From 4d3fea1e3c0cd0163e63395f1821a34b641acfda Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Tue, 5 Nov 2024 15:10:10 +0100 Subject: [PATCH] Update OpenAPI spec --- go/internal/openapi/api_endpoint.go | 6 +- go/internal/openapi/api_message_attempt.go | 10 +- go/internal/openapi/api_webhook_endpoint.go | 1365 +++++++++++ go/internal/openapi/client.go | 3 + go/internal/openapi/model_big_query_config.go | 243 ++ go/internal/openapi/model_create_stream_in.go | 36 + .../openapi/model_event_type_from_open_api.go | 93 + ...ponse_operational_webhook_endpoint_out_.go | 278 +++ .../model_operational_webhook_endpoint_in.go | 451 ++++ .../model_operational_webhook_endpoint_out.go | 471 ++++ ..._operational_webhook_endpoint_secret_in.go | 137 ++ ...operational_webhook_endpoint_secret_out.go | 159 ++ ...del_operational_webhook_endpoint_update.go | 404 ++++ go/internal/openapi/model_stream_sink_in.go | 34 + .../openapi/model_stream_sink_in_one_of_7.go | 186 ++ go/internal/openapi/model_stream_sink_out.go | 34 + .../openapi/model_stream_sink_patch.go | 34 + openapi.json | 2133 ++++++++++++----- 18 files changed, 5452 insertions(+), 625 deletions(-) create mode 100644 go/internal/openapi/api_webhook_endpoint.go create mode 100644 go/internal/openapi/model_big_query_config.go create mode 100644 go/internal/openapi/model_list_response_operational_webhook_endpoint_out_.go create mode 100644 go/internal/openapi/model_operational_webhook_endpoint_in.go create mode 100644 go/internal/openapi/model_operational_webhook_endpoint_out.go create mode 100644 go/internal/openapi/model_operational_webhook_endpoint_secret_in.go create mode 100644 go/internal/openapi/model_operational_webhook_endpoint_secret_out.go create mode 100644 go/internal/openapi/model_operational_webhook_endpoint_update.go create mode 100644 go/internal/openapi/model_stream_sink_in_one_of_7.go diff --git a/go/internal/openapi/api_endpoint.go b/go/internal/openapi/api_endpoint.go index ba759436e..e634c2495 100644 --- a/go/internal/openapi/api_endpoint.go +++ b/go/internal/openapi/api_endpoint.go @@ -2232,6 +2232,8 @@ V1EndpointRecover Recover Failed Webhooks Resend all failed messages since a given time. +Messages that were sent successfully, even if failed initially, are not resent. + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param appId The app's ID or UID @param endpointId The ep's ID or UID @@ -2662,7 +2664,9 @@ func (r ApiV1EndpointRotateSecretRequest) Execute() (*http.Response, error) { /* V1EndpointRotateSecret Rotate Endpoint Secret -Rotates the endpoint's signing secret. The previous secret will be valid for the next 24 hours. +Rotates the endpoint's signing secret. + +The previous secret will remain valid for the next 24 hours. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param appId The app's ID or UID diff --git a/go/internal/openapi/api_message_attempt.go b/go/internal/openapi/api_message_attempt.go index c855553ca..084595f65 100644 --- a/go/internal/openapi/api_message_attempt.go +++ b/go/internal/openapi/api_message_attempt.go @@ -867,7 +867,7 @@ func (r ApiV1MessageAttemptListAttemptedMessagesRequest) Tag(tag string) ApiV1Me return r } -// Filter response based on the delivery status +// Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) func (r ApiV1MessageAttemptListAttemptedMessagesRequest) Status(status MessageStatus) ApiV1MessageAttemptListAttemptedMessagesRequest { r.status = &status return r @@ -1161,7 +1161,7 @@ func (r ApiV1MessageAttemptListByEndpointRequest) Iterator(iterator string) ApiV return r } -// Filter response based on the delivery status +// Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) func (r ApiV1MessageAttemptListByEndpointRequest) Status(status MessageStatus) ApiV1MessageAttemptListByEndpointRequest { r.status = &status return r @@ -1496,7 +1496,7 @@ func (r ApiV1MessageAttemptListByEndpointDeprecatedRequest) Tag(tag string) ApiV return r } -// Filter response based on the delivery status +// Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) func (r ApiV1MessageAttemptListByEndpointDeprecatedRequest) Status(status MessageStatus) ApiV1MessageAttemptListByEndpointDeprecatedRequest { r.status = &status return r @@ -1794,7 +1794,7 @@ func (r ApiV1MessageAttemptListByMsgRequest) Iterator(iterator string) ApiV1Mess return r } -// Filter response based on the delivery status +// Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) func (r ApiV1MessageAttemptListByMsgRequest) Status(status MessageStatus) ApiV1MessageAttemptListByMsgRequest { r.status = &status return r @@ -2133,7 +2133,7 @@ func (r ApiV1MessageAttemptListByMsgDeprecatedRequest) Tag(tag string) ApiV1Mess return r } -// Filter response based on the delivery status +// Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) func (r ApiV1MessageAttemptListByMsgDeprecatedRequest) Status(status MessageStatus) ApiV1MessageAttemptListByMsgDeprecatedRequest { r.status = &status return r diff --git a/go/internal/openapi/api_webhook_endpoint.go b/go/internal/openapi/api_webhook_endpoint.go new file mode 100644 index 000000000..442ff3e6d --- /dev/null +++ b/go/internal/openapi/api_webhook_endpoint.go @@ -0,0 +1,1365 @@ +/* +Svix API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// WebhookEndpointAPIService WebhookEndpointAPI service +type WebhookEndpointAPIService service + +type ApiCreateOperationalWebhookEndpointRequest struct { + ctx context.Context + ApiService *WebhookEndpointAPIService + operationalWebhookEndpointIn *OperationalWebhookEndpointIn + idempotencyKey *string +} + +func (r ApiCreateOperationalWebhookEndpointRequest) OperationalWebhookEndpointIn(operationalWebhookEndpointIn OperationalWebhookEndpointIn) ApiCreateOperationalWebhookEndpointRequest { + r.operationalWebhookEndpointIn = &operationalWebhookEndpointIn + return r +} + +// The request's idempotency key +func (r ApiCreateOperationalWebhookEndpointRequest) IdempotencyKey(idempotencyKey string) ApiCreateOperationalWebhookEndpointRequest { + r.idempotencyKey = &idempotencyKey + return r +} + +func (r ApiCreateOperationalWebhookEndpointRequest) Execute() (*OperationalWebhookEndpointOut, *http.Response, error) { + return r.ApiService.CreateOperationalWebhookEndpointExecute(r) +} + +/* +CreateOperationalWebhookEndpoint Create Operational Webhook Endpoint + +Create an operational webhook endpoint. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateOperationalWebhookEndpointRequest +*/ +func (a *WebhookEndpointAPIService) CreateOperationalWebhookEndpoint(ctx context.Context) ApiCreateOperationalWebhookEndpointRequest { + return ApiCreateOperationalWebhookEndpointRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return OperationalWebhookEndpointOut +func (a *WebhookEndpointAPIService) CreateOperationalWebhookEndpointExecute(r ApiCreateOperationalWebhookEndpointRequest) (*OperationalWebhookEndpointOut, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OperationalWebhookEndpointOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhookEndpointAPIService.CreateOperationalWebhookEndpoint") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/operational-webhook/endpoint" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.operationalWebhookEndpointIn == nil { + return localVarReturnValue, nil, reportError("operationalWebhookEndpointIn is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.idempotencyKey != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "simple", "") + } + // body params + localVarPostBody = r.operationalWebhookEndpointIn + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v HTTPValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteOperationalWebhookEndpointRequest struct { + ctx context.Context + ApiService *WebhookEndpointAPIService + endpointId string +} + +func (r ApiDeleteOperationalWebhookEndpointRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteOperationalWebhookEndpointExecute(r) +} + +/* +DeleteOperationalWebhookEndpoint Delete Operational Webhook Endpoint + +Delete an operational webhook endpoint. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param endpointId The ep's ID or UID + @return ApiDeleteOperationalWebhookEndpointRequest +*/ +func (a *WebhookEndpointAPIService) DeleteOperationalWebhookEndpoint(ctx context.Context, endpointId string) ApiDeleteOperationalWebhookEndpointRequest { + return ApiDeleteOperationalWebhookEndpointRequest{ + ApiService: a, + ctx: ctx, + endpointId: endpointId, + } +} + +// Execute executes the request +func (a *WebhookEndpointAPIService) DeleteOperationalWebhookEndpointExecute(r ApiDeleteOperationalWebhookEndpointRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhookEndpointAPIService.DeleteOperationalWebhookEndpoint") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/operational-webhook/endpoint/{endpoint_id}" + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.endpointId) < 1 { + return nil, reportError("endpointId must have at least 1 elements") + } + if strlen(r.endpointId) > 256 { + return nil, reportError("endpointId must have less than 256 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v HTTPValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetOperationalWebhookEndpointRequest struct { + ctx context.Context + ApiService *WebhookEndpointAPIService + endpointId string +} + +func (r ApiGetOperationalWebhookEndpointRequest) Execute() (*OperationalWebhookEndpointOut, *http.Response, error) { + return r.ApiService.GetOperationalWebhookEndpointExecute(r) +} + +/* +GetOperationalWebhookEndpoint Get Operational Webhook Endpoint + +Get an operational webhook endpoint. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param endpointId The ep's ID or UID + @return ApiGetOperationalWebhookEndpointRequest +*/ +func (a *WebhookEndpointAPIService) GetOperationalWebhookEndpoint(ctx context.Context, endpointId string) ApiGetOperationalWebhookEndpointRequest { + return ApiGetOperationalWebhookEndpointRequest{ + ApiService: a, + ctx: ctx, + endpointId: endpointId, + } +} + +// Execute executes the request +// @return OperationalWebhookEndpointOut +func (a *WebhookEndpointAPIService) GetOperationalWebhookEndpointExecute(r ApiGetOperationalWebhookEndpointRequest) (*OperationalWebhookEndpointOut, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OperationalWebhookEndpointOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhookEndpointAPIService.GetOperationalWebhookEndpoint") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/operational-webhook/endpoint/{endpoint_id}" + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.endpointId) < 1 { + return localVarReturnValue, nil, reportError("endpointId must have at least 1 elements") + } + if strlen(r.endpointId) > 256 { + return localVarReturnValue, nil, reportError("endpointId must have less than 256 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v HTTPValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetOperationalWebhookEndpointSecretRequest struct { + ctx context.Context + ApiService *WebhookEndpointAPIService + endpointId string +} + +func (r ApiGetOperationalWebhookEndpointSecretRequest) Execute() (*OperationalWebhookEndpointSecretOut, *http.Response, error) { + return r.ApiService.GetOperationalWebhookEndpointSecretExecute(r) +} + +/* +GetOperationalWebhookEndpointSecret Get Operational Webhook Endpoint Secret + +Get an operational webhook endpoint's signing secret. + +This is used to verify the authenticity of the webhook. +For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/). + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param endpointId The ep's ID or UID + @return ApiGetOperationalWebhookEndpointSecretRequest +*/ +func (a *WebhookEndpointAPIService) GetOperationalWebhookEndpointSecret(ctx context.Context, endpointId string) ApiGetOperationalWebhookEndpointSecretRequest { + return ApiGetOperationalWebhookEndpointSecretRequest{ + ApiService: a, + ctx: ctx, + endpointId: endpointId, + } +} + +// Execute executes the request +// @return OperationalWebhookEndpointSecretOut +func (a *WebhookEndpointAPIService) GetOperationalWebhookEndpointSecretExecute(r ApiGetOperationalWebhookEndpointSecretRequest) (*OperationalWebhookEndpointSecretOut, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OperationalWebhookEndpointSecretOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhookEndpointAPIService.GetOperationalWebhookEndpointSecret") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/operational-webhook/endpoint/{endpoint_id}/secret" + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.endpointId) < 1 { + return localVarReturnValue, nil, reportError("endpointId must have at least 1 elements") + } + if strlen(r.endpointId) > 256 { + return localVarReturnValue, nil, reportError("endpointId must have less than 256 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v HTTPValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListOperationalWebhookEndpointsRequest struct { + ctx context.Context + ApiService *WebhookEndpointAPIService + limit *int32 + iterator *string + order *Ordering +} + +// Limit the number of returned items +func (r ApiListOperationalWebhookEndpointsRequest) Limit(limit int32) ApiListOperationalWebhookEndpointsRequest { + r.limit = &limit + return r +} + +// The iterator returned from a prior invocation +func (r ApiListOperationalWebhookEndpointsRequest) Iterator(iterator string) ApiListOperationalWebhookEndpointsRequest { + r.iterator = &iterator + return r +} + +// The sorting order of the returned items +func (r ApiListOperationalWebhookEndpointsRequest) Order(order Ordering) ApiListOperationalWebhookEndpointsRequest { + r.order = &order + return r +} + +func (r ApiListOperationalWebhookEndpointsRequest) Execute() (*ListResponseOperationalWebhookEndpointOut, *http.Response, error) { + return r.ApiService.ListOperationalWebhookEndpointsExecute(r) +} + +/* +ListOperationalWebhookEndpoints List Operational Webhook Endpoints + +List operational webhook endpoints. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListOperationalWebhookEndpointsRequest +*/ +func (a *WebhookEndpointAPIService) ListOperationalWebhookEndpoints(ctx context.Context) ApiListOperationalWebhookEndpointsRequest { + return ApiListOperationalWebhookEndpointsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ListResponseOperationalWebhookEndpointOut +func (a *WebhookEndpointAPIService) ListOperationalWebhookEndpointsExecute(r ApiListOperationalWebhookEndpointsRequest) (*ListResponseOperationalWebhookEndpointOut, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListResponseOperationalWebhookEndpointOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhookEndpointAPIService.ListOperationalWebhookEndpoints") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/operational-webhook/endpoint" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.iterator != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "iterator", r.iterator, "form", "") + } + if r.order != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "order", r.order, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v HTTPValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRotateOperationalWebhookEndpointSecretRequest struct { + ctx context.Context + ApiService *WebhookEndpointAPIService + endpointId string + operationalWebhookEndpointSecretIn *OperationalWebhookEndpointSecretIn + idempotencyKey *string +} + +func (r ApiRotateOperationalWebhookEndpointSecretRequest) OperationalWebhookEndpointSecretIn(operationalWebhookEndpointSecretIn OperationalWebhookEndpointSecretIn) ApiRotateOperationalWebhookEndpointSecretRequest { + r.operationalWebhookEndpointSecretIn = &operationalWebhookEndpointSecretIn + return r +} + +// The request's idempotency key +func (r ApiRotateOperationalWebhookEndpointSecretRequest) IdempotencyKey(idempotencyKey string) ApiRotateOperationalWebhookEndpointSecretRequest { + r.idempotencyKey = &idempotencyKey + return r +} + +func (r ApiRotateOperationalWebhookEndpointSecretRequest) Execute() (*http.Response, error) { + return r.ApiService.RotateOperationalWebhookEndpointSecretExecute(r) +} + +/* +RotateOperationalWebhookEndpointSecret Rotate Operational Webhook Endpoint Secret + +Rotates an operational webhook endpoint's signing secret. + +The previous secret will remain valid for the next 24 hours. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param endpointId The ep's ID or UID + @return ApiRotateOperationalWebhookEndpointSecretRequest +*/ +func (a *WebhookEndpointAPIService) RotateOperationalWebhookEndpointSecret(ctx context.Context, endpointId string) ApiRotateOperationalWebhookEndpointSecretRequest { + return ApiRotateOperationalWebhookEndpointSecretRequest{ + ApiService: a, + ctx: ctx, + endpointId: endpointId, + } +} + +// Execute executes the request +func (a *WebhookEndpointAPIService) RotateOperationalWebhookEndpointSecretExecute(r ApiRotateOperationalWebhookEndpointSecretRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhookEndpointAPIService.RotateOperationalWebhookEndpointSecret") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/operational-webhook/endpoint/{endpoint_id}/secret/rotate" + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.endpointId) < 1 { + return nil, reportError("endpointId must have at least 1 elements") + } + if strlen(r.endpointId) > 256 { + return nil, reportError("endpointId must have less than 256 elements") + } + if r.operationalWebhookEndpointSecretIn == nil { + return nil, reportError("operationalWebhookEndpointSecretIn is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.idempotencyKey != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "simple", "") + } + // body params + localVarPostBody = r.operationalWebhookEndpointSecretIn + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v HTTPValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiUpdateOperationalWebhookEndpointRequest struct { + ctx context.Context + ApiService *WebhookEndpointAPIService + endpointId string + operationalWebhookEndpointUpdate *OperationalWebhookEndpointUpdate +} + +func (r ApiUpdateOperationalWebhookEndpointRequest) OperationalWebhookEndpointUpdate(operationalWebhookEndpointUpdate OperationalWebhookEndpointUpdate) ApiUpdateOperationalWebhookEndpointRequest { + r.operationalWebhookEndpointUpdate = &operationalWebhookEndpointUpdate + return r +} + +func (r ApiUpdateOperationalWebhookEndpointRequest) Execute() (*OperationalWebhookEndpointOut, *http.Response, error) { + return r.ApiService.UpdateOperationalWebhookEndpointExecute(r) +} + +/* +UpdateOperationalWebhookEndpoint Update Operational Webhook Endpoint + +Update an operational webhook endpoint. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param endpointId The ep's ID or UID + @return ApiUpdateOperationalWebhookEndpointRequest +*/ +func (a *WebhookEndpointAPIService) UpdateOperationalWebhookEndpoint(ctx context.Context, endpointId string) ApiUpdateOperationalWebhookEndpointRequest { + return ApiUpdateOperationalWebhookEndpointRequest{ + ApiService: a, + ctx: ctx, + endpointId: endpointId, + } +} + +// Execute executes the request +// @return OperationalWebhookEndpointOut +func (a *WebhookEndpointAPIService) UpdateOperationalWebhookEndpointExecute(r ApiUpdateOperationalWebhookEndpointRequest) (*OperationalWebhookEndpointOut, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OperationalWebhookEndpointOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhookEndpointAPIService.UpdateOperationalWebhookEndpoint") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/operational-webhook/endpoint/{endpoint_id}" + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.endpointId) < 1 { + return localVarReturnValue, nil, reportError("endpointId must have at least 1 elements") + } + if strlen(r.endpointId) > 256 { + return localVarReturnValue, nil, reportError("endpointId must have less than 256 elements") + } + if r.operationalWebhookEndpointUpdate == nil { + return localVarReturnValue, nil, reportError("operationalWebhookEndpointUpdate is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.operationalWebhookEndpointUpdate + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v HTTPValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/go/internal/openapi/client.go b/go/internal/openapi/client.go index b58419dc3..cb25b7a60 100644 --- a/go/internal/openapi/client.go +++ b/go/internal/openapi/client.go @@ -87,6 +87,8 @@ type APIClient struct { StreamAPI *StreamAPIService TransformationTemplateAPI *TransformationTemplateAPIService + + WebhookEndpointAPI *WebhookEndpointAPIService } type service struct { @@ -123,6 +125,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.StatisticsAPI = (*StatisticsAPIService)(&c.common) c.StreamAPI = (*StreamAPIService)(&c.common) c.TransformationTemplateAPI = (*TransformationTemplateAPIService)(&c.common) + c.WebhookEndpointAPI = (*WebhookEndpointAPIService)(&c.common) return c } diff --git a/go/internal/openapi/model_big_query_config.go b/go/internal/openapi/model_big_query_config.go new file mode 100644 index 000000000..8cd9f3d58 --- /dev/null +++ b/go/internal/openapi/model_big_query_config.go @@ -0,0 +1,243 @@ +/* +Svix API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the BigQueryConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BigQueryConfig{} + +// BigQueryConfig Configuration for a Google Cloud BigQuery sink. +type BigQueryConfig struct { + // Google Cloud Credentials JSON Object as a string. + Credentials string `json:"credentials"` + DatasetId string `json:"datasetId"` + ProjectId string `json:"projectId"` + TableId string `json:"tableId"` +} + +type _BigQueryConfig BigQueryConfig + +// NewBigQueryConfig instantiates a new BigQueryConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBigQueryConfig(credentials string, datasetId string, projectId string, tableId string) *BigQueryConfig { + this := BigQueryConfig{} + this.Credentials = credentials + this.DatasetId = datasetId + this.ProjectId = projectId + this.TableId = tableId + return &this +} + +// NewBigQueryConfigWithDefaults instantiates a new BigQueryConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBigQueryConfigWithDefaults() *BigQueryConfig { + this := BigQueryConfig{} + return &this +} + +// GetCredentials returns the Credentials field value +func (o *BigQueryConfig) GetCredentials() string { + if o == nil { + var ret string + return ret + } + + return o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value +// and a boolean to check if the value has been set. +func (o *BigQueryConfig) GetCredentialsOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Credentials, true +} + +// SetCredentials sets field value +func (o *BigQueryConfig) SetCredentials(v string) { + o.Credentials = v +} + +// GetDatasetId returns the DatasetId field value +func (o *BigQueryConfig) GetDatasetId() string { + if o == nil { + var ret string + return ret + } + + return o.DatasetId +} + +// GetDatasetIdOk returns a tuple with the DatasetId field value +// and a boolean to check if the value has been set. +func (o *BigQueryConfig) GetDatasetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DatasetId, true +} + +// SetDatasetId sets field value +func (o *BigQueryConfig) SetDatasetId(v string) { + o.DatasetId = v +} + +// GetProjectId returns the ProjectId field value +func (o *BigQueryConfig) GetProjectId() string { + if o == nil { + var ret string + return ret + } + + return o.ProjectId +} + +// GetProjectIdOk returns a tuple with the ProjectId field value +// and a boolean to check if the value has been set. +func (o *BigQueryConfig) GetProjectIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ProjectId, true +} + +// SetProjectId sets field value +func (o *BigQueryConfig) SetProjectId(v string) { + o.ProjectId = v +} + +// GetTableId returns the TableId field value +func (o *BigQueryConfig) GetTableId() string { + if o == nil { + var ret string + return ret + } + + return o.TableId +} + +// GetTableIdOk returns a tuple with the TableId field value +// and a boolean to check if the value has been set. +func (o *BigQueryConfig) GetTableIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TableId, true +} + +// SetTableId sets field value +func (o *BigQueryConfig) SetTableId(v string) { + o.TableId = v +} + +func (o BigQueryConfig) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BigQueryConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["credentials"] = o.Credentials + toSerialize["datasetId"] = o.DatasetId + toSerialize["projectId"] = o.ProjectId + toSerialize["tableId"] = o.TableId + return toSerialize, nil +} + +func (o *BigQueryConfig) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "credentials", + "datasetId", + "projectId", + "tableId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBigQueryConfig := _BigQueryConfig{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBigQueryConfig) + + if err != nil { + return err + } + + *o = BigQueryConfig(varBigQueryConfig) + + return err +} + +type NullableBigQueryConfig struct { + value *BigQueryConfig + isSet bool +} + +func (v NullableBigQueryConfig) Get() *BigQueryConfig { + return v.value +} + +func (v *NullableBigQueryConfig) Set(val *BigQueryConfig) { + v.value = val + v.isSet = true +} + +func (v NullableBigQueryConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableBigQueryConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBigQueryConfig(val *BigQueryConfig) *NullableBigQueryConfig { + return &NullableBigQueryConfig{value: val, isSet: true} +} + +func (v NullableBigQueryConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBigQueryConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_create_stream_in.go b/go/internal/openapi/model_create_stream_in.go index 9092b67f5..608298c32 100644 --- a/go/internal/openapi/model_create_stream_in.go +++ b/go/internal/openapi/model_create_stream_in.go @@ -22,6 +22,7 @@ var _ MappedNullable = &CreateStreamIn{} // CreateStreamIn struct for CreateStreamIn type CreateStreamIn struct { Messages []EventIn `json:"messages"` + Stream *StreamIn `json:"stream,omitempty"` } type _CreateStreamIn CreateStreamIn @@ -68,6 +69,38 @@ func (o *CreateStreamIn) SetMessages(v []EventIn) { o.Messages = v } +// GetStream returns the Stream field value if set, zero value otherwise. +func (o *CreateStreamIn) GetStream() StreamIn { + if o == nil || IsNil(o.Stream) { + var ret StreamIn + return ret + } + return *o.Stream +} + +// GetStreamOk returns a tuple with the Stream field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateStreamIn) GetStreamOk() (*StreamIn, bool) { + if o == nil || IsNil(o.Stream) { + return nil, false + } + return o.Stream, true +} + +// HasStream returns a boolean if a field has been set. +func (o *CreateStreamIn) HasStream() bool { + if o != nil && !IsNil(o.Stream) { + return true + } + + return false +} + +// SetStream gets a reference to the given StreamIn and assigns it to the Stream field. +func (o *CreateStreamIn) SetStream(v StreamIn) { + o.Stream = &v +} + func (o CreateStreamIn) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { @@ -79,6 +112,9 @@ func (o CreateStreamIn) MarshalJSON() ([]byte, error) { func (o CreateStreamIn) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["messages"] = o.Messages + if !IsNil(o.Stream) { + toSerialize["stream"] = o.Stream + } return toSerialize, nil } diff --git a/go/internal/openapi/model_event_type_from_open_api.go b/go/internal/openapi/model_event_type_from_open_api.go index 2ce21511d..af10fd88c 100644 --- a/go/internal/openapi/model_event_type_from_open_api.go +++ b/go/internal/openapi/model_event_type_from_open_api.go @@ -23,6 +23,9 @@ var _ MappedNullable = &EventTypeFromOpenApi{} type EventTypeFromOpenApi struct { Deprecated bool `json:"deprecated"` Description string `json:"description"` + FeatureFlag NullableString `json:"featureFlag,omitempty" validate:"regexp=^[a-zA-Z0-9\\\\-_.]+$"` + // The event type group's name + GroupName NullableString `json:"groupName,omitempty" validate:"regexp=^[a-zA-Z0-9\\\\-_.]+$"` // The event type's name Name string `json:"name" validate:"regexp=^[a-zA-Z0-9\\\\-_.]+$"` Schemas map[string]map[string]interface{} `json:"schemas,omitempty"` @@ -98,6 +101,90 @@ func (o *EventTypeFromOpenApi) SetDescription(v string) { o.Description = v } +// GetFeatureFlag returns the FeatureFlag field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EventTypeFromOpenApi) GetFeatureFlag() string { + if o == nil || IsNil(o.FeatureFlag.Get()) { + var ret string + return ret + } + return *o.FeatureFlag.Get() +} + +// GetFeatureFlagOk returns a tuple with the FeatureFlag field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EventTypeFromOpenApi) GetFeatureFlagOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FeatureFlag.Get(), o.FeatureFlag.IsSet() +} + +// HasFeatureFlag returns a boolean if a field has been set. +func (o *EventTypeFromOpenApi) HasFeatureFlag() bool { + if o != nil && o.FeatureFlag.IsSet() { + return true + } + + return false +} + +// SetFeatureFlag gets a reference to the given NullableString and assigns it to the FeatureFlag field. +func (o *EventTypeFromOpenApi) SetFeatureFlag(v string) { + o.FeatureFlag.Set(&v) +} +// SetFeatureFlagNil sets the value for FeatureFlag to be an explicit nil +func (o *EventTypeFromOpenApi) SetFeatureFlagNil() { + o.FeatureFlag.Set(nil) +} + +// UnsetFeatureFlag ensures that no value is present for FeatureFlag, not even an explicit nil +func (o *EventTypeFromOpenApi) UnsetFeatureFlag() { + o.FeatureFlag.Unset() +} + +// GetGroupName returns the GroupName field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EventTypeFromOpenApi) GetGroupName() string { + if o == nil || IsNil(o.GroupName.Get()) { + var ret string + return ret + } + return *o.GroupName.Get() +} + +// GetGroupNameOk returns a tuple with the GroupName field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EventTypeFromOpenApi) GetGroupNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.GroupName.Get(), o.GroupName.IsSet() +} + +// HasGroupName returns a boolean if a field has been set. +func (o *EventTypeFromOpenApi) HasGroupName() bool { + if o != nil && o.GroupName.IsSet() { + return true + } + + return false +} + +// SetGroupName gets a reference to the given NullableString and assigns it to the GroupName field. +func (o *EventTypeFromOpenApi) SetGroupName(v string) { + o.GroupName.Set(&v) +} +// SetGroupNameNil sets the value for GroupName to be an explicit nil +func (o *EventTypeFromOpenApi) SetGroupNameNil() { + o.GroupName.Set(nil) +} + +// UnsetGroupName ensures that no value is present for GroupName, not even an explicit nil +func (o *EventTypeFromOpenApi) UnsetGroupName() { + o.GroupName.Unset() +} + // GetName returns the Name field value func (o *EventTypeFromOpenApi) GetName() string { if o == nil { @@ -167,6 +254,12 @@ func (o EventTypeFromOpenApi) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["deprecated"] = o.Deprecated toSerialize["description"] = o.Description + if o.FeatureFlag.IsSet() { + toSerialize["featureFlag"] = o.FeatureFlag.Get() + } + if o.GroupName.IsSet() { + toSerialize["groupName"] = o.GroupName.Get() + } toSerialize["name"] = o.Name if o.Schemas != nil { toSerialize["schemas"] = o.Schemas diff --git a/go/internal/openapi/model_list_response_operational_webhook_endpoint_out_.go b/go/internal/openapi/model_list_response_operational_webhook_endpoint_out_.go new file mode 100644 index 000000000..a6f558255 --- /dev/null +++ b/go/internal/openapi/model_list_response_operational_webhook_endpoint_out_.go @@ -0,0 +1,278 @@ +/* +Svix API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the ListResponseOperationalWebhookEndpointOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListResponseOperationalWebhookEndpointOut{} + +// ListResponseOperationalWebhookEndpointOut struct for ListResponseOperationalWebhookEndpointOut +type ListResponseOperationalWebhookEndpointOut struct { + Data []OperationalWebhookEndpointOut `json:"data"` + Done bool `json:"done"` + Iterator NullableString `json:"iterator,omitempty"` + PrevIterator NullableString `json:"prevIterator,omitempty"` +} + +type _ListResponseOperationalWebhookEndpointOut ListResponseOperationalWebhookEndpointOut + +// NewListResponseOperationalWebhookEndpointOut instantiates a new ListResponseOperationalWebhookEndpointOut object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListResponseOperationalWebhookEndpointOut(data []OperationalWebhookEndpointOut, done bool) *ListResponseOperationalWebhookEndpointOut { + this := ListResponseOperationalWebhookEndpointOut{} + this.Data = data + this.Done = done + return &this +} + +// NewListResponseOperationalWebhookEndpointOutWithDefaults instantiates a new ListResponseOperationalWebhookEndpointOut object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListResponseOperationalWebhookEndpointOutWithDefaults() *ListResponseOperationalWebhookEndpointOut { + this := ListResponseOperationalWebhookEndpointOut{} + return &this +} + +// GetData returns the Data field value +func (o *ListResponseOperationalWebhookEndpointOut) GetData() []OperationalWebhookEndpointOut { + if o == nil { + var ret []OperationalWebhookEndpointOut + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *ListResponseOperationalWebhookEndpointOut) GetDataOk() ([]OperationalWebhookEndpointOut, bool) { + if o == nil { + return nil, false + } + return o.Data, true +} + +// SetData sets field value +func (o *ListResponseOperationalWebhookEndpointOut) SetData(v []OperationalWebhookEndpointOut) { + o.Data = v +} + +// GetDone returns the Done field value +func (o *ListResponseOperationalWebhookEndpointOut) GetDone() bool { + if o == nil { + var ret bool + return ret + } + + return o.Done +} + +// GetDoneOk returns a tuple with the Done field value +// and a boolean to check if the value has been set. +func (o *ListResponseOperationalWebhookEndpointOut) GetDoneOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Done, true +} + +// SetDone sets field value +func (o *ListResponseOperationalWebhookEndpointOut) SetDone(v bool) { + o.Done = v +} + +// GetIterator returns the Iterator field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ListResponseOperationalWebhookEndpointOut) GetIterator() string { + if o == nil || IsNil(o.Iterator.Get()) { + var ret string + return ret + } + return *o.Iterator.Get() +} + +// GetIteratorOk returns a tuple with the Iterator field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ListResponseOperationalWebhookEndpointOut) GetIteratorOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Iterator.Get(), o.Iterator.IsSet() +} + +// HasIterator returns a boolean if a field has been set. +func (o *ListResponseOperationalWebhookEndpointOut) HasIterator() bool { + if o != nil && o.Iterator.IsSet() { + return true + } + + return false +} + +// SetIterator gets a reference to the given NullableString and assigns it to the Iterator field. +func (o *ListResponseOperationalWebhookEndpointOut) SetIterator(v string) { + o.Iterator.Set(&v) +} +// SetIteratorNil sets the value for Iterator to be an explicit nil +func (o *ListResponseOperationalWebhookEndpointOut) SetIteratorNil() { + o.Iterator.Set(nil) +} + +// UnsetIterator ensures that no value is present for Iterator, not even an explicit nil +func (o *ListResponseOperationalWebhookEndpointOut) UnsetIterator() { + o.Iterator.Unset() +} + +// GetPrevIterator returns the PrevIterator field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ListResponseOperationalWebhookEndpointOut) GetPrevIterator() string { + if o == nil || IsNil(o.PrevIterator.Get()) { + var ret string + return ret + } + return *o.PrevIterator.Get() +} + +// GetPrevIteratorOk returns a tuple with the PrevIterator field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ListResponseOperationalWebhookEndpointOut) GetPrevIteratorOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PrevIterator.Get(), o.PrevIterator.IsSet() +} + +// HasPrevIterator returns a boolean if a field has been set. +func (o *ListResponseOperationalWebhookEndpointOut) HasPrevIterator() bool { + if o != nil && o.PrevIterator.IsSet() { + return true + } + + return false +} + +// SetPrevIterator gets a reference to the given NullableString and assigns it to the PrevIterator field. +func (o *ListResponseOperationalWebhookEndpointOut) SetPrevIterator(v string) { + o.PrevIterator.Set(&v) +} +// SetPrevIteratorNil sets the value for PrevIterator to be an explicit nil +func (o *ListResponseOperationalWebhookEndpointOut) SetPrevIteratorNil() { + o.PrevIterator.Set(nil) +} + +// UnsetPrevIterator ensures that no value is present for PrevIterator, not even an explicit nil +func (o *ListResponseOperationalWebhookEndpointOut) UnsetPrevIterator() { + o.PrevIterator.Unset() +} + +func (o ListResponseOperationalWebhookEndpointOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListResponseOperationalWebhookEndpointOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["done"] = o.Done + if o.Iterator.IsSet() { + toSerialize["iterator"] = o.Iterator.Get() + } + if o.PrevIterator.IsSet() { + toSerialize["prevIterator"] = o.PrevIterator.Get() + } + return toSerialize, nil +} + +func (o *ListResponseOperationalWebhookEndpointOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + "done", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListResponseOperationalWebhookEndpointOut := _ListResponseOperationalWebhookEndpointOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListResponseOperationalWebhookEndpointOut) + + if err != nil { + return err + } + + *o = ListResponseOperationalWebhookEndpointOut(varListResponseOperationalWebhookEndpointOut) + + return err +} + +type NullableListResponseOperationalWebhookEndpointOut struct { + value *ListResponseOperationalWebhookEndpointOut + isSet bool +} + +func (v NullableListResponseOperationalWebhookEndpointOut) Get() *ListResponseOperationalWebhookEndpointOut { + return v.value +} + +func (v *NullableListResponseOperationalWebhookEndpointOut) Set(val *ListResponseOperationalWebhookEndpointOut) { + v.value = val + v.isSet = true +} + +func (v NullableListResponseOperationalWebhookEndpointOut) IsSet() bool { + return v.isSet +} + +func (v *NullableListResponseOperationalWebhookEndpointOut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListResponseOperationalWebhookEndpointOut(val *ListResponseOperationalWebhookEndpointOut) *NullableListResponseOperationalWebhookEndpointOut { + return &NullableListResponseOperationalWebhookEndpointOut{value: val, isSet: true} +} + +func (v NullableListResponseOperationalWebhookEndpointOut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListResponseOperationalWebhookEndpointOut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_operational_webhook_endpoint_in.go b/go/internal/openapi/model_operational_webhook_endpoint_in.go new file mode 100644 index 000000000..c0ad246c1 --- /dev/null +++ b/go/internal/openapi/model_operational_webhook_endpoint_in.go @@ -0,0 +1,451 @@ +/* +Svix API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the OperationalWebhookEndpointIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OperationalWebhookEndpointIn{} + +// OperationalWebhookEndpointIn struct for OperationalWebhookEndpointIn +type OperationalWebhookEndpointIn struct { + Description *string `json:"description,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + FilterTypes []string `json:"filterTypes,omitempty"` + Metadata *map[string]string `json:"metadata,omitempty"` + RateLimit NullableInt32 `json:"rateLimit,omitempty"` + // The endpoint's verification secret. If `null` is passed, a secret is automatically generated. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24. + Secret NullableString `json:"secret,omitempty" validate:"regexp=^(whsec_)?[a-zA-Z0-9+\\/=]{32,100}$"` + // Optional unique identifier for the endpoint + Uid NullableString `json:"uid,omitempty" validate:"regexp=^[a-zA-Z0-9\\\\-_.]+$"` + Url string `json:"url"` +} + +type _OperationalWebhookEndpointIn OperationalWebhookEndpointIn + +// NewOperationalWebhookEndpointIn instantiates a new OperationalWebhookEndpointIn object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOperationalWebhookEndpointIn(url string) *OperationalWebhookEndpointIn { + this := OperationalWebhookEndpointIn{} + var description string = "" + this.Description = &description + var disabled bool = false + this.Disabled = &disabled + this.Url = url + return &this +} + +// NewOperationalWebhookEndpointInWithDefaults instantiates a new OperationalWebhookEndpointIn object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOperationalWebhookEndpointInWithDefaults() *OperationalWebhookEndpointIn { + this := OperationalWebhookEndpointIn{} + var description string = "" + this.Description = &description + var disabled bool = false + this.Disabled = &disabled + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *OperationalWebhookEndpointIn) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OperationalWebhookEndpointIn) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *OperationalWebhookEndpointIn) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *OperationalWebhookEndpointIn) SetDescription(v string) { + o.Description = &v +} + +// GetDisabled returns the Disabled field value if set, zero value otherwise. +func (o *OperationalWebhookEndpointIn) GetDisabled() bool { + if o == nil || IsNil(o.Disabled) { + var ret bool + return ret + } + return *o.Disabled +} + +// GetDisabledOk returns a tuple with the Disabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OperationalWebhookEndpointIn) GetDisabledOk() (*bool, bool) { + if o == nil || IsNil(o.Disabled) { + return nil, false + } + return o.Disabled, true +} + +// HasDisabled returns a boolean if a field has been set. +func (o *OperationalWebhookEndpointIn) HasDisabled() bool { + if o != nil && !IsNil(o.Disabled) { + return true + } + + return false +} + +// SetDisabled gets a reference to the given bool and assigns it to the Disabled field. +func (o *OperationalWebhookEndpointIn) SetDisabled(v bool) { + o.Disabled = &v +} + +// GetFilterTypes returns the FilterTypes field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OperationalWebhookEndpointIn) GetFilterTypes() []string { + if o == nil { + var ret []string + return ret + } + return o.FilterTypes +} + +// GetFilterTypesOk returns a tuple with the FilterTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OperationalWebhookEndpointIn) GetFilterTypesOk() ([]string, bool) { + if o == nil || IsNil(o.FilterTypes) { + return nil, false + } + return o.FilterTypes, true +} + +// HasFilterTypes returns a boolean if a field has been set. +func (o *OperationalWebhookEndpointIn) HasFilterTypes() bool { + if o != nil && !IsNil(o.FilterTypes) { + return true + } + + return false +} + +// SetFilterTypes gets a reference to the given []string and assigns it to the FilterTypes field. +func (o *OperationalWebhookEndpointIn) SetFilterTypes(v []string) { + o.FilterTypes = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *OperationalWebhookEndpointIn) GetMetadata() map[string]string { + if o == nil || IsNil(o.Metadata) { + var ret map[string]string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OperationalWebhookEndpointIn) GetMetadataOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *OperationalWebhookEndpointIn) HasMetadata() bool { + if o != nil && !IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. +func (o *OperationalWebhookEndpointIn) SetMetadata(v map[string]string) { + o.Metadata = &v +} + +// GetRateLimit returns the RateLimit field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OperationalWebhookEndpointIn) GetRateLimit() int32 { + if o == nil || IsNil(o.RateLimit.Get()) { + var ret int32 + return ret + } + return *o.RateLimit.Get() +} + +// GetRateLimitOk returns a tuple with the RateLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OperationalWebhookEndpointIn) GetRateLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.RateLimit.Get(), o.RateLimit.IsSet() +} + +// HasRateLimit returns a boolean if a field has been set. +func (o *OperationalWebhookEndpointIn) HasRateLimit() bool { + if o != nil && o.RateLimit.IsSet() { + return true + } + + return false +} + +// SetRateLimit gets a reference to the given NullableInt32 and assigns it to the RateLimit field. +func (o *OperationalWebhookEndpointIn) SetRateLimit(v int32) { + o.RateLimit.Set(&v) +} +// SetRateLimitNil sets the value for RateLimit to be an explicit nil +func (o *OperationalWebhookEndpointIn) SetRateLimitNil() { + o.RateLimit.Set(nil) +} + +// UnsetRateLimit ensures that no value is present for RateLimit, not even an explicit nil +func (o *OperationalWebhookEndpointIn) UnsetRateLimit() { + o.RateLimit.Unset() +} + +// GetSecret returns the Secret field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OperationalWebhookEndpointIn) GetSecret() string { + if o == nil || IsNil(o.Secret.Get()) { + var ret string + return ret + } + return *o.Secret.Get() +} + +// GetSecretOk returns a tuple with the Secret field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OperationalWebhookEndpointIn) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Secret.Get(), o.Secret.IsSet() +} + +// HasSecret returns a boolean if a field has been set. +func (o *OperationalWebhookEndpointIn) HasSecret() bool { + if o != nil && o.Secret.IsSet() { + return true + } + + return false +} + +// SetSecret gets a reference to the given NullableString and assigns it to the Secret field. +func (o *OperationalWebhookEndpointIn) SetSecret(v string) { + o.Secret.Set(&v) +} +// SetSecretNil sets the value for Secret to be an explicit nil +func (o *OperationalWebhookEndpointIn) SetSecretNil() { + o.Secret.Set(nil) +} + +// UnsetSecret ensures that no value is present for Secret, not even an explicit nil +func (o *OperationalWebhookEndpointIn) UnsetSecret() { + o.Secret.Unset() +} + +// GetUid returns the Uid field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OperationalWebhookEndpointIn) GetUid() string { + if o == nil || IsNil(o.Uid.Get()) { + var ret string + return ret + } + return *o.Uid.Get() +} + +// GetUidOk returns a tuple with the Uid field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OperationalWebhookEndpointIn) GetUidOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Uid.Get(), o.Uid.IsSet() +} + +// HasUid returns a boolean if a field has been set. +func (o *OperationalWebhookEndpointIn) HasUid() bool { + if o != nil && o.Uid.IsSet() { + return true + } + + return false +} + +// SetUid gets a reference to the given NullableString and assigns it to the Uid field. +func (o *OperationalWebhookEndpointIn) SetUid(v string) { + o.Uid.Set(&v) +} +// SetUidNil sets the value for Uid to be an explicit nil +func (o *OperationalWebhookEndpointIn) SetUidNil() { + o.Uid.Set(nil) +} + +// UnsetUid ensures that no value is present for Uid, not even an explicit nil +func (o *OperationalWebhookEndpointIn) UnsetUid() { + o.Uid.Unset() +} + +// GetUrl returns the Url field value +func (o *OperationalWebhookEndpointIn) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *OperationalWebhookEndpointIn) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *OperationalWebhookEndpointIn) SetUrl(v string) { + o.Url = v +} + +func (o OperationalWebhookEndpointIn) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OperationalWebhookEndpointIn) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Disabled) { + toSerialize["disabled"] = o.Disabled + } + if o.FilterTypes != nil { + toSerialize["filterTypes"] = o.FilterTypes + } + if !IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + if o.RateLimit.IsSet() { + toSerialize["rateLimit"] = o.RateLimit.Get() + } + if o.Secret.IsSet() { + toSerialize["secret"] = o.Secret.Get() + } + if o.Uid.IsSet() { + toSerialize["uid"] = o.Uid.Get() + } + toSerialize["url"] = o.Url + return toSerialize, nil +} + +func (o *OperationalWebhookEndpointIn) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOperationalWebhookEndpointIn := _OperationalWebhookEndpointIn{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varOperationalWebhookEndpointIn) + + if err != nil { + return err + } + + *o = OperationalWebhookEndpointIn(varOperationalWebhookEndpointIn) + + return err +} + +type NullableOperationalWebhookEndpointIn struct { + value *OperationalWebhookEndpointIn + isSet bool +} + +func (v NullableOperationalWebhookEndpointIn) Get() *OperationalWebhookEndpointIn { + return v.value +} + +func (v *NullableOperationalWebhookEndpointIn) Set(val *OperationalWebhookEndpointIn) { + v.value = val + v.isSet = true +} + +func (v NullableOperationalWebhookEndpointIn) IsSet() bool { + return v.isSet +} + +func (v *NullableOperationalWebhookEndpointIn) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOperationalWebhookEndpointIn(val *OperationalWebhookEndpointIn) *NullableOperationalWebhookEndpointIn { + return &NullableOperationalWebhookEndpointIn{value: val, isSet: true} +} + +func (v NullableOperationalWebhookEndpointIn) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOperationalWebhookEndpointIn) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_operational_webhook_endpoint_out.go b/go/internal/openapi/model_operational_webhook_endpoint_out.go new file mode 100644 index 000000000..88d240ee9 --- /dev/null +++ b/go/internal/openapi/model_operational_webhook_endpoint_out.go @@ -0,0 +1,471 @@ +/* +Svix API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "time" + "bytes" + "fmt" +) + +// checks if the OperationalWebhookEndpointOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OperationalWebhookEndpointOut{} + +// OperationalWebhookEndpointOut struct for OperationalWebhookEndpointOut +type OperationalWebhookEndpointOut struct { + CreatedAt time.Time `json:"createdAt"` + // An example endpoint name + Description string `json:"description"` + Disabled *bool `json:"disabled,omitempty"` + FilterTypes []string `json:"filterTypes,omitempty"` + // The ep's ID + Id string `json:"id"` + Metadata map[string]string `json:"metadata"` + RateLimit NullableInt32 `json:"rateLimit,omitempty"` + // Optional unique identifier for the endpoint + Uid NullableString `json:"uid,omitempty" validate:"regexp=^[a-zA-Z0-9\\\\-_.]+$"` + UpdatedAt time.Time `json:"updatedAt"` + Url string `json:"url"` +} + +type _OperationalWebhookEndpointOut OperationalWebhookEndpointOut + +// NewOperationalWebhookEndpointOut instantiates a new OperationalWebhookEndpointOut object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOperationalWebhookEndpointOut(createdAt time.Time, description string, id string, metadata map[string]string, updatedAt time.Time, url string) *OperationalWebhookEndpointOut { + this := OperationalWebhookEndpointOut{} + this.CreatedAt = createdAt + this.Description = description + var disabled bool = false + this.Disabled = &disabled + this.Id = id + this.Metadata = metadata + this.UpdatedAt = updatedAt + this.Url = url + return &this +} + +// NewOperationalWebhookEndpointOutWithDefaults instantiates a new OperationalWebhookEndpointOut object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOperationalWebhookEndpointOutWithDefaults() *OperationalWebhookEndpointOut { + this := OperationalWebhookEndpointOut{} + var disabled bool = false + this.Disabled = &disabled + return &this +} + +// GetCreatedAt returns the CreatedAt field value +func (o *OperationalWebhookEndpointOut) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *OperationalWebhookEndpointOut) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *OperationalWebhookEndpointOut) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetDescription returns the Description field value +func (o *OperationalWebhookEndpointOut) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *OperationalWebhookEndpointOut) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *OperationalWebhookEndpointOut) SetDescription(v string) { + o.Description = v +} + +// GetDisabled returns the Disabled field value if set, zero value otherwise. +func (o *OperationalWebhookEndpointOut) GetDisabled() bool { + if o == nil || IsNil(o.Disabled) { + var ret bool + return ret + } + return *o.Disabled +} + +// GetDisabledOk returns a tuple with the Disabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OperationalWebhookEndpointOut) GetDisabledOk() (*bool, bool) { + if o == nil || IsNil(o.Disabled) { + return nil, false + } + return o.Disabled, true +} + +// HasDisabled returns a boolean if a field has been set. +func (o *OperationalWebhookEndpointOut) HasDisabled() bool { + if o != nil && !IsNil(o.Disabled) { + return true + } + + return false +} + +// SetDisabled gets a reference to the given bool and assigns it to the Disabled field. +func (o *OperationalWebhookEndpointOut) SetDisabled(v bool) { + o.Disabled = &v +} + +// GetFilterTypes returns the FilterTypes field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OperationalWebhookEndpointOut) GetFilterTypes() []string { + if o == nil { + var ret []string + return ret + } + return o.FilterTypes +} + +// GetFilterTypesOk returns a tuple with the FilterTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OperationalWebhookEndpointOut) GetFilterTypesOk() ([]string, bool) { + if o == nil || IsNil(o.FilterTypes) { + return nil, false + } + return o.FilterTypes, true +} + +// HasFilterTypes returns a boolean if a field has been set. +func (o *OperationalWebhookEndpointOut) HasFilterTypes() bool { + if o != nil && !IsNil(o.FilterTypes) { + return true + } + + return false +} + +// SetFilterTypes gets a reference to the given []string and assigns it to the FilterTypes field. +func (o *OperationalWebhookEndpointOut) SetFilterTypes(v []string) { + o.FilterTypes = v +} + +// GetId returns the Id field value +func (o *OperationalWebhookEndpointOut) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *OperationalWebhookEndpointOut) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *OperationalWebhookEndpointOut) SetId(v string) { + o.Id = v +} + +// GetMetadata returns the Metadata field value +func (o *OperationalWebhookEndpointOut) GetMetadata() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value +// and a boolean to check if the value has been set. +func (o *OperationalWebhookEndpointOut) GetMetadataOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.Metadata, true +} + +// SetMetadata sets field value +func (o *OperationalWebhookEndpointOut) SetMetadata(v map[string]string) { + o.Metadata = v +} + +// GetRateLimit returns the RateLimit field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OperationalWebhookEndpointOut) GetRateLimit() int32 { + if o == nil || IsNil(o.RateLimit.Get()) { + var ret int32 + return ret + } + return *o.RateLimit.Get() +} + +// GetRateLimitOk returns a tuple with the RateLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OperationalWebhookEndpointOut) GetRateLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.RateLimit.Get(), o.RateLimit.IsSet() +} + +// HasRateLimit returns a boolean if a field has been set. +func (o *OperationalWebhookEndpointOut) HasRateLimit() bool { + if o != nil && o.RateLimit.IsSet() { + return true + } + + return false +} + +// SetRateLimit gets a reference to the given NullableInt32 and assigns it to the RateLimit field. +func (o *OperationalWebhookEndpointOut) SetRateLimit(v int32) { + o.RateLimit.Set(&v) +} +// SetRateLimitNil sets the value for RateLimit to be an explicit nil +func (o *OperationalWebhookEndpointOut) SetRateLimitNil() { + o.RateLimit.Set(nil) +} + +// UnsetRateLimit ensures that no value is present for RateLimit, not even an explicit nil +func (o *OperationalWebhookEndpointOut) UnsetRateLimit() { + o.RateLimit.Unset() +} + +// GetUid returns the Uid field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OperationalWebhookEndpointOut) GetUid() string { + if o == nil || IsNil(o.Uid.Get()) { + var ret string + return ret + } + return *o.Uid.Get() +} + +// GetUidOk returns a tuple with the Uid field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OperationalWebhookEndpointOut) GetUidOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Uid.Get(), o.Uid.IsSet() +} + +// HasUid returns a boolean if a field has been set. +func (o *OperationalWebhookEndpointOut) HasUid() bool { + if o != nil && o.Uid.IsSet() { + return true + } + + return false +} + +// SetUid gets a reference to the given NullableString and assigns it to the Uid field. +func (o *OperationalWebhookEndpointOut) SetUid(v string) { + o.Uid.Set(&v) +} +// SetUidNil sets the value for Uid to be an explicit nil +func (o *OperationalWebhookEndpointOut) SetUidNil() { + o.Uid.Set(nil) +} + +// UnsetUid ensures that no value is present for Uid, not even an explicit nil +func (o *OperationalWebhookEndpointOut) UnsetUid() { + o.Uid.Unset() +} + +// GetUpdatedAt returns the UpdatedAt field value +func (o *OperationalWebhookEndpointOut) GetUpdatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value +// and a boolean to check if the value has been set. +func (o *OperationalWebhookEndpointOut) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.UpdatedAt, true +} + +// SetUpdatedAt sets field value +func (o *OperationalWebhookEndpointOut) SetUpdatedAt(v time.Time) { + o.UpdatedAt = v +} + +// GetUrl returns the Url field value +func (o *OperationalWebhookEndpointOut) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *OperationalWebhookEndpointOut) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *OperationalWebhookEndpointOut) SetUrl(v string) { + o.Url = v +} + +func (o OperationalWebhookEndpointOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OperationalWebhookEndpointOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["createdAt"] = o.CreatedAt + toSerialize["description"] = o.Description + if !IsNil(o.Disabled) { + toSerialize["disabled"] = o.Disabled + } + if o.FilterTypes != nil { + toSerialize["filterTypes"] = o.FilterTypes + } + toSerialize["id"] = o.Id + toSerialize["metadata"] = o.Metadata + if o.RateLimit.IsSet() { + toSerialize["rateLimit"] = o.RateLimit.Get() + } + if o.Uid.IsSet() { + toSerialize["uid"] = o.Uid.Get() + } + toSerialize["updatedAt"] = o.UpdatedAt + toSerialize["url"] = o.Url + return toSerialize, nil +} + +func (o *OperationalWebhookEndpointOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "createdAt", + "description", + "id", + "metadata", + "updatedAt", + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOperationalWebhookEndpointOut := _OperationalWebhookEndpointOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varOperationalWebhookEndpointOut) + + if err != nil { + return err + } + + *o = OperationalWebhookEndpointOut(varOperationalWebhookEndpointOut) + + return err +} + +type NullableOperationalWebhookEndpointOut struct { + value *OperationalWebhookEndpointOut + isSet bool +} + +func (v NullableOperationalWebhookEndpointOut) Get() *OperationalWebhookEndpointOut { + return v.value +} + +func (v *NullableOperationalWebhookEndpointOut) Set(val *OperationalWebhookEndpointOut) { + v.value = val + v.isSet = true +} + +func (v NullableOperationalWebhookEndpointOut) IsSet() bool { + return v.isSet +} + +func (v *NullableOperationalWebhookEndpointOut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOperationalWebhookEndpointOut(val *OperationalWebhookEndpointOut) *NullableOperationalWebhookEndpointOut { + return &NullableOperationalWebhookEndpointOut{value: val, isSet: true} +} + +func (v NullableOperationalWebhookEndpointOut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOperationalWebhookEndpointOut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_operational_webhook_endpoint_secret_in.go b/go/internal/openapi/model_operational_webhook_endpoint_secret_in.go new file mode 100644 index 000000000..c72128ec2 --- /dev/null +++ b/go/internal/openapi/model_operational_webhook_endpoint_secret_in.go @@ -0,0 +1,137 @@ +/* +Svix API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the OperationalWebhookEndpointSecretIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OperationalWebhookEndpointSecretIn{} + +// OperationalWebhookEndpointSecretIn struct for OperationalWebhookEndpointSecretIn +type OperationalWebhookEndpointSecretIn struct { + // The endpoint's verification secret. If `null` is passed, a secret is automatically generated. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24. + Key NullableString `json:"key,omitempty" validate:"regexp=^(whsec_)?[a-zA-Z0-9+\\/=]{32,100}$"` +} + +// NewOperationalWebhookEndpointSecretIn instantiates a new OperationalWebhookEndpointSecretIn object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOperationalWebhookEndpointSecretIn() *OperationalWebhookEndpointSecretIn { + this := OperationalWebhookEndpointSecretIn{} + return &this +} + +// NewOperationalWebhookEndpointSecretInWithDefaults instantiates a new OperationalWebhookEndpointSecretIn object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOperationalWebhookEndpointSecretInWithDefaults() *OperationalWebhookEndpointSecretIn { + this := OperationalWebhookEndpointSecretIn{} + return &this +} + +// GetKey returns the Key field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OperationalWebhookEndpointSecretIn) GetKey() string { + if o == nil || IsNil(o.Key.Get()) { + var ret string + return ret + } + return *o.Key.Get() +} + +// GetKeyOk returns a tuple with the Key field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OperationalWebhookEndpointSecretIn) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Key.Get(), o.Key.IsSet() +} + +// HasKey returns a boolean if a field has been set. +func (o *OperationalWebhookEndpointSecretIn) HasKey() bool { + if o != nil && o.Key.IsSet() { + return true + } + + return false +} + +// SetKey gets a reference to the given NullableString and assigns it to the Key field. +func (o *OperationalWebhookEndpointSecretIn) SetKey(v string) { + o.Key.Set(&v) +} +// SetKeyNil sets the value for Key to be an explicit nil +func (o *OperationalWebhookEndpointSecretIn) SetKeyNil() { + o.Key.Set(nil) +} + +// UnsetKey ensures that no value is present for Key, not even an explicit nil +func (o *OperationalWebhookEndpointSecretIn) UnsetKey() { + o.Key.Unset() +} + +func (o OperationalWebhookEndpointSecretIn) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OperationalWebhookEndpointSecretIn) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Key.IsSet() { + toSerialize["key"] = o.Key.Get() + } + return toSerialize, nil +} + +type NullableOperationalWebhookEndpointSecretIn struct { + value *OperationalWebhookEndpointSecretIn + isSet bool +} + +func (v NullableOperationalWebhookEndpointSecretIn) Get() *OperationalWebhookEndpointSecretIn { + return v.value +} + +func (v *NullableOperationalWebhookEndpointSecretIn) Set(val *OperationalWebhookEndpointSecretIn) { + v.value = val + v.isSet = true +} + +func (v NullableOperationalWebhookEndpointSecretIn) IsSet() bool { + return v.isSet +} + +func (v *NullableOperationalWebhookEndpointSecretIn) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOperationalWebhookEndpointSecretIn(val *OperationalWebhookEndpointSecretIn) *NullableOperationalWebhookEndpointSecretIn { + return &NullableOperationalWebhookEndpointSecretIn{value: val, isSet: true} +} + +func (v NullableOperationalWebhookEndpointSecretIn) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOperationalWebhookEndpointSecretIn) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_operational_webhook_endpoint_secret_out.go b/go/internal/openapi/model_operational_webhook_endpoint_secret_out.go new file mode 100644 index 000000000..be46849a7 --- /dev/null +++ b/go/internal/openapi/model_operational_webhook_endpoint_secret_out.go @@ -0,0 +1,159 @@ +/* +Svix API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the OperationalWebhookEndpointSecretOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OperationalWebhookEndpointSecretOut{} + +// OperationalWebhookEndpointSecretOut struct for OperationalWebhookEndpointSecretOut +type OperationalWebhookEndpointSecretOut struct { + // The endpoint's verification secret. If `null` is passed, a secret is automatically generated. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24. + Key string `json:"key" validate:"regexp=^(whsec_)?[a-zA-Z0-9+\\/=]{32,100}$"` +} + +type _OperationalWebhookEndpointSecretOut OperationalWebhookEndpointSecretOut + +// NewOperationalWebhookEndpointSecretOut instantiates a new OperationalWebhookEndpointSecretOut object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOperationalWebhookEndpointSecretOut(key string) *OperationalWebhookEndpointSecretOut { + this := OperationalWebhookEndpointSecretOut{} + this.Key = key + return &this +} + +// NewOperationalWebhookEndpointSecretOutWithDefaults instantiates a new OperationalWebhookEndpointSecretOut object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOperationalWebhookEndpointSecretOutWithDefaults() *OperationalWebhookEndpointSecretOut { + this := OperationalWebhookEndpointSecretOut{} + return &this +} + +// GetKey returns the Key field value +func (o *OperationalWebhookEndpointSecretOut) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *OperationalWebhookEndpointSecretOut) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *OperationalWebhookEndpointSecretOut) SetKey(v string) { + o.Key = v +} + +func (o OperationalWebhookEndpointSecretOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OperationalWebhookEndpointSecretOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +func (o *OperationalWebhookEndpointSecretOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "key", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOperationalWebhookEndpointSecretOut := _OperationalWebhookEndpointSecretOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varOperationalWebhookEndpointSecretOut) + + if err != nil { + return err + } + + *o = OperationalWebhookEndpointSecretOut(varOperationalWebhookEndpointSecretOut) + + return err +} + +type NullableOperationalWebhookEndpointSecretOut struct { + value *OperationalWebhookEndpointSecretOut + isSet bool +} + +func (v NullableOperationalWebhookEndpointSecretOut) Get() *OperationalWebhookEndpointSecretOut { + return v.value +} + +func (v *NullableOperationalWebhookEndpointSecretOut) Set(val *OperationalWebhookEndpointSecretOut) { + v.value = val + v.isSet = true +} + +func (v NullableOperationalWebhookEndpointSecretOut) IsSet() bool { + return v.isSet +} + +func (v *NullableOperationalWebhookEndpointSecretOut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOperationalWebhookEndpointSecretOut(val *OperationalWebhookEndpointSecretOut) *NullableOperationalWebhookEndpointSecretOut { + return &NullableOperationalWebhookEndpointSecretOut{value: val, isSet: true} +} + +func (v NullableOperationalWebhookEndpointSecretOut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOperationalWebhookEndpointSecretOut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_operational_webhook_endpoint_update.go b/go/internal/openapi/model_operational_webhook_endpoint_update.go new file mode 100644 index 000000000..a14925059 --- /dev/null +++ b/go/internal/openapi/model_operational_webhook_endpoint_update.go @@ -0,0 +1,404 @@ +/* +Svix API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the OperationalWebhookEndpointUpdate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OperationalWebhookEndpointUpdate{} + +// OperationalWebhookEndpointUpdate struct for OperationalWebhookEndpointUpdate +type OperationalWebhookEndpointUpdate struct { + Description *string `json:"description,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + FilterTypes []string `json:"filterTypes,omitempty"` + Metadata *map[string]string `json:"metadata,omitempty"` + RateLimit NullableInt32 `json:"rateLimit,omitempty"` + // Optional unique identifier for the endpoint + Uid NullableString `json:"uid,omitempty" validate:"regexp=^[a-zA-Z0-9\\\\-_.]+$"` + Url string `json:"url"` +} + +type _OperationalWebhookEndpointUpdate OperationalWebhookEndpointUpdate + +// NewOperationalWebhookEndpointUpdate instantiates a new OperationalWebhookEndpointUpdate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOperationalWebhookEndpointUpdate(url string) *OperationalWebhookEndpointUpdate { + this := OperationalWebhookEndpointUpdate{} + var description string = "" + this.Description = &description + var disabled bool = false + this.Disabled = &disabled + this.Url = url + return &this +} + +// NewOperationalWebhookEndpointUpdateWithDefaults instantiates a new OperationalWebhookEndpointUpdate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOperationalWebhookEndpointUpdateWithDefaults() *OperationalWebhookEndpointUpdate { + this := OperationalWebhookEndpointUpdate{} + var description string = "" + this.Description = &description + var disabled bool = false + this.Disabled = &disabled + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *OperationalWebhookEndpointUpdate) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OperationalWebhookEndpointUpdate) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *OperationalWebhookEndpointUpdate) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *OperationalWebhookEndpointUpdate) SetDescription(v string) { + o.Description = &v +} + +// GetDisabled returns the Disabled field value if set, zero value otherwise. +func (o *OperationalWebhookEndpointUpdate) GetDisabled() bool { + if o == nil || IsNil(o.Disabled) { + var ret bool + return ret + } + return *o.Disabled +} + +// GetDisabledOk returns a tuple with the Disabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OperationalWebhookEndpointUpdate) GetDisabledOk() (*bool, bool) { + if o == nil || IsNil(o.Disabled) { + return nil, false + } + return o.Disabled, true +} + +// HasDisabled returns a boolean if a field has been set. +func (o *OperationalWebhookEndpointUpdate) HasDisabled() bool { + if o != nil && !IsNil(o.Disabled) { + return true + } + + return false +} + +// SetDisabled gets a reference to the given bool and assigns it to the Disabled field. +func (o *OperationalWebhookEndpointUpdate) SetDisabled(v bool) { + o.Disabled = &v +} + +// GetFilterTypes returns the FilterTypes field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OperationalWebhookEndpointUpdate) GetFilterTypes() []string { + if o == nil { + var ret []string + return ret + } + return o.FilterTypes +} + +// GetFilterTypesOk returns a tuple with the FilterTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OperationalWebhookEndpointUpdate) GetFilterTypesOk() ([]string, bool) { + if o == nil || IsNil(o.FilterTypes) { + return nil, false + } + return o.FilterTypes, true +} + +// HasFilterTypes returns a boolean if a field has been set. +func (o *OperationalWebhookEndpointUpdate) HasFilterTypes() bool { + if o != nil && !IsNil(o.FilterTypes) { + return true + } + + return false +} + +// SetFilterTypes gets a reference to the given []string and assigns it to the FilterTypes field. +func (o *OperationalWebhookEndpointUpdate) SetFilterTypes(v []string) { + o.FilterTypes = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *OperationalWebhookEndpointUpdate) GetMetadata() map[string]string { + if o == nil || IsNil(o.Metadata) { + var ret map[string]string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OperationalWebhookEndpointUpdate) GetMetadataOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *OperationalWebhookEndpointUpdate) HasMetadata() bool { + if o != nil && !IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. +func (o *OperationalWebhookEndpointUpdate) SetMetadata(v map[string]string) { + o.Metadata = &v +} + +// GetRateLimit returns the RateLimit field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OperationalWebhookEndpointUpdate) GetRateLimit() int32 { + if o == nil || IsNil(o.RateLimit.Get()) { + var ret int32 + return ret + } + return *o.RateLimit.Get() +} + +// GetRateLimitOk returns a tuple with the RateLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OperationalWebhookEndpointUpdate) GetRateLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.RateLimit.Get(), o.RateLimit.IsSet() +} + +// HasRateLimit returns a boolean if a field has been set. +func (o *OperationalWebhookEndpointUpdate) HasRateLimit() bool { + if o != nil && o.RateLimit.IsSet() { + return true + } + + return false +} + +// SetRateLimit gets a reference to the given NullableInt32 and assigns it to the RateLimit field. +func (o *OperationalWebhookEndpointUpdate) SetRateLimit(v int32) { + o.RateLimit.Set(&v) +} +// SetRateLimitNil sets the value for RateLimit to be an explicit nil +func (o *OperationalWebhookEndpointUpdate) SetRateLimitNil() { + o.RateLimit.Set(nil) +} + +// UnsetRateLimit ensures that no value is present for RateLimit, not even an explicit nil +func (o *OperationalWebhookEndpointUpdate) UnsetRateLimit() { + o.RateLimit.Unset() +} + +// GetUid returns the Uid field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OperationalWebhookEndpointUpdate) GetUid() string { + if o == nil || IsNil(o.Uid.Get()) { + var ret string + return ret + } + return *o.Uid.Get() +} + +// GetUidOk returns a tuple with the Uid field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OperationalWebhookEndpointUpdate) GetUidOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Uid.Get(), o.Uid.IsSet() +} + +// HasUid returns a boolean if a field has been set. +func (o *OperationalWebhookEndpointUpdate) HasUid() bool { + if o != nil && o.Uid.IsSet() { + return true + } + + return false +} + +// SetUid gets a reference to the given NullableString and assigns it to the Uid field. +func (o *OperationalWebhookEndpointUpdate) SetUid(v string) { + o.Uid.Set(&v) +} +// SetUidNil sets the value for Uid to be an explicit nil +func (o *OperationalWebhookEndpointUpdate) SetUidNil() { + o.Uid.Set(nil) +} + +// UnsetUid ensures that no value is present for Uid, not even an explicit nil +func (o *OperationalWebhookEndpointUpdate) UnsetUid() { + o.Uid.Unset() +} + +// GetUrl returns the Url field value +func (o *OperationalWebhookEndpointUpdate) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *OperationalWebhookEndpointUpdate) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *OperationalWebhookEndpointUpdate) SetUrl(v string) { + o.Url = v +} + +func (o OperationalWebhookEndpointUpdate) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OperationalWebhookEndpointUpdate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Disabled) { + toSerialize["disabled"] = o.Disabled + } + if o.FilterTypes != nil { + toSerialize["filterTypes"] = o.FilterTypes + } + if !IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + if o.RateLimit.IsSet() { + toSerialize["rateLimit"] = o.RateLimit.Get() + } + if o.Uid.IsSet() { + toSerialize["uid"] = o.Uid.Get() + } + toSerialize["url"] = o.Url + return toSerialize, nil +} + +func (o *OperationalWebhookEndpointUpdate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOperationalWebhookEndpointUpdate := _OperationalWebhookEndpointUpdate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varOperationalWebhookEndpointUpdate) + + if err != nil { + return err + } + + *o = OperationalWebhookEndpointUpdate(varOperationalWebhookEndpointUpdate) + + return err +} + +type NullableOperationalWebhookEndpointUpdate struct { + value *OperationalWebhookEndpointUpdate + isSet bool +} + +func (v NullableOperationalWebhookEndpointUpdate) Get() *OperationalWebhookEndpointUpdate { + return v.value +} + +func (v *NullableOperationalWebhookEndpointUpdate) Set(val *OperationalWebhookEndpointUpdate) { + v.value = val + v.isSet = true +} + +func (v NullableOperationalWebhookEndpointUpdate) IsSet() bool { + return v.isSet +} + +func (v *NullableOperationalWebhookEndpointUpdate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOperationalWebhookEndpointUpdate(val *OperationalWebhookEndpointUpdate) *NullableOperationalWebhookEndpointUpdate { + return &NullableOperationalWebhookEndpointUpdate{value: val, isSet: true} +} + +func (v NullableOperationalWebhookEndpointUpdate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOperationalWebhookEndpointUpdate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_stream_sink_in.go b/go/internal/openapi/model_stream_sink_in.go index c585ea2f6..74104ccf1 100644 --- a/go/internal/openapi/model_stream_sink_in.go +++ b/go/internal/openapi/model_stream_sink_in.go @@ -25,6 +25,7 @@ type StreamSinkIn struct { StreamSinkInOneOf4 *StreamSinkInOneOf4 StreamSinkInOneOf5 *StreamSinkInOneOf5 StreamSinkInOneOf6 *StreamSinkInOneOf6 + StreamSinkInOneOf7 *StreamSinkInOneOf7 } // StreamSinkInOneOfAsStreamSinkIn is a convenience function that returns StreamSinkInOneOf wrapped in StreamSinkIn @@ -76,6 +77,13 @@ func StreamSinkInOneOf6AsStreamSinkIn(v *StreamSinkInOneOf6) StreamSinkIn { } } +// StreamSinkInOneOf7AsStreamSinkIn is a convenience function that returns StreamSinkInOneOf7 wrapped in StreamSinkIn +func StreamSinkInOneOf7AsStreamSinkIn(v *StreamSinkInOneOf7) StreamSinkIn { + return StreamSinkIn{ + StreamSinkInOneOf7: v, + } +} + // Unmarshal JSON data into one of the pointers in the struct func (dst *StreamSinkIn) UnmarshalJSON(data []byte) error { @@ -200,6 +208,23 @@ func (dst *StreamSinkIn) UnmarshalJSON(data []byte) error { dst.StreamSinkInOneOf6 = nil } + // try to unmarshal data into StreamSinkInOneOf7 + err = newStrictDecoder(data).Decode(&dst.StreamSinkInOneOf7) + if err == nil { + jsonStreamSinkInOneOf7, _ := json.Marshal(dst.StreamSinkInOneOf7) + if string(jsonStreamSinkInOneOf7) == "{}" { // empty struct + dst.StreamSinkInOneOf7 = nil + } else { + if err = validator.Validate(dst.StreamSinkInOneOf7); err != nil { + dst.StreamSinkInOneOf7 = nil + } else { + match++ + } + } + } else { + dst.StreamSinkInOneOf7 = nil + } + if match > 1 { // more than 1 match // reset to nil dst.StreamSinkInOneOf = nil @@ -209,6 +234,7 @@ func (dst *StreamSinkIn) UnmarshalJSON(data []byte) error { dst.StreamSinkInOneOf4 = nil dst.StreamSinkInOneOf5 = nil dst.StreamSinkInOneOf6 = nil + dst.StreamSinkInOneOf7 = nil return fmt.Errorf("data matches more than one schema in oneOf(StreamSinkIn)") } else if match == 1 { @@ -248,6 +274,10 @@ func (src StreamSinkIn) MarshalJSON() ([]byte, error) { return json.Marshal(&src.StreamSinkInOneOf6) } + if src.StreamSinkInOneOf7 != nil { + return json.Marshal(&src.StreamSinkInOneOf7) + } + return nil, nil // no data in oneOf schemas } @@ -284,6 +314,10 @@ func (obj *StreamSinkIn) GetActualInstance() (interface{}) { return obj.StreamSinkInOneOf6 } + if obj.StreamSinkInOneOf7 != nil { + return obj.StreamSinkInOneOf7 + } + // all schemas are nil return nil } diff --git a/go/internal/openapi/model_stream_sink_in_one_of_7.go b/go/internal/openapi/model_stream_sink_in_one_of_7.go new file mode 100644 index 000000000..1f26c1149 --- /dev/null +++ b/go/internal/openapi/model_stream_sink_in_one_of_7.go @@ -0,0 +1,186 @@ +/* +Svix API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the StreamSinkInOneOf7 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StreamSinkInOneOf7{} + +// StreamSinkInOneOf7 struct for StreamSinkInOneOf7 +type StreamSinkInOneOf7 struct { + Config BigQueryConfig `json:"config"` + Type string `json:"type"` +} + +type _StreamSinkInOneOf7 StreamSinkInOneOf7 + +// NewStreamSinkInOneOf7 instantiates a new StreamSinkInOneOf7 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStreamSinkInOneOf7(config BigQueryConfig, type_ string) *StreamSinkInOneOf7 { + this := StreamSinkInOneOf7{} + this.Config = config + this.Type = type_ + return &this +} + +// NewStreamSinkInOneOf7WithDefaults instantiates a new StreamSinkInOneOf7 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStreamSinkInOneOf7WithDefaults() *StreamSinkInOneOf7 { + this := StreamSinkInOneOf7{} + return &this +} + +// GetConfig returns the Config field value +func (o *StreamSinkInOneOf7) GetConfig() BigQueryConfig { + if o == nil { + var ret BigQueryConfig + return ret + } + + return o.Config +} + +// GetConfigOk returns a tuple with the Config field value +// and a boolean to check if the value has been set. +func (o *StreamSinkInOneOf7) GetConfigOk() (*BigQueryConfig, bool) { + if o == nil { + return nil, false + } + return &o.Config, true +} + +// SetConfig sets field value +func (o *StreamSinkInOneOf7) SetConfig(v BigQueryConfig) { + o.Config = v +} + +// GetType returns the Type field value +func (o *StreamSinkInOneOf7) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *StreamSinkInOneOf7) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *StreamSinkInOneOf7) SetType(v string) { + o.Type = v +} + +func (o StreamSinkInOneOf7) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StreamSinkInOneOf7) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["config"] = o.Config + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *StreamSinkInOneOf7) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "config", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varStreamSinkInOneOf7 := _StreamSinkInOneOf7{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varStreamSinkInOneOf7) + + if err != nil { + return err + } + + *o = StreamSinkInOneOf7(varStreamSinkInOneOf7) + + return err +} + +type NullableStreamSinkInOneOf7 struct { + value *StreamSinkInOneOf7 + isSet bool +} + +func (v NullableStreamSinkInOneOf7) Get() *StreamSinkInOneOf7 { + return v.value +} + +func (v *NullableStreamSinkInOneOf7) Set(val *StreamSinkInOneOf7) { + v.value = val + v.isSet = true +} + +func (v NullableStreamSinkInOneOf7) IsSet() bool { + return v.isSet +} + +func (v *NullableStreamSinkInOneOf7) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStreamSinkInOneOf7(val *StreamSinkInOneOf7) *NullableStreamSinkInOneOf7 { + return &NullableStreamSinkInOneOf7{value: val, isSet: true} +} + +func (v NullableStreamSinkInOneOf7) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStreamSinkInOneOf7) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_stream_sink_out.go b/go/internal/openapi/model_stream_sink_out.go index b234ffe2e..24be1568c 100644 --- a/go/internal/openapi/model_stream_sink_out.go +++ b/go/internal/openapi/model_stream_sink_out.go @@ -25,6 +25,7 @@ type StreamSinkOut struct { StreamSinkInOneOf4 *StreamSinkInOneOf4 StreamSinkInOneOf5 *StreamSinkInOneOf5 StreamSinkInOneOf6 *StreamSinkInOneOf6 + StreamSinkInOneOf7 *StreamSinkInOneOf7 } // StreamSinkInOneOfAsStreamSinkOut is a convenience function that returns StreamSinkInOneOf wrapped in StreamSinkOut @@ -76,6 +77,13 @@ func StreamSinkInOneOf6AsStreamSinkOut(v *StreamSinkInOneOf6) StreamSinkOut { } } +// StreamSinkInOneOf7AsStreamSinkOut is a convenience function that returns StreamSinkInOneOf7 wrapped in StreamSinkOut +func StreamSinkInOneOf7AsStreamSinkOut(v *StreamSinkInOneOf7) StreamSinkOut { + return StreamSinkOut{ + StreamSinkInOneOf7: v, + } +} + // Unmarshal JSON data into one of the pointers in the struct func (dst *StreamSinkOut) UnmarshalJSON(data []byte) error { @@ -200,6 +208,23 @@ func (dst *StreamSinkOut) UnmarshalJSON(data []byte) error { dst.StreamSinkInOneOf6 = nil } + // try to unmarshal data into StreamSinkInOneOf7 + err = newStrictDecoder(data).Decode(&dst.StreamSinkInOneOf7) + if err == nil { + jsonStreamSinkInOneOf7, _ := json.Marshal(dst.StreamSinkInOneOf7) + if string(jsonStreamSinkInOneOf7) == "{}" { // empty struct + dst.StreamSinkInOneOf7 = nil + } else { + if err = validator.Validate(dst.StreamSinkInOneOf7); err != nil { + dst.StreamSinkInOneOf7 = nil + } else { + match++ + } + } + } else { + dst.StreamSinkInOneOf7 = nil + } + if match > 1 { // more than 1 match // reset to nil dst.StreamSinkInOneOf = nil @@ -209,6 +234,7 @@ func (dst *StreamSinkOut) UnmarshalJSON(data []byte) error { dst.StreamSinkInOneOf4 = nil dst.StreamSinkInOneOf5 = nil dst.StreamSinkInOneOf6 = nil + dst.StreamSinkInOneOf7 = nil return fmt.Errorf("data matches more than one schema in oneOf(StreamSinkOut)") } else if match == 1 { @@ -248,6 +274,10 @@ func (src StreamSinkOut) MarshalJSON() ([]byte, error) { return json.Marshal(&src.StreamSinkInOneOf6) } + if src.StreamSinkInOneOf7 != nil { + return json.Marshal(&src.StreamSinkInOneOf7) + } + return nil, nil // no data in oneOf schemas } @@ -284,6 +314,10 @@ func (obj *StreamSinkOut) GetActualInstance() (interface{}) { return obj.StreamSinkInOneOf6 } + if obj.StreamSinkInOneOf7 != nil { + return obj.StreamSinkInOneOf7 + } + // all schemas are nil return nil } diff --git a/go/internal/openapi/model_stream_sink_patch.go b/go/internal/openapi/model_stream_sink_patch.go index 5f880a5e7..1df478938 100644 --- a/go/internal/openapi/model_stream_sink_patch.go +++ b/go/internal/openapi/model_stream_sink_patch.go @@ -25,6 +25,7 @@ type StreamSinkPatch struct { StreamSinkInOneOf4 *StreamSinkInOneOf4 StreamSinkInOneOf5 *StreamSinkInOneOf5 StreamSinkInOneOf6 *StreamSinkInOneOf6 + StreamSinkInOneOf7 *StreamSinkInOneOf7 } // StreamSinkInOneOfAsStreamSinkPatch is a convenience function that returns StreamSinkInOneOf wrapped in StreamSinkPatch @@ -76,6 +77,13 @@ func StreamSinkInOneOf6AsStreamSinkPatch(v *StreamSinkInOneOf6) StreamSinkPatch } } +// StreamSinkInOneOf7AsStreamSinkPatch is a convenience function that returns StreamSinkInOneOf7 wrapped in StreamSinkPatch +func StreamSinkInOneOf7AsStreamSinkPatch(v *StreamSinkInOneOf7) StreamSinkPatch { + return StreamSinkPatch{ + StreamSinkInOneOf7: v, + } +} + // Unmarshal JSON data into one of the pointers in the struct func (dst *StreamSinkPatch) UnmarshalJSON(data []byte) error { @@ -200,6 +208,23 @@ func (dst *StreamSinkPatch) UnmarshalJSON(data []byte) error { dst.StreamSinkInOneOf6 = nil } + // try to unmarshal data into StreamSinkInOneOf7 + err = newStrictDecoder(data).Decode(&dst.StreamSinkInOneOf7) + if err == nil { + jsonStreamSinkInOneOf7, _ := json.Marshal(dst.StreamSinkInOneOf7) + if string(jsonStreamSinkInOneOf7) == "{}" { // empty struct + dst.StreamSinkInOneOf7 = nil + } else { + if err = validator.Validate(dst.StreamSinkInOneOf7); err != nil { + dst.StreamSinkInOneOf7 = nil + } else { + match++ + } + } + } else { + dst.StreamSinkInOneOf7 = nil + } + if match > 1 { // more than 1 match // reset to nil dst.StreamSinkInOneOf = nil @@ -209,6 +234,7 @@ func (dst *StreamSinkPatch) UnmarshalJSON(data []byte) error { dst.StreamSinkInOneOf4 = nil dst.StreamSinkInOneOf5 = nil dst.StreamSinkInOneOf6 = nil + dst.StreamSinkInOneOf7 = nil return fmt.Errorf("data matches more than one schema in oneOf(StreamSinkPatch)") } else if match == 1 { @@ -248,6 +274,10 @@ func (src StreamSinkPatch) MarshalJSON() ([]byte, error) { return json.Marshal(&src.StreamSinkInOneOf6) } + if src.StreamSinkInOneOf7 != nil { + return json.Marshal(&src.StreamSinkInOneOf7) + } + return nil, nil // no data in oneOf schemas } @@ -284,6 +314,10 @@ func (obj *StreamSinkPatch) GetActualInstance() (interface{}) { return obj.StreamSinkInOneOf6 } + if obj.StreamSinkInOneOf7 != nil { + return obj.StreamSinkInOneOf7 + } + // all schemas are nil return nil } diff --git a/openapi.json b/openapi.json index 5b2410788..9ac82f5e0 100644 --- a/openapi.json +++ b/openapi.json @@ -428,6 +428,31 @@ ], "type": "string" }, + "BigQueryConfig": { + "description": "Configuration for a Google Cloud BigQuery sink.", + "properties": { + "credentials": { + "description": "Google Cloud Credentials JSON Object as a string.", + "type": "string" + }, + "datasetId": { + "type": "string" + }, + "projectId": { + "type": "string" + }, + "tableId": { + "type": "string" + } + }, + "required": [ + "credentials", + "datasetId", + "projectId", + "tableId" + ], + "type": "object" + }, "BorderRadiusConfig": { "properties": { "button": { @@ -545,6 +570,11 @@ "$ref": "#/components/schemas/EventIn" }, "type": "array" + }, + "stream": { + "$ref": "#/components/schemas/StreamIn", + "description": "Optionally creates a new Stream alongside the events.\n\nIf the stream id or uid that is used in the path already exists, this argument is ignored.", + "nullable": true } }, "required": [ @@ -1882,6 +1912,21 @@ "description": { "type": "string" }, + "featureFlag": { + "example": "cool-new-feature", + "maxLength": 256, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "groupName": { + "description": "The event type group's name", + "example": "user", + "maxLength": 256, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, "name": { "description": "The event type's name", "example": "user.signup", @@ -2923,6 +2968,34 @@ ], "type": "object" }, + "ListResponse_OperationalWebhookEndpointOut_": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/OperationalWebhookEndpointOut" + }, + "type": "array" + }, + "done": { + "type": "boolean" + }, + "iterator": { + "example": "iterator", + "nullable": true, + "type": "string" + }, + "prevIterator": { + "example": "-iterator", + "nullable": true, + "type": "string" + } + }, + "required": [ + "data", + "done" + ], + "type": "object" + }, "ListResponse_SinkOut_": { "properties": { "data": { @@ -3954,129 +4027,368 @@ ], "type": "object" }, - "Ordering": { - "description": "Defines the ordering in a listing of results.", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - }, - "RecoverIn": { + "OperationalWebhookEndpointIn": { "properties": { - "since": { - "format": "date-time", + "description": { + "default": "", + "example": "An example endpoint name", "type": "string" }, - "until": { - "format": "date-time", + "disabled": { + "default": false, + "example": false, + "type": "boolean" + }, + "filterTypes": { + "example": [ + "message.attempt.failing" + ], + "items": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "minItems": 1, "nullable": true, - "type": "string" - } - }, - "required": [ - "since" - ], - "type": "object" - }, - "RecoverOut": { - "properties": { - "id": { + "type": "array", + "uniqueItems": true + }, + "metadata": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "type": "object" + }, + "rateLimit": { + "format": "uint16", + "minimum": 1, + "nullable": true, + "type": "integer" + }, + "secret": { + "description": "The endpoint's verification secret. If `null` is passed, a secret is automatically generated. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24.", + "example": "whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD", + "nullable": true, + "pattern": "^(whsec_)?[a-zA-Z0-9+/=]{32,100}$", "type": "string" }, - "status": { - "$ref": "#/components/schemas/BackgroundTaskStatus" + "uid": { + "description": "Optional unique identifier for the endpoint", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" }, - "task": { - "$ref": "#/components/schemas/BackgroundTaskType" + "url": { + "example": "https://example.com/webhook/", + "format": "uri", + "maxLength": 65536, + "minLength": 1, + "type": "string" } }, "required": [ - "id", - "status", - "task" + "url" ], "type": "object" }, - "RedshiftConfig": { - "description": "Configuration parameters for defining a Redshift sink.", + "OperationalWebhookEndpointOut": { "properties": { - "accessKeyId": { + "createdAt": { + "format": "date-time", "type": "string" }, - "clusterIdentifier": { + "description": { + "description": "An example endpoint name", "type": "string" }, - "dbName": { - "description": "Database name.\n\nOnly required if not using transformations.", - "type": "string" + "disabled": { + "default": false, + "example": false, + "type": "boolean" }, - "dbUser": { - "type": "string" + "filterTypes": { + "example": [ + "message.attempt.failing" + ], + "items": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "minItems": 1, + "nullable": true, + "type": "array", + "uniqueItems": true }, - "region": { + "id": { + "description": "The ep's ID", + "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2", "type": "string" }, - "schemaName": { - "description": "Schema name.\n\nOnly used if not using transformations.", + "metadata": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "rateLimit": { + "format": "uint16", + "minimum": 0, + "nullable": true, + "type": "integer" + }, + "uid": { + "description": "Optional unique identifier for the endpoint", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, - "secretAccessKey": { + "updatedAt": { + "format": "date-time", "type": "string" }, - "tableName": { - "description": "Table name.\n\nOnly required if not using transformations.", + "url": { + "example": "https://example.com/webhook/", + "format": "uri", + "maxLength": 65536, + "minLength": 1, "type": "string" } }, "required": [ - "accessKeyId", - "clusterIdentifier", - "dbUser", - "region", - "secretAccessKey" + "createdAt", + "description", + "id", + "metadata", + "updatedAt", + "url" ], "type": "object" }, - "ReplayIn": { + "OperationalWebhookEndpointSecretIn": { "properties": { - "since": { - "format": "date-time", - "type": "string" - }, - "until": { - "format": "date-time", + "key": { + "default": null, + "description": "The endpoint's verification secret. If `null` is passed, a secret is automatically generated. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24.", + "example": "whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD", "nullable": true, + "pattern": "^(whsec_)?[a-zA-Z0-9+/=]{32,100}$", "type": "string" } }, - "required": [ - "since" - ], "type": "object" }, - "ReplayOut": { + "OperationalWebhookEndpointSecretOut": { "properties": { - "id": { + "key": { + "description": "The endpoint's verification secret. If `null` is passed, a secret is automatically generated. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24.", + "example": "whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD", + "pattern": "^(whsec_)?[a-zA-Z0-9+/=]{32,100}$", "type": "string" - }, - "status": { - "$ref": "#/components/schemas/BackgroundTaskStatus" - }, - "task": { - "$ref": "#/components/schemas/BackgroundTaskType" } }, "required": [ - "id", - "status", - "task" + "key" ], "type": "object" }, - "RetrySchedule": { - "items": { + "OperationalWebhookEndpointUpdate": { + "properties": { + "description": { + "default": "", + "example": "An example endpoint name", + "type": "string" + }, + "disabled": { + "default": false, + "example": false, + "type": "boolean" + }, + "filterTypes": { + "example": [ + "message.attempt.failing" + ], + "items": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "minItems": 1, + "nullable": true, + "type": "array", + "uniqueItems": true + }, + "metadata": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "type": "object" + }, + "rateLimit": { + "format": "uint16", + "minimum": 1, + "nullable": true, + "type": "integer" + }, + "uid": { + "description": "Optional unique identifier for the endpoint", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "url": { + "example": "https://example.com/webhook/", + "format": "uri", + "maxLength": 65536, + "minLength": 1, + "type": "string" + } + }, + "required": [ + "url" + ], + "type": "object" + }, + "Ordering": { + "description": "Defines the ordering in a listing of results.", + "enum": [ + "ascending", + "descending" + ], + "type": "string" + }, + "RecoverIn": { + "properties": { + "since": { + "format": "date-time", + "type": "string" + }, + "until": { + "format": "date-time", + "nullable": true, + "type": "string" + } + }, + "required": [ + "since" + ], + "type": "object" + }, + "RecoverOut": { + "properties": { + "id": { + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/BackgroundTaskStatus" + }, + "task": { + "$ref": "#/components/schemas/BackgroundTaskType" + } + }, + "required": [ + "id", + "status", + "task" + ], + "type": "object" + }, + "RedshiftConfig": { + "description": "Configuration parameters for defining a Redshift sink.", + "properties": { + "accessKeyId": { + "type": "string" + }, + "clusterIdentifier": { + "type": "string" + }, + "dbName": { + "description": "Database name.\n\nOnly required if not using transformations.", + "type": "string" + }, + "dbUser": { + "type": "string" + }, + "region": { + "type": "string" + }, + "schemaName": { + "description": "Schema name.\n\nOnly used if not using transformations.", + "nullable": true, + "type": "string" + }, + "secretAccessKey": { + "type": "string" + }, + "tableName": { + "description": "Table name.\n\nOnly required if not using transformations.", + "type": "string" + } + }, + "required": [ + "accessKeyId", + "clusterIdentifier", + "dbUser", + "region", + "secretAccessKey" + ], + "type": "object" + }, + "ReplayIn": { + "properties": { + "since": { + "format": "date-time", + "type": "string" + }, + "until": { + "format": "date-time", + "nullable": true, + "type": "string" + } + }, + "required": [ + "since" + ], + "type": "object" + }, + "ReplayOut": { + "properties": { + "id": { + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/BackgroundTaskStatus" + }, + "task": { + "$ref": "#/components/schemas/BackgroundTaskType" + } + }, + "required": [ + "id", + "status", + "task" + ], + "type": "object" + }, + "RetrySchedule": { + "items": { "$ref": "#/components/schemas/Duration" }, "type": "array" @@ -5024,6 +5336,24 @@ "type" ], "type": "object" + }, + { + "properties": { + "config": { + "$ref": "#/components/schemas/BigQueryConfig" + }, + "type": { + "enum": [ + "bigQuery" + ], + "type": "string" + } + }, + "required": [ + "config", + "type" + ], + "type": "object" } ], "properties": { @@ -5184,6 +5514,24 @@ "type" ], "type": "object" + }, + { + "properties": { + "config": { + "$ref": "#/components/schemas/BigQueryConfig" + }, + "type": { + "enum": [ + "bigQuery" + ], + "type": "string" + } + }, + "required": [ + "config", + "type" + ], + "type": "object" } ], "properties": { @@ -5363,6 +5711,24 @@ "type" ], "type": "object" + }, + { + "properties": { + "config": { + "$ref": "#/components/schemas/BigQueryConfig" + }, + "type": { + "enum": [ + "bigQuery" + ], + "type": "string" + } + }, + "required": [ + "config", + "type" + ], + "type": "object" } ], "properties": { @@ -5947,12 +6313,12 @@ { "label": "Python", "lang": "Python", - "source": "list_response_application_out = svix.application.list(None)" + "source": "list_response_application_out = svix.application.list(options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_application_out = await svix.application.list(None)" + "source": "list_response_application_out = await svix.application.list(options=...)" }, { "label": "Go", @@ -6146,12 +6512,12 @@ { "label": "Python", "lang": "Python", - "source": "application_out = svix.application.create(ApplicationIn(\n name=\"My first application\",\n rate_limit=None,\n uid=\"unique-app-identifier\"\n), None)" + "source": "application_out = svix.application.create(ApplicationIn(\n name=\"My first application\",\n rate_limit=None,\n uid=\"unique-app-identifier\"\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "application_out = await svix.application.create(ApplicationIn(\n name=\"My first application\",\n rate_limit=None,\n uid=\"unique-app-identifier\"\n), None)" + "source": "application_out = await svix.application.create(ApplicationIn(\n name=\"My first application\",\n rate_limit=None,\n uid=\"unique-app-identifier\"\n), options=...)" }, { "label": "Go", @@ -6345,73 +6711,18 @@ ], "x-codeSamples": [ { - "label": "JavaScript", - "lang": "JavaScript", - "source": "const listResponseApplicationStats = await svix.app.stats();" - }, - { - "label": "TypeScript", - "lang": "JavaScript", - "source": "const listResponseApplicationStats = await svix.app.stats();" - }, - { - "label": "Python", - "lang": "Python", - "source": "list_response_application_stats = svix.app.stats()" - }, - { - "label": "Python (Async)", - "lang": "Python", - "source": "list_response_application_stats = await svix.app.stats()" - }, - { - "label": "Go", - "lang": "Go", - "source": "listResponseApplicationStats, err := svixClient.App.Stats(ctx)" - }, - { - "label": "Kotlin", - "lang": "Kotlin", - "source": "val listResponseApplicationStats = svix.app.stats()" - }, - { - "label": "Java", - "lang": "Java", - "source": "ListResponseApplicationStats listResponseApplicationStats = svix.getApp().stats()" - }, - { - "label": "Ruby", - "lang": "Ruby", - "source": "list_response_application_stats = svix.app.stats()" - }, - { - "label": "Rust", - "lang": "Rust", - "source": "let list_response_application_stats = svix.app().stats().await?;" - }, - { - "label": "C#", - "lang": "C#", - "source": "var listResponseApplicationStats = await svix.App.StatsAsync()" - }, - { - "label": "CLI", - "lang": "Shell", - "source": "svix app stats " - }, - { - "label": "cURL", - "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/stats/usage' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" - } - ] - } - }, - "/api/v1/app/{app_id}": { - "delete": { - "description": "Delete an application.", - "operationId": "v1.application.delete", - "parameters": [ + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/stats/usage' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/app/{app_id}": { + "delete": { + "description": "Delete an application.", + "operationId": "v1.application.delete", + "parameters": [ { "description": "The app's ID or UID", "in": "path", @@ -7159,12 +7470,12 @@ "style": "form" }, { - "description": "Filter response based on the delivery status", + "description": "Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3)", "in": "query", "name": "status", "schema": { "$ref": "#/components/schemas/MessageStatus", - "description": "Filter response based on the delivery status", + "description": "Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3)", "nullable": true }, "style": "form" @@ -7409,12 +7720,12 @@ { "label": "Python", "lang": "Python", - "source": "list_response_message_attempt_out = svix.message_attempt.list_by_endpoint(\"app_id\", \"endpoint_id\", None)" + "source": "list_response_message_attempt_out = svix.message_attempt.list_by_endpoint(\"app_id\", \"endpoint_id\", options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_message_attempt_out = await svix.message_attempt.list_by_endpoint(\"app_id\", \"endpoint_id\", None)" + "source": "list_response_message_attempt_out = await svix.message_attempt.list_by_endpoint(\"app_id\", \"endpoint_id\", options=...)" }, { "label": "Go", @@ -7490,12 +7801,12 @@ "style": "form" }, { - "description": "Filter response based on the delivery status", + "description": "Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3)", "in": "query", "name": "status", "schema": { "$ref": "#/components/schemas/MessageStatus", - "description": "Filter response based on the delivery status", + "description": "Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3)", "nullable": true }, "style": "form" @@ -7744,12 +8055,12 @@ { "label": "Python", "lang": "Python", - "source": "list_response_message_attempt_out = svix.message_attempt.list_by_msg(\"app_id\", \"msg_id\", None)" + "source": "list_response_message_attempt_out = svix.message_attempt.list_by_msg(\"app_id\", \"msg_id\", options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_message_attempt_out = await svix.message_attempt.list_by_msg(\"app_id\", \"msg_id\", None)" + "source": "list_response_message_attempt_out = await svix.message_attempt.list_by_msg(\"app_id\", \"msg_id\", options=...)" }, { "label": "Go", @@ -7956,12 +8267,12 @@ { "label": "Python", "lang": "Python", - "source": "list_response_endpoint_out = svix.endpoint.list(\"app_id\", None)" + "source": "list_response_endpoint_out = svix.endpoint.list(\"app_id\", options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_endpoint_out = await svix.endpoint.list(\"app_id\", None)" + "source": "list_response_endpoint_out = await svix.endpoint.list(\"app_id\", options=...)" }, { "label": "Go", @@ -8149,12 +8460,12 @@ { "label": "Python", "lang": "Python", - "source": "endpoint_out = svix.endpoint.create(\"app_id\", EndpointIn(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n url=\"https://example.com/webhook/\",\n version=1,\n disabled=False,\n filter_types=[\"user.signup\", \"user.deleted\"],\n channels=[\"project_123\", \"group_2\"],\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), None)" + "source": "endpoint_out = svix.endpoint.create(\"app_id\", EndpointIn(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n url=\"https://example.com/webhook/\",\n version=1,\n disabled=False,\n filter_types=[\"user.signup\", \"user.deleted\"],\n channels=[\"project_123\", \"group_2\"],\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "endpoint_out = await svix.endpoint.create(\"app_id\", EndpointIn(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n url=\"https://example.com/webhook/\",\n version=1,\n disabled=False,\n filter_types=[\"user.signup\", \"user.deleted\"],\n channels=[\"project_123\", \"group_2\"],\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), None)" + "source": "endpoint_out = await svix.endpoint.create(\"app_id\", EndpointIn(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n url=\"https://example.com/webhook/\",\n version=1,\n disabled=False,\n filter_types=[\"user.signup\", \"user.deleted\"],\n channels=[\"project_123\", \"group_2\"],\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), options=...)" }, { "label": "Go", @@ -9614,12 +9925,12 @@ "style": "form" }, { - "description": "Filter response based on the delivery status", + "description": "Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3)", "in": "query", "name": "status", "schema": { "$ref": "#/components/schemas/MessageStatus", - "description": "Filter response based on the delivery status", + "description": "Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3)", "nullable": true }, "style": "form" @@ -9814,12 +10125,12 @@ { "label": "Python", "lang": "Python", - "source": "list_response_endpoint_message_out = svix.message_attempt.list_attempted_messages(\"app_id\", \"endpoint_id\", None)" + "source": "list_response_endpoint_message_out = svix.message_attempt.list_attempted_messages(\"app_id\", \"endpoint_id\", options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_endpoint_message_out = await svix.message_attempt.list_attempted_messages(\"app_id\", \"endpoint_id\", None)" + "source": "list_response_endpoint_message_out = await svix.message_attempt.list_attempted_messages(\"app_id\", \"endpoint_id\", options=...)" }, { "label": "Go", @@ -10009,6 +10320,13 @@ "summary": "Create Message Attempt For Endpoint", "tags": [ "Message" + ], + "x-codeSamples": [ + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg/test-attempt' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"eventId\": \"unique-msg-identifier\",\n \"eventType\": \"user.signup\",\n \"payload\": {\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"},\n \"channels\": [\"project_123\", \"group_2\"],\n \"application\": null,\n \"tags\": [\"my_tag\", \"other\"],\n \"transformationsParams\": null,\n \"payloadRetentionPeriod\": 90,\n \"payloadRetentionHours\": null\n }'" + } ] } }, @@ -10766,7 +11084,7 @@ }, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover": { "post": { - "description": "Resend all failed messages since a given time.", + "description": "Resend all failed messages since a given time.\n\nMessages that were sent successfully, even if failed initially, are not resent.", "operationId": "v1.endpoint.recover", "parameters": [ { @@ -10924,12 +11242,12 @@ { "label": "Python", "lang": "Python", - "source": "recover_out = svix.endpoint.recover(\"app_id\", \"endpoint_id\", RecoverIn(\n until=None\n), None)" + "source": "recover_out = svix.endpoint.recover(\"app_id\", \"endpoint_id\", RecoverIn(\n until=None\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "recover_out = await svix.endpoint.recover(\"app_id\", \"endpoint_id\", RecoverIn(\n until=None\n), None)" + "source": "recover_out = await svix.endpoint.recover(\"app_id\", \"endpoint_id\", RecoverIn(\n until=None\n), options=...)" }, { "label": "Go", @@ -11134,12 +11452,12 @@ { "label": "Python", "lang": "Python", - "source": "replay_out = svix.endpoint.replay(\"app_id\", \"endpoint_id\", ReplayIn(\n until=None\n), None)" + "source": "replay_out = svix.endpoint.replay(\"app_id\", \"endpoint_id\", ReplayIn(\n until=None\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "replay_out = await svix.endpoint.replay(\"app_id\", \"endpoint_id\", ReplayIn(\n until=None\n), None)" + "source": "replay_out = await svix.endpoint.replay(\"app_id\", \"endpoint_id\", ReplayIn(\n until=None\n), options=...)" }, { "label": "Go", @@ -11377,7 +11695,7 @@ }, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate": { "post": { - "description": "Rotates the endpoint's signing secret. The previous secret will be valid for the next 24 hours.", + "description": "Rotates the endpoint's signing secret.\n\nThe previous secret will remain valid for the next 24 hours.", "operationId": "v1.endpoint.rotate-secret", "parameters": [ { @@ -11528,12 +11846,12 @@ { "label": "Python", "lang": "Python", - "source": "svix.endpoint.rotate_secret(\"app_id\", \"endpoint_id\", EndpointSecretRotateIn(\n key=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), None)" + "source": "svix.endpoint.rotate_secret(\"app_id\", \"endpoint_id\", EndpointSecretRotateIn(\n key=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.endpoint.rotate_secret(\"app_id\", \"endpoint_id\", EndpointSecretRotateIn(\n key=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), None)" + "source": "await svix.endpoint.rotate_secret(\"app_id\", \"endpoint_id\", EndpointSecretRotateIn(\n key=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), options=...)" }, { "label": "Go", @@ -11738,12 +12056,12 @@ { "label": "Python", "lang": "Python", - "source": "message_out = svix.endpoint.send_example(\"app_id\", \"endpoint_id\", EventExampleIn(\n event_type=\"user.signup\"\n), None)" + "source": "message_out = svix.endpoint.send_example(\"app_id\", \"endpoint_id\", EventExampleIn(\n event_type=\"user.signup\"\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "message_out = await svix.endpoint.send_example(\"app_id\", \"endpoint_id\", EventExampleIn(\n event_type=\"user.signup\"\n), None)" + "source": "message_out = await svix.endpoint.send_example(\"app_id\", \"endpoint_id\", EventExampleIn(\n event_type=\"user.signup\"\n), options=...)" }, { "label": "Go", @@ -12740,12 +13058,12 @@ { "label": "Python", "lang": "Python", - "source": "endpoint_transformation_simulate_out = svix.endpoint.transformation_simulate(\"app_id\", \"endpoint_id\", EndpointTransformationSimulateIn(\n event_type=\"user.signup\",\n channels=None\n), None)" + "source": "endpoint_transformation_simulate_out = svix.endpoint.transformation_simulate(\"app_id\", \"endpoint_id\", EndpointTransformationSimulateIn(\n event_type=\"user.signup\",\n channels=None\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "endpoint_transformation_simulate_out = await svix.endpoint.transformation_simulate(\"app_id\", \"endpoint_id\", EndpointTransformationSimulateIn(\n event_type=\"user.signup\",\n channels=None\n), None)" + "source": "endpoint_transformation_simulate_out = await svix.endpoint.transformation_simulate(\"app_id\", \"endpoint_id\", EndpointTransformationSimulateIn(\n event_type=\"user.signup\",\n channels=None\n), options=...)" }, { "label": "Go", @@ -13436,61 +13754,6 @@ "Message" ], "x-codeSamples": [ - { - "label": "JavaScript", - "lang": "JavaScript", - "source": "const messageSubscriberAuthTokenOut = await svix.message.eventsSubscription(\"app_id\", \"subscription_id\");" - }, - { - "label": "TypeScript", - "lang": "JavaScript", - "source": "const messageSubscriberAuthTokenOut = await svix.message.eventsSubscription(\"app_id\", \"subscription_id\");" - }, - { - "label": "Python", - "lang": "Python", - "source": "message_subscriber_auth_token_out = svix.message.events_subscription(\"app_id\", \"subscription_id\", None)" - }, - { - "label": "Python (Async)", - "lang": "Python", - "source": "message_subscriber_auth_token_out = await svix.message.events_subscription(\"app_id\", \"subscription_id\", None)" - }, - { - "label": "Go", - "lang": "Go", - "source": "messageSubscriberAuthTokenOut, err := svixClient.Message.EventsSubscription(ctx, \"app_id\", \"subscription_id\")" - }, - { - "label": "Kotlin", - "lang": "Kotlin", - "source": "val messageSubscriberAuthTokenOut = svix.message.eventsSubscription(\"app_id\", \"subscription_id\")" - }, - { - "label": "Java", - "lang": "Java", - "source": "MessageSubscriberAuthTokenOut messageSubscriberAuthTokenOut = svix.getMessage().eventsSubscription(\"app_id\", \"subscription_id\")" - }, - { - "label": "Ruby", - "lang": "Ruby", - "source": "message_subscriber_auth_token_out = svix.message.events_subscription(\"app_id\", \"subscription_id\")" - }, - { - "label": "Rust", - "lang": "Rust", - "source": "let message_subscriber_auth_token_out = svix.message().events_subscription(\"app_id\", \"subscription_id\", None).await?;" - }, - { - "label": "C#", - "lang": "C#", - "source": "var messageSubscriberAuthTokenOut = await svix.Message.EventsSubscriptionAsync(\"app_id\", \"subscription_id\")" - }, - { - "label": "CLI", - "lang": "Shell", - "source": "svix message events-subscription \"app_id\" \"subscription_id\"" - }, { "label": "cURL", "lang": "Shell", @@ -13667,12 +13930,12 @@ { "label": "Python", "lang": "Python", - "source": "message_out = svix.inbound.msg(\"app_id\", \"inbound_token\", None)" + "source": "message_out = svix.inbound.msg(\"app_id\", \"inbound_token\", options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "message_out = await svix.inbound.msg(\"app_id\", \"inbound_token\", None)" + "source": "message_out = await svix.inbound.msg(\"app_id\", \"inbound_token\", options=...)" }, { "label": "Go", @@ -13852,12 +14115,12 @@ { "label": "Python", "lang": "Python", - "source": "rotated_url_out = svix.inbound.rotate_url(\"app_id\", None)" + "source": "rotated_url_out = svix.inbound.rotate_url(\"app_id\", options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "rotated_url_out = await svix.inbound.rotate_url(\"app_id\", None)" + "source": "rotated_url_out = await svix.inbound.rotate_url(\"app_id\", options=...)" }, { "label": "Go", @@ -14064,12 +14327,12 @@ { "label": "Python", "lang": "Python", - "source": "list_response_integration_out = svix.integration.list(\"app_id\", None)" + "source": "list_response_integration_out = svix.integration.list(\"app_id\", options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_integration_out = await svix.integration.list(\"app_id\", None)" + "source": "list_response_integration_out = await svix.integration.list(\"app_id\", options=...)" }, { "label": "Go", @@ -14257,12 +14520,12 @@ { "label": "Python", "lang": "Python", - "source": "integration_out = svix.integration.create(\"app_id\", IntegrationIn(\n name=\"Example Integration\"\n), None)" + "source": "integration_out = svix.integration.create(\"app_id\", IntegrationIn(\n name=\"Example Integration\"\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "integration_out = await svix.integration.create(\"app_id\", IntegrationIn(\n name=\"Example Integration\"\n), None)" + "source": "integration_out = await svix.integration.create(\"app_id\", IntegrationIn(\n name=\"Example Integration\"\n), options=...)" }, { "label": "Go", @@ -15206,12 +15469,12 @@ { "label": "Python", "lang": "Python", - "source": "integration_key_out = svix.integration.rotate_key(\"app_id\", \"integ_id\", None)" + "source": "integration_key_out = svix.integration.rotate_key(\"app_id\", \"integ_id\", options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "integration_key_out = await svix.integration.rotate_key(\"app_id\", \"integ_id\", None)" + "source": "integration_key_out = await svix.integration.rotate_key(\"app_id\", \"integ_id\", options=...)" }, { "label": "Go", @@ -15489,12 +15752,12 @@ { "label": "Python", "lang": "Python", - "source": "list_response_message_out = svix.message.list(\"app_id\", None)" + "source": "list_response_message_out = svix.message.list(\"app_id\", options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_message_out = await svix.message.list(\"app_id\", None)" + "source": "list_response_message_out = await svix.message.list(\"app_id\", options=...)" }, { "label": "Go", @@ -15703,12 +15966,12 @@ { "label": "Python", "lang": "Python", - "source": "message_out = svix.message.create(\"app_id\", MessageIn(\n event_id=\"unique-msg-identifier\",\n event_type=\"user.signup\",\n payload={\"email\": \"test@example.com\", \"type\": \"user.created\", \"username\": \"test_user\"},\n channels=[\"project_123\", \"group_2\"],\n application=None,\n tags=[\"my_tag\", \"other\"],\n transformations_params=None,\n payload_retention_period=90,\n payload_retention_hours=None\n), None)" + "source": "message_out = svix.message.create(\"app_id\", MessageIn(\n event_id=\"unique-msg-identifier\",\n event_type=\"user.signup\",\n payload={\"email\": \"test@example.com\", \"type\": \"user.created\", \"username\": \"test_user\"},\n channels=[\"project_123\", \"group_2\"],\n application=None,\n tags=[\"my_tag\", \"other\"],\n transformations_params=None,\n payload_retention_period=90,\n payload_retention_hours=None\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "message_out = await svix.message.create(\"app_id\", MessageIn(\n event_id=\"unique-msg-identifier\",\n event_type=\"user.signup\",\n payload={\"email\": \"test@example.com\", \"type\": \"user.created\", \"username\": \"test_user\"},\n channels=[\"project_123\", \"group_2\"],\n application=None,\n tags=[\"my_tag\", \"other\"],\n transformations_params=None,\n payload_retention_period=90,\n payload_retention_hours=None\n), None)" + "source": "message_out = await svix.message.create(\"app_id\", MessageIn(\n event_id=\"unique-msg-identifier\",\n event_type=\"user.signup\",\n payload={\"email\": \"test@example.com\", \"type\": \"user.created\", \"username\": \"test_user\"},\n channels=[\"project_123\", \"group_2\"],\n application=None,\n tags=[\"my_tag\", \"other\"],\n transformations_params=None,\n payload_retention_period=90,\n payload_retention_hours=None\n), options=...)" }, { "label": "Go", @@ -16030,12 +16293,12 @@ "style": "form" }, { - "description": "Filter response based on the delivery status", + "description": "Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3)", "in": "query", "name": "status", "schema": { "$ref": "#/components/schemas/MessageStatus", - "description": "Filter response based on the delivery status", + "description": "Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3)", "nullable": true }, "style": "form" @@ -16230,12 +16493,12 @@ { "label": "Python", "lang": "Python", - "source": "list_response_message_attempt_out = svix.message_attempt.list_by_msg_deprecated(\"app_id\", \"msg_id\", None)" + "source": "list_response_message_attempt_out = svix.message_attempt.list_by_msg_deprecated(\"app_id\", \"msg_id\", options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_message_attempt_out = await svix.message_attempt.list_by_msg_deprecated(\"app_id\", \"msg_id\", None)" + "source": "list_response_message_attempt_out = await svix.message_attempt.list_by_msg_deprecated(\"app_id\", \"msg_id\", options=...)" }, { "label": "Go", @@ -17232,12 +17495,12 @@ { "label": "Python", "lang": "Python", - "source": "list_response_message_endpoint_out = svix.message_attempt.list_attempted_destinations(\"app_id\", \"msg_id\", None)" + "source": "list_response_message_endpoint_out = svix.message_attempt.list_attempted_destinations(\"app_id\", \"msg_id\", options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_message_endpoint_out = await svix.message_attempt.list_attempted_destinations(\"app_id\", \"msg_id\", None)" + "source": "list_response_message_endpoint_out = await svix.message_attempt.list_attempted_destinations(\"app_id\", \"msg_id\", options=...)" }, { "label": "Go", @@ -17342,12 +17605,12 @@ "style": "form" }, { - "description": "Filter response based on the delivery status", + "description": "Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3)", "in": "query", "name": "status", "schema": { "$ref": "#/components/schemas/MessageStatus", - "description": "Filter response based on the delivery status", + "description": "Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3)", "nullable": true }, "style": "form" @@ -17546,12 +17809,12 @@ { "label": "Python", "lang": "Python", - "source": "list_response_message_attempt_endpoint_out = svix.message_attempt.list_by_endpoint_deprecated(\"app_id\", \"msg_id\", \"endpoint_id\", None)" + "source": "list_response_message_attempt_endpoint_out = svix.message_attempt.list_by_endpoint_deprecated(\"app_id\", \"msg_id\", \"endpoint_id\", options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_message_attempt_endpoint_out = await svix.message_attempt.list_by_endpoint_deprecated(\"app_id\", \"msg_id\", \"endpoint_id\", None)" + "source": "list_response_message_attempt_endpoint_out = await svix.message_attempt.list_by_endpoint_deprecated(\"app_id\", \"msg_id\", \"endpoint_id\", options=...)" }, { "label": "Go", @@ -17754,12 +18017,12 @@ { "label": "Python", "lang": "Python", - "source": "svix.message_attempt.resend(\"app_id\", \"msg_id\", \"endpoint_id\", None)" + "source": "svix.message_attempt.resend(\"app_id\", \"msg_id\", \"endpoint_id\", options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.message_attempt.resend(\"app_id\", \"msg_id\", \"endpoint_id\", None)" + "source": "await svix.message_attempt.resend(\"app_id\", \"msg_id\", \"endpoint_id\", options=...)" }, { "label": "Go", @@ -17807,7 +18070,7 @@ "/api/v1/app/{app_id}/msg/{msg_id}/raw": { "get": { "description": "Get a message raw payload by its ID or eventID.", - "operationId": "v1.message.get_raw_payload", + "operationId": "v1.message.get-raw-payload", "parameters": [ { "description": "The app's ID or UID", @@ -17935,57 +18198,57 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const messageRawPayloadOut = await svix.message.get(\"app_id\", \"msg_id\");" + "source": "const messageRawPayloadOut = await svix.message.getRawPayload(\"app_id\", \"msg_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const messageRawPayloadOut = await svix.message.get(\"app_id\", \"msg_id\");" + "source": "const messageRawPayloadOut = await svix.message.getRawPayload(\"app_id\", \"msg_id\");" }, { "label": "Python", "lang": "Python", - "source": "message_raw_payload_out = svix.message.get(\"app_id\", \"msg_id\")" + "source": "message_raw_payload_out = svix.message.get_raw_payload(\"app_id\", \"msg_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "message_raw_payload_out = await svix.message.get(\"app_id\", \"msg_id\")" + "source": "message_raw_payload_out = await svix.message.get_raw_payload(\"app_id\", \"msg_id\")" }, { "label": "Go", "lang": "Go", - "source": "messageRawPayloadOut, err := svixClient.Message.Get(ctx, \"app_id\", \"msg_id\")" + "source": "messageRawPayloadOut, err := svixClient.Message.GetRawPayload(ctx, \"app_id\", \"msg_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val messageRawPayloadOut = svix.message.get(\"app_id\", \"msg_id\")" + "source": "val messageRawPayloadOut = svix.message.getRawPayload(\"app_id\", \"msg_id\")" }, { "label": "Java", "lang": "Java", - "source": "MessageRawPayloadOut messageRawPayloadOut = svix.getMessage().get(\"app_id\", \"msg_id\")" + "source": "MessageRawPayloadOut messageRawPayloadOut = svix.getMessage().getRawPayload(\"app_id\", \"msg_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "message_raw_payload_out = svix.message.get(\"app_id\", \"msg_id\")" + "source": "message_raw_payload_out = svix.message.get_raw_payload(\"app_id\", \"msg_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let message_raw_payload_out = svix.message().get(\"app_id\", \"msg_id\").await?;" + "source": "let message_raw_payload_out = svix.message().get_raw_payload(\"app_id\", \"msg_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "var messageRawPayloadOut = await svix.Message.GetAsync(\"app_id\", \"msg_id\")" + "source": "var messageRawPayloadOut = await svix.Message.GetRawPayloadAsync(\"app_id\", \"msg_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix message get \"app_id\" \"msg_id\"" + "source": "svix message get-raw-payload \"app_id\" \"msg_id\"" }, { "label": "cURL", @@ -18157,12 +18420,12 @@ { "label": "Python", "lang": "Python", - "source": "list_response_sink_out = svix.sink.list(\"app_id\", None)" + "source": "list_response_sink_out = svix.sink.list(\"app_id\", options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_sink_out = await svix.sink.list(\"app_id\", None)" + "source": "list_response_sink_out = await svix.sink.list(\"app_id\", options=...)" }, { "label": "Go", @@ -18350,12 +18613,12 @@ { "label": "Python", "lang": "Python", - "source": "sink_out = svix.sink.create(\"app_id\", SinkIn(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n disabled=False,\n filter_types=[\"user.signup\", \"user.deleted\"],\n channels=[\"project_123\", \"group_2\"]\n), None)" + "source": "sink_out = svix.sink.create(\"app_id\", SinkIn(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n disabled=False,\n filter_types=[\"user.signup\", \"user.deleted\"],\n channels=[\"project_123\", \"group_2\"]\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "sink_out = await svix.sink.create(\"app_id\", SinkIn(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n disabled=False,\n filter_types=[\"user.signup\", \"user.deleted\"],\n channels=[\"project_123\", \"group_2\"]\n), None)" + "source": "sink_out = await svix.sink.create(\"app_id\", SinkIn(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n disabled=False,\n filter_types=[\"user.signup\", \"user.deleted\"],\n channels=[\"project_123\", \"group_2\"]\n), options=...)" }, { "label": "Go", @@ -18936,12 +19199,12 @@ { "label": "Python", "lang": "Python", - "source": "app_portal_access_out = svix.authentication.app_portal_access(\"app_id\", AppPortalAccessIn(\n feature_flags=[],\n expiry=None,\n read_only=None,\n application=None\n), None)" + "source": "app_portal_access_out = svix.authentication.app_portal_access(\"app_id\", AppPortalAccessIn(\n feature_flags=[],\n expiry=None,\n read_only=None,\n application=None\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "app_portal_access_out = await svix.authentication.app_portal_access(\"app_id\", AppPortalAccessIn(\n feature_flags=[],\n expiry=None,\n read_only=None,\n application=None\n), None)" + "source": "app_portal_access_out = await svix.authentication.app_portal_access(\"app_id\", AppPortalAccessIn(\n feature_flags=[],\n expiry=None,\n read_only=None,\n application=None\n), options=...)" }, { "label": "Go", @@ -19131,12 +19394,12 @@ { "label": "Python", "lang": "Python", - "source": "auth_token_out = svix.authentication.create_message_token(\"app_id\", CreateMessageTokenIn(\n expiry=None\n), None)" + "source": "auth_token_out = svix.authentication.create_message_token(\"app_id\", CreateMessageTokenIn(\n expiry=None\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "auth_token_out = await svix.authentication.create_message_token(\"app_id\", CreateMessageTokenIn(\n expiry=None\n), None)" + "source": "auth_token_out = await svix.authentication.create_message_token(\"app_id\", CreateMessageTokenIn(\n expiry=None\n), options=...)" }, { "label": "Go", @@ -19319,12 +19582,12 @@ { "label": "Python", "lang": "Python", - "source": "svix.authentication.expire_all(\"app_id\", ApplicationTokenExpireIn(\n expiry=60\n), None)" + "source": "svix.authentication.expire_all(\"app_id\", ApplicationTokenExpireIn(\n expiry=60\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.authentication.expire_all(\"app_id\", ApplicationTokenExpireIn(\n expiry=60\n), None)" + "source": "await svix.authentication.expire_all(\"app_id\", ApplicationTokenExpireIn(\n expiry=60\n), options=...)" }, { "label": "Go", @@ -19505,12 +19768,12 @@ { "label": "Python", "lang": "Python", - "source": "dashboard_access_out = svix.authentication.dashboard_access(\"app_id\", None)" + "source": "dashboard_access_out = svix.authentication.dashboard_access(\"app_id\", options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "dashboard_access_out = await svix.authentication.dashboard_access(\"app_id\", None)" + "source": "dashboard_access_out = await svix.authentication.dashboard_access(\"app_id\", options=...)" }, { "label": "Go", @@ -19668,12 +19931,12 @@ { "label": "Python", "lang": "Python", - "source": "svix.authentication.logout(None)" + "source": "svix.authentication.logout(options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.authentication.logout(None)" + "source": "await svix.authentication.logout(options=...)" }, { "label": "Go", @@ -19848,12 +20111,12 @@ { "label": "Python", "lang": "Python", - "source": "one_time_token_out = svix.authentication.exchange_one_time_token(OneTimeTokenIn\n), None)" + "source": "one_time_token_out = svix.authentication.exchange_one_time_token(OneTimeTokenIn\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "one_time_token_out = await svix.authentication.exchange_one_time_token(OneTimeTokenIn\n), None)" + "source": "one_time_token_out = await svix.authentication.exchange_one_time_token(OneTimeTokenIn\n), options=...)" }, { "label": "Go", @@ -20051,6 +20314,13 @@ "summary": "List Background Tasks", "tags": [ "Background Tasks" + ], + "x-codeSamples": [ + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/background-task' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } ] } }, @@ -20159,6 +20429,13 @@ "summary": "Get Background Task", "tags": [ "Background Tasks" + ], + "x-codeSamples": [ + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/background-task/{task_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } ] } }, @@ -20258,61 +20535,6 @@ "Environment" ], "x-codeSamples": [ - { - "label": "JavaScript", - "lang": "JavaScript", - "source": "const environmentOut = await svix.environment.export();" - }, - { - "label": "TypeScript", - "lang": "JavaScript", - "source": "const environmentOut = await svix.environment.export();" - }, - { - "label": "Python", - "lang": "Python", - "source": "environment_out = svix.environment.export()" - }, - { - "label": "Python (Async)", - "lang": "Python", - "source": "environment_out = await svix.environment.export()" - }, - { - "label": "Go", - "lang": "Go", - "source": "environmentOut, err := svixClient.Environment.Export(ctx)" - }, - { - "label": "Kotlin", - "lang": "Kotlin", - "source": "val environmentOut = svix.environment.export()" - }, - { - "label": "Java", - "lang": "Java", - "source": "EnvironmentOut environmentOut = svix.getEnvironment().export()" - }, - { - "label": "Ruby", - "lang": "Ruby", - "source": "environment_out = svix.environment.export()" - }, - { - "label": "Rust", - "lang": "Rust", - "source": "let environment_out = svix.environment().export().await?;" - }, - { - "label": "C#", - "lang": "C#", - "source": "var environmentOut = await svix.Environment.ExportAsync()" - }, - { - "label": "CLI", - "lang": "Shell", - "source": "svix environment export " - }, { "label": "cURL", "lang": "Shell", @@ -20439,12 +20661,12 @@ { "label": "Python", "lang": "Python", - "source": "environment_out = svix.environment.export(None)" + "source": "environment_out = svix.environment.export(options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "environment_out = await svix.environment.export(None)" + "source": "environment_out = await svix.environment.export(options=...)" }, { "label": "Go", @@ -20612,12 +20834,12 @@ { "label": "Python", "lang": "Python", - "source": "svix.environment.import(EnvironmentIn(\n event_types=None,\n settings=None,\n transformation_templates=None\n), None)" + "source": "svix.environment.import(EnvironmentIn(\n event_types=None,\n settings=None,\n transformation_templates=None\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.environment.import(EnvironmentIn(\n event_types=None,\n settings=None,\n transformation_templates=None\n), None)" + "source": "await svix.environment.import(EnvironmentIn(\n event_types=None,\n settings=None,\n transformation_templates=None\n), options=...)" }, { "label": "Go", @@ -20992,12 +21214,12 @@ { "label": "Python", "lang": "Python", - "source": "list_response_event_type_out = svix.event_type.list(None)" + "source": "list_response_event_type_out = svix.event_type.list(options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_event_type_out = await svix.event_type.list(None)" + "source": "list_response_event_type_out = await svix.event_type.list(options=...)" }, { "label": "Go", @@ -21170,12 +21392,12 @@ { "label": "Python", "lang": "Python", - "source": "event_type_out = svix.event_type.create(EventTypeIn(\n name=\"user.signup\",\n description=\"A user has signed up\",\n archived=False,\n schemas={\"1\": {\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"}},\n feature_flag=\"cool-new-feature\",\n group_name=\"user\"\n), None)" + "source": "event_type_out = svix.event_type.create(EventTypeIn(\n name=\"user.signup\",\n description=\"A user has signed up\",\n archived=False,\n schemas={\"1\": {\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"}},\n feature_flag=\"cool-new-feature\",\n group_name=\"user\"\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "event_type_out = await svix.event_type.create(EventTypeIn(\n name=\"user.signup\",\n description=\"A user has signed up\",\n archived=False,\n schemas={\"1\": {\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"}},\n feature_flag=\"cool-new-feature\",\n group_name=\"user\"\n), None)" + "source": "event_type_out = await svix.event_type.create(EventTypeIn(\n name=\"user.signup\",\n description=\"A user has signed up\",\n archived=False,\n schemas={\"1\": {\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"}},\n feature_flag=\"cool-new-feature\",\n group_name=\"user\"\n), options=...)" }, { "label": "Go", @@ -21340,12 +21562,12 @@ { "label": "Python", "lang": "Python", - "source": "export_event_type_out = svix.event_type.export_openapi(None)" + "source": "export_event_type_out = svix.event_type.export_openapi(options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "export_event_type_out = await svix.event_type.export_openapi(None)" + "source": "export_event_type_out = await svix.event_type.export_openapi(options=...)" }, { "label": "Go", @@ -21521,12 +21743,12 @@ { "label": "Python", "lang": "Python", - "source": "event_type_import_open_api_out = svix.event_type.import_openapi(EventTypeImportOpenApiIn(\n spec={\"info\": {\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": {\"pet.new\": {\"post\": {\"requestBody\": {\"content\": {\"application/json\": {\"schema\": {\"properties\": {\"id\": {\"format\": \"int64\", \"type\": \"integer\"}, \"name\": {\"type\": \"string\"}, \"tag\": {\"type\": \"string\"}}, \"required\": [\"id\", \"name\"]}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": {\"200\": {\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n spec_raw={\"info\": {\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": {\"pet.new\": {\"post\": {\"requestBody\": {\"content\": {\"application/json\": {\"schema\": {\"properties\": {\"id\": {\"format\": \"int64\", \"type\": \"integer\"}, \"name\": {\"type\": \"string\"}, \"tag\": {\"type\": \"string\"}}, \"required\": [\"id\", \"name\"]}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": {\"200\": {\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n), None)" + "source": "event_type_import_open_api_out = svix.event_type.import_openapi(EventTypeImportOpenApiIn(\n spec={\"info\": {\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": {\"pet.new\": {\"post\": {\"requestBody\": {\"content\": {\"application/json\": {\"schema\": {\"properties\": {\"id\": {\"format\": \"int64\", \"type\": \"integer\"}, \"name\": {\"type\": \"string\"}, \"tag\": {\"type\": \"string\"}}, \"required\": [\"id\", \"name\"]}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": {\"200\": {\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n spec_raw={\"info\": {\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": {\"pet.new\": {\"post\": {\"requestBody\": {\"content\": {\"application/json\": {\"schema\": {\"properties\": {\"id\": {\"format\": \"int64\", \"type\": \"integer\"}, \"name\": {\"type\": \"string\"}, \"tag\": {\"type\": \"string\"}}, \"required\": [\"id\", \"name\"]}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": {\"200\": {\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "event_type_import_open_api_out = await svix.event_type.import_openapi(EventTypeImportOpenApiIn(\n spec={\"info\": {\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": {\"pet.new\": {\"post\": {\"requestBody\": {\"content\": {\"application/json\": {\"schema\": {\"properties\": {\"id\": {\"format\": \"int64\", \"type\": \"integer\"}, \"name\": {\"type\": \"string\"}, \"tag\": {\"type\": \"string\"}}, \"required\": [\"id\", \"name\"]}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": {\"200\": {\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n spec_raw={\"info\": {\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": {\"pet.new\": {\"post\": {\"requestBody\": {\"content\": {\"application/json\": {\"schema\": {\"properties\": {\"id\": {\"format\": \"int64\", \"type\": \"integer\"}, \"name\": {\"type\": \"string\"}, \"tag\": {\"type\": \"string\"}}, \"required\": [\"id\", \"name\"]}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": {\"200\": {\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n), None)" + "source": "event_type_import_open_api_out = await svix.event_type.import_openapi(EventTypeImportOpenApiIn(\n spec={\"info\": {\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": {\"pet.new\": {\"post\": {\"requestBody\": {\"content\": {\"application/json\": {\"schema\": {\"properties\": {\"id\": {\"format\": \"int64\", \"type\": \"integer\"}, \"name\": {\"type\": \"string\"}, \"tag\": {\"type\": \"string\"}}, \"required\": [\"id\", \"name\"]}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": {\"200\": {\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n spec_raw={\"info\": {\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": {\"pet.new\": {\"post\": {\"requestBody\": {\"content\": {\"application/json\": {\"schema\": {\"properties\": {\"id\": {\"format\": \"int64\", \"type\": \"integer\"}, \"name\": {\"type\": \"string\"}, \"tag\": {\"type\": \"string\"}}, \"required\": [\"id\", \"name\"]}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": {\"200\": {\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n), options=...)" }, { "label": "Go", @@ -21701,12 +21923,12 @@ { "label": "Python", "lang": "Python", - "source": "event_type_example_out = svix.event_type.generate_example(EventTypeSchemaIn(\n schema={\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"}\n), None)" + "source": "event_type_example_out = svix.event_type.generate_example(EventTypeSchemaIn(\n schema={\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"}\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "event_type_example_out = await svix.event_type.generate_example(EventTypeSchemaIn(\n schema={\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"}\n), None)" + "source": "event_type_example_out = await svix.event_type.generate_example(EventTypeSchemaIn(\n schema={\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"}\n), options=...)" }, { "label": "Go", @@ -23007,75 +23229,888 @@ ], "x-codeSamples": [ { - "label": "JavaScript", - "lang": "JavaScript", - "source": "const messageEventsOut = await svix.even.s();" + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/events' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/health": { + "get": { + "description": "Verify the API server is up and running.", + "operationId": "v1.health.get", + "responses": { + "204": { + "description": "no content" }, - { - "label": "TypeScript", - "lang": "JavaScript", - "source": "const messageEventsOut = await svix.even.s();" + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" }, - { - "label": "Python", - "lang": "Python", - "source": "message_events_out = svix.even.s()" + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" }, - { - "label": "Python (Async)", - "lang": "Python", - "source": "message_events_out = await svix.even.s()" + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" }, - { - "label": "Go", - "lang": "Go", - "source": "messageEventsOut, err := svixClient.Even.S(ctx)" + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" }, - { - "label": "Kotlin", - "lang": "Kotlin", - "source": "val messageEventsOut = svix.even.s()" + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" }, - { - "label": "Java", - "lang": "Java", - "source": "MessageEventsOut messageEventsOut = svix.getEven().s()" + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" }, - { - "label": "Ruby", - "lang": "Ruby", - "source": "message_events_out = svix.even.s()" + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "summary": "Health", + "tags": [ + "Health" + ], + "x-codeSamples": [ + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/health' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/msg/broadcast": { + "post": { + "description": "Creates a background task to send the same message to each application in your organization", + "operationId": "create_broadcast_message", + "parameters": [ + { + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessageBroadcastIn" + } + } + }, + "required": true + }, + "responses": { + "202": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessageBroadcastOut" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Create Broadcast Message", + "tags": [ + "Broadcast" + ], + "x-codeSamples": [ + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/msg/broadcast' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"eventId\": \"unique-msg-identifier\",\n \"eventType\": \"user.signup\",\n \"payload\": {\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"},\n \"channels\": [\"project_123\", \"group_2\"],\n \"payloadRetentionPeriod\": 90,\n \"payloadRetentionHours\": null\n }'" + } + ] + } + }, + "/api/v1/operational-webhook/endpoint": { + "get": { + "description": "List operational webhook endpoints.", + "operationId": "list_operational_webhook_endpoints", + "parameters": [ + { + "description": "Limit the number of returned items", + "in": "query", + "name": "limit", + "schema": { + "description": "Limit the number of returned items", + "format": "uint64", + "maximum": 250, + "minimum": 1, + "type": "integer" + }, + "style": "form" + }, + { + "description": "The iterator returned from a prior invocation", + "in": "query", + "name": "iterator", + "schema": { + "description": "The iterator returned from a prior invocation", + "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "description": "The sorting order of the returned items", + "in": "query", + "name": "order", + "schema": { + "$ref": "#/components/schemas/Ordering", + "description": "The sorting order of the returned items", + "nullable": true + }, + "style": "form" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListResponse_OperationalWebhookEndpointOut_" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "List Operational Webhook Endpoints", + "tags": [ + "Webhook Endpoint" + ], + "x-codeSamples": [ + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/operational-webhook/endpoint' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + }, + "post": { + "description": "Create an operational webhook endpoint.", + "operationId": "create_operational_webhook_endpoint", + "parameters": [ + { + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OperationalWebhookEndpointIn" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OperationalWebhookEndpointOut" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Create Operational Webhook Endpoint", + "tags": [ + "Webhook Endpoint" + ], + "x-codeSamples": [ + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/operational-webhook/endpoint' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"description\": \"An example endpoint name\",\n \"rateLimit\": null,\n \"uid\": \"unique-ep-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"disabled\": false,\n \"filterTypes\": [\"message.attempt.failing\"],\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n }'" + } + ] + } + }, + "/api/v1/operational-webhook/endpoint/{endpoint_id}": { + "delete": { + "description": "Delete an operational webhook endpoint.", + "operationId": "delete_operational_webhook_endpoint", + "parameters": [ + { + "description": "The ep's ID or UID", + "in": "path", + "name": "endpoint_id", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "204": { + "description": "no content" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Delete Operational Webhook Endpoint", + "tags": [ + "Webhook Endpoint" + ], + "x-codeSamples": [ + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/operational-webhook/endpoint/{endpoint_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + }, + "get": { + "description": "Get an operational webhook endpoint.", + "operationId": "get_operational_webhook_endpoint", + "parameters": [ + { + "description": "The ep's ID or UID", + "in": "path", + "name": "endpoint_id", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OperationalWebhookEndpointOut" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Get Operational Webhook Endpoint", + "tags": [ + "Webhook Endpoint" + ], + "x-codeSamples": [ + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/operational-webhook/endpoint/{endpoint_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + }, + "put": { + "description": "Update an operational webhook endpoint.", + "operationId": "update_operational_webhook_endpoint", + "parameters": [ + { + "description": "The ep's ID or UID", + "in": "path", + "name": "endpoint_id", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OperationalWebhookEndpointUpdate" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OperationalWebhookEndpointOut" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" }, - { - "label": "Rust", - "lang": "Rust", - "source": "let message_events_out = svix.even().s().await?;" + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" }, - { - "label": "C#", - "lang": "C#", - "source": "var messageEventsOut = await svix.Even.SAsync()" + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ { - "label": "CLI", - "lang": "Shell", - "source": "svix even s " - }, + "HTTPBearer": [] + } + ], + "summary": "Update Operational Webhook Endpoint", + "tags": [ + "Webhook Endpoint" + ], + "x-codeSamples": [ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/events' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/operational-webhook/endpoint/{endpoint_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"description\": \"An example endpoint name\",\n \"rateLimit\": null,\n \"uid\": \"unique-ep-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"disabled\": false,\n \"filterTypes\": [\"message.attempt.failing\"]\n }'" } ] } }, - "/api/v1/health": { + "/api/v1/operational-webhook/endpoint/{endpoint_id}/secret": { "get": { - "description": "Verify the API server is up and running.", - "operationId": "v1.health.get", + "description": "Get an operational webhook endpoint's signing secret.\n\nThis is used to verify the authenticity of the webhook.\nFor more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/).", + "operationId": "get_operational_webhook_endpoint_secret", + "parameters": [ + { + "description": "The ep's ID or UID", + "in": "path", + "name": "endpoint_id", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + } + ], "responses": { - "204": { - "description": "no content" + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OperationalWebhookEndpointSecretOut" + } + } + }, + "description": "" }, "400": { "content": { @@ -23148,24 +24183,44 @@ "description": "Too Many Requests" } }, - "summary": "Health", + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Get Operational Webhook Endpoint Secret", "tags": [ - "Health" + "Webhook Endpoint" ], "x-codeSamples": [ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/health' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/operational-webhook/endpoint/{endpoint_id}/secret' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] } }, - "/api/v1/msg/broadcast": { + "/api/v1/operational-webhook/endpoint/{endpoint_id}/secret/rotate": { "post": { - "description": "Creates a background task to send the same message to each application in your organization", - "operationId": "create_broadcast_message", + "description": "Rotates an operational webhook endpoint's signing secret.\n\nThe previous secret will remain valid for the next 24 hours.", + "operationId": "rotate_operational_webhook_endpoint_secret", "parameters": [ + { + "description": "The ep's ID or UID", + "in": "path", + "name": "endpoint_id", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + }, { "description": "The request's idempotency key", "in": "header", @@ -23180,22 +24235,15 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MessageBroadcastIn" + "$ref": "#/components/schemas/OperationalWebhookEndpointSecretIn" } } }, "required": true }, "responses": { - "202": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MessageBroadcastOut" - } - } - }, - "description": "" + "204": { + "description": "no content" }, "400": { "content": { @@ -23273,9 +24321,16 @@ "HTTPBearer": [] } ], - "summary": "Create Broadcast Message", + "summary": "Rotate Operational Webhook Endpoint Secret", "tags": [ - "Broadcast" + "Webhook Endpoint" + ], + "x-codeSamples": [ + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/operational-webhook/endpoint/{endpoint_id}/secret/rotate' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"key\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n }'" + } ] } }, @@ -23824,12 +24879,12 @@ { "label": "Python", "lang": "Python", - "source": "app_usage_stats_out = svix.statistics.aggregate_app_stats(AppUsageStatsIn(\n app_ids=None\n), None)" + "source": "app_usage_stats_out = svix.statistics.aggregate_app_stats(AppUsageStatsIn(\n app_ids=None\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "app_usage_stats_out = await svix.statistics.aggregate_app_stats(AppUsageStatsIn(\n app_ids=None\n), None)" + "source": "app_usage_stats_out = await svix.statistics.aggregate_app_stats(AppUsageStatsIn(\n app_ids=None\n), options=...)" }, { "label": "Go", @@ -24179,12 +25234,12 @@ { "label": "Python", "lang": "Python", - "source": "list_response_stream_out = svix.stream.list(None)" + "source": "list_response_stream_out = svix.stream.list(options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_stream_out = await svix.stream.list(None)" + "source": "list_response_stream_out = await svix.stream.list(options=...)" }, { "label": "Go", @@ -24367,12 +25422,12 @@ { "label": "Python", "lang": "Python", - "source": "stream_out = svix.stream.create(StreamIn(\n uid=None\n), None)" + "source": "stream_out = svix.stream.create(StreamIn(\n uid=None\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "stream_out = await svix.stream.create(StreamIn(\n uid=None\n), None)" + "source": "stream_out = await svix.stream.create(StreamIn(\n uid=None\n), options=...)" }, { "label": "Go", @@ -25445,62 +26500,62 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const createStreamOut = await svix.stream.createEvents(\"stream_id\", \n});" + "source": "const createStreamOut = await svix.stream.createEvents(\"stream_id\", {\n stream: null\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const createStreamOut = await svix.stream.createEvents(\"stream_id\", \n});" + "source": "const createStreamOut = await svix.stream.createEvents(\"stream_id\", {\n stream: null\n});" }, { "label": "Python", "lang": "Python", - "source": "create_stream_out = svix.stream.create_events(\"stream_id\", CreateStreamIn\n), None)" + "source": "create_stream_out = svix.stream.create_events(\"stream_id\", CreateStreamIn(\n stream=None\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "create_stream_out = await svix.stream.create_events(\"stream_id\", CreateStreamIn\n), None)" + "source": "create_stream_out = await svix.stream.create_events(\"stream_id\", CreateStreamIn(\n stream=None\n), options=...)" }, { "label": "Go", "lang": "Go", - "source": "createStreamOut, err := svixClient.Stream.CreateEvents(ctx, \"stream_id\", &CreateStreamIn{\n})" + "source": "createStreamOut, err := svixClient.Stream.CreateEvents(ctx, \"stream_id\", &CreateStreamIn{\n Stream: nil,\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val createStreamOut = svix.stream.createEvents(\"stream_id\", CreateStreamIn()\n)" + "source": "val createStreamOut = svix.stream.createEvents(\"stream_id\", CreateStreamIn()\n .stream(null)\n)" }, { "label": "Java", "lang": "Java", - "source": "CreateStreamOut createStreamOut = svix.getStream().createEvents(\"stream_id\", new CreateStreamIn()\n)" + "source": "CreateStreamOut createStreamOut = svix.getStream().createEvents(\"stream_id\", new CreateStreamIn()\n .stream(null)\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "create_stream_out = svix.stream.create_events(\"stream_id\", Svix::CreateStreamIn.new(\n}))" + "source": "create_stream_out = svix.stream.create_events(\"stream_id\", Svix::CreateStreamIn.new({\n \"stream\": nil\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let create_stream_out = svix.stream().create_events(\"stream_id\", CreateStreamIn {\n}, None).await?;" + "source": "let create_stream_out = svix.stream().create_events(\"stream_id\", CreateStreamIn {\n stream: None,\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var createStreamOut = await svix.Stream.CreateEventsAsync(\"stream_id\", new CreateStreamIn\n})" + "source": "var createStreamOut = await svix.Stream.CreateEventsAsync(\"stream_id\", new CreateStreamIn{\n stream: null\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix stream create-events \"stream_id\" '\n}'" + "source": "svix stream create-events \"stream_id\" '{\n \"stream\": null\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/stream/{stream_id}/events' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/stream/{stream_id}/events' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"stream\": null\n }'" } ] } @@ -25651,12 +26706,12 @@ { "label": "Python", "lang": "Python", - "source": "list_response_template_out = svix.transformation_template.list(None)" + "source": "list_response_template_out = svix.transformation_template.list(options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_template_out = await svix.transformation_template.list(None)" + "source": "list_response_template_out = await svix.transformation_template.list(options=...)" }, { "label": "Go", @@ -25829,12 +26884,12 @@ { "label": "Python", "lang": "Python", - "source": "template_out = svix.transformation_template.create(TemplateIn(\n instructions_link=None,\n filter_types=[\"user.signup\", \"user.deleted\"],\n feature_flag=\"cool-new-feature\"\n), None)" + "source": "template_out = svix.transformation_template.create(TemplateIn(\n instructions_link=None,\n filter_types=[\"user.signup\", \"user.deleted\"],\n feature_flag=\"cool-new-feature\"\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "template_out = await svix.transformation_template.create(TemplateIn(\n instructions_link=None,\n filter_types=[\"user.signup\", \"user.deleted\"],\n feature_flag=\"cool-new-feature\"\n), None)" + "source": "template_out = await svix.transformation_template.create(TemplateIn(\n instructions_link=None,\n filter_types=[\"user.signup\", \"user.deleted\"],\n feature_flag=\"cool-new-feature\"\n), options=...)" }, { "label": "Go", @@ -26009,12 +27064,12 @@ { "label": "Python", "lang": "Python", - "source": "generate_out = svix.transformation_template.generate(GenerateIn\n), None)" + "source": "generate_out = svix.transformation_template.generate(GenerateIn\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "generate_out = await svix.transformation_template.generate(GenerateIn\n), None)" + "source": "generate_out = await svix.transformation_template.generate(GenerateIn\n), options=...)" }, { "label": "Go", @@ -26176,61 +27231,6 @@ "Transformation Template" ], "x-codeSamples": [ - { - "label": "JavaScript", - "lang": "JavaScript", - "source": "const incomingWebhookPayloadOut = await svix.transformationTemplate.oauth(\n});" - }, - { - "label": "TypeScript", - "lang": "JavaScript", - "source": "const incomingWebhookPayloadOut = await svix.transformationTemplate.oauth(\n});" - }, - { - "label": "Python", - "lang": "Python", - "source": "incoming_webhook_payload_out = svix.transformation_template.oauth(OAuthPayloadIn\n), None)" - }, - { - "label": "Python (Async)", - "lang": "Python", - "source": "incoming_webhook_payload_out = await svix.transformation_template.oauth(OAuthPayloadIn\n), None)" - }, - { - "label": "Go", - "lang": "Go", - "source": "incomingWebhookPayloadOut, err := svixClient.TransformationTemplate.Oauth(ctx, &OAuthPayloadIn{\n})" - }, - { - "label": "Kotlin", - "lang": "Kotlin", - "source": "val incomingWebhookPayloadOut = svix.transformationTemplate.oauth(OAuthPayloadIn()\n)" - }, - { - "label": "Java", - "lang": "Java", - "source": "IncomingWebhookPayloadOut incomingWebhookPayloadOut = svix.getTransformationTemplate().oauth(new OAuthPayloadIn()\n)" - }, - { - "label": "Ruby", - "lang": "Ruby", - "source": "incoming_webhook_payload_out = svix.transformation_template.oauth(Svix::OAuthPayloadIn.new(\n}))" - }, - { - "label": "Rust", - "lang": "Rust", - "source": "let incoming_webhook_payload_out = svix.transformation_template().oauth(OAuthPayloadIn {\n}, None).await?;" - }, - { - "label": "C#", - "lang": "C#", - "source": "var incomingWebhookPayloadOut = await svix.TransformationTemplate.OauthAsync(new OAuthPayloadIn\n})" - }, - { - "label": "CLI", - "lang": "Shell", - "source": "svix transformation-template oauth '\n}'" - }, { "label": "cURL", "lang": "Shell", @@ -26356,61 +27356,6 @@ "Transformation Template" ], "x-codeSamples": [ - { - "label": "JavaScript", - "lang": "JavaScript", - "source": "const oAuthPayloadOut = await svix.transformationTemplate.oauth(\n});" - }, - { - "label": "TypeScript", - "lang": "JavaScript", - "source": "const oAuthPayloadOut = await svix.transformationTemplate.oauth(\n});" - }, - { - "label": "Python", - "lang": "Python", - "source": "o_auth_payload_out = svix.transformation_template.oauth(OAuthPayloadIn\n), None)" - }, - { - "label": "Python (Async)", - "lang": "Python", - "source": "o_auth_payload_out = await svix.transformation_template.oauth(OAuthPayloadIn\n), None)" - }, - { - "label": "Go", - "lang": "Go", - "source": "oAuthPayloadOut, err := svixClient.TransformationTemplate.Oauth(ctx, &OAuthPayloadIn{\n})" - }, - { - "label": "Kotlin", - "lang": "Kotlin", - "source": "val oAuthPayloadOut = svix.transformationTemplate.oauth(OAuthPayloadIn()\n)" - }, - { - "label": "Java", - "lang": "Java", - "source": "OAuthPayloadOut oAuthPayloadOut = svix.getTransformationTemplate().oauth(new OAuthPayloadIn()\n)" - }, - { - "label": "Ruby", - "lang": "Ruby", - "source": "o_auth_payload_out = svix.transformation_template.oauth(Svix::OAuthPayloadIn.new(\n}))" - }, - { - "label": "Rust", - "lang": "Rust", - "source": "let o_auth_payload_out = svix.transformation_template().oauth(OAuthPayloadIn {\n}, None).await?;" - }, - { - "label": "C#", - "lang": "C#", - "source": "var oAuthPayloadOut = await svix.TransformationTemplate.OauthAsync(new OAuthPayloadIn\n})" - }, - { - "label": "CLI", - "lang": "Shell", - "source": "svix transformation-template oauth '\n}'" - }, { "label": "cURL", "lang": "Shell", @@ -26536,61 +27481,6 @@ "Transformation Template" ], "x-codeSamples": [ - { - "label": "JavaScript", - "lang": "JavaScript", - "source": "const incomingWebhookPayloadOut = await svix.transformationTemplate.oauth(\n});" - }, - { - "label": "TypeScript", - "lang": "JavaScript", - "source": "const incomingWebhookPayloadOut = await svix.transformationTemplate.oauth(\n});" - }, - { - "label": "Python", - "lang": "Python", - "source": "incoming_webhook_payload_out = svix.transformation_template.oauth(OAuthPayloadIn\n), None)" - }, - { - "label": "Python (Async)", - "lang": "Python", - "source": "incoming_webhook_payload_out = await svix.transformation_template.oauth(OAuthPayloadIn\n), None)" - }, - { - "label": "Go", - "lang": "Go", - "source": "incomingWebhookPayloadOut, err := svixClient.TransformationTemplate.Oauth(ctx, &OAuthPayloadIn{\n})" - }, - { - "label": "Kotlin", - "lang": "Kotlin", - "source": "val incomingWebhookPayloadOut = svix.transformationTemplate.oauth(OAuthPayloadIn()\n)" - }, - { - "label": "Java", - "lang": "Java", - "source": "IncomingWebhookPayloadOut incomingWebhookPayloadOut = svix.getTransformationTemplate().oauth(new OAuthPayloadIn()\n)" - }, - { - "label": "Ruby", - "lang": "Ruby", - "source": "incoming_webhook_payload_out = svix.transformation_template.oauth(Svix::OAuthPayloadIn.new(\n}))" - }, - { - "label": "Rust", - "lang": "Rust", - "source": "let incoming_webhook_payload_out = svix.transformation_template().oauth(OAuthPayloadIn {\n}, None).await?;" - }, - { - "label": "C#", - "lang": "C#", - "source": "var incomingWebhookPayloadOut = await svix.TransformationTemplate.OauthAsync(new OAuthPayloadIn\n})" - }, - { - "label": "CLI", - "lang": "Shell", - "source": "svix transformation-template oauth '\n}'" - }, { "label": "cURL", "lang": "Shell", @@ -26729,12 +27619,12 @@ { "label": "Python", "lang": "Python", - "source": "transformation_simulate_out = svix.transformation_template.simulate(TransformationSimulateIn(\n event_type=\"user.signup\",\n channels=None\n), None)" + "source": "transformation_simulate_out = svix.transformation_template.simulate(TransformationSimulateIn(\n event_type=\"user.signup\",\n channels=None\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "transformation_simulate_out = await svix.transformation_template.simulate(TransformationSimulateIn(\n event_type=\"user.signup\",\n channels=None\n), None)" + "source": "transformation_simulate_out = await svix.transformation_template.simulate(TransformationSimulateIn(\n event_type=\"user.signup\",\n channels=None\n), options=...)" }, { "label": "Go", @@ -27522,7 +28412,7 @@ }, { "description": "The webhooks the Svix service sends to notify you of events.", - "name": "Webhooks" + "name": "Webhook" }, { "description": "The background tasks that have been executed for your environment.", @@ -27531,6 +28421,10 @@ { "description": "Generate statistics about your Svix utilization", "name": "Statistics" + }, + { + "description": "Configure where operational webhooks are sent to.", + "name": "Webhook Endpoint" } ], "x-tagGroups": [ @@ -27559,9 +28453,10 @@ ] }, { - "name": "Webhooks", + "name": "Operational Webhooks", "tags": [ - "Webhooks" + "Webhook", + "Webhook Endpoint" ] }, { @@ -27601,7 +28496,7 @@ }, "summary": "endpoint.created", "tags": [ - "Webhooks" + "Webhook" ] } }, @@ -27634,7 +28529,7 @@ }, "summary": "endpoint.deleted", "tags": [ - "Webhooks" + "Webhook" ] } }, @@ -27668,7 +28563,7 @@ }, "summary": "endpoint.disabled", "tags": [ - "Webhooks" + "Webhook" ] } }, @@ -27701,7 +28596,7 @@ }, "summary": "endpoint.updated", "tags": [ - "Webhooks" + "Webhook" ] } }, @@ -27740,7 +28635,7 @@ }, "summary": "message.attempt.exhausted", "tags": [ - "Webhooks" + "Webhook" ] } }, @@ -27779,7 +28674,7 @@ }, "summary": "message.attempt.failing", "tags": [ - "Webhooks" + "Webhook" ] } }, @@ -27818,7 +28713,7 @@ }, "summary": "message.attempt.recovered", "tags": [ - "Webhooks" + "Webhook" ] } }