Report Filing Service

<back to all web services

BatchDeleteWebhookSubscriptions

DeleteBatchSubscriptionsWebhooksSync

Represents a request to delete webhook subscriptions.

Requires Authentication
The following routes are available for this service:
POST/sync/webhooks/subscriptions/delete
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class SubscriptionConfig implements IConvertible
{
    String? url;
    String? contentType;
    String? secret;

    SubscriptionConfig({this.url,this.contentType,this.secret});
    SubscriptionConfig.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        url = json['url'];
        contentType = json['contentType'];
        secret = json['secret'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'url': url,
        'contentType': contentType,
        'secret': secret
    };

    getTypeName() => "SubscriptionConfig";
    TypeContext? context = _ctx;
}

class WebhookSubscription implements IConvertible
{
    String? id;
    String? name;
    String? event;
    bool? isActive;
    DateTime? createdDateUtc;
    String? createdById;
    DateTime? lastModifiedDateUtc;
    SubscriptionConfig? config;

    WebhookSubscription({this.id,this.name,this.event,this.isActive,this.createdDateUtc,this.createdById,this.lastModifiedDateUtc,this.config});
    WebhookSubscription.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        name = json['name'];
        event = json['event'];
        isActive = json['isActive'];
        createdDateUtc = JsonConverters.fromJson(json['createdDateUtc'],'DateTime',context!);
        createdById = json['createdById'];
        lastModifiedDateUtc = JsonConverters.fromJson(json['lastModifiedDateUtc'],'DateTime',context!);
        config = JsonConverters.fromJson(json['config'],'SubscriptionConfig',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'name': name,
        'event': event,
        'isActive': isActive,
        'createdDateUtc': JsonConverters.toJson(createdDateUtc,'DateTime',context!),
        'createdById': createdById,
        'lastModifiedDateUtc': JsonConverters.toJson(lastModifiedDateUtc,'DateTime',context!),
        'config': JsonConverters.toJson(config,'SubscriptionConfig',context!)
    };

    getTypeName() => "WebhookSubscription";
    TypeContext? context = _ctx;
}

/**
* Specifies a request to delete webhook subscriptions.
*/
// @Api(Description="Specifies a request to delete webhook subscriptions.")
abstract class BatchDeleteWebhookSubscriptionsBase implements IPost
{
    /**
    * The subscriptions to delete.
    */
    // @ApiMember(Description="The subscriptions to delete.", IsRequired=true, Name="Subscriptions")
    List<WebhookSubscription>? subscriptions;

    BatchDeleteWebhookSubscriptionsBase({this.subscriptions});
    BatchDeleteWebhookSubscriptionsBase.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        subscriptions = JsonConverters.fromJson(json['subscriptions'],'List<WebhookSubscription>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'subscriptions': JsonConverters.toJson(subscriptions,'List<WebhookSubscription>',context!)
    };

    getTypeName() => "BatchDeleteWebhookSubscriptionsBase";
    TypeContext? context = _ctx;
}

/**
* Represents a request to delete webhook subscriptions.
*/
// @Api(Description="Represents a request to delete webhook subscriptions.")
class BatchDeleteWebhookSubscriptions extends BatchDeleteWebhookSubscriptionsBase implements IConvertible
{
    BatchDeleteWebhookSubscriptions();
    BatchDeleteWebhookSubscriptions.fromJson(Map<String, dynamic> json) : super.fromJson(json);
    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson();
    getTypeName() => "BatchDeleteWebhookSubscriptions";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'reportfiling.staging.pwc.de', types: <String, TypeInfo> {
    'SubscriptionConfig': TypeInfo(TypeOf.Class, create:() => SubscriptionConfig()),
    'WebhookSubscription': TypeInfo(TypeOf.Class, create:() => WebhookSubscription()),
    'BatchDeleteWebhookSubscriptionsBase': TypeInfo(TypeOf.AbstractClass),
    'List<WebhookSubscription>': TypeInfo(TypeOf.Class, create:() => <WebhookSubscription>[]),
    'BatchDeleteWebhookSubscriptions': TypeInfo(TypeOf.Class, create:() => BatchDeleteWebhookSubscriptions()),
});

Dart BatchDeleteWebhookSubscriptions DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /sync/webhooks/subscriptions/delete HTTP/1.1 
Host: reportfiling.staging.pwc.de 
Accept: text/csv
Content-Type: text/csv
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: text/csv
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"}}}]