diff --git a/api/tangled/webhookcreateWebhook.go b/api/tangled/webhookcreateWebhook.go new file mode 100644 index 00000000..134d79d6 --- /dev/null +++ b/api/tangled/webhookcreateWebhook.go @@ -0,0 +1,45 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: org.tangled.temp.webhook.createWebhook + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempWebhookCreateWebhookNSID = "org.tangled.temp.webhook.createWebhook" +) + +// TempWebhookCreateWebhook_Input is the input argument to a org.tangled.temp.webhook.createWebhook call. +type TempWebhookCreateWebhook_Input struct { + // active: Whether the webhook should be active immediately. Defaults to true. + Active *bool `json:"active,omitempty" cborgen:"active,omitempty"` + // events: Event types to subscribe to (e.g. 'push', 'repository:renamed'). + Events []string `json:"events" cborgen:"events"` + // repoDid: DID of the repository as minted by the knot. + RepoDid string `json:"repoDid" cborgen:"repoDid"` + // secret: Optional HMAC secret used to sign payloads. If omitted, payloads are not signed. + Secret *string `json:"secret,omitempty" cborgen:"secret,omitempty"` + // url: Endpoint URL that will receive webhook payloads. + Url string `json:"url" cborgen:"url"` +} + +// TempWebhookCreateWebhook_Output is the output of a org.tangled.temp.webhook.createWebhook call. +type TempWebhookCreateWebhook_Output struct { + // id: ID of the newly created webhook. + Id int64 `json:"id" cborgen:"id"` +} + +// TempWebhookCreateWebhook calls the XRPC method "org.tangled.temp.webhook.createWebhook". +func TempWebhookCreateWebhook(ctx context.Context, c util.LexClient, input *TempWebhookCreateWebhook_Input) (*TempWebhookCreateWebhook_Output, error) { + var out TempWebhookCreateWebhook_Output + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.webhook.createWebhook", nil, input, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/webhookdeleteWebhook.go b/api/tangled/webhookdeleteWebhook.go new file mode 100644 index 00000000..b1373a3f --- /dev/null +++ b/api/tangled/webhookdeleteWebhook.go @@ -0,0 +1,32 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: org.tangled.temp.webhook.deleteWebhook + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempWebhookDeleteWebhookNSID = "org.tangled.temp.webhook.deleteWebhook" +) + +// TempWebhookDeleteWebhook_Input is the input argument to a org.tangled.temp.webhook.deleteWebhook call. +type TempWebhookDeleteWebhook_Input struct { + // id: Webhook ID to delete. + Id int64 `json:"id" cborgen:"id"` + // repoDid: DID of the repository as minted by the knot. + RepoDid string `json:"repoDid" cborgen:"repoDid"` +} + +// TempWebhookDeleteWebhook calls the XRPC method "org.tangled.temp.webhook.deleteWebhook". +func TempWebhookDeleteWebhook(ctx context.Context, c util.LexClient, input *TempWebhookDeleteWebhook_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.webhook.deleteWebhook", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/tangled/webhookgetDeliveriesForWebhooks.go b/api/tangled/webhookgetDeliveriesForWebhooks.go new file mode 100644 index 00000000..e99c5aef --- /dev/null +++ b/api/tangled/webhookgetDeliveriesForWebhooks.go @@ -0,0 +1,55 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: org.tangled.temp.webhook.getDeliveriesForWebhooks + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempWebhookGetDeliveriesForWebhooksNSID = "org.tangled.temp.webhook.getDeliveriesForWebhooks" +) + +// TempWebhookGetDeliveriesForWebhooks_Delivery is a "delivery" in the org.tangled.temp.webhook.getDeliveriesForWebhooks schema. +type TempWebhookGetDeliveriesForWebhooks_Delivery struct { + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + // deliveryId: UUID for tracking this delivery attempt. + DeliveryId string `json:"deliveryId" cborgen:"deliveryId"` + // event: Event type that triggered the delivery. + Event string `json:"event" cborgen:"event"` + Id int64 `json:"id" cborgen:"id"` + RequestBody *string `json:"requestBody,omitempty" cborgen:"requestBody,omitempty"` + ResponseBody *string `json:"responseBody,omitempty" cborgen:"responseBody,omitempty"` + ResponseCode *int64 `json:"responseCode,omitempty" cborgen:"responseCode,omitempty"` + Success bool `json:"success" cborgen:"success"` + Url string `json:"url" cborgen:"url"` + WebhookId int64 `json:"webhookId" cborgen:"webhookId"` +} + +// TempWebhookGetDeliveriesForWebhooks_Output is the output of a org.tangled.temp.webhook.getDeliveriesForWebhooks call. +type TempWebhookGetDeliveriesForWebhooks_Output struct { + Deliveries []*TempWebhookGetDeliveriesForWebhooks_Delivery `json:"deliveries" cborgen:"deliveries"` +} + +// TempWebhookGetDeliveriesForWebhooks calls the XRPC method "org.tangled.temp.webhook.getDeliveriesForWebhooks". +// +// repoDid: DID of the repository as minted by the knot. +func TempWebhookGetDeliveriesForWebhooks(ctx context.Context, c util.LexClient, ids []int64, limit int64, repoDid string) (*TempWebhookGetDeliveriesForWebhooks_Output, error) { + var out TempWebhookGetDeliveriesForWebhooks_Output + + params := map[string]interface{}{} + params["ids"] = ids + if limit != 0 { + params["limit"] = limit + } + params["repoDid"] = repoDid + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.webhook.getDeliveriesForWebhooks", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/webhooklistWebhooks.go b/api/tangled/webhooklistWebhooks.go new file mode 100644 index 00000000..bd67af94 --- /dev/null +++ b/api/tangled/webhooklistWebhooks.go @@ -0,0 +1,49 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: org.tangled.temp.webhook.listWebhooks + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempWebhookListWebhooksNSID = "org.tangled.temp.webhook.listWebhooks" +) + +// TempWebhookListWebhooks_Output is the output of a org.tangled.temp.webhook.listWebhooks call. +type TempWebhookListWebhooks_Output struct { + Webhooks []*TempWebhookListWebhooks_Webhook `json:"webhooks" cborgen:"webhooks"` +} + +// TempWebhookListWebhooks_Webhook is a "webhook" in the org.tangled.temp.webhook.listWebhooks schema. +type TempWebhookListWebhooks_Webhook struct { + // active: Whether the webhook is currently enabled. + Active bool `json:"active" cborgen:"active"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + // events: Event types this webhook is subscribed to (e.g. 'push', 'repository:renamed'). + Events []string `json:"events" cborgen:"events"` + // id: Webhook identifier. + Id int64 `json:"id" cborgen:"id"` + UpdatedAt *string `json:"updatedAt,omitempty" cborgen:"updatedAt,omitempty"` + // url: Endpoint URL that receives webhook payloads. + Url string `json:"url" cborgen:"url"` +} + +// TempWebhookListWebhooks calls the XRPC method "org.tangled.temp.webhook.listWebhooks". +// +// repoDid: DID of the repository as minted by the knot. +func TempWebhookListWebhooks(ctx context.Context, c util.LexClient, repoDid string) (*TempWebhookListWebhooks_Output, error) { + var out TempWebhookListWebhooks_Output + + params := map[string]interface{}{} + params["repoDid"] = repoDid + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.webhook.listWebhooks", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/webhookretryDelivery.go b/api/tangled/webhookretryDelivery.go new file mode 100644 index 00000000..b45b6d55 --- /dev/null +++ b/api/tangled/webhookretryDelivery.go @@ -0,0 +1,34 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: org.tangled.temp.webhook.retryDelivery + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempWebhookRetryDeliveryNSID = "org.tangled.temp.webhook.retryDelivery" +) + +// TempWebhookRetryDelivery_Input is the input argument to a org.tangled.temp.webhook.retryDelivery call. +type TempWebhookRetryDelivery_Input struct { + // deliveryId: UUID of the delivery to retry. + DeliveryId string `json:"deliveryId" cborgen:"deliveryId"` + // repoDid: DID of the repository as minted by the knot. + RepoDid string `json:"repoDid" cborgen:"repoDid"` + // webhookId: Webhook ID that owns the delivery. + WebhookId int64 `json:"webhookId" cborgen:"webhookId"` +} + +// TempWebhookRetryDelivery calls the XRPC method "org.tangled.temp.webhook.retryDelivery". +func TempWebhookRetryDelivery(ctx context.Context, c util.LexClient, input *TempWebhookRetryDelivery_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.webhook.retryDelivery", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/tangled/webhooktoggleWebhook.go b/api/tangled/webhooktoggleWebhook.go new file mode 100644 index 00000000..585e517a --- /dev/null +++ b/api/tangled/webhooktoggleWebhook.go @@ -0,0 +1,39 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: org.tangled.temp.webhook.toggleWebhook + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempWebhookToggleWebhookNSID = "org.tangled.temp.webhook.toggleWebhook" +) + +// TempWebhookToggleWebhook_Input is the input argument to a org.tangled.temp.webhook.toggleWebhook call. +type TempWebhookToggleWebhook_Input struct { + // id: Webhook ID to toggle. + Id int64 `json:"id" cborgen:"id"` + // repoDid: DID of the repository as minted by the knot. + RepoDid string `json:"repoDid" cborgen:"repoDid"` +} + +// TempWebhookToggleWebhook_Output is the output of a org.tangled.temp.webhook.toggleWebhook call. +type TempWebhookToggleWebhook_Output struct { + // active: New active state of the webhook. + Active bool `json:"active" cborgen:"active"` +} + +// TempWebhookToggleWebhook calls the XRPC method "org.tangled.temp.webhook.toggleWebhook". +func TempWebhookToggleWebhook(ctx context.Context, c util.LexClient, input *TempWebhookToggleWebhook_Input) (*TempWebhookToggleWebhook_Output, error) { + var out TempWebhookToggleWebhook_Output + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.webhook.toggleWebhook", nil, input, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/webhookupdateWebhook.go b/api/tangled/webhookupdateWebhook.go new file mode 100644 index 00000000..a2b9bd0f --- /dev/null +++ b/api/tangled/webhookupdateWebhook.go @@ -0,0 +1,36 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: org.tangled.temp.webhook.updateWebhook + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempWebhookUpdateWebhookNSID = "org.tangled.temp.webhook.updateWebhook" +) + +// TempWebhookUpdateWebhook_Input is the input argument to a org.tangled.temp.webhook.updateWebhook call. +type TempWebhookUpdateWebhook_Input struct { + Active *bool `json:"active,omitempty" cborgen:"active,omitempty"` + Events []string `json:"events,omitempty" cborgen:"events,omitempty"` + // id: Webhook ID to update. + Id int64 `json:"id" cborgen:"id"` + // repoDid: DID of the repository as minted by the knot. + RepoDid string `json:"repoDid" cborgen:"repoDid"` + Secret *string `json:"secret,omitempty" cborgen:"secret,omitempty"` + Url *string `json:"url,omitempty" cborgen:"url,omitempty"` +} + +// TempWebhookUpdateWebhook calls the XRPC method "org.tangled.temp.webhook.updateWebhook". +func TempWebhookUpdateWebhook(ctx context.Context, c util.LexClient, input *TempWebhookUpdateWebhook_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.webhook.updateWebhook", nil, input, nil); err != nil { + return err + } + + return nil +}