BokaMera.API.Host

<back to all web services

UpdateStripeWebhookEvents

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, bookingsupplier-administrator-read, superadmin
The following routes are available for this service:
PUT/payment/stripe/v1/webhookeventUpdate stripe webhook eventsUpdate stripe webhook events
import 'package:servicestack/servicestack.dart';

class StripeWebhookResponse implements IConvertible
{
    String? Id;
    List<String>? Events;
    String? Url;

    StripeWebhookResponse({this.Id,this.Events,this.Url});
    StripeWebhookResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class StripeWebhooksResponse implements IConvertible
{
    List<StripeWebhookResponse>? StripeWebhooks;

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

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

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

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

// @ValidateRequest(Validator="IsAuthenticated")
class UpdateStripeWebhookEvents implements ICompany, IConvertible
{
    /**
    * The company id, if empty will use the company id for the user you are logged in with.
    */
    // @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
    String? CompanyId;

    /**
    * Events (webhooks) that are accepted by stripe.
    */
    // @ApiMember(Description="Events (webhooks) that are accepted by stripe.")
    List<String>? Events;

    /**
    * Webhook Id to update events
    */
    // @ApiMember(Description="Webhook Id to update events")
    String? WebhookId;

    UpdateStripeWebhookEvents({this.CompanyId,this.Events,this.WebhookId});
    UpdateStripeWebhookEvents.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

TypeContext _ctx = TypeContext(library: 'testapi.bokamera.se', types: <String, TypeInfo> {
    'StripeWebhookResponse': TypeInfo(TypeOf.Class, create:() => StripeWebhookResponse()),
    'StripeWebhooksResponse': TypeInfo(TypeOf.Class, create:() => StripeWebhooksResponse()),
    'List<StripeWebhookResponse>': TypeInfo(TypeOf.Class, create:() => <StripeWebhookResponse>[]),
    'UpdateStripeWebhookEvents': TypeInfo(TypeOf.Class, create:() => UpdateStripeWebhookEvents()),
});

Dart UpdateStripeWebhookEvents DTOs

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

HTTP + JSV

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

PUT /payment/stripe/v1/webhookevent HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	CompanyId: 00000000-0000-0000-0000-000000000000,
	Events: 
	[
		String
	],
	WebhookId: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	StripeWebhooks: 
	[
		{
			Id: String,
			Events: 
			[
				String
			],
			Url: String
		}
	]
}