From a5314fa3005dfd239454e54c9d0eb0f9daee0064 Mon Sep 17 00:00:00 2001 From: svix-lucho Date: Tue, 26 Dec 2023 15:02:02 -0300 Subject: [PATCH] Update OpenAPI spec and regenerate libs --- go/internal/openapi/api_environment.go | 354 ++++- ...nvironment_settings.go => api_generate.go} | 54 +- go/internal/openapi/api_inbound.go | 421 +++++ go/internal/openapi/api_message.go | 229 +++ .../openapi/api_transformation_template.go | 189 +++ go/internal/openapi/client.go | 6 +- .../openapi/model_completion_choice.go | 166 ++ .../openapi/model_completion_message.go | 137 ++ .../openapi/model_completion_response.go | 224 +++ .../openapi/model_custom_color_palette.go | 222 ++- .../openapi/model_environment_settings_out.go | 32 +- go/internal/openapi/model_generate_in.go | 108 ++ go/internal/openapi/model_generate_out.go | 224 +++ .../openapi/model_inbound_path_params.go | 138 ++ .../openapi/model_message_stream_out.go | 166 ++ go/internal/openapi/model_open_aiin.go | 108 ++ go/internal/openapi/model_rotated_url_out.go | 108 ++ go/internal/openapi/model_settings_in.go | 32 +- go/internal/openapi/model_settings_out.go | 32 +- openapi.json | 1363 +++++++++++++++-- 20 files changed, 3954 insertions(+), 359 deletions(-) rename go/internal/openapi/{api_environment_settings.go => api_generate.go} (76%) create mode 100644 go/internal/openapi/api_inbound.go create mode 100644 go/internal/openapi/model_completion_choice.go create mode 100644 go/internal/openapi/model_completion_message.go create mode 100644 go/internal/openapi/model_completion_response.go create mode 100644 go/internal/openapi/model_generate_in.go create mode 100644 go/internal/openapi/model_generate_out.go create mode 100644 go/internal/openapi/model_inbound_path_params.go create mode 100644 go/internal/openapi/model_message_stream_out.go create mode 100644 go/internal/openapi/model_open_aiin.go create mode 100644 go/internal/openapi/model_rotated_url_out.go diff --git a/go/internal/openapi/api_environment.go b/go/internal/openapi/api_environment.go index 3d22014d5..bac49c925 100644 --- a/go/internal/openapi/api_environment.go +++ b/go/internal/openapi/api_environment.go @@ -29,14 +29,9 @@ type EnvironmentApiService service type ApiV1EnvironmentExportRequest struct { ctx _context.Context ApiService *EnvironmentApiService - body *map[string]interface{} idempotencyKey *string } -func (r ApiV1EnvironmentExportRequest) Body(body map[string]interface{}) ApiV1EnvironmentExportRequest { - r.body = &body - return r -} func (r ApiV1EnvironmentExportRequest) IdempotencyKey(idempotencyKey string) ApiV1EnvironmentExportRequest { r.idempotencyKey = &idempotencyKey return r @@ -83,12 +78,9 @@ func (a *EnvironmentApiService) V1EnvironmentExportExecute(r ApiV1EnvironmentExp localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.body == nil { - return localVarReturnValue, nil, reportError("body is required and must be specified") - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -107,8 +99,348 @@ func (a *EnvironmentApiService) V1EnvironmentExportExecute(r ApiV1EnvironmentExp if r.idempotencyKey != nil { localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") } - // body params - localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.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.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.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.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.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.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.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.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 ApiV1EnvironmentExportGetRequest struct { + ctx _context.Context + ApiService *EnvironmentApiService +} + + +func (r ApiV1EnvironmentExportGetRequest) Execute() (EnvironmentOut, *_nethttp.Response, error) { + return r.ApiService.V1EnvironmentExportGetExecute(r) +} + +/* + * V1EnvironmentExportGet Export Environment Configuration + * Download a JSON file containing all org-settings and event types + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiV1EnvironmentExportGetRequest + */ +func (a *EnvironmentApiService) V1EnvironmentExportGet(ctx _context.Context) ApiV1EnvironmentExportGetRequest { + return ApiV1EnvironmentExportGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return EnvironmentOut + */ +func (a *EnvironmentApiService) V1EnvironmentExportGetExecute(r ApiV1EnvironmentExportGetRequest) (EnvironmentOut, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue EnvironmentOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnvironmentApiService.V1EnvironmentExportGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/environment/export/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // 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, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.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.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.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.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.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.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.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.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 ApiV1EnvironmentGetSettingsRequest struct { + ctx _context.Context + ApiService *EnvironmentApiService +} + + +func (r ApiV1EnvironmentGetSettingsRequest) Execute() (EnvironmentSettingsOut, *_nethttp.Response, error) { + return r.ApiService.V1EnvironmentGetSettingsExecute(r) +} + +/* + * V1EnvironmentGetSettings Get Org Settings + * Get the environment's settings + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiV1EnvironmentGetSettingsRequest + */ +func (a *EnvironmentApiService) V1EnvironmentGetSettings(ctx _context.Context) ApiV1EnvironmentGetSettingsRequest { + return ApiV1EnvironmentGetSettingsRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return EnvironmentSettingsOut + */ +func (a *EnvironmentApiService) V1EnvironmentGetSettingsExecute(r ApiV1EnvironmentGetSettingsRequest) (EnvironmentSettingsOut, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue EnvironmentSettingsOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnvironmentApiService.V1EnvironmentGetSettings") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/environment/settings/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // 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, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err diff --git a/go/internal/openapi/api_environment_settings.go b/go/internal/openapi/api_generate.go similarity index 76% rename from go/internal/openapi/api_environment_settings.go rename to go/internal/openapi/api_generate.go index 5f8575325..808b3da09 100644 --- a/go/internal/openapi/api_environment_settings.go +++ b/go/internal/openapi/api_generate.go @@ -23,27 +23,37 @@ var ( _ _context.Context ) -// EnvironmentSettingsApiService EnvironmentSettingsApi service -type EnvironmentSettingsApiService service +// GenerateApiService GenerateApi service +type GenerateApiService service -type ApiV1EnvironmentGetSettingsRequest struct { +type ApiV1GenerateGenTransformationRequest struct { ctx _context.Context - ApiService *EnvironmentSettingsApiService + ApiService *GenerateApiService + openAIIn *OpenAIIn + idempotencyKey *string } +func (r ApiV1GenerateGenTransformationRequest) OpenAIIn(openAIIn OpenAIIn) ApiV1GenerateGenTransformationRequest { + r.openAIIn = &openAIIn + return r +} +func (r ApiV1GenerateGenTransformationRequest) IdempotencyKey(idempotencyKey string) ApiV1GenerateGenTransformationRequest { + r.idempotencyKey = &idempotencyKey + return r +} -func (r ApiV1EnvironmentGetSettingsRequest) Execute() (EnvironmentSettingsOut, *_nethttp.Response, error) { - return r.ApiService.V1EnvironmentGetSettingsExecute(r) +func (r ApiV1GenerateGenTransformationRequest) Execute() (interface{}, *_nethttp.Response, error) { + return r.ApiService.V1GenerateGenTransformationExecute(r) } /* - * V1EnvironmentGetSettings Get Org Settings - * Get the environment's settings + * V1GenerateGenTransformation Generate + * stop bothering me * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiV1EnvironmentGetSettingsRequest + * @return ApiV1GenerateGenTransformationRequest */ -func (a *EnvironmentSettingsApiService) V1EnvironmentGetSettings(ctx _context.Context) ApiV1EnvironmentGetSettingsRequest { - return ApiV1EnvironmentGetSettingsRequest{ +func (a *GenerateApiService) V1GenerateGenTransformation(ctx _context.Context) ApiV1GenerateGenTransformationRequest { + return ApiV1GenerateGenTransformationRequest{ ApiService: a, ctx: ctx, } @@ -51,31 +61,34 @@ func (a *EnvironmentSettingsApiService) V1EnvironmentGetSettings(ctx _context.Co /* * Execute executes the request - * @return EnvironmentSettingsOut + * @return interface{} */ -func (a *EnvironmentSettingsApiService) V1EnvironmentGetSettingsExecute(r ApiV1EnvironmentGetSettingsRequest) (EnvironmentSettingsOut, *_nethttp.Response, error) { +func (a *GenerateApiService) V1GenerateGenTransformationExecute(r ApiV1GenerateGenTransformationRequest) (interface{}, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue EnvironmentSettingsOut + localVarReturnValue interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnvironmentSettingsApiService.V1EnvironmentGetSettings") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GenerateApiService.V1GenerateGenTransformation") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/v1/environment/settings/" + localVarPath := localBasePath + "/api/v1/generate-transformation/" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.openAIIn == nil { + return localVarReturnValue, nil, reportError("openAIIn 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) @@ -91,6 +104,11 @@ func (a *EnvironmentSettingsApiService) V1EnvironmentGetSettingsExecute(r ApiV1E if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.idempotencyKey != nil { + localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + } + // body params + localVarPostBody = r.openAIIn req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err diff --git a/go/internal/openapi/api_inbound.go b/go/internal/openapi/api_inbound.go new file mode 100644 index 000000000..fb8558db0 --- /dev/null +++ b/go/internal/openapi/api_inbound.go @@ -0,0 +1,421 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "bytes" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +// InboundApiService InboundApi service +type InboundApiService service + +type ApiV1InboundMsgRequest struct { + ctx _context.Context + ApiService *InboundApiService + appId string + inboundToken string + body *string + idempotencyKey *string +} + +func (r ApiV1InboundMsgRequest) Body(body string) ApiV1InboundMsgRequest { + r.body = &body + return r +} +func (r ApiV1InboundMsgRequest) IdempotencyKey(idempotencyKey string) ApiV1InboundMsgRequest { + r.idempotencyKey = &idempotencyKey + return r +} + +func (r ApiV1InboundMsgRequest) Execute() (MessageOut, *_nethttp.Response, error) { + return r.ApiService.V1InboundMsgExecute(r) +} + +/* + * V1InboundMsg Handle Inbound + * Handles a raw inbound webhook for the application + * @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 inboundToken + * @return ApiV1InboundMsgRequest + */ +func (a *InboundApiService) V1InboundMsg(ctx _context.Context, appId string, inboundToken string) ApiV1InboundMsgRequest { + return ApiV1InboundMsgRequest{ + ApiService: a, + ctx: ctx, + appId: appId, + inboundToken: inboundToken, + } +} + +/* + * Execute executes the request + * @return MessageOut + */ +func (a *InboundApiService) V1InboundMsgExecute(r ApiV1InboundMsgRequest) (MessageOut, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue MessageOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InboundApiService.V1InboundMsg") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/app/{app_id}/inbound/msg/{inbound_token}/" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"inbound_token"+"}", _neturl.PathEscape(parameterToString(r.inboundToken, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.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 r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"text/plain; charset=utf-8"} + + // 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 { + localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + } + // body params + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.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.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.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.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.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.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.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.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 ApiV1InboundRotateUrlRequest struct { + ctx _context.Context + ApiService *InboundApiService + appId string + idempotencyKey *string +} + +func (r ApiV1InboundRotateUrlRequest) IdempotencyKey(idempotencyKey string) ApiV1InboundRotateUrlRequest { + r.idempotencyKey = &idempotencyKey + return r +} + +func (r ApiV1InboundRotateUrlRequest) Execute() (RotatedUrlOut, *_nethttp.Response, error) { + return r.ApiService.V1InboundRotateUrlExecute(r) +} + +/* + * V1InboundRotateUrl Rotate Url + * Invalidates the previous inbound url (if one exists), producing a new inbound +URL for this app + * @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 ApiV1InboundRotateUrlRequest + */ +func (a *InboundApiService) V1InboundRotateUrl(ctx _context.Context, appId string) ApiV1InboundRotateUrlRequest { + return ApiV1InboundRotateUrlRequest{ + ApiService: a, + ctx: ctx, + appId: appId, + } +} + +/* + * Execute executes the request + * @return RotatedUrlOut + */ +func (a *InboundApiService) V1InboundRotateUrlExecute(r ApiV1InboundRotateUrlRequest) (RotatedUrlOut, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue RotatedUrlOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InboundApiService.V1InboundRotateUrl") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/app/{app_id}/inbound/rotate-url/" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.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") + } + + // 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 + } + if r.idempotencyKey != nil { + localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.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.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.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.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.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.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.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.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_message.go b/go/internal/openapi/api_message.go index f132d1f81..40eb9a9cd 100644 --- a/go/internal/openapi/api_message.go +++ b/go/internal/openapi/api_message.go @@ -1297,3 +1297,232 @@ func (a *MessageApiService) V1MessageListExecute(r ApiV1MessageListRequest) (Lis return localVarReturnValue, localVarHTTPResponse, nil } + +type ApiV1MessageStreamRequest struct { + ctx _context.Context + ApiService *MessageApiService + appId string + limit *int32 + iterator *string + eventTypes *[]string + channels *[]string +} + +func (r ApiV1MessageStreamRequest) Limit(limit int32) ApiV1MessageStreamRequest { + r.limit = &limit + return r +} +func (r ApiV1MessageStreamRequest) Iterator(iterator string) ApiV1MessageStreamRequest { + r.iterator = &iterator + return r +} +func (r ApiV1MessageStreamRequest) EventTypes(eventTypes []string) ApiV1MessageStreamRequest { + r.eventTypes = &eventTypes + return r +} +func (r ApiV1MessageStreamRequest) Channels(channels []string) ApiV1MessageStreamRequest { + r.channels = &channels + return r +} + +func (r ApiV1MessageStreamRequest) Execute() (MessageStreamOut, *_nethttp.Response, error) { + return r.ApiService.V1MessageStreamExecute(r) +} + +/* + * V1MessageStream Stream Events + * Reads the stream of created messages for an application + * @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 ApiV1MessageStreamRequest + */ +func (a *MessageApiService) V1MessageStream(ctx _context.Context, appId string) ApiV1MessageStreamRequest { + return ApiV1MessageStreamRequest{ + ApiService: a, + ctx: ctx, + appId: appId, + } +} + +/* + * Execute executes the request + * @return MessageStreamOut + */ +func (a *MessageApiService) V1MessageStreamExecute(r ApiV1MessageStreamRequest) (MessageStreamOut, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue MessageStreamOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageApiService.V1MessageStream") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/app/{app_id}/events/" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.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 r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } + if r.iterator != nil { + localVarQueryParams.Add("iterator", parameterToString(*r.iterator, "")) + } + 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++ { + localVarQueryParams.Add("event_types", parameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("event_types", parameterToString(t, "multi")) + } + } + if r.channels != nil { + t := *r.channels + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("channels", parameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("channels", parameterToString(t, "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, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.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.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.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.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.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.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.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.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_transformation_template.go b/go/internal/openapi/api_transformation_template.go index a2e3b4ade..7f1ffde5b 100644 --- a/go/internal/openapi/api_transformation_template.go +++ b/go/internal/openapi/api_transformation_template.go @@ -380,6 +380,195 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateDeleteExecute return localVarHTTPResponse, nil } +type ApiV1TransformationTemplateGenerateRequest struct { + ctx _context.Context + ApiService *TransformationTemplateApiService + generateIn *GenerateIn + idempotencyKey *string +} + +func (r ApiV1TransformationTemplateGenerateRequest) GenerateIn(generateIn GenerateIn) ApiV1TransformationTemplateGenerateRequest { + r.generateIn = &generateIn + return r +} +func (r ApiV1TransformationTemplateGenerateRequest) IdempotencyKey(idempotencyKey string) ApiV1TransformationTemplateGenerateRequest { + r.idempotencyKey = &idempotencyKey + return r +} + +func (r ApiV1TransformationTemplateGenerateRequest) Execute() (GenerateOut, *_nethttp.Response, error) { + return r.ApiService.V1TransformationTemplateGenerateExecute(r) +} + +/* + * V1TransformationTemplateGenerate Generate + * Use OpenAI's Completion API to generate code for a transformation template + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiV1TransformationTemplateGenerateRequest + */ +func (a *TransformationTemplateApiService) V1TransformationTemplateGenerate(ctx _context.Context) ApiV1TransformationTemplateGenerateRequest { + return ApiV1TransformationTemplateGenerateRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return GenerateOut + */ +func (a *TransformationTemplateApiService) V1TransformationTemplateGenerateExecute(r ApiV1TransformationTemplateGenerateRequest) (GenerateOut, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue GenerateOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransformationTemplateApiService.V1TransformationTemplateGenerate") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/transformation-template/generate" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.generateIn == nil { + return localVarReturnValue, nil, reportError("generateIn 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 { + localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + } + // body params + localVarPostBody = r.generateIn + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.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.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.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.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.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.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.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.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 ApiV1TransformationTemplateGetRequest struct { ctx _context.Context ApiService *TransformationTemplateApiService diff --git a/go/internal/openapi/client.go b/go/internal/openapi/client.go index ad5ef2f2e..939d5fdd7 100644 --- a/go/internal/openapi/client.go +++ b/go/internal/openapi/client.go @@ -64,12 +64,12 @@ type APIClient struct { EnvironmentApi *EnvironmentApiService - EnvironmentSettingsApi *EnvironmentSettingsApiService - EventTypeApi *EventTypeApiService HealthApi *HealthApiService + InboundApi *InboundApiService + IntegrationApi *IntegrationApiService MessageApi *MessageApiService @@ -103,9 +103,9 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.BroadcastApi = (*BroadcastApiService)(&c.common) c.EndpointApi = (*EndpointApiService)(&c.common) c.EnvironmentApi = (*EnvironmentApiService)(&c.common) - c.EnvironmentSettingsApi = (*EnvironmentSettingsApiService)(&c.common) c.EventTypeApi = (*EventTypeApiService)(&c.common) c.HealthApi = (*HealthApiService)(&c.common) + c.InboundApi = (*InboundApiService)(&c.common) c.IntegrationApi = (*IntegrationApiService)(&c.common) c.MessageApi = (*MessageApiService)(&c.common) c.MessageAttemptApi = (*MessageAttemptApiService)(&c.common) diff --git a/go/internal/openapi/model_completion_choice.go b/go/internal/openapi/model_completion_choice.go new file mode 100644 index 000000000..a372473da --- /dev/null +++ b/go/internal/openapi/model_completion_choice.go @@ -0,0 +1,166 @@ +/* + * 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" +) + +// CompletionChoice struct for CompletionChoice +type CompletionChoice struct { + FinishReason string `json:"finish_reason"` + Index int64 `json:"index"` + Message CompletionMessage `json:"message"` +} + +// NewCompletionChoice instantiates a new CompletionChoice 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 NewCompletionChoice(finishReason string, index int64, message CompletionMessage) *CompletionChoice { + this := CompletionChoice{} + this.FinishReason = finishReason + this.Index = index + this.Message = message + return &this +} + +// NewCompletionChoiceWithDefaults instantiates a new CompletionChoice 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 NewCompletionChoiceWithDefaults() *CompletionChoice { + this := CompletionChoice{} + return &this +} + +// GetFinishReason returns the FinishReason field value +func (o *CompletionChoice) GetFinishReason() string { + if o == nil { + var ret string + return ret + } + + return o.FinishReason +} + +// GetFinishReasonOk returns a tuple with the FinishReason field value +// and a boolean to check if the value has been set. +func (o *CompletionChoice) GetFinishReasonOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FinishReason, true +} + +// SetFinishReason sets field value +func (o *CompletionChoice) SetFinishReason(v string) { + o.FinishReason = v +} + +// GetIndex returns the Index field value +func (o *CompletionChoice) GetIndex() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Index +} + +// GetIndexOk returns a tuple with the Index field value +// and a boolean to check if the value has been set. +func (o *CompletionChoice) GetIndexOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Index, true +} + +// SetIndex sets field value +func (o *CompletionChoice) SetIndex(v int64) { + o.Index = v +} + +// GetMessage returns the Message field value +func (o *CompletionChoice) GetMessage() CompletionMessage { + if o == nil { + var ret CompletionMessage + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *CompletionChoice) GetMessageOk() (*CompletionMessage, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *CompletionChoice) SetMessage(v CompletionMessage) { + o.Message = v +} + +func (o CompletionChoice) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["finish_reason"] = o.FinishReason + } + if true { + toSerialize["index"] = o.Index + } + if true { + toSerialize["message"] = o.Message + } + return json.Marshal(toSerialize) +} + +type NullableCompletionChoice struct { + value *CompletionChoice + isSet bool +} + +func (v NullableCompletionChoice) Get() *CompletionChoice { + return v.value +} + +func (v *NullableCompletionChoice) Set(val *CompletionChoice) { + v.value = val + v.isSet = true +} + +func (v NullableCompletionChoice) IsSet() bool { + return v.isSet +} + +func (v *NullableCompletionChoice) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCompletionChoice(val *CompletionChoice) *NullableCompletionChoice { + return &NullableCompletionChoice{value: val, isSet: true} +} + +func (v NullableCompletionChoice) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCompletionChoice) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_completion_message.go b/go/internal/openapi/model_completion_message.go new file mode 100644 index 000000000..37267257e --- /dev/null +++ b/go/internal/openapi/model_completion_message.go @@ -0,0 +1,137 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// CompletionMessage struct for CompletionMessage +type CompletionMessage struct { + Content string `json:"content"` + Role string `json:"role"` +} + +// NewCompletionMessage instantiates a new CompletionMessage 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 NewCompletionMessage(content string, role string) *CompletionMessage { + this := CompletionMessage{} + this.Content = content + this.Role = role + return &this +} + +// NewCompletionMessageWithDefaults instantiates a new CompletionMessage 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 NewCompletionMessageWithDefaults() *CompletionMessage { + this := CompletionMessage{} + return &this +} + +// GetContent returns the Content field value +func (o *CompletionMessage) GetContent() string { + if o == nil { + var ret string + return ret + } + + return o.Content +} + +// GetContentOk returns a tuple with the Content field value +// and a boolean to check if the value has been set. +func (o *CompletionMessage) GetContentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Content, true +} + +// SetContent sets field value +func (o *CompletionMessage) SetContent(v string) { + o.Content = v +} + +// GetRole returns the Role field value +func (o *CompletionMessage) GetRole() string { + if o == nil { + var ret string + return ret + } + + return o.Role +} + +// GetRoleOk returns a tuple with the Role field value +// and a boolean to check if the value has been set. +func (o *CompletionMessage) GetRoleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Role, true +} + +// SetRole sets field value +func (o *CompletionMessage) SetRole(v string) { + o.Role = v +} + +func (o CompletionMessage) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["content"] = o.Content + } + if true { + toSerialize["role"] = o.Role + } + return json.Marshal(toSerialize) +} + +type NullableCompletionMessage struct { + value *CompletionMessage + isSet bool +} + +func (v NullableCompletionMessage) Get() *CompletionMessage { + return v.value +} + +func (v *NullableCompletionMessage) Set(val *CompletionMessage) { + v.value = val + v.isSet = true +} + +func (v NullableCompletionMessage) IsSet() bool { + return v.isSet +} + +func (v *NullableCompletionMessage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCompletionMessage(val *CompletionMessage) *NullableCompletionMessage { + return &NullableCompletionMessage{value: val, isSet: true} +} + +func (v NullableCompletionMessage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCompletionMessage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_completion_response.go b/go/internal/openapi/model_completion_response.go new file mode 100644 index 000000000..2e9f21e24 --- /dev/null +++ b/go/internal/openapi/model_completion_response.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" +) + +// CompletionResponse struct for CompletionResponse +type CompletionResponse struct { + Choices []CompletionChoice `json:"choices"` + Created int64 `json:"created"` + Id string `json:"id"` + Model string `json:"model"` + Object string `json:"object"` +} + +// NewCompletionResponse instantiates a new CompletionResponse 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 NewCompletionResponse(choices []CompletionChoice, created int64, id string, model string, object string) *CompletionResponse { + this := CompletionResponse{} + this.Choices = choices + this.Created = created + this.Id = id + this.Model = model + this.Object = object + return &this +} + +// NewCompletionResponseWithDefaults instantiates a new CompletionResponse 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 NewCompletionResponseWithDefaults() *CompletionResponse { + this := CompletionResponse{} + return &this +} + +// GetChoices returns the Choices field value +func (o *CompletionResponse) GetChoices() []CompletionChoice { + if o == nil { + var ret []CompletionChoice + return ret + } + + return o.Choices +} + +// GetChoicesOk returns a tuple with the Choices field value +// and a boolean to check if the value has been set. +func (o *CompletionResponse) GetChoicesOk() (*[]CompletionChoice, bool) { + if o == nil { + return nil, false + } + return &o.Choices, true +} + +// SetChoices sets field value +func (o *CompletionResponse) SetChoices(v []CompletionChoice) { + o.Choices = v +} + +// GetCreated returns the Created field value +func (o *CompletionResponse) GetCreated() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *CompletionResponse) GetCreatedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *CompletionResponse) SetCreated(v int64) { + o.Created = v +} + +// GetId returns the Id field value +func (o *CompletionResponse) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CompletionResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CompletionResponse) SetId(v string) { + o.Id = v +} + +// GetModel returns the Model field value +func (o *CompletionResponse) GetModel() string { + if o == nil { + var ret string + return ret + } + + return o.Model +} + +// GetModelOk returns a tuple with the Model field value +// and a boolean to check if the value has been set. +func (o *CompletionResponse) GetModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Model, true +} + +// SetModel sets field value +func (o *CompletionResponse) SetModel(v string) { + o.Model = v +} + +// GetObject returns the Object field value +func (o *CompletionResponse) GetObject() string { + if o == nil { + var ret string + return ret + } + + return o.Object +} + +// GetObjectOk returns a tuple with the Object field value +// and a boolean to check if the value has been set. +func (o *CompletionResponse) GetObjectOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Object, true +} + +// SetObject sets field value +func (o *CompletionResponse) SetObject(v string) { + o.Object = v +} + +func (o CompletionResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["choices"] = o.Choices + } + if true { + toSerialize["created"] = o.Created + } + if true { + toSerialize["id"] = o.Id + } + if true { + toSerialize["model"] = o.Model + } + if true { + toSerialize["object"] = o.Object + } + return json.Marshal(toSerialize) +} + +type NullableCompletionResponse struct { + value *CompletionResponse + isSet bool +} + +func (v NullableCompletionResponse) Get() *CompletionResponse { + return v.value +} + +func (v *NullableCompletionResponse) Set(val *CompletionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCompletionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCompletionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCompletionResponse(val *CompletionResponse) *NullableCompletionResponse { + return &NullableCompletionResponse{value: val, isSet: true} +} + +func (v NullableCompletionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCompletionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_custom_color_palette.go b/go/internal/openapi/model_custom_color_palette.go index 5e8b24ff2..7866c75b5 100644 --- a/go/internal/openapi/model_custom_color_palette.go +++ b/go/internal/openapi/model_custom_color_palette.go @@ -16,12 +16,13 @@ import ( // CustomColorPalette struct for CustomColorPalette type CustomColorPalette struct { - BackgroundHover NullableString `json:"backgroundHover,omitempty"` - BackgroundPrimary NullableString `json:"backgroundPrimary,omitempty"` - BackgroundSecondary NullableString `json:"backgroundSecondary,omitempty"` - InteractiveAccent NullableString `json:"interactiveAccent,omitempty"` - TextDanger NullableString `json:"textDanger,omitempty"` - TextPrimary NullableString `json:"textPrimary,omitempty"` + BackgroundHover *string `json:"backgroundHover,omitempty"` + BackgroundPrimary *string `json:"backgroundPrimary,omitempty"` + BackgroundSecondary *string `json:"backgroundSecondary,omitempty"` + InteractiveAccent *string `json:"interactiveAccent,omitempty"` + Primary *string `json:"primary,omitempty"` + TextDanger *string `json:"textDanger,omitempty"` + TextPrimary *string `json:"textPrimary,omitempty"` } // NewCustomColorPalette instantiates a new CustomColorPalette object @@ -41,277 +42,252 @@ func NewCustomColorPaletteWithDefaults() *CustomColorPalette { return &this } -// GetBackgroundHover returns the BackgroundHover field value if set, zero value otherwise (both if not set or set to explicit null). +// GetBackgroundHover returns the BackgroundHover field value if set, zero value otherwise. func (o *CustomColorPalette) GetBackgroundHover() string { - if o == nil || o.BackgroundHover.Get() == nil { + if o == nil || o.BackgroundHover == nil { var ret string return ret } - return *o.BackgroundHover.Get() + return *o.BackgroundHover } // GetBackgroundHoverOk returns a tuple with the BackgroundHover 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 *CustomColorPalette) GetBackgroundHoverOk() (*string, bool) { - if o == nil { + if o == nil || o.BackgroundHover == nil { return nil, false } - return o.BackgroundHover.Get(), o.BackgroundHover.IsSet() + return o.BackgroundHover, true } // HasBackgroundHover returns a boolean if a field has been set. func (o *CustomColorPalette) HasBackgroundHover() bool { - if o != nil && o.BackgroundHover.IsSet() { + if o != nil && o.BackgroundHover != nil { return true } return false } -// SetBackgroundHover gets a reference to the given NullableString and assigns it to the BackgroundHover field. +// SetBackgroundHover gets a reference to the given string and assigns it to the BackgroundHover field. func (o *CustomColorPalette) SetBackgroundHover(v string) { - o.BackgroundHover.Set(&v) -} -// SetBackgroundHoverNil sets the value for BackgroundHover to be an explicit nil -func (o *CustomColorPalette) SetBackgroundHoverNil() { - o.BackgroundHover.Set(nil) -} - -// UnsetBackgroundHover ensures that no value is present for BackgroundHover, not even an explicit nil -func (o *CustomColorPalette) UnsetBackgroundHover() { - o.BackgroundHover.Unset() + o.BackgroundHover = &v } -// GetBackgroundPrimary returns the BackgroundPrimary field value if set, zero value otherwise (both if not set or set to explicit null). +// GetBackgroundPrimary returns the BackgroundPrimary field value if set, zero value otherwise. func (o *CustomColorPalette) GetBackgroundPrimary() string { - if o == nil || o.BackgroundPrimary.Get() == nil { + if o == nil || o.BackgroundPrimary == nil { var ret string return ret } - return *o.BackgroundPrimary.Get() + return *o.BackgroundPrimary } // GetBackgroundPrimaryOk returns a tuple with the BackgroundPrimary 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 *CustomColorPalette) GetBackgroundPrimaryOk() (*string, bool) { - if o == nil { + if o == nil || o.BackgroundPrimary == nil { return nil, false } - return o.BackgroundPrimary.Get(), o.BackgroundPrimary.IsSet() + return o.BackgroundPrimary, true } // HasBackgroundPrimary returns a boolean if a field has been set. func (o *CustomColorPalette) HasBackgroundPrimary() bool { - if o != nil && o.BackgroundPrimary.IsSet() { + if o != nil && o.BackgroundPrimary != nil { return true } return false } -// SetBackgroundPrimary gets a reference to the given NullableString and assigns it to the BackgroundPrimary field. +// SetBackgroundPrimary gets a reference to the given string and assigns it to the BackgroundPrimary field. func (o *CustomColorPalette) SetBackgroundPrimary(v string) { - o.BackgroundPrimary.Set(&v) -} -// SetBackgroundPrimaryNil sets the value for BackgroundPrimary to be an explicit nil -func (o *CustomColorPalette) SetBackgroundPrimaryNil() { - o.BackgroundPrimary.Set(nil) + o.BackgroundPrimary = &v } -// UnsetBackgroundPrimary ensures that no value is present for BackgroundPrimary, not even an explicit nil -func (o *CustomColorPalette) UnsetBackgroundPrimary() { - o.BackgroundPrimary.Unset() -} - -// GetBackgroundSecondary returns the BackgroundSecondary field value if set, zero value otherwise (both if not set or set to explicit null). +// GetBackgroundSecondary returns the BackgroundSecondary field value if set, zero value otherwise. func (o *CustomColorPalette) GetBackgroundSecondary() string { - if o == nil || o.BackgroundSecondary.Get() == nil { + if o == nil || o.BackgroundSecondary == nil { var ret string return ret } - return *o.BackgroundSecondary.Get() + return *o.BackgroundSecondary } // GetBackgroundSecondaryOk returns a tuple with the BackgroundSecondary 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 *CustomColorPalette) GetBackgroundSecondaryOk() (*string, bool) { - if o == nil { + if o == nil || o.BackgroundSecondary == nil { return nil, false } - return o.BackgroundSecondary.Get(), o.BackgroundSecondary.IsSet() + return o.BackgroundSecondary, true } // HasBackgroundSecondary returns a boolean if a field has been set. func (o *CustomColorPalette) HasBackgroundSecondary() bool { - if o != nil && o.BackgroundSecondary.IsSet() { + if o != nil && o.BackgroundSecondary != nil { return true } return false } -// SetBackgroundSecondary gets a reference to the given NullableString and assigns it to the BackgroundSecondary field. +// SetBackgroundSecondary gets a reference to the given string and assigns it to the BackgroundSecondary field. func (o *CustomColorPalette) SetBackgroundSecondary(v string) { - o.BackgroundSecondary.Set(&v) -} -// SetBackgroundSecondaryNil sets the value for BackgroundSecondary to be an explicit nil -func (o *CustomColorPalette) SetBackgroundSecondaryNil() { - o.BackgroundSecondary.Set(nil) -} - -// UnsetBackgroundSecondary ensures that no value is present for BackgroundSecondary, not even an explicit nil -func (o *CustomColorPalette) UnsetBackgroundSecondary() { - o.BackgroundSecondary.Unset() + o.BackgroundSecondary = &v } -// GetInteractiveAccent returns the InteractiveAccent field value if set, zero value otherwise (both if not set or set to explicit null). +// GetInteractiveAccent returns the InteractiveAccent field value if set, zero value otherwise. func (o *CustomColorPalette) GetInteractiveAccent() string { - if o == nil || o.InteractiveAccent.Get() == nil { + if o == nil || o.InteractiveAccent == nil { var ret string return ret } - return *o.InteractiveAccent.Get() + return *o.InteractiveAccent } // GetInteractiveAccentOk returns a tuple with the InteractiveAccent 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 *CustomColorPalette) GetInteractiveAccentOk() (*string, bool) { - if o == nil { + if o == nil || o.InteractiveAccent == nil { return nil, false } - return o.InteractiveAccent.Get(), o.InteractiveAccent.IsSet() + return o.InteractiveAccent, true } // HasInteractiveAccent returns a boolean if a field has been set. func (o *CustomColorPalette) HasInteractiveAccent() bool { - if o != nil && o.InteractiveAccent.IsSet() { + if o != nil && o.InteractiveAccent != nil { return true } return false } -// SetInteractiveAccent gets a reference to the given NullableString and assigns it to the InteractiveAccent field. +// SetInteractiveAccent gets a reference to the given string and assigns it to the InteractiveAccent field. func (o *CustomColorPalette) SetInteractiveAccent(v string) { - o.InteractiveAccent.Set(&v) + o.InteractiveAccent = &v } -// SetInteractiveAccentNil sets the value for InteractiveAccent to be an explicit nil -func (o *CustomColorPalette) SetInteractiveAccentNil() { - o.InteractiveAccent.Set(nil) + +// GetPrimary returns the Primary field value if set, zero value otherwise. +func (o *CustomColorPalette) GetPrimary() string { + if o == nil || o.Primary == nil { + var ret string + return ret + } + return *o.Primary } -// UnsetInteractiveAccent ensures that no value is present for InteractiveAccent, not even an explicit nil -func (o *CustomColorPalette) UnsetInteractiveAccent() { - o.InteractiveAccent.Unset() +// GetPrimaryOk returns a tuple with the Primary field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomColorPalette) GetPrimaryOk() (*string, bool) { + if o == nil || o.Primary == nil { + return nil, false + } + return o.Primary, true } -// GetTextDanger returns the TextDanger field value if set, zero value otherwise (both if not set or set to explicit null). +// HasPrimary returns a boolean if a field has been set. +func (o *CustomColorPalette) HasPrimary() bool { + if o != nil && o.Primary != nil { + return true + } + + return false +} + +// SetPrimary gets a reference to the given string and assigns it to the Primary field. +func (o *CustomColorPalette) SetPrimary(v string) { + o.Primary = &v +} + +// GetTextDanger returns the TextDanger field value if set, zero value otherwise. func (o *CustomColorPalette) GetTextDanger() string { - if o == nil || o.TextDanger.Get() == nil { + if o == nil || o.TextDanger == nil { var ret string return ret } - return *o.TextDanger.Get() + return *o.TextDanger } // GetTextDangerOk returns a tuple with the TextDanger 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 *CustomColorPalette) GetTextDangerOk() (*string, bool) { - if o == nil { + if o == nil || o.TextDanger == nil { return nil, false } - return o.TextDanger.Get(), o.TextDanger.IsSet() + return o.TextDanger, true } // HasTextDanger returns a boolean if a field has been set. func (o *CustomColorPalette) HasTextDanger() bool { - if o != nil && o.TextDanger.IsSet() { + if o != nil && o.TextDanger != nil { return true } return false } -// SetTextDanger gets a reference to the given NullableString and assigns it to the TextDanger field. +// SetTextDanger gets a reference to the given string and assigns it to the TextDanger field. func (o *CustomColorPalette) SetTextDanger(v string) { - o.TextDanger.Set(&v) -} -// SetTextDangerNil sets the value for TextDanger to be an explicit nil -func (o *CustomColorPalette) SetTextDangerNil() { - o.TextDanger.Set(nil) -} - -// UnsetTextDanger ensures that no value is present for TextDanger, not even an explicit nil -func (o *CustomColorPalette) UnsetTextDanger() { - o.TextDanger.Unset() + o.TextDanger = &v } -// GetTextPrimary returns the TextPrimary field value if set, zero value otherwise (both if not set or set to explicit null). +// GetTextPrimary returns the TextPrimary field value if set, zero value otherwise. func (o *CustomColorPalette) GetTextPrimary() string { - if o == nil || o.TextPrimary.Get() == nil { + if o == nil || o.TextPrimary == nil { var ret string return ret } - return *o.TextPrimary.Get() + return *o.TextPrimary } // GetTextPrimaryOk returns a tuple with the TextPrimary 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 *CustomColorPalette) GetTextPrimaryOk() (*string, bool) { - if o == nil { + if o == nil || o.TextPrimary == nil { return nil, false } - return o.TextPrimary.Get(), o.TextPrimary.IsSet() + return o.TextPrimary, true } // HasTextPrimary returns a boolean if a field has been set. func (o *CustomColorPalette) HasTextPrimary() bool { - if o != nil && o.TextPrimary.IsSet() { + if o != nil && o.TextPrimary != nil { return true } return false } -// SetTextPrimary gets a reference to the given NullableString and assigns it to the TextPrimary field. +// SetTextPrimary gets a reference to the given string and assigns it to the TextPrimary field. func (o *CustomColorPalette) SetTextPrimary(v string) { - o.TextPrimary.Set(&v) -} -// SetTextPrimaryNil sets the value for TextPrimary to be an explicit nil -func (o *CustomColorPalette) SetTextPrimaryNil() { - o.TextPrimary.Set(nil) -} - -// UnsetTextPrimary ensures that no value is present for TextPrimary, not even an explicit nil -func (o *CustomColorPalette) UnsetTextPrimary() { - o.TextPrimary.Unset() + o.TextPrimary = &v } func (o CustomColorPalette) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.BackgroundHover.IsSet() { - toSerialize["backgroundHover"] = o.BackgroundHover.Get() + if o.BackgroundHover != nil { + toSerialize["backgroundHover"] = o.BackgroundHover + } + if o.BackgroundPrimary != nil { + toSerialize["backgroundPrimary"] = o.BackgroundPrimary } - if o.BackgroundPrimary.IsSet() { - toSerialize["backgroundPrimary"] = o.BackgroundPrimary.Get() + if o.BackgroundSecondary != nil { + toSerialize["backgroundSecondary"] = o.BackgroundSecondary } - if o.BackgroundSecondary.IsSet() { - toSerialize["backgroundSecondary"] = o.BackgroundSecondary.Get() + if o.InteractiveAccent != nil { + toSerialize["interactiveAccent"] = o.InteractiveAccent } - if o.InteractiveAccent.IsSet() { - toSerialize["interactiveAccent"] = o.InteractiveAccent.Get() + if o.Primary != nil { + toSerialize["primary"] = o.Primary } - if o.TextDanger.IsSet() { - toSerialize["textDanger"] = o.TextDanger.Get() + if o.TextDanger != nil { + toSerialize["textDanger"] = o.TextDanger } - if o.TextPrimary.IsSet() { - toSerialize["textPrimary"] = o.TextPrimary.Get() + if o.TextPrimary != nil { + toSerialize["textPrimary"] = o.TextPrimary } return json.Marshal(toSerialize) } diff --git a/go/internal/openapi/model_environment_settings_out.go b/go/internal/openapi/model_environment_settings_out.go index d534b0c91..025f2a826 100644 --- a/go/internal/openapi/model_environment_settings_out.go +++ b/go/internal/openapi/model_environment_settings_out.go @@ -18,7 +18,7 @@ import ( type EnvironmentSettingsOut struct { ColorPaletteDark *CustomColorPalette `json:"colorPaletteDark,omitempty"` ColorPaletteLight *CustomColorPalette `json:"colorPaletteLight,omitempty"` - CustomColor NullableString `json:"customColor,omitempty"` + CustomColor *string `json:"customColor,omitempty"` CustomFontFamily NullableString `json:"customFontFamily,omitempty"` CustomLogoUrl NullableString `json:"customLogoUrl,omitempty"` CustomThemeOverride *CustomThemeOverride `json:"customThemeOverride,omitempty"` @@ -120,46 +120,36 @@ func (o *EnvironmentSettingsOut) SetColorPaletteLight(v CustomColorPalette) { o.ColorPaletteLight = &v } -// GetCustomColor returns the CustomColor field value if set, zero value otherwise (both if not set or set to explicit null). +// GetCustomColor returns the CustomColor field value if set, zero value otherwise. func (o *EnvironmentSettingsOut) GetCustomColor() string { - if o == nil || o.CustomColor.Get() == nil { + if o == nil || o.CustomColor == nil { var ret string return ret } - return *o.CustomColor.Get() + return *o.CustomColor } // GetCustomColorOk returns a tuple with the CustomColor 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 *EnvironmentSettingsOut) GetCustomColorOk() (*string, bool) { - if o == nil { + if o == nil || o.CustomColor == nil { return nil, false } - return o.CustomColor.Get(), o.CustomColor.IsSet() + return o.CustomColor, true } // HasCustomColor returns a boolean if a field has been set. func (o *EnvironmentSettingsOut) HasCustomColor() bool { - if o != nil && o.CustomColor.IsSet() { + if o != nil && o.CustomColor != nil { return true } return false } -// SetCustomColor gets a reference to the given NullableString and assigns it to the CustomColor field. +// SetCustomColor gets a reference to the given string and assigns it to the CustomColor field. func (o *EnvironmentSettingsOut) SetCustomColor(v string) { - o.CustomColor.Set(&v) -} -// SetCustomColorNil sets the value for CustomColor to be an explicit nil -func (o *EnvironmentSettingsOut) SetCustomColorNil() { - o.CustomColor.Set(nil) -} - -// UnsetCustomColor ensures that no value is present for CustomColor, not even an explicit nil -func (o *EnvironmentSettingsOut) UnsetCustomColor() { - o.CustomColor.Unset() + o.CustomColor = &v } // GetCustomFontFamily returns the CustomFontFamily field value if set, zero value otherwise (both if not set or set to explicit null). @@ -382,8 +372,8 @@ func (o EnvironmentSettingsOut) MarshalJSON() ([]byte, error) { if o.ColorPaletteLight != nil { toSerialize["colorPaletteLight"] = o.ColorPaletteLight } - if o.CustomColor.IsSet() { - toSerialize["customColor"] = o.CustomColor.Get() + if o.CustomColor != nil { + toSerialize["customColor"] = o.CustomColor } if o.CustomFontFamily.IsSet() { toSerialize["customFontFamily"] = o.CustomFontFamily.Get() diff --git a/go/internal/openapi/model_generate_in.go b/go/internal/openapi/model_generate_in.go new file mode 100644 index 000000000..4961b3e03 --- /dev/null +++ b/go/internal/openapi/model_generate_in.go @@ -0,0 +1,108 @@ +/* + * 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" +) + +// GenerateIn struct for GenerateIn +type GenerateIn struct { + Prompt string `json:"prompt"` +} + +// NewGenerateIn instantiates a new GenerateIn 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 NewGenerateIn(prompt string) *GenerateIn { + this := GenerateIn{} + this.Prompt = prompt + return &this +} + +// NewGenerateInWithDefaults instantiates a new GenerateIn 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 NewGenerateInWithDefaults() *GenerateIn { + this := GenerateIn{} + return &this +} + +// GetPrompt returns the Prompt field value +func (o *GenerateIn) GetPrompt() string { + if o == nil { + var ret string + return ret + } + + return o.Prompt +} + +// GetPromptOk returns a tuple with the Prompt field value +// and a boolean to check if the value has been set. +func (o *GenerateIn) GetPromptOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Prompt, true +} + +// SetPrompt sets field value +func (o *GenerateIn) SetPrompt(v string) { + o.Prompt = v +} + +func (o GenerateIn) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["prompt"] = o.Prompt + } + return json.Marshal(toSerialize) +} + +type NullableGenerateIn struct { + value *GenerateIn + isSet bool +} + +func (v NullableGenerateIn) Get() *GenerateIn { + return v.value +} + +func (v *NullableGenerateIn) Set(val *GenerateIn) { + v.value = val + v.isSet = true +} + +func (v NullableGenerateIn) IsSet() bool { + return v.isSet +} + +func (v *NullableGenerateIn) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGenerateIn(val *GenerateIn) *NullableGenerateIn { + return &NullableGenerateIn{value: val, isSet: true} +} + +func (v NullableGenerateIn) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGenerateIn) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_generate_out.go b/go/internal/openapi/model_generate_out.go new file mode 100644 index 000000000..8ec75ca5f --- /dev/null +++ b/go/internal/openapi/model_generate_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" +) + +// GenerateOut struct for GenerateOut +type GenerateOut struct { + Choices []CompletionChoice `json:"choices"` + Created int64 `json:"created"` + Id string `json:"id"` + Model string `json:"model"` + Object string `json:"object"` +} + +// NewGenerateOut instantiates a new GenerateOut 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 NewGenerateOut(choices []CompletionChoice, created int64, id string, model string, object string) *GenerateOut { + this := GenerateOut{} + this.Choices = choices + this.Created = created + this.Id = id + this.Model = model + this.Object = object + return &this +} + +// NewGenerateOutWithDefaults instantiates a new GenerateOut 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 NewGenerateOutWithDefaults() *GenerateOut { + this := GenerateOut{} + return &this +} + +// GetChoices returns the Choices field value +func (o *GenerateOut) GetChoices() []CompletionChoice { + if o == nil { + var ret []CompletionChoice + return ret + } + + return o.Choices +} + +// GetChoicesOk returns a tuple with the Choices field value +// and a boolean to check if the value has been set. +func (o *GenerateOut) GetChoicesOk() (*[]CompletionChoice, bool) { + if o == nil { + return nil, false + } + return &o.Choices, true +} + +// SetChoices sets field value +func (o *GenerateOut) SetChoices(v []CompletionChoice) { + o.Choices = v +} + +// GetCreated returns the Created field value +func (o *GenerateOut) GetCreated() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *GenerateOut) GetCreatedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *GenerateOut) SetCreated(v int64) { + o.Created = v +} + +// GetId returns the Id field value +func (o *GenerateOut) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *GenerateOut) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *GenerateOut) SetId(v string) { + o.Id = v +} + +// GetModel returns the Model field value +func (o *GenerateOut) GetModel() string { + if o == nil { + var ret string + return ret + } + + return o.Model +} + +// GetModelOk returns a tuple with the Model field value +// and a boolean to check if the value has been set. +func (o *GenerateOut) GetModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Model, true +} + +// SetModel sets field value +func (o *GenerateOut) SetModel(v string) { + o.Model = v +} + +// GetObject returns the Object field value +func (o *GenerateOut) GetObject() string { + if o == nil { + var ret string + return ret + } + + return o.Object +} + +// GetObjectOk returns a tuple with the Object field value +// and a boolean to check if the value has been set. +func (o *GenerateOut) GetObjectOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Object, true +} + +// SetObject sets field value +func (o *GenerateOut) SetObject(v string) { + o.Object = v +} + +func (o GenerateOut) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["choices"] = o.Choices + } + if true { + toSerialize["created"] = o.Created + } + if true { + toSerialize["id"] = o.Id + } + if true { + toSerialize["model"] = o.Model + } + if true { + toSerialize["object"] = o.Object + } + return json.Marshal(toSerialize) +} + +type NullableGenerateOut struct { + value *GenerateOut + isSet bool +} + +func (v NullableGenerateOut) Get() *GenerateOut { + return v.value +} + +func (v *NullableGenerateOut) Set(val *GenerateOut) { + v.value = val + v.isSet = true +} + +func (v NullableGenerateOut) IsSet() bool { + return v.isSet +} + +func (v *NullableGenerateOut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGenerateOut(val *GenerateOut) *NullableGenerateOut { + return &NullableGenerateOut{value: val, isSet: true} +} + +func (v NullableGenerateOut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGenerateOut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_inbound_path_params.go b/go/internal/openapi/model_inbound_path_params.go new file mode 100644 index 000000000..8b665b591 --- /dev/null +++ b/go/internal/openapi/model_inbound_path_params.go @@ -0,0 +1,138 @@ +/* + * 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" +) + +// InboundPathParams struct for InboundPathParams +type InboundPathParams struct { + // The app's ID or UID + AppId string `json:"app_id"` + InboundToken string `json:"inbound_token"` +} + +// NewInboundPathParams instantiates a new InboundPathParams 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 NewInboundPathParams(appId string, inboundToken string) *InboundPathParams { + this := InboundPathParams{} + this.AppId = appId + this.InboundToken = inboundToken + return &this +} + +// NewInboundPathParamsWithDefaults instantiates a new InboundPathParams 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 NewInboundPathParamsWithDefaults() *InboundPathParams { + this := InboundPathParams{} + return &this +} + +// GetAppId returns the AppId field value +func (o *InboundPathParams) 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 *InboundPathParams) GetAppIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AppId, true +} + +// SetAppId sets field value +func (o *InboundPathParams) SetAppId(v string) { + o.AppId = v +} + +// GetInboundToken returns the InboundToken field value +func (o *InboundPathParams) GetInboundToken() string { + if o == nil { + var ret string + return ret + } + + return o.InboundToken +} + +// GetInboundTokenOk returns a tuple with the InboundToken field value +// and a boolean to check if the value has been set. +func (o *InboundPathParams) GetInboundTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InboundToken, true +} + +// SetInboundToken sets field value +func (o *InboundPathParams) SetInboundToken(v string) { + o.InboundToken = v +} + +func (o InboundPathParams) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["app_id"] = o.AppId + } + if true { + toSerialize["inbound_token"] = o.InboundToken + } + return json.Marshal(toSerialize) +} + +type NullableInboundPathParams struct { + value *InboundPathParams + isSet bool +} + +func (v NullableInboundPathParams) Get() *InboundPathParams { + return v.value +} + +func (v *NullableInboundPathParams) Set(val *InboundPathParams) { + v.value = val + v.isSet = true +} + +func (v NullableInboundPathParams) IsSet() bool { + return v.isSet +} + +func (v *NullableInboundPathParams) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInboundPathParams(val *InboundPathParams) *NullableInboundPathParams { + return &NullableInboundPathParams{value: val, isSet: true} +} + +func (v NullableInboundPathParams) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInboundPathParams) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_message_stream_out.go b/go/internal/openapi/model_message_stream_out.go new file mode 100644 index 000000000..d37bf5ca1 --- /dev/null +++ b/go/internal/openapi/model_message_stream_out.go @@ -0,0 +1,166 @@ +/* + * 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" +) + +// MessageStreamOut struct for MessageStreamOut +type MessageStreamOut struct { + Data []MessageOut `json:"data"` + Done bool `json:"done"` + Iterator string `json:"iterator"` +} + +// NewMessageStreamOut instantiates a new MessageStreamOut 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 NewMessageStreamOut(data []MessageOut, done bool, iterator string) *MessageStreamOut { + this := MessageStreamOut{} + this.Data = data + this.Done = done + this.Iterator = iterator + return &this +} + +// NewMessageStreamOutWithDefaults instantiates a new MessageStreamOut 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 NewMessageStreamOutWithDefaults() *MessageStreamOut { + this := MessageStreamOut{} + return &this +} + +// GetData returns the Data field value +func (o *MessageStreamOut) GetData() []MessageOut { + if o == nil { + var ret []MessageOut + 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 *MessageStreamOut) GetDataOk() (*[]MessageOut, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *MessageStreamOut) SetData(v []MessageOut) { + o.Data = v +} + +// GetDone returns the Done field value +func (o *MessageStreamOut) GetDone() bool { + if o == nil { + var ret bool + return ret + } + + return o.Done +} + +// GetDoneOk returns a tuple with the Done field value +// and a boolean to check if the value has been set. +func (o *MessageStreamOut) GetDoneOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Done, true +} + +// SetDone sets field value +func (o *MessageStreamOut) SetDone(v bool) { + o.Done = v +} + +// GetIterator returns the Iterator field value +func (o *MessageStreamOut) GetIterator() string { + if o == nil { + var ret string + return ret + } + + return o.Iterator +} + +// GetIteratorOk returns a tuple with the Iterator field value +// and a boolean to check if the value has been set. +func (o *MessageStreamOut) GetIteratorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Iterator, true +} + +// SetIterator sets field value +func (o *MessageStreamOut) SetIterator(v string) { + o.Iterator = v +} + +func (o MessageStreamOut) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["data"] = o.Data + } + if true { + toSerialize["done"] = o.Done + } + if true { + toSerialize["iterator"] = o.Iterator + } + return json.Marshal(toSerialize) +} + +type NullableMessageStreamOut struct { + value *MessageStreamOut + isSet bool +} + +func (v NullableMessageStreamOut) Get() *MessageStreamOut { + return v.value +} + +func (v *NullableMessageStreamOut) Set(val *MessageStreamOut) { + v.value = val + v.isSet = true +} + +func (v NullableMessageStreamOut) IsSet() bool { + return v.isSet +} + +func (v *NullableMessageStreamOut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMessageStreamOut(val *MessageStreamOut) *NullableMessageStreamOut { + return &NullableMessageStreamOut{value: val, isSet: true} +} + +func (v NullableMessageStreamOut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMessageStreamOut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_open_aiin.go b/go/internal/openapi/model_open_aiin.go new file mode 100644 index 000000000..476bf90ab --- /dev/null +++ b/go/internal/openapi/model_open_aiin.go @@ -0,0 +1,108 @@ +/* + * 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" +) + +// OpenAIIn struct for OpenAIIn +type OpenAIIn struct { + Prompt string `json:"prompt"` +} + +// NewOpenAIIn instantiates a new OpenAIIn 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 NewOpenAIIn(prompt string) *OpenAIIn { + this := OpenAIIn{} + this.Prompt = prompt + return &this +} + +// NewOpenAIInWithDefaults instantiates a new OpenAIIn 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 NewOpenAIInWithDefaults() *OpenAIIn { + this := OpenAIIn{} + return &this +} + +// GetPrompt returns the Prompt field value +func (o *OpenAIIn) GetPrompt() string { + if o == nil { + var ret string + return ret + } + + return o.Prompt +} + +// GetPromptOk returns a tuple with the Prompt field value +// and a boolean to check if the value has been set. +func (o *OpenAIIn) GetPromptOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Prompt, true +} + +// SetPrompt sets field value +func (o *OpenAIIn) SetPrompt(v string) { + o.Prompt = v +} + +func (o OpenAIIn) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["prompt"] = o.Prompt + } + return json.Marshal(toSerialize) +} + +type NullableOpenAIIn struct { + value *OpenAIIn + isSet bool +} + +func (v NullableOpenAIIn) Get() *OpenAIIn { + return v.value +} + +func (v *NullableOpenAIIn) Set(val *OpenAIIn) { + v.value = val + v.isSet = true +} + +func (v NullableOpenAIIn) IsSet() bool { + return v.isSet +} + +func (v *NullableOpenAIIn) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOpenAIIn(val *OpenAIIn) *NullableOpenAIIn { + return &NullableOpenAIIn{value: val, isSet: true} +} + +func (v NullableOpenAIIn) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOpenAIIn) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_rotated_url_out.go b/go/internal/openapi/model_rotated_url_out.go new file mode 100644 index 000000000..8fa241e63 --- /dev/null +++ b/go/internal/openapi/model_rotated_url_out.go @@ -0,0 +1,108 @@ +/* + * 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" +) + +// RotatedUrlOut struct for RotatedUrlOut +type RotatedUrlOut struct { + Url string `json:"url"` +} + +// NewRotatedUrlOut instantiates a new RotatedUrlOut 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 NewRotatedUrlOut(url string) *RotatedUrlOut { + this := RotatedUrlOut{} + this.Url = url + return &this +} + +// NewRotatedUrlOutWithDefaults instantiates a new RotatedUrlOut 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 NewRotatedUrlOutWithDefaults() *RotatedUrlOut { + this := RotatedUrlOut{} + return &this +} + +// GetUrl returns the Url field value +func (o *RotatedUrlOut) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *RotatedUrlOut) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *RotatedUrlOut) SetUrl(v string) { + o.Url = v +} + +func (o RotatedUrlOut) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["url"] = o.Url + } + return json.Marshal(toSerialize) +} + +type NullableRotatedUrlOut struct { + value *RotatedUrlOut + isSet bool +} + +func (v NullableRotatedUrlOut) Get() *RotatedUrlOut { + return v.value +} + +func (v *NullableRotatedUrlOut) Set(val *RotatedUrlOut) { + v.value = val + v.isSet = true +} + +func (v NullableRotatedUrlOut) IsSet() bool { + return v.isSet +} + +func (v *NullableRotatedUrlOut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRotatedUrlOut(val *RotatedUrlOut) *NullableRotatedUrlOut { + return &NullableRotatedUrlOut{value: val, isSet: true} +} + +func (v NullableRotatedUrlOut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRotatedUrlOut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_settings_in.go b/go/internal/openapi/model_settings_in.go index 455906f4c..35844b7bf 100644 --- a/go/internal/openapi/model_settings_in.go +++ b/go/internal/openapi/model_settings_in.go @@ -19,7 +19,7 @@ type SettingsIn struct { ColorPaletteDark *CustomColorPalette `json:"colorPaletteDark,omitempty"` ColorPaletteLight *CustomColorPalette `json:"colorPaletteLight,omitempty"` CustomBaseFontSize NullableInt32 `json:"customBaseFontSize,omitempty"` - CustomColor NullableString `json:"customColor,omitempty"` + CustomColor *string `json:"customColor,omitempty"` CustomFontFamily NullableString `json:"customFontFamily,omitempty"` CustomLogoUrl NullableString `json:"customLogoUrl,omitempty"` CustomThemeOverride *CustomThemeOverride `json:"customThemeOverride,omitempty"` @@ -184,46 +184,36 @@ func (o *SettingsIn) UnsetCustomBaseFontSize() { o.CustomBaseFontSize.Unset() } -// GetCustomColor returns the CustomColor field value if set, zero value otherwise (both if not set or set to explicit null). +// GetCustomColor returns the CustomColor field value if set, zero value otherwise. func (o *SettingsIn) GetCustomColor() string { - if o == nil || o.CustomColor.Get() == nil { + if o == nil || o.CustomColor == nil { var ret string return ret } - return *o.CustomColor.Get() + return *o.CustomColor } // GetCustomColorOk returns a tuple with the CustomColor 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 *SettingsIn) GetCustomColorOk() (*string, bool) { - if o == nil { + if o == nil || o.CustomColor == nil { return nil, false } - return o.CustomColor.Get(), o.CustomColor.IsSet() + return o.CustomColor, true } // HasCustomColor returns a boolean if a field has been set. func (o *SettingsIn) HasCustomColor() bool { - if o != nil && o.CustomColor.IsSet() { + if o != nil && o.CustomColor != nil { return true } return false } -// SetCustomColor gets a reference to the given NullableString and assigns it to the CustomColor field. +// SetCustomColor gets a reference to the given string and assigns it to the CustomColor field. func (o *SettingsIn) SetCustomColor(v string) { - o.CustomColor.Set(&v) -} -// SetCustomColorNil sets the value for CustomColor to be an explicit nil -func (o *SettingsIn) SetCustomColorNil() { - o.CustomColor.Set(nil) -} - -// UnsetCustomColor ensures that no value is present for CustomColor, not even an explicit nil -func (o *SettingsIn) UnsetCustomColor() { - o.CustomColor.Unset() + o.CustomColor = &v } // GetCustomFontFamily returns the CustomFontFamily field value if set, zero value otherwise (both if not set or set to explicit null). @@ -619,8 +609,8 @@ func (o SettingsIn) MarshalJSON() ([]byte, error) { if o.CustomBaseFontSize.IsSet() { toSerialize["customBaseFontSize"] = o.CustomBaseFontSize.Get() } - if o.CustomColor.IsSet() { - toSerialize["customColor"] = o.CustomColor.Get() + if o.CustomColor != nil { + toSerialize["customColor"] = o.CustomColor } if o.CustomFontFamily.IsSet() { toSerialize["customFontFamily"] = o.CustomFontFamily.Get() diff --git a/go/internal/openapi/model_settings_out.go b/go/internal/openapi/model_settings_out.go index 18434b2b1..e71fe34d5 100644 --- a/go/internal/openapi/model_settings_out.go +++ b/go/internal/openapi/model_settings_out.go @@ -19,7 +19,7 @@ type SettingsOut struct { ColorPaletteDark *CustomColorPalette `json:"colorPaletteDark,omitempty"` ColorPaletteLight *CustomColorPalette `json:"colorPaletteLight,omitempty"` CustomBaseFontSize NullableInt32 `json:"customBaseFontSize,omitempty"` - CustomColor NullableString `json:"customColor,omitempty"` + CustomColor *string `json:"customColor,omitempty"` CustomFontFamily NullableString `json:"customFontFamily,omitempty"` CustomLogoUrl NullableString `json:"customLogoUrl,omitempty"` CustomThemeOverride *CustomThemeOverride `json:"customThemeOverride,omitempty"` @@ -184,46 +184,36 @@ func (o *SettingsOut) UnsetCustomBaseFontSize() { o.CustomBaseFontSize.Unset() } -// GetCustomColor returns the CustomColor field value if set, zero value otherwise (both if not set or set to explicit null). +// GetCustomColor returns the CustomColor field value if set, zero value otherwise. func (o *SettingsOut) GetCustomColor() string { - if o == nil || o.CustomColor.Get() == nil { + if o == nil || o.CustomColor == nil { var ret string return ret } - return *o.CustomColor.Get() + return *o.CustomColor } // GetCustomColorOk returns a tuple with the CustomColor 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 *SettingsOut) GetCustomColorOk() (*string, bool) { - if o == nil { + if o == nil || o.CustomColor == nil { return nil, false } - return o.CustomColor.Get(), o.CustomColor.IsSet() + return o.CustomColor, true } // HasCustomColor returns a boolean if a field has been set. func (o *SettingsOut) HasCustomColor() bool { - if o != nil && o.CustomColor.IsSet() { + if o != nil && o.CustomColor != nil { return true } return false } -// SetCustomColor gets a reference to the given NullableString and assigns it to the CustomColor field. +// SetCustomColor gets a reference to the given string and assigns it to the CustomColor field. func (o *SettingsOut) SetCustomColor(v string) { - o.CustomColor.Set(&v) -} -// SetCustomColorNil sets the value for CustomColor to be an explicit nil -func (o *SettingsOut) SetCustomColorNil() { - o.CustomColor.Set(nil) -} - -// UnsetCustomColor ensures that no value is present for CustomColor, not even an explicit nil -func (o *SettingsOut) UnsetCustomColor() { - o.CustomColor.Unset() + o.CustomColor = &v } // GetCustomFontFamily returns the CustomFontFamily field value if set, zero value otherwise (both if not set or set to explicit null). @@ -619,8 +609,8 @@ func (o SettingsOut) MarshalJSON() ([]byte, error) { if o.CustomBaseFontSize.IsSet() { toSerialize["customBaseFontSize"] = o.CustomBaseFontSize.Get() } - if o.CustomColor.IsSet() { - toSerialize["customColor"] = o.CustomColor.Get() + if o.CustomColor != nil { + toSerialize["customColor"] = o.CustomColor } if o.CustomFontFamily.IsSet() { toSerialize["customFontFamily"] = o.CustomFontFamily.Get() diff --git a/openapi.json b/openapi.json index a7078cec5..6319c9a74 100644 --- a/openapi.json +++ b/openapi.json @@ -379,37 +379,73 @@ ], "type": "string" }, + "Color": { + "type": "string" + }, + "CompletionChoice": { + "properties": { + "finish_reason": { + "type": "string" + }, + "index": { + "format": "int64", + "type": "integer" + }, + "message": { + "$ref": "#/components/schemas/CompletionMessage" + } + }, + "required": [ + "finish_reason", + "index", + "message" + ], + "type": "object" + }, + "CompletionMessage": { + "properties": { + "content": { + "type": "string" + }, + "role": { + "type": "string" + } + }, + "required": [ + "content", + "role" + ], + "type": "object" + }, "CustomColorPalette": { "properties": { "backgroundHover": { - "format": "color", - "nullable": true, - "type": "string" + "$ref": "#/components/schemas/Color", + "nullable": true }, "backgroundPrimary": { - "format": "color", - "nullable": true, - "type": "string" + "$ref": "#/components/schemas/Color", + "nullable": true }, "backgroundSecondary": { - "format": "color", - "nullable": true, - "type": "string" + "$ref": "#/components/schemas/Color", + "nullable": true }, "interactiveAccent": { - "format": "color", - "nullable": true, - "type": "string" + "$ref": "#/components/schemas/Color", + "nullable": true + }, + "primary": { + "$ref": "#/components/schemas/Color", + "nullable": true }, "textDanger": { - "format": "color", - "nullable": true, - "type": "string" + "$ref": "#/components/schemas/Color", + "nullable": true }, "textPrimary": { - "format": "color", - "nullable": true, - "type": "string" + "$ref": "#/components/schemas/Color", + "nullable": true } }, "type": "object" @@ -1396,9 +1432,8 @@ "nullable": true }, "customColor": { - "format": "color", - "nullable": true, - "type": "string" + "$ref": "#/components/schemas/Color", + "nullable": true }, "customFontFamily": { "example": "Open Sans", @@ -1861,9 +1896,6 @@ ], "type": "object" }, - "ExportEnvironmentIn": { - "type": "object" - }, "ExportEventTypeOut": { "properties": { "id": { @@ -1886,13 +1918,56 @@ "FontSizeConfig": { "properties": { "base": { - "format": "int", + "format": "uint16", + "minimum": 0, "nullable": true, "type": "integer" } }, "type": "object" }, + "GenerateIn": { + "properties": { + "prompt": { + "type": "string" + } + }, + "required": [ + "prompt" + ], + "type": "object" + }, + "GenerateOut": { + "properties": { + "choices": { + "items": { + "$ref": "#/components/schemas/CompletionChoice" + }, + "type": "array" + }, + "created": { + "format": "int64", + "type": "integer" + }, + "id": { + "type": "string" + }, + "model": { + "type": "string" + }, + "object": { + "type": "string" + } + }, + "required": [ + "choices", + "created", + "id", + "model", + "object" + ], + "type": "object" + }, "HTTPValidationError": { "properties": { "detail": { @@ -1923,6 +1998,26 @@ "title": "HttpError", "type": "object" }, + "InboundPathParams": { + "properties": { + "app_id": { + "description": "The app's ID or UID", + "example": "unique-app-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "inbound_token": { + "type": "string" + } + }, + "required": [ + "app_id", + "inbound_token" + ], + "type": "object" + }, "IntegrationIn": { "properties": { "name": { @@ -3077,6 +3172,28 @@ "Sending" ] }, + "MessageStreamOut": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/MessageOut" + }, + "type": "array" + }, + "done": { + "type": "boolean" + }, + "iterator": { + "type": "string" + } + }, + "required": [ + "data", + "done", + "iterator" + ], + "type": "object" + }, "OauthPayloadIn": { "properties": { "code": { @@ -3212,6 +3329,17 @@ ], "type": "object" }, + "RotatedUrlOut": { + "properties": { + "url": { + "type": "string" + } + }, + "required": [ + "url" + ], + "type": "object" + }, "SettingsIn": { "properties": { "colorPaletteDark": { @@ -3228,9 +3356,8 @@ "type": "integer" }, "customColor": { - "format": "color", - "nullable": true, - "type": "string" + "$ref": "#/components/schemas/Color", + "nullable": true }, "customFontFamily": { "example": "Open Sans", @@ -3300,9 +3427,8 @@ "type": "integer" }, "customColor": { - "format": "color", - "nullable": true, - "type": "string" + "$ref": "#/components/schemas/Color", + "nullable": true }, "customFontFamily": { "example": "Open Sans", @@ -5205,10 +5331,12 @@ "style": "form" }, { + "description": "When `true`, the message information is included in the response", "in": "query", "name": "with_msg", "schema": { "default": false, + "description": "When `true`, the message information is included in the response", "type": "boolean" }, "style": "form" @@ -9775,10 +9903,10 @@ ] } }, - "/api/v1/app/{app_id}/integration/": { + "/api/v1/app/{app_id}/events/": { "get": { - "description": "List the application's integrations.", - "operationId": "v1.integration.list", + "description": "Reads the stream of created messages for an application", + "operationId": "v1.message.stream", "parameters": [ { "description": "The app's ID or UID", @@ -9814,11 +9942,47 @@ "name": "iterator", "schema": { "description": "The iterator returned from a prior invocation", - "example": "integ_1srOrx2ZWZBpBUvZwXKQmoEYga2", "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": "Filter response based on the event type", + "in": "query", + "name": "channels", + "schema": { + "description": "Filter response based on the event type", + "items": { + "example": "project_1337", + "maxLength": 128, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "nullable": true, + "type": "array", + "uniqueItems": true + }, + "style": "form" } ], "responses": { @@ -9826,7 +9990,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListResponse_IntegrationOut_" + "$ref": "#/components/schemas/MessageStreamOut" } } }, @@ -9908,76 +10072,78 @@ "HTTPBearer": [] } ], - "summary": "List Integrations", + "summary": "Stream Events", "tags": [ - "Integration" + "Message" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const listResponseIntegrationOut = await svix.integration.list(\"app_id\");" + "source": "const messageStreamOut = await svix.message.stream(\"app_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const listResponseIntegrationOut = await svix.integration.list(\"app_id\");" + "source": "const messageStreamOut = await svix.message.stream(\"app_id\");" }, { "label": "Python", "lang": "Python", - "source": "list_response_integration_out = svix.integration.list(\"app_id\", None)" + "source": "message_stream_out = svix.message.stream(\"app_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_integration_out = await svix.integration.list(\"app_id\", None)" + "source": "message_stream_out = await svix.message.stream(\"app_id\")" }, { "label": "Go", "lang": "Go", - "source": "listResponseIntegrationOut, err := svixClient.Integration.List(ctx, \"app_id\", nil)" + "source": "messageStreamOut, err := svixClient.Message.Stream(ctx, \"app_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val listResponseIntegrationOut = svix.integration.list(\"app_id\")" + "source": "val messageStreamOut = svix.message.stream(\"app_id\")" }, { "label": "Java", "lang": "Java", - "source": "ListResponseIntegrationOut listResponseIntegrationOut = svix.getIntegration().list(\"app_id\")" + "source": "MessageStreamOut messageStreamOut = svix.getMessage().stream(\"app_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "list_response_integration_out = svix.integration.list(\"app_id\")" + "source": "message_stream_out = svix.message.stream(\"app_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let list_response_integration_out = svix.integration().list(\"app_id\", None).await?;" + "source": "let message_stream_out = svix.message().stream(\"app_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "var listResponseIntegrationOut = await svix.Integration.ListAsync(\"app_id\")" + "source": "var messageStreamOut = await svix.Message.StreamAsync(\"app_id\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix integration list \"app_id\"" + "source": "svix message stream \"app_id\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/integration/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/events/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] - }, + } + }, + "/api/v1/app/{app_id}/inbound/msg/{inbound_token}/": { "post": { - "description": "Create an integration.", - "operationId": "v1.integration.create", + "description": "Handles a raw inbound webhook for the application", + "operationId": "v1.inbound.msg", "parameters": [ { "description": "The app's ID or UID", @@ -9994,6 +10160,15 @@ }, "style": "simple" }, + { + "in": "path", + "name": "inbound_token", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, { "description": "The request's idempotency key", "in": "header", @@ -10006,20 +10181,20 @@ ], "requestBody": { "content": { - "application/json": { + "text/plain; charset=utf-8": { "schema": { - "$ref": "#/components/schemas/IntegrationIn" + "type": "string" } } }, "required": true }, "responses": { - "201": { + "202": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IntegrationOut" + "$ref": "#/components/schemas/MessageOut" } } }, @@ -10101,78 +10276,78 @@ "HTTPBearer": [] } ], - "summary": "Create Integration", + "summary": "Handle Inbound", "tags": [ - "Integration" + "Inbound" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "const integrationOut = await svix.integration.create(\"app_id\", {\n name: \"Example Integration\"\n});" + "source": "const messageOut = await svix.inbound.msg(\"app_id\", \"inbound_token\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const integrationOut = await svix.integration.create(\"app_id\", {\n name: \"Example Integration\"\n});" + "source": "const messageOut = await svix.inbound.msg(\"app_id\", \"inbound_token\");" }, { "label": "Python", "lang": "Python", - "source": "integration_out = svix.integration.create(\"app_id\", IntegrationIn(\n name=\"Example Integration\"\n), None)" + "source": "message_out = svix.inbound.msg(\"app_id\", \"inbound_token\", None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "integration_out = await svix.integration.create(\"app_id\", IntegrationIn(\n name=\"Example Integration\"\n), None)" + "source": "message_out = await svix.inbound.msg(\"app_id\", \"inbound_token\", None)" }, { "label": "Go", "lang": "Go", - "source": "integrationOut, err := svixClient.Integration.Create(ctx, \"app_id\", &IntegrationIn{\n Name: \"Example Integration\",\n})" + "source": "messageOut, err := svixClient.Inbound.Msg(ctx, \"app_id\", \"inbound_token\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val integrationOut = svix.integration.create(\"app_id\", IntegrationIn()\n .name(\"Example Integration\")\n)" + "source": "val messageOut = svix.inbound.msg(\"app_id\", \"inbound_token\")" }, { "label": "Java", "lang": "Java", - "source": "IntegrationOut integrationOut = svix.getIntegration().create(\"app_id\", new IntegrationIn()\n .name(\"Example Integration\")\n)" + "source": "MessageOut messageOut = svix.getInbound().msg(\"app_id\", \"inbound_token\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "integration_out = svix.integration.create(\"app_id\", Svix::IntegrationIn.new({\n \"name\": \"Example Integration\"\n}))" + "source": "message_out = svix.inbound.msg(\"app_id\", \"inbound_token\")" }, { "label": "Rust", "lang": "Rust", - "source": "let integration_out = svix.integration().create(\"app_id\", IntegrationIn {\n name: \"Example Integration\".to_string(),\n}, None).await?;" + "source": "let message_out = svix.inbound().msg(\"app_id\", \"inbound_token\", None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var integrationOut = await svix.Integration.CreateAsync(\"app_id\", new IntegrationIn{\n name: \"Example Integration\"\n})" + "source": "var messageOut = await svix.Inbound.MsgAsync(\"app_id\", \"inbound_token\")" }, { "label": "CLI", "lang": "Shell", - "source": "svix integration create \"app_id\" '{\n \"name\": \"Example Integration\"\n}'" + "source": "svix inbound msg \"app_id\" \"inbound_token\"" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/integration/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"Example Integration\"\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/inbound/msg/{inbound_token}/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] } }, - "/api/v1/app/{app_id}/integration/{integ_id}/": { - "delete": { - "description": "Delete an integration.", - "operationId": "v1.integration.delete", + "/api/v1/app/{app_id}/inbound/rotate-url/": { + "post": { + "description": "Invalidates the previous inbound url (if one exists), producing a new inbound\nURL for this app", + "operationId": "v1.inbound.rotate-url", "parameters": [ { "description": "The app's ID or UID", @@ -10190,21 +10365,25 @@ "style": "simple" }, { - "description": "The integ's ID", - "in": "path", - "name": "integ_id", - "required": true, + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", "schema": { - "description": "The integ's ID", - "example": "integ_1srOrx2ZWZBpBUvZwXKQmoEYga2", "type": "string" }, "style": "simple" } ], "responses": { - "204": { - "description": "no content" + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RotatedUrlOut" + } + } + }, + "description": "" }, "400": { "content": { @@ -10282,60 +10461,635 @@ "HTTPBearer": [] } ], - "summary": "Delete Integration", + "summary": "Rotate Url", "tags": [ - "Integration" + "Inbound" ], "x-codeSamples": [ { "label": "JavaScript", "lang": "JavaScript", - "source": "await svix.integration.delete(\"app_id\", \"integ_id\");" + "source": "const rotatedUrlOut = await svix.inbound.rotateUrl(\"app_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "await svix.integration.delete(\"app_id\", \"integ_id\");" + "source": "const rotatedUrlOut = await svix.inbound.rotateUrl(\"app_id\");" }, { "label": "Python", "lang": "Python", - "source": "svix.integration.delete(\"app_id\", \"integ_id\")" + "source": "rotated_url_out = svix.inbound.rotate_url(\"app_id\", None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.integration.delete(\"app_id\", \"integ_id\")" + "source": "rotated_url_out = await svix.inbound.rotate_url(\"app_id\", None)" }, { "label": "Go", "lang": "Go", - "source": "err := svixClient.Integration.Delete(ctx, \"app_id\", \"integ_id\")" + "source": "rotatedUrlOut, err := svixClient.Inbound.RotateUrl(ctx, \"app_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "svix.integration.delete(\"app_id\", \"integ_id\")" + "source": "val rotatedUrlOut = svix.inbound.rotateUrl(\"app_id\")" }, { "label": "Java", "lang": "Java", - "source": "svix.getIntegration().delete(\"app_id\", \"integ_id\")" + "source": "RotatedUrlOut rotatedUrlOut = svix.getInbound().rotateUrl(\"app_id\")" }, { "label": "Ruby", "lang": "Ruby", - "source": "svix.integration.delete(\"app_id\", \"integ_id\")" + "source": "rotated_url_out = svix.inbound.rotate_url(\"app_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "svix.integration().delete(\"app_id\", \"integ_id\").await?;" + "source": "let rotated_url_out = svix.inbound().rotate_url(\"app_id\", None).await?;" }, { "label": "C#", "lang": "C#", - "source": "await svix.Integration.DeleteAsync(\"app_id\", \"integ_id\")" + "source": "var rotatedUrlOut = await svix.Inbound.RotateUrlAsync(\"app_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix inbound rotate-url \"app_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/inbound/rotate-url/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/app/{app_id}/integration/": { + "get": { + "description": "List the application's integrations.", + "operationId": "v1.integration.list", + "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": "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": "integ_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "nullable": true, + "type": "string" + }, + "style": "form" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListResponse_IntegrationOut_" + } + } + }, + "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 Integrations", + "tags": [ + "Integration" + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const listResponseIntegrationOut = await svix.integration.list(\"app_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const listResponseIntegrationOut = await svix.integration.list(\"app_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "list_response_integration_out = svix.integration.list(\"app_id\", None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "list_response_integration_out = await svix.integration.list(\"app_id\", None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "listResponseIntegrationOut, err := svixClient.Integration.List(ctx, \"app_id\", nil)" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val listResponseIntegrationOut = svix.integration.list(\"app_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "ListResponseIntegrationOut listResponseIntegrationOut = svix.getIntegration().list(\"app_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "list_response_integration_out = svix.integration.list(\"app_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let list_response_integration_out = svix.integration().list(\"app_id\", None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var listResponseIntegrationOut = await svix.Integration.ListAsync(\"app_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix integration list \"app_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/integration/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + }, + "post": { + "description": "Create an integration.", + "operationId": "v1.integration.create", + "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" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IntegrationIn" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IntegrationOut" + } + } + }, + "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 Integration", + "tags": [ + "Integration" + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const integrationOut = await svix.integration.create(\"app_id\", {\n name: \"Example Integration\"\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const integrationOut = await svix.integration.create(\"app_id\", {\n name: \"Example Integration\"\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "integration_out = svix.integration.create(\"app_id\", IntegrationIn(\n name=\"Example Integration\"\n), None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "integration_out = await svix.integration.create(\"app_id\", IntegrationIn(\n name=\"Example Integration\"\n), None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "integrationOut, err := svixClient.Integration.Create(ctx, \"app_id\", &IntegrationIn{\n Name: \"Example Integration\",\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val integrationOut = svix.integration.create(\"app_id\", IntegrationIn()\n .name(\"Example Integration\")\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "IntegrationOut integrationOut = svix.getIntegration().create(\"app_id\", new IntegrationIn()\n .name(\"Example Integration\")\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "integration_out = svix.integration.create(\"app_id\", Svix::IntegrationIn.new({\n \"name\": \"Example Integration\"\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let integration_out = svix.integration().create(\"app_id\", IntegrationIn {\n name: \"Example Integration\".to_string(),\n}, None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var integrationOut = await svix.Integration.CreateAsync(\"app_id\", new IntegrationIn{\n name: \"Example Integration\"\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix integration create \"app_id\" '{\n \"name\": \"Example Integration\"\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/integration/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"Example Integration\"\n }'" + } + ] + } + }, + "/api/v1/app/{app_id}/integration/{integ_id}/": { + "delete": { + "description": "Delete an integration.", + "operationId": "v1.integration.delete", + "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 integ's ID", + "in": "path", + "name": "integ_id", + "required": true, + "schema": { + "description": "The integ's ID", + "example": "integ_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "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 Integration", + "tags": [ + "Integration" + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "await svix.integration.delete(\"app_id\", \"integ_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "await svix.integration.delete(\"app_id\", \"integ_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "svix.integration.delete(\"app_id\", \"integ_id\")" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "await svix.integration.delete(\"app_id\", \"integ_id\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "err := svixClient.Integration.Delete(ctx, \"app_id\", \"integ_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "svix.integration.delete(\"app_id\", \"integ_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "svix.getIntegration().delete(\"app_id\", \"integ_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "svix.integration.delete(\"app_id\", \"integ_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "svix.integration().delete(\"app_id\", \"integ_id\").await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "await svix.Integration.DeleteAsync(\"app_id\", \"integ_id\")" }, { "label": "CLI", @@ -15000,7 +15754,115 @@ "description": "The sorting order of the returned items", "nullable": true }, - "style": "form" + "style": "form" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListResponse_BackgroundTaskOut_" + } + } + }, + "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 Background Tasks", + "tags": [ + "Background Tasks" + ] + } + }, + "/api/v1/background-task/{task_id}/": { + "get": { + "description": "Get a background task by ID.", + "operationId": "get_background_task", + "parameters": [ + { + "in": "path", + "name": "task_id", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" } ], "responses": { @@ -15008,7 +15870,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListResponse_BackgroundTaskOut_" + "$ref": "#/components/schemas/BackgroundTaskOut" } } }, @@ -15090,33 +15952,22 @@ "HTTPBearer": [] } ], - "summary": "List Background Tasks", + "summary": "Get Background Task", "tags": [ "Background Tasks" ] } }, - "/api/v1/background-task/{task_id}/": { + "/api/v1/environment/export/": { "get": { - "description": "Get a background task by ID.", - "operationId": "get_background_task", - "parameters": [ - { - "in": "path", - "name": "task_id", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - ], + "description": "Download a JSON file containing all org-settings and event types", + "operationId": "v1.environment.export.get", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BackgroundTaskOut" + "$ref": "#/components/schemas/EnvironmentOut" } } }, @@ -15198,13 +16049,73 @@ "HTTPBearer": [] } ], - "summary": "Get Background Task", + "summary": "Export Environment Configuration", "tags": [ - "Background Tasks" + "Environment" + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const environmentOut = await svix.environment.export();" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const environmentOut = await svix.environment.export();" + }, + { + "label": "Python", + "lang": "Python", + "source": "environment_out = svix.environment.export()" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "environment_out = await svix.environment.export()" + }, + { + "label": "Go", + "lang": "Go", + "source": "environmentOut, err := svixClient.Environment.Export(ctx)" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val environmentOut = svix.environment.export()" + }, + { + "label": "Java", + "lang": "Java", + "source": "EnvironmentOut environmentOut = svix.getEnvironment().export()" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "environment_out = svix.environment.export()" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let environment_out = svix.environment().export().await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var environmentOut = await svix.Environment.ExportAsync()" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix environment export " + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/environment/export/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } ] - } - }, - "/api/v1/environment/export/": { + }, "post": { "description": "Download a JSON file containing all org-settings and event types", "operationId": "v1.environment.export", @@ -15219,16 +16130,6 @@ "style": "simple" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ExportEnvironmentIn" - } - } - }, - "required": true - }, "responses": { "200": { "content": { @@ -15324,62 +16225,62 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const environmentOut = await svix.environment.export(\n});" + "source": "const environmentOut = await svix.environment.export();" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const environmentOut = await svix.environment.export(\n});" + "source": "const environmentOut = await svix.environment.export();" }, { "label": "Python", "lang": "Python", - "source": "environment_out = svix.environment.export(ExportEnvironmentIn\n), None)" + "source": "environment_out = svix.environment.export(None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "environment_out = await svix.environment.export(ExportEnvironmentIn\n), None)" + "source": "environment_out = await svix.environment.export(None)" }, { "label": "Go", "lang": "Go", - "source": "environmentOut, err := svixClient.Environment.Export(ctx, &ExportEnvironmentIn{\n})" + "source": "environmentOut, err := svixClient.Environment.Export(ctx)" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val environmentOut = svix.environment.export(ExportEnvironmentIn()\n)" + "source": "val environmentOut = svix.environment.export()" }, { "label": "Java", "lang": "Java", - "source": "EnvironmentOut environmentOut = svix.getEnvironment().export(new ExportEnvironmentIn()\n)" + "source": "EnvironmentOut environmentOut = svix.getEnvironment().export()" }, { "label": "Ruby", "lang": "Ruby", - "source": "environment_out = svix.environment.export(Svix::ExportEnvironmentIn.new(\n}))" + "source": "environment_out = svix.environment.export()" }, { "label": "Rust", "lang": "Rust", - "source": "let environment_out = svix.environment().export(ExportEnvironmentIn {\n}, None).await?;" + "source": "let environment_out = svix.environment().export(None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var environmentOut = await svix.Environment.ExportAsync(new ExportEnvironmentIn\n})" + "source": "var environmentOut = await svix.Environment.ExportAsync()" }, { "label": "CLI", "lang": "Shell", - "source": "svix environment export '\n}'" + "source": "svix environment export " }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/environment/export/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/environment/export/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" } ] } @@ -15650,7 +16551,7 @@ ], "summary": "Get Org Settings", "tags": [ - "Environment-Settings" + "Environment" ], "x-codeSamples": [ { @@ -18767,6 +19668,186 @@ ] } }, + "/api/v1/transformation-template/generate": { + "post": { + "description": "Use OpenAI's Completion API to generate code for a transformation template", + "operationId": "v1.transformation-template.generate", + "parameters": [ + { + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateIn" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateOut" + } + } + }, + "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": "Generate", + "tags": [ + "Transformation Template" + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const generateOut = await svix.transformationTemplate.generate(\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const generateOut = await svix.transformationTemplate.generate(\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "generate_out = svix.transformation_template.generate(GenerateIn\n), None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "generate_out = await svix.transformation_template.generate(GenerateIn\n), None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "generateOut, err := svixClient.TransformationTemplate.Generate(ctx, &GenerateIn{\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val generateOut = svix.transformationTemplate.generate(GenerateIn()\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "GenerateOut generateOut = svix.getTransformationTemplate().generate(new GenerateIn()\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "generate_out = svix.transformation_template.generate(Svix::GenerateIn.new(\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let generate_out = svix.transformation_template().generate(GenerateIn {\n}, None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var generateOut = await svix.TransformationTemplate.GenerateAsync(new GenerateIn\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix transformation-template generate '\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/transformation-template/generate' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '\n }'" + } + ] + } + }, "/api/v1/transformation-template/oauth/discord": { "post": { "description": "Get Discord Incoming webhook URL",