POST | /async/webhooks/subscriptions/delete |
---|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using PwC.Elmaas.Core.Services.Contracts.Webhooks.Requests;
using ServiceStack.Webhooks.ServiceModel.Types;
namespace PwC.Elmaas.Core.Services.Contracts.Webhooks.Requests
{
///<summary>
///Represents a request to delete webhook subscriptions in an asynchronous operation.
///</summary>
[Api(Description="Represents a request to delete webhook subscriptions in an asynchronous operation.")]
public partial class BatchDeleteWebhookSubscriptionsAsync
: BatchDeleteWebhookSubscriptionsBase
{
}
///<summary>
///Specifies a request to delete webhook subscriptions.
///</summary>
[Api(Description="Specifies a request to delete webhook subscriptions.")]
public partial class BatchDeleteWebhookSubscriptionsBase
: IPost
{
public BatchDeleteWebhookSubscriptionsBase()
{
Subscriptions = new List<WebhookSubscription>{};
}
///<summary>
///The subscriptions to delete.
///</summary>
[ApiMember(Description="The subscriptions to delete.", IsRequired=true, Name="Subscriptions")]
public virtual List<WebhookSubscription> Subscriptions { get; set; }
}
}
namespace ServiceStack.Webhooks.ServiceModel.Types
{
public partial class SubscriptionConfig
{
public virtual string Url { get; set; }
public virtual string ContentType { get; set; }
public virtual string Secret { get; set; }
}
public partial class WebhookSubscription
{
public virtual string Id { get; set; }
public virtual string Name { get; set; }
public virtual string Event { get; set; }
public virtual bool IsActive { get; set; }
public virtual DateTime CreatedDateUtc { get; set; }
public virtual string CreatedById { get; set; }
public virtual DateTime LastModifiedDateUtc { get; set; }
public virtual SubscriptionConfig Config { get; set; }
}
}
C# BatchDeleteWebhookSubscriptionsAsync DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /async/webhooks/subscriptions/delete HTTP/1.1
Host: reportfiling.staging.pwc.de
Accept: application/json
Content-Type: application/json
Content-Length: length
{"subscriptions":[{"id":"String","name":"String","event":"String","isActive":false,"createdDateUtc":"\/Date(-62135596800000-0000)\/","createdById":"String","lastModifiedDateUtc":"\/Date(-62135596800000-0000)\/","config":{"url":"String","contentType":"String","secret":"String"}}]}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length [{"subscription":{"id":"String","name":"String","event":"String","isActive":false,"createdDateUtc":"\/Date(-62135596800000-0000)\/","createdById":"String","lastModifiedDateUtc":"\/Date(-62135596800000-0000)\/","config":{"url":"String","contentType":"String","secret":"String"}},"history":[{"attemptedDateUtc":"\/Date(-62135596800000-0000)\/","statusDescription":"String","statusCode":"Continue","subscriptionId":"String","id":"String","eventId":"String"}],"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}]