From fc3e6916ea7784448f619f8a2f20db424a305103 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Thu, 30 Jan 2025 12:38:49 +0100 Subject: [PATCH 1/7] Bump OpenAPI spec and regenerate libs --- go/internal/openapi/api_authentication.go | 206 ++ go/internal/openapi/api_background_tasks.go | 46 +- go/internal/openapi/api_endpoint.go | 4 +- go/internal/openapi/api_message.go | 1 - go/internal/openapi/api_message_attempt.go | 719 +---- go/internal/openapi/api_stream.go | 426 +-- .../openapi/api_transformation_template.go | 3 +- go/internal/openapi/api_webhook_endpoint.go | 512 +++- .../openapi/model_aggregated_event_types.go | 215 ++ .../model_application_message_failure.go | 187 ++ .../model_application_message_id_pair.go | 188 ++ .../openapi/model_application_stats_out.go | 224 ++ .../model_background_task_finished_event.go | 188 ++ .../model_background_task_finished_event2.go | 242 ++ go/internal/openapi/model_create_stream_in.go | 28 +- go/internal/openapi/model_data.go | 143 + go/internal/openapi/model_data_any_of.go | 158 + go/internal/openapi/model_data_any_of_1.go | 158 + go/internal/openapi/model_data_any_of_2.go | 186 ++ go/internal/openapi/model_data_any_of_3.go | 158 + .../openapi/model_endpoint_disabled_event.go | 2 +- .../model_endpoint_disabled_event_data.go | 74 +- .../model_endpoint_disabled_trigger.go | 111 + .../openapi/model_endpoint_enabled_event.go | 188 ++ .../model_endpoint_enabled_event_data.go | 262 ++ go/internal/openapi/model_environment_in.go | 68 +- .../model_event_type_import_open_api_in.go | 45 +- ...operational_webhook_endpoint_headers_in.go | 158 + ...perational_webhook_endpoint_headers_out.go | 186 ++ .../openapi/model_rotate_poller_token_in.go | 2 +- go/internal/openapi/model_stream_in.go | 2 + go/internal/openapi/model_stream_out.go | 5 +- go/internal/openapi/model_stream_patch.go | 2 + .../openapi/model_stream_portal_access_in.go | 205 ++ lib-openapi.json | 2711 ++++++++--------- 35 files changed, 5578 insertions(+), 2435 deletions(-) create mode 100644 go/internal/openapi/model_aggregated_event_types.go create mode 100644 go/internal/openapi/model_application_message_failure.go create mode 100644 go/internal/openapi/model_application_message_id_pair.go create mode 100644 go/internal/openapi/model_application_stats_out.go create mode 100644 go/internal/openapi/model_background_task_finished_event.go create mode 100644 go/internal/openapi/model_background_task_finished_event2.go create mode 100644 go/internal/openapi/model_data.go create mode 100644 go/internal/openapi/model_data_any_of.go create mode 100644 go/internal/openapi/model_data_any_of_1.go create mode 100644 go/internal/openapi/model_data_any_of_2.go create mode 100644 go/internal/openapi/model_data_any_of_3.go create mode 100644 go/internal/openapi/model_endpoint_disabled_trigger.go create mode 100644 go/internal/openapi/model_endpoint_enabled_event.go create mode 100644 go/internal/openapi/model_endpoint_enabled_event_data.go create mode 100644 go/internal/openapi/model_operational_webhook_endpoint_headers_in.go create mode 100644 go/internal/openapi/model_operational_webhook_endpoint_headers_out.go create mode 100644 go/internal/openapi/model_stream_portal_access_in.go diff --git a/go/internal/openapi/api_authentication.go b/go/internal/openapi/api_authentication.go index 7a8732014..a820bc9c7 100644 --- a/go/internal/openapi/api_authentication.go +++ b/go/internal/openapi/api_authentication.go @@ -1612,3 +1612,209 @@ func (a *AuthenticationAPIService) V1AuthenticationRotatePollerTokenExecute(r Ap return localVarReturnValue, localVarHTTPResponse, nil } + +type ApiV1AuthenticationStreamPortalAccessRequest struct { + ctx context.Context + ApiService *AuthenticationAPIService + streamId string + streamPortalAccessIn *StreamPortalAccessIn + idempotencyKey *string +} + +func (r ApiV1AuthenticationStreamPortalAccessRequest) StreamPortalAccessIn(streamPortalAccessIn StreamPortalAccessIn) ApiV1AuthenticationStreamPortalAccessRequest { + r.streamPortalAccessIn = &streamPortalAccessIn + return r +} + +// The request's idempotency key +func (r ApiV1AuthenticationStreamPortalAccessRequest) IdempotencyKey(idempotencyKey string) ApiV1AuthenticationStreamPortalAccessRequest { + r.idempotencyKey = &idempotencyKey + return r +} + +func (r ApiV1AuthenticationStreamPortalAccessRequest) Execute() (*AppPortalAccessOut, *http.Response, error) { + return r.ApiService.V1AuthenticationStreamPortalAccessExecute(r) +} + +/* +V1AuthenticationStreamPortalAccess Get Stream Portal Access + +Use this function to get magic links (and authentication codes) for connecting your users to the Stream Consumer Portal. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param streamId + @return ApiV1AuthenticationStreamPortalAccessRequest +*/ +func (a *AuthenticationAPIService) V1AuthenticationStreamPortalAccess(ctx context.Context, streamId string) ApiV1AuthenticationStreamPortalAccessRequest { + return ApiV1AuthenticationStreamPortalAccessRequest{ + ApiService: a, + ctx: ctx, + streamId: streamId, + } +} + +// Execute executes the request +// @return AppPortalAccessOut +func (a *AuthenticationAPIService) V1AuthenticationStreamPortalAccessExecute(r ApiV1AuthenticationStreamPortalAccessRequest) (*AppPortalAccessOut, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AppPortalAccessOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticationAPIService.V1AuthenticationStreamPortalAccess") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/auth/stream-portal-access/{stream_id}" + localVarPath = strings.Replace(localVarPath, "{"+"stream_id"+"}", url.PathEscape(parameterValueToString(r.streamId, "streamId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.streamId) < 1 { + return localVarReturnValue, nil, reportError("streamId must have at least 1 elements") + } + if strlen(r.streamId) > 60 { + return localVarReturnValue, nil, reportError("streamId must have less than 60 elements") + } + if r.streamPortalAccessIn == nil { + return localVarReturnValue, nil, reportError("streamPortalAccessIn 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.streamPortalAccessIn + 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/api_background_tasks.go b/go/internal/openapi/api_background_tasks.go index 737f2fba9..3726075a9 100644 --- a/go/internal/openapi/api_background_tasks.go +++ b/go/internal/openapi/api_background_tasks.go @@ -23,27 +23,27 @@ import ( // BackgroundTasksAPIService BackgroundTasksAPI service type BackgroundTasksAPIService service -type ApiGetBackgroundTaskRequest struct { +type ApiV1BackgroundTaskGetRequest struct { ctx context.Context ApiService *BackgroundTasksAPIService taskId string } -func (r ApiGetBackgroundTaskRequest) Execute() (*BackgroundTaskOut, *http.Response, error) { - return r.ApiService.GetBackgroundTaskExecute(r) +func (r ApiV1BackgroundTaskGetRequest) Execute() (*BackgroundTaskOut, *http.Response, error) { + return r.ApiService.V1BackgroundTaskGetExecute(r) } /* -GetBackgroundTask Get Background Task +V1BackgroundTaskGet Get Background Task Get a background task by ID. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param taskId - @return ApiGetBackgroundTaskRequest + @return ApiV1BackgroundTaskGetRequest */ -func (a *BackgroundTasksAPIService) GetBackgroundTask(ctx context.Context, taskId string) ApiGetBackgroundTaskRequest { - return ApiGetBackgroundTaskRequest{ +func (a *BackgroundTasksAPIService) V1BackgroundTaskGet(ctx context.Context, taskId string) ApiV1BackgroundTaskGetRequest { + return ApiV1BackgroundTaskGetRequest{ ApiService: a, ctx: ctx, taskId: taskId, @@ -52,7 +52,7 @@ func (a *BackgroundTasksAPIService) GetBackgroundTask(ctx context.Context, taskI // Execute executes the request // @return BackgroundTaskOut -func (a *BackgroundTasksAPIService) GetBackgroundTaskExecute(r ApiGetBackgroundTaskRequest) (*BackgroundTaskOut, *http.Response, error) { +func (a *BackgroundTasksAPIService) V1BackgroundTaskGetExecute(r ApiV1BackgroundTaskGetRequest) (*BackgroundTaskOut, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -60,7 +60,7 @@ func (a *BackgroundTasksAPIService) GetBackgroundTaskExecute(r ApiGetBackgroundT localVarReturnValue *BackgroundTaskOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BackgroundTasksAPIService.GetBackgroundTask") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BackgroundTasksAPIService.V1BackgroundTaskGet") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -202,7 +202,7 @@ func (a *BackgroundTasksAPIService) GetBackgroundTaskExecute(r ApiGetBackgroundT return localVarReturnValue, localVarHTTPResponse, nil } -type ApiListBackgroundTasksRequest struct { +type ApiV1BackgroundTaskListRequest struct { ctx context.Context ApiService *BackgroundTasksAPIService status *BackgroundTaskStatus @@ -213,49 +213,49 @@ type ApiListBackgroundTasksRequest struct { } // Filter the response based on the status. -func (r ApiListBackgroundTasksRequest) Status(status BackgroundTaskStatus) ApiListBackgroundTasksRequest { +func (r ApiV1BackgroundTaskListRequest) Status(status BackgroundTaskStatus) ApiV1BackgroundTaskListRequest { r.status = &status return r } // Filter the response based on the type. -func (r ApiListBackgroundTasksRequest) Task(task BackgroundTaskType) ApiListBackgroundTasksRequest { +func (r ApiV1BackgroundTaskListRequest) Task(task BackgroundTaskType) ApiV1BackgroundTaskListRequest { r.task = &task return r } // Limit the number of returned items -func (r ApiListBackgroundTasksRequest) Limit(limit int32) ApiListBackgroundTasksRequest { +func (r ApiV1BackgroundTaskListRequest) Limit(limit int32) ApiV1BackgroundTaskListRequest { r.limit = &limit return r } // The iterator returned from a prior invocation -func (r ApiListBackgroundTasksRequest) Iterator(iterator string) ApiListBackgroundTasksRequest { +func (r ApiV1BackgroundTaskListRequest) Iterator(iterator string) ApiV1BackgroundTaskListRequest { r.iterator = &iterator return r } // The sorting order of the returned items -func (r ApiListBackgroundTasksRequest) Order(order Ordering) ApiListBackgroundTasksRequest { +func (r ApiV1BackgroundTaskListRequest) Order(order Ordering) ApiV1BackgroundTaskListRequest { r.order = &order return r } -func (r ApiListBackgroundTasksRequest) Execute() (*ListResponseBackgroundTaskOut, *http.Response, error) { - return r.ApiService.ListBackgroundTasksExecute(r) +func (r ApiV1BackgroundTaskListRequest) Execute() (*ListResponseBackgroundTaskOut, *http.Response, error) { + return r.ApiService.V1BackgroundTaskListExecute(r) } /* -ListBackgroundTasks List Background Tasks +V1BackgroundTaskList List Background Tasks List background tasks executed in the past 90 days. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiListBackgroundTasksRequest + @return ApiV1BackgroundTaskListRequest */ -func (a *BackgroundTasksAPIService) ListBackgroundTasks(ctx context.Context) ApiListBackgroundTasksRequest { - return ApiListBackgroundTasksRequest{ +func (a *BackgroundTasksAPIService) V1BackgroundTaskList(ctx context.Context) ApiV1BackgroundTaskListRequest { + return ApiV1BackgroundTaskListRequest{ ApiService: a, ctx: ctx, } @@ -263,7 +263,7 @@ func (a *BackgroundTasksAPIService) ListBackgroundTasks(ctx context.Context) Api // Execute executes the request // @return ListResponseBackgroundTaskOut -func (a *BackgroundTasksAPIService) ListBackgroundTasksExecute(r ApiListBackgroundTasksRequest) (*ListResponseBackgroundTaskOut, *http.Response, error) { +func (a *BackgroundTasksAPIService) V1BackgroundTaskListExecute(r ApiV1BackgroundTaskListRequest) (*ListResponseBackgroundTaskOut, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -271,7 +271,7 @@ func (a *BackgroundTasksAPIService) ListBackgroundTasksExecute(r ApiListBackgrou localVarReturnValue *ListResponseBackgroundTaskOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BackgroundTasksAPIService.ListBackgroundTasks") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BackgroundTasksAPIService.V1BackgroundTaskList") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } diff --git a/go/internal/openapi/api_endpoint.go b/go/internal/openapi/api_endpoint.go index b62e3338f..b6746eea1 100644 --- a/go/internal/openapi/api_endpoint.go +++ b/go/internal/openapi/api_endpoint.go @@ -4090,7 +4090,7 @@ func (r ApiV1EndpointUpdateMtlsConfigRequest) Execute() (*http.Response, error) /* V1EndpointUpdateMtlsConfig Update Endpoint Mtls Config -Create/update endpoint mTLS configuration. +Create / update endpoint mTLS configuration. @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 @@ -4285,7 +4285,7 @@ func (r ApiV1EndpointUpdateOauthConfigRequest) Execute() (*http.Response, error) /* V1EndpointUpdateOauthConfig Update Endpoint Oauth Config -Create/update endpoint OAuth configuration. +Create / update endpoint OAuth configuration. @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.go b/go/internal/openapi/api_message.go index 5bed504fe..37dbcb2a0 100644 --- a/go/internal/openapi/api_message.go +++ b/go/internal/openapi/api_message.go @@ -2109,7 +2109,6 @@ relative to now or, if an iterator is provided, 90 days before/after the time in by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate. - @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 @return ApiV1MessageListRequest diff --git a/go/internal/openapi/api_message_attempt.go b/go/internal/openapi/api_message_attempt.go index dc2cea45c..d48f2717a 100644 --- a/go/internal/openapi/api_message_attempt.go +++ b/go/internal/openapi/api_message_attempt.go @@ -1734,737 +1734,111 @@ func (a *MessageAttemptAPIService) V1MessageAttemptListByEndpointExecute(r ApiV1 return localVarReturnValue, localVarHTTPResponse, nil } -type ApiV1MessageAttemptListByEndpointDeprecatedRequest struct { - ctx context.Context - ApiService *MessageAttemptAPIService - appId string - msgId string - endpointId string - limit *int32 - iterator *string - channel *string - tag *string - status *MessageStatus - before *time.Time - after *time.Time - eventTypes *[]string -} - -// Limit the number of returned items -func (r ApiV1MessageAttemptListByEndpointDeprecatedRequest) Limit(limit int32) ApiV1MessageAttemptListByEndpointDeprecatedRequest { - r.limit = &limit - return r -} - -// The iterator returned from a prior invocation -func (r ApiV1MessageAttemptListByEndpointDeprecatedRequest) Iterator(iterator string) ApiV1MessageAttemptListByEndpointDeprecatedRequest { - r.iterator = &iterator - return r -} - -// Filter response based on the channel -func (r ApiV1MessageAttemptListByEndpointDeprecatedRequest) Channel(channel string) ApiV1MessageAttemptListByEndpointDeprecatedRequest { - r.channel = &channel - return r -} - -// Filter response based on the tag -func (r ApiV1MessageAttemptListByEndpointDeprecatedRequest) Tag(tag string) ApiV1MessageAttemptListByEndpointDeprecatedRequest { - r.tag = &tag - return r -} - -// 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 -} - -// Only include items created before a certain date -func (r ApiV1MessageAttemptListByEndpointDeprecatedRequest) Before(before time.Time) ApiV1MessageAttemptListByEndpointDeprecatedRequest { - r.before = &before - return r -} - -// Only include items created after a certain date -func (r ApiV1MessageAttemptListByEndpointDeprecatedRequest) After(after time.Time) ApiV1MessageAttemptListByEndpointDeprecatedRequest { - r.after = &after - return r -} - -// Filter response based on the event type -func (r ApiV1MessageAttemptListByEndpointDeprecatedRequest) EventTypes(eventTypes []string) ApiV1MessageAttemptListByEndpointDeprecatedRequest { - r.eventTypes = &eventTypes - return r -} - -func (r ApiV1MessageAttemptListByEndpointDeprecatedRequest) Execute() (*ListResponseMessageAttemptEndpointOut, *http.Response, error) { - return r.ApiService.V1MessageAttemptListByEndpointDeprecatedExecute(r) -} - -/* -V1MessageAttemptListByEndpointDeprecated List Attempts For Endpoint - -DEPRECATED: please use list_attempts with endpoint_id as a query parameter instead. - -List the message attempts for a particular endpoint. - -Returning the endpoint. - -The `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed. - -Note that by default this endpoint is limited to retrieving 90 days' worth of data -relative to now or, if an iterator is provided, 90 days before/after the time indicated -by the iterator ID. If you require data beyond those time ranges, you will need to explicitly -set the `before` or `after` parameter as appropriate. - - - @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 msgId The msg's ID or UID - @param endpointId The ep's ID or UID - @return ApiV1MessageAttemptListByEndpointDeprecatedRequest - -Deprecated -*/ -func (a *MessageAttemptAPIService) V1MessageAttemptListByEndpointDeprecated(ctx context.Context, appId string, msgId string, endpointId string) ApiV1MessageAttemptListByEndpointDeprecatedRequest { - return ApiV1MessageAttemptListByEndpointDeprecatedRequest{ - ApiService: a, - ctx: ctx, - appId: appId, - msgId: msgId, - endpointId: endpointId, - } -} - -// Execute executes the request -// @return ListResponseMessageAttemptEndpointOut -// Deprecated -func (a *MessageAttemptAPIService) V1MessageAttemptListByEndpointDeprecatedExecute(r ApiV1MessageAttemptListByEndpointDeprecatedRequest) (*ListResponseMessageAttemptEndpointOut, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListResponseMessageAttemptEndpointOut - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAttemptAPIService.V1MessageAttemptListByEndpointDeprecated") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/attempt" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"msg_id"+"}", url.PathEscape(parameterValueToString(r.msgId, "msgId")), -1) - 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.appId) < 1 { - return localVarReturnValue, nil, reportError("appId must have at least 1 elements") - } - if strlen(r.appId) > 256 { - return localVarReturnValue, nil, reportError("appId must have less than 256 elements") - } - if strlen(r.msgId) < 1 { - return localVarReturnValue, nil, reportError("msgId must have at least 1 elements") - } - if strlen(r.msgId) > 256 { - return localVarReturnValue, nil, reportError("msgId must have less than 256 elements") - } - 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.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.iterator != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "iterator", r.iterator, "form", "") - } - if r.channel != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "channel", r.channel, "form", "") - } - if r.tag != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "tag", r.tag, "form", "") - } - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.before != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "before", r.before, "form", "") - } - if r.after != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "after", r.after, "form", "") - } - if r.eventTypes != nil { - t := *r.eventTypes - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - parameterAddToHeaderOrQuery(localVarQueryParams, "event_types", s.Index(i).Interface(), "form", "multi") - } - } else { - parameterAddToHeaderOrQuery(localVarQueryParams, "event_types", t, "form", "multi") - } - } - // 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 ApiV1MessageAttemptListByMsgRequest struct { - ctx context.Context - ApiService *MessageAttemptAPIService - appId string - msgId string - limit *int32 - iterator *string - status *MessageStatus - statusCodeClass *StatusCodeClass - channel *string - tag *string - endpointId *string - before *time.Time - after *time.Time - withContent *bool - eventTypes *[]string -} - -// Limit the number of returned items -func (r ApiV1MessageAttemptListByMsgRequest) Limit(limit int32) ApiV1MessageAttemptListByMsgRequest { - r.limit = &limit - return r -} - -// The iterator returned from a prior invocation -func (r ApiV1MessageAttemptListByMsgRequest) Iterator(iterator string) ApiV1MessageAttemptListByMsgRequest { - r.iterator = &iterator - return r -} - -// 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 -} - -// Filter response based on the HTTP status code -func (r ApiV1MessageAttemptListByMsgRequest) StatusCodeClass(statusCodeClass StatusCodeClass) ApiV1MessageAttemptListByMsgRequest { - r.statusCodeClass = &statusCodeClass - return r -} - -// Filter response based on the channel -func (r ApiV1MessageAttemptListByMsgRequest) Channel(channel string) ApiV1MessageAttemptListByMsgRequest { - r.channel = &channel - return r -} - -// Filter response based on the tag -func (r ApiV1MessageAttemptListByMsgRequest) Tag(tag string) ApiV1MessageAttemptListByMsgRequest { - r.tag = &tag - return r -} - -// Filter the attempts based on the attempted endpoint -func (r ApiV1MessageAttemptListByMsgRequest) EndpointId(endpointId string) ApiV1MessageAttemptListByMsgRequest { - r.endpointId = &endpointId - return r -} - -// Only include items created before a certain date -func (r ApiV1MessageAttemptListByMsgRequest) Before(before time.Time) ApiV1MessageAttemptListByMsgRequest { - r.before = &before - return r -} - -// Only include items created after a certain date -func (r ApiV1MessageAttemptListByMsgRequest) After(after time.Time) ApiV1MessageAttemptListByMsgRequest { - r.after = &after - return r -} - -// When `true` attempt content is included in the response -func (r ApiV1MessageAttemptListByMsgRequest) WithContent(withContent bool) ApiV1MessageAttemptListByMsgRequest { - r.withContent = &withContent - return r -} - -// Filter response based on the event type -func (r ApiV1MessageAttemptListByMsgRequest) EventTypes(eventTypes []string) ApiV1MessageAttemptListByMsgRequest { - r.eventTypes = &eventTypes - return r -} - -func (r ApiV1MessageAttemptListByMsgRequest) Execute() (*ListResponseMessageAttemptOut, *http.Response, error) { - return r.ApiService.V1MessageAttemptListByMsgExecute(r) -} - -/* -V1MessageAttemptListByMsg List Attempts By Msg - -List attempts by message ID. - -Note that by default this endpoint is limited to retrieving 90 days' worth of data -relative to now or, if an iterator is provided, 90 days before/after the time indicated -by the iterator ID. If you require data beyond those time ranges, you will need to explicitly -set the `before` or `after` parameter as appropriate. - - @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 msgId The msg's ID or UID - @return ApiV1MessageAttemptListByMsgRequest -*/ -func (a *MessageAttemptAPIService) V1MessageAttemptListByMsg(ctx context.Context, appId string, msgId string) ApiV1MessageAttemptListByMsgRequest { - return ApiV1MessageAttemptListByMsgRequest{ - ApiService: a, - ctx: ctx, - appId: appId, - msgId: msgId, - } -} - -// Execute executes the request -// @return ListResponseMessageAttemptOut -func (a *MessageAttemptAPIService) V1MessageAttemptListByMsgExecute(r ApiV1MessageAttemptListByMsgRequest) (*ListResponseMessageAttemptOut, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListResponseMessageAttemptOut - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAttemptAPIService.V1MessageAttemptListByMsg") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/api/v1/app/{app_id}/attempt/msg/{msg_id}" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"msg_id"+"}", url.PathEscape(parameterValueToString(r.msgId, "msgId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.appId) < 1 { - return localVarReturnValue, nil, reportError("appId must have at least 1 elements") - } - if strlen(r.appId) > 256 { - return localVarReturnValue, nil, reportError("appId must have less than 256 elements") - } - if strlen(r.msgId) < 1 { - return localVarReturnValue, nil, reportError("msgId must have at least 1 elements") - } - if strlen(r.msgId) > 256 { - return localVarReturnValue, nil, reportError("msgId must have less than 256 elements") - } - - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.iterator != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "iterator", r.iterator, "form", "") - } - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") - } - if r.statusCodeClass != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status_code_class", r.statusCodeClass, "form", "") - } - if r.channel != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "channel", r.channel, "form", "") - } - if r.tag != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "tag", r.tag, "form", "") - } - if r.endpointId != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "endpoint_id", r.endpointId, "form", "") - } - if r.before != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "before", r.before, "form", "") - } - if r.after != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "after", r.after, "form", "") - } - if r.withContent != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "with_content", r.withContent, "form", "") - } else { - var defaultValue bool = true - r.withContent = &defaultValue - } - if r.eventTypes != nil { - t := *r.eventTypes - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - parameterAddToHeaderOrQuery(localVarQueryParams, "event_types", s.Index(i).Interface(), "form", "multi") - } - } else { - parameterAddToHeaderOrQuery(localVarQueryParams, "event_types", t, "form", "multi") - } - } - // 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 ApiV1MessageAttemptListByMsgDeprecatedRequest struct { +type ApiV1MessageAttemptListByMsgRequest struct { ctx context.Context ApiService *MessageAttemptAPIService appId string msgId string limit *int32 iterator *string - endpointId *string + status *MessageStatus + statusCodeClass *StatusCodeClass channel *string tag *string - status *MessageStatus + endpointId *string before *time.Time after *time.Time - statusCodeClass *StatusCodeClass + withContent *bool eventTypes *[]string } // Limit the number of returned items -func (r ApiV1MessageAttemptListByMsgDeprecatedRequest) Limit(limit int32) ApiV1MessageAttemptListByMsgDeprecatedRequest { +func (r ApiV1MessageAttemptListByMsgRequest) Limit(limit int32) ApiV1MessageAttemptListByMsgRequest { r.limit = &limit return r } // The iterator returned from a prior invocation -func (r ApiV1MessageAttemptListByMsgDeprecatedRequest) Iterator(iterator string) ApiV1MessageAttemptListByMsgDeprecatedRequest { +func (r ApiV1MessageAttemptListByMsgRequest) Iterator(iterator string) ApiV1MessageAttemptListByMsgRequest { r.iterator = &iterator return r } -// Filter the attempts based on the attempted endpoint -func (r ApiV1MessageAttemptListByMsgDeprecatedRequest) EndpointId(endpointId string) ApiV1MessageAttemptListByMsgDeprecatedRequest { - r.endpointId = &endpointId +// 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 +} + +// Filter response based on the HTTP status code +func (r ApiV1MessageAttemptListByMsgRequest) StatusCodeClass(statusCodeClass StatusCodeClass) ApiV1MessageAttemptListByMsgRequest { + r.statusCodeClass = &statusCodeClass return r } // Filter response based on the channel -func (r ApiV1MessageAttemptListByMsgDeprecatedRequest) Channel(channel string) ApiV1MessageAttemptListByMsgDeprecatedRequest { +func (r ApiV1MessageAttemptListByMsgRequest) Channel(channel string) ApiV1MessageAttemptListByMsgRequest { r.channel = &channel return r } // Filter response based on the tag -func (r ApiV1MessageAttemptListByMsgDeprecatedRequest) Tag(tag string) ApiV1MessageAttemptListByMsgDeprecatedRequest { +func (r ApiV1MessageAttemptListByMsgRequest) Tag(tag string) ApiV1MessageAttemptListByMsgRequest { r.tag = &tag return r } -// 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 +// Filter the attempts based on the attempted endpoint +func (r ApiV1MessageAttemptListByMsgRequest) EndpointId(endpointId string) ApiV1MessageAttemptListByMsgRequest { + r.endpointId = &endpointId return r } // Only include items created before a certain date -func (r ApiV1MessageAttemptListByMsgDeprecatedRequest) Before(before time.Time) ApiV1MessageAttemptListByMsgDeprecatedRequest { +func (r ApiV1MessageAttemptListByMsgRequest) Before(before time.Time) ApiV1MessageAttemptListByMsgRequest { r.before = &before return r } // Only include items created after a certain date -func (r ApiV1MessageAttemptListByMsgDeprecatedRequest) After(after time.Time) ApiV1MessageAttemptListByMsgDeprecatedRequest { +func (r ApiV1MessageAttemptListByMsgRequest) After(after time.Time) ApiV1MessageAttemptListByMsgRequest { r.after = &after return r } -// Filter response based on the HTTP status code -func (r ApiV1MessageAttemptListByMsgDeprecatedRequest) StatusCodeClass(statusCodeClass StatusCodeClass) ApiV1MessageAttemptListByMsgDeprecatedRequest { - r.statusCodeClass = &statusCodeClass +// When `true` attempt content is included in the response +func (r ApiV1MessageAttemptListByMsgRequest) WithContent(withContent bool) ApiV1MessageAttemptListByMsgRequest { + r.withContent = &withContent return r } // Filter response based on the event type -func (r ApiV1MessageAttemptListByMsgDeprecatedRequest) EventTypes(eventTypes []string) ApiV1MessageAttemptListByMsgDeprecatedRequest { +func (r ApiV1MessageAttemptListByMsgRequest) EventTypes(eventTypes []string) ApiV1MessageAttemptListByMsgRequest { r.eventTypes = &eventTypes return r } -func (r ApiV1MessageAttemptListByMsgDeprecatedRequest) Execute() (*ListResponseMessageAttemptOut, *http.Response, error) { - return r.ApiService.V1MessageAttemptListByMsgDeprecatedExecute(r) +func (r ApiV1MessageAttemptListByMsgRequest) Execute() (*ListResponseMessageAttemptOut, *http.Response, error) { + return r.ApiService.V1MessageAttemptListByMsgExecute(r) } /* -V1MessageAttemptListByMsgDeprecated List Attempts +V1MessageAttemptListByMsg List Attempts By Msg -Deprecated: Please use "List Attempts by Endpoint" and "List Attempts by Msg" instead. +List attempts by message ID. Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate. -`msg_id`: Use a message id or a message `eventId` - @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 msgId The msg's ID or UID - @return ApiV1MessageAttemptListByMsgDeprecatedRequest - -Deprecated + @return ApiV1MessageAttemptListByMsgRequest */ -func (a *MessageAttemptAPIService) V1MessageAttemptListByMsgDeprecated(ctx context.Context, appId string, msgId string) ApiV1MessageAttemptListByMsgDeprecatedRequest { - return ApiV1MessageAttemptListByMsgDeprecatedRequest{ +func (a *MessageAttemptAPIService) V1MessageAttemptListByMsg(ctx context.Context, appId string, msgId string) ApiV1MessageAttemptListByMsgRequest { + return ApiV1MessageAttemptListByMsgRequest{ ApiService: a, ctx: ctx, appId: appId, @@ -2474,8 +1848,7 @@ func (a *MessageAttemptAPIService) V1MessageAttemptListByMsgDeprecated(ctx conte // Execute executes the request // @return ListResponseMessageAttemptOut -// Deprecated -func (a *MessageAttemptAPIService) V1MessageAttemptListByMsgDeprecatedExecute(r ApiV1MessageAttemptListByMsgDeprecatedRequest) (*ListResponseMessageAttemptOut, *http.Response, error) { +func (a *MessageAttemptAPIService) V1MessageAttemptListByMsgExecute(r ApiV1MessageAttemptListByMsgRequest) (*ListResponseMessageAttemptOut, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -2483,12 +1856,12 @@ func (a *MessageAttemptAPIService) V1MessageAttemptListByMsgDeprecatedExecute(r localVarReturnValue *ListResponseMessageAttemptOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAttemptAPIService.V1MessageAttemptListByMsgDeprecated") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAttemptAPIService.V1MessageAttemptListByMsg") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/v1/app/{app_id}/msg/{msg_id}/attempt" + localVarPath := localBasePath + "/api/v1/app/{app_id}/attempt/msg/{msg_id}" localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"msg_id"+"}", url.PathEscape(parameterValueToString(r.msgId, "msgId")), -1) @@ -2514,8 +1887,11 @@ func (a *MessageAttemptAPIService) V1MessageAttemptListByMsgDeprecatedExecute(r if r.iterator != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "iterator", r.iterator, "form", "") } - if r.endpointId != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "endpoint_id", r.endpointId, "form", "") + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + } + if r.statusCodeClass != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status_code_class", r.statusCodeClass, "form", "") } if r.channel != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "channel", r.channel, "form", "") @@ -2523,8 +1899,8 @@ func (a *MessageAttemptAPIService) V1MessageAttemptListByMsgDeprecatedExecute(r if r.tag != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "tag", r.tag, "form", "") } - if r.status != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "") + if r.endpointId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "endpoint_id", r.endpointId, "form", "") } if r.before != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "before", r.before, "form", "") @@ -2532,8 +1908,11 @@ func (a *MessageAttemptAPIService) V1MessageAttemptListByMsgDeprecatedExecute(r if r.after != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "after", r.after, "form", "") } - if r.statusCodeClass != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "status_code_class", r.statusCodeClass, "form", "") + if r.withContent != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "with_content", r.withContent, "form", "") + } else { + var defaultValue bool = true + r.withContent = &defaultValue } if r.eventTypes != nil { t := *r.eventTypes diff --git a/go/internal/openapi/api_stream.go b/go/internal/openapi/api_stream.go index d53c7ac90..f975b91a7 100644 --- a/go/internal/openapi/api_stream.go +++ b/go/internal/openapi/api_stream.go @@ -24,65 +24,75 @@ import ( // StreamAPIService StreamAPI service type StreamAPIService service -type ApiV1StreamCreateRequest struct { +type ApiV1StreamEventsCreateRequest struct { ctx context.Context ApiService *StreamAPIService - streamIn *StreamIn + streamId string + createStreamIn *CreateStreamIn idempotencyKey *string } -func (r ApiV1StreamCreateRequest) StreamIn(streamIn StreamIn) ApiV1StreamCreateRequest { - r.streamIn = &streamIn +func (r ApiV1StreamEventsCreateRequest) CreateStreamIn(createStreamIn CreateStreamIn) ApiV1StreamEventsCreateRequest { + r.createStreamIn = &createStreamIn return r } // The request's idempotency key -func (r ApiV1StreamCreateRequest) IdempotencyKey(idempotencyKey string) ApiV1StreamCreateRequest { +func (r ApiV1StreamEventsCreateRequest) IdempotencyKey(idempotencyKey string) ApiV1StreamEventsCreateRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1StreamCreateRequest) Execute() (*StreamOut, *http.Response, error) { - return r.ApiService.V1StreamCreateExecute(r) +func (r ApiV1StreamEventsCreateRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.V1StreamEventsCreateExecute(r) } /* -V1StreamCreate Create Stream +V1StreamEventsCreate Create Events -Creates a new stream. +Creates events on the Stream. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiV1StreamCreateRequest + @param streamId + @return ApiV1StreamEventsCreateRequest */ -func (a *StreamAPIService) V1StreamCreate(ctx context.Context) ApiV1StreamCreateRequest { - return ApiV1StreamCreateRequest{ +func (a *StreamAPIService) V1StreamEventsCreate(ctx context.Context, streamId string) ApiV1StreamEventsCreateRequest { + return ApiV1StreamEventsCreateRequest{ ApiService: a, ctx: ctx, + streamId: streamId, } } // Execute executes the request -// @return StreamOut -func (a *StreamAPIService) V1StreamCreateExecute(r ApiV1StreamCreateRequest) (*StreamOut, *http.Response, error) { +// @return map[string]interface{} +func (a *StreamAPIService) V1StreamEventsCreateExecute(r ApiV1StreamEventsCreateRequest) (map[string]interface{}, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *StreamOut + localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StreamAPIService.V1StreamCreate") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StreamAPIService.V1StreamEventsCreate") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/v1/stream" + localVarPath := localBasePath + "/api/v1/stream/{stream_id}/events" + localVarPath = strings.Replace(localVarPath, "{"+"stream_id"+"}", url.PathEscape(parameterValueToString(r.streamId, "streamId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.streamIn == nil { - return localVarReturnValue, nil, reportError("streamIn is required and must be specified") + if strlen(r.streamId) < 1 { + return localVarReturnValue, nil, reportError("streamId must have at least 1 elements") + } + if strlen(r.streamId) > 60 { + return localVarReturnValue, nil, reportError("streamId must have less than 60 elements") + } + if r.createStreamIn == nil { + return localVarReturnValue, nil, reportError("createStreamIn is required and must be specified") } // to determine the Content-Type header @@ -106,7 +116,7 @@ func (a *StreamAPIService) V1StreamCreateExecute(r ApiV1StreamCreateRequest) (*S parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "simple", "") } // body params - localVarPostBody = r.streamIn + localVarPostBody = r.createStreamIn req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -220,40 +230,47 @@ func (a *StreamAPIService) V1StreamCreateExecute(r ApiV1StreamCreateRequest) (*S return localVarReturnValue, localVarHTTPResponse, nil } -type ApiV1StreamCreateEventsRequest struct { +type ApiV1StreamEventsGetRequest struct { ctx context.Context ApiService *StreamAPIService streamId string - createStreamIn *CreateStreamIn - idempotencyKey *string + limit *int32 + iterator *string + after *time.Time } -func (r ApiV1StreamCreateEventsRequest) CreateStreamIn(createStreamIn CreateStreamIn) ApiV1StreamCreateEventsRequest { - r.createStreamIn = &createStreamIn +// Limit the number of returned items +func (r ApiV1StreamEventsGetRequest) Limit(limit int32) ApiV1StreamEventsGetRequest { + r.limit = &limit return r } -// The request's idempotency key -func (r ApiV1StreamCreateEventsRequest) IdempotencyKey(idempotencyKey string) ApiV1StreamCreateEventsRequest { - r.idempotencyKey = &idempotencyKey +// The iterator returned from a prior invocation +func (r ApiV1StreamEventsGetRequest) Iterator(iterator string) ApiV1StreamEventsGetRequest { + r.iterator = &iterator + return r +} + +func (r ApiV1StreamEventsGetRequest) After(after time.Time) ApiV1StreamEventsGetRequest { + r.after = &after return r } -func (r ApiV1StreamCreateEventsRequest) Execute() (map[string]interface{}, *http.Response, error) { - return r.ApiService.V1StreamCreateEventsExecute(r) +func (r ApiV1StreamEventsGetRequest) Execute() (*EventStreamOut, *http.Response, error) { + return r.ApiService.V1StreamEventsGetExecute(r) } /* -V1StreamCreateEvents Create Events +V1StreamEventsGet Stream Events -Creates events on the Stream. +Iterate over a stream of events. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param streamId - @return ApiV1StreamCreateEventsRequest + @return ApiV1StreamEventsGetRequest */ -func (a *StreamAPIService) V1StreamCreateEvents(ctx context.Context, streamId string) ApiV1StreamCreateEventsRequest { - return ApiV1StreamCreateEventsRequest{ +func (a *StreamAPIService) V1StreamEventsGet(ctx context.Context, streamId string) ApiV1StreamEventsGetRequest { + return ApiV1StreamEventsGetRequest{ ApiService: a, ctx: ctx, streamId: streamId, @@ -261,16 +278,16 @@ func (a *StreamAPIService) V1StreamCreateEvents(ctx context.Context, streamId st } // Execute executes the request -// @return map[string]interface{} -func (a *StreamAPIService) V1StreamCreateEventsExecute(r ApiV1StreamCreateEventsRequest) (map[string]interface{}, *http.Response, error) { +// @return EventStreamOut +func (a *StreamAPIService) V1StreamEventsGetExecute(r ApiV1StreamEventsGetRequest) (*EventStreamOut, *http.Response, error) { var ( - localVarHTTPMethod = http.MethodPost + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue map[string]interface{} + localVarReturnValue *EventStreamOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StreamAPIService.V1StreamCreateEvents") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StreamAPIService.V1StreamEventsGet") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -281,12 +298,24 @@ func (a *StreamAPIService) V1StreamCreateEventsExecute(r ApiV1StreamCreateEvents localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.createStreamIn == nil { - return localVarReturnValue, nil, reportError("createStreamIn is required and must be specified") + if strlen(r.streamId) < 1 { + return localVarReturnValue, nil, reportError("streamId must have at least 1 elements") + } + if strlen(r.streamId) > 60 { + return localVarReturnValue, nil, reportError("streamId must have less than 60 elements") } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.iterator != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "iterator", r.iterator, "form", "") + } + if r.after != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "after", r.after, "form", "") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -302,11 +331,6 @@ func (a *StreamAPIService) V1StreamCreateEventsExecute(r ApiV1StreamCreateEvents if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if r.idempotencyKey != nil { - parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "simple", "") - } - // body params - localVarPostBody = r.createStreamIn req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -420,55 +444,69 @@ func (a *StreamAPIService) V1StreamCreateEventsExecute(r ApiV1StreamCreateEvents return localVarReturnValue, localVarHTTPResponse, nil } -type ApiV1StreamDeleteRequest struct { +type ApiV1StreamStreamCreateRequest struct { ctx context.Context ApiService *StreamAPIService - streamId string + streamIn *StreamIn + idempotencyKey *string +} + +func (r ApiV1StreamStreamCreateRequest) StreamIn(streamIn StreamIn) ApiV1StreamStreamCreateRequest { + r.streamIn = &streamIn + return r +} + +// The request's idempotency key +func (r ApiV1StreamStreamCreateRequest) IdempotencyKey(idempotencyKey string) ApiV1StreamStreamCreateRequest { + r.idempotencyKey = &idempotencyKey + return r } -func (r ApiV1StreamDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.V1StreamDeleteExecute(r) +func (r ApiV1StreamStreamCreateRequest) Execute() (*StreamOut, *http.Response, error) { + return r.ApiService.V1StreamStreamCreateExecute(r) } /* -V1StreamDelete Delete Stream +V1StreamStreamCreate Create Stream -Delete a stream. +Creates a new stream. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param streamId - @return ApiV1StreamDeleteRequest + @return ApiV1StreamStreamCreateRequest */ -func (a *StreamAPIService) V1StreamDelete(ctx context.Context, streamId string) ApiV1StreamDeleteRequest { - return ApiV1StreamDeleteRequest{ +func (a *StreamAPIService) V1StreamStreamCreate(ctx context.Context) ApiV1StreamStreamCreateRequest { + return ApiV1StreamStreamCreateRequest{ ApiService: a, ctx: ctx, - streamId: streamId, } } // Execute executes the request -func (a *StreamAPIService) V1StreamDeleteExecute(r ApiV1StreamDeleteRequest) (*http.Response, error) { +// @return StreamOut +func (a *StreamAPIService) V1StreamStreamCreateExecute(r ApiV1StreamStreamCreateRequest) (*StreamOut, *http.Response, error) { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile + localVarReturnValue *StreamOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StreamAPIService.V1StreamDelete") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StreamAPIService.V1StreamStreamCreate") if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/v1/stream/{stream_id}" - localVarPath = strings.Replace(localVarPath, "{"+"stream_id"+"}", url.PathEscape(parameterValueToString(r.streamId, "streamId")), -1) + localVarPath := localBasePath + "/api/v1/stream" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.streamIn == nil { + return localVarReturnValue, nil, reportError("streamIn is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -484,21 +522,26 @@ func (a *StreamAPIService) V1StreamDeleteExecute(r ApiV1StreamDeleteRequest) (*h if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.idempotencyKey != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "simple", "") + } + // body params + localVarPostBody = r.streamIn req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return nil, err + return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -511,124 +554,113 @@ func (a *StreamAPIService) V1StreamDeleteExecute(r ApiV1StreamDeleteRequest) (*h err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarHTTPResponse, newErr + 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 localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarHTTPResponse, newErr + 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 localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarHTTPResponse, newErr + 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 localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarHTTPResponse, newErr + 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 localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarHTTPResponse, newErr + 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 localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarHTTPResponse, newErr + 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 localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v } - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + 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 ApiV1StreamEventsGetRequest struct { +type ApiV1StreamStreamDeleteRequest struct { ctx context.Context ApiService *StreamAPIService streamId string - limit *int32 - iterator *string - after *time.Time -} - -// Limit the number of returned items -func (r ApiV1StreamEventsGetRequest) Limit(limit int32) ApiV1StreamEventsGetRequest { - r.limit = &limit - return r -} - -// The iterator returned from a prior invocation -func (r ApiV1StreamEventsGetRequest) Iterator(iterator string) ApiV1StreamEventsGetRequest { - r.iterator = &iterator - return r -} - -func (r ApiV1StreamEventsGetRequest) After(after time.Time) ApiV1StreamEventsGetRequest { - r.after = &after - return r } -func (r ApiV1StreamEventsGetRequest) Execute() (*EventStreamOut, *http.Response, error) { - return r.ApiService.V1StreamEventsGetExecute(r) +func (r ApiV1StreamStreamDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.V1StreamStreamDeleteExecute(r) } /* -V1StreamEventsGet Stream Events +V1StreamStreamDelete Delete Stream -Iterate over a stream of events. +Delete a stream. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param streamId - @return ApiV1StreamEventsGetRequest + @return ApiV1StreamStreamDeleteRequest */ -func (a *StreamAPIService) V1StreamEventsGet(ctx context.Context, streamId string) ApiV1StreamEventsGetRequest { - return ApiV1StreamEventsGetRequest{ +func (a *StreamAPIService) V1StreamStreamDelete(ctx context.Context, streamId string) ApiV1StreamStreamDeleteRequest { + return ApiV1StreamStreamDeleteRequest{ ApiService: a, ctx: ctx, streamId: streamId, @@ -636,36 +668,31 @@ func (a *StreamAPIService) V1StreamEventsGet(ctx context.Context, streamId strin } // Execute executes the request -// @return EventStreamOut -func (a *StreamAPIService) V1StreamEventsGetExecute(r ApiV1StreamEventsGetRequest) (*EventStreamOut, *http.Response, error) { +func (a *StreamAPIService) V1StreamStreamDeleteExecute(r ApiV1StreamStreamDeleteRequest) (*http.Response, error) { var ( - localVarHTTPMethod = http.MethodGet + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile - localVarReturnValue *EventStreamOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StreamAPIService.V1StreamEventsGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StreamAPIService.V1StreamStreamDelete") if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/v1/stream/{stream_id}/events" + localVarPath := localBasePath + "/api/v1/stream/{stream_id}" localVarPath = strings.Replace(localVarPath, "{"+"stream_id"+"}", url.PathEscape(parameterValueToString(r.streamId, "streamId")), -1) 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 strlen(r.streamId) < 1 { + return nil, reportError("streamId must have at least 1 elements") } - if r.after != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "after", r.after, "form", "") + if strlen(r.streamId) > 60 { + return nil, reportError("streamId must have less than 60 elements") } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -685,19 +712,19 @@ func (a *StreamAPIService) V1StreamEventsGetExecute(r ApiV1StreamEventsGetReques } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, nil, err + return nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + return 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 + return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -710,113 +737,104 @@ func (a *StreamAPIService) V1StreamEventsGetExecute(r ApiV1StreamEventsGetReques err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + 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 localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + 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 localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + 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 localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + 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 localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + 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 localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + 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 localVarReturnValue, localVarHTTPResponse, newErr + return 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 localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarHTTPResponse, nil } -type ApiV1StreamGetRequest struct { +type ApiV1StreamStreamGetRequest struct { ctx context.Context ApiService *StreamAPIService streamId string } -func (r ApiV1StreamGetRequest) Execute() (*StreamOut, *http.Response, error) { - return r.ApiService.V1StreamGetExecute(r) +func (r ApiV1StreamStreamGetRequest) Execute() (*StreamOut, *http.Response, error) { + return r.ApiService.V1StreamStreamGetExecute(r) } /* -V1StreamGet Get Stream +V1StreamStreamGet Get Stream Get a stream by id or uid. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param streamId - @return ApiV1StreamGetRequest + @return ApiV1StreamStreamGetRequest */ -func (a *StreamAPIService) V1StreamGet(ctx context.Context, streamId string) ApiV1StreamGetRequest { - return ApiV1StreamGetRequest{ +func (a *StreamAPIService) V1StreamStreamGet(ctx context.Context, streamId string) ApiV1StreamStreamGetRequest { + return ApiV1StreamStreamGetRequest{ ApiService: a, ctx: ctx, streamId: streamId, @@ -825,7 +843,7 @@ func (a *StreamAPIService) V1StreamGet(ctx context.Context, streamId string) Api // Execute executes the request // @return StreamOut -func (a *StreamAPIService) V1StreamGetExecute(r ApiV1StreamGetRequest) (*StreamOut, *http.Response, error) { +func (a *StreamAPIService) V1StreamStreamGetExecute(r ApiV1StreamStreamGetRequest) (*StreamOut, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -833,7 +851,7 @@ func (a *StreamAPIService) V1StreamGetExecute(r ApiV1StreamGetRequest) (*StreamO localVarReturnValue *StreamOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StreamAPIService.V1StreamGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StreamAPIService.V1StreamStreamGet") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -844,6 +862,12 @@ func (a *StreamAPIService) V1StreamGetExecute(r ApiV1StreamGetRequest) (*StreamO localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if strlen(r.streamId) < 1 { + return localVarReturnValue, nil, reportError("streamId must have at least 1 elements") + } + if strlen(r.streamId) > 60 { + return localVarReturnValue, nil, reportError("streamId must have less than 60 elements") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -975,7 +999,7 @@ func (a *StreamAPIService) V1StreamGetExecute(r ApiV1StreamGetRequest) (*StreamO return localVarReturnValue, localVarHTTPResponse, nil } -type ApiV1StreamListRequest struct { +type ApiV1StreamStreamListRequest struct { ctx context.Context ApiService *StreamAPIService limit *int32 @@ -984,37 +1008,37 @@ type ApiV1StreamListRequest struct { } // Limit the number of returned items -func (r ApiV1StreamListRequest) Limit(limit int32) ApiV1StreamListRequest { +func (r ApiV1StreamStreamListRequest) Limit(limit int32) ApiV1StreamStreamListRequest { r.limit = &limit return r } // The iterator returned from a prior invocation -func (r ApiV1StreamListRequest) Iterator(iterator string) ApiV1StreamListRequest { +func (r ApiV1StreamStreamListRequest) Iterator(iterator string) ApiV1StreamStreamListRequest { r.iterator = &iterator return r } // The sorting order of the returned items -func (r ApiV1StreamListRequest) Order(order Ordering) ApiV1StreamListRequest { +func (r ApiV1StreamStreamListRequest) Order(order Ordering) ApiV1StreamStreamListRequest { r.order = &order return r } -func (r ApiV1StreamListRequest) Execute() (*ListResponseStreamOut, *http.Response, error) { - return r.ApiService.V1StreamListExecute(r) +func (r ApiV1StreamStreamListRequest) Execute() (*ListResponseStreamOut, *http.Response, error) { + return r.ApiService.V1StreamStreamListExecute(r) } /* -V1StreamList List Streams +V1StreamStreamList List Streams List of all the organization's streams. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiV1StreamListRequest + @return ApiV1StreamStreamListRequest */ -func (a *StreamAPIService) V1StreamList(ctx context.Context) ApiV1StreamListRequest { - return ApiV1StreamListRequest{ +func (a *StreamAPIService) V1StreamStreamList(ctx context.Context) ApiV1StreamStreamListRequest { + return ApiV1StreamStreamListRequest{ ApiService: a, ctx: ctx, } @@ -1022,7 +1046,7 @@ func (a *StreamAPIService) V1StreamList(ctx context.Context) ApiV1StreamListRequ // Execute executes the request // @return ListResponseStreamOut -func (a *StreamAPIService) V1StreamListExecute(r ApiV1StreamListRequest) (*ListResponseStreamOut, *http.Response, error) { +func (a *StreamAPIService) V1StreamStreamListExecute(r ApiV1StreamStreamListRequest) (*ListResponseStreamOut, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -1030,7 +1054,7 @@ func (a *StreamAPIService) V1StreamListExecute(r ApiV1StreamListRequest) (*ListR localVarReturnValue *ListResponseStreamOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StreamAPIService.V1StreamList") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StreamAPIService.V1StreamStreamList") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -1180,33 +1204,33 @@ func (a *StreamAPIService) V1StreamListExecute(r ApiV1StreamListRequest) (*ListR return localVarReturnValue, localVarHTTPResponse, nil } -type ApiV1StreamPatchRequest struct { +type ApiV1StreamStreamPatchRequest struct { ctx context.Context ApiService *StreamAPIService streamId string streamPatch *StreamPatch } -func (r ApiV1StreamPatchRequest) StreamPatch(streamPatch StreamPatch) ApiV1StreamPatchRequest { +func (r ApiV1StreamStreamPatchRequest) StreamPatch(streamPatch StreamPatch) ApiV1StreamStreamPatchRequest { r.streamPatch = &streamPatch return r } -func (r ApiV1StreamPatchRequest) Execute() (*StreamOut, *http.Response, error) { - return r.ApiService.V1StreamPatchExecute(r) +func (r ApiV1StreamStreamPatchRequest) Execute() (*StreamOut, *http.Response, error) { + return r.ApiService.V1StreamStreamPatchExecute(r) } /* -V1StreamPatch Patch Stream +V1StreamStreamPatch Patch Stream Partially update a stream. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param streamId - @return ApiV1StreamPatchRequest + @return ApiV1StreamStreamPatchRequest */ -func (a *StreamAPIService) V1StreamPatch(ctx context.Context, streamId string) ApiV1StreamPatchRequest { - return ApiV1StreamPatchRequest{ +func (a *StreamAPIService) V1StreamStreamPatch(ctx context.Context, streamId string) ApiV1StreamStreamPatchRequest { + return ApiV1StreamStreamPatchRequest{ ApiService: a, ctx: ctx, streamId: streamId, @@ -1215,7 +1239,7 @@ func (a *StreamAPIService) V1StreamPatch(ctx context.Context, streamId string) A // Execute executes the request // @return StreamOut -func (a *StreamAPIService) V1StreamPatchExecute(r ApiV1StreamPatchRequest) (*StreamOut, *http.Response, error) { +func (a *StreamAPIService) V1StreamStreamPatchExecute(r ApiV1StreamStreamPatchRequest) (*StreamOut, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} @@ -1223,7 +1247,7 @@ func (a *StreamAPIService) V1StreamPatchExecute(r ApiV1StreamPatchRequest) (*Str localVarReturnValue *StreamOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StreamAPIService.V1StreamPatch") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StreamAPIService.V1StreamStreamPatch") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -1234,6 +1258,12 @@ func (a *StreamAPIService) V1StreamPatchExecute(r ApiV1StreamPatchRequest) (*Str localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if strlen(r.streamId) < 1 { + return localVarReturnValue, nil, reportError("streamId must have at least 1 elements") + } + if strlen(r.streamId) > 60 { + return localVarReturnValue, nil, reportError("streamId must have less than 60 elements") + } if r.streamPatch == nil { return localVarReturnValue, nil, reportError("streamPatch is required and must be specified") } @@ -1370,33 +1400,33 @@ func (a *StreamAPIService) V1StreamPatchExecute(r ApiV1StreamPatchRequest) (*Str return localVarReturnValue, localVarHTTPResponse, nil } -type ApiV1StreamUpdateRequest struct { +type ApiV1StreamStreamUpdateRequest struct { ctx context.Context ApiService *StreamAPIService streamId string streamIn *StreamIn } -func (r ApiV1StreamUpdateRequest) StreamIn(streamIn StreamIn) ApiV1StreamUpdateRequest { +func (r ApiV1StreamStreamUpdateRequest) StreamIn(streamIn StreamIn) ApiV1StreamStreamUpdateRequest { r.streamIn = &streamIn return r } -func (r ApiV1StreamUpdateRequest) Execute() (*StreamOut, *http.Response, error) { - return r.ApiService.V1StreamUpdateExecute(r) +func (r ApiV1StreamStreamUpdateRequest) Execute() (*StreamOut, *http.Response, error) { + return r.ApiService.V1StreamStreamUpdateExecute(r) } /* -V1StreamUpdate Update Stream +V1StreamStreamUpdate Update Stream Update a stream. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param streamId - @return ApiV1StreamUpdateRequest + @return ApiV1StreamStreamUpdateRequest */ -func (a *StreamAPIService) V1StreamUpdate(ctx context.Context, streamId string) ApiV1StreamUpdateRequest { - return ApiV1StreamUpdateRequest{ +func (a *StreamAPIService) V1StreamStreamUpdate(ctx context.Context, streamId string) ApiV1StreamStreamUpdateRequest { + return ApiV1StreamStreamUpdateRequest{ ApiService: a, ctx: ctx, streamId: streamId, @@ -1405,7 +1435,7 @@ func (a *StreamAPIService) V1StreamUpdate(ctx context.Context, streamId string) // Execute executes the request // @return StreamOut -func (a *StreamAPIService) V1StreamUpdateExecute(r ApiV1StreamUpdateRequest) (*StreamOut, *http.Response, error) { +func (a *StreamAPIService) V1StreamStreamUpdateExecute(r ApiV1StreamStreamUpdateRequest) (*StreamOut, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} @@ -1413,7 +1443,7 @@ func (a *StreamAPIService) V1StreamUpdateExecute(r ApiV1StreamUpdateRequest) (*S localVarReturnValue *StreamOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StreamAPIService.V1StreamUpdate") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StreamAPIService.V1StreamStreamUpdate") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -1424,6 +1454,12 @@ func (a *StreamAPIService) V1StreamUpdateExecute(r ApiV1StreamUpdateRequest) (*S localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if strlen(r.streamId) < 1 { + return localVarReturnValue, nil, reportError("streamId must have at least 1 elements") + } + if strlen(r.streamId) > 60 { + return localVarReturnValue, nil, reportError("streamId must have less than 60 elements") + } if r.streamIn == nil { return localVarReturnValue, nil, reportError("streamIn is required and must be specified") } diff --git a/go/internal/openapi/api_transformation_template.go b/go/internal/openapi/api_transformation_template.go index dd081d555..07486a0b8 100644 --- a/go/internal/openapi/api_transformation_template.go +++ b/go/internal/openapi/api_transformation_template.go @@ -43,7 +43,8 @@ func (r ApiV1EndpointUpdateHubspotOauthConfigRequest) Execute() (*http.Response, /* V1EndpointUpdateHubspotOauthConfig Update Hubspot Oauth Config -Create/update endpoint Hubspot OAuth configuration +Create / update endpoint Hubspot OAuth configuration. + Specific private endpoint just for us, to avoid exposing the Hubspot secret to the client. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). diff --git a/go/internal/openapi/api_webhook_endpoint.go b/go/internal/openapi/api_webhook_endpoint.go index 442ff3e6d..2b3343260 100644 --- a/go/internal/openapi/api_webhook_endpoint.go +++ b/go/internal/openapi/api_webhook_endpoint.go @@ -23,38 +23,38 @@ import ( // WebhookEndpointAPIService WebhookEndpointAPI service type WebhookEndpointAPIService service -type ApiCreateOperationalWebhookEndpointRequest struct { +type ApiV1OperationalWebhookEndpointCreateRequest struct { ctx context.Context ApiService *WebhookEndpointAPIService operationalWebhookEndpointIn *OperationalWebhookEndpointIn idempotencyKey *string } -func (r ApiCreateOperationalWebhookEndpointRequest) OperationalWebhookEndpointIn(operationalWebhookEndpointIn OperationalWebhookEndpointIn) ApiCreateOperationalWebhookEndpointRequest { +func (r ApiV1OperationalWebhookEndpointCreateRequest) OperationalWebhookEndpointIn(operationalWebhookEndpointIn OperationalWebhookEndpointIn) ApiV1OperationalWebhookEndpointCreateRequest { r.operationalWebhookEndpointIn = &operationalWebhookEndpointIn return r } // The request's idempotency key -func (r ApiCreateOperationalWebhookEndpointRequest) IdempotencyKey(idempotencyKey string) ApiCreateOperationalWebhookEndpointRequest { +func (r ApiV1OperationalWebhookEndpointCreateRequest) IdempotencyKey(idempotencyKey string) ApiV1OperationalWebhookEndpointCreateRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiCreateOperationalWebhookEndpointRequest) Execute() (*OperationalWebhookEndpointOut, *http.Response, error) { - return r.ApiService.CreateOperationalWebhookEndpointExecute(r) +func (r ApiV1OperationalWebhookEndpointCreateRequest) Execute() (*OperationalWebhookEndpointOut, *http.Response, error) { + return r.ApiService.V1OperationalWebhookEndpointCreateExecute(r) } /* -CreateOperationalWebhookEndpoint Create Operational Webhook Endpoint +V1OperationalWebhookEndpointCreate 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 + @return ApiV1OperationalWebhookEndpointCreateRequest */ -func (a *WebhookEndpointAPIService) CreateOperationalWebhookEndpoint(ctx context.Context) ApiCreateOperationalWebhookEndpointRequest { - return ApiCreateOperationalWebhookEndpointRequest{ +func (a *WebhookEndpointAPIService) V1OperationalWebhookEndpointCreate(ctx context.Context) ApiV1OperationalWebhookEndpointCreateRequest { + return ApiV1OperationalWebhookEndpointCreateRequest{ ApiService: a, ctx: ctx, } @@ -62,7 +62,7 @@ func (a *WebhookEndpointAPIService) CreateOperationalWebhookEndpoint(ctx context // Execute executes the request // @return OperationalWebhookEndpointOut -func (a *WebhookEndpointAPIService) CreateOperationalWebhookEndpointExecute(r ApiCreateOperationalWebhookEndpointRequest) (*OperationalWebhookEndpointOut, *http.Response, error) { +func (a *WebhookEndpointAPIService) V1OperationalWebhookEndpointCreateExecute(r ApiV1OperationalWebhookEndpointCreateRequest) (*OperationalWebhookEndpointOut, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -70,7 +70,7 @@ func (a *WebhookEndpointAPIService) CreateOperationalWebhookEndpointExecute(r Ap localVarReturnValue *OperationalWebhookEndpointOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhookEndpointAPIService.CreateOperationalWebhookEndpoint") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhookEndpointAPIService.V1OperationalWebhookEndpointCreate") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -219,27 +219,27 @@ func (a *WebhookEndpointAPIService) CreateOperationalWebhookEndpointExecute(r Ap return localVarReturnValue, localVarHTTPResponse, nil } -type ApiDeleteOperationalWebhookEndpointRequest struct { +type ApiV1OperationalWebhookEndpointDeleteRequest struct { ctx context.Context ApiService *WebhookEndpointAPIService endpointId string } -func (r ApiDeleteOperationalWebhookEndpointRequest) Execute() (*http.Response, error) { - return r.ApiService.DeleteOperationalWebhookEndpointExecute(r) +func (r ApiV1OperationalWebhookEndpointDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.V1OperationalWebhookEndpointDeleteExecute(r) } /* -DeleteOperationalWebhookEndpoint Delete Operational Webhook Endpoint +V1OperationalWebhookEndpointDelete 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 + @return ApiV1OperationalWebhookEndpointDeleteRequest */ -func (a *WebhookEndpointAPIService) DeleteOperationalWebhookEndpoint(ctx context.Context, endpointId string) ApiDeleteOperationalWebhookEndpointRequest { - return ApiDeleteOperationalWebhookEndpointRequest{ +func (a *WebhookEndpointAPIService) V1OperationalWebhookEndpointDelete(ctx context.Context, endpointId string) ApiV1OperationalWebhookEndpointDeleteRequest { + return ApiV1OperationalWebhookEndpointDeleteRequest{ ApiService: a, ctx: ctx, endpointId: endpointId, @@ -247,14 +247,14 @@ func (a *WebhookEndpointAPIService) DeleteOperationalWebhookEndpoint(ctx context } // Execute executes the request -func (a *WebhookEndpointAPIService) DeleteOperationalWebhookEndpointExecute(r ApiDeleteOperationalWebhookEndpointRequest) (*http.Response, error) { +func (a *WebhookEndpointAPIService) V1OperationalWebhookEndpointDeleteExecute(r ApiV1OperationalWebhookEndpointDeleteRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhookEndpointAPIService.DeleteOperationalWebhookEndpoint") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhookEndpointAPIService.V1OperationalWebhookEndpointDelete") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } @@ -393,27 +393,27 @@ func (a *WebhookEndpointAPIService) DeleteOperationalWebhookEndpointExecute(r Ap return localVarHTTPResponse, nil } -type ApiGetOperationalWebhookEndpointRequest struct { +type ApiV1OperationalWebhookEndpointGetRequest struct { ctx context.Context ApiService *WebhookEndpointAPIService endpointId string } -func (r ApiGetOperationalWebhookEndpointRequest) Execute() (*OperationalWebhookEndpointOut, *http.Response, error) { - return r.ApiService.GetOperationalWebhookEndpointExecute(r) +func (r ApiV1OperationalWebhookEndpointGetRequest) Execute() (*OperationalWebhookEndpointOut, *http.Response, error) { + return r.ApiService.V1OperationalWebhookEndpointGetExecute(r) } /* -GetOperationalWebhookEndpoint Get Operational Webhook Endpoint +V1OperationalWebhookEndpointGet 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 + @return ApiV1OperationalWebhookEndpointGetRequest */ -func (a *WebhookEndpointAPIService) GetOperationalWebhookEndpoint(ctx context.Context, endpointId string) ApiGetOperationalWebhookEndpointRequest { - return ApiGetOperationalWebhookEndpointRequest{ +func (a *WebhookEndpointAPIService) V1OperationalWebhookEndpointGet(ctx context.Context, endpointId string) ApiV1OperationalWebhookEndpointGetRequest { + return ApiV1OperationalWebhookEndpointGetRequest{ ApiService: a, ctx: ctx, endpointId: endpointId, @@ -422,7 +422,7 @@ func (a *WebhookEndpointAPIService) GetOperationalWebhookEndpoint(ctx context.Co // Execute executes the request // @return OperationalWebhookEndpointOut -func (a *WebhookEndpointAPIService) GetOperationalWebhookEndpointExecute(r ApiGetOperationalWebhookEndpointRequest) (*OperationalWebhookEndpointOut, *http.Response, error) { +func (a *WebhookEndpointAPIService) V1OperationalWebhookEndpointGetExecute(r ApiV1OperationalWebhookEndpointGetRequest) (*OperationalWebhookEndpointOut, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -430,7 +430,7 @@ func (a *WebhookEndpointAPIService) GetOperationalWebhookEndpointExecute(r ApiGe localVarReturnValue *OperationalWebhookEndpointOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhookEndpointAPIService.GetOperationalWebhookEndpoint") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhookEndpointAPIService.V1OperationalWebhookEndpointGet") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -578,18 +578,203 @@ func (a *WebhookEndpointAPIService) GetOperationalWebhookEndpointExecute(r ApiGe return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetOperationalWebhookEndpointSecretRequest struct { +type ApiV1OperationalWebhookEndpointGetHeadersRequest struct { ctx context.Context ApiService *WebhookEndpointAPIService endpointId string } -func (r ApiGetOperationalWebhookEndpointSecretRequest) Execute() (*OperationalWebhookEndpointSecretOut, *http.Response, error) { - return r.ApiService.GetOperationalWebhookEndpointSecretExecute(r) +func (r ApiV1OperationalWebhookEndpointGetHeadersRequest) Execute() (*OperationalWebhookEndpointHeadersOut, *http.Response, error) { + return r.ApiService.V1OperationalWebhookEndpointGetHeadersExecute(r) } /* -GetOperationalWebhookEndpointSecret Get Operational Webhook Endpoint Secret +V1OperationalWebhookEndpointGetHeaders Get Operational Webhook Endpoint Headers + +Get the additional headers to be sent with the operational webhook. + + @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 ApiV1OperationalWebhookEndpointGetHeadersRequest +*/ +func (a *WebhookEndpointAPIService) V1OperationalWebhookEndpointGetHeaders(ctx context.Context, endpointId string) ApiV1OperationalWebhookEndpointGetHeadersRequest { + return ApiV1OperationalWebhookEndpointGetHeadersRequest{ + ApiService: a, + ctx: ctx, + endpointId: endpointId, + } +} + +// Execute executes the request +// @return OperationalWebhookEndpointHeadersOut +func (a *WebhookEndpointAPIService) V1OperationalWebhookEndpointGetHeadersExecute(r ApiV1OperationalWebhookEndpointGetHeadersRequest) (*OperationalWebhookEndpointHeadersOut, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OperationalWebhookEndpointHeadersOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhookEndpointAPIService.V1OperationalWebhookEndpointGetHeaders") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/operational-webhook/endpoint/{endpoint_id}/headers" + 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 ApiV1OperationalWebhookEndpointGetSecretRequest struct { + ctx context.Context + ApiService *WebhookEndpointAPIService + endpointId string +} + +func (r ApiV1OperationalWebhookEndpointGetSecretRequest) Execute() (*OperationalWebhookEndpointSecretOut, *http.Response, error) { + return r.ApiService.V1OperationalWebhookEndpointGetSecretExecute(r) +} + +/* +V1OperationalWebhookEndpointGetSecret Get Operational Webhook Endpoint Secret Get an operational webhook endpoint's signing secret. @@ -598,10 +783,10 @@ For more information please refer to [the consuming webhooks docs](https://docs. @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 + @return ApiV1OperationalWebhookEndpointGetSecretRequest */ -func (a *WebhookEndpointAPIService) GetOperationalWebhookEndpointSecret(ctx context.Context, endpointId string) ApiGetOperationalWebhookEndpointSecretRequest { - return ApiGetOperationalWebhookEndpointSecretRequest{ +func (a *WebhookEndpointAPIService) V1OperationalWebhookEndpointGetSecret(ctx context.Context, endpointId string) ApiV1OperationalWebhookEndpointGetSecretRequest { + return ApiV1OperationalWebhookEndpointGetSecretRequest{ ApiService: a, ctx: ctx, endpointId: endpointId, @@ -610,7 +795,7 @@ func (a *WebhookEndpointAPIService) GetOperationalWebhookEndpointSecret(ctx cont // Execute executes the request // @return OperationalWebhookEndpointSecretOut -func (a *WebhookEndpointAPIService) GetOperationalWebhookEndpointSecretExecute(r ApiGetOperationalWebhookEndpointSecretRequest) (*OperationalWebhookEndpointSecretOut, *http.Response, error) { +func (a *WebhookEndpointAPIService) V1OperationalWebhookEndpointGetSecretExecute(r ApiV1OperationalWebhookEndpointGetSecretRequest) (*OperationalWebhookEndpointSecretOut, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -618,7 +803,7 @@ func (a *WebhookEndpointAPIService) GetOperationalWebhookEndpointSecretExecute(r localVarReturnValue *OperationalWebhookEndpointSecretOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhookEndpointAPIService.GetOperationalWebhookEndpointSecret") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhookEndpointAPIService.V1OperationalWebhookEndpointGetSecret") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -766,7 +951,7 @@ func (a *WebhookEndpointAPIService) GetOperationalWebhookEndpointSecretExecute(r return localVarReturnValue, localVarHTTPResponse, nil } -type ApiListOperationalWebhookEndpointsRequest struct { +type ApiV1OperationalWebhookEndpointListRequest struct { ctx context.Context ApiService *WebhookEndpointAPIService limit *int32 @@ -775,37 +960,37 @@ type ApiListOperationalWebhookEndpointsRequest struct { } // Limit the number of returned items -func (r ApiListOperationalWebhookEndpointsRequest) Limit(limit int32) ApiListOperationalWebhookEndpointsRequest { +func (r ApiV1OperationalWebhookEndpointListRequest) Limit(limit int32) ApiV1OperationalWebhookEndpointListRequest { r.limit = &limit return r } // The iterator returned from a prior invocation -func (r ApiListOperationalWebhookEndpointsRequest) Iterator(iterator string) ApiListOperationalWebhookEndpointsRequest { +func (r ApiV1OperationalWebhookEndpointListRequest) Iterator(iterator string) ApiV1OperationalWebhookEndpointListRequest { r.iterator = &iterator return r } // The sorting order of the returned items -func (r ApiListOperationalWebhookEndpointsRequest) Order(order Ordering) ApiListOperationalWebhookEndpointsRequest { +func (r ApiV1OperationalWebhookEndpointListRequest) Order(order Ordering) ApiV1OperationalWebhookEndpointListRequest { r.order = &order return r } -func (r ApiListOperationalWebhookEndpointsRequest) Execute() (*ListResponseOperationalWebhookEndpointOut, *http.Response, error) { - return r.ApiService.ListOperationalWebhookEndpointsExecute(r) +func (r ApiV1OperationalWebhookEndpointListRequest) Execute() (*ListResponseOperationalWebhookEndpointOut, *http.Response, error) { + return r.ApiService.V1OperationalWebhookEndpointListExecute(r) } /* -ListOperationalWebhookEndpoints List Operational Webhook Endpoints +V1OperationalWebhookEndpointList 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 + @return ApiV1OperationalWebhookEndpointListRequest */ -func (a *WebhookEndpointAPIService) ListOperationalWebhookEndpoints(ctx context.Context) ApiListOperationalWebhookEndpointsRequest { - return ApiListOperationalWebhookEndpointsRequest{ +func (a *WebhookEndpointAPIService) V1OperationalWebhookEndpointList(ctx context.Context) ApiV1OperationalWebhookEndpointListRequest { + return ApiV1OperationalWebhookEndpointListRequest{ ApiService: a, ctx: ctx, } @@ -813,7 +998,7 @@ func (a *WebhookEndpointAPIService) ListOperationalWebhookEndpoints(ctx context. // Execute executes the request // @return ListResponseOperationalWebhookEndpointOut -func (a *WebhookEndpointAPIService) ListOperationalWebhookEndpointsExecute(r ApiListOperationalWebhookEndpointsRequest) (*ListResponseOperationalWebhookEndpointOut, *http.Response, error) { +func (a *WebhookEndpointAPIService) V1OperationalWebhookEndpointListExecute(r ApiV1OperationalWebhookEndpointListRequest) (*ListResponseOperationalWebhookEndpointOut, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -821,7 +1006,7 @@ func (a *WebhookEndpointAPIService) ListOperationalWebhookEndpointsExecute(r Api localVarReturnValue *ListResponseOperationalWebhookEndpointOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhookEndpointAPIService.ListOperationalWebhookEndpoints") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhookEndpointAPIService.V1OperationalWebhookEndpointList") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -971,7 +1156,7 @@ func (a *WebhookEndpointAPIService) ListOperationalWebhookEndpointsExecute(r Api return localVarReturnValue, localVarHTTPResponse, nil } -type ApiRotateOperationalWebhookEndpointSecretRequest struct { +type ApiV1OperationalWebhookEndpointRotateSecretRequest struct { ctx context.Context ApiService *WebhookEndpointAPIService endpointId string @@ -979,23 +1164,23 @@ type ApiRotateOperationalWebhookEndpointSecretRequest struct { idempotencyKey *string } -func (r ApiRotateOperationalWebhookEndpointSecretRequest) OperationalWebhookEndpointSecretIn(operationalWebhookEndpointSecretIn OperationalWebhookEndpointSecretIn) ApiRotateOperationalWebhookEndpointSecretRequest { +func (r ApiV1OperationalWebhookEndpointRotateSecretRequest) OperationalWebhookEndpointSecretIn(operationalWebhookEndpointSecretIn OperationalWebhookEndpointSecretIn) ApiV1OperationalWebhookEndpointRotateSecretRequest { r.operationalWebhookEndpointSecretIn = &operationalWebhookEndpointSecretIn return r } // The request's idempotency key -func (r ApiRotateOperationalWebhookEndpointSecretRequest) IdempotencyKey(idempotencyKey string) ApiRotateOperationalWebhookEndpointSecretRequest { +func (r ApiV1OperationalWebhookEndpointRotateSecretRequest) IdempotencyKey(idempotencyKey string) ApiV1OperationalWebhookEndpointRotateSecretRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiRotateOperationalWebhookEndpointSecretRequest) Execute() (*http.Response, error) { - return r.ApiService.RotateOperationalWebhookEndpointSecretExecute(r) +func (r ApiV1OperationalWebhookEndpointRotateSecretRequest) Execute() (*http.Response, error) { + return r.ApiService.V1OperationalWebhookEndpointRotateSecretExecute(r) } /* -RotateOperationalWebhookEndpointSecret Rotate Operational Webhook Endpoint Secret +V1OperationalWebhookEndpointRotateSecret Rotate Operational Webhook Endpoint Secret Rotates an operational webhook endpoint's signing secret. @@ -1003,10 +1188,10 @@ 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 + @return ApiV1OperationalWebhookEndpointRotateSecretRequest */ -func (a *WebhookEndpointAPIService) RotateOperationalWebhookEndpointSecret(ctx context.Context, endpointId string) ApiRotateOperationalWebhookEndpointSecretRequest { - return ApiRotateOperationalWebhookEndpointSecretRequest{ +func (a *WebhookEndpointAPIService) V1OperationalWebhookEndpointRotateSecret(ctx context.Context, endpointId string) ApiV1OperationalWebhookEndpointRotateSecretRequest { + return ApiV1OperationalWebhookEndpointRotateSecretRequest{ ApiService: a, ctx: ctx, endpointId: endpointId, @@ -1014,14 +1199,14 @@ func (a *WebhookEndpointAPIService) RotateOperationalWebhookEndpointSecret(ctx c } // Execute executes the request -func (a *WebhookEndpointAPIService) RotateOperationalWebhookEndpointSecretExecute(r ApiRotateOperationalWebhookEndpointSecretRequest) (*http.Response, error) { +func (a *WebhookEndpointAPIService) V1OperationalWebhookEndpointRotateSecretExecute(r ApiV1OperationalWebhookEndpointRotateSecretRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhookEndpointAPIService.RotateOperationalWebhookEndpointSecret") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhookEndpointAPIService.V1OperationalWebhookEndpointRotateSecret") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } @@ -1168,33 +1353,33 @@ func (a *WebhookEndpointAPIService) RotateOperationalWebhookEndpointSecretExecut return localVarHTTPResponse, nil } -type ApiUpdateOperationalWebhookEndpointRequest struct { +type ApiV1OperationalWebhookEndpointUpdateRequest struct { ctx context.Context ApiService *WebhookEndpointAPIService endpointId string operationalWebhookEndpointUpdate *OperationalWebhookEndpointUpdate } -func (r ApiUpdateOperationalWebhookEndpointRequest) OperationalWebhookEndpointUpdate(operationalWebhookEndpointUpdate OperationalWebhookEndpointUpdate) ApiUpdateOperationalWebhookEndpointRequest { +func (r ApiV1OperationalWebhookEndpointUpdateRequest) OperationalWebhookEndpointUpdate(operationalWebhookEndpointUpdate OperationalWebhookEndpointUpdate) ApiV1OperationalWebhookEndpointUpdateRequest { r.operationalWebhookEndpointUpdate = &operationalWebhookEndpointUpdate return r } -func (r ApiUpdateOperationalWebhookEndpointRequest) Execute() (*OperationalWebhookEndpointOut, *http.Response, error) { - return r.ApiService.UpdateOperationalWebhookEndpointExecute(r) +func (r ApiV1OperationalWebhookEndpointUpdateRequest) Execute() (*OperationalWebhookEndpointOut, *http.Response, error) { + return r.ApiService.V1OperationalWebhookEndpointUpdateExecute(r) } /* -UpdateOperationalWebhookEndpoint Update Operational Webhook Endpoint +V1OperationalWebhookEndpointUpdate 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 + @return ApiV1OperationalWebhookEndpointUpdateRequest */ -func (a *WebhookEndpointAPIService) UpdateOperationalWebhookEndpoint(ctx context.Context, endpointId string) ApiUpdateOperationalWebhookEndpointRequest { - return ApiUpdateOperationalWebhookEndpointRequest{ +func (a *WebhookEndpointAPIService) V1OperationalWebhookEndpointUpdate(ctx context.Context, endpointId string) ApiV1OperationalWebhookEndpointUpdateRequest { + return ApiV1OperationalWebhookEndpointUpdateRequest{ ApiService: a, ctx: ctx, endpointId: endpointId, @@ -1203,7 +1388,7 @@ func (a *WebhookEndpointAPIService) UpdateOperationalWebhookEndpoint(ctx context // Execute executes the request // @return OperationalWebhookEndpointOut -func (a *WebhookEndpointAPIService) UpdateOperationalWebhookEndpointExecute(r ApiUpdateOperationalWebhookEndpointRequest) (*OperationalWebhookEndpointOut, *http.Response, error) { +func (a *WebhookEndpointAPIService) V1OperationalWebhookEndpointUpdateExecute(r ApiV1OperationalWebhookEndpointUpdateRequest) (*OperationalWebhookEndpointOut, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} @@ -1211,7 +1396,7 @@ func (a *WebhookEndpointAPIService) UpdateOperationalWebhookEndpointExecute(r Ap localVarReturnValue *OperationalWebhookEndpointOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhookEndpointAPIService.UpdateOperationalWebhookEndpoint") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhookEndpointAPIService.V1OperationalWebhookEndpointUpdate") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } @@ -1363,3 +1548,188 @@ func (a *WebhookEndpointAPIService) UpdateOperationalWebhookEndpointExecute(r Ap return localVarReturnValue, localVarHTTPResponse, nil } + +type ApiV1OperationalWebhookEndpointUpdateHeadersRequest struct { + ctx context.Context + ApiService *WebhookEndpointAPIService + endpointId string + operationalWebhookEndpointHeadersIn *OperationalWebhookEndpointHeadersIn +} + +func (r ApiV1OperationalWebhookEndpointUpdateHeadersRequest) OperationalWebhookEndpointHeadersIn(operationalWebhookEndpointHeadersIn OperationalWebhookEndpointHeadersIn) ApiV1OperationalWebhookEndpointUpdateHeadersRequest { + r.operationalWebhookEndpointHeadersIn = &operationalWebhookEndpointHeadersIn + return r +} + +func (r ApiV1OperationalWebhookEndpointUpdateHeadersRequest) Execute() (*http.Response, error) { + return r.ApiService.V1OperationalWebhookEndpointUpdateHeadersExecute(r) +} + +/* +V1OperationalWebhookEndpointUpdateHeaders Update Operational Webhook Endpoint Headers + +Set the additional headers to be sent with the operational webhook. + + @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 ApiV1OperationalWebhookEndpointUpdateHeadersRequest +*/ +func (a *WebhookEndpointAPIService) V1OperationalWebhookEndpointUpdateHeaders(ctx context.Context, endpointId string) ApiV1OperationalWebhookEndpointUpdateHeadersRequest { + return ApiV1OperationalWebhookEndpointUpdateHeadersRequest{ + ApiService: a, + ctx: ctx, + endpointId: endpointId, + } +} + +// Execute executes the request +func (a *WebhookEndpointAPIService) V1OperationalWebhookEndpointUpdateHeadersExecute(r ApiV1OperationalWebhookEndpointUpdateHeadersRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WebhookEndpointAPIService.V1OperationalWebhookEndpointUpdateHeaders") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/operational-webhook/endpoint/{endpoint_id}/headers" + 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.operationalWebhookEndpointHeadersIn == nil { + return nil, reportError("operationalWebhookEndpointHeadersIn 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.operationalWebhookEndpointHeadersIn + 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 +} diff --git a/go/internal/openapi/model_aggregated_event_types.go b/go/internal/openapi/model_aggregated_event_types.go new file mode 100644 index 000000000..136133885 --- /dev/null +++ b/go/internal/openapi/model_aggregated_event_types.go @@ -0,0 +1,215 @@ +/* +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 AggregatedEventTypes type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AggregatedEventTypes{} + +// AggregatedEventTypes struct for AggregatedEventTypes +type AggregatedEventTypes struct { + // The app's ID + AppId string `json:"appId"` + ExplicitlySubscribedEventTypes []string `json:"explicitlySubscribedEventTypes"` + HasCatchAllEndpoint bool `json:"hasCatchAllEndpoint"` +} + +type _AggregatedEventTypes AggregatedEventTypes + +// NewAggregatedEventTypes instantiates a new AggregatedEventTypes 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 NewAggregatedEventTypes(appId string, explicitlySubscribedEventTypes []string, hasCatchAllEndpoint bool) *AggregatedEventTypes { + this := AggregatedEventTypes{} + this.AppId = appId + this.ExplicitlySubscribedEventTypes = explicitlySubscribedEventTypes + this.HasCatchAllEndpoint = hasCatchAllEndpoint + return &this +} + +// NewAggregatedEventTypesWithDefaults instantiates a new AggregatedEventTypes 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 NewAggregatedEventTypesWithDefaults() *AggregatedEventTypes { + this := AggregatedEventTypes{} + return &this +} + +// GetAppId returns the AppId field value +func (o *AggregatedEventTypes) GetAppId() string { + if o == nil { + var ret string + return ret + } + + return o.AppId +} + +// GetAppIdOk returns a tuple with the AppId field value +// and a boolean to check if the value has been set. +func (o *AggregatedEventTypes) GetAppIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AppId, true +} + +// SetAppId sets field value +func (o *AggregatedEventTypes) SetAppId(v string) { + o.AppId = v +} + +// GetExplicitlySubscribedEventTypes returns the ExplicitlySubscribedEventTypes field value +func (o *AggregatedEventTypes) GetExplicitlySubscribedEventTypes() []string { + if o == nil { + var ret []string + return ret + } + + return o.ExplicitlySubscribedEventTypes +} + +// GetExplicitlySubscribedEventTypesOk returns a tuple with the ExplicitlySubscribedEventTypes field value +// and a boolean to check if the value has been set. +func (o *AggregatedEventTypes) GetExplicitlySubscribedEventTypesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.ExplicitlySubscribedEventTypes, true +} + +// SetExplicitlySubscribedEventTypes sets field value +func (o *AggregatedEventTypes) SetExplicitlySubscribedEventTypes(v []string) { + o.ExplicitlySubscribedEventTypes = v +} + +// GetHasCatchAllEndpoint returns the HasCatchAllEndpoint field value +func (o *AggregatedEventTypes) GetHasCatchAllEndpoint() bool { + if o == nil { + var ret bool + return ret + } + + return o.HasCatchAllEndpoint +} + +// GetHasCatchAllEndpointOk returns a tuple with the HasCatchAllEndpoint field value +// and a boolean to check if the value has been set. +func (o *AggregatedEventTypes) GetHasCatchAllEndpointOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.HasCatchAllEndpoint, true +} + +// SetHasCatchAllEndpoint sets field value +func (o *AggregatedEventTypes) SetHasCatchAllEndpoint(v bool) { + o.HasCatchAllEndpoint = v +} + +func (o AggregatedEventTypes) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AggregatedEventTypes) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["appId"] = o.AppId + toSerialize["explicitlySubscribedEventTypes"] = o.ExplicitlySubscribedEventTypes + toSerialize["hasCatchAllEndpoint"] = o.HasCatchAllEndpoint + return toSerialize, nil +} + +func (o *AggregatedEventTypes) 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{ + "appId", + "explicitlySubscribedEventTypes", + "hasCatchAllEndpoint", + } + + 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) + } + } + + varAggregatedEventTypes := _AggregatedEventTypes{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAggregatedEventTypes) + + if err != nil { + return err + } + + *o = AggregatedEventTypes(varAggregatedEventTypes) + + return err +} + +type NullableAggregatedEventTypes struct { + value *AggregatedEventTypes + isSet bool +} + +func (v NullableAggregatedEventTypes) Get() *AggregatedEventTypes { + return v.value +} + +func (v *NullableAggregatedEventTypes) Set(val *AggregatedEventTypes) { + v.value = val + v.isSet = true +} + +func (v NullableAggregatedEventTypes) IsSet() bool { + return v.isSet +} + +func (v *NullableAggregatedEventTypes) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAggregatedEventTypes(val *AggregatedEventTypes) *NullableAggregatedEventTypes { + return &NullableAggregatedEventTypes{value: val, isSet: true} +} + +func (v NullableAggregatedEventTypes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAggregatedEventTypes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_application_message_failure.go b/go/internal/openapi/model_application_message_failure.go new file mode 100644 index 000000000..049a77293 --- /dev/null +++ b/go/internal/openapi/model_application_message_failure.go @@ -0,0 +1,187 @@ +/* +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 ApplicationMessageFailure type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationMessageFailure{} + +// ApplicationMessageFailure struct for ApplicationMessageFailure +type ApplicationMessageFailure struct { + // The app's ID + AppId string `json:"appId"` + Reason string `json:"reason"` +} + +type _ApplicationMessageFailure ApplicationMessageFailure + +// NewApplicationMessageFailure instantiates a new ApplicationMessageFailure 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 NewApplicationMessageFailure(appId string, reason string) *ApplicationMessageFailure { + this := ApplicationMessageFailure{} + this.AppId = appId + this.Reason = reason + return &this +} + +// NewApplicationMessageFailureWithDefaults instantiates a new ApplicationMessageFailure 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 NewApplicationMessageFailureWithDefaults() *ApplicationMessageFailure { + this := ApplicationMessageFailure{} + return &this +} + +// GetAppId returns the AppId field value +func (o *ApplicationMessageFailure) GetAppId() string { + if o == nil { + var ret string + return ret + } + + return o.AppId +} + +// GetAppIdOk returns a tuple with the AppId field value +// and a boolean to check if the value has been set. +func (o *ApplicationMessageFailure) GetAppIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AppId, true +} + +// SetAppId sets field value +func (o *ApplicationMessageFailure) SetAppId(v string) { + o.AppId = v +} + +// GetReason returns the Reason field value +func (o *ApplicationMessageFailure) GetReason() string { + if o == nil { + var ret string + return ret + } + + return o.Reason +} + +// GetReasonOk returns a tuple with the Reason field value +// and a boolean to check if the value has been set. +func (o *ApplicationMessageFailure) GetReasonOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Reason, true +} + +// SetReason sets field value +func (o *ApplicationMessageFailure) SetReason(v string) { + o.Reason = v +} + +func (o ApplicationMessageFailure) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationMessageFailure) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["appId"] = o.AppId + toSerialize["reason"] = o.Reason + return toSerialize, nil +} + +func (o *ApplicationMessageFailure) 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{ + "appId", + "reason", + } + + 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) + } + } + + varApplicationMessageFailure := _ApplicationMessageFailure{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varApplicationMessageFailure) + + if err != nil { + return err + } + + *o = ApplicationMessageFailure(varApplicationMessageFailure) + + return err +} + +type NullableApplicationMessageFailure struct { + value *ApplicationMessageFailure + isSet bool +} + +func (v NullableApplicationMessageFailure) Get() *ApplicationMessageFailure { + return v.value +} + +func (v *NullableApplicationMessageFailure) Set(val *ApplicationMessageFailure) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationMessageFailure) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationMessageFailure) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationMessageFailure(val *ApplicationMessageFailure) *NullableApplicationMessageFailure { + return &NullableApplicationMessageFailure{value: val, isSet: true} +} + +func (v NullableApplicationMessageFailure) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationMessageFailure) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_application_message_id_pair.go b/go/internal/openapi/model_application_message_id_pair.go new file mode 100644 index 000000000..ec56d818e --- /dev/null +++ b/go/internal/openapi/model_application_message_id_pair.go @@ -0,0 +1,188 @@ +/* +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 ApplicationMessageIdPair type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationMessageIdPair{} + +// ApplicationMessageIdPair struct for ApplicationMessageIdPair +type ApplicationMessageIdPair struct { + // The app's ID + AppId string `json:"appId"` + // The msg's ID + MsgId string `json:"msgId"` +} + +type _ApplicationMessageIdPair ApplicationMessageIdPair + +// NewApplicationMessageIdPair instantiates a new ApplicationMessageIdPair 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 NewApplicationMessageIdPair(appId string, msgId string) *ApplicationMessageIdPair { + this := ApplicationMessageIdPair{} + this.AppId = appId + this.MsgId = msgId + return &this +} + +// NewApplicationMessageIdPairWithDefaults instantiates a new ApplicationMessageIdPair 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 NewApplicationMessageIdPairWithDefaults() *ApplicationMessageIdPair { + this := ApplicationMessageIdPair{} + return &this +} + +// GetAppId returns the AppId field value +func (o *ApplicationMessageIdPair) GetAppId() string { + if o == nil { + var ret string + return ret + } + + return o.AppId +} + +// GetAppIdOk returns a tuple with the AppId field value +// and a boolean to check if the value has been set. +func (o *ApplicationMessageIdPair) GetAppIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AppId, true +} + +// SetAppId sets field value +func (o *ApplicationMessageIdPair) SetAppId(v string) { + o.AppId = v +} + +// GetMsgId returns the MsgId field value +func (o *ApplicationMessageIdPair) GetMsgId() string { + if o == nil { + var ret string + return ret + } + + return o.MsgId +} + +// GetMsgIdOk returns a tuple with the MsgId field value +// and a boolean to check if the value has been set. +func (o *ApplicationMessageIdPair) GetMsgIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MsgId, true +} + +// SetMsgId sets field value +func (o *ApplicationMessageIdPair) SetMsgId(v string) { + o.MsgId = v +} + +func (o ApplicationMessageIdPair) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationMessageIdPair) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["appId"] = o.AppId + toSerialize["msgId"] = o.MsgId + return toSerialize, nil +} + +func (o *ApplicationMessageIdPair) 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{ + "appId", + "msgId", + } + + 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) + } + } + + varApplicationMessageIdPair := _ApplicationMessageIdPair{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varApplicationMessageIdPair) + + if err != nil { + return err + } + + *o = ApplicationMessageIdPair(varApplicationMessageIdPair) + + return err +} + +type NullableApplicationMessageIdPair struct { + value *ApplicationMessageIdPair + isSet bool +} + +func (v NullableApplicationMessageIdPair) Get() *ApplicationMessageIdPair { + return v.value +} + +func (v *NullableApplicationMessageIdPair) Set(val *ApplicationMessageIdPair) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationMessageIdPair) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationMessageIdPair) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationMessageIdPair(val *ApplicationMessageIdPair) *NullableApplicationMessageIdPair { + return &NullableApplicationMessageIdPair{value: val, isSet: true} +} + +func (v NullableApplicationMessageIdPair) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationMessageIdPair) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_application_stats_out.go b/go/internal/openapi/model_application_stats_out.go new file mode 100644 index 000000000..b966eac3e --- /dev/null +++ b/go/internal/openapi/model_application_stats_out.go @@ -0,0 +1,224 @@ +/* +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 ApplicationStatsOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationStatsOut{} + +// ApplicationStatsOut A copy of [`backgroundtask::ApplicationStats`], but serialized with camelCase fields for customers. +type ApplicationStatsOut struct { + // The app's ID + AppId string `json:"appId"` + // The app's UID + AppUid *string `json:"appUid,omitempty" validate:"regexp=^[a-zA-Z0-9\\\\-_.]+$"` + MessageDestinations int64 `json:"messageDestinations"` +} + +type _ApplicationStatsOut ApplicationStatsOut + +// NewApplicationStatsOut instantiates a new ApplicationStatsOut 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 NewApplicationStatsOut(appId string, messageDestinations int64) *ApplicationStatsOut { + this := ApplicationStatsOut{} + this.AppId = appId + this.MessageDestinations = messageDestinations + return &this +} + +// NewApplicationStatsOutWithDefaults instantiates a new ApplicationStatsOut 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 NewApplicationStatsOutWithDefaults() *ApplicationStatsOut { + this := ApplicationStatsOut{} + return &this +} + +// GetAppId returns the AppId field value +func (o *ApplicationStatsOut) GetAppId() string { + if o == nil { + var ret string + return ret + } + + return o.AppId +} + +// GetAppIdOk returns a tuple with the AppId field value +// and a boolean to check if the value has been set. +func (o *ApplicationStatsOut) GetAppIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AppId, true +} + +// SetAppId sets field value +func (o *ApplicationStatsOut) SetAppId(v string) { + o.AppId = v +} + +// GetAppUid returns the AppUid field value if set, zero value otherwise. +func (o *ApplicationStatsOut) GetAppUid() string { + if o == nil || IsNil(o.AppUid) { + var ret string + return ret + } + return *o.AppUid +} + +// GetAppUidOk returns a tuple with the AppUid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationStatsOut) GetAppUidOk() (*string, bool) { + if o == nil || IsNil(o.AppUid) { + return nil, false + } + return o.AppUid, true +} + +// HasAppUid returns a boolean if a field has been set. +func (o *ApplicationStatsOut) HasAppUid() bool { + if o != nil && !IsNil(o.AppUid) { + return true + } + + return false +} + +// SetAppUid gets a reference to the given string and assigns it to the AppUid field. +func (o *ApplicationStatsOut) SetAppUid(v string) { + o.AppUid = &v +} + +// GetMessageDestinations returns the MessageDestinations field value +func (o *ApplicationStatsOut) GetMessageDestinations() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.MessageDestinations +} + +// GetMessageDestinationsOk returns a tuple with the MessageDestinations field value +// and a boolean to check if the value has been set. +func (o *ApplicationStatsOut) GetMessageDestinationsOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.MessageDestinations, true +} + +// SetMessageDestinations sets field value +func (o *ApplicationStatsOut) SetMessageDestinations(v int64) { + o.MessageDestinations = v +} + +func (o ApplicationStatsOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationStatsOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["appId"] = o.AppId + if !IsNil(o.AppUid) { + toSerialize["appUid"] = o.AppUid + } + toSerialize["messageDestinations"] = o.MessageDestinations + return toSerialize, nil +} + +func (o *ApplicationStatsOut) 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{ + "appId", + "messageDestinations", + } + + 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) + } + } + + varApplicationStatsOut := _ApplicationStatsOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varApplicationStatsOut) + + if err != nil { + return err + } + + *o = ApplicationStatsOut(varApplicationStatsOut) + + return err +} + +type NullableApplicationStatsOut struct { + value *ApplicationStatsOut + isSet bool +} + +func (v NullableApplicationStatsOut) Get() *ApplicationStatsOut { + return v.value +} + +func (v *NullableApplicationStatsOut) Set(val *ApplicationStatsOut) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationStatsOut) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationStatsOut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationStatsOut(val *ApplicationStatsOut) *NullableApplicationStatsOut { + return &NullableApplicationStatsOut{value: val, isSet: true} +} + +func (v NullableApplicationStatsOut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationStatsOut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_background_task_finished_event.go b/go/internal/openapi/model_background_task_finished_event.go new file mode 100644 index 000000000..b93ece074 --- /dev/null +++ b/go/internal/openapi/model_background_task_finished_event.go @@ -0,0 +1,188 @@ +/* +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 BackgroundTaskFinishedEvent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackgroundTaskFinishedEvent{} + +// BackgroundTaskFinishedEvent Sent when a background task is finished. +type BackgroundTaskFinishedEvent struct { + Data BackgroundTaskFinishedEvent2 `json:"data"` + Type string `json:"type"` +} + +type _BackgroundTaskFinishedEvent BackgroundTaskFinishedEvent + +// NewBackgroundTaskFinishedEvent instantiates a new BackgroundTaskFinishedEvent 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 NewBackgroundTaskFinishedEvent(data BackgroundTaskFinishedEvent2, type_ string) *BackgroundTaskFinishedEvent { + this := BackgroundTaskFinishedEvent{} + this.Data = data + this.Type = type_ + return &this +} + +// NewBackgroundTaskFinishedEventWithDefaults instantiates a new BackgroundTaskFinishedEvent 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 NewBackgroundTaskFinishedEventWithDefaults() *BackgroundTaskFinishedEvent { + this := BackgroundTaskFinishedEvent{} + var type_ string = "background_task.finished" + this.Type = type_ + return &this +} + +// GetData returns the Data field value +func (o *BackgroundTaskFinishedEvent) GetData() BackgroundTaskFinishedEvent2 { + if o == nil { + var ret BackgroundTaskFinishedEvent2 + 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 *BackgroundTaskFinishedEvent) GetDataOk() (*BackgroundTaskFinishedEvent2, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *BackgroundTaskFinishedEvent) SetData(v BackgroundTaskFinishedEvent2) { + o.Data = v +} + +// GetType returns the Type field value +func (o *BackgroundTaskFinishedEvent) 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 *BackgroundTaskFinishedEvent) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *BackgroundTaskFinishedEvent) SetType(v string) { + o.Type = v +} + +func (o BackgroundTaskFinishedEvent) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BackgroundTaskFinishedEvent) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *BackgroundTaskFinishedEvent) 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", + "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) + } + } + + varBackgroundTaskFinishedEvent := _BackgroundTaskFinishedEvent{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBackgroundTaskFinishedEvent) + + if err != nil { + return err + } + + *o = BackgroundTaskFinishedEvent(varBackgroundTaskFinishedEvent) + + return err +} + +type NullableBackgroundTaskFinishedEvent struct { + value *BackgroundTaskFinishedEvent + isSet bool +} + +func (v NullableBackgroundTaskFinishedEvent) Get() *BackgroundTaskFinishedEvent { + return v.value +} + +func (v *NullableBackgroundTaskFinishedEvent) Set(val *BackgroundTaskFinishedEvent) { + v.value = val + v.isSet = true +} + +func (v NullableBackgroundTaskFinishedEvent) IsSet() bool { + return v.isSet +} + +func (v *NullableBackgroundTaskFinishedEvent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackgroundTaskFinishedEvent(val *BackgroundTaskFinishedEvent) *NullableBackgroundTaskFinishedEvent { + return &NullableBackgroundTaskFinishedEvent{value: val, isSet: true} +} + +func (v NullableBackgroundTaskFinishedEvent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackgroundTaskFinishedEvent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_background_task_finished_event2.go b/go/internal/openapi/model_background_task_finished_event2.go new file mode 100644 index 000000000..b377e3626 --- /dev/null +++ b/go/internal/openapi/model_background_task_finished_event2.go @@ -0,0 +1,242 @@ +/* +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 BackgroundTaskFinishedEvent2 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackgroundTaskFinishedEvent2{} + +// BackgroundTaskFinishedEvent2 struct for BackgroundTaskFinishedEvent2 +type BackgroundTaskFinishedEvent2 struct { + Data Data `json:"data"` + Status BackgroundTaskStatus `json:"status"` + Task BackgroundTaskType `json:"task"` + TaskId string `json:"taskId"` +} + +type _BackgroundTaskFinishedEvent2 BackgroundTaskFinishedEvent2 + +// NewBackgroundTaskFinishedEvent2 instantiates a new BackgroundTaskFinishedEvent2 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 NewBackgroundTaskFinishedEvent2(data Data, status BackgroundTaskStatus, task BackgroundTaskType, taskId string) *BackgroundTaskFinishedEvent2 { + this := BackgroundTaskFinishedEvent2{} + this.Data = data + this.Status = status + this.Task = task + this.TaskId = taskId + return &this +} + +// NewBackgroundTaskFinishedEvent2WithDefaults instantiates a new BackgroundTaskFinishedEvent2 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 NewBackgroundTaskFinishedEvent2WithDefaults() *BackgroundTaskFinishedEvent2 { + this := BackgroundTaskFinishedEvent2{} + return &this +} + +// GetData returns the Data field value +func (o *BackgroundTaskFinishedEvent2) GetData() Data { + if o == nil { + var ret Data + 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 *BackgroundTaskFinishedEvent2) GetDataOk() (*Data, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *BackgroundTaskFinishedEvent2) SetData(v Data) { + o.Data = v +} + +// GetStatus returns the Status field value +func (o *BackgroundTaskFinishedEvent2) GetStatus() BackgroundTaskStatus { + if o == nil { + var ret BackgroundTaskStatus + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *BackgroundTaskFinishedEvent2) GetStatusOk() (*BackgroundTaskStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *BackgroundTaskFinishedEvent2) SetStatus(v BackgroundTaskStatus) { + o.Status = v +} + +// GetTask returns the Task field value +func (o *BackgroundTaskFinishedEvent2) GetTask() BackgroundTaskType { + if o == nil { + var ret BackgroundTaskType + return ret + } + + return o.Task +} + +// GetTaskOk returns a tuple with the Task field value +// and a boolean to check if the value has been set. +func (o *BackgroundTaskFinishedEvent2) GetTaskOk() (*BackgroundTaskType, bool) { + if o == nil { + return nil, false + } + return &o.Task, true +} + +// SetTask sets field value +func (o *BackgroundTaskFinishedEvent2) SetTask(v BackgroundTaskType) { + o.Task = v +} + +// GetTaskId returns the TaskId field value +func (o *BackgroundTaskFinishedEvent2) GetTaskId() string { + if o == nil { + var ret string + return ret + } + + return o.TaskId +} + +// GetTaskIdOk returns a tuple with the TaskId field value +// and a boolean to check if the value has been set. +func (o *BackgroundTaskFinishedEvent2) GetTaskIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TaskId, true +} + +// SetTaskId sets field value +func (o *BackgroundTaskFinishedEvent2) SetTaskId(v string) { + o.TaskId = v +} + +func (o BackgroundTaskFinishedEvent2) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BackgroundTaskFinishedEvent2) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["status"] = o.Status + toSerialize["task"] = o.Task + toSerialize["taskId"] = o.TaskId + return toSerialize, nil +} + +func (o *BackgroundTaskFinishedEvent2) 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", + "status", + "task", + "taskId", + } + + 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) + } + } + + varBackgroundTaskFinishedEvent2 := _BackgroundTaskFinishedEvent2{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBackgroundTaskFinishedEvent2) + + if err != nil { + return err + } + + *o = BackgroundTaskFinishedEvent2(varBackgroundTaskFinishedEvent2) + + return err +} + +type NullableBackgroundTaskFinishedEvent2 struct { + value *BackgroundTaskFinishedEvent2 + isSet bool +} + +func (v NullableBackgroundTaskFinishedEvent2) Get() *BackgroundTaskFinishedEvent2 { + return v.value +} + +func (v *NullableBackgroundTaskFinishedEvent2) Set(val *BackgroundTaskFinishedEvent2) { + v.value = val + v.isSet = true +} + +func (v NullableBackgroundTaskFinishedEvent2) IsSet() bool { + return v.isSet +} + +func (v *NullableBackgroundTaskFinishedEvent2) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackgroundTaskFinishedEvent2(val *BackgroundTaskFinishedEvent2) *NullableBackgroundTaskFinishedEvent2 { + return &NullableBackgroundTaskFinishedEvent2{value: val, isSet: true} +} + +func (v NullableBackgroundTaskFinishedEvent2) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackgroundTaskFinishedEvent2) 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 608298c32..e81f6e404 100644 --- a/go/internal/openapi/model_create_stream_in.go +++ b/go/internal/openapi/model_create_stream_in.go @@ -21,7 +21,7 @@ var _ MappedNullable = &CreateStreamIn{} // CreateStreamIn struct for CreateStreamIn type CreateStreamIn struct { - Messages []EventIn `json:"messages"` + Events []EventIn `json:"events"` Stream *StreamIn `json:"stream,omitempty"` } @@ -31,9 +31,9 @@ type _CreateStreamIn CreateStreamIn // 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 NewCreateStreamIn(messages []EventIn) *CreateStreamIn { +func NewCreateStreamIn(events []EventIn) *CreateStreamIn { this := CreateStreamIn{} - this.Messages = messages + this.Events = events return &this } @@ -45,28 +45,28 @@ func NewCreateStreamInWithDefaults() *CreateStreamIn { return &this } -// GetMessages returns the Messages field value -func (o *CreateStreamIn) GetMessages() []EventIn { +// GetEvents returns the Events field value +func (o *CreateStreamIn) GetEvents() []EventIn { if o == nil { var ret []EventIn return ret } - return o.Messages + return o.Events } -// GetMessagesOk returns a tuple with the Messages field value +// GetEventsOk returns a tuple with the Events field value // and a boolean to check if the value has been set. -func (o *CreateStreamIn) GetMessagesOk() ([]EventIn, bool) { +func (o *CreateStreamIn) GetEventsOk() ([]EventIn, bool) { if o == nil { return nil, false } - return o.Messages, true + return o.Events, true } -// SetMessages sets field value -func (o *CreateStreamIn) SetMessages(v []EventIn) { - o.Messages = v +// SetEvents sets field value +func (o *CreateStreamIn) SetEvents(v []EventIn) { + o.Events = v } // GetStream returns the Stream field value if set, zero value otherwise. @@ -111,7 +111,7 @@ func (o CreateStreamIn) MarshalJSON() ([]byte, error) { func (o CreateStreamIn) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["messages"] = o.Messages + toSerialize["events"] = o.Events if !IsNil(o.Stream) { toSerialize["stream"] = o.Stream } @@ -123,7 +123,7 @@ func (o *CreateStreamIn) UnmarshalJSON(data []byte) (err error) { // 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{ - "messages", + "events", } allProperties := make(map[string]interface{}) diff --git a/go/internal/openapi/model_data.go b/go/internal/openapi/model_data.go new file mode 100644 index 000000000..74cc1f3fc --- /dev/null +++ b/go/internal/openapi/model_data.go @@ -0,0 +1,143 @@ +/* +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" + "fmt" +) + + +// Data A copy of [`backgroundtask::Data`], but serialized with camelCase fields for customers. +type Data struct { + DataAnyOf *DataAnyOf + DataAnyOf1 *DataAnyOf1 + DataAnyOf2 *DataAnyOf2 + DataAnyOf3 *DataAnyOf3 +} + +// Unmarshal JSON data into any of the pointers in the struct +func (dst *Data) UnmarshalJSON(data []byte) error { + var err error + // try to unmarshal JSON data into DataAnyOf + err = json.Unmarshal(data, &dst.DataAnyOf); + if err == nil { + jsonDataAnyOf, _ := json.Marshal(dst.DataAnyOf) + if string(jsonDataAnyOf) == "{}" { // empty struct + dst.DataAnyOf = nil + } else { + return nil // data stored in dst.DataAnyOf, return on the first match + } + } else { + dst.DataAnyOf = nil + } + + // try to unmarshal JSON data into DataAnyOf1 + err = json.Unmarshal(data, &dst.DataAnyOf1); + if err == nil { + jsonDataAnyOf1, _ := json.Marshal(dst.DataAnyOf1) + if string(jsonDataAnyOf1) == "{}" { // empty struct + dst.DataAnyOf1 = nil + } else { + return nil // data stored in dst.DataAnyOf1, return on the first match + } + } else { + dst.DataAnyOf1 = nil + } + + // try to unmarshal JSON data into DataAnyOf2 + err = json.Unmarshal(data, &dst.DataAnyOf2); + if err == nil { + jsonDataAnyOf2, _ := json.Marshal(dst.DataAnyOf2) + if string(jsonDataAnyOf2) == "{}" { // empty struct + dst.DataAnyOf2 = nil + } else { + return nil // data stored in dst.DataAnyOf2, return on the first match + } + } else { + dst.DataAnyOf2 = nil + } + + // try to unmarshal JSON data into DataAnyOf3 + err = json.Unmarshal(data, &dst.DataAnyOf3); + if err == nil { + jsonDataAnyOf3, _ := json.Marshal(dst.DataAnyOf3) + if string(jsonDataAnyOf3) == "{}" { // empty struct + dst.DataAnyOf3 = nil + } else { + return nil // data stored in dst.DataAnyOf3, return on the first match + } + } else { + dst.DataAnyOf3 = nil + } + + return fmt.Errorf("data failed to match schemas in anyOf(Data)") +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src *Data) MarshalJSON() ([]byte, error) { + if src.DataAnyOf != nil { + return json.Marshal(&src.DataAnyOf) + } + + if src.DataAnyOf1 != nil { + return json.Marshal(&src.DataAnyOf1) + } + + if src.DataAnyOf2 != nil { + return json.Marshal(&src.DataAnyOf2) + } + + if src.DataAnyOf3 != nil { + return json.Marshal(&src.DataAnyOf3) + } + + return nil, nil // no data in anyOf schemas +} + + +type NullableData struct { + value *Data + isSet bool +} + +func (v NullableData) Get() *Data { + return v.value +} + +func (v *NullableData) Set(val *Data) { + v.value = val + v.isSet = true +} + +func (v NullableData) IsSet() bool { + return v.isSet +} + +func (v *NullableData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableData(val *Data) *NullableData { + return &NullableData{value: val, isSet: true} +} + +func (v NullableData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_data_any_of.go b/go/internal/openapi/model_data_any_of.go new file mode 100644 index 000000000..9023e41d0 --- /dev/null +++ b/go/internal/openapi/model_data_any_of.go @@ -0,0 +1,158 @@ +/* +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 DataAnyOf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DataAnyOf{} + +// DataAnyOf struct for DataAnyOf +type DataAnyOf struct { + MessagesSent int32 `json:"messages_sent"` +} + +type _DataAnyOf DataAnyOf + +// NewDataAnyOf instantiates a new DataAnyOf 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 NewDataAnyOf(messagesSent int32) *DataAnyOf { + this := DataAnyOf{} + this.MessagesSent = messagesSent + return &this +} + +// NewDataAnyOfWithDefaults instantiates a new DataAnyOf 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 NewDataAnyOfWithDefaults() *DataAnyOf { + this := DataAnyOf{} + return &this +} + +// GetMessagesSent returns the MessagesSent field value +func (o *DataAnyOf) GetMessagesSent() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MessagesSent +} + +// GetMessagesSentOk returns a tuple with the MessagesSent field value +// and a boolean to check if the value has been set. +func (o *DataAnyOf) GetMessagesSentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MessagesSent, true +} + +// SetMessagesSent sets field value +func (o *DataAnyOf) SetMessagesSent(v int32) { + o.MessagesSent = v +} + +func (o DataAnyOf) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DataAnyOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["messages_sent"] = o.MessagesSent + return toSerialize, nil +} + +func (o *DataAnyOf) 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{ + "messages_sent", + } + + 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) + } + } + + varDataAnyOf := _DataAnyOf{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDataAnyOf) + + if err != nil { + return err + } + + *o = DataAnyOf(varDataAnyOf) + + return err +} + +type NullableDataAnyOf struct { + value *DataAnyOf + isSet bool +} + +func (v NullableDataAnyOf) Get() *DataAnyOf { + return v.value +} + +func (v *NullableDataAnyOf) Set(val *DataAnyOf) { + v.value = val + v.isSet = true +} + +func (v NullableDataAnyOf) IsSet() bool { + return v.isSet +} + +func (v *NullableDataAnyOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDataAnyOf(val *DataAnyOf) *NullableDataAnyOf { + return &NullableDataAnyOf{value: val, isSet: true} +} + +func (v NullableDataAnyOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDataAnyOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_data_any_of_1.go b/go/internal/openapi/model_data_any_of_1.go new file mode 100644 index 000000000..d8bba1747 --- /dev/null +++ b/go/internal/openapi/model_data_any_of_1.go @@ -0,0 +1,158 @@ +/* +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 DataAnyOf1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DataAnyOf1{} + +// DataAnyOf1 struct for DataAnyOf1 +type DataAnyOf1 struct { + AppStats []ApplicationStatsOut `json:"app_stats"` +} + +type _DataAnyOf1 DataAnyOf1 + +// NewDataAnyOf1 instantiates a new DataAnyOf1 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 NewDataAnyOf1(appStats []ApplicationStatsOut) *DataAnyOf1 { + this := DataAnyOf1{} + this.AppStats = appStats + return &this +} + +// NewDataAnyOf1WithDefaults instantiates a new DataAnyOf1 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 NewDataAnyOf1WithDefaults() *DataAnyOf1 { + this := DataAnyOf1{} + return &this +} + +// GetAppStats returns the AppStats field value +func (o *DataAnyOf1) GetAppStats() []ApplicationStatsOut { + if o == nil { + var ret []ApplicationStatsOut + return ret + } + + return o.AppStats +} + +// GetAppStatsOk returns a tuple with the AppStats field value +// and a boolean to check if the value has been set. +func (o *DataAnyOf1) GetAppStatsOk() ([]ApplicationStatsOut, bool) { + if o == nil { + return nil, false + } + return o.AppStats, true +} + +// SetAppStats sets field value +func (o *DataAnyOf1) SetAppStats(v []ApplicationStatsOut) { + o.AppStats = v +} + +func (o DataAnyOf1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DataAnyOf1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["app_stats"] = o.AppStats + return toSerialize, nil +} + +func (o *DataAnyOf1) 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{ + "app_stats", + } + + 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) + } + } + + varDataAnyOf1 := _DataAnyOf1{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDataAnyOf1) + + if err != nil { + return err + } + + *o = DataAnyOf1(varDataAnyOf1) + + return err +} + +type NullableDataAnyOf1 struct { + value *DataAnyOf1 + isSet bool +} + +func (v NullableDataAnyOf1) Get() *DataAnyOf1 { + return v.value +} + +func (v *NullableDataAnyOf1) Set(val *DataAnyOf1) { + v.value = val + v.isSet = true +} + +func (v NullableDataAnyOf1) IsSet() bool { + return v.isSet +} + +func (v *NullableDataAnyOf1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDataAnyOf1(val *DataAnyOf1) *NullableDataAnyOf1 { + return &NullableDataAnyOf1{value: val, isSet: true} +} + +func (v NullableDataAnyOf1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDataAnyOf1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_data_any_of_2.go b/go/internal/openapi/model_data_any_of_2.go new file mode 100644 index 000000000..df13eb0a4 --- /dev/null +++ b/go/internal/openapi/model_data_any_of_2.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 DataAnyOf2 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DataAnyOf2{} + +// DataAnyOf2 struct for DataAnyOf2 +type DataAnyOf2 struct { + MessagesCreated []ApplicationMessageIdPair `json:"messages_created"` + MessagesFailed []ApplicationMessageFailure `json:"messages_failed"` +} + +type _DataAnyOf2 DataAnyOf2 + +// NewDataAnyOf2 instantiates a new DataAnyOf2 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 NewDataAnyOf2(messagesCreated []ApplicationMessageIdPair, messagesFailed []ApplicationMessageFailure) *DataAnyOf2 { + this := DataAnyOf2{} + this.MessagesCreated = messagesCreated + this.MessagesFailed = messagesFailed + return &this +} + +// NewDataAnyOf2WithDefaults instantiates a new DataAnyOf2 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 NewDataAnyOf2WithDefaults() *DataAnyOf2 { + this := DataAnyOf2{} + return &this +} + +// GetMessagesCreated returns the MessagesCreated field value +func (o *DataAnyOf2) GetMessagesCreated() []ApplicationMessageIdPair { + if o == nil { + var ret []ApplicationMessageIdPair + return ret + } + + return o.MessagesCreated +} + +// GetMessagesCreatedOk returns a tuple with the MessagesCreated field value +// and a boolean to check if the value has been set. +func (o *DataAnyOf2) GetMessagesCreatedOk() ([]ApplicationMessageIdPair, bool) { + if o == nil { + return nil, false + } + return o.MessagesCreated, true +} + +// SetMessagesCreated sets field value +func (o *DataAnyOf2) SetMessagesCreated(v []ApplicationMessageIdPair) { + o.MessagesCreated = v +} + +// GetMessagesFailed returns the MessagesFailed field value +func (o *DataAnyOf2) GetMessagesFailed() []ApplicationMessageFailure { + if o == nil { + var ret []ApplicationMessageFailure + return ret + } + + return o.MessagesFailed +} + +// GetMessagesFailedOk returns a tuple with the MessagesFailed field value +// and a boolean to check if the value has been set. +func (o *DataAnyOf2) GetMessagesFailedOk() ([]ApplicationMessageFailure, bool) { + if o == nil { + return nil, false + } + return o.MessagesFailed, true +} + +// SetMessagesFailed sets field value +func (o *DataAnyOf2) SetMessagesFailed(v []ApplicationMessageFailure) { + o.MessagesFailed = v +} + +func (o DataAnyOf2) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DataAnyOf2) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["messages_created"] = o.MessagesCreated + toSerialize["messages_failed"] = o.MessagesFailed + return toSerialize, nil +} + +func (o *DataAnyOf2) 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{ + "messages_created", + "messages_failed", + } + + 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) + } + } + + varDataAnyOf2 := _DataAnyOf2{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDataAnyOf2) + + if err != nil { + return err + } + + *o = DataAnyOf2(varDataAnyOf2) + + return err +} + +type NullableDataAnyOf2 struct { + value *DataAnyOf2 + isSet bool +} + +func (v NullableDataAnyOf2) Get() *DataAnyOf2 { + return v.value +} + +func (v *NullableDataAnyOf2) Set(val *DataAnyOf2) { + v.value = val + v.isSet = true +} + +func (v NullableDataAnyOf2) IsSet() bool { + return v.isSet +} + +func (v *NullableDataAnyOf2) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDataAnyOf2(val *DataAnyOf2) *NullableDataAnyOf2 { + return &NullableDataAnyOf2{value: val, isSet: true} +} + +func (v NullableDataAnyOf2) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDataAnyOf2) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_data_any_of_3.go b/go/internal/openapi/model_data_any_of_3.go new file mode 100644 index 000000000..44281edaf --- /dev/null +++ b/go/internal/openapi/model_data_any_of_3.go @@ -0,0 +1,158 @@ +/* +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 DataAnyOf3 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DataAnyOf3{} + +// DataAnyOf3 struct for DataAnyOf3 +type DataAnyOf3 struct { + EventTypes []AggregatedEventTypes `json:"event_types"` +} + +type _DataAnyOf3 DataAnyOf3 + +// NewDataAnyOf3 instantiates a new DataAnyOf3 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 NewDataAnyOf3(eventTypes []AggregatedEventTypes) *DataAnyOf3 { + this := DataAnyOf3{} + this.EventTypes = eventTypes + return &this +} + +// NewDataAnyOf3WithDefaults instantiates a new DataAnyOf3 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 NewDataAnyOf3WithDefaults() *DataAnyOf3 { + this := DataAnyOf3{} + return &this +} + +// GetEventTypes returns the EventTypes field value +func (o *DataAnyOf3) GetEventTypes() []AggregatedEventTypes { + if o == nil { + var ret []AggregatedEventTypes + return ret + } + + return o.EventTypes +} + +// GetEventTypesOk returns a tuple with the EventTypes field value +// and a boolean to check if the value has been set. +func (o *DataAnyOf3) GetEventTypesOk() ([]AggregatedEventTypes, bool) { + if o == nil { + return nil, false + } + return o.EventTypes, true +} + +// SetEventTypes sets field value +func (o *DataAnyOf3) SetEventTypes(v []AggregatedEventTypes) { + o.EventTypes = v +} + +func (o DataAnyOf3) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DataAnyOf3) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["event_types"] = o.EventTypes + return toSerialize, nil +} + +func (o *DataAnyOf3) 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{ + "event_types", + } + + 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) + } + } + + varDataAnyOf3 := _DataAnyOf3{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDataAnyOf3) + + if err != nil { + return err + } + + *o = DataAnyOf3(varDataAnyOf3) + + return err +} + +type NullableDataAnyOf3 struct { + value *DataAnyOf3 + isSet bool +} + +func (v NullableDataAnyOf3) Get() *DataAnyOf3 { + return v.value +} + +func (v *NullableDataAnyOf3) Set(val *DataAnyOf3) { + v.value = val + v.isSet = true +} + +func (v NullableDataAnyOf3) IsSet() bool { + return v.isSet +} + +func (v *NullableDataAnyOf3) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDataAnyOf3(val *DataAnyOf3) *NullableDataAnyOf3 { + return &NullableDataAnyOf3{value: val, isSet: true} +} + +func (v NullableDataAnyOf3) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDataAnyOf3) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_endpoint_disabled_event.go b/go/internal/openapi/model_endpoint_disabled_event.go index 39825a3e7..c9aa07e80 100644 --- a/go/internal/openapi/model_endpoint_disabled_event.go +++ b/go/internal/openapi/model_endpoint_disabled_event.go @@ -19,7 +19,7 @@ import ( // checks if the EndpointDisabledEvent type satisfies the MappedNullable interface at compile time var _ MappedNullable = &EndpointDisabledEvent{} -// EndpointDisabledEvent Sent when an endpoint has been automatically disabled after continuous failures. +// EndpointDisabledEvent Sent when an endpoint has been automatically disabled after continuous failures, or manually via an API call. type EndpointDisabledEvent struct { Data EndpointDisabledEventData `json:"data"` Type string `json:"type"` diff --git a/go/internal/openapi/model_endpoint_disabled_event_data.go b/go/internal/openapi/model_endpoint_disabled_event_data.go index 11ca1d9d5..000c34a3b 100644 --- a/go/internal/openapi/model_endpoint_disabled_event_data.go +++ b/go/internal/openapi/model_endpoint_disabled_event_data.go @@ -20,7 +20,7 @@ import ( // checks if the EndpointDisabledEventData type satisfies the MappedNullable interface at compile time var _ MappedNullable = &EndpointDisabledEventData{} -// EndpointDisabledEventData Sent when an endpoint has been automatically disabled after continuous failures. +// EndpointDisabledEventData Sent when an endpoint has been automatically disabled after continuous failures, or manually via an API call. type EndpointDisabledEventData struct { // The app's ID AppId string `json:"appId"` @@ -30,7 +30,8 @@ type EndpointDisabledEventData struct { EndpointId string `json:"endpointId"` // The ep's UID EndpointUid *string `json:"endpointUid,omitempty" validate:"regexp=^[a-zA-Z0-9\\\\-_.]+$"` - FailSince time.Time `json:"failSince"` + FailSince *time.Time `json:"failSince,omitempty"` + Trigger *EndpointDisabledTrigger `json:"trigger,omitempty"` } type _EndpointDisabledEventData EndpointDisabledEventData @@ -39,11 +40,10 @@ type _EndpointDisabledEventData EndpointDisabledEventData // 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 NewEndpointDisabledEventData(appId string, endpointId string, failSince time.Time) *EndpointDisabledEventData { +func NewEndpointDisabledEventData(appId string, endpointId string) *EndpointDisabledEventData { this := EndpointDisabledEventData{} this.AppId = appId this.EndpointId = endpointId - this.FailSince = failSince return &this } @@ -167,28 +167,68 @@ func (o *EndpointDisabledEventData) SetEndpointUid(v string) { o.EndpointUid = &v } -// GetFailSince returns the FailSince field value +// GetFailSince returns the FailSince field value if set, zero value otherwise. func (o *EndpointDisabledEventData) GetFailSince() time.Time { - if o == nil { + if o == nil || IsNil(o.FailSince) { var ret time.Time return ret } - - return o.FailSince + return *o.FailSince } -// GetFailSinceOk returns a tuple with the FailSince field value +// GetFailSinceOk returns a tuple with the FailSince field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EndpointDisabledEventData) GetFailSinceOk() (*time.Time, bool) { - if o == nil { + if o == nil || IsNil(o.FailSince) { return nil, false } - return &o.FailSince, true + return o.FailSince, true +} + +// HasFailSince returns a boolean if a field has been set. +func (o *EndpointDisabledEventData) HasFailSince() bool { + if o != nil && !IsNil(o.FailSince) { + return true + } + + return false } -// SetFailSince sets field value +// SetFailSince gets a reference to the given time.Time and assigns it to the FailSince field. func (o *EndpointDisabledEventData) SetFailSince(v time.Time) { - o.FailSince = v + o.FailSince = &v +} + +// GetTrigger returns the Trigger field value if set, zero value otherwise. +func (o *EndpointDisabledEventData) GetTrigger() EndpointDisabledTrigger { + if o == nil || IsNil(o.Trigger) { + var ret EndpointDisabledTrigger + return ret + } + return *o.Trigger +} + +// GetTriggerOk returns a tuple with the Trigger field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EndpointDisabledEventData) GetTriggerOk() (*EndpointDisabledTrigger, bool) { + if o == nil || IsNil(o.Trigger) { + return nil, false + } + return o.Trigger, true +} + +// HasTrigger returns a boolean if a field has been set. +func (o *EndpointDisabledEventData) HasTrigger() bool { + if o != nil && !IsNil(o.Trigger) { + return true + } + + return false +} + +// SetTrigger gets a reference to the given EndpointDisabledTrigger and assigns it to the Trigger field. +func (o *EndpointDisabledEventData) SetTrigger(v EndpointDisabledTrigger) { + o.Trigger = &v } func (o EndpointDisabledEventData) MarshalJSON() ([]byte, error) { @@ -209,7 +249,12 @@ func (o EndpointDisabledEventData) ToMap() (map[string]interface{}, error) { if !IsNil(o.EndpointUid) { toSerialize["endpointUid"] = o.EndpointUid } - toSerialize["failSince"] = o.FailSince + if !IsNil(o.FailSince) { + toSerialize["failSince"] = o.FailSince + } + if !IsNil(o.Trigger) { + toSerialize["trigger"] = o.Trigger + } return toSerialize, nil } @@ -220,7 +265,6 @@ func (o *EndpointDisabledEventData) UnmarshalJSON(data []byte) (err error) { requiredProperties := []string{ "appId", "endpointId", - "failSince", } allProperties := make(map[string]interface{}) diff --git a/go/internal/openapi/model_endpoint_disabled_trigger.go b/go/internal/openapi/model_endpoint_disabled_trigger.go new file mode 100644 index 000000000..c27beece5 --- /dev/null +++ b/go/internal/openapi/model_endpoint_disabled_trigger.go @@ -0,0 +1,111 @@ +/* +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" + "fmt" +) + +// EndpointDisabledTrigger the model 'EndpointDisabledTrigger' +type EndpointDisabledTrigger string + +// List of EndpointDisabledTrigger +const ( + ENDPOINTDISABLEDTRIGGER_MANUAL EndpointDisabledTrigger = "manual" + ENDPOINTDISABLEDTRIGGER_AUTOMATIC EndpointDisabledTrigger = "automatic" +) + +// All allowed values of EndpointDisabledTrigger enum +var AllowedEndpointDisabledTriggerEnumValues = []EndpointDisabledTrigger{ + "manual", + "automatic", +} + +func (v *EndpointDisabledTrigger) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EndpointDisabledTrigger(value) + for _, existing := range AllowedEndpointDisabledTriggerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EndpointDisabledTrigger", value) +} + +// NewEndpointDisabledTriggerFromValue returns a pointer to a valid EndpointDisabledTrigger +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEndpointDisabledTriggerFromValue(v string) (*EndpointDisabledTrigger, error) { + ev := EndpointDisabledTrigger(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EndpointDisabledTrigger: valid values are %v", v, AllowedEndpointDisabledTriggerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EndpointDisabledTrigger) IsValid() bool { + for _, existing := range AllowedEndpointDisabledTriggerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to EndpointDisabledTrigger value +func (v EndpointDisabledTrigger) Ptr() *EndpointDisabledTrigger { + return &v +} + +type NullableEndpointDisabledTrigger struct { + value *EndpointDisabledTrigger + isSet bool +} + +func (v NullableEndpointDisabledTrigger) Get() *EndpointDisabledTrigger { + return v.value +} + +func (v *NullableEndpointDisabledTrigger) Set(val *EndpointDisabledTrigger) { + v.value = val + v.isSet = true +} + +func (v NullableEndpointDisabledTrigger) IsSet() bool { + return v.isSet +} + +func (v *NullableEndpointDisabledTrigger) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEndpointDisabledTrigger(val *EndpointDisabledTrigger) *NullableEndpointDisabledTrigger { + return &NullableEndpointDisabledTrigger{value: val, isSet: true} +} + +func (v NullableEndpointDisabledTrigger) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEndpointDisabledTrigger) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/go/internal/openapi/model_endpoint_enabled_event.go b/go/internal/openapi/model_endpoint_enabled_event.go new file mode 100644 index 000000000..23f14b15c --- /dev/null +++ b/go/internal/openapi/model_endpoint_enabled_event.go @@ -0,0 +1,188 @@ +/* +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 EndpointEnabledEvent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointEnabledEvent{} + +// EndpointEnabledEvent Sent when an endpoint has been enabled. +type EndpointEnabledEvent struct { + Data EndpointEnabledEventData `json:"data"` + Type string `json:"type"` +} + +type _EndpointEnabledEvent EndpointEnabledEvent + +// NewEndpointEnabledEvent instantiates a new EndpointEnabledEvent 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 NewEndpointEnabledEvent(data EndpointEnabledEventData, type_ string) *EndpointEnabledEvent { + this := EndpointEnabledEvent{} + this.Data = data + this.Type = type_ + return &this +} + +// NewEndpointEnabledEventWithDefaults instantiates a new EndpointEnabledEvent 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 NewEndpointEnabledEventWithDefaults() *EndpointEnabledEvent { + this := EndpointEnabledEvent{} + var type_ string = "endpoint.enabled" + this.Type = type_ + return &this +} + +// GetData returns the Data field value +func (o *EndpointEnabledEvent) GetData() EndpointEnabledEventData { + if o == nil { + var ret EndpointEnabledEventData + 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 *EndpointEnabledEvent) GetDataOk() (*EndpointEnabledEventData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *EndpointEnabledEvent) SetData(v EndpointEnabledEventData) { + o.Data = v +} + +// GetType returns the Type field value +func (o *EndpointEnabledEvent) 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 *EndpointEnabledEvent) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *EndpointEnabledEvent) SetType(v string) { + o.Type = v +} + +func (o EndpointEnabledEvent) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointEnabledEvent) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *EndpointEnabledEvent) 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", + "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) + } + } + + varEndpointEnabledEvent := _EndpointEnabledEvent{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEndpointEnabledEvent) + + if err != nil { + return err + } + + *o = EndpointEnabledEvent(varEndpointEnabledEvent) + + return err +} + +type NullableEndpointEnabledEvent struct { + value *EndpointEnabledEvent + isSet bool +} + +func (v NullableEndpointEnabledEvent) Get() *EndpointEnabledEvent { + return v.value +} + +func (v *NullableEndpointEnabledEvent) Set(val *EndpointEnabledEvent) { + v.value = val + v.isSet = true +} + +func (v NullableEndpointEnabledEvent) IsSet() bool { + return v.isSet +} + +func (v *NullableEndpointEnabledEvent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEndpointEnabledEvent(val *EndpointEnabledEvent) *NullableEndpointEnabledEvent { + return &NullableEndpointEnabledEvent{value: val, isSet: true} +} + +func (v NullableEndpointEnabledEvent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEndpointEnabledEvent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_endpoint_enabled_event_data.go b/go/internal/openapi/model_endpoint_enabled_event_data.go new file mode 100644 index 000000000..19457c491 --- /dev/null +++ b/go/internal/openapi/model_endpoint_enabled_event_data.go @@ -0,0 +1,262 @@ +/* +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 EndpointEnabledEventData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointEnabledEventData{} + +// EndpointEnabledEventData Sent when an endpoint has been enabled. +type EndpointEnabledEventData struct { + // The app's ID + AppId string `json:"appId"` + // The app's UID + AppUid *string `json:"appUid,omitempty" validate:"regexp=^[a-zA-Z0-9\\\\-_.]+$"` + // The ep's ID + EndpointId string `json:"endpointId"` + // The ep's UID + EndpointUid *string `json:"endpointUid,omitempty" validate:"regexp=^[a-zA-Z0-9\\\\-_.]+$"` +} + +type _EndpointEnabledEventData EndpointEnabledEventData + +// NewEndpointEnabledEventData instantiates a new EndpointEnabledEventData 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 NewEndpointEnabledEventData(appId string, endpointId string) *EndpointEnabledEventData { + this := EndpointEnabledEventData{} + this.AppId = appId + this.EndpointId = endpointId + return &this +} + +// NewEndpointEnabledEventDataWithDefaults instantiates a new EndpointEnabledEventData 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 NewEndpointEnabledEventDataWithDefaults() *EndpointEnabledEventData { + this := EndpointEnabledEventData{} + return &this +} + +// GetAppId returns the AppId field value +func (o *EndpointEnabledEventData) GetAppId() string { + if o == nil { + var ret string + return ret + } + + return o.AppId +} + +// GetAppIdOk returns a tuple with the AppId field value +// and a boolean to check if the value has been set. +func (o *EndpointEnabledEventData) GetAppIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AppId, true +} + +// SetAppId sets field value +func (o *EndpointEnabledEventData) SetAppId(v string) { + o.AppId = v +} + +// GetAppUid returns the AppUid field value if set, zero value otherwise. +func (o *EndpointEnabledEventData) GetAppUid() string { + if o == nil || IsNil(o.AppUid) { + var ret string + return ret + } + return *o.AppUid +} + +// GetAppUidOk returns a tuple with the AppUid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EndpointEnabledEventData) GetAppUidOk() (*string, bool) { + if o == nil || IsNil(o.AppUid) { + return nil, false + } + return o.AppUid, true +} + +// HasAppUid returns a boolean if a field has been set. +func (o *EndpointEnabledEventData) HasAppUid() bool { + if o != nil && !IsNil(o.AppUid) { + return true + } + + return false +} + +// SetAppUid gets a reference to the given string and assigns it to the AppUid field. +func (o *EndpointEnabledEventData) SetAppUid(v string) { + o.AppUid = &v +} + +// GetEndpointId returns the EndpointId field value +func (o *EndpointEnabledEventData) GetEndpointId() string { + if o == nil { + var ret string + return ret + } + + return o.EndpointId +} + +// GetEndpointIdOk returns a tuple with the EndpointId field value +// and a boolean to check if the value has been set. +func (o *EndpointEnabledEventData) GetEndpointIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EndpointId, true +} + +// SetEndpointId sets field value +func (o *EndpointEnabledEventData) SetEndpointId(v string) { + o.EndpointId = v +} + +// GetEndpointUid returns the EndpointUid field value if set, zero value otherwise. +func (o *EndpointEnabledEventData) GetEndpointUid() string { + if o == nil || IsNil(o.EndpointUid) { + var ret string + return ret + } + return *o.EndpointUid +} + +// GetEndpointUidOk returns a tuple with the EndpointUid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EndpointEnabledEventData) GetEndpointUidOk() (*string, bool) { + if o == nil || IsNil(o.EndpointUid) { + return nil, false + } + return o.EndpointUid, true +} + +// HasEndpointUid returns a boolean if a field has been set. +func (o *EndpointEnabledEventData) HasEndpointUid() bool { + if o != nil && !IsNil(o.EndpointUid) { + return true + } + + return false +} + +// SetEndpointUid gets a reference to the given string and assigns it to the EndpointUid field. +func (o *EndpointEnabledEventData) SetEndpointUid(v string) { + o.EndpointUid = &v +} + +func (o EndpointEnabledEventData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointEnabledEventData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["appId"] = o.AppId + if !IsNil(o.AppUid) { + toSerialize["appUid"] = o.AppUid + } + toSerialize["endpointId"] = o.EndpointId + if !IsNil(o.EndpointUid) { + toSerialize["endpointUid"] = o.EndpointUid + } + return toSerialize, nil +} + +func (o *EndpointEnabledEventData) 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{ + "appId", + "endpointId", + } + + 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) + } + } + + varEndpointEnabledEventData := _EndpointEnabledEventData{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEndpointEnabledEventData) + + if err != nil { + return err + } + + *o = EndpointEnabledEventData(varEndpointEnabledEventData) + + return err +} + +type NullableEndpointEnabledEventData struct { + value *EndpointEnabledEventData + isSet bool +} + +func (v NullableEndpointEnabledEventData) Get() *EndpointEnabledEventData { + return v.value +} + +func (v *NullableEndpointEnabledEventData) Set(val *EndpointEnabledEventData) { + v.value = val + v.isSet = true +} + +func (v NullableEndpointEnabledEventData) IsSet() bool { + return v.isSet +} + +func (v *NullableEndpointEnabledEventData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEndpointEnabledEventData(val *EndpointEnabledEventData) *NullableEndpointEnabledEventData { + return &NullableEndpointEnabledEventData{value: val, isSet: true} +} + +func (v NullableEndpointEnabledEventData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEndpointEnabledEventData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_environment_in.go b/go/internal/openapi/model_environment_in.go index 703f060c1..459ae9944 100644 --- a/go/internal/openapi/model_environment_in.go +++ b/go/internal/openapi/model_environment_in.go @@ -12,8 +12,6 @@ package openapi import ( "encoding/json" - "bytes" - "fmt" ) // checks if the EnvironmentIn type satisfies the MappedNullable interface at compile time @@ -22,19 +20,16 @@ var _ MappedNullable = &EnvironmentIn{} // EnvironmentIn struct for EnvironmentIn type EnvironmentIn struct { EventTypes []EventTypeIn `json:"eventTypes,omitempty"` - Settings map[string]interface{} `json:"settings"` + Settings map[string]interface{} `json:"settings,omitempty"` TransformationTemplates []TemplateIn `json:"transformationTemplates,omitempty"` } -type _EnvironmentIn EnvironmentIn - // NewEnvironmentIn instantiates a new EnvironmentIn 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 NewEnvironmentIn(settings map[string]interface{}) *EnvironmentIn { +func NewEnvironmentIn() *EnvironmentIn { this := EnvironmentIn{} - this.Settings = settings return &this } @@ -78,20 +73,17 @@ func (o *EnvironmentIn) SetEventTypes(v []EventTypeIn) { o.EventTypes = v } -// GetSettings returns the Settings field value -// If the value is explicit nil, the zero value for map[string]interface{} will be returned +// GetSettings returns the Settings field value if set, zero value otherwise. func (o *EnvironmentIn) GetSettings() map[string]interface{} { - if o == nil { + if o == nil || IsNil(o.Settings) { var ret map[string]interface{} return ret } - return o.Settings } -// GetSettingsOk returns a tuple with the Settings field value +// GetSettingsOk returns a tuple with the Settings 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 *EnvironmentIn) GetSettingsOk() (map[string]interface{}, bool) { if o == nil || IsNil(o.Settings) { return map[string]interface{}{}, false @@ -99,7 +91,16 @@ func (o *EnvironmentIn) GetSettingsOk() (map[string]interface{}, bool) { return o.Settings, true } -// SetSettings sets field value +// HasSettings returns a boolean if a field has been set. +func (o *EnvironmentIn) HasSettings() bool { + if o != nil && !IsNil(o.Settings) { + return true + } + + return false +} + +// SetSettings gets a reference to the given map[string]interface{} and assigns it to the Settings field. func (o *EnvironmentIn) SetSettings(v map[string]interface{}) { o.Settings = v } @@ -149,7 +150,7 @@ func (o EnvironmentIn) ToMap() (map[string]interface{}, error) { if !IsNil(o.EventTypes) { toSerialize["eventTypes"] = o.EventTypes } - if o.Settings != nil { + if !IsNil(o.Settings) { toSerialize["settings"] = o.Settings } if !IsNil(o.TransformationTemplates) { @@ -158,43 +159,6 @@ func (o EnvironmentIn) ToMap() (map[string]interface{}, error) { return toSerialize, nil } -func (o *EnvironmentIn) 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{ - "settings", - } - - 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) - } - } - - varEnvironmentIn := _EnvironmentIn{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varEnvironmentIn) - - if err != nil { - return err - } - - *o = EnvironmentIn(varEnvironmentIn) - - return err -} - type NullableEnvironmentIn struct { value *EnvironmentIn isSet bool diff --git a/go/internal/openapi/model_event_type_import_open_api_in.go b/go/internal/openapi/model_event_type_import_open_api_in.go index b9d3402e5..4bd2efece 100644 --- a/go/internal/openapi/model_event_type_import_open_api_in.go +++ b/go/internal/openapi/model_event_type_import_open_api_in.go @@ -20,7 +20,9 @@ var _ MappedNullable = &EventTypeImportOpenApiIn{} // EventTypeImportOpenApiIn Import a list of event types from webhooks defined in an OpenAPI spec. The OpenAPI spec can be specified as either `spec` given the spec as a JSON object, or as `specRaw` (a `string`) which will be parsed as YAML or JSON by the server. Sending neither or both is invalid, resulting in a `400` **Bad Request**. type EventTypeImportOpenApiIn struct { // If `true`, return the event types that would be modified without actually modifying them. - DryRun *bool `json:"dry_run,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + // If `true`, all existing event types that are not in the spec will be archived. + ReplaceAll *bool `json:"replaceAll,omitempty"` // A pre-parsed JSON spec. Spec map[string]interface{} `json:"spec,omitempty"` // A string, parsed by the server as YAML or JSON. @@ -35,6 +37,8 @@ func NewEventTypeImportOpenApiIn() *EventTypeImportOpenApiIn { this := EventTypeImportOpenApiIn{} var dryRun bool = false this.DryRun = &dryRun + var replaceAll bool = false + this.ReplaceAll = &replaceAll return &this } @@ -45,6 +49,8 @@ func NewEventTypeImportOpenApiInWithDefaults() *EventTypeImportOpenApiIn { this := EventTypeImportOpenApiIn{} var dryRun bool = false this.DryRun = &dryRun + var replaceAll bool = false + this.ReplaceAll = &replaceAll return &this } @@ -80,6 +86,38 @@ func (o *EventTypeImportOpenApiIn) SetDryRun(v bool) { o.DryRun = &v } +// GetReplaceAll returns the ReplaceAll field value if set, zero value otherwise. +func (o *EventTypeImportOpenApiIn) GetReplaceAll() bool { + if o == nil || IsNil(o.ReplaceAll) { + var ret bool + return ret + } + return *o.ReplaceAll +} + +// GetReplaceAllOk returns a tuple with the ReplaceAll field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventTypeImportOpenApiIn) GetReplaceAllOk() (*bool, bool) { + if o == nil || IsNil(o.ReplaceAll) { + return nil, false + } + return o.ReplaceAll, true +} + +// HasReplaceAll returns a boolean if a field has been set. +func (o *EventTypeImportOpenApiIn) HasReplaceAll() bool { + if o != nil && !IsNil(o.ReplaceAll) { + return true + } + + return false +} + +// SetReplaceAll gets a reference to the given bool and assigns it to the ReplaceAll field. +func (o *EventTypeImportOpenApiIn) SetReplaceAll(v bool) { + o.ReplaceAll = &v +} + // GetSpec returns the Spec field value if set, zero value otherwise. func (o *EventTypeImportOpenApiIn) GetSpec() map[string]interface{} { if o == nil || IsNil(o.Spec) { @@ -155,7 +193,10 @@ func (o EventTypeImportOpenApiIn) MarshalJSON() ([]byte, error) { func (o EventTypeImportOpenApiIn) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !IsNil(o.DryRun) { - toSerialize["dry_run"] = o.DryRun + toSerialize["dryRun"] = o.DryRun + } + if !IsNil(o.ReplaceAll) { + toSerialize["replaceAll"] = o.ReplaceAll } if !IsNil(o.Spec) { toSerialize["spec"] = o.Spec diff --git a/go/internal/openapi/model_operational_webhook_endpoint_headers_in.go b/go/internal/openapi/model_operational_webhook_endpoint_headers_in.go new file mode 100644 index 000000000..4919760a1 --- /dev/null +++ b/go/internal/openapi/model_operational_webhook_endpoint_headers_in.go @@ -0,0 +1,158 @@ +/* +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 OperationalWebhookEndpointHeadersIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OperationalWebhookEndpointHeadersIn{} + +// OperationalWebhookEndpointHeadersIn struct for OperationalWebhookEndpointHeadersIn +type OperationalWebhookEndpointHeadersIn struct { + Headers map[string]string `json:"headers"` +} + +type _OperationalWebhookEndpointHeadersIn OperationalWebhookEndpointHeadersIn + +// NewOperationalWebhookEndpointHeadersIn instantiates a new OperationalWebhookEndpointHeadersIn 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 NewOperationalWebhookEndpointHeadersIn(headers map[string]string) *OperationalWebhookEndpointHeadersIn { + this := OperationalWebhookEndpointHeadersIn{} + this.Headers = headers + return &this +} + +// NewOperationalWebhookEndpointHeadersInWithDefaults instantiates a new OperationalWebhookEndpointHeadersIn 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 NewOperationalWebhookEndpointHeadersInWithDefaults() *OperationalWebhookEndpointHeadersIn { + this := OperationalWebhookEndpointHeadersIn{} + return &this +} + +// GetHeaders returns the Headers field value +func (o *OperationalWebhookEndpointHeadersIn) GetHeaders() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + + return o.Headers +} + +// GetHeadersOk returns a tuple with the Headers field value +// and a boolean to check if the value has been set. +func (o *OperationalWebhookEndpointHeadersIn) GetHeadersOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.Headers, true +} + +// SetHeaders sets field value +func (o *OperationalWebhookEndpointHeadersIn) SetHeaders(v map[string]string) { + o.Headers = v +} + +func (o OperationalWebhookEndpointHeadersIn) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OperationalWebhookEndpointHeadersIn) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["headers"] = o.Headers + return toSerialize, nil +} + +func (o *OperationalWebhookEndpointHeadersIn) 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{ + "headers", + } + + 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) + } + } + + varOperationalWebhookEndpointHeadersIn := _OperationalWebhookEndpointHeadersIn{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varOperationalWebhookEndpointHeadersIn) + + if err != nil { + return err + } + + *o = OperationalWebhookEndpointHeadersIn(varOperationalWebhookEndpointHeadersIn) + + return err +} + +type NullableOperationalWebhookEndpointHeadersIn struct { + value *OperationalWebhookEndpointHeadersIn + isSet bool +} + +func (v NullableOperationalWebhookEndpointHeadersIn) Get() *OperationalWebhookEndpointHeadersIn { + return v.value +} + +func (v *NullableOperationalWebhookEndpointHeadersIn) Set(val *OperationalWebhookEndpointHeadersIn) { + v.value = val + v.isSet = true +} + +func (v NullableOperationalWebhookEndpointHeadersIn) IsSet() bool { + return v.isSet +} + +func (v *NullableOperationalWebhookEndpointHeadersIn) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOperationalWebhookEndpointHeadersIn(val *OperationalWebhookEndpointHeadersIn) *NullableOperationalWebhookEndpointHeadersIn { + return &NullableOperationalWebhookEndpointHeadersIn{value: val, isSet: true} +} + +func (v NullableOperationalWebhookEndpointHeadersIn) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOperationalWebhookEndpointHeadersIn) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_operational_webhook_endpoint_headers_out.go b/go/internal/openapi/model_operational_webhook_endpoint_headers_out.go new file mode 100644 index 000000000..280c10a04 --- /dev/null +++ b/go/internal/openapi/model_operational_webhook_endpoint_headers_out.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 OperationalWebhookEndpointHeadersOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OperationalWebhookEndpointHeadersOut{} + +// OperationalWebhookEndpointHeadersOut struct for OperationalWebhookEndpointHeadersOut +type OperationalWebhookEndpointHeadersOut struct { + Headers map[string]string `json:"headers"` + Sensitive []string `json:"sensitive"` +} + +type _OperationalWebhookEndpointHeadersOut OperationalWebhookEndpointHeadersOut + +// NewOperationalWebhookEndpointHeadersOut instantiates a new OperationalWebhookEndpointHeadersOut 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 NewOperationalWebhookEndpointHeadersOut(headers map[string]string, sensitive []string) *OperationalWebhookEndpointHeadersOut { + this := OperationalWebhookEndpointHeadersOut{} + this.Headers = headers + this.Sensitive = sensitive + return &this +} + +// NewOperationalWebhookEndpointHeadersOutWithDefaults instantiates a new OperationalWebhookEndpointHeadersOut 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 NewOperationalWebhookEndpointHeadersOutWithDefaults() *OperationalWebhookEndpointHeadersOut { + this := OperationalWebhookEndpointHeadersOut{} + return &this +} + +// GetHeaders returns the Headers field value +func (o *OperationalWebhookEndpointHeadersOut) GetHeaders() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + + return o.Headers +} + +// GetHeadersOk returns a tuple with the Headers field value +// and a boolean to check if the value has been set. +func (o *OperationalWebhookEndpointHeadersOut) GetHeadersOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.Headers, true +} + +// SetHeaders sets field value +func (o *OperationalWebhookEndpointHeadersOut) SetHeaders(v map[string]string) { + o.Headers = v +} + +// GetSensitive returns the Sensitive field value +func (o *OperationalWebhookEndpointHeadersOut) GetSensitive() []string { + if o == nil { + var ret []string + return ret + } + + return o.Sensitive +} + +// GetSensitiveOk returns a tuple with the Sensitive field value +// and a boolean to check if the value has been set. +func (o *OperationalWebhookEndpointHeadersOut) GetSensitiveOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Sensitive, true +} + +// SetSensitive sets field value +func (o *OperationalWebhookEndpointHeadersOut) SetSensitive(v []string) { + o.Sensitive = v +} + +func (o OperationalWebhookEndpointHeadersOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OperationalWebhookEndpointHeadersOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["headers"] = o.Headers + toSerialize["sensitive"] = o.Sensitive + return toSerialize, nil +} + +func (o *OperationalWebhookEndpointHeadersOut) 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{ + "headers", + "sensitive", + } + + 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) + } + } + + varOperationalWebhookEndpointHeadersOut := _OperationalWebhookEndpointHeadersOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varOperationalWebhookEndpointHeadersOut) + + if err != nil { + return err + } + + *o = OperationalWebhookEndpointHeadersOut(varOperationalWebhookEndpointHeadersOut) + + return err +} + +type NullableOperationalWebhookEndpointHeadersOut struct { + value *OperationalWebhookEndpointHeadersOut + isSet bool +} + +func (v NullableOperationalWebhookEndpointHeadersOut) Get() *OperationalWebhookEndpointHeadersOut { + return v.value +} + +func (v *NullableOperationalWebhookEndpointHeadersOut) Set(val *OperationalWebhookEndpointHeadersOut) { + v.value = val + v.isSet = true +} + +func (v NullableOperationalWebhookEndpointHeadersOut) IsSet() bool { + return v.isSet +} + +func (v *NullableOperationalWebhookEndpointHeadersOut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOperationalWebhookEndpointHeadersOut(val *OperationalWebhookEndpointHeadersOut) *NullableOperationalWebhookEndpointHeadersOut { + return &NullableOperationalWebhookEndpointHeadersOut{value: val, isSet: true} +} + +func (v NullableOperationalWebhookEndpointHeadersOut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOperationalWebhookEndpointHeadersOut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_rotate_poller_token_in.go b/go/internal/openapi/model_rotate_poller_token_in.go index ceae5aafa..124df0ba4 100644 --- a/go/internal/openapi/model_rotate_poller_token_in.go +++ b/go/internal/openapi/model_rotate_poller_token_in.go @@ -21,7 +21,7 @@ var _ MappedNullable = &RotatePollerTokenIn{} type RotatePollerTokenIn struct { // How long the token will be valid for, in seconds. Can be up to 31,536,000 seconds (1 year). Expiry *int64 `json:"expiry,omitempty"` - // Updates the previous token's expiration, in seconds. If set to 0, the old token will immediately be revoked. Must be between 0 and 86,400 seconds (1 day). Defaults to 300 seconds (5 minutes). + // Updates the previous token's expiration, in seconds. If set to 0, the old token will immediately be revoked. Must be between 0 and 86,400 seconds (1 day). Defaults to 300 seconds (5 minutes). OldTokenExpiry *int64 `json:"oldTokenExpiry,omitempty"` } diff --git a/go/internal/openapi/model_stream_in.go b/go/internal/openapi/model_stream_in.go index da7d191d7..cbc026f05 100644 --- a/go/internal/openapi/model_stream_in.go +++ b/go/internal/openapi/model_stream_in.go @@ -21,7 +21,9 @@ var _ MappedNullable = &StreamIn{} // StreamIn struct for StreamIn type StreamIn struct { + // The stream's description. Description string `json:"description"` + // The Stream's UID. Uid *string `json:"uid,omitempty" validate:"regexp=^(?!strm_)[a-zA-Z0-9_-]+$"` } diff --git a/go/internal/openapi/model_stream_out.go b/go/internal/openapi/model_stream_out.go index 771355de1..405f1d795 100644 --- a/go/internal/openapi/model_stream_out.go +++ b/go/internal/openapi/model_stream_out.go @@ -23,8 +23,11 @@ var _ MappedNullable = &StreamOut{} // StreamOut struct for StreamOut type StreamOut struct { CreatedAt time.Time `json:"createdAt"` + // The stream's description. Description *string `json:"description,omitempty"` - Id string `json:"id"` + // The stream's ID. + Id string `json:"id" validate:"regexp=^strm_[A-Za-z0-9]{22}$"` + // The Stream's UID. Uid *string `json:"uid,omitempty" validate:"regexp=^(?!strm_)[a-zA-Z0-9_-]+$"` UpdatedAt time.Time `json:"updatedAt"` } diff --git a/go/internal/openapi/model_stream_patch.go b/go/internal/openapi/model_stream_patch.go index a1673cc56..fa97bda19 100644 --- a/go/internal/openapi/model_stream_patch.go +++ b/go/internal/openapi/model_stream_patch.go @@ -19,7 +19,9 @@ var _ MappedNullable = &StreamPatch{} // StreamPatch struct for StreamPatch type StreamPatch struct { + // The Stream's description. Description *string `json:"description,omitempty"` + // The Stream's UID. Uid *string `json:"uid,omitempty" validate:"regexp=^(?!strm_)[a-zA-Z0-9_-]+$"` } diff --git a/go/internal/openapi/model_stream_portal_access_in.go b/go/internal/openapi/model_stream_portal_access_in.go new file mode 100644 index 000000000..61e42e03d --- /dev/null +++ b/go/internal/openapi/model_stream_portal_access_in.go @@ -0,0 +1,205 @@ +/* +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 StreamPortalAccessIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StreamPortalAccessIn{} + +// StreamPortalAccessIn struct for StreamPortalAccessIn +type StreamPortalAccessIn struct { + // How long the token will be valid for, in seconds. Valid values are between 1 hour and 7 days. The default is 7 days. + Expiry *int32 `json:"expiry,omitempty"` + // The set of feature flags the created token will have access to. + FeatureFlags []string `json:"featureFlags,omitempty"` + // Whether the app portal should be in read-only mode. + ReadOnly *bool `json:"readOnly,omitempty"` +} + +// NewStreamPortalAccessIn instantiates a new StreamPortalAccessIn 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 NewStreamPortalAccessIn() *StreamPortalAccessIn { + this := StreamPortalAccessIn{} + var expiry int32 = 604800 + this.Expiry = &expiry + return &this +} + +// NewStreamPortalAccessInWithDefaults instantiates a new StreamPortalAccessIn 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 NewStreamPortalAccessInWithDefaults() *StreamPortalAccessIn { + this := StreamPortalAccessIn{} + var expiry int32 = 604800 + this.Expiry = &expiry + return &this +} + +// GetExpiry returns the Expiry field value if set, zero value otherwise. +func (o *StreamPortalAccessIn) GetExpiry() int32 { + if o == nil || IsNil(o.Expiry) { + var ret int32 + return ret + } + return *o.Expiry +} + +// GetExpiryOk returns a tuple with the Expiry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StreamPortalAccessIn) GetExpiryOk() (*int32, bool) { + if o == nil || IsNil(o.Expiry) { + return nil, false + } + return o.Expiry, true +} + +// HasExpiry returns a boolean if a field has been set. +func (o *StreamPortalAccessIn) HasExpiry() bool { + if o != nil && !IsNil(o.Expiry) { + return true + } + + return false +} + +// SetExpiry gets a reference to the given int32 and assigns it to the Expiry field. +func (o *StreamPortalAccessIn) SetExpiry(v int32) { + o.Expiry = &v +} + +// GetFeatureFlags returns the FeatureFlags field value if set, zero value otherwise. +func (o *StreamPortalAccessIn) GetFeatureFlags() []string { + if o == nil || IsNil(o.FeatureFlags) { + var ret []string + return ret + } + return o.FeatureFlags +} + +// GetFeatureFlagsOk returns a tuple with the FeatureFlags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StreamPortalAccessIn) GetFeatureFlagsOk() ([]string, bool) { + if o == nil || IsNil(o.FeatureFlags) { + return nil, false + } + return o.FeatureFlags, true +} + +// HasFeatureFlags returns a boolean if a field has been set. +func (o *StreamPortalAccessIn) HasFeatureFlags() bool { + if o != nil && !IsNil(o.FeatureFlags) { + return true + } + + return false +} + +// SetFeatureFlags gets a reference to the given []string and assigns it to the FeatureFlags field. +func (o *StreamPortalAccessIn) SetFeatureFlags(v []string) { + o.FeatureFlags = v +} + +// GetReadOnly returns the ReadOnly field value if set, zero value otherwise. +func (o *StreamPortalAccessIn) GetReadOnly() bool { + if o == nil || IsNil(o.ReadOnly) { + var ret bool + return ret + } + return *o.ReadOnly +} + +// GetReadOnlyOk returns a tuple with the ReadOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StreamPortalAccessIn) GetReadOnlyOk() (*bool, bool) { + if o == nil || IsNil(o.ReadOnly) { + return nil, false + } + return o.ReadOnly, true +} + +// HasReadOnly returns a boolean if a field has been set. +func (o *StreamPortalAccessIn) HasReadOnly() bool { + if o != nil && !IsNil(o.ReadOnly) { + return true + } + + return false +} + +// SetReadOnly gets a reference to the given bool and assigns it to the ReadOnly field. +func (o *StreamPortalAccessIn) SetReadOnly(v bool) { + o.ReadOnly = &v +} + +func (o StreamPortalAccessIn) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StreamPortalAccessIn) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Expiry) { + toSerialize["expiry"] = o.Expiry + } + if !IsNil(o.FeatureFlags) { + toSerialize["featureFlags"] = o.FeatureFlags + } + if !IsNil(o.ReadOnly) { + toSerialize["readOnly"] = o.ReadOnly + } + return toSerialize, nil +} + +type NullableStreamPortalAccessIn struct { + value *StreamPortalAccessIn + isSet bool +} + +func (v NullableStreamPortalAccessIn) Get() *StreamPortalAccessIn { + return v.value +} + +func (v *NullableStreamPortalAccessIn) Set(val *StreamPortalAccessIn) { + v.value = val + v.isSet = true +} + +func (v NullableStreamPortalAccessIn) IsSet() bool { + return v.isSet +} + +func (v *NullableStreamPortalAccessIn) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStreamPortalAccessIn(val *StreamPortalAccessIn) *NullableStreamPortalAccessIn { + return &NullableStreamPortalAccessIn{value: val, isSet: true} +} + +func (v NullableStreamPortalAccessIn) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStreamPortalAccessIn) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/lib-openapi.json b/lib-openapi.json index e0454f6fb..24cf61b56 100644 --- a/lib-openapi.json +++ b/lib-openapi.json @@ -20,11 +20,40 @@ ], "type": "object" }, + "AggregatedEventTypes": { + "properties": { + "appId": { + "description": "The app's ID", + "example": "app_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "type": "string" + }, + "explicitlySubscribedEventTypes": { + "items": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "type": "array", + "uniqueItems": true + }, + "hasCatchAllEndpoint": { + "type": "boolean" + } + }, + "required": [ + "appId", + "explicitlySubscribedEventTypes", + "hasCatchAllEndpoint" + ], + "type": "object" + }, "AppPortalAccessIn": { "properties": { "application": { "$ref": "#/components/schemas/ApplicationIn", - "description": "Optionally creates a new application while generating the access link. If the application id or uid that is used in the path already exists, this argument is ignored.", + "description": "Optionally creates a new application while generating the access link.\n\nIf the application id or uid that is used in the path already exists, this argument is ignored.", "nullable": true }, "expiry": { @@ -175,6 +204,42 @@ ], "type": "object" }, + "ApplicationMessageFailure": { + "properties": { + "appId": { + "description": "The app's ID", + "example": "app_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "type": "string" + }, + "reason": { + "type": "string" + } + }, + "required": [ + "appId", + "reason" + ], + "type": "object" + }, + "ApplicationMessageIdPair": { + "properties": { + "appId": { + "description": "The app's ID", + "example": "app_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "type": "string" + }, + "msgId": { + "description": "The msg's ID", + "example": "msg_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "type": "string" + } + }, + "required": [ + "appId", + "msgId" + ], + "type": "object" + }, "ApplicationOut": { "properties": { "createdAt": { @@ -281,6 +346,34 @@ ], "type": "object" }, + "ApplicationStatsOut": { + "description": "A copy of [`backgroundtask::ApplicationStats`], but serialized with camelCase fields for customers.", + "properties": { + "appId": { + "description": "The app's ID", + "example": "app_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "type": "string" + }, + "appUid": { + "description": "The app's UID", + "example": "unique-app-identifier", + "maxLength": 256, + "minLength": 1, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "messageDestinations": { + "format": "int64", + "type": "integer" + } + }, + "required": [ + "appId", + "messageDestinations" + ], + "type": "object" + }, "ApplicationTokenExpireIn": { "properties": { "expiry": { @@ -398,13 +491,53 @@ ], "type": "object" }, - "BackgroundTaskData": { + "BackgroundTaskFinishedEvent": { + "description": "Sent when a background task is finished.", + "properties": { + "data": { + "$ref": "#/components/schemas/BackgroundTaskFinishedEvent2" + }, + "type": { + "default": "background_task.finished", + "enum": [ + "background_task.finished" + ], + "type": "string" + } + }, + "required": [ + "data", + "type" + ], + "type": "object" + }, + "BackgroundTaskFinishedEvent2": { + "properties": { + "data": { + "$ref": "#/components/schemas/Data" + }, + "status": { + "$ref": "#/components/schemas/BackgroundTaskStatus" + }, + "task": { + "$ref": "#/components/schemas/BackgroundTaskType" + }, + "taskId": { + "type": "string" + } + }, + "required": [ + "data", + "status", + "task", + "taskId" + ], "type": "object" }, "BackgroundTaskOut": { "properties": { "data": { - "$ref": "#/components/schemas/BackgroundTaskData" + "type": "object" }, "id": { "type": "string" @@ -580,7 +713,7 @@ }, "CreateStreamIn": { "properties": { - "messages": { + "events": { "items": { "$ref": "#/components/schemas/EventIn" }, @@ -593,7 +726,7 @@ } }, "required": [ - "messages" + "events" ], "type": "object" }, @@ -719,6 +852,86 @@ ], "type": "object" }, + "Data": { + "anyOf": [ + { + "properties": { + "messages_sent": { + "format": "uint", + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "messages_sent" + ], + "type": "object" + }, + { + "properties": { + "messages_sent": { + "format": "uint", + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "messages_sent" + ], + "type": "object" + }, + { + "properties": { + "app_stats": { + "items": { + "$ref": "#/components/schemas/ApplicationStatsOut" + }, + "type": "array" + } + }, + "required": [ + "app_stats" + ], + "type": "object" + }, + { + "properties": { + "messages_created": { + "items": { + "$ref": "#/components/schemas/ApplicationMessageIdPair" + }, + "type": "array" + }, + "messages_failed": { + "items": { + "$ref": "#/components/schemas/ApplicationMessageFailure" + }, + "type": "array" + } + }, + "required": [ + "messages_created", + "messages_failed" + ], + "type": "object" + }, + { + "properties": { + "event_types": { + "items": { + "$ref": "#/components/schemas/AggregatedEventTypes" + }, + "type": "array" + } + }, + "required": [ + "event_types" + ], + "type": "object" + } + ], + "description": "A copy of [`backgroundtask::Data`], but serialized with camelCase fields for customers." + }, "Duration": { "properties": { "nanos": { @@ -855,7 +1068,7 @@ "type": "object" }, "EndpointDisabledEvent": { - "description": "Sent when an endpoint has been automatically disabled after continuous failures.", + "description": "Sent when an endpoint has been automatically disabled after continuous failures, or manually via an API call.", "properties": { "data": { "$ref": "#/components/schemas/EndpointDisabledEventData" @@ -875,7 +1088,7 @@ "type": "object" }, "EndpointDisabledEventData": { - "description": "Sent when an endpoint has been automatically disabled after continuous failures.", + "description": "Sent when an endpoint has been automatically disabled after continuous failures, or manually via an API call.", "properties": { "appId": { "description": "The app's ID", @@ -907,13 +1120,82 @@ }, "failSince": { "format": "date-time", + "nullable": true, "type": "string" + }, + "trigger": { + "$ref": "#/components/schemas/EndpointDisabledTrigger", + "default": "automatic" } }, "required": [ "appId", - "endpointId", - "failSince" + "endpointId" + ], + "type": "object" + }, + "EndpointDisabledTrigger": { + "enum": [ + "manual", + "automatic" + ], + "type": "string" + }, + "EndpointEnabledEvent": { + "description": "Sent when an endpoint has been enabled.", + "properties": { + "data": { + "$ref": "#/components/schemas/EndpointEnabledEventData" + }, + "type": { + "default": "endpoint.enabled", + "enum": [ + "endpoint.enabled" + ], + "type": "string" + } + }, + "required": [ + "data", + "type" + ], + "type": "object" + }, + "EndpointEnabledEventData": { + "description": "Sent when an endpoint has been enabled.", + "properties": { + "appId": { + "description": "The app's ID", + "example": "app_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "type": "string" + }, + "appUid": { + "description": "The app's UID", + "example": "unique-app-identifier", + "maxLength": 256, + "minLength": 1, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "endpointId": { + "description": "The ep's ID", + "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "type": "string" + }, + "endpointUid": { + "description": "The ep's UID", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + } + }, + "required": [ + "appId", + "endpointId" ], "type": "object" }, @@ -1730,9 +2012,6 @@ "type": "array" } }, - "required": [ - "settings" - ], "type": "object" }, "EnvironmentOut": { @@ -2018,11 +2297,16 @@ "EventTypeImportOpenApiIn": { "description": "Import a list of event types from webhooks defined in an OpenAPI spec.\n\nThe OpenAPI spec can be specified as either `spec` given the spec as a JSON object, or as `specRaw` (a `string`) which will be parsed as YAML or JSON by the server. Sending neither or both is invalid, resulting in a `400` **Bad Request**.", "properties": { - "dry_run": { + "dryRun": { "default": false, "description": "If `true`, return the event types that would be modified without actually modifying them.", "type": "boolean" }, + "replaceAll": { + "default": false, + "description": "If `true`, all existing event types that are not in the spec will be archived.", + "type": "boolean" + }, "spec": { "description": "A pre-parsed JSON spec.", "example": { @@ -4103,39 +4387,86 @@ ], "type": "object" }, - "OperationalWebhookEndpointIn": { + "OperationalWebhookEndpointHeadersIn": { "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": { + "headers": { "additionalProperties": { "type": "string" }, - "default": {}, + "example": { + "X-Example": "123", + "X-Foobar": "Bar" + }, + "type": "object" + } + }, + "required": [ + "headers" + ], + "type": "object" + }, + "OperationalWebhookEndpointHeadersOut": { + "properties": { + "headers": { + "additionalProperties": { + "type": "string" + }, + "example": { + "X-Example": "123", + "X-Foobar": "Bar" + }, + "type": "object" + }, + "sensitive": { + "example": [ + "Authorization" + ], + "items": { + "type": "string" + }, + "type": "array", + "uniqueItems": true + } + }, + "required": [ + "headers", + "sensitive" + ], + "type": "object" + }, + "OperationalWebhookEndpointIn": { + "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": { @@ -4490,7 +4821,7 @@ }, "oldTokenExpiry": { "default": 300, - "description": "Updates the previous token's expiration, in seconds. If set to 0, the old token will immediately be revoked. Must be between 0 and 86,400 seconds (1 day).\n\nDefaults to 300 seconds (5 minutes).", + "description": "Updates the previous token's expiration, in seconds.\n\nIf set to 0, the old token will immediately be revoked. Must be between 0 and 86,400 seconds (1 day).\n\nDefaults to 300 seconds (5 minutes).", "format": "int64", "maximum": 86400, "minimum": 0, @@ -5166,15 +5497,23 @@ ], "type": "object" }, + "StreamIdOrUid": { + "description": "The Stream's ID or UID.", + "example": "unique-identifier", + "maxLength": 60, + "minLength": 1, + "type": "string" + }, "StreamIn": { "properties": { "description": { + "description": "The stream's description.", "minLength": 1, "type": "string" }, "uid": { "$ref": "#/components/schemas/StreamUid", - "description": "Optional unique identifier for the stream.", + "description": "An optional unique identifier for the stream.", "nullable": true } }, @@ -5190,14 +5529,21 @@ "type": "string" }, "description": { + "description": "The stream's description.", "nullable": true, "type": "string" }, "id": { + "description": "The stream's ID.", + "example": "strm_2yZwUhtgs5Ai8T9yRQJXA", + "maxLength": 27, + "minLength": 27, + "pattern": "^strm_[A-Za-z0-9]{22}$", "type": "string" }, "uid": { "$ref": "#/components/schemas/StreamUid", + "description": "The stream's UID.", "nullable": true }, "updatedAt": { @@ -5215,16 +5561,55 @@ "StreamPatch": { "properties": { "description": { + "description": "The Stream's description.", "type": "string" }, "uid": { "$ref": "#/components/schemas/StreamUid", - "description": "Optional unique identifier for the stream.", + "description": "An optional unique identifier for the stream.", "nullable": true } }, "type": "object" }, + "StreamPortalAccessIn": { + "properties": { + "expiry": { + "default": 604800, + "description": "How long the token will be valid for, in seconds.\n\nValid values are between 1 hour and 7 days. The default is 7 days.", + "format": "uint64", + "maximum": 604800, + "minimum": 3600, + "nullable": true, + "type": "integer" + }, + "featureFlags": { + "description": "The set of feature flags the created token will have access to.", + "example": [], + "items": { + "example": "cool-new-feature", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "type": "array", + "uniqueItems": true + }, + "readOnly": { + "description": "Whether the app portal should be in read-only mode.", + "nullable": true, + "type": "boolean" + } + }, + "type": "object" + }, + "StreamSinkIdOrUid": { + "description": "The StreamSink's ID or UID.", + "example": "unique-identifier", + "maxLength": 60, + "minLength": 1, + "type": "string" + }, "StreamSinkIn": { "oneOf": [ { @@ -5375,6 +5760,7 @@ "properties": { "batchSize": { "default": 100, + "description": "How many events we will attempt to accumulate before sending a request to the Sink.", "format": "uint16", "maximum": 1000, "minimum": 0, @@ -5382,6 +5768,7 @@ }, "eventTypes": { "default": [], + "description": "A list of event types that filter which events are dispatched to the Sink. An empty list (or null) will not filter out any events.", "items": { "description": "The event type's name", "example": "user.signup", @@ -5392,20 +5779,24 @@ "type": "array" }, "format": { - "$ref": "#/components/schemas/SinkPayloadFormat" + "$ref": "#/components/schemas/SinkPayloadFormat", + "description": "The format of data sent to the sink. When events are dispatched to the sink, we will attempt to send them in the preferred format. (Note that for some sink types, such as `amazonS3`, the format is ignored.)" }, "maxWaitSecs": { "default": 0, + "description": "How many seconds we will wait to accumulate events of `batchSize`, before sending a request to the Sink. For example, with a `batchSize` of 100 and `maxWaitSecs` of 10, we will wait _at most_ 10 seconds before sending a request to the Sink. If 100 events accumulate faster than 10 seconds, we will send the request to the Sink as soon as possible.", "format": "uint16", "maximum": 3600, "minimum": 0, "type": "integer" }, "status": { - "$ref": "#/components/schemas/SinkStatusIn" + "$ref": "#/components/schemas/SinkStatusIn", + "description": "Whether the sink will receive events.\n\nIf the sink is `enabled`, any events posted to the stream will be dispatched to the Sink in the same order that events were posted to the stream.\n\nIf the sink is `paused`, events will *not* be dispatched to the sink until the sink is reenabled." }, "uid": { "$ref": "#/components/schemas/StreamSinkUid", + "description": "An optional unique identifier for the sink.", "nullable": true } }, @@ -5593,6 +5984,11 @@ "$ref": "#/components/schemas/SinkPayloadFormat" }, "id": { + "description": "The sink's ID.", + "example": "sink_2yZwUhtgs5Ai8T9yRQJXA", + "maxLength": 27, + "minLength": 27, + "pattern": "^sink_[A-Za-z0-9]{22}$", "type": "string" }, "maxWaitSecs": { @@ -5604,6 +6000,7 @@ }, "uid": { "$ref": "#/components/schemas/StreamSinkUid", + "description": "The sink's UID.", "nullable": true }, "updatedAt": { @@ -5813,12 +6210,16 @@ "type": "object" }, "StreamSinkUid": { + "description": "The StreamSink's UID.", + "example": "unique-identifier", "maxLength": 60, "minLength": 1, "pattern": "^(?!sink_)[a-zA-Z0-9_-]+$", "type": "string" }, "StreamUid": { + "description": "The Stream's UID.", + "example": "unique-identifier", "maxLength": 60, "minLength": 1, "pattern": "^(?!strm_)[a-zA-Z0-9_-]+$", @@ -6197,7 +6598,6 @@ }, "securitySchemes": { "HTTPBearer": { - "bearerFormat": null, "description": "HTTP Bearer token passed in the `Authorization` header", "scheme": "bearer", "type": "http" @@ -6205,15 +6605,15 @@ } }, "info": { - "description": "", + "description": "Welcome to the Svix API documentation!\n\nUseful links: [Homepage](https://www.svix.com) | [Support email](mailto:support+docs@svix.com) | [Blog](https://www.svix.com/blog/) | [Slack Community](https://www.svix.com/slack/)\n\n# Introduction\n\nThis is the reference documentation and schemas for the [Svix webhook service](https://www.svix.com) API. For tutorials and other documentation please refer to [the documentation](https://docs.svix.com).\n\n## Main concepts\n\nIn Svix you have four important entities you will be interacting with:\n\n- `messages`: these are the webhooks being sent. They can have contents and a few other properties.\n- `application`: this is where `messages` are sent to. Usually you want to create one application for each user on your platform.\n- `endpoint`: endpoints are the URLs messages will be sent to. Each application can have multiple `endpoints` and each message sent to that application will be sent to all of them (unless they are not subscribed to the sent event type).\n- `event-type`: event types are identifiers denoting the type of the message being sent. Event types are primarily used to decide which events are sent to which endpoint.\n\n\n## Authentication\n\nGet your authentication token (`AUTH_TOKEN`) from the [Svix dashboard](https://dashboard.svix.com) and use it as part of the `Authorization` header as such: `Authorization: Bearer ${AUTH_TOKEN}`. For more information on authentication, please refer to the [authentication token docs](https://docs.svix.com/api-keys).\n\n\n\n\n## Code samples\n\nThe code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/).\n\n\n## Idempotency\n\nSvix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response.\n\nTo perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions.\n\nSvix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result for a period of up to 12 hours.\n\nPlease note that idempotency is only supported for `POST` requests.\n\n\n## Cross-Origin Resource Sharing\n\nThis API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.\n", "title": "Svix API", - "version": "1.1.1", + "version": "1.56.0", "x-logo": { "altText": "Svix Logo", "url": "https://www.svix.com/static/img/brand-padded.svg" } }, - "openapi": "3.0.2", + "openapi": "3.1.0", "paths": { "/api/v1/app": { "get": { @@ -10854,7 +11254,7 @@ ] }, "put": { - "description": "Create/update endpoint mTLS configuration.", + "description": "Create / update endpoint mTLS configuration.", "operationId": "v1.endpoint.update-mtls-config", "parameters": [ { @@ -11230,7 +11630,7 @@ ] }, "put": { - "description": "Create/update endpoint OAuth configuration.", + "description": "Create / update endpoint OAuth configuration.", "operationId": "v1.endpoint.update-oauth-config", "parameters": [ { @@ -13046,7 +13446,7 @@ }, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation-template/oauth/hubspot": { "put": { - "description": "Create/update endpoint Hubspot OAuth configuration\nSpecific private endpoint just for us, to avoid exposing the Hubspot secret to the client.", + "description": "Create / update endpoint Hubspot OAuth configuration.\n\nSpecific private endpoint just for us, to avoid exposing the Hubspot secret to the client.", "operationId": "v1.endpoint.update-hubspot-oauth-config", "parameters": [ { @@ -15861,7 +16261,7 @@ }, "/api/v1/app/{app_id}/msg": { "get": { - "description": "List all of the application's messages.\n\nThe `before` and `after` parameters let you filter all items created before or after a certain date. These can be used alongside an iterator to paginate over results\nwithin a certain window.\n\nNote that by default this endpoint is limited to retrieving 90 days' worth of data\nrelative to now or, if an iterator is provided, 90 days before/after the time indicated\nby the iterator ID. If you require data beyond those time ranges, you will need to explicitly\nset the `before` or `after` parameter as appropriate.\n", + "description": "List all of the application's messages.\n\nThe `before` and `after` parameters let you filter all items created before or after a certain date. These can be used alongside an iterator to paginate over results\nwithin a certain window.\n\nNote that by default this endpoint is limited to retrieving 90 days' worth of data\nrelative to now or, if an iterator is provided, 90 days before/after the time indicated\nby the iterator ID. If you require data beyond those time ranges, you will need to explicitly\nset the `before` or `after` parameter as appropriate.", "operationId": "v1.message.list", "parameters": [ { @@ -16296,52 +16696,52 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const messageOut = await svix.message.create(\"app_id\", {\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});\n\n// Alternatively, with a raw string payload.\nconst messageOut = await svix.message.create(\n \"app_id\",\n svix.messageInRaw(\"world.hello\", \"Hello, World\", \"text/plain\"),\n);\n" + "source": "const messageOut = await svix.message.create(\"app_id\", {\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});\n\n// Alternatively, with a raw string payload.\nconst messageOut = await svix.message.create(\n \"app_id\",\n svix.messageInRaw(\"user.signup\", \"This is a raw body.\", \"text/plain\"),\n);\n" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const messageOut = await svix.message.create(\"app_id\", {\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});\n\n// Alternatively, with a raw string payload.\nconst messageOut = await svix.message.create(\n \"app_id\",\n svix.messageInRaw(\"world.hello\", \"Hello, World\", \"text/plain\"),\n);\n" + "source": "const messageOut = await svix.message.create(\"app_id\", {\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});\n\n// Alternatively, with a raw string payload.\nconst messageOut = await svix.message.create(\n \"app_id\",\n svix.messageInRaw(\"user.signup\", \"This is a raw body.\", \"text/plain\"),\n);\n" }, { "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), options=...)\n\n# Alternatively, with a raw string payload.\nmessage_out = svix.message.create(\"app_id\", svix.message_in_raw(\n event_type=\"user.signup\",\n payload=\"Hello, World!\",\n content_type=\"text/plain\",\n), options=...)\n" + "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=...)\n\n# Alternatively, with a raw string payload.\nmessage_out = svix.message.create(\"app_id\", svix.message_in_raw(\n event_type=\"user.signup\",\n payload=\"This is a raw body.\",\n content_type=\"text/plain\",\n), options=...)\n" }, { "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), options=...)\n\n# Alternatively, with a raw string payload.\nmessage_out = await svix.message.create(\"app_id\", await svix.message_in_raw(\n event_type=\"user.signup\",\n payload=\"Hello, World!\",\n content_type=\"text/plain\",\n), options=...)\n" + "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=...)\n\n# Alternatively, with a raw string payload.\nmessage_out = await svix.message.create(\"app_id\", await svix.message_in_raw(\n event_type=\"user.signup\",\n payload=\"This is a raw body.\",\n content_type=\"text/plain\",\n), options=...)\n" }, { "label": "Go", "lang": "Go", - "source": "messageOut, err := svixClient.Message.Create(ctx, \"app_id\", &MessageIn{\n EventId: \"unique-msg-identifier\",\n EventType: \"user.signup\",\n Payload: map[string]interface{}{\"email\": \"test@example.com\", \"type\": \"user.created\", \"username\": \"test_user\"},\n Channels: []string{\"project_123\", \"group_2\"},\n Application: nil,\n Tags: []string{\"my_tag\", \"other\"},\n TransformationsParams: nil,\n PayloadRetentionPeriod: 90,\n PayloadRetentionHours: nil,\n})\n\n// Alternatively, with a raw string payload.\nmessageOut, err := svixClient.Message.Create(ctx, \"app_id\", &svix.NewMessageInRaw(\n \"world.hello\",\n \"Hello, World\",\n svix.StaticNullableString(\"text/plain\"),\n))\n" + "source": "messageOut, err := svixClient.Message.Create(ctx, \"app_id\", &MessageIn{\n EventId: \"unique-msg-identifier\",\n EventType: \"user.signup\",\n Payload: map[string]interface{}{\"email\": \"test@example.com\", \"type\": \"user.created\", \"username\": \"test_user\"},\n Channels: []string{\"project_123\", \"group_2\"},\n Application: nil,\n Tags: []string{\"my_tag\", \"other\"},\n TransformationsParams: nil,\n PayloadRetentionPeriod: 90,\n PayloadRetentionHours: nil,\n})\n\n// Alternatively, with a raw string payload.\nmessageOut, err := svixClient.Message.Create(ctx, \"app_id\", &svix.NewMessageInRaw(\n \"user.signup\",\n \"This is a raw body.\",\n svix.StaticNullableString(\"text/plain\"),\n))\n" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val messageOut = svix.message.create(\"app_id\", MessageIn()\n .eventId(\"unique-msg-identifier\")\n .eventType(\"user.signup\")\n .payload(/* ... */)\n .channels(arrayOf(\"project_123\", \"group_2\"))\n .application(null)\n .tags(arrayOf(\"my_tag\", \"other\"))\n .transformationsParams(null)\n .payloadRetentionPeriod(90)\n .payloadRetentionHours(null)\n)\n\n// Alternatively, with a raw string payload.\nval messageOut = svix.message.create(\"app_id\", svix.messageInRaw(\n eventType = \"world.hello\",\n payload = \"Hello, World!\",\n contentType = \"text/plain\",\n))\n" + "source": "val messageOut = svix.message.create(\"app_id\", MessageIn()\n .eventId(\"unique-msg-identifier\")\n .eventType(\"user.signup\")\n .payload(/* ... */)\n .channels(arrayOf(\"project_123\", \"group_2\"))\n .application(null)\n .tags(arrayOf(\"my_tag\", \"other\"))\n .transformationsParams(null)\n .payloadRetentionPeriod(90)\n .payloadRetentionHours(null)\n)\n\n// Alternatively, with a raw string payload.\nval messageOut = svix.message.create(\"app_id\", svix.messageInRaw(\n eventType = \"user.signup\",\n payload = \"This is a raw body.\",\n contentType = \"text/plain\",\n))\n" }, { "label": "Java", "lang": "Java", - "source": "MessageOut messageOut = svix.getMessage().create(\"app_id\", new MessageIn()\n .eventId(\"unique-msg-identifier\")\n .eventType(\"user.signup\")\n .payload(/* ... */)\n .channels(new String[]{\"project_123\", \"group_2\"})\n .application(null)\n .tags(new String[]{\"my_tag\", \"other\"})\n .transformationsParams(null)\n .payloadRetentionPeriod(90)\n .payloadRetentionHours(null)\n);\n\n// Alternatively, with a raw string payload.\nMessageOut messageOut = svix.getMessage().create(\n \"app_id\",\n Message.messageInRaw(\"Hello, World!\", \"text/plain\")\n .eventType(\"world.hello\")\n);\n" + "source": "MessageOut messageOut = svix.getMessage().create(\"app_id\", new MessageIn()\n .eventId(\"unique-msg-identifier\")\n .eventType(\"user.signup\")\n .payload(/* ... */)\n .channels(new String[]{\"project_123\", \"group_2\"})\n .application(null)\n .tags(new String[]{\"my_tag\", \"other\"})\n .transformationsParams(null)\n .payloadRetentionPeriod(90)\n .payloadRetentionHours(null)\n);\n\n// Alternatively, with a raw string payload.\nMessageOut messageOut = svix.getMessage().create(\n \"app_id\",\n Message.messageInRaw(\"This is a raw body.\", \"text/plain\")\n .eventType(\"user.signup\")\n);\n" }, { "label": "Ruby", "lang": "Ruby", - "source": "message_out = svix.message.create(\"app_id\", Svix::MessageIn.new({\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\": nil,\n \"tags\": [\"my_tag\", \"other\"],\n \"transformations_params\": nil,\n \"payload_retention_period\": 90,\n \"payload_retention_hours\": nil\n}))\n\n# Alternatively, with a raw string payload.\nmessage_out = svix.message.create(\"app_id\", Svix.message_in_raw({\n event_type: \"user.signup\",\n payload: \"Hello, World!\",\n content_type: \"text/plain\",\n}))\n" + "source": "message_out = svix.message.create(\"app_id\", Svix::MessageIn.new({\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\": nil,\n \"tags\": [\"my_tag\", \"other\"],\n \"transformations_params\": nil,\n \"payload_retention_period\": 90,\n \"payload_retention_hours\": nil\n}))\n\n# Alternatively, with a raw string payload.\nmessage_out = svix.message.create(\"app_id\", Svix.message_in_raw({\n event_type: \"user.signup\",\n payload: \"This is a raw body.\",\n content_type: \"text/plain\",\n}))\n" }, { "label": "Rust", "lang": "Rust", - "source": "let message_out = svix.message().create(\"app_id\", MessageIn {\n event_id: Some(\"unique-msg-identifier\".to_string()),\n event_type: \"user.signup\".to_string(),\n payload: json!({\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"}),\n channels: Some(vec![\"project_123\".to_string(), \"group_2\".to_string()]),\n application: None,\n tags: Some(vec![\"my_tag\".to_string(), \"other\".to_string()]),\n transformations_params: None,\n payload_retention_period: Some(90),\n payload_retention_hours: None,\n}, None).await?;\n\n// Alternatively, with a raw string payload.\nlet message_out = svix.message().create(\n \"app_id\",\n MessageIn::new_raw_payload(\n \"world.hello\".to_string(),\n \"Hello, World!\".to_string(),\n ).with_content_type(\"text/plain\".to_string()),\n None,\n).await?;\n" + "source": "let message_out = svix.message().create(\"app_id\", MessageIn {\n event_id: Some(\"unique-msg-identifier\".to_string()),\n event_type: \"user.signup\".to_string(),\n payload: json!({\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"}),\n channels: Some(vec![\"project_123\".to_string(), \"group_2\".to_string()]),\n application: None,\n tags: Some(vec![\"my_tag\".to_string(), \"other\".to_string()]),\n transformations_params: None,\n payload_retention_period: Some(90),\n payload_retention_hours: None,\n}, None).await?;\n\n// Alternatively, with a raw string payload.\nlet message_out = svix.message().create(\n \"app_id\",\n MessageIn::new_raw_payload(\n \"user.signup\".to_string(),\n \"This is a raw body.\".to_string(),\n ).with_content_type(\"text/plain\".to_string()),\n None,\n).await?;\n" }, { "label": "C#", "lang": "C#", - "source": "var messageOut = await svix.Message.CreateAsync(\"app_id\", new MessageIn{\n eventId: \"unique-msg-identifier\",\n eventType: \"user.signup\",\n payload: /* ... */,\n channels: new string[] {\"project_123\", \"group_2\"},\n application: null,\n tags: new string[] {\"my_tag\", \"other\"},\n transformationsParams: null,\n payloadRetentionPeriod: 90,\n payloadRetentionHours: null\n});\n\n// Alternatively, with a raw string payload.\nvar messageOut = await svix.Message.CreateAsync(\n \"app_id\",\n svix.Message.messageInRaw(\n eventType: \"world.hello\",\n payload: \"Hello, world!\",\n contentType: \"text/plain\",\n ),\n);\n" + "source": "var messageOut = await svix.Message.CreateAsync(\"app_id\", new MessageIn{\n eventId: \"unique-msg-identifier\",\n eventType: \"user.signup\",\n payload: /* ... */,\n channels: new string[] {\"project_123\", \"group_2\"},\n application: null,\n tags: new string[] {\"my_tag\", \"other\"},\n transformationsParams: null,\n payloadRetentionPeriod: 90,\n payloadRetentionHours: null\n});\n\n// Alternatively, with a raw string payload.\nvar messageOut = await svix.Message.CreateAsync(\n \"app_id\",\n svix.Message.messageInRaw(\n eventType: \"user.signup\",\n payload: \"This is a raw body.\",\n contentType: \"text/plain\",\n ),\n);\n" }, { "label": "CLI", @@ -16351,7 +16751,7 @@ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\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 }'\n\n# Alternatively, with a raw string payload.\ncurl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"eventType\": \"world.hello\",\n \"payload\": {},\n \"transformationsParams\": {\n \"rawPayload\": \"Hello, World!\",\n \"headers\": { \"content-type\": \"text/plain\" }\n }\n }'\n" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\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 }'\n\n# Alternatively, with a raw string payload.\ncurl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"eventType\": \"user.signup\",\n \"payload\": {},\n \"transformationsParams\": {\n \"rawPayload\": \"This is a raw body.\",\n \"headers\": { \"content-type\": \"text/plain\" }\n }\n }'\n" } ] } @@ -16558,337 +16958,10 @@ ] } }, - "/api/v1/app/{app_id}/msg/{msg_id}/attempt": { + "/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}": { "get": { - "deprecated": true, - "description": "Deprecated: Please use \"List Attempts by Endpoint\" and \"List Attempts by Msg\" instead.\n\nNote that by default this endpoint is limited to retrieving 90 days' worth of data\nrelative to now or, if an iterator is provided, 90 days before/after the time indicated\nby the iterator ID. If you require data beyond those time ranges, you will need to explicitly\nset the `before` or `after` parameter as appropriate.\n\n`msg_id`: Use a message id or a message `eventId`", - "operationId": "v1.message-attempt.list-by-msg-deprecated", - "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": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2", - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "description": "Filter the attempts based on the attempted endpoint", - "in": "query", - "name": "endpoint_id", - "schema": { - "description": "Filter the attempts based on the attempted endpoint", - "example": "unique-ep-identifier", - "maxLength": 256, - "minLength": 1, - "nullable": true, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "form" - }, - { - "description": "Filter response based on the channel", - "in": "query", - "name": "channel", - "schema": { - "description": "Filter response based on the channel", - "example": "project_1337", - "maxLength": 128, - "nullable": true, - "pattern": "^[a-zA-Z0-9\\-_.:]+$", - "type": "string" - }, - "style": "form" - }, - { - "description": "Filter response based on the tag", - "in": "query", - "name": "tag", - "schema": { - "description": "Filter response based on the tag", - "example": "project_1337", - "maxLength": 128, - "nullable": true, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "form" - }, - { - "description": "Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3)", - "explode": false, - "in": "query", - "name": "status", - "schema": { - "$ref": "#/components/schemas/MessageStatus", - "description": "Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3)", - "nullable": true - }, - "style": "form" - }, - { - "description": "Only include items created before a certain date", - "in": "query", - "name": "before", - "schema": { - "description": "Only include items created before a certain date", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "description": "Only include items created after a certain date", - "in": "query", - "name": "after", - "schema": { - "description": "Only include items created after a certain date", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "description": "Filter response based on the HTTP status code", - "explode": false, - "in": "query", - "name": "status_code_class", - "schema": { - "$ref": "#/components/schemas/StatusCodeClass", - "description": "Filter response based on the HTTP status code", - "nullable": true - }, - "style": "form" - }, - { - "description": "Filter response based on the event type", - "in": "query", - "name": "event_types", - "schema": { - "description": "Filter response based on the event type", - "items": { - "description": "The event type's name", - "example": "user.signup", - "maxLength": 256, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "nullable": true, - "type": "array", - "uniqueItems": true - }, - "style": "form" - }, - { - "description": "The app's ID or UID", - "in": "path", - "name": "app_id", - "required": true, - "schema": { - "description": "The app's ID or UID", - "example": "unique-app-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "simple" - }, - { - "description": "The msg's ID or UID", - "in": "path", - "name": "msg_id", - "required": true, - "schema": { - "description": "The msg's ID or UID", - "example": "unique-msg-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "simple" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListResponse_MessageAttemptOut_" - } - } - }, - "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 Attempts", - "tags": [ - "Message Attempt" - ], - "x-codeSamples": [ - { - "label": "JavaScript", - "lang": "JavaScript", - "source": "const listResponseMessageAttemptOut = await svix.messageAttempt.listByMsgDeprecated(\"app_id\", \"msg_id\");" - }, - { - "label": "TypeScript", - "lang": "JavaScript", - "source": "const listResponseMessageAttemptOut = await svix.messageAttempt.listByMsgDeprecated(\"app_id\", \"msg_id\");" - }, - { - "label": "Python", - "lang": "Python", - "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\", options=...)" - }, - { - "label": "Go", - "lang": "Go", - "source": "listResponseMessageAttemptOut, err := svixClient.MessageAttempt.ListByMsgDeprecated(ctx, \"app_id\", \"msg_id\", nil)" - }, - { - "label": "Kotlin", - "lang": "Kotlin", - "source": "val listResponseMessageAttemptOut = svix.messageAttempt.listByMsgDeprecated(\"app_id\", \"msg_id\")" - }, - { - "label": "Java", - "lang": "Java", - "source": "ListResponseMessageAttemptOut listResponseMessageAttemptOut = svix.getMessageAttempt().listByMsgDeprecated(\"app_id\", \"msg_id\");" - }, - { - "label": "Ruby", - "lang": "Ruby", - "source": "list_response_message_attempt_out = svix.message_attempt.list_by_msg_deprecated(\"app_id\", \"msg_id\")" - }, - { - "label": "Rust", - "lang": "Rust", - "source": "let list_response_message_attempt_out = svix.message_attempt().list_by_msg_deprecated(\"app_id\", \"msg_id\", None).await?;" - }, - { - "label": "C#", - "lang": "C#", - "source": "var listResponseMessageAttemptOut = await svix.MessageAttempt.ListByMsgDeprecatedAsync(\"app_id\", \"msg_id\");" - }, - { - "label": "CLI", - "lang": "Shell", - "source": "svix message-attempt list-by-msg-deprecated \"app_id\" \"msg_id\"" - }, - { - "label": "cURL", - "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/attempt' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" - } - ] - } - }, - "/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}": { - "get": { - "description": "`msg_id`: Use a message id or a message `eventId`", - "operationId": "v1.message-attempt.get", + "description": "`msg_id`: Use a message id or a message `eventId`", + "operationId": "v1.message-attempt.get", "parameters": [ { "description": "The app's ID or UID", @@ -17887,384 +17960,69 @@ ] } }, - "/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/attempt": { - "get": { - "deprecated": true, - "description": "DEPRECATED: please use list_attempts with endpoint_id as a query parameter instead.\n\nList the message attempts for a particular endpoint.\n\nReturning the endpoint.\n\nThe `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed.\n\nNote that by default this endpoint is limited to retrieving 90 days' worth of data\nrelative to now or, if an iterator is provided, 90 days before/after the time indicated\nby the iterator ID. If you require data beyond those time ranges, you will need to explicitly\nset the `before` or `after` parameter as appropriate.\n", - "operationId": "v1.message-attempt.list-by-endpoint-deprecated", + "/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend": { + "post": { + "description": "Resend a message to the specified endpoint.", + "operationId": "v1.message-attempt.resend", "parameters": [ { - "description": "Limit the number of returned items", - "in": "query", - "name": "limit", + "description": "The app's ID or UID", + "in": "path", + "name": "app_id", + "required": true, "schema": { - "description": "Limit the number of returned items", - "format": "uint64", - "maximum": 250, - "minimum": 1, - "type": "integer" + "description": "The app's ID or UID", + "example": "unique-app-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" }, - "style": "form" + "style": "simple" }, { - "description": "The iterator returned from a prior invocation", - "in": "query", - "name": "iterator", + "description": "The msg's ID or UID", + "in": "path", + "name": "msg_id", + "required": true, "schema": { - "description": "The iterator returned from a prior invocation", - "example": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2", - "nullable": true, + "description": "The msg's ID or UID", + "example": "unique-msg-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, - "style": "form" + "style": "simple" }, { - "description": "Filter response based on the channel", - "in": "query", - "name": "channel", + "description": "The ep's ID or UID", + "in": "path", + "name": "endpoint_id", + "required": true, "schema": { - "description": "Filter response based on the channel", - "example": "project_1337", - "maxLength": 128, - "nullable": true, - "pattern": "^[a-zA-Z0-9\\-_.:]+$", + "description": "The ep's ID or UID", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, - "style": "form" + "style": "simple" }, { - "description": "Filter response based on the tag", - "in": "query", - "name": "tag", + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", "schema": { - "description": "Filter response based on the tag", - "example": "project_1337", - "maxLength": 128, - "nullable": true, - "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, - "style": "form" - }, - { - "description": "Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3)", - "explode": false, - "in": "query", - "name": "status", - "schema": { - "$ref": "#/components/schemas/MessageStatus", - "description": "Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3)", - "nullable": true - }, - "style": "form" - }, - { - "description": "Only include items created before a certain date", - "in": "query", - "name": "before", - "schema": { - "description": "Only include items created before a certain date", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "description": "Only include items created after a certain date", - "in": "query", - "name": "after", - "schema": { - "description": "Only include items created after a certain date", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "description": "Filter response based on the event type", - "in": "query", - "name": "event_types", - "schema": { - "description": "Filter response based on the event type", - "items": { - "description": "The event type's name", - "example": "user.signup", - "maxLength": 256, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "nullable": true, - "type": "array", - "uniqueItems": true - }, - "style": "form" - }, - { - "description": "The app's ID or UID", - "in": "path", - "name": "app_id", - "required": true, - "schema": { - "description": "The app's ID or UID", - "example": "unique-app-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "simple" - }, - { - "description": "The msg's ID or UID", - "in": "path", - "name": "msg_id", - "required": true, - "schema": { - "description": "The msg's ID or UID", - "example": "unique-msg-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "simple" - }, - { - "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/ListResponse_MessageAttemptEndpointOut_" - } - } - }, - "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 Attempts For Endpoint", - "tags": [ - "Message Attempt" - ], - "x-codeSamples": [ - { - "label": "JavaScript", - "lang": "JavaScript", - "source": "const listResponseMessageAttemptEndpointOut = await svix.messageAttempt.listByEndpointDeprecated(\"app_id\", \"msg_id\", \"endpoint_id\");" - }, - { - "label": "TypeScript", - "lang": "JavaScript", - "source": "const listResponseMessageAttemptEndpointOut = await svix.messageAttempt.listByEndpointDeprecated(\"app_id\", \"msg_id\", \"endpoint_id\");" - }, - { - "label": "Python", - "lang": "Python", - "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\", options=...)" - }, - { - "label": "Go", - "lang": "Go", - "source": "listResponseMessageAttemptEndpointOut, err := svixClient.MessageAttempt.ListByEndpointDeprecated(ctx, \"app_id\", \"msg_id\", \"endpoint_id\", nil)" - }, - { - "label": "Kotlin", - "lang": "Kotlin", - "source": "val listResponseMessageAttemptEndpointOut = svix.messageAttempt.listByEndpointDeprecated(\"app_id\", \"msg_id\", \"endpoint_id\")" - }, - { - "label": "Java", - "lang": "Java", - "source": "ListResponseMessageAttemptEndpointOut listResponseMessageAttemptEndpointOut = svix.getMessageAttempt().listByEndpointDeprecated(\"app_id\", \"msg_id\", \"endpoint_id\");" - }, - { - "label": "Ruby", - "lang": "Ruby", - "source": "list_response_message_attempt_endpoint_out = svix.message_attempt.list_by_endpoint_deprecated(\"app_id\", \"msg_id\", \"endpoint_id\")" - }, - { - "label": "Rust", - "lang": "Rust", - "source": "let list_response_message_attempt_endpoint_out = svix.message_attempt().list_by_endpoint_deprecated(\"app_id\", \"msg_id\", \"endpoint_id\", None).await?;" - }, - { - "label": "C#", - "lang": "C#", - "source": "var listResponseMessageAttemptEndpointOut = await svix.MessageAttempt.ListByEndpointDeprecatedAsync(\"app_id\", \"msg_id\", \"endpoint_id\");" - }, - { - "label": "CLI", - "lang": "Shell", - "source": "svix message-attempt list-by-endpoint-deprecated \"app_id\" \"msg_id\" \"endpoint_id\"" - }, - { - "label": "cURL", - "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/attempt' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" - } - ] - } - }, - "/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend": { - "post": { - "description": "Resend a message to the specified endpoint.", - "operationId": "v1.message-attempt.resend", - "parameters": [ - { - "description": "The app's ID or UID", - "in": "path", - "name": "app_id", - "required": true, - "schema": { - "description": "The app's ID or UID", - "example": "unique-app-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "simple" - }, - { - "description": "The msg's ID or UID", - "in": "path", - "name": "msg_id", - "required": true, - "schema": { - "description": "The msg's ID or UID", - "example": "unique-msg-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "simple" - }, - { - "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", - "name": "idempotency-key", - "schema": { - "type": "string" - }, - "style": "simple" - } - ], - "responses": { - "202": { - "description": "no content" + "style": "simple" + } + ], + "responses": { + "202": { + "description": "no content" }, "400": { "content": { @@ -19730,62 +19488,62 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const appPortalAccessOut = await svix.authentication.appPortalAccess(\"app_id\", {\n featureFlags: [],\n expiry: null,\n readOnly: null,\n application: null\n});" + "source": "const appPortalAccessOut = await svix.authentication.appPortalAccess(\"app_id\", {\n application: null,\n featureFlags: [],\n expiry: null,\n readOnly: null\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const appPortalAccessOut = await svix.authentication.appPortalAccess(\"app_id\", {\n featureFlags: [],\n expiry: null,\n readOnly: null,\n application: null\n});" + "source": "const appPortalAccessOut = await svix.authentication.appPortalAccess(\"app_id\", {\n application: null,\n featureFlags: [],\n expiry: null,\n readOnly: null\n});" }, { "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), options=...)" + "source": "app_portal_access_out = svix.authentication.app_portal_access(\"app_id\", AppPortalAccessIn(\n application=None,\n feature_flags=[],\n expiry=None,\n read_only=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), options=...)" + "source": "app_portal_access_out = await svix.authentication.app_portal_access(\"app_id\", AppPortalAccessIn(\n application=None,\n feature_flags=[],\n expiry=None,\n read_only=None\n), options=...)" }, { "label": "Go", "lang": "Go", - "source": "appPortalAccessOut, err := svixClient.Authentication.AppPortalAccess(ctx, \"app_id\", &AppPortalAccessIn{\n FeatureFlags: []interface{}{},\n Expiry: nil,\n ReadOnly: nil,\n Application: nil,\n})" + "source": "appPortalAccessOut, err := svixClient.Authentication.AppPortalAccess(ctx, \"app_id\", &AppPortalAccessIn{\n Application: nil,\n FeatureFlags: []interface{}{},\n Expiry: nil,\n ReadOnly: nil,\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val appPortalAccessOut = svix.authentication.appPortalAccess(\"app_id\", AppPortalAccessIn()\n .featureFlags(arrayOf())\n .expiry(null)\n .readOnly(null)\n .application(null)\n)" + "source": "val appPortalAccessOut = svix.authentication.appPortalAccess(\"app_id\", AppPortalAccessIn()\n .application(null)\n .featureFlags(arrayOf())\n .expiry(null)\n .readOnly(null)\n)" }, { "label": "Java", "lang": "Java", - "source": "AppPortalAccessOut appPortalAccessOut = svix.getAuthentication().appPortalAccess(\"app_id\", new AppPortalAccessIn()\n .featureFlags(new Object[]{})\n .expiry(null)\n .readOnly(null)\n .application(null)\n);" + "source": "AppPortalAccessOut appPortalAccessOut = svix.getAuthentication().appPortalAccess(\"app_id\", new AppPortalAccessIn()\n .application(null)\n .featureFlags(new Object[]{})\n .expiry(null)\n .readOnly(null)\n);" }, { "label": "Ruby", "lang": "Ruby", - "source": "app_portal_access_out = svix.authentication.app_portal_access(\"app_id\", Svix::AppPortalAccessIn.new({\n \"feature_flags\": [],\n \"expiry\": nil,\n \"read_only\": nil,\n \"application\": nil\n}))" + "source": "app_portal_access_out = svix.authentication.app_portal_access(\"app_id\", Svix::AppPortalAccessIn.new({\n \"application\": nil,\n \"feature_flags\": [],\n \"expiry\": nil,\n \"read_only\": nil\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let app_portal_access_out = svix.authentication().app_portal_access(\"app_id\", AppPortalAccessIn {\n feature_flags: Some(vec![]),\n expiry: None,\n read_only: None,\n application: None,\n}, None).await?;" + "source": "let app_portal_access_out = svix.authentication().app_portal_access(\"app_id\", AppPortalAccessIn {\n application: None,\n feature_flags: Some(vec![]),\n expiry: None,\n read_only: None,\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var appPortalAccessOut = await svix.Authentication.AppPortalAccessAsync(\"app_id\", new AppPortalAccessIn{\n featureFlags: new Object[] {},\n expiry: null,\n readOnly: null,\n application: null\n});" + "source": "var appPortalAccessOut = await svix.Authentication.AppPortalAccessAsync(\"app_id\", new AppPortalAccessIn{\n application: null,\n featureFlags: new Object[] {},\n expiry: null,\n readOnly: null\n});" }, { "label": "CLI", "lang": "Shell", - "source": "svix authentication app-portal-access \"app_id\" '{\n \"featureFlags\": [],\n \"expiry\": null,\n \"readOnly\": null,\n \"application\": null\n}'" + "source": "svix authentication app-portal-access \"app_id\" '{\n \"application\": null,\n \"featureFlags\": [],\n \"expiry\": null,\n \"readOnly\": null\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/app-portal-access/{app_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"featureFlags\": [],\n \"expiry\": null,\n \"readOnly\": null,\n \"application\": null\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/app-portal-access/{app_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"application\": null,\n \"featureFlags\": [],\n \"expiry\": null,\n \"readOnly\": null\n }'" } ] } @@ -20539,62 +20297,232 @@ { "label": "Kotlin", "lang": "Kotlin", - "source": "val authTokenOut = svix.authentication.rotatePollerToken(\"app_id\", \"endpoint_id\", RotatePollerTokenIn()\n .expiry(null)\n)" + "source": "val authTokenOut = svix.authentication.rotatePollerToken(\"app_id\", \"endpoint_id\", RotatePollerTokenIn()\n .expiry(null)\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "AuthTokenOut authTokenOut = svix.getAuthentication().rotatePollerToken(\"app_id\", \"endpoint_id\", new RotatePollerTokenIn()\n .expiry(null)\n);" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "auth_token_out = svix.authentication.rotate_poller_token(\"app_id\", \"endpoint_id\", Svix::RotatePollerTokenIn.new({\n \"expiry\": nil\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let auth_token_out = svix.authentication().rotate_poller_token(\"app_id\", \"endpoint_id\", RotatePollerTokenIn {\n expiry: None,\n}, None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var authTokenOut = await svix.Authentication.RotatePollerTokenAsync(\"app_id\", \"endpoint_id\", new RotatePollerTokenIn{\n expiry: null\n});" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix authentication rotate-poller-token \"app_id\" \"endpoint_id\" '{\n \"expiry\": null\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/app/{app_id}/poller/{endpoint_id}/token/rotate' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"expiry\": null\n }'" + } + ] + } + }, + "/api/v1/auth/dashboard-access/{app_id}": { + "post": { + "deprecated": true, + "description": "DEPRECATED: Please use `app-portal-access` instead.\n\nUse this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.", + "operationId": "v1.authentication.dashboard-access", + "parameters": [ + { + "description": "The app's ID or UID", + "in": "path", + "name": "app_id", + "required": true, + "schema": { + "description": "The app's ID or UID", + "example": "unique-app-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + }, + { + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DashboardAccessOut" + } + } + }, + "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": "Dashboard Access", + "tags": [ + "Authentication" + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const dashboardAccessOut = await svix.authentication.dashboardAccess(\"app_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const dashboardAccessOut = await svix.authentication.dashboardAccess(\"app_id\");" + }, + { + "label": "Python", + "lang": "Python", + "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\", options=...)" + }, + { + "label": "Go", + "lang": "Go", + "source": "dashboardAccessOut, err := svixClient.Authentication.DashboardAccess(ctx, \"app_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val dashboardAccessOut = svix.authentication.dashboardAccess(\"app_id\")" }, { "label": "Java", "lang": "Java", - "source": "AuthTokenOut authTokenOut = svix.getAuthentication().rotatePollerToken(\"app_id\", \"endpoint_id\", new RotatePollerTokenIn()\n .expiry(null)\n);" + "source": "DashboardAccessOut dashboardAccessOut = svix.getAuthentication().dashboardAccess(\"app_id\");" }, { "label": "Ruby", "lang": "Ruby", - "source": "auth_token_out = svix.authentication.rotate_poller_token(\"app_id\", \"endpoint_id\", Svix::RotatePollerTokenIn.new({\n \"expiry\": nil\n}))" + "source": "dashboard_access_out = svix.authentication.dashboard_access(\"app_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let auth_token_out = svix.authentication().rotate_poller_token(\"app_id\", \"endpoint_id\", RotatePollerTokenIn {\n expiry: None,\n}, None).await?;" + "source": "let dashboard_access_out = svix.authentication().dashboard_access(\"app_id\", None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var authTokenOut = await svix.Authentication.RotatePollerTokenAsync(\"app_id\", \"endpoint_id\", new RotatePollerTokenIn{\n expiry: null\n});" + "source": "var dashboardAccessOut = await svix.Authentication.DashboardAccessAsync(\"app_id\");" }, { "label": "CLI", "lang": "Shell", - "source": "svix authentication rotate-poller-token \"app_id\" \"endpoint_id\" '{\n \"expiry\": null\n}'" + "source": "svix authentication dashboard-access \"app_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/app/{app_id}/poller/{endpoint_id}/token/rotate' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"expiry\": null\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/dashboard-access/{app_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" } ] } }, - "/api/v1/auth/dashboard-access/{app_id}": { + "/api/v1/auth/logout": { "post": { - "deprecated": true, - "description": "DEPRECATED: Please use `app-portal-access` instead.\n\nUse this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.", - "operationId": "v1.authentication.dashboard-access", + "description": "Logout an app token.\n\nTrying to log out other tokens will fail.", + "operationId": "v1.authentication.logout", "parameters": [ - { - "description": "The app's ID or UID", - "in": "path", - "name": "app_id", - "required": true, - "schema": { - "description": "The app's ID or UID", - "example": "unique-app-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "style": "simple" - }, { "description": "The request's idempotency key", "in": "header", @@ -20606,15 +20534,8 @@ } ], "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DashboardAccessOut" - } - } - }, - "description": "" + "204": { + "description": "no content" }, "400": { "content": { @@ -20692,7 +20613,7 @@ "HTTPBearer": [] } ], - "summary": "Dashboard Access", + "summary": "Logout", "tags": [ "Authentication" ], @@ -20700,70 +20621,70 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const dashboardAccessOut = await svix.authentication.dashboardAccess(\"app_id\");" + "source": "await svix.authentication.logout();" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const dashboardAccessOut = await svix.authentication.dashboardAccess(\"app_id\");" + "source": "await svix.authentication.logout();" }, { "label": "Python", "lang": "Python", - "source": "dashboard_access_out = svix.authentication.dashboard_access(\"app_id\", options=...)" + "source": "svix.authentication.logout(options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "dashboard_access_out = await svix.authentication.dashboard_access(\"app_id\", options=...)" + "source": "await svix.authentication.logout(options=...)" }, { "label": "Go", "lang": "Go", - "source": "dashboardAccessOut, err := svixClient.Authentication.DashboardAccess(ctx, \"app_id\")" + "source": "err := svixClient.Authentication.Logout(ctx)" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val dashboardAccessOut = svix.authentication.dashboardAccess(\"app_id\")" + "source": "svix.authentication.logout()" }, { "label": "Java", "lang": "Java", - "source": "DashboardAccessOut dashboardAccessOut = svix.getAuthentication().dashboardAccess(\"app_id\");" + "source": "svix.getAuthentication().logout();" }, { "label": "Ruby", "lang": "Ruby", - "source": "dashboard_access_out = svix.authentication.dashboard_access(\"app_id\")" + "source": "svix.authentication.logout()" }, { "label": "Rust", "lang": "Rust", - "source": "let dashboard_access_out = svix.authentication().dashboard_access(\"app_id\", None).await?;" + "source": "svix.authentication().logout(None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var dashboardAccessOut = await svix.Authentication.DashboardAccessAsync(\"app_id\");" + "source": "await svix.Authentication.LogoutAsync();" }, { "label": "CLI", "lang": "Shell", - "source": "svix authentication dashboard-access \"app_id\"" + "source": "svix authentication logout " }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/dashboard-access/{app_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/logout' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" } ] } }, - "/api/v1/auth/logout": { + "/api/v1/auth/one-time-token": { "post": { - "description": "Logout an app token.\n\nTrying to log out other tokens will fail.", - "operationId": "v1.authentication.logout", + "description": "This is a one time token.", + "operationId": "v1.authentication.exchange-one-time-token", "parameters": [ { "description": "The request's idempotency key", @@ -20775,9 +20696,26 @@ "style": "simple" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OneTimeTokenIn" + } + } + }, + "required": true + }, "responses": { - "204": { - "description": "no content" + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OneTimeTokenOut" + } + } + }, + "description": "" }, "400": { "content": { @@ -20855,7 +20793,7 @@ "HTTPBearer": [] } ], - "summary": "Logout", + "summary": "Exchange One Time Token", "tags": [ "Authentication" ], @@ -20863,71 +20801,80 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "await svix.authentication.logout();" + "source": "const oneTimeTokenOut = await svix.authentication.exchangeOneTimeToken(\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "await svix.authentication.logout();" + "source": "const oneTimeTokenOut = await svix.authentication.exchangeOneTimeToken(\n});" }, { "label": "Python", "lang": "Python", - "source": "svix.authentication.logout(options=...)" + "source": "one_time_token_out = svix.authentication.exchange_one_time_token(OneTimeTokenIn\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.authentication.logout(options=...)" + "source": "one_time_token_out = await svix.authentication.exchange_one_time_token(OneTimeTokenIn\n), options=...)" }, { "label": "Go", "lang": "Go", - "source": "err := svixClient.Authentication.Logout(ctx)" + "source": "oneTimeTokenOut, err := svixClient.Authentication.ExchangeOneTimeToken(ctx, &OneTimeTokenIn{\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "svix.authentication.logout()" + "source": "val oneTimeTokenOut = svix.authentication.exchangeOneTimeToken(OneTimeTokenIn()\n)" }, { "label": "Java", "lang": "Java", - "source": "svix.getAuthentication().logout();" + "source": "OneTimeTokenOut oneTimeTokenOut = svix.getAuthentication().exchangeOneTimeToken(new OneTimeTokenIn()\n);" }, { "label": "Ruby", "lang": "Ruby", - "source": "svix.authentication.logout()" + "source": "one_time_token_out = svix.authentication.exchange_one_time_token(Svix::OneTimeTokenIn.new(\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "svix.authentication().logout(None).await?;" + "source": "let one_time_token_out = svix.authentication().exchange_one_time_token(OneTimeTokenIn {\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "await svix.Authentication.LogoutAsync();" + "source": "var oneTimeTokenOut = await svix.Authentication.ExchangeOneTimeTokenAsync(new OneTimeTokenIn\n});" }, { "label": "CLI", "lang": "Shell", - "source": "svix authentication logout " + "source": "svix authentication exchange-one-time-token '\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/logout' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/one-time-token' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '\n }'" } ] } }, - "/api/v1/auth/one-time-token": { + "/api/v1/auth/stream-portal-access/{stream_id}": { "post": { - "description": "This is a one time token.", - "operationId": "v1.authentication.exchange-one-time-token", + "description": "Use this function to get magic links (and authentication codes) for connecting your users to the Stream Consumer Portal.", + "operationId": "v1.authentication.stream-portal-access", "parameters": [ + { + "in": "path", + "name": "stream_id", + "required": true, + "schema": { + "$ref": "#/components/schemas/StreamIdOrUid" + }, + "style": "simple" + }, { "description": "The request's idempotency key", "in": "header", @@ -20942,7 +20889,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OneTimeTokenIn" + "$ref": "#/components/schemas/StreamPortalAccessIn" } } }, @@ -20953,7 +20900,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OneTimeTokenOut" + "$ref": "#/components/schemas/AppPortalAccessOut" } } }, @@ -21035,7 +20982,7 @@ "HTTPBearer": [] } ], - "summary": "Exchange One Time Token", + "summary": "Get Stream Portal Access", "tags": [ "Authentication" ], @@ -21043,62 +20990,62 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const oneTimeTokenOut = await svix.authentication.exchangeOneTimeToken(\n});" + "source": "const appPortalAccessOut = await svix.authentication.streamPortalAccess(\"stream_id\", {\n featureFlags: [],\n expiry: null,\n readOnly: null\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const oneTimeTokenOut = await svix.authentication.exchangeOneTimeToken(\n});" + "source": "const appPortalAccessOut = await svix.authentication.streamPortalAccess(\"stream_id\", {\n featureFlags: [],\n expiry: null,\n readOnly: null\n});" }, { "label": "Python", "lang": "Python", - "source": "one_time_token_out = svix.authentication.exchange_one_time_token(OneTimeTokenIn\n), options=...)" + "source": "app_portal_access_out = svix.authentication.stream_portal_access(\"stream_id\", StreamPortalAccessIn(\n feature_flags=[],\n expiry=None,\n read_only=None\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "one_time_token_out = await svix.authentication.exchange_one_time_token(OneTimeTokenIn\n), options=...)" + "source": "app_portal_access_out = await svix.authentication.stream_portal_access(\"stream_id\", StreamPortalAccessIn(\n feature_flags=[],\n expiry=None,\n read_only=None\n), options=...)" }, { "label": "Go", "lang": "Go", - "source": "oneTimeTokenOut, err := svixClient.Authentication.ExchangeOneTimeToken(ctx, &OneTimeTokenIn{\n})" + "source": "appPortalAccessOut, err := svixClient.Authentication.StreamPortalAccess(ctx, \"stream_id\", &StreamPortalAccessIn{\n FeatureFlags: []interface{}{},\n Expiry: nil,\n ReadOnly: nil,\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val oneTimeTokenOut = svix.authentication.exchangeOneTimeToken(OneTimeTokenIn()\n)" + "source": "val appPortalAccessOut = svix.authentication.streamPortalAccess(\"stream_id\", StreamPortalAccessIn()\n .featureFlags(arrayOf())\n .expiry(null)\n .readOnly(null)\n)" }, { "label": "Java", "lang": "Java", - "source": "OneTimeTokenOut oneTimeTokenOut = svix.getAuthentication().exchangeOneTimeToken(new OneTimeTokenIn()\n);" + "source": "AppPortalAccessOut appPortalAccessOut = svix.getAuthentication().streamPortalAccess(\"stream_id\", new StreamPortalAccessIn()\n .featureFlags(new Object[]{})\n .expiry(null)\n .readOnly(null)\n);" }, { "label": "Ruby", "lang": "Ruby", - "source": "one_time_token_out = svix.authentication.exchange_one_time_token(Svix::OneTimeTokenIn.new(\n}))" + "source": "app_portal_access_out = svix.authentication.stream_portal_access(\"stream_id\", Svix::StreamPortalAccessIn.new({\n \"feature_flags\": [],\n \"expiry\": nil,\n \"read_only\": nil\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let one_time_token_out = svix.authentication().exchange_one_time_token(OneTimeTokenIn {\n}, None).await?;" + "source": "let app_portal_access_out = svix.authentication().stream_portal_access(\"stream_id\", StreamPortalAccessIn {\n feature_flags: Some(vec![]),\n expiry: None,\n read_only: None,\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var oneTimeTokenOut = await svix.Authentication.ExchangeOneTimeTokenAsync(new OneTimeTokenIn\n});" + "source": "var appPortalAccessOut = await svix.Authentication.StreamPortalAccessAsync(\"stream_id\", new StreamPortalAccessIn{\n featureFlags: new Object[] {},\n expiry: null,\n readOnly: null\n});" }, { "label": "CLI", "lang": "Shell", - "source": "svix authentication exchange-one-time-token '\n}'" + "source": "svix authentication stream-portal-access \"stream_id\" '{\n \"featureFlags\": [],\n \"expiry\": null,\n \"readOnly\": null\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/one-time-token' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/stream-portal-access/{stream_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"featureFlags\": [],\n \"expiry\": null,\n \"readOnly\": null\n }'" } ] } @@ -21106,7 +21053,7 @@ "/api/v1/background-task": { "get": { "description": "List background tasks executed in the past 90 days.", - "operationId": "list_background_tasks", + "operationId": "v1.background-task.list", "parameters": [ { "description": "Filter the response based on the status.", @@ -21258,6 +21205,61 @@ "Background Tasks" ], "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const listResponseBackgroundTaskOut = await svix.backgroundTask.list();" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const listResponseBackgroundTaskOut = await svix.backgroundTask.list();" + }, + { + "label": "Python", + "lang": "Python", + "source": "list_response_background_task_out = svix.background_task.list(options=...)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "list_response_background_task_out = await svix.background_task.list(options=...)" + }, + { + "label": "Go", + "lang": "Go", + "source": "listResponseBackgroundTaskOut, err := svixClient.BackgroundTask.List(ctx, nil)" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val listResponseBackgroundTaskOut = svix.backgroundTask.list()" + }, + { + "label": "Java", + "lang": "Java", + "source": "ListResponseBackgroundTaskOut listResponseBackgroundTaskOut = svix.getBackgroundTask().list();" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "list_response_background_task_out = svix.background_task.list()" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let list_response_background_task_out = svix.background_task().list(None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var listResponseBackgroundTaskOut = await svix.BackgroundTask.ListAsync();" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix background-task list " + }, { "label": "cURL", "lang": "Shell", @@ -21269,7 +21271,7 @@ "/api/v1/background-task/{task_id}": { "get": { "description": "Get a background task by ID.", - "operationId": "get_background_task", + "operationId": "v1.background-task.get", "parameters": [ { "in": "path", @@ -21352,27 +21354,82 @@ }, "description": "Validation Error" }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HttpErrorOut" - } - } - }, - "description": "Too Many Requests" - } - }, - "security": [ + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Get Background Task", + "tags": [ + "Background Tasks" + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const backgroundTaskOut = await svix.backgroundTask.get(\"task_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const backgroundTaskOut = await svix.backgroundTask.get(\"task_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "background_task_out = svix.background_task.get(\"task_id\")" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "background_task_out = await svix.background_task.get(\"task_id\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "backgroundTaskOut, err := svixClient.BackgroundTask.Get(ctx, \"task_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val backgroundTaskOut = svix.backgroundTask.get(\"task_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "BackgroundTaskOut backgroundTaskOut = svix.getBackgroundTask().get(\"task_id\");" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "background_task_out = svix.background_task.get(\"task_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let background_task_out = svix.background_task().get(\"task_id\").await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var backgroundTaskOut = await svix.BackgroundTask.GetAsync(\"task_id\");" + }, { - "HTTPBearer": [] - } - ], - "summary": "Get Background Task", - "tags": [ - "Background Tasks" - ], - "x-codeSamples": [ + "label": "CLI", + "lang": "Shell", + "source": "svix background-task get \"task_id\"" + }, { "label": "cURL", "lang": "Shell", @@ -24296,7 +24353,7 @@ "/api/v1/operational-webhook/endpoint": { "get": { "description": "List operational webhook endpoints.", - "operationId": "list_operational_webhook_endpoints", + "operationId": "v1.operational-webhook.endpoint.list", "parameters": [ { "description": "Limit the number of returned items", @@ -24436,7 +24493,7 @@ }, "post": { "description": "Create an operational webhook endpoint.", - "operationId": "create_operational_webhook_endpoint", + "operationId": "v1.operational-webhook.endpoint.create", "parameters": [ { "description": "The request's idempotency key", @@ -24459,7 +24516,240 @@ "required": true }, "responses": { - "201": { + "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 \\\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": "v1.operational-webhook.endpoint.delete", + "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'\n" + } + ] + }, + "get": { + "description": "Get an operational webhook endpoint.", + "operationId": "v1.operational-webhook.endpoint.get", + "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": { @@ -24545,7 +24835,7 @@ "HTTPBearer": [] } ], - "summary": "Create Operational Webhook Endpoint", + "summary": "Get Operational Webhook Endpoint", "tags": [ "Webhook Endpoint" ], @@ -24553,15 +24843,13 @@ { "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 \\\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 }'" + "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'\n" } ] - } - }, - "/api/v1/operational-webhook/endpoint/{endpoint_id}": { - "delete": { - "description": "Delete an operational webhook endpoint.", - "operationId": "delete_operational_webhook_endpoint", + }, + "put": { + "description": "Update an operational webhook endpoint.", + "operationId": "v1.operational-webhook.endpoint.update", "parameters": [ { "description": "The ep's ID or UID", @@ -24579,9 +24867,26 @@ "style": "simple" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OperationalWebhookEndpointUpdate" + } + } + }, + "required": true + }, "responses": { - "204": { - "description": "no content" + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OperationalWebhookEndpointOut" + } + } + }, + "description": "" }, "400": { "content": { @@ -24659,7 +24964,7 @@ "HTTPBearer": [] } ], - "summary": "Delete Operational Webhook Endpoint", + "summary": "Update Operational Webhook Endpoint", "tags": [ "Webhook Endpoint" ], @@ -24667,13 +24972,15 @@ { "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'\n" + "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 \\\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/operational-webhook/endpoint/{endpoint_id}/headers": { "get": { - "description": "Get an operational webhook endpoint.", - "operationId": "get_operational_webhook_endpoint", + "description": "Get the additional headers to be sent with the operational webhook.", + "operationId": "v1.operational-webhook.endpoint.get-headers", "parameters": [ { "description": "The ep's ID or UID", @@ -24696,7 +25003,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OperationalWebhookEndpointOut" + "$ref": "#/components/schemas/OperationalWebhookEndpointHeadersOut" } } }, @@ -24778,7 +25085,7 @@ "HTTPBearer": [] } ], - "summary": "Get Operational Webhook Endpoint", + "summary": "Get Operational Webhook Endpoint Headers", "tags": [ "Webhook Endpoint" ], @@ -24786,13 +25093,13 @@ { "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'\n" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/operational-webhook/endpoint/{endpoint_id}/headers' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" } ] }, "put": { - "description": "Update an operational webhook endpoint.", - "operationId": "update_operational_webhook_endpoint", + "description": "Set the additional headers to be sent with the operational webhook.", + "operationId": "v1.operational-webhook.endpoint.update-headers", "parameters": [ { "description": "The ep's ID or UID", @@ -24814,22 +25121,15 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OperationalWebhookEndpointUpdate" + "$ref": "#/components/schemas/OperationalWebhookEndpointHeadersIn" } } }, "required": true }, "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OperationalWebhookEndpointOut" - } - } - }, - "description": "" + "204": { + "description": "no content" }, "400": { "content": { @@ -24907,7 +25207,7 @@ "HTTPBearer": [] } ], - "summary": "Update Operational Webhook Endpoint", + "summary": "Update Operational Webhook Endpoint Headers", "tags": [ "Webhook Endpoint" ], @@ -24915,7 +25215,7 @@ { "label": "cURL", "lang": "Shell", - "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 \\\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 }'" + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/operational-webhook/endpoint/{endpoint_id}/headers' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"headers\": {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n }'" } ] } @@ -24923,7 +25223,7 @@ "/api/v1/operational-webhook/endpoint/{endpoint_id}/secret": { "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", + "operationId": "v1.operational-webhook.endpoint.get-secret", "parameters": [ { "description": "The ep's ID or UID", @@ -25044,7 +25344,7 @@ "/api/v1/operational-webhook/endpoint/{endpoint_id}/secret/rotate": { "post": { "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", + "operationId": "v1.operational-webhook.endpoint.rotate-secret", "parameters": [ { "description": "The ep's ID or UID", @@ -25931,7 +26231,7 @@ "/api/v1/stream": { "get": { "description": "List of all the organization's streams.", - "operationId": "v1.stream.list", + "operationId": "v1.stream.stream.list", "parameters": [ { "description": "Limit the number of returned items", @@ -25952,7 +26252,11 @@ "name": "iterator", "schema": { "description": "The iterator returned from a prior invocation", + "example": "strm_2yZwUhtgs5Ai8T9yRQJXA", + "maxLength": 27, + "minLength": 27, "nullable": true, + "pattern": "^strm_[A-Za-z0-9]{22}$", "type": "string" }, "style": "form" @@ -26061,61 +26365,6 @@ "Stream" ], "x-codeSamples": [ - { - "label": "JavaScript", - "lang": "JavaScript", - "source": "const listResponseStreamOut = await svix.stream.list();" - }, - { - "label": "TypeScript", - "lang": "JavaScript", - "source": "const listResponseStreamOut = await svix.stream.list();" - }, - { - "label": "Python", - "lang": "Python", - "source": "list_response_stream_out = svix.stream.list(options=...)" - }, - { - "label": "Python (Async)", - "lang": "Python", - "source": "list_response_stream_out = await svix.stream.list(options=...)" - }, - { - "label": "Go", - "lang": "Go", - "source": "listResponseStreamOut, err := svixClient.Stream.List(ctx, nil)" - }, - { - "label": "Kotlin", - "lang": "Kotlin", - "source": "val listResponseStreamOut = svix.stream.list()" - }, - { - "label": "Java", - "lang": "Java", - "source": "ListResponseStreamOut listResponseStreamOut = svix.getStream().list();" - }, - { - "label": "Ruby", - "lang": "Ruby", - "source": "list_response_stream_out = svix.stream.list()" - }, - { - "label": "Rust", - "lang": "Rust", - "source": "let list_response_stream_out = svix.stream().list(None).await?;" - }, - { - "label": "C#", - "lang": "C#", - "source": "var listResponseStreamOut = await svix.Stream.ListAsync();" - }, - { - "label": "CLI", - "lang": "Shell", - "source": "svix stream list " - }, { "label": "cURL", "lang": "Shell", @@ -26125,7 +26374,7 @@ }, "post": { "description": "Creates a new stream.", - "operationId": "v1.stream.create", + "operationId": "v1.stream.stream.create", "parameters": [ { "description": "The request's idempotency key", @@ -26249,61 +26498,6 @@ "Stream" ], "x-codeSamples": [ - { - "label": "JavaScript", - "lang": "JavaScript", - "source": "const streamOut = await svix.stream.create({\n uid: null\n});" - }, - { - "label": "TypeScript", - "lang": "JavaScript", - "source": "const streamOut = await svix.stream.create({\n uid: null\n});" - }, - { - "label": "Python", - "lang": "Python", - "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), options=...)" - }, - { - "label": "Go", - "lang": "Go", - "source": "streamOut, err := svixClient.Stream.Create(ctx, &StreamIn{\n Uid: nil,\n})" - }, - { - "label": "Kotlin", - "lang": "Kotlin", - "source": "val streamOut = svix.stream.create(StreamIn()\n .uid(null)\n)" - }, - { - "label": "Java", - "lang": "Java", - "source": "StreamOut streamOut = svix.getStream().create(new StreamIn()\n .uid(null)\n);" - }, - { - "label": "Ruby", - "lang": "Ruby", - "source": "stream_out = svix.stream.create(Svix::StreamIn.new({\n \"uid\": nil\n}))" - }, - { - "label": "Rust", - "lang": "Rust", - "source": "let stream_out = svix.stream().create(StreamIn {\n uid: None,\n}, None).await?;" - }, - { - "label": "C#", - "lang": "C#", - "source": "var streamOut = await svix.Stream.CreateAsync(new StreamIn{\n uid: null\n});" - }, - { - "label": "CLI", - "lang": "Shell", - "source": "svix stream create '{\n \"uid\": null\n}'" - }, { "label": "cURL", "lang": "Shell", @@ -27079,14 +27273,14 @@ "/api/v1/stream/{stream_id}": { "delete": { "description": "Delete a stream.", - "operationId": "v1.stream.delete", + "operationId": "v1.stream.stream.delete", "parameters": [ { "in": "path", "name": "stream_id", "required": true, "schema": { - "type": "string" + "$ref": "#/components/schemas/StreamIdOrUid" }, "style": "simple" } @@ -27176,61 +27370,6 @@ "Stream" ], "x-codeSamples": [ - { - "label": "JavaScript", - "lang": "JavaScript", - "source": "await svix.stream.delete(\"stream_id\");" - }, - { - "label": "TypeScript", - "lang": "JavaScript", - "source": "await svix.stream.delete(\"stream_id\");" - }, - { - "label": "Python", - "lang": "Python", - "source": "svix.stream.delete(\"stream_id\")" - }, - { - "label": "Python (Async)", - "lang": "Python", - "source": "await svix.stream.delete(\"stream_id\")" - }, - { - "label": "Go", - "lang": "Go", - "source": "err := svixClient.Stream.Delete(ctx, \"stream_id\")" - }, - { - "label": "Kotlin", - "lang": "Kotlin", - "source": "svix.stream.delete(\"stream_id\")" - }, - { - "label": "Java", - "lang": "Java", - "source": "svix.getStream().delete(\"stream_id\");" - }, - { - "label": "Ruby", - "lang": "Ruby", - "source": "svix.stream.delete(\"stream_id\")" - }, - { - "label": "Rust", - "lang": "Rust", - "source": "svix.stream().delete(\"stream_id\").await?;" - }, - { - "label": "C#", - "lang": "C#", - "source": "await svix.Stream.DeleteAsync(\"stream_id\");" - }, - { - "label": "CLI", - "lang": "Shell", - "source": "svix stream delete \"stream_id\"" - }, { "label": "cURL", "lang": "Shell", @@ -27240,14 +27379,14 @@ }, "get": { "description": "Get a stream by id or uid.", - "operationId": "v1.stream.get", + "operationId": "v1.stream.stream.get", "parameters": [ { "in": "path", "name": "stream_id", "required": true, "schema": { - "type": "string" + "$ref": "#/components/schemas/StreamIdOrUid" }, "style": "simple" } @@ -27323,82 +27462,27 @@ }, "description": "Validation Error" }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HttpErrorOut" - } - } - }, - "description": "Too Many Requests" - } - }, - "security": [ - { - "HTTPBearer": [] - } - ], - "summary": "Get Stream", - "tags": [ - "Stream" - ], - "x-codeSamples": [ - { - "label": "JavaScript", - "lang": "JavaScript", - "source": "const streamOut = await svix.stream.get(\"stream_id\");" - }, - { - "label": "TypeScript", - "lang": "JavaScript", - "source": "const streamOut = await svix.stream.get(\"stream_id\");" - }, - { - "label": "Python", - "lang": "Python", - "source": "stream_out = svix.stream.get(\"stream_id\")" - }, - { - "label": "Python (Async)", - "lang": "Python", - "source": "stream_out = await svix.stream.get(\"stream_id\")" - }, - { - "label": "Go", - "lang": "Go", - "source": "streamOut, err := svixClient.Stream.Get(ctx, \"stream_id\")" - }, - { - "label": "Kotlin", - "lang": "Kotlin", - "source": "val streamOut = svix.stream.get(\"stream_id\")" - }, - { - "label": "Java", - "lang": "Java", - "source": "StreamOut streamOut = svix.getStream().get(\"stream_id\");" - }, - { - "label": "Ruby", - "lang": "Ruby", - "source": "stream_out = svix.stream.get(\"stream_id\")" - }, - { - "label": "Rust", - "lang": "Rust", - "source": "let stream_out = svix.stream().get(\"stream_id\").await?;" - }, - { - "label": "C#", - "lang": "C#", - "source": "var streamOut = await svix.Stream.GetAsync(\"stream_id\");" - }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ { - "label": "CLI", - "lang": "Shell", - "source": "svix stream get \"stream_id\"" - }, + "HTTPBearer": [] + } + ], + "summary": "Get Stream", + "tags": [ + "Stream" + ], + "x-codeSamples": [ { "label": "cURL", "lang": "Shell", @@ -27408,14 +27492,14 @@ }, "patch": { "description": "Partially update a stream.", - "operationId": "v1.stream.patch", + "operationId": "v1.stream.stream.patch", "parameters": [ { "in": "path", "name": "stream_id", "required": true, "schema": { - "type": "string" + "$ref": "#/components/schemas/StreamIdOrUid" }, "style": "simple" } @@ -27522,61 +27606,6 @@ "Stream" ], "x-codeSamples": [ - { - "label": "JavaScript", - "lang": "JavaScript", - "source": "const streamOut = await svix.stream.patch(\"stream_id\", {\n uid: null\n});" - }, - { - "label": "TypeScript", - "lang": "JavaScript", - "source": "const streamOut = await svix.stream.patch(\"stream_id\", {\n uid: null\n});" - }, - { - "label": "Python", - "lang": "Python", - "source": "stream_out = svix.stream.patch(\"stream_id\", StreamPatch(\n uid=None\n))" - }, - { - "label": "Python (Async)", - "lang": "Python", - "source": "stream_out = await svix.stream.patch(\"stream_id\", StreamPatch(\n uid=None\n))" - }, - { - "label": "Go", - "lang": "Go", - "source": "streamOut, err := svixClient.Stream.Patch(ctx, \"stream_id\", &StreamPatch{\n Uid: nil,\n})" - }, - { - "label": "Kotlin", - "lang": "Kotlin", - "source": "val streamOut = svix.stream.patch(\"stream_id\", StreamPatch()\n .uid(null)\n)" - }, - { - "label": "Java", - "lang": "Java", - "source": "StreamOut streamOut = svix.getStream().patch(\"stream_id\", new StreamPatch()\n .uid(null)\n);" - }, - { - "label": "Ruby", - "lang": "Ruby", - "source": "stream_out = svix.stream.patch(\"stream_id\", Svix::StreamPatch.new({\n \"uid\": nil\n}))" - }, - { - "label": "Rust", - "lang": "Rust", - "source": "let stream_out = svix.stream().patch(\"stream_id\", StreamPatch {\n uid: None,\n}).await?;" - }, - { - "label": "C#", - "lang": "C#", - "source": "var streamOut = await svix.Stream.PatchAsync(\"stream_id\", new StreamPatch{\n uid: null\n});" - }, - { - "label": "CLI", - "lang": "Shell", - "source": "svix stream patch \"stream_id\" '{\n \"uid\": null\n}'" - }, { "label": "cURL", "lang": "Shell", @@ -27586,14 +27615,14 @@ }, "put": { "description": "Update a stream.", - "operationId": "v1.stream.update", + "operationId": "v1.stream.stream.update", "parameters": [ { "in": "path", "name": "stream_id", "required": true, "schema": { - "type": "string" + "$ref": "#/components/schemas/StreamIdOrUid" }, "style": "simple" } @@ -27710,61 +27739,6 @@ "Stream" ], "x-codeSamples": [ - { - "label": "JavaScript", - "lang": "JavaScript", - "source": "const streamOut = await svix.stream.update(\"stream_id\", {\n uid: null\n});" - }, - { - "label": "TypeScript", - "lang": "JavaScript", - "source": "const streamOut = await svix.stream.update(\"stream_id\", {\n uid: null\n});" - }, - { - "label": "Python", - "lang": "Python", - "source": "stream_out = svix.stream.update(\"stream_id\", StreamIn(\n uid=None\n))" - }, - { - "label": "Python (Async)", - "lang": "Python", - "source": "stream_out = await svix.stream.update(\"stream_id\", StreamIn(\n uid=None\n))" - }, - { - "label": "Go", - "lang": "Go", - "source": "streamOut, err := svixClient.Stream.Update(ctx, \"stream_id\", &StreamIn{\n Uid: nil,\n})" - }, - { - "label": "Kotlin", - "lang": "Kotlin", - "source": "val streamOut = svix.stream.update(\"stream_id\", StreamIn()\n .uid(null)\n)" - }, - { - "label": "Java", - "lang": "Java", - "source": "StreamOut streamOut = svix.getStream().update(\"stream_id\", new StreamIn()\n .uid(null)\n);" - }, - { - "label": "Ruby", - "lang": "Ruby", - "source": "stream_out = svix.stream.update(\"stream_id\", Svix::StreamIn.new({\n \"uid\": nil\n}))" - }, - { - "label": "Rust", - "lang": "Rust", - "source": "let stream_out = svix.stream().update(\"stream_id\", StreamIn {\n uid: None,\n}).await?;" - }, - { - "label": "C#", - "lang": "C#", - "source": "var streamOut = await svix.Stream.UpdateAsync(\"stream_id\", new StreamIn{\n uid: null\n});" - }, - { - "label": "CLI", - "lang": "Shell", - "source": "svix stream update \"stream_id\" '{\n \"uid\": null\n}'" - }, { "label": "cURL", "lang": "Shell", @@ -27776,14 +27750,14 @@ "/api/v1/stream/{stream_id}/events": { "get": { "description": "Iterate over a stream of events.", - "operationId": "v1.stream.events-get", + "operationId": "v1.stream.events.get", "parameters": [ { "in": "path", "name": "stream_id", "required": true, "schema": { - "type": "string" + "$ref": "#/components/schemas/StreamIdOrUid" }, "style": "simple" }, @@ -27914,61 +27888,6 @@ "Stream" ], "x-codeSamples": [ - { - "label": "JavaScript", - "lang": "JavaScript", - "source": "const eventStreamOut = await svix.stream.eventsGet(\"stream_id\");" - }, - { - "label": "TypeScript", - "lang": "JavaScript", - "source": "const eventStreamOut = await svix.stream.eventsGet(\"stream_id\");" - }, - { - "label": "Python", - "lang": "Python", - "source": "event_stream_out = svix.stream.events_get(\"stream_id\")" - }, - { - "label": "Python (Async)", - "lang": "Python", - "source": "event_stream_out = await svix.stream.events_get(\"stream_id\")" - }, - { - "label": "Go", - "lang": "Go", - "source": "eventStreamOut, err := svixClient.Stream.EventsGet(ctx, \"stream_id\")" - }, - { - "label": "Kotlin", - "lang": "Kotlin", - "source": "val eventStreamOut = svix.stream.eventsGet(\"stream_id\")" - }, - { - "label": "Java", - "lang": "Java", - "source": "EventStreamOut eventStreamOut = svix.getStream().eventsGet(\"stream_id\");" - }, - { - "label": "Ruby", - "lang": "Ruby", - "source": "event_stream_out = svix.stream.events_get(\"stream_id\")" - }, - { - "label": "Rust", - "lang": "Rust", - "source": "let event_stream_out = svix.stream().events_get(\"stream_id\").await?;" - }, - { - "label": "C#", - "lang": "C#", - "source": "var eventStreamOut = await svix.Stream.EventsGetAsync(\"stream_id\");" - }, - { - "label": "CLI", - "lang": "Shell", - "source": "svix stream events-get \"stream_id\"" - }, { "label": "cURL", "lang": "Shell", @@ -27978,14 +27897,14 @@ }, "post": { "description": "Creates events on the Stream.", - "operationId": "v1.stream.create-events", + "operationId": "v1.stream.events.create", "parameters": [ { "in": "path", "name": "stream_id", "required": true, "schema": { - "type": "string" + "$ref": "#/components/schemas/StreamIdOrUid" }, "style": "simple" }, @@ -28101,61 +28020,6 @@ "Stream" ], "x-codeSamples": [ - { - "label": "JavaScript", - "lang": "JavaScript", - "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 stream: null\n});" - }, - { - "label": "Python", - "lang": "Python", - "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 stream=None\n), options=...)" - }, - { - "label": "Go", - "lang": "Go", - "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 .stream(null)\n)" - }, - { - "label": "Java", - "lang": "Java", - "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 \"stream\": nil\n}))" - }, - { - "label": "Rust", - "lang": "Rust", - "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 stream: null\n});" - }, - { - "label": "CLI", - "lang": "Shell", - "source": "svix stream create-events \"stream_id\" '{\n \"stream\": null\n}'" - }, { "label": "cURL", "lang": "Shell", @@ -30076,6 +29940,47 @@ } ], "x-webhooks": { + "background_task.finished": { + "post": { + "description": "Sent when a background task is finished.", + "operationId": "background_task.finished", + "requestBody": { + "content": { + "application/json": { + "example": { + "data": { + "data": { + "appStats": [ + { + "appId": "app_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "appUid": null, + "messageDestinations": 343 + } + ] + }, + "status": "finished", + "task": "application.stats", + "taskId": "qtask_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "type": "background_task.finished" + }, + "schema": { + "$ref": "#/components/schemas/BackgroundTaskFinishedEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2XX status to indicate that the data was received successfully" + } + }, + "summary": "background_task.finished", + "tags": [ + "Webhook" + ] + } + }, "endpoint.created": { "post": { "description": "Sent when an endpoint is created.", @@ -30144,7 +30049,7 @@ }, "endpoint.disabled": { "post": { - "description": "Sent when an endpoint has been automatically disabled after continuous failures.", + "description": "Sent when an endpoint has been automatically disabled after continuous failures, or manually via an API call.", "operationId": "endpoint.disabled", "requestBody": { "content": { @@ -30155,7 +30060,8 @@ "appUid": "unique-app-identifier", "endpointId": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2", "endpointUid": "unique-endpoint-identifier", - "failSince": "2022-11-06T15:04:05Z" + "failSince": "2022-11-06T15:04:05Z", + "trigger": "automatic" }, "type": "endpoint.disabled" }, @@ -30176,6 +30082,39 @@ ] } }, + "endpoint.enabled": { + "post": { + "description": "Sent when an endpoint has been enabled.", + "operationId": "endpoint.enabled", + "requestBody": { + "content": { + "application/json": { + "example": { + "data": { + "appId": "app_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "appUid": "unique-app-identifier", + "endpointId": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "endpointUid": "unique-endpoint-identifier" + }, + "type": "endpoint.disabled" + }, + "schema": { + "$ref": "#/components/schemas/EndpointEnabledEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2XX status to indicate that the data was received successfully" + } + }, + "summary": "endpoint.enabled", + "tags": [ + "Webhook" + ] + } + }, "endpoint.updated": { "post": { "description": "Sent when an endpoint is updated.", From bb961d342a010f3277d37a89eb7d97baf3f53af5 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Thu, 30 Jan 2025 12:39:03 +0100 Subject: [PATCH 2/7] go: Adjust to changes of the lower-level generated code --- go/background_task.go | 4 ++-- go/message_attempt.go | 35 ++---------------------------- go/operational_webhook_endpoint.go | 14 ++++++------ go/svix.go | 5 +++-- 4 files changed, 14 insertions(+), 44 deletions(-) diff --git a/go/background_task.go b/go/background_task.go index 6211dbb75..c927035aa 100644 --- a/go/background_task.go +++ b/go/background_task.go @@ -29,7 +29,7 @@ func (backgroundTask *BackgroundTask) List( ctx context.Context, options *BackgroundTaskListOptions, ) (*ListResponseBackgroundTaskOut, error) { - req := backgroundTask.api.BackgroundTasksAPI.ListBackgroundTasks( + req := backgroundTask.api.BackgroundTasksAPI.V1BackgroundTaskList( ctx, ) @@ -64,7 +64,7 @@ func (backgroundTask *BackgroundTask) Get( ctx context.Context, taskId string, ) (*BackgroundTaskOut, error) { - req := backgroundTask.api.BackgroundTasksAPI.GetBackgroundTask( + req := backgroundTask.api.BackgroundTasksAPI.V1BackgroundTaskGet( ctx, taskId, ) diff --git a/go/message_attempt.go b/go/message_attempt.go index 88910b311..9b18b12fc 100644 --- a/go/message_attempt.go +++ b/go/message_attempt.go @@ -304,39 +304,8 @@ func (messageAttempt *MessageAttempt) ListAttemptsForEndpoint( endpointId string, options *MessageAttemptListOptions, ) (*ListResponseMessageAttemptEndpointOut, error) { - req := messageAttempt.api.MessageAttemptAPI.V1MessageAttemptListByEndpointDeprecated(ctx, appId, msgId, endpointId) - if options != nil { - if options.Iterator != nil { - req = req.Iterator(*options.Iterator) - } - if options.Limit != nil { - req = req.Limit(*options.Limit) - } - if options.Status != nil { - req = req.Status(openapi.MessageStatus(*options.Status)) - } - if options.EventTypes != nil { - req = req.EventTypes(*options.EventTypes) - } - if options.Before != nil { - req = req.Before(*options.Before) - } - if options.After != nil { - req = req.After(*options.After) - } - if options.Channel != nil { - req = req.Channel(*options.Channel) - } - if options.Tag != nil { - req = req.Tag(*options.Tag) - } - } - ret, res, err := req.Execute() - if err != nil { - return nil, wrapError(err, res) - } - - return ret, nil + options.EndpointId = &endpointId + return messageAttempt.ListByMsg(ctx, appId, msgId, options) } // Resend a message to the specified endpoint. diff --git a/go/operational_webhook_endpoint.go b/go/operational_webhook_endpoint.go index 04ecc50dd..abff85184 100644 --- a/go/operational_webhook_endpoint.go +++ b/go/operational_webhook_endpoint.go @@ -25,7 +25,7 @@ func (operationalWebhookEndpoint *OperationalWebhookEndpoint) List( ctx context.Context, options *OperationalWebhookEndpointListOptions, ) (*ListResponseOperationalWebhookEndpointOut, error) { - req := operationalWebhookEndpoint.api.WebhookEndpointAPI.ListOperationalWebhookEndpoints( + req := operationalWebhookEndpoint.api.WebhookEndpointAPI.V1OperationalWebhookEndpointList( ctx, ) @@ -67,7 +67,7 @@ func (operationalWebhookEndpoint *OperationalWebhookEndpoint) CreateWithOptions( operationalWebhookEndpointIn *OperationalWebhookEndpointIn, options *PostOptions, ) (*OperationalWebhookEndpointOut, error) { - req := operationalWebhookEndpoint.api.WebhookEndpointAPI.CreateOperationalWebhookEndpoint( + req := operationalWebhookEndpoint.api.WebhookEndpointAPI.V1OperationalWebhookEndpointCreate( ctx, ).OperationalWebhookEndpointIn(*operationalWebhookEndpointIn) @@ -90,7 +90,7 @@ func (operationalWebhookEndpoint *OperationalWebhookEndpoint) Get( ctx context.Context, endpointId string, ) (*OperationalWebhookEndpointOut, error) { - req := operationalWebhookEndpoint.api.WebhookEndpointAPI.GetOperationalWebhookEndpoint( + req := operationalWebhookEndpoint.api.WebhookEndpointAPI.V1OperationalWebhookEndpointGet( ctx, endpointId, ) @@ -109,7 +109,7 @@ func (operationalWebhookEndpoint *OperationalWebhookEndpoint) Update( endpointId string, operationalWebhookEndpointUpdate *OperationalWebhookEndpointUpdate, ) (*OperationalWebhookEndpointOut, error) { - req := operationalWebhookEndpoint.api.WebhookEndpointAPI.UpdateOperationalWebhookEndpoint( + req := operationalWebhookEndpoint.api.WebhookEndpointAPI.V1OperationalWebhookEndpointUpdate( ctx, endpointId, ).OperationalWebhookEndpointUpdate(*operationalWebhookEndpointUpdate) @@ -127,7 +127,7 @@ func (operationalWebhookEndpoint *OperationalWebhookEndpoint) Delete( ctx context.Context, endpointId string, ) error { - req := operationalWebhookEndpoint.api.WebhookEndpointAPI.DeleteOperationalWebhookEndpoint( + req := operationalWebhookEndpoint.api.WebhookEndpointAPI.V1OperationalWebhookEndpointDelete( ctx, endpointId, ) @@ -144,7 +144,7 @@ func (operationalWebhookEndpoint *OperationalWebhookEndpoint) GetSecret( ctx context.Context, endpointId string, ) (*OperationalWebhookEndpointSecretOut, error) { - req := operationalWebhookEndpoint.api.WebhookEndpointAPI.GetOperationalWebhookEndpointSecret( + req := operationalWebhookEndpoint.api.WebhookEndpointAPI.V1OperationalWebhookEndpointGetSecret( ctx, endpointId, ) @@ -180,7 +180,7 @@ func (operationalWebhookEndpoint *OperationalWebhookEndpoint) RotateSecretWithOp operationalWebhookEndpointSecretIn *OperationalWebhookEndpointSecretIn, options *PostOptions, ) error { - req := operationalWebhookEndpoint.api.WebhookEndpointAPI.RotateOperationalWebhookEndpointSecret( + req := operationalWebhookEndpoint.api.WebhookEndpointAPI.V1OperationalWebhookEndpointRotateSecret( ctx, endpointId, ) diff --git a/go/svix.go b/go/svix.go index d57208b03..5de11a869 100644 --- a/go/svix.go +++ b/go/svix.go @@ -74,7 +74,6 @@ type ( ListResponseEndpointOut = openapi.ListResponseEndpointOut ListResponseEventTypeOut = openapi.ListResponseEventTypeOut ListResponseIntegrationOut = openapi.ListResponseIntegrationOut - ListResponseMessageAttemptEndpointOut = openapi.ListResponseMessageAttemptEndpointOut ListResponseMessageAttemptOut = openapi.ListResponseMessageAttemptOut ListResponseMessageEndpointOut = openapi.ListResponseMessageEndpointOut ListResponseMessageOut = openapi.ListResponseMessageOut @@ -97,8 +96,10 @@ type ( ReplayOut = openapi.ReplayOut StatusCodeClass = openapi.StatusCodeClass - // Deprecated: Use EndpointGetStatsOptions directly + // Deprecated: Use EndpointGetStatsOptions EndpointStatsOptions = EndpointGetStatsOptions + // Deprecated: Use ListResponseMessageAttemptOut + ListResponseMessageAttemptEndpointOut = openapi.ListResponseMessageAttemptOut ) var defaultHTTPClient = &http.Client{ From fc4cea06b2c71e111912d75ffa849630fa4059c5 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Thu, 30 Jan 2025 13:10:01 +0100 Subject: [PATCH 3/7] java: Adjust to changes of the lower-level generated code --- .../main/java/com/svix/BackgroundTask.java | 4 +-- .../main/java/com/svix/MessageAttempt.java | 25 ++++--------------- .../com/svix/OperationalWebhookEndpoint.java | 14 +++++------ 3 files changed, 14 insertions(+), 29 deletions(-) diff --git a/java/lib/src/main/java/com/svix/BackgroundTask.java b/java/lib/src/main/java/com/svix/BackgroundTask.java index 96bef1d58..4e0694fe4 100644 --- a/java/lib/src/main/java/com/svix/BackgroundTask.java +++ b/java/lib/src/main/java/com/svix/BackgroundTask.java @@ -15,7 +15,7 @@ public final class BackgroundTask { public ListResponseBackgroundTaskOut list(final BackgroundTaskListOptions options) throws ApiException { try { - return api.listBackgroundTasks(options.getStatus(), options.getTask(), options.getLimit(), + return api.v1BackgroundTaskList(options.getStatus(), options.getTask(), options.getLimit(), options.getIterator(), options.getOrder()); } catch (com.svix.internal.ApiException e) { @@ -25,7 +25,7 @@ public ListResponseBackgroundTaskOut list(final BackgroundTaskListOptions option public BackgroundTaskOut get(final String taskId) throws ApiException { try { - return api.getBackgroundTask(taskId); + return api.v1BackgroundTaskGet(taskId); } catch (com.svix.internal.ApiException e) { throw Utils.wrapInternalApiException(e); } diff --git a/java/lib/src/main/java/com/svix/MessageAttempt.java b/java/lib/src/main/java/com/svix/MessageAttempt.java index 546c64028..97fc73142 100644 --- a/java/lib/src/main/java/com/svix/MessageAttempt.java +++ b/java/lib/src/main/java/com/svix/MessageAttempt.java @@ -19,8 +19,8 @@ public final class MessageAttempt { } /* - * @deprecated: use listByMsg or listByEndpoint instead - */ + * @deprecated: use listByMsg or listByEndpoint instead + */ @Deprecated public ListResponseMessageAttemptOut list(final String appId, final String msgId, final MessageAttemptListOptions options) throws ApiException { return this.listByMsg(appId, msgId, options); @@ -122,25 +122,10 @@ public ListResponseMessageEndpointOut listAttemptedDestinations(final String app * @deprecated: use listByMsg instead, passing the endpoint ID through options */ @Deprecated - public ListResponseMessageAttemptEndpointOut listAttemptsForEndpoint(final String appId, final String msgId, final String endpointId, + public ListResponseMessageAttemptOut listAttemptsForEndpoint(final String appId, final String msgId, final String endpointId, final MessageAttemptListOptions options) throws ApiException { - try { - return api.v1MessageAttemptListByEndpointDeprecated( - appId, - msgId, - endpointId, - options.getLimit(), - options.getIterator(), - options.getChannel(), - options.getTag(), - options.getMessageStatus(), - options.getBefore(), - options.getAfter(), - new HashSet<>(options.getEventTypes()) - ); - } catch (com.svix.internal.ApiException e) { - throw Utils.wrapInternalApiException(e); - } + options.setEndpointId(endpointId); + return listByMsg(appId, msgId, options); } public void expungeContent(final String appId, final String msgId, final String attemptId) throws ApiException { diff --git a/java/lib/src/main/java/com/svix/OperationalWebhookEndpoint.java b/java/lib/src/main/java/com/svix/OperationalWebhookEndpoint.java index eb568caf0..daa978f4c 100644 --- a/java/lib/src/main/java/com/svix/OperationalWebhookEndpoint.java +++ b/java/lib/src/main/java/com/svix/OperationalWebhookEndpoint.java @@ -19,7 +19,7 @@ public OperationalWebhookEndpoint(ApiClient apiClient) { public ListResponseOperationalWebhookEndpointOut list(final OperationalWebhookEndpointListOptions options) throws ApiException { try { - return api.listOperationalWebhookEndpoints(options.getLimit(), options.getIterator(), options.getOrder()); + return api.v1OperationalWebhookEndpointList(options.getLimit(), options.getIterator(), options.getOrder()); } catch (com.svix.internal.ApiException e) { throw Utils.wrapInternalApiException(e); } @@ -32,7 +32,7 @@ public OperationalWebhookEndpointOut create(final OperationalWebhookEndpointIn e public OperationalWebhookEndpointOut create(final OperationalWebhookEndpointIn endpointIn, final PostOptions options) throws ApiException { try { - return api.createOperationalWebhookEndpoint(endpointIn, options.getIdempotencyKey()); + return api.v1OperationalWebhookEndpointCreate(endpointIn, options.getIdempotencyKey()); } catch (com.svix.internal.ApiException e) { throw Utils.wrapInternalApiException(e); } @@ -40,7 +40,7 @@ public OperationalWebhookEndpointOut create(final OperationalWebhookEndpointIn e public OperationalWebhookEndpointOut get(final String endpointId) throws ApiException { try { - return api.getOperationalWebhookEndpoint(endpointId); + return api.v1OperationalWebhookEndpointGet(endpointId); } catch (com.svix.internal.ApiException e) { throw Utils.wrapInternalApiException(e); } @@ -49,7 +49,7 @@ public OperationalWebhookEndpointOut get(final String endpointId) throws ApiExce public OperationalWebhookEndpointOut update(final String endpointId, final OperationalWebhookEndpointUpdate endpointUpdate) throws ApiException { try { - return api.updateOperationalWebhookEndpoint(endpointId, endpointUpdate); + return api.v1OperationalWebhookEndpointUpdate(endpointId, endpointUpdate); } catch (com.svix.internal.ApiException e) { throw Utils.wrapInternalApiException(e); } @@ -57,7 +57,7 @@ public OperationalWebhookEndpointOut update(final String endpointId, final Opera public void delete(final String endpointId) throws ApiException { try { - api.deleteOperationalWebhookEndpoint(endpointId); + api.v1OperationalWebhookEndpointDelete(endpointId); } catch (com.svix.internal.ApiException e) { throw Utils.wrapInternalApiException(e); } @@ -65,7 +65,7 @@ public void delete(final String endpointId) throws ApiException { public OperationalWebhookEndpointSecretOut getSecret(final String endpointId) throws ApiException { try { - return api.getOperationalWebhookEndpointSecret(endpointId); + return api.v1OperationalWebhookEndpointGetSecret(endpointId); } catch (com.svix.internal.ApiException e) { throw Utils.wrapInternalApiException(e); } @@ -79,7 +79,7 @@ public void rotateSecret(final String endpointId, public void rotateSecret(final String endpointId, final OperationalWebhookEndpointSecretIn endpointSecretIn, final PostOptions options) throws ApiException { try { - api.rotateOperationalWebhookEndpointSecret(endpointId, endpointSecretIn, options.getIdempotencyKey()); + api.v1OperationalWebhookEndpointRotateSecret(endpointId, endpointSecretIn, options.getIdempotencyKey()); } catch (com.svix.internal.ApiException e) { throw Utils.wrapInternalApiException(e); } From b05e23691c68b1d8b36d0220b08013d9a1c2962c Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Thu, 30 Jan 2025 13:06:33 +0100 Subject: [PATCH 4/7] kotlin: Adjust to changes of the lower-level generated code --- csharp/Svix/Abstractions/IMessageAttempt.cs | 4 +- kotlin/lib/src/main/kotlin/BackgroundTask.kt | 4 +- kotlin/lib/src/main/kotlin/MessageAttempt.kt | 37 ++++++++----------- .../main/kotlin/OperationalWebhookEndpoint.kt | 14 +++---- 4 files changed, 27 insertions(+), 32 deletions(-) diff --git a/csharp/Svix/Abstractions/IMessageAttempt.cs b/csharp/Svix/Abstractions/IMessageAttempt.cs index 8995d2146..234268c8e 100644 --- a/csharp/Svix/Abstractions/IMessageAttempt.cs +++ b/csharp/Svix/Abstractions/IMessageAttempt.cs @@ -26,10 +26,10 @@ Task ListAttemptedMessagesAsync(string appId, st Task ListAttemptsByMessageAsync(string appId, string messageId, AttemptsByMessageListOptions options = null, string idempotencyKey = default, CancellationToken cancellationToken = default); - ListResponseMessageAttemptEndpointOut ListAttemptsForEndpoint(string appId, string messageId, string endpointId, + ListResponseMessageAttemptOut ListAttemptsForEndpoint(string appId, string messageId, string endpointId, AttemptsByEndpointListOptions options = null, string idempotencyKey = default); - Task ListAttemptsForEndpointAsync(string appId, string messageId, string endpointId, + Task ListAttemptsForEndpointAsync(string appId, string messageId, string endpointId, AttemptsByEndpointListOptions options = null, string idempotencyKey = default, CancellationToken cancellationToken = default); diff --git a/kotlin/lib/src/main/kotlin/BackgroundTask.kt b/kotlin/lib/src/main/kotlin/BackgroundTask.kt index 3dd0b8495..382895647 100644 --- a/kotlin/lib/src/main/kotlin/BackgroundTask.kt +++ b/kotlin/lib/src/main/kotlin/BackgroundTask.kt @@ -40,7 +40,7 @@ class BackgroundTask internal constructor(token: String, options: SvixOptions) { options: BackgroundTaskListOptions = BackgroundTaskListOptions() ): ListResponseBackgroundTaskOut { try { - return api.listBackgroundTasks( + return api.v1BackgroundTaskList( options.status, options.task, options.limit, @@ -54,7 +54,7 @@ class BackgroundTask internal constructor(token: String, options: SvixOptions) { suspend fun get(taskId: String): BackgroundTaskOut { try { - return api.getBackgroundTask(taskId) + return api.v1BackgroundTaskGet(taskId) } catch (e: Exception) { throw ApiException.wrap(e) } diff --git a/kotlin/lib/src/main/kotlin/MessageAttempt.kt b/kotlin/lib/src/main/kotlin/MessageAttempt.kt index 961e1b751..7e9f283fb 100644 --- a/kotlin/lib/src/main/kotlin/MessageAttempt.kt +++ b/kotlin/lib/src/main/kotlin/MessageAttempt.kt @@ -220,8 +220,8 @@ class MessageAttempt internal constructor(token: String, options: SvixOptions) { options.numRetries?.let { api.numRetries = it } } - /** @deprecated use listByMsg or listByEndpoint instead. */ - @Deprecated(message = "use listByMsg or listByEndpoint instead.") + /** @deprecated use listByMsg instead. */ + @Deprecated(message = "use listByMsg instead.") suspend fun list( appId: String, msgId: String, @@ -382,30 +382,25 @@ class MessageAttempt internal constructor(token: String, options: SvixOptions) { } } - @Deprecated(message = "use listByEndpoint instead.") + @Deprecated(message = "use listByMsg instead, passing the endpoint ID through options.") suspend fun listAttemptsForEndpoint( appId: String, endpointId: String, msgId: String, options: MessageAttemptListOptions = MessageAttemptListOptions(), - ): ListResponseMessageAttemptEndpointOut { - return try { - api.v1MessageAttemptListByEndpointDeprecated( - appId, - msgId, - endpointId, - options.limit, - options.iterator, - options.channel, - options.tag, - options.messageStatus, - options.before, - options.after, - HashSet(options.eventTypes), - ) - } catch (e: Exception) { - throw ApiException.wrap(e) - } + ): ListResponseMessageAttemptOut { + val listByMsgOptions = MessageAttemptListByMsgOptions() + listByMsgOptions.limit = options.limit + listByMsgOptions.iterator = options.iterator + listByMsgOptions.channel = options.channel + listByMsgOptions.tag = options.tag + listByMsgOptions.status = options.messageStatus + listByMsgOptions.before = options.before + listByMsgOptions.after = options.after + listByMsgOptions.eventTypes = options.eventTypes + listByMsgOptions.endpointId = endpointId + + return listByMsg(appId, msgId, listByMsgOptions) } /** Resend a message to the specified endpoint. */ diff --git a/kotlin/lib/src/main/kotlin/OperationalWebhookEndpoint.kt b/kotlin/lib/src/main/kotlin/OperationalWebhookEndpoint.kt index 3a25ff9fb..d8def189e 100644 --- a/kotlin/lib/src/main/kotlin/OperationalWebhookEndpoint.kt +++ b/kotlin/lib/src/main/kotlin/OperationalWebhookEndpoint.kt @@ -39,7 +39,7 @@ class OperationalWebhookEndpoint internal constructor(token: String, options: Sv options: OperationalWebhookEndpointListOptions = OperationalWebhookEndpointListOptions() ): ListResponseOperationalWebhookEndpointOut { try { - return api.listOperationalWebhookEndpoints( + return api.v1OperationalWebhookEndpointList( options.limit, options.iterator, options.order, @@ -54,7 +54,7 @@ class OperationalWebhookEndpoint internal constructor(token: String, options: Sv options: PostOptions = PostOptions(), ): OperationalWebhookEndpointOut { try { - return api.createOperationalWebhookEndpoint(endpointIn, options.idempotencyKey) + return api.v1OperationalWebhookEndpointCreate(endpointIn, options.idempotencyKey) } catch (e: Exception) { throw ApiException.wrap(e) } @@ -62,7 +62,7 @@ class OperationalWebhookEndpoint internal constructor(token: String, options: Sv suspend fun get(endpointId: String): OperationalWebhookEndpointOut { try { - return api.getOperationalWebhookEndpoint(endpointId) + return api.v1OperationalWebhookEndpointGet(endpointId) } catch (e: Exception) { throw ApiException.wrap(e) } @@ -73,7 +73,7 @@ class OperationalWebhookEndpoint internal constructor(token: String, options: Sv endpointUpdate: OperationalWebhookEndpointUpdate, ): OperationalWebhookEndpointOut { try { - return api.updateOperationalWebhookEndpoint(endpointId, endpointUpdate) + return api.v1OperationalWebhookEndpointUpdate(endpointId, endpointUpdate) } catch (e: Exception) { throw ApiException.wrap(e) } @@ -81,7 +81,7 @@ class OperationalWebhookEndpoint internal constructor(token: String, options: Sv suspend fun delete(endpointId: String) { try { - api.deleteOperationalWebhookEndpoint(endpointId) + api.v1OperationalWebhookEndpointDelete(endpointId) } catch (e: Exception) { throw ApiException.wrap(e) } @@ -89,7 +89,7 @@ class OperationalWebhookEndpoint internal constructor(token: String, options: Sv suspend fun getSecret(endpointId: String): OperationalWebhookEndpointSecretOut { try { - return api.getOperationalWebhookEndpointSecret(endpointId) + return api.v1OperationalWebhookEndpointGetSecret(endpointId) } catch (e: Exception) { throw ApiException.wrap(e) } @@ -101,7 +101,7 @@ class OperationalWebhookEndpoint internal constructor(token: String, options: Sv options: PostOptions = PostOptions(), ) { try { - api.rotateOperationalWebhookEndpointSecret( + api.v1OperationalWebhookEndpointRotateSecret( endpointId, endpointSecretRotateIn, options.idempotencyKey, From 240885546f2e4fba54fad24c88cff945f2748c37 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Thu, 30 Jan 2025 13:29:27 +0100 Subject: [PATCH 5/7] ruby: Adjust to changes of the lower-level generated code --- ruby/lib/svix/background_tasks_api.rb | 4 ++-- ruby/lib/svix/message_attempt_api.rb | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ruby/lib/svix/background_tasks_api.rb b/ruby/lib/svix/background_tasks_api.rb index 9731f3ec0..a12c5e59a 100644 --- a/ruby/lib/svix/background_tasks_api.rb +++ b/ruby/lib/svix/background_tasks_api.rb @@ -7,11 +7,11 @@ def initialize(api_client) end def list(options = {}) - return @api.list_background_tasks(options) + return @api.v1_background_task_list(options) end def get(task_id, options = {}) - return @api.get_background_task(task_id, options) + return @api.v1_background_task_get(task_id, options) end end end diff --git a/ruby/lib/svix/message_attempt_api.rb b/ruby/lib/svix/message_attempt_api.rb index ec9d6234c..c64add931 100644 --- a/ruby/lib/svix/message_attempt_api.rb +++ b/ruby/lib/svix/message_attempt_api.rb @@ -6,9 +6,9 @@ def initialize(api_client) @api = MessageAttemptApi.new(api_client) end - # DEPRECATED: Please use list_by_msg or list_by_endpoint instead. + # DEPRECATED: Please use list_by_msg instead. def list(app_id, msg_id, options = {}) - warn "[DEPRECATION] `list` is deprecated. Please use `list_by_msg` or `list_by_endpoint` instead." + warn "[DEPRECATION] `list` is deprecated. Please use `list_by_msg` instead." return self.list_by_msg(app_id, msg_id, options) end @@ -36,8 +36,12 @@ def list_attempted_destinations(app_id, msg_id, options = {}) return @api.v1_message_attempt_list_attempted_destinations(app_id, msg_id, options) end + # DEPRECATED: Please use list_by_msg instead. def list_attempts_for_endpoint(app_id, endpoint_id, msg_id, options = {}) - return @api.v1_message_attempt_list_by_endpoint_deprecated(app_id, msg_id, endpoint_id, options) + warn "[DEPRECATION] `list` is deprecated. Please use `list_by_msg` instead, passing the endpoint ID through options." + + options[:'endpoint_id'] = endpoint_id + return self.list_by_msg(app_id, msg_id, options) end def expunge_content(app_id, msg_id, attempt_id) From 26c9065a55d1747765193829b5c4c1960fc4fa4b Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Thu, 30 Jan 2025 13:29:44 +0100 Subject: [PATCH 6/7] ruby: Delete broken operational_webhook_endpoint_api module --- .../svix/operational_webhook_endpoint_api.rb | 37 ------------------- 1 file changed, 37 deletions(-) delete mode 100644 ruby/lib/svix/operational_webhook_endpoint_api.rb diff --git a/ruby/lib/svix/operational_webhook_endpoint_api.rb b/ruby/lib/svix/operational_webhook_endpoint_api.rb deleted file mode 100644 index 7967a2047..000000000 --- a/ruby/lib/svix/operational_webhook_endpoint_api.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -module Svix - class OperationalWebhookEndpointAPI - def initialize(api_client) - @api = OperationalWebhookEndpointApi.new(api_client) - end - - def list(options = {}) - return @api.v1_endpoint_list(options) - end - - def create(endpoint_in, options = {}) - return @api.v1_endpoint_create(endpoint_in, options) - end - - def get(endpoint_id) - return @api.v1_endpoint_get(endpoint_id) - end - - def update(endpoint_id, endpoint_update) - return @api.v1_endpoint_update(endpoint_id, endpoint_update) - end - - def delete(endpoint_id) - return @api.v1_endpoint_delete(endpoint_id) - end - - def get_secret(endpoint_id) - return @api.v1_endpoint_get_secret(endpoint_id) - end - - def rotate_secret(endpoint_id, endpoint_secret_rotate_in, options = {}) - return @api.v1_endpoint_rotate_secret(endpoint_id, endpoint_secret_rotate_in, options) - end - end -end From 54278274491ad7536989d798b0c9c6493753f775 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Thu, 30 Jan 2025 12:59:27 +0100 Subject: [PATCH 7/7] csharp: Adjust to changes of the lower-level generated code --- csharp/Svix/BackgroundTask.cs | 8 +- csharp/Svix/MessageAttempt.cs | 164 +++++++--------------- csharp/Svix/OperationalWebhookEndpoint.cs | 28 ++-- 3 files changed, 70 insertions(+), 130 deletions(-) diff --git a/csharp/Svix/BackgroundTask.cs b/csharp/Svix/BackgroundTask.cs index 8e8b7ccee..dcef6db39 100644 --- a/csharp/Svix/BackgroundTask.cs +++ b/csharp/Svix/BackgroundTask.cs @@ -26,7 +26,7 @@ public BackgroundTaskOut Get(string taskId, string idempotencyKey = default) { try { - var lBackgroundTask = _backgroundTaskApi.GetBackgroundTask(taskId); + var lBackgroundTask = _backgroundTaskApi.V1BackgroundTaskGet(taskId); return lBackgroundTask; } @@ -45,7 +45,7 @@ public async Task GetAsync(string taskId, string idempotencyK { try { - var lBackgroundTask = await _backgroundTaskApi.GetBackgroundTaskAsync(taskId); + var lBackgroundTask = await _backgroundTaskApi.V1BackgroundTaskGetAsync(taskId); return lBackgroundTask; } @@ -64,7 +64,7 @@ public ListResponseBackgroundTaskOut List(BackgroundTaskListOptions options = nu { try { - var lResponse = _backgroundTaskApi.ListBackgroundTasks( + var lResponse = _backgroundTaskApi.V1BackgroundTaskList( options?.Status, options?.Task, options?.Limit, @@ -88,7 +88,7 @@ public async Task ListAsync(BackgroundTaskListOpt { try { - var lResponse = await _backgroundTaskApi.ListBackgroundTasksAsync( + var lResponse = await _backgroundTaskApi.V1BackgroundTaskListAsync( options?.Status, options?.Task, options?.Limit, diff --git a/csharp/Svix/MessageAttempt.cs b/csharp/Svix/MessageAttempt.cs index 9472f5b74..9047f4789 100644 --- a/csharp/Svix/MessageAttempt.cs +++ b/csharp/Svix/MessageAttempt.cs @@ -266,139 +266,79 @@ public async Task ListAttemptsByMessageAsync(stri // Deprecated [Obsolete("Use ListAttemptsByMessage instead, passing the endpoint ID through options")] - public ListResponseMessageAttemptEndpointOut ListAttemptsForEndpoint(string appId, string messageId, + public ListResponseMessageAttemptOut ListAttemptsForEndpoint(string appId, string messageId, string endpointId, AttemptsByEndpointListOptions options = null, string idempotencyKey = default) { - try - { - var lResults = _messageAttemptApi.V1MessageAttemptListByEndpointDeprecated( - appId, - messageId, - endpointId, - options?.Limit, - options?.Iterator, - options?.Channel, - options?.Tag, - (Svix.Model.MessageStatus?)options?.Status, - options?.Before, - options?.After, - options?.EventTypes); - - return lResults; - } - catch (ApiException e) - { - Logger?.LogError(e, $"{nameof(ListAttemptsForEndpoint)} failed"); - - if (Throw) - throw; - - return new ListResponseMessageAttemptEndpointOut(); - } + var listByMessageOptions = new AttemptsByMessageListOptions(); + listByMessageOptions.Limit = options?.Limit; + listByMessageOptions.Iterator = options?.Iterator; + listByMessageOptions.Channel = options?.Channel; + listByMessageOptions.Tag = options?.Tag; + listByMessageOptions.Status = options?.Status; + listByMessageOptions.Before = options?.Before; + listByMessageOptions.After = options?.After; + listByMessageOptions.EventTypes = options?.EventTypes; + listByMessageOptions.EndpointId = endpointId; + + return ListAttemptsByMessage(appId, messageId, listByMessageOptions, idempotencyKey); } // Deprecated [Obsolete("Use ListAttemptsByMessageAsync instead, passing the endpoint ID through options")] - public async Task ListAttemptsForEndpointAsync(string appId, + public async Task ListAttemptsForEndpointAsync(string appId, string messageId, string endpointId, AttemptsByEndpointListOptions options = null, string idempotencyKey = default, CancellationToken cancellationToken = default) { - try - { - var lResults = await _messageAttemptApi.V1MessageAttemptListByEndpointDeprecatedAsync( - appId, - messageId, - endpointId, - options?.Limit, - options?.Iterator, - options?.Channel, - options?.Tag, - (Svix.Model.MessageStatus?)options?.Status, - options?.Before, - options?.After, - options?.EventTypes?.ToList(), - cancellationToken); - - return lResults; - } - catch (ApiException e) - { - Logger?.LogError(e, $"{nameof(ListAttemptsForEndpointAsync)} failed"); - - if (Throw) - throw; - - return new ListResponseMessageAttemptEndpointOut(); - } + var listByMessageOptions = new AttemptsByMessageListOptions(); + listByMessageOptions.Limit = options?.Limit; + listByMessageOptions.Iterator = options?.Iterator; + listByMessageOptions.Channel = options?.Channel; + listByMessageOptions.Tag = options?.Tag; + listByMessageOptions.Status = options?.Status; + listByMessageOptions.Before = options?.Before; + listByMessageOptions.After = options?.After; + listByMessageOptions.EventTypes = options?.EventTypes; + listByMessageOptions.EndpointId = endpointId; + + return await ListAttemptsByMessageAsync(appId, messageId, listByMessageOptions, idempotencyKey); } // Deprecated - [Obsolete("Use ListAttemptsByEndpoint or ListAttemptsByMessage instead")] + [Obsolete("Use ListAttemptsByMessage instead")] public ListResponseMessageAttemptOut ListAttempts(string appId, string messageId, MessageAttemptListOptions options = null, string idempotencyKey = default) { - try - { - var lResults = _messageAttemptApi.V1MessageAttemptListByMsgDeprecated( - appId, - messageId, - options?.Limit, - options?.Iterator, - options?.EndpointId, - options?.Channel, - options?.Tag, - (Svix.Model.MessageStatus?)options?.Status, - options?.Before, - options?.After, - null, - options?.EventTypes); - - return lResults; - } - catch (ApiException e) - { - Logger?.LogError(e, $"{nameof(ListAttempts)} failed"); - - if (Throw) - throw; - - return new ListResponseMessageAttemptOut(); - } + var listByMessageOptions = new AttemptsByMessageListOptions(); + listByMessageOptions.Limit = options?.Limit; + listByMessageOptions.Iterator = options?.Iterator; + listByMessageOptions.EndpointId = options?.EndpointId; + listByMessageOptions.Channel = options?.Channel; + listByMessageOptions.Tag = options?.Tag; + listByMessageOptions.Status = options?.Status; + listByMessageOptions.Before = options?.Before; + listByMessageOptions.After = options?.After; + listByMessageOptions.EventTypes = options?.EventTypes; + + return ListAttemptsByMessage(appId, messageId, listByMessageOptions, idempotencyKey); } // Deprecated - [Obsolete("Use ListAttemptsByEndpointAsync or ListAttemptsByMessageAsync instead")] + [Obsolete("Use ListAttemptsByMessageAsync instead")] public async Task ListAttemptsAsync(string appId, string messageId, MessageAttemptListOptions options = null, string idempotencyKey = default, CancellationToken cancellationToken = default) { - try - { - var lResults = await _messageAttemptApi.V1MessageAttemptListByMsgDeprecatedAsync( - appId, - messageId, - options?.Limit, - options?.Iterator, - options?.EndpointId, - options?.Channel, - options?.Tag, - (Svix.Model.MessageStatus?)options?.Status, - options?.Before, - options?.After, - null, - options?.EventTypes, - cancellationToken); - - return lResults; - } - catch (ApiException e) - { - Logger?.LogError(e, $"{nameof(ListAttemptsAsync)} failed"); - - if (Throw) - throw; - - return new ListResponseMessageAttemptOut(); - } + var listByMessageOptions = new AttemptsByMessageListOptions(); + listByMessageOptions.Limit = options?.Limit; + listByMessageOptions.Iterator = options?.Iterator; + listByMessageOptions.EndpointId = options?.EndpointId; + listByMessageOptions.Channel = options?.Channel; + listByMessageOptions.Tag = options?.Tag; + listByMessageOptions.Status = options?.Status; + listByMessageOptions.Before = options?.Before; + listByMessageOptions.After = options?.After; + listByMessageOptions.EventTypes = options?.EventTypes; + + return await ListAttemptsByMessageAsync(appId, messageId, listByMessageOptions, idempotencyKey); } public ListResponseMessageEndpointOut ListAttemptedDestinations(string appId, string messageId, ListOptions options = null, diff --git a/csharp/Svix/OperationalWebhookEndpoint.cs b/csharp/Svix/OperationalWebhookEndpoint.cs index b73444f1c..872193544 100644 --- a/csharp/Svix/OperationalWebhookEndpoint.cs +++ b/csharp/Svix/OperationalWebhookEndpoint.cs @@ -27,7 +27,7 @@ public OperationalWebhookEndpointOut Create( { try { - var lEndpoint = _opWebhookEndpointApi.CreateOperationalWebhookEndpoint( + var lEndpoint = _opWebhookEndpointApi.V1OperationalWebhookEndpointCreate( endpoint, idempotencyKey); @@ -50,7 +50,7 @@ public async Task CreateAsync( { try { - var lEndpoint = await _opWebhookEndpointApi.CreateOperationalWebhookEndpointAsync( + var lEndpoint = await _opWebhookEndpointApi.V1OperationalWebhookEndpointCreateAsync( endpoint, idempotencyKey, cancellationToken); @@ -72,7 +72,7 @@ public bool Delete(string endpointId, string idempotencyKey = default) { try { - var lResponse = _opWebhookEndpointApi.DeleteOperationalWebhookEndpointWithHttpInfo( + var lResponse = _opWebhookEndpointApi.V1OperationalWebhookEndpointDeleteWithHttpInfo( endpointId); return lResponse.StatusCode == HttpStatusCode.NoContent; @@ -93,7 +93,7 @@ public async Task DeleteAsync(string endpointId, string idempotencyKey = d { try { - var lResponse = await _opWebhookEndpointApi.DeleteOperationalWebhookEndpointWithHttpInfoAsync( + var lResponse = await _opWebhookEndpointApi.V1OperationalWebhookEndpointDeleteWithHttpInfoAsync( endpointId, cancellationToken); @@ -114,7 +114,7 @@ public OperationalWebhookEndpointOut Get(string endpointId, string idempotencyKe { try { - var lEndpoint = _opWebhookEndpointApi.GetOperationalWebhookEndpoint(endpointId); + var lEndpoint = _opWebhookEndpointApi.V1OperationalWebhookEndpointGet(endpointId); return lEndpoint; } catch (ApiException e) @@ -133,7 +133,7 @@ public async Task GetAsync(string endpointId, str { try { - var lEndpoint = await _opWebhookEndpointApi.GetOperationalWebhookEndpointAsync( + var lEndpoint = await _opWebhookEndpointApi.V1OperationalWebhookEndpointGetAsync( endpointId, cancellationToken); @@ -154,7 +154,7 @@ public string GetSecret(string endpointId, string idempotencyKey = default) { try { - var lSecret = _opWebhookEndpointApi.GetOperationalWebhookEndpointSecret( + var lSecret = _opWebhookEndpointApi.V1OperationalWebhookEndpointGetSecret( endpointId); return lSecret?.Key; @@ -175,7 +175,7 @@ public async Task GetSecretAsync(string endpointId, string idempotencyKe { try { - var lSecret = await _opWebhookEndpointApi.GetOperationalWebhookEndpointSecretAsync( + var lSecret = await _opWebhookEndpointApi.V1OperationalWebhookEndpointGetSecretAsync( endpointId, cancellationToken); @@ -197,7 +197,7 @@ public ListResponseOperationalWebhookEndpointOut List(ListOptions options = null { try { - var lEndpoints = _opWebhookEndpointApi.ListOperationalWebhookEndpoints( + var lEndpoints = _opWebhookEndpointApi.V1OperationalWebhookEndpointList( options?.Limit, options?.Iterator, options?.Order); @@ -221,7 +221,7 @@ public async Task ListAsync( { try { - var lEndpoints = await _opWebhookEndpointApi.ListOperationalWebhookEndpointsAsync( + var lEndpoints = await _opWebhookEndpointApi.V1OperationalWebhookEndpointListAsync( options?.Limit, options?.Iterator, options?.Order, @@ -244,7 +244,7 @@ public bool RotateSecret(string endpointId, OperationalWebhookEndpointSecretIn s { try { - var lResponse = _opWebhookEndpointApi.RotateOperationalWebhookEndpointSecretWithHttpInfo( + var lResponse = _opWebhookEndpointApi.V1OperationalWebhookEndpointRotateSecretWithHttpInfo( endpointId, secret, idempotencyKey); @@ -267,7 +267,7 @@ public async Task RotateSecretAsync(string endpointId, OperationalWebhookE { try { - var lResponse = await _opWebhookEndpointApi.RotateOperationalWebhookEndpointSecretWithHttpInfoAsync( + var lResponse = await _opWebhookEndpointApi.V1OperationalWebhookEndpointRotateSecretWithHttpInfoAsync( endpointId, secret, idempotencyKey); @@ -290,7 +290,7 @@ public OperationalWebhookEndpointOut Update(string endpointId, { try { - var lEndpoint = _opWebhookEndpointApi.UpdateOperationalWebhookEndpoint( + var lEndpoint = _opWebhookEndpointApi.V1OperationalWebhookEndpointUpdate( endpointId, endpoint); @@ -313,7 +313,7 @@ public async Task UpdateAsync(string endpointId, { try { - var lEndpoint = await _opWebhookEndpointApi.UpdateOperationalWebhookEndpointAsync( + var lEndpoint = await _opWebhookEndpointApi.V1OperationalWebhookEndpointUpdateAsync( endpointId, endpoint, cancellationToken);