BokaMera.API.Host

<back to all web services

WebhookCreateAgreement

The following routes are available for this service:
POST/webhooks/termsWebhook from prismic
import 'package:servicestack/servicestack.dart';

class WebhookAgreements implements IConvertible
{
    String? id;
    String? label;
    List<String>? documents;

    WebhookAgreements({this.id,this.label,this.documents});
    WebhookAgreements.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class Releases implements IConvertible
{
    List<WebhookAgreements>? deletion;

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

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

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

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

// @ApiResponse(Description="Returned if there is a validation error on the input parameters", StatusCode=400)
// @ApiResponse(Description="Returned if the current user is not allowed to perform the action", StatusCode=401)
class WebhookCreateAgreement implements IConvertible
{
    Releases? releases;
    List<String>? documents;
    String? secret;

    WebhookCreateAgreement({this.releases,this.documents,this.secret});
    WebhookCreateAgreement.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'releases': JsonConverters.toJson(releases,'Releases',context!),
        'documents': JsonConverters.toJson(documents,'List<String>',context!),
        'secret': secret
    };

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

TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
    'WebhookAgreements': TypeInfo(TypeOf.Class, create:() => WebhookAgreements()),
    'Releases': TypeInfo(TypeOf.Class, create:() => Releases()),
    'List<WebhookAgreements>': TypeInfo(TypeOf.Class, create:() => <WebhookAgreements>[]),
    'WebhookCreateAgreement': TypeInfo(TypeOf.Class, create:() => WebhookCreateAgreement()),
});

Dart WebhookCreateAgreement DTOs

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

HTTP + XML

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

POST /webhooks/terms HTTP/1.1 
Host: api.bokamera.se 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<WebhookCreateAgreement xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <documents xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>String</d2p1:string>
  </documents>
  <releases>
    <deletion>
      <WebhookAgreements>
        <documents xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:string>String</d5p1:string>
        </documents>
        <id>String</id>
        <label>String</label>
      </WebhookAgreements>
    </deletion>
  </releases>
  <secret>String</secret>
</WebhookCreateAgreement>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<z:anyType xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />