From 372023ffa38dbe3d026e6b4283282cbfaab6d57d Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Tue, 23 Jan 2024 17:42:04 -0500 Subject: [PATCH] Bump openapi generator to 7.2.0 and openapi-generator-cli This works around a crash that we're hitting with an updated openapi spec --- go/internal/openapi/api_application.go | 691 +++-- go/internal/openapi/api_authentication.go | 424 +-- go/internal/openapi/api_background_tasks.go | 202 +- go/internal/openapi/api_broadcast.go | 107 +- go/internal/openapi/api_endpoint.go | 1531 +++++----- go/internal/openapi/api_environment.go | 255 +- .../openapi/api_environment_settings.go | 104 +- go/internal/openapi/api_event_type.go | 1136 ++++--- go/internal/openapi/api_health.go | 98 +- go/internal/openapi/api_inbound.go | 210 +- go/internal/openapi/api_integration.go | 612 ++-- go/internal/openapi/api_message.go | 672 +++-- go/internal/openapi/api_message_attempt.go | 1078 ++++--- go/internal/openapi/api_statistics.go | 359 +-- .../openapi/api_transformation_template.go | 821 ++--- go/internal/openapi/client.go | 72 +- go/internal/openapi/configuration.go | 28 +- .../model_aggregate_event_types_out.go | 80 +- .../openapi/model_app_portal_access_in.go | 41 +- .../openapi/model_app_portal_access_out.go | 75 +- .../openapi/model_app_usage_stats_in.go | 85 +- .../openapi/model_app_usage_stats_out.go | 80 +- go/internal/openapi/model_application_in.go | 88 +- go/internal/openapi/model_application_out.go | 106 +- .../openapi/model_application_patch.go | 49 +- .../openapi/model_application_stats.go | 81 +- .../model_application_token_expire_in.go | 29 +- .../openapi/model_attempt_statistics_data.go | 45 +- .../model_attempt_statistics_response.go | 85 +- .../openapi/model_background_task_out.go | 91 +- .../openapi/model_background_task_status.go | 21 +- .../openapi/model_background_task_type.go | 21 +- .../openapi/model_border_radius_config.go | 49 +- .../openapi/model_border_radius_enum.go | 21 +- .../openapi/model_completion_choice.go | 80 +- .../openapi/model_completion_message.go | 75 +- .../openapi/model_custom_color_palette.go | 97 +- .../openapi/model_custom_theme_override.go | 41 +- .../openapi/model_dashboard_access_out.go | 75 +- .../openapi/model_endpoint_created_event.go | 75 +- .../model_endpoint_created_event_data.go | 87 +- .../openapi/model_endpoint_deleted_event.go | 75 +- .../model_endpoint_deleted_event_data.go | 87 +- .../openapi/model_endpoint_disabled_event.go | 75 +- .../model_endpoint_disabled_event_data.go | 92 +- .../openapi/model_endpoint_headers_in.go | 70 +- .../openapi/model_endpoint_headers_out.go | 79 +- .../model_endpoint_headers_patch_in.go | 70 +- go/internal/openapi/model_endpoint_in.go | 136 +- .../openapi/model_endpoint_message_out.go | 118 +- go/internal/openapi/model_endpoint_out.go | 148 +- go/internal/openapi/model_endpoint_patch.go | 101 +- .../openapi/model_endpoint_secret_out.go | 70 +- .../model_endpoint_secret_rotate_in.go | 33 +- go/internal/openapi/model_endpoint_stats.go | 85 +- .../model_endpoint_transformation_in.go | 37 +- .../model_endpoint_transformation_out.go | 37 +- ...del_endpoint_transformation_simulate_in.go | 96 +- ...el_endpoint_transformation_simulate_out.go | 83 +- go/internal/openapi/model_endpoint_update.go | 132 +- .../openapi/model_endpoint_updated_event.go | 75 +- .../model_endpoint_updated_event_data.go | 87 +- go/internal/openapi/model_environment_in.go | 95 +- go/internal/openapi/model_environment_out.go | 99 +- .../openapi/model_environment_settings_out.go | 97 +- go/internal/openapi/model_event_example_in.go | 70 +- .../openapi/model_event_type_example_out.go | 76 +- .../model_event_type_import_open_api_in.go | 41 +- .../model_event_type_import_open_api_out.go | 70 +- ...del_event_type_import_open_api_out_data.go | 74 +- go/internal/openapi/model_event_type_in.go | 103 +- go/internal/openapi/model_event_type_out.go | 115 +- go/internal/openapi/model_event_type_patch.go | 57 +- .../openapi/model_event_type_schema_in.go | 76 +- .../openapi/model_event_type_update.go | 96 +- .../openapi/model_export_event_type_out.go | 80 +- go/internal/openapi/model_font_size_config.go | 29 +- go/internal/openapi/model_generate_in.go | 70 +- go/internal/openapi/model_generate_out.go | 96 +- go/internal/openapi/model_http_error_out.go | 75 +- .../openapi/model_http_validation_error.go | 74 +- .../openapi/model_inbound_path_params.go | 75 +- go/internal/openapi/model_integration_in.go | 70 +- .../openapi/model_integration_key_out.go | 70 +- go/internal/openapi/model_integration_out.go | 85 +- .../openapi/model_integration_update.go | 70 +- .../model_list_response_application_out_.go | 91 +- .../model_list_response_application_stats_.go | 91 +- ...odel_list_response_background_task_out_.go | 91 +- ...del_list_response_endpoint_message_out_.go | 91 +- .../model_list_response_endpoint_out_.go | 91 +- .../model_list_response_event_type_out_.go | 91 +- .../model_list_response_integration_out_.go | 91 +- ..._response_message_attempt_endpoint_out_.go | 91 +- ...odel_list_response_message_attempt_out_.go | 91 +- ...del_list_response_message_endpoint_out_.go | 91 +- .../model_list_response_message_out_.go | 91 +- .../model_list_response_template_out_.go | 91 +- .../model_message_attempt_endpoint_out.go | 128 +- .../model_message_attempt_exhausted_event.go | 75 +- ...el_message_attempt_exhausted_event_data.go | 99 +- .../model_message_attempt_failed_data.go | 80 +- .../model_message_attempt_failing_event.go | 75 +- ...odel_message_attempt_failing_event_data.go | 99 +- .../model_message_attempt_headers_out.go | 89 +- .../openapi/model_message_attempt_out.go | 128 +- .../model_message_attempt_recovered_event.go | 75 +- ...el_message_attempt_recovered_event_data.go | 99 +- .../model_message_attempt_trigger_type.go | 21 +- .../openapi/model_message_broadcast_in.go | 105 +- .../openapi/model_message_broadcast_out.go | 80 +- .../openapi/model_message_endpoint_out.go | 152 +- go/internal/openapi/model_message_in.go | 163 +- go/internal/openapi/model_message_out.go | 105 +- .../openapi/model_message_raw_payload_out.go | 70 +- go/internal/openapi/model_message_status.go | 21 +- .../openapi/model_message_stream_out.go | 84 +- go/internal/openapi/model_oauth_payload_in.go | 75 +- .../openapi/model_oauth_payload_out.go | 37 +- .../openapi/model_one_time_token_in.go | 70 +- .../openapi/model_one_time_token_out.go | 70 +- go/internal/openapi/model_ordering.go | 21 +- go/internal/openapi/model_recover_in.go | 76 +- go/internal/openapi/model_recover_out.go | 80 +- go/internal/openapi/model_replay_in.go | 76 +- go/internal/openapi/model_replay_out.go | 80 +- go/internal/openapi/model_rotated_url_out.go | 70 +- go/internal/openapi/model_settings_in.go | 133 +- go/internal/openapi/model_settings_out.go | 133 +- .../openapi/model_statistics_period.go | 21 +- .../openapi/model_status_code_class.go | 21 +- go/internal/openapi/model_template_in.go | 126 +- go/internal/openapi/model_template_out.go | 145 +- go/internal/openapi/model_template_patch.go | 91 +- go/internal/openapi/model_template_update.go | 127 +- .../model_transformation_http_method.go | 21 +- .../model_transformation_simulate_in.go | 96 +- .../model_transformation_simulate_out.go | 83 +- .../model_transformation_template_kind.go | 21 +- go/internal/openapi/model_validation_error.go | 84 +- go/internal/openapi/response.go | 12 +- go/internal/openapi/utils.go | 31 +- openapitools.json | 2 +- package.json | 2 +- regen_openapi.sh | 2 +- yarn.lock | 2638 ++++++++++------- 146 files changed, 13579 insertions(+), 7331 deletions(-) diff --git a/go/internal/openapi/api_application.go b/go/internal/openapi/api_application.go index ce5905bb7..07cf15ced 100644 --- a/go/internal/openapi/api_application.go +++ b/go/internal/openapi/api_application.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,89 +12,90 @@ package openapi import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" "strings" "time" ) -// Linger please -var ( - _ _context.Context -) -// ApplicationApiService ApplicationApi service -type ApplicationApiService service +// ApplicationAPIService ApplicationAPI service +type ApplicationAPIService service type ApiGetAppUsageStatsApiV1AppStatsUsageGetRequest struct { - ctx _context.Context - ApiService *ApplicationApiService + ctx context.Context + ApiService *ApplicationAPIService since *time.Time until *time.Time limit *int32 iterator *string } +// Filter the range to data after this date func (r ApiGetAppUsageStatsApiV1AppStatsUsageGetRequest) Since(since time.Time) ApiGetAppUsageStatsApiV1AppStatsUsageGetRequest { r.since = &since return r } + +// Filter the range to data before this date func (r ApiGetAppUsageStatsApiV1AppStatsUsageGetRequest) Until(until time.Time) ApiGetAppUsageStatsApiV1AppStatsUsageGetRequest { r.until = &until return r } + +// Limit the number of returned items func (r ApiGetAppUsageStatsApiV1AppStatsUsageGetRequest) Limit(limit int32) ApiGetAppUsageStatsApiV1AppStatsUsageGetRequest { r.limit = &limit return r } + +// The iterator to use (depends on the chosen ordering) func (r ApiGetAppUsageStatsApiV1AppStatsUsageGetRequest) Iterator(iterator string) ApiGetAppUsageStatsApiV1AppStatsUsageGetRequest { r.iterator = &iterator return r } -func (r ApiGetAppUsageStatsApiV1AppStatsUsageGetRequest) Execute() (ListResponseApplicationStats, *_nethttp.Response, error) { +func (r ApiGetAppUsageStatsApiV1AppStatsUsageGetRequest) Execute() (*ListResponseApplicationStats, *http.Response, error) { return r.ApiService.GetAppUsageStatsApiV1AppStatsUsageGetExecute(r) } /* - * GetAppUsageStatsApiV1AppStatsUsageGet Get App Usage Stats - * Get basic statistics for all applications. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetAppUsageStatsApiV1AppStatsUsageGetRequest - */ -func (a *ApplicationApiService) GetAppUsageStatsApiV1AppStatsUsageGet(ctx _context.Context) ApiGetAppUsageStatsApiV1AppStatsUsageGetRequest { +GetAppUsageStatsApiV1AppStatsUsageGet Get App Usage Stats + +Get basic statistics for all applications. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetAppUsageStatsApiV1AppStatsUsageGetRequest +*/ +func (a *ApplicationAPIService) GetAppUsageStatsApiV1AppStatsUsageGet(ctx context.Context) ApiGetAppUsageStatsApiV1AppStatsUsageGetRequest { return ApiGetAppUsageStatsApiV1AppStatsUsageGetRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return ListResponseApplicationStats - */ -func (a *ApplicationApiService) GetAppUsageStatsApiV1AppStatsUsageGetExecute(r ApiGetAppUsageStatsApiV1AppStatsUsageGetRequest) (ListResponseApplicationStats, *_nethttp.Response, error) { +// Execute executes the request +// @return ListResponseApplicationStats +func (a *ApplicationAPIService) GetAppUsageStatsApiV1AppStatsUsageGetExecute(r ApiGetAppUsageStatsApiV1AppStatsUsageGetRequest) (*ListResponseApplicationStats, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ListResponseApplicationStats + formFiles []formFile + localVarReturnValue *ListResponseApplicationStats ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ApplicationApiService.GetAppUsageStatsApiV1AppStatsUsageGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ApplicationAPIService.GetAppUsageStatsApiV1AppStatsUsageGet") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/stats/usage/" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.since == nil { return localVarReturnValue, nil, reportError("since is required and must be specified") } @@ -102,13 +103,16 @@ func (a *ApplicationApiService) GetAppUsageStatsApiV1AppStatsUsageGetExecute(r A return localVarReturnValue, nil, reportError("until is required and must be specified") } - localVarQueryParams.Add("since", parameterToString(*r.since, "")) - localVarQueryParams.Add("until", parameterToString(*r.until, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "since", r.since, "") + parameterAddToHeaderOrQuery(localVarQueryParams, "until", r.until, "") if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } else { + var defaultValue int32 = 50 + r.limit = &defaultValue } if r.iterator != nil { - localVarQueryParams.Add("iterator", parameterToString(*r.iterator, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "iterator", r.iterator, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -127,7 +131,7 @@ func (a *ApplicationApiService) GetAppUsageStatsApiV1AppStatsUsageGetExecute(r A if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -137,15 +141,15 @@ func (a *ApplicationApiService) GetAppUsageStatsApiV1AppStatsUsageGetExecute(r A return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -156,7 +160,8 @@ func (a *ApplicationApiService) GetAppUsageStatsApiV1AppStatsUsageGetExecute(r A newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -166,7 +171,8 @@ func (a *ApplicationApiService) GetAppUsageStatsApiV1AppStatsUsageGetExecute(r A newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -176,7 +182,8 @@ func (a *ApplicationApiService) GetAppUsageStatsApiV1AppStatsUsageGetExecute(r A newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -186,7 +193,8 @@ func (a *ApplicationApiService) GetAppUsageStatsApiV1AppStatsUsageGetExecute(r A newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -196,7 +204,8 @@ func (a *ApplicationApiService) GetAppUsageStatsApiV1AppStatsUsageGetExecute(r A newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -206,7 +215,8 @@ func (a *ApplicationApiService) GetAppUsageStatsApiV1AppStatsUsageGetExecute(r A newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -216,14 +226,15 @@ func (a *ApplicationApiService) GetAppUsageStatsApiV1AppStatsUsageGetExecute(r A newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -234,8 +245,8 @@ func (a *ApplicationApiService) GetAppUsageStatsApiV1AppStatsUsageGetExecute(r A } type ApiV1ApplicationCreateRequest struct { - ctx _context.Context - ApiService *ApplicationApiService + ctx context.Context + ApiService *ApplicationAPIService applicationIn *ApplicationIn getIfExists *bool idempotencyKey *string @@ -245,62 +256,67 @@ func (r ApiV1ApplicationCreateRequest) ApplicationIn(applicationIn ApplicationIn r.applicationIn = &applicationIn return r } + +// Get an existing application, or create a new one if doesn't exist. It's two separate functions in the libs. func (r ApiV1ApplicationCreateRequest) GetIfExists(getIfExists bool) ApiV1ApplicationCreateRequest { r.getIfExists = &getIfExists return r } + +// The request's idempotency key func (r ApiV1ApplicationCreateRequest) IdempotencyKey(idempotencyKey string) ApiV1ApplicationCreateRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1ApplicationCreateRequest) Execute() (ApplicationOut, *_nethttp.Response, error) { +func (r ApiV1ApplicationCreateRequest) Execute() (*ApplicationOut, *http.Response, error) { return r.ApiService.V1ApplicationCreateExecute(r) } /* - * V1ApplicationCreate Create Application - * Create a new application. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiV1ApplicationCreateRequest - */ -func (a *ApplicationApiService) V1ApplicationCreate(ctx _context.Context) ApiV1ApplicationCreateRequest { +V1ApplicationCreate Create Application + +Create a new application. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiV1ApplicationCreateRequest +*/ +func (a *ApplicationAPIService) V1ApplicationCreate(ctx context.Context) ApiV1ApplicationCreateRequest { return ApiV1ApplicationCreateRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return ApplicationOut - */ -func (a *ApplicationApiService) V1ApplicationCreateExecute(r ApiV1ApplicationCreateRequest) (ApplicationOut, *_nethttp.Response, error) { +// Execute executes the request +// @return ApplicationOut +func (a *ApplicationAPIService) V1ApplicationCreateExecute(r ApiV1ApplicationCreateRequest) (*ApplicationOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ApplicationOut + formFiles []formFile + localVarReturnValue *ApplicationOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ApplicationApiService.V1ApplicationCreate") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ApplicationAPIService.V1ApplicationCreate") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.applicationIn == nil { return localVarReturnValue, nil, reportError("applicationIn is required and must be specified") } if r.getIfExists != nil { - localVarQueryParams.Add("get_if_exists", parameterToString(*r.getIfExists, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "get_if_exists", r.getIfExists, "") + } else { + var defaultValue bool = false + r.getIfExists = &defaultValue } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -320,11 +336,11 @@ func (a *ApplicationApiService) V1ApplicationCreateExecute(r ApiV1ApplicationCre localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } // body params localVarPostBody = r.applicationIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -334,15 +350,15 @@ func (a *ApplicationApiService) V1ApplicationCreateExecute(r ApiV1ApplicationCre return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -353,7 +369,8 @@ func (a *ApplicationApiService) V1ApplicationCreateExecute(r ApiV1ApplicationCre newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -363,7 +380,8 @@ func (a *ApplicationApiService) V1ApplicationCreateExecute(r ApiV1ApplicationCre newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -373,7 +391,8 @@ func (a *ApplicationApiService) V1ApplicationCreateExecute(r ApiV1ApplicationCre newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -383,7 +402,8 @@ func (a *ApplicationApiService) V1ApplicationCreateExecute(r ApiV1ApplicationCre newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -393,7 +413,8 @@ func (a *ApplicationApiService) V1ApplicationCreateExecute(r ApiV1ApplicationCre newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -403,7 +424,8 @@ func (a *ApplicationApiService) V1ApplicationCreateExecute(r ApiV1ApplicationCre newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -413,14 +435,15 @@ func (a *ApplicationApiService) V1ApplicationCreateExecute(r ApiV1ApplicationCre newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -431,24 +454,25 @@ func (a *ApplicationApiService) V1ApplicationCreateExecute(r ApiV1ApplicationCre } type ApiV1ApplicationDeleteRequest struct { - ctx _context.Context - ApiService *ApplicationApiService + ctx context.Context + ApiService *ApplicationAPIService appId string } - -func (r ApiV1ApplicationDeleteRequest) Execute() (*_nethttp.Response, error) { +func (r ApiV1ApplicationDeleteRequest) Execute() (*http.Response, error) { return r.ApiService.V1ApplicationDeleteExecute(r) } /* - * V1ApplicationDelete Delete Application - * Delete 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 ApiV1ApplicationDeleteRequest - */ -func (a *ApplicationApiService) V1ApplicationDelete(ctx _context.Context, appId string) ApiV1ApplicationDeleteRequest { +V1ApplicationDelete Delete Application + +Delete 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 ApiV1ApplicationDeleteRequest +*/ +func (a *ApplicationAPIService) V1ApplicationDelete(ctx context.Context, appId string) ApiV1ApplicationDeleteRequest { return ApiV1ApplicationDeleteRequest{ ApiService: a, ctx: ctx, @@ -456,29 +480,25 @@ func (a *ApplicationApiService) V1ApplicationDelete(ctx _context.Context, appId } } -/* - * Execute executes the request - */ -func (a *ApplicationApiService) V1ApplicationDeleteExecute(r ApiV1ApplicationDeleteRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *ApplicationAPIService) V1ApplicationDeleteExecute(r ApiV1ApplicationDeleteRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ApplicationApiService.V1ApplicationDelete") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ApplicationAPIService.V1ApplicationDelete") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return nil, reportError("appId must have at least 1 elements") } @@ -503,7 +523,7 @@ func (a *ApplicationApiService) V1ApplicationDeleteExecute(r ApiV1ApplicationDel if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -513,15 +533,15 @@ func (a *ApplicationApiService) V1ApplicationDeleteExecute(r ApiV1ApplicationDel return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -532,7 +552,8 @@ func (a *ApplicationApiService) V1ApplicationDeleteExecute(r ApiV1ApplicationDel newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -542,7 +563,8 @@ func (a *ApplicationApiService) V1ApplicationDeleteExecute(r ApiV1ApplicationDel newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -552,7 +574,8 @@ func (a *ApplicationApiService) V1ApplicationDeleteExecute(r ApiV1ApplicationDel newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -562,7 +585,8 @@ func (a *ApplicationApiService) V1ApplicationDeleteExecute(r ApiV1ApplicationDel newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -572,7 +596,8 @@ func (a *ApplicationApiService) V1ApplicationDeleteExecute(r ApiV1ApplicationDel newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -582,7 +607,8 @@ func (a *ApplicationApiService) V1ApplicationDeleteExecute(r ApiV1ApplicationDel newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -592,7 +618,8 @@ func (a *ApplicationApiService) V1ApplicationDeleteExecute(r ApiV1ApplicationDel newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -601,24 +628,25 @@ func (a *ApplicationApiService) V1ApplicationDeleteExecute(r ApiV1ApplicationDel } type ApiV1ApplicationGetRequest struct { - ctx _context.Context - ApiService *ApplicationApiService + ctx context.Context + ApiService *ApplicationAPIService appId string } - -func (r ApiV1ApplicationGetRequest) Execute() (ApplicationOut, *_nethttp.Response, error) { +func (r ApiV1ApplicationGetRequest) Execute() (*ApplicationOut, *http.Response, error) { return r.ApiService.V1ApplicationGetExecute(r) } /* - * V1ApplicationGet Get Application - * Get 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 ApiV1ApplicationGetRequest - */ -func (a *ApplicationApiService) V1ApplicationGet(ctx _context.Context, appId string) ApiV1ApplicationGetRequest { +V1ApplicationGet Get Application + +Get 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 ApiV1ApplicationGetRequest +*/ +func (a *ApplicationAPIService) V1ApplicationGet(ctx context.Context, appId string) ApiV1ApplicationGetRequest { return ApiV1ApplicationGetRequest{ ApiService: a, ctx: ctx, @@ -626,31 +654,27 @@ func (a *ApplicationApiService) V1ApplicationGet(ctx _context.Context, appId str } } -/* - * Execute executes the request - * @return ApplicationOut - */ -func (a *ApplicationApiService) V1ApplicationGetExecute(r ApiV1ApplicationGetRequest) (ApplicationOut, *_nethttp.Response, error) { +// Execute executes the request +// @return ApplicationOut +func (a *ApplicationAPIService) V1ApplicationGetExecute(r ApiV1ApplicationGetRequest) (*ApplicationOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ApplicationOut + formFiles []formFile + localVarReturnValue *ApplicationOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ApplicationApiService.V1ApplicationGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ApplicationAPIService.V1ApplicationGet") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -675,7 +699,7 @@ func (a *ApplicationApiService) V1ApplicationGetExecute(r ApiV1ApplicationGetReq if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -685,15 +709,15 @@ func (a *ApplicationApiService) V1ApplicationGetExecute(r ApiV1ApplicationGetReq return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -704,7 +728,8 @@ func (a *ApplicationApiService) V1ApplicationGetExecute(r ApiV1ApplicationGetReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -714,7 +739,8 @@ func (a *ApplicationApiService) V1ApplicationGetExecute(r ApiV1ApplicationGetReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -724,7 +750,8 @@ func (a *ApplicationApiService) V1ApplicationGetExecute(r ApiV1ApplicationGetReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -734,7 +761,8 @@ func (a *ApplicationApiService) V1ApplicationGetExecute(r ApiV1ApplicationGetReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -744,7 +772,8 @@ func (a *ApplicationApiService) V1ApplicationGetExecute(r ApiV1ApplicationGetReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -754,7 +783,8 @@ func (a *ApplicationApiService) V1ApplicationGetExecute(r ApiV1ApplicationGetReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -764,14 +794,15 @@ func (a *ApplicationApiService) V1ApplicationGetExecute(r ApiV1ApplicationGetReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -782,34 +813,39 @@ func (a *ApplicationApiService) V1ApplicationGetExecute(r ApiV1ApplicationGetReq } type ApiV1ApplicationGetStatsRequest struct { - ctx _context.Context - ApiService *ApplicationApiService + ctx context.Context + ApiService *ApplicationAPIService since *time.Time until *time.Time appId string } +// Filter the range to data starting from this date func (r ApiV1ApplicationGetStatsRequest) Since(since time.Time) ApiV1ApplicationGetStatsRequest { r.since = &since return r } + +// Filter the range to data ending by this date func (r ApiV1ApplicationGetStatsRequest) Until(until time.Time) ApiV1ApplicationGetStatsRequest { r.until = &until return r } -func (r ApiV1ApplicationGetStatsRequest) Execute() (ApplicationStats, *_nethttp.Response, error) { +func (r ApiV1ApplicationGetStatsRequest) Execute() (*ApplicationStats, *http.Response, error) { return r.ApiService.V1ApplicationGetStatsExecute(r) } /* - * V1ApplicationGetStats Get App Stats - * Get basic statistics 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 - * @return ApiV1ApplicationGetStatsRequest - */ -func (a *ApplicationApiService) V1ApplicationGetStats(ctx _context.Context, appId string) ApiV1ApplicationGetStatsRequest { +V1ApplicationGetStats Get App Stats + +Get basic statistics 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 + @return ApiV1ApplicationGetStatsRequest +*/ +func (a *ApplicationAPIService) V1ApplicationGetStats(ctx context.Context, appId string) ApiV1ApplicationGetStatsRequest { return ApiV1ApplicationGetStatsRequest{ ApiService: a, ctx: ctx, @@ -817,31 +853,27 @@ func (a *ApplicationApiService) V1ApplicationGetStats(ctx _context.Context, appI } } -/* - * Execute executes the request - * @return ApplicationStats - */ -func (a *ApplicationApiService) V1ApplicationGetStatsExecute(r ApiV1ApplicationGetStatsRequest) (ApplicationStats, *_nethttp.Response, error) { +// Execute executes the request +// @return ApplicationStats +func (a *ApplicationAPIService) V1ApplicationGetStatsExecute(r ApiV1ApplicationGetStatsRequest) (*ApplicationStats, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ApplicationStats + formFiles []formFile + localVarReturnValue *ApplicationStats ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ApplicationApiService.V1ApplicationGetStats") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ApplicationAPIService.V1ApplicationGetStats") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/stats/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.since == nil { return localVarReturnValue, nil, reportError("since is required and must be specified") } @@ -855,8 +887,8 @@ func (a *ApplicationApiService) V1ApplicationGetStatsExecute(r ApiV1ApplicationG return localVarReturnValue, nil, reportError("appId must have less than 256 elements") } - localVarQueryParams.Add("since", parameterToString(*r.since, "")) - localVarQueryParams.Add("until", parameterToString(*r.until, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "since", r.since, "") + parameterAddToHeaderOrQuery(localVarQueryParams, "until", r.until, "") // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -874,7 +906,7 @@ func (a *ApplicationApiService) V1ApplicationGetStatsExecute(r ApiV1ApplicationG if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -884,15 +916,15 @@ func (a *ApplicationApiService) V1ApplicationGetStatsExecute(r ApiV1ApplicationG return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -903,7 +935,8 @@ func (a *ApplicationApiService) V1ApplicationGetStatsExecute(r ApiV1ApplicationG newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -913,7 +946,8 @@ func (a *ApplicationApiService) V1ApplicationGetStatsExecute(r ApiV1ApplicationG newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -923,7 +957,8 @@ func (a *ApplicationApiService) V1ApplicationGetStatsExecute(r ApiV1ApplicationG newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -933,7 +968,8 @@ func (a *ApplicationApiService) V1ApplicationGetStatsExecute(r ApiV1ApplicationG newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -943,7 +979,8 @@ func (a *ApplicationApiService) V1ApplicationGetStatsExecute(r ApiV1ApplicationG newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -953,7 +990,8 @@ func (a *ApplicationApiService) V1ApplicationGetStatsExecute(r ApiV1ApplicationG newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -963,14 +1001,15 @@ func (a *ApplicationApiService) V1ApplicationGetStatsExecute(r ApiV1ApplicationG newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -981,76 +1020,79 @@ func (a *ApplicationApiService) V1ApplicationGetStatsExecute(r ApiV1ApplicationG } type ApiV1ApplicationListRequest struct { - ctx _context.Context - ApiService *ApplicationApiService + ctx context.Context + ApiService *ApplicationAPIService limit *int32 iterator *string order *Ordering } +// Limit the number of returned items func (r ApiV1ApplicationListRequest) Limit(limit int32) ApiV1ApplicationListRequest { r.limit = &limit return r } + +// The iterator returned from a prior invocation func (r ApiV1ApplicationListRequest) Iterator(iterator string) ApiV1ApplicationListRequest { r.iterator = &iterator return r } + +// The sorting order of the returned items func (r ApiV1ApplicationListRequest) Order(order Ordering) ApiV1ApplicationListRequest { r.order = &order return r } -func (r ApiV1ApplicationListRequest) Execute() (ListResponseApplicationOut, *_nethttp.Response, error) { +func (r ApiV1ApplicationListRequest) Execute() (*ListResponseApplicationOut, *http.Response, error) { return r.ApiService.V1ApplicationListExecute(r) } /* - * V1ApplicationList List Applications - * List of all the organization's applications. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiV1ApplicationListRequest - */ -func (a *ApplicationApiService) V1ApplicationList(ctx _context.Context) ApiV1ApplicationListRequest { +V1ApplicationList List Applications + +List of all the organization's applications. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiV1ApplicationListRequest +*/ +func (a *ApplicationAPIService) V1ApplicationList(ctx context.Context) ApiV1ApplicationListRequest { return ApiV1ApplicationListRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return ListResponseApplicationOut - */ -func (a *ApplicationApiService) V1ApplicationListExecute(r ApiV1ApplicationListRequest) (ListResponseApplicationOut, *_nethttp.Response, error) { +// Execute executes the request +// @return ListResponseApplicationOut +func (a *ApplicationAPIService) V1ApplicationListExecute(r ApiV1ApplicationListRequest) (*ListResponseApplicationOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ListResponseApplicationOut + formFiles []formFile + localVarReturnValue *ListResponseApplicationOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ApplicationApiService.V1ApplicationList") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ApplicationAPIService.V1ApplicationList") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") } if r.iterator != nil { - localVarQueryParams.Add("iterator", parameterToString(*r.iterator, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "iterator", r.iterator, "") } if r.order != nil { - localVarQueryParams.Add("order", parameterToString(*r.order, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "order", r.order, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1069,7 +1111,7 @@ func (a *ApplicationApiService) V1ApplicationListExecute(r ApiV1ApplicationListR if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1079,15 +1121,15 @@ func (a *ApplicationApiService) V1ApplicationListExecute(r ApiV1ApplicationListR return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1098,7 +1140,8 @@ func (a *ApplicationApiService) V1ApplicationListExecute(r ApiV1ApplicationListR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1108,7 +1151,8 @@ func (a *ApplicationApiService) V1ApplicationListExecute(r ApiV1ApplicationListR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1118,7 +1162,8 @@ func (a *ApplicationApiService) V1ApplicationListExecute(r ApiV1ApplicationListR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1128,7 +1173,8 @@ func (a *ApplicationApiService) V1ApplicationListExecute(r ApiV1ApplicationListR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -1138,7 +1184,8 @@ func (a *ApplicationApiService) V1ApplicationListExecute(r ApiV1ApplicationListR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1148,7 +1195,8 @@ func (a *ApplicationApiService) V1ApplicationListExecute(r ApiV1ApplicationListR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1158,14 +1206,15 @@ func (a *ApplicationApiService) V1ApplicationListExecute(r ApiV1ApplicationListR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1176,8 +1225,8 @@ func (a *ApplicationApiService) V1ApplicationListExecute(r ApiV1ApplicationListR } type ApiV1ApplicationPatchRequest struct { - ctx _context.Context - ApiService *ApplicationApiService + ctx context.Context + ApiService *ApplicationAPIService appId string applicationPatch *ApplicationPatch } @@ -1187,18 +1236,20 @@ func (r ApiV1ApplicationPatchRequest) ApplicationPatch(applicationPatch Applicat return r } -func (r ApiV1ApplicationPatchRequest) Execute() (ApplicationOut, *_nethttp.Response, error) { +func (r ApiV1ApplicationPatchRequest) Execute() (*ApplicationOut, *http.Response, error) { return r.ApiService.V1ApplicationPatchExecute(r) } /* - * V1ApplicationPatch Patch Application - * Partially update 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 ApiV1ApplicationPatchRequest - */ -func (a *ApplicationApiService) V1ApplicationPatch(ctx _context.Context, appId string) ApiV1ApplicationPatchRequest { +V1ApplicationPatch Patch Application + +Partially update 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 ApiV1ApplicationPatchRequest +*/ +func (a *ApplicationAPIService) V1ApplicationPatch(ctx context.Context, appId string) ApiV1ApplicationPatchRequest { return ApiV1ApplicationPatchRequest{ ApiService: a, ctx: ctx, @@ -1206,31 +1257,27 @@ func (a *ApplicationApiService) V1ApplicationPatch(ctx _context.Context, appId s } } -/* - * Execute executes the request - * @return ApplicationOut - */ -func (a *ApplicationApiService) V1ApplicationPatchExecute(r ApiV1ApplicationPatchRequest) (ApplicationOut, *_nethttp.Response, error) { +// Execute executes the request +// @return ApplicationOut +func (a *ApplicationAPIService) V1ApplicationPatchExecute(r ApiV1ApplicationPatchRequest) (*ApplicationOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ApplicationOut + formFiles []formFile + localVarReturnValue *ApplicationOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ApplicationApiService.V1ApplicationPatch") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ApplicationAPIService.V1ApplicationPatch") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -1260,7 +1307,7 @@ func (a *ApplicationApiService) V1ApplicationPatchExecute(r ApiV1ApplicationPatc } // body params localVarPostBody = r.applicationPatch - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1270,15 +1317,15 @@ func (a *ApplicationApiService) V1ApplicationPatchExecute(r ApiV1ApplicationPatc return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1289,7 +1336,8 @@ func (a *ApplicationApiService) V1ApplicationPatchExecute(r ApiV1ApplicationPatc newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1299,7 +1347,8 @@ func (a *ApplicationApiService) V1ApplicationPatchExecute(r ApiV1ApplicationPatc newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1309,7 +1358,8 @@ func (a *ApplicationApiService) V1ApplicationPatchExecute(r ApiV1ApplicationPatc newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1319,7 +1369,8 @@ func (a *ApplicationApiService) V1ApplicationPatchExecute(r ApiV1ApplicationPatc newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -1329,7 +1380,8 @@ func (a *ApplicationApiService) V1ApplicationPatchExecute(r ApiV1ApplicationPatc newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1339,7 +1391,8 @@ func (a *ApplicationApiService) V1ApplicationPatchExecute(r ApiV1ApplicationPatc newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1349,14 +1402,15 @@ func (a *ApplicationApiService) V1ApplicationPatchExecute(r ApiV1ApplicationPatc newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1367,8 +1421,8 @@ func (a *ApplicationApiService) V1ApplicationPatchExecute(r ApiV1ApplicationPatc } type ApiV1ApplicationUpdateRequest struct { - ctx _context.Context - ApiService *ApplicationApiService + ctx context.Context + ApiService *ApplicationAPIService appId string applicationIn *ApplicationIn } @@ -1378,18 +1432,20 @@ func (r ApiV1ApplicationUpdateRequest) ApplicationIn(applicationIn ApplicationIn return r } -func (r ApiV1ApplicationUpdateRequest) Execute() (ApplicationOut, *_nethttp.Response, error) { +func (r ApiV1ApplicationUpdateRequest) Execute() (*ApplicationOut, *http.Response, error) { return r.ApiService.V1ApplicationUpdateExecute(r) } /* - * V1ApplicationUpdate Update Application - * Update 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 ApiV1ApplicationUpdateRequest - */ -func (a *ApplicationApiService) V1ApplicationUpdate(ctx _context.Context, appId string) ApiV1ApplicationUpdateRequest { +V1ApplicationUpdate Update Application + +Update 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 ApiV1ApplicationUpdateRequest +*/ +func (a *ApplicationAPIService) V1ApplicationUpdate(ctx context.Context, appId string) ApiV1ApplicationUpdateRequest { return ApiV1ApplicationUpdateRequest{ ApiService: a, ctx: ctx, @@ -1397,31 +1453,27 @@ func (a *ApplicationApiService) V1ApplicationUpdate(ctx _context.Context, appId } } -/* - * Execute executes the request - * @return ApplicationOut - */ -func (a *ApplicationApiService) V1ApplicationUpdateExecute(r ApiV1ApplicationUpdateRequest) (ApplicationOut, *_nethttp.Response, error) { +// Execute executes the request +// @return ApplicationOut +func (a *ApplicationAPIService) V1ApplicationUpdateExecute(r ApiV1ApplicationUpdateRequest) (*ApplicationOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ApplicationOut + formFiles []formFile + localVarReturnValue *ApplicationOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ApplicationApiService.V1ApplicationUpdate") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ApplicationAPIService.V1ApplicationUpdate") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -1451,7 +1503,7 @@ func (a *ApplicationApiService) V1ApplicationUpdateExecute(r ApiV1ApplicationUpd } // body params localVarPostBody = r.applicationIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1461,15 +1513,15 @@ func (a *ApplicationApiService) V1ApplicationUpdateExecute(r ApiV1ApplicationUpd return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1480,7 +1532,8 @@ func (a *ApplicationApiService) V1ApplicationUpdateExecute(r ApiV1ApplicationUpd newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1490,7 +1543,8 @@ func (a *ApplicationApiService) V1ApplicationUpdateExecute(r ApiV1ApplicationUpd newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1500,7 +1554,8 @@ func (a *ApplicationApiService) V1ApplicationUpdateExecute(r ApiV1ApplicationUpd newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1510,7 +1565,8 @@ func (a *ApplicationApiService) V1ApplicationUpdateExecute(r ApiV1ApplicationUpd newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -1520,7 +1576,8 @@ func (a *ApplicationApiService) V1ApplicationUpdateExecute(r ApiV1ApplicationUpd newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1530,7 +1587,8 @@ func (a *ApplicationApiService) V1ApplicationUpdateExecute(r ApiV1ApplicationUpd newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1540,14 +1598,15 @@ func (a *ApplicationApiService) V1ApplicationUpdateExecute(r ApiV1ApplicationUpd newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/go/internal/openapi/api_authentication.go b/go/internal/openapi/api_authentication.go index bd2611ee7..772e09379 100644 --- a/go/internal/openapi/api_authentication.go +++ b/go/internal/openapi/api_authentication.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,24 +12,20 @@ package openapi import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) -// AuthenticationApiService AuthenticationApi service -type AuthenticationApiService service +// AuthenticationAPIService AuthenticationAPI service +type AuthenticationAPIService service type ApiV1AuthenticationAppPortalAccessRequest struct { - ctx _context.Context - ApiService *AuthenticationApiService + ctx context.Context + ApiService *AuthenticationAPIService appId string appPortalAccessIn *AppPortalAccessIn idempotencyKey *string @@ -39,23 +35,27 @@ func (r ApiV1AuthenticationAppPortalAccessRequest) AppPortalAccessIn(appPortalAc r.appPortalAccessIn = &appPortalAccessIn return r } + +// The request's idempotency key func (r ApiV1AuthenticationAppPortalAccessRequest) IdempotencyKey(idempotencyKey string) ApiV1AuthenticationAppPortalAccessRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1AuthenticationAppPortalAccessRequest) Execute() (AppPortalAccessOut, *_nethttp.Response, error) { +func (r ApiV1AuthenticationAppPortalAccessRequest) Execute() (*AppPortalAccessOut, *http.Response, error) { return r.ApiService.V1AuthenticationAppPortalAccessExecute(r) } /* - * V1AuthenticationAppPortalAccess Get Consumer App Portal Access - * Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal. - * @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 ApiV1AuthenticationAppPortalAccessRequest - */ -func (a *AuthenticationApiService) V1AuthenticationAppPortalAccess(ctx _context.Context, appId string) ApiV1AuthenticationAppPortalAccessRequest { +V1AuthenticationAppPortalAccess Get Consumer App Portal Access + +Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal. + + @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 ApiV1AuthenticationAppPortalAccessRequest +*/ +func (a *AuthenticationAPIService) V1AuthenticationAppPortalAccess(ctx context.Context, appId string) ApiV1AuthenticationAppPortalAccessRequest { return ApiV1AuthenticationAppPortalAccessRequest{ ApiService: a, ctx: ctx, @@ -63,31 +63,27 @@ func (a *AuthenticationApiService) V1AuthenticationAppPortalAccess(ctx _context. } } -/* - * Execute executes the request - * @return AppPortalAccessOut - */ -func (a *AuthenticationApiService) V1AuthenticationAppPortalAccessExecute(r ApiV1AuthenticationAppPortalAccessRequest) (AppPortalAccessOut, *_nethttp.Response, error) { +// Execute executes the request +// @return AppPortalAccessOut +func (a *AuthenticationAPIService) V1AuthenticationAppPortalAccessExecute(r ApiV1AuthenticationAppPortalAccessRequest) (*AppPortalAccessOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue AppPortalAccessOut + formFiles []formFile + localVarReturnValue *AppPortalAccessOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticationApiService.V1AuthenticationAppPortalAccess") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticationAPIService.V1AuthenticationAppPortalAccess") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/auth/app-portal-access/{app_id}/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -116,11 +112,11 @@ func (a *AuthenticationApiService) V1AuthenticationAppPortalAccessExecute(r ApiV localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } // body params localVarPostBody = r.appPortalAccessIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -130,15 +126,15 @@ func (a *AuthenticationApiService) V1AuthenticationAppPortalAccessExecute(r ApiV return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -149,7 +145,8 @@ func (a *AuthenticationApiService) V1AuthenticationAppPortalAccessExecute(r ApiV newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -159,7 +156,8 @@ func (a *AuthenticationApiService) V1AuthenticationAppPortalAccessExecute(r ApiV newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -169,7 +167,8 @@ func (a *AuthenticationApiService) V1AuthenticationAppPortalAccessExecute(r ApiV newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -179,7 +178,8 @@ func (a *AuthenticationApiService) V1AuthenticationAppPortalAccessExecute(r ApiV newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -189,7 +189,8 @@ func (a *AuthenticationApiService) V1AuthenticationAppPortalAccessExecute(r ApiV newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -199,7 +200,8 @@ func (a *AuthenticationApiService) V1AuthenticationAppPortalAccessExecute(r ApiV newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -209,14 +211,15 @@ func (a *AuthenticationApiService) V1AuthenticationAppPortalAccessExecute(r ApiV newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -227,31 +230,36 @@ func (a *AuthenticationApiService) V1AuthenticationAppPortalAccessExecute(r ApiV } type ApiV1AuthenticationDashboardAccessRequest struct { - ctx _context.Context - ApiService *AuthenticationApiService + ctx context.Context + ApiService *AuthenticationAPIService appId string idempotencyKey *string } +// The request's idempotency key func (r ApiV1AuthenticationDashboardAccessRequest) IdempotencyKey(idempotencyKey string) ApiV1AuthenticationDashboardAccessRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1AuthenticationDashboardAccessRequest) Execute() (DashboardAccessOut, *_nethttp.Response, error) { +func (r ApiV1AuthenticationDashboardAccessRequest) Execute() (*DashboardAccessOut, *http.Response, error) { return r.ApiService.V1AuthenticationDashboardAccessExecute(r) } /* - * V1AuthenticationDashboardAccess Dashboard Access - * DEPRECATED: Please use `app-portal-access` instead. +V1AuthenticationDashboardAccess Dashboard Access + +DEPRECATED: Please use `app-portal-access` instead. Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal. - * @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 ApiV1AuthenticationDashboardAccessRequest - */ -func (a *AuthenticationApiService) V1AuthenticationDashboardAccess(ctx _context.Context, appId string) ApiV1AuthenticationDashboardAccessRequest { + + @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 ApiV1AuthenticationDashboardAccessRequest + +Deprecated +*/ +func (a *AuthenticationAPIService) V1AuthenticationDashboardAccess(ctx context.Context, appId string) ApiV1AuthenticationDashboardAccessRequest { return ApiV1AuthenticationDashboardAccessRequest{ ApiService: a, ctx: ctx, @@ -259,31 +267,28 @@ func (a *AuthenticationApiService) V1AuthenticationDashboardAccess(ctx _context. } } -/* - * Execute executes the request - * @return DashboardAccessOut - */ -func (a *AuthenticationApiService) V1AuthenticationDashboardAccessExecute(r ApiV1AuthenticationDashboardAccessRequest) (DashboardAccessOut, *_nethttp.Response, error) { +// Execute executes the request +// @return DashboardAccessOut +// Deprecated +func (a *AuthenticationAPIService) V1AuthenticationDashboardAccessExecute(r ApiV1AuthenticationDashboardAccessRequest) (*DashboardAccessOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue DashboardAccessOut + formFiles []formFile + localVarReturnValue *DashboardAccessOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticationApiService.V1AuthenticationDashboardAccess") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticationAPIService.V1AuthenticationDashboardAccess") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/auth/dashboard-access/{app_id}/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -309,9 +314,9 @@ func (a *AuthenticationApiService) V1AuthenticationDashboardAccessExecute(r ApiV localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -321,15 +326,15 @@ func (a *AuthenticationApiService) V1AuthenticationDashboardAccessExecute(r ApiV return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -340,7 +345,8 @@ func (a *AuthenticationApiService) V1AuthenticationDashboardAccessExecute(r ApiV newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -350,7 +356,8 @@ func (a *AuthenticationApiService) V1AuthenticationDashboardAccessExecute(r ApiV newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -360,7 +367,8 @@ func (a *AuthenticationApiService) V1AuthenticationDashboardAccessExecute(r ApiV newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -370,7 +378,8 @@ func (a *AuthenticationApiService) V1AuthenticationDashboardAccessExecute(r ApiV newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -380,7 +389,8 @@ func (a *AuthenticationApiService) V1AuthenticationDashboardAccessExecute(r ApiV newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -390,7 +400,8 @@ func (a *AuthenticationApiService) V1AuthenticationDashboardAccessExecute(r ApiV newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -400,14 +411,15 @@ func (a *AuthenticationApiService) V1AuthenticationDashboardAccessExecute(r ApiV newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -418,8 +430,8 @@ func (a *AuthenticationApiService) V1AuthenticationDashboardAccessExecute(r ApiV } type ApiV1AuthenticationExchangeOneTimeTokenRequest struct { - ctx _context.Context - ApiService *AuthenticationApiService + ctx context.Context + ApiService *AuthenticationAPIService oneTimeTokenIn *OneTimeTokenIn idempotencyKey *string } @@ -428,52 +440,52 @@ func (r ApiV1AuthenticationExchangeOneTimeTokenRequest) OneTimeTokenIn(oneTimeTo r.oneTimeTokenIn = &oneTimeTokenIn return r } + +// The request's idempotency key func (r ApiV1AuthenticationExchangeOneTimeTokenRequest) IdempotencyKey(idempotencyKey string) ApiV1AuthenticationExchangeOneTimeTokenRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1AuthenticationExchangeOneTimeTokenRequest) Execute() (OneTimeTokenOut, *_nethttp.Response, error) { +func (r ApiV1AuthenticationExchangeOneTimeTokenRequest) Execute() (*OneTimeTokenOut, *http.Response, error) { return r.ApiService.V1AuthenticationExchangeOneTimeTokenExecute(r) } /* - * V1AuthenticationExchangeOneTimeToken Exchange One Time Token - * This is a one time token - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiV1AuthenticationExchangeOneTimeTokenRequest - */ -func (a *AuthenticationApiService) V1AuthenticationExchangeOneTimeToken(ctx _context.Context) ApiV1AuthenticationExchangeOneTimeTokenRequest { +V1AuthenticationExchangeOneTimeToken Exchange One Time Token + +This is a one time token + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiV1AuthenticationExchangeOneTimeTokenRequest +*/ +func (a *AuthenticationAPIService) V1AuthenticationExchangeOneTimeToken(ctx context.Context) ApiV1AuthenticationExchangeOneTimeTokenRequest { return ApiV1AuthenticationExchangeOneTimeTokenRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return OneTimeTokenOut - */ -func (a *AuthenticationApiService) V1AuthenticationExchangeOneTimeTokenExecute(r ApiV1AuthenticationExchangeOneTimeTokenRequest) (OneTimeTokenOut, *_nethttp.Response, error) { +// Execute executes the request +// @return OneTimeTokenOut +func (a *AuthenticationAPIService) V1AuthenticationExchangeOneTimeTokenExecute(r ApiV1AuthenticationExchangeOneTimeTokenRequest) (*OneTimeTokenOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue OneTimeTokenOut + formFiles []formFile + localVarReturnValue *OneTimeTokenOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticationApiService.V1AuthenticationExchangeOneTimeToken") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticationAPIService.V1AuthenticationExchangeOneTimeToken") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/auth/one-time-token/" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.oneTimeTokenIn == nil { return localVarReturnValue, nil, reportError("oneTimeTokenIn is required and must be specified") } @@ -496,11 +508,11 @@ func (a *AuthenticationApiService) V1AuthenticationExchangeOneTimeTokenExecute(r localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } // body params localVarPostBody = r.oneTimeTokenIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -510,15 +522,15 @@ func (a *AuthenticationApiService) V1AuthenticationExchangeOneTimeTokenExecute(r return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -529,7 +541,8 @@ func (a *AuthenticationApiService) V1AuthenticationExchangeOneTimeTokenExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -539,7 +552,8 @@ func (a *AuthenticationApiService) V1AuthenticationExchangeOneTimeTokenExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -549,7 +563,8 @@ func (a *AuthenticationApiService) V1AuthenticationExchangeOneTimeTokenExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -559,7 +574,8 @@ func (a *AuthenticationApiService) V1AuthenticationExchangeOneTimeTokenExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -569,7 +585,8 @@ func (a *AuthenticationApiService) V1AuthenticationExchangeOneTimeTokenExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -579,7 +596,8 @@ func (a *AuthenticationApiService) V1AuthenticationExchangeOneTimeTokenExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -589,14 +607,15 @@ func (a *AuthenticationApiService) V1AuthenticationExchangeOneTimeTokenExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -607,8 +626,8 @@ func (a *AuthenticationApiService) V1AuthenticationExchangeOneTimeTokenExecute(r } type ApiV1AuthenticationExpireAllRequest struct { - ctx _context.Context - ApiService *AuthenticationApiService + ctx context.Context + ApiService *AuthenticationAPIService appId string applicationTokenExpireIn *ApplicationTokenExpireIn idempotencyKey *string @@ -618,23 +637,27 @@ func (r ApiV1AuthenticationExpireAllRequest) ApplicationTokenExpireIn(applicatio r.applicationTokenExpireIn = &applicationTokenExpireIn return r } + +// The request's idempotency key func (r ApiV1AuthenticationExpireAllRequest) IdempotencyKey(idempotencyKey string) ApiV1AuthenticationExpireAllRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1AuthenticationExpireAllRequest) Execute() (*_nethttp.Response, error) { +func (r ApiV1AuthenticationExpireAllRequest) Execute() (*http.Response, error) { return r.ApiService.V1AuthenticationExpireAllExecute(r) } /* - * V1AuthenticationExpireAll Expire All - * Expire all of the tokens associated with a specific 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 ApiV1AuthenticationExpireAllRequest - */ -func (a *AuthenticationApiService) V1AuthenticationExpireAll(ctx _context.Context, appId string) ApiV1AuthenticationExpireAllRequest { +V1AuthenticationExpireAll Expire All + +Expire all of the tokens associated with a specific 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 ApiV1AuthenticationExpireAllRequest +*/ +func (a *AuthenticationAPIService) V1AuthenticationExpireAll(ctx context.Context, appId string) ApiV1AuthenticationExpireAllRequest { return ApiV1AuthenticationExpireAllRequest{ ApiService: a, ctx: ctx, @@ -642,29 +665,25 @@ func (a *AuthenticationApiService) V1AuthenticationExpireAll(ctx _context.Contex } } -/* - * Execute executes the request - */ -func (a *AuthenticationApiService) V1AuthenticationExpireAllExecute(r ApiV1AuthenticationExpireAllRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *AuthenticationAPIService) V1AuthenticationExpireAllExecute(r ApiV1AuthenticationExpireAllRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticationApiService.V1AuthenticationExpireAll") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticationAPIService.V1AuthenticationExpireAll") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/auth/app/{app_id}/expire-all/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return nil, reportError("appId must have at least 1 elements") } @@ -693,11 +712,11 @@ func (a *AuthenticationApiService) V1AuthenticationExpireAllExecute(r ApiV1Authe localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } // body params localVarPostBody = r.applicationTokenExpireIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -707,15 +726,15 @@ func (a *AuthenticationApiService) V1AuthenticationExpireAllExecute(r ApiV1Authe return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -726,7 +745,8 @@ func (a *AuthenticationApiService) V1AuthenticationExpireAllExecute(r ApiV1Authe newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -736,7 +756,8 @@ func (a *AuthenticationApiService) V1AuthenticationExpireAllExecute(r ApiV1Authe newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -746,7 +767,8 @@ func (a *AuthenticationApiService) V1AuthenticationExpireAllExecute(r ApiV1Authe newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -756,7 +778,8 @@ func (a *AuthenticationApiService) V1AuthenticationExpireAllExecute(r ApiV1Authe newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -766,7 +789,8 @@ func (a *AuthenticationApiService) V1AuthenticationExpireAllExecute(r ApiV1Authe newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -776,7 +800,8 @@ func (a *AuthenticationApiService) V1AuthenticationExpireAllExecute(r ApiV1Authe newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -786,7 +811,8 @@ func (a *AuthenticationApiService) V1AuthenticationExpireAllExecute(r ApiV1Authe newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -795,57 +821,56 @@ func (a *AuthenticationApiService) V1AuthenticationExpireAllExecute(r ApiV1Authe } type ApiV1AuthenticationLogoutRequest struct { - ctx _context.Context - ApiService *AuthenticationApiService + ctx context.Context + ApiService *AuthenticationAPIService idempotencyKey *string } +// The request's idempotency key func (r ApiV1AuthenticationLogoutRequest) IdempotencyKey(idempotencyKey string) ApiV1AuthenticationLogoutRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1AuthenticationLogoutRequest) Execute() (*_nethttp.Response, error) { +func (r ApiV1AuthenticationLogoutRequest) Execute() (*http.Response, error) { return r.ApiService.V1AuthenticationLogoutExecute(r) } /* - * V1AuthenticationLogout Logout - * Logout an app token. +V1AuthenticationLogout Logout + +Logout an app token. Trying to log out other tokens will fail. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiV1AuthenticationLogoutRequest - */ -func (a *AuthenticationApiService) V1AuthenticationLogout(ctx _context.Context) ApiV1AuthenticationLogoutRequest { + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiV1AuthenticationLogoutRequest +*/ +func (a *AuthenticationAPIService) V1AuthenticationLogout(ctx context.Context) ApiV1AuthenticationLogoutRequest { return ApiV1AuthenticationLogoutRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - */ -func (a *AuthenticationApiService) V1AuthenticationLogoutExecute(r ApiV1AuthenticationLogoutRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *AuthenticationAPIService) V1AuthenticationLogoutExecute(r ApiV1AuthenticationLogoutRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticationApiService.V1AuthenticationLogout") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticationAPIService.V1AuthenticationLogout") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/auth/logout/" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -865,9 +890,9 @@ func (a *AuthenticationApiService) V1AuthenticationLogoutExecute(r ApiV1Authenti localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -877,15 +902,15 @@ func (a *AuthenticationApiService) V1AuthenticationLogoutExecute(r ApiV1Authenti return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -896,7 +921,8 @@ func (a *AuthenticationApiService) V1AuthenticationLogoutExecute(r ApiV1Authenti newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -906,7 +932,8 @@ func (a *AuthenticationApiService) V1AuthenticationLogoutExecute(r ApiV1Authenti newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -916,7 +943,8 @@ func (a *AuthenticationApiService) V1AuthenticationLogoutExecute(r ApiV1Authenti newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -926,7 +954,8 @@ func (a *AuthenticationApiService) V1AuthenticationLogoutExecute(r ApiV1Authenti newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -936,7 +965,8 @@ func (a *AuthenticationApiService) V1AuthenticationLogoutExecute(r ApiV1Authenti newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -946,7 +976,8 @@ func (a *AuthenticationApiService) V1AuthenticationLogoutExecute(r ApiV1Authenti newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -956,7 +987,8 @@ func (a *AuthenticationApiService) V1AuthenticationLogoutExecute(r ApiV1Authenti newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } diff --git a/go/internal/openapi/api_background_tasks.go b/go/internal/openapi/api_background_tasks.go index aa6c8d8b4..51ab43374 100644 --- a/go/internal/openapi/api_background_tasks.go +++ b/go/internal/openapi/api_background_tasks.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,40 +12,37 @@ package openapi import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) -// BackgroundTasksApiService BackgroundTasksApi service -type BackgroundTasksApiService service +// BackgroundTasksAPIService BackgroundTasksAPI service +type BackgroundTasksAPIService service type ApiGetBackgroundTaskRequest struct { - ctx _context.Context - ApiService *BackgroundTasksApiService + ctx context.Context + ApiService *BackgroundTasksAPIService taskId string } - -func (r ApiGetBackgroundTaskRequest) Execute() (BackgroundTaskOut, *_nethttp.Response, error) { +func (r ApiGetBackgroundTaskRequest) Execute() (*BackgroundTaskOut, *http.Response, error) { return r.ApiService.GetBackgroundTaskExecute(r) } /* - * GetBackgroundTask Get Background Task - * Get a background task by ID. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param taskId - * @return ApiGetBackgroundTaskRequest - */ -func (a *BackgroundTasksApiService) GetBackgroundTask(ctx _context.Context, taskId string) ApiGetBackgroundTaskRequest { +GetBackgroundTask Get Background Task + +Get a background task by ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param taskId + @return ApiGetBackgroundTaskRequest +*/ +func (a *BackgroundTasksAPIService) GetBackgroundTask(ctx context.Context, taskId string) ApiGetBackgroundTaskRequest { return ApiGetBackgroundTaskRequest{ ApiService: a, ctx: ctx, @@ -53,31 +50,27 @@ func (a *BackgroundTasksApiService) GetBackgroundTask(ctx _context.Context, task } } -/* - * Execute executes the request - * @return BackgroundTaskOut - */ -func (a *BackgroundTasksApiService) GetBackgroundTaskExecute(r ApiGetBackgroundTaskRequest) (BackgroundTaskOut, *_nethttp.Response, error) { +// Execute executes the request +// @return BackgroundTaskOut +func (a *BackgroundTasksAPIService) GetBackgroundTaskExecute(r ApiGetBackgroundTaskRequest) (*BackgroundTaskOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue BackgroundTaskOut + formFiles []formFile + localVarReturnValue *BackgroundTaskOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BackgroundTasksApiService.GetBackgroundTask") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BackgroundTasksAPIService.GetBackgroundTask") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/background-task/{task_id}/" - localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", _neturl.PathEscape(parameterToString(r.taskId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", url.PathEscape(parameterValueToString(r.taskId, "taskId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -96,7 +89,7 @@ func (a *BackgroundTasksApiService) GetBackgroundTaskExecute(r ApiGetBackgroundT if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -106,15 +99,15 @@ func (a *BackgroundTasksApiService) GetBackgroundTaskExecute(r ApiGetBackgroundT return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -125,7 +118,8 @@ func (a *BackgroundTasksApiService) GetBackgroundTaskExecute(r ApiGetBackgroundT newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -135,7 +129,8 @@ func (a *BackgroundTasksApiService) GetBackgroundTaskExecute(r ApiGetBackgroundT newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -145,7 +140,8 @@ func (a *BackgroundTasksApiService) GetBackgroundTaskExecute(r ApiGetBackgroundT newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -155,7 +151,8 @@ func (a *BackgroundTasksApiService) GetBackgroundTaskExecute(r ApiGetBackgroundT newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -165,7 +162,8 @@ func (a *BackgroundTasksApiService) GetBackgroundTaskExecute(r ApiGetBackgroundT newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -175,7 +173,8 @@ func (a *BackgroundTasksApiService) GetBackgroundTaskExecute(r ApiGetBackgroundT newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -185,14 +184,15 @@ func (a *BackgroundTasksApiService) GetBackgroundTaskExecute(r ApiGetBackgroundT newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -203,8 +203,8 @@ func (a *BackgroundTasksApiService) GetBackgroundTaskExecute(r ApiGetBackgroundT } type ApiListBackgroundTasksRequest struct { - ctx _context.Context - ApiService *BackgroundTasksApiService + ctx context.Context + ApiService *BackgroundTasksAPIService status *BackgroundTaskStatus task *BackgroundTaskType limit *int32 @@ -212,83 +212,90 @@ type ApiListBackgroundTasksRequest struct { order *Ordering } +// Filter the response based on the status func (r ApiListBackgroundTasksRequest) Status(status BackgroundTaskStatus) ApiListBackgroundTasksRequest { r.status = &status return r } + +// Filter the response based on the type func (r ApiListBackgroundTasksRequest) Task(task BackgroundTaskType) ApiListBackgroundTasksRequest { r.task = &task return r } + +// Limit the number of returned items func (r ApiListBackgroundTasksRequest) Limit(limit int32) ApiListBackgroundTasksRequest { r.limit = &limit return r } + +// The iterator returned from a prior invocation func (r ApiListBackgroundTasksRequest) Iterator(iterator string) ApiListBackgroundTasksRequest { r.iterator = &iterator return r } + +// The sorting order of the returned items func (r ApiListBackgroundTasksRequest) Order(order Ordering) ApiListBackgroundTasksRequest { r.order = &order return r } -func (r ApiListBackgroundTasksRequest) Execute() (ListResponseBackgroundTaskOut, *_nethttp.Response, error) { +func (r ApiListBackgroundTasksRequest) Execute() (*ListResponseBackgroundTaskOut, *http.Response, error) { return r.ApiService.ListBackgroundTasksExecute(r) } /* - * ListBackgroundTasks List Background Tasks - * List background tasks executed in the past 90 days. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiListBackgroundTasksRequest - */ -func (a *BackgroundTasksApiService) ListBackgroundTasks(ctx _context.Context) ApiListBackgroundTasksRequest { +ListBackgroundTasks List Background Tasks + +List background tasks executed in the past 90 days. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListBackgroundTasksRequest +*/ +func (a *BackgroundTasksAPIService) ListBackgroundTasks(ctx context.Context) ApiListBackgroundTasksRequest { return ApiListBackgroundTasksRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return ListResponseBackgroundTaskOut - */ -func (a *BackgroundTasksApiService) ListBackgroundTasksExecute(r ApiListBackgroundTasksRequest) (ListResponseBackgroundTaskOut, *_nethttp.Response, error) { +// Execute executes the request +// @return ListResponseBackgroundTaskOut +func (a *BackgroundTasksAPIService) ListBackgroundTasksExecute(r ApiListBackgroundTasksRequest) (*ListResponseBackgroundTaskOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ListResponseBackgroundTaskOut + formFiles []formFile + localVarReturnValue *ListResponseBackgroundTaskOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BackgroundTasksApiService.ListBackgroundTasks") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BackgroundTasksAPIService.ListBackgroundTasks") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/background-task/" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.status != nil { - localVarQueryParams.Add("status", parameterToString(*r.status, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "") } if r.task != nil { - localVarQueryParams.Add("task", parameterToString(*r.task, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "task", r.task, "") } if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") } if r.iterator != nil { - localVarQueryParams.Add("iterator", parameterToString(*r.iterator, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "iterator", r.iterator, "") } if r.order != nil { - localVarQueryParams.Add("order", parameterToString(*r.order, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "order", r.order, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -307,7 +314,7 @@ func (a *BackgroundTasksApiService) ListBackgroundTasksExecute(r ApiListBackgrou if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -317,15 +324,15 @@ func (a *BackgroundTasksApiService) ListBackgroundTasksExecute(r ApiListBackgrou return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -336,7 +343,8 @@ func (a *BackgroundTasksApiService) ListBackgroundTasksExecute(r ApiListBackgrou newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -346,7 +354,8 @@ func (a *BackgroundTasksApiService) ListBackgroundTasksExecute(r ApiListBackgrou newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -356,7 +365,8 @@ func (a *BackgroundTasksApiService) ListBackgroundTasksExecute(r ApiListBackgrou newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -366,7 +376,8 @@ func (a *BackgroundTasksApiService) ListBackgroundTasksExecute(r ApiListBackgrou newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -376,7 +387,8 @@ func (a *BackgroundTasksApiService) ListBackgroundTasksExecute(r ApiListBackgrou newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -386,7 +398,8 @@ func (a *BackgroundTasksApiService) ListBackgroundTasksExecute(r ApiListBackgrou newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -396,14 +409,15 @@ func (a *BackgroundTasksApiService) ListBackgroundTasksExecute(r ApiListBackgrou newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/go/internal/openapi/api_broadcast.go b/go/internal/openapi/api_broadcast.go index 95243eba2..0b887e024 100644 --- a/go/internal/openapi/api_broadcast.go +++ b/go/internal/openapi/api_broadcast.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,23 +12,19 @@ package openapi import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" ) -// Linger please -var ( - _ _context.Context -) -// BroadcastApiService BroadcastApi service -type BroadcastApiService service +// BroadcastAPIService BroadcastAPI service +type BroadcastAPIService service type ApiCreateBroadcastMessageRequest struct { - ctx _context.Context - ApiService *BroadcastApiService + ctx context.Context + ApiService *BroadcastAPIService messageBroadcastIn *MessageBroadcastIn idempotencyKey *string } @@ -37,52 +33,52 @@ func (r ApiCreateBroadcastMessageRequest) MessageBroadcastIn(messageBroadcastIn r.messageBroadcastIn = &messageBroadcastIn return r } + +// The request's idempotency key func (r ApiCreateBroadcastMessageRequest) IdempotencyKey(idempotencyKey string) ApiCreateBroadcastMessageRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiCreateBroadcastMessageRequest) Execute() (MessageBroadcastOut, *_nethttp.Response, error) { +func (r ApiCreateBroadcastMessageRequest) Execute() (*MessageBroadcastOut, *http.Response, error) { return r.ApiService.CreateBroadcastMessageExecute(r) } /* - * CreateBroadcastMessage Create Broadcast Message - * Creates a background task to send the same message to each application in your organization - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiCreateBroadcastMessageRequest - */ -func (a *BroadcastApiService) CreateBroadcastMessage(ctx _context.Context) ApiCreateBroadcastMessageRequest { +CreateBroadcastMessage Create Broadcast Message + +Creates a background task to send the same message to each application in your organization + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateBroadcastMessageRequest +*/ +func (a *BroadcastAPIService) CreateBroadcastMessage(ctx context.Context) ApiCreateBroadcastMessageRequest { return ApiCreateBroadcastMessageRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return MessageBroadcastOut - */ -func (a *BroadcastApiService) CreateBroadcastMessageExecute(r ApiCreateBroadcastMessageRequest) (MessageBroadcastOut, *_nethttp.Response, error) { +// Execute executes the request +// @return MessageBroadcastOut +func (a *BroadcastAPIService) CreateBroadcastMessageExecute(r ApiCreateBroadcastMessageRequest) (*MessageBroadcastOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue MessageBroadcastOut + formFiles []formFile + localVarReturnValue *MessageBroadcastOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BroadcastApiService.CreateBroadcastMessage") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BroadcastAPIService.CreateBroadcastMessage") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/msg/broadcast/" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.messageBroadcastIn == nil { return localVarReturnValue, nil, reportError("messageBroadcastIn is required and must be specified") } @@ -105,11 +101,11 @@ func (a *BroadcastApiService) CreateBroadcastMessageExecute(r ApiCreateBroadcast localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } // body params localVarPostBody = r.messageBroadcastIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -119,15 +115,15 @@ func (a *BroadcastApiService) CreateBroadcastMessageExecute(r ApiCreateBroadcast return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -138,7 +134,8 @@ func (a *BroadcastApiService) CreateBroadcastMessageExecute(r ApiCreateBroadcast newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -148,7 +145,8 @@ func (a *BroadcastApiService) CreateBroadcastMessageExecute(r ApiCreateBroadcast newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -158,7 +156,8 @@ func (a *BroadcastApiService) CreateBroadcastMessageExecute(r ApiCreateBroadcast newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -168,7 +167,8 @@ func (a *BroadcastApiService) CreateBroadcastMessageExecute(r ApiCreateBroadcast newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -178,7 +178,8 @@ func (a *BroadcastApiService) CreateBroadcastMessageExecute(r ApiCreateBroadcast newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -188,7 +189,8 @@ func (a *BroadcastApiService) CreateBroadcastMessageExecute(r ApiCreateBroadcast newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -198,14 +200,15 @@ func (a *BroadcastApiService) CreateBroadcastMessageExecute(r ApiCreateBroadcast newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/go/internal/openapi/api_endpoint.go b/go/internal/openapi/api_endpoint.go index 23a7c8086..60c7e8ee0 100644 --- a/go/internal/openapi/api_endpoint.go +++ b/go/internal/openapi/api_endpoint.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,25 +12,21 @@ package openapi import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" "strings" "time" ) -// Linger please -var ( - _ _context.Context -) -// EndpointApiService EndpointApi service -type EndpointApiService service +// EndpointAPIService EndpointAPI service +type EndpointAPIService service type ApiV1EndpointCreateRequest struct { - ctx _context.Context - ApiService *EndpointApiService + ctx context.Context + ApiService *EndpointAPIService appId string endpointIn *EndpointIn idempotencyKey *string @@ -40,25 +36,29 @@ func (r ApiV1EndpointCreateRequest) EndpointIn(endpointIn EndpointIn) ApiV1Endpo r.endpointIn = &endpointIn return r } + +// The request's idempotency key func (r ApiV1EndpointCreateRequest) IdempotencyKey(idempotencyKey string) ApiV1EndpointCreateRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1EndpointCreateRequest) Execute() (EndpointOut, *_nethttp.Response, error) { +func (r ApiV1EndpointCreateRequest) Execute() (*EndpointOut, *http.Response, error) { return r.ApiService.V1EndpointCreateExecute(r) } /* - * V1EndpointCreate Create Endpoint - * Create a new endpoint for the application. +V1EndpointCreate Create Endpoint + +Create a new endpoint for the application. When `secret` is `null` the secret is automatically generated (recommended) - * @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 ApiV1EndpointCreateRequest - */ -func (a *EndpointApiService) V1EndpointCreate(ctx _context.Context, appId string) ApiV1EndpointCreateRequest { + + @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 ApiV1EndpointCreateRequest +*/ +func (a *EndpointAPIService) V1EndpointCreate(ctx context.Context, appId string) ApiV1EndpointCreateRequest { return ApiV1EndpointCreateRequest{ ApiService: a, ctx: ctx, @@ -66,31 +66,27 @@ func (a *EndpointApiService) V1EndpointCreate(ctx _context.Context, appId string } } -/* - * Execute executes the request - * @return EndpointOut - */ -func (a *EndpointApiService) V1EndpointCreateExecute(r ApiV1EndpointCreateRequest) (EndpointOut, *_nethttp.Response, error) { +// Execute executes the request +// @return EndpointOut +func (a *EndpointAPIService) V1EndpointCreateExecute(r ApiV1EndpointCreateRequest) (*EndpointOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue EndpointOut + formFiles []formFile + localVarReturnValue *EndpointOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointCreate") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointAPIService.V1EndpointCreate") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -119,11 +115,11 @@ func (a *EndpointApiService) V1EndpointCreateExecute(r ApiV1EndpointCreateReques localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } // body params localVarPostBody = r.endpointIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -133,15 +129,15 @@ func (a *EndpointApiService) V1EndpointCreateExecute(r ApiV1EndpointCreateReques return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -152,7 +148,8 @@ func (a *EndpointApiService) V1EndpointCreateExecute(r ApiV1EndpointCreateReques newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -162,7 +159,8 @@ func (a *EndpointApiService) V1EndpointCreateExecute(r ApiV1EndpointCreateReques newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -172,7 +170,8 @@ func (a *EndpointApiService) V1EndpointCreateExecute(r ApiV1EndpointCreateReques newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -182,7 +181,8 @@ func (a *EndpointApiService) V1EndpointCreateExecute(r ApiV1EndpointCreateReques newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -192,7 +192,8 @@ func (a *EndpointApiService) V1EndpointCreateExecute(r ApiV1EndpointCreateReques newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -202,7 +203,8 @@ func (a *EndpointApiService) V1EndpointCreateExecute(r ApiV1EndpointCreateReques newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -212,14 +214,15 @@ func (a *EndpointApiService) V1EndpointCreateExecute(r ApiV1EndpointCreateReques newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -230,26 +233,27 @@ func (a *EndpointApiService) V1EndpointCreateExecute(r ApiV1EndpointCreateReques } type ApiV1EndpointDeleteRequest struct { - ctx _context.Context - ApiService *EndpointApiService + ctx context.Context + ApiService *EndpointAPIService appId string endpointId string } - -func (r ApiV1EndpointDeleteRequest) Execute() (*_nethttp.Response, error) { +func (r ApiV1EndpointDeleteRequest) Execute() (*http.Response, error) { return r.ApiService.V1EndpointDeleteExecute(r) } /* - * V1EndpointDelete Delete Endpoint - * Delete an endpoint. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param endpointId The ep's ID or UID - * @return ApiV1EndpointDeleteRequest - */ -func (a *EndpointApiService) V1EndpointDelete(ctx _context.Context, appId string, endpointId string) ApiV1EndpointDeleteRequest { +V1EndpointDelete Delete Endpoint + +Delete an endpoint. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param endpointId The ep's ID or UID + @return ApiV1EndpointDeleteRequest +*/ +func (a *EndpointAPIService) V1EndpointDelete(ctx context.Context, appId string, endpointId string) ApiV1EndpointDeleteRequest { return ApiV1EndpointDeleteRequest{ ApiService: a, ctx: ctx, @@ -258,30 +262,26 @@ func (a *EndpointApiService) V1EndpointDelete(ctx _context.Context, appId string } } -/* - * Execute executes the request - */ -func (a *EndpointApiService) V1EndpointDeleteExecute(r ApiV1EndpointDeleteRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *EndpointAPIService) V1EndpointDeleteExecute(r ApiV1EndpointDeleteRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointDelete") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointAPIService.V1EndpointDelete") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return nil, reportError("appId must have at least 1 elements") } @@ -312,7 +312,7 @@ func (a *EndpointApiService) V1EndpointDeleteExecute(r ApiV1EndpointDeleteReques if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -322,15 +322,15 @@ func (a *EndpointApiService) V1EndpointDeleteExecute(r ApiV1EndpointDeleteReques return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -341,7 +341,8 @@ func (a *EndpointApiService) V1EndpointDeleteExecute(r ApiV1EndpointDeleteReques newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -351,7 +352,8 @@ func (a *EndpointApiService) V1EndpointDeleteExecute(r ApiV1EndpointDeleteReques newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -361,7 +363,8 @@ func (a *EndpointApiService) V1EndpointDeleteExecute(r ApiV1EndpointDeleteReques newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -371,7 +374,8 @@ func (a *EndpointApiService) V1EndpointDeleteExecute(r ApiV1EndpointDeleteReques newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -381,7 +385,8 @@ func (a *EndpointApiService) V1EndpointDeleteExecute(r ApiV1EndpointDeleteReques newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -391,7 +396,8 @@ func (a *EndpointApiService) V1EndpointDeleteExecute(r ApiV1EndpointDeleteReques newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -401,7 +407,8 @@ func (a *EndpointApiService) V1EndpointDeleteExecute(r ApiV1EndpointDeleteReques newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -410,26 +417,27 @@ func (a *EndpointApiService) V1EndpointDeleteExecute(r ApiV1EndpointDeleteReques } type ApiV1EndpointGetRequest struct { - ctx _context.Context - ApiService *EndpointApiService + ctx context.Context + ApiService *EndpointAPIService appId string endpointId string } - -func (r ApiV1EndpointGetRequest) Execute() (EndpointOut, *_nethttp.Response, error) { +func (r ApiV1EndpointGetRequest) Execute() (*EndpointOut, *http.Response, error) { return r.ApiService.V1EndpointGetExecute(r) } /* - * V1EndpointGet Get Endpoint - * Get an endpoint. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param endpointId The ep's ID or UID - * @return ApiV1EndpointGetRequest - */ -func (a *EndpointApiService) V1EndpointGet(ctx _context.Context, appId string, endpointId string) ApiV1EndpointGetRequest { +V1EndpointGet Get Endpoint + +Get an endpoint. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param endpointId The ep's ID or UID + @return ApiV1EndpointGetRequest +*/ +func (a *EndpointAPIService) V1EndpointGet(ctx context.Context, appId string, endpointId string) ApiV1EndpointGetRequest { return ApiV1EndpointGetRequest{ ApiService: a, ctx: ctx, @@ -438,32 +446,28 @@ func (a *EndpointApiService) V1EndpointGet(ctx _context.Context, appId string, e } } -/* - * Execute executes the request - * @return EndpointOut - */ -func (a *EndpointApiService) V1EndpointGetExecute(r ApiV1EndpointGetRequest) (EndpointOut, *_nethttp.Response, error) { +// Execute executes the request +// @return EndpointOut +func (a *EndpointAPIService) V1EndpointGetExecute(r ApiV1EndpointGetRequest) (*EndpointOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue EndpointOut + formFiles []formFile + localVarReturnValue *EndpointOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointAPIService.V1EndpointGet") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -494,7 +498,7 @@ func (a *EndpointApiService) V1EndpointGetExecute(r ApiV1EndpointGetRequest) (En if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -504,15 +508,15 @@ func (a *EndpointApiService) V1EndpointGetExecute(r ApiV1EndpointGetRequest) (En return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -523,7 +527,8 @@ func (a *EndpointApiService) V1EndpointGetExecute(r ApiV1EndpointGetRequest) (En newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -533,7 +538,8 @@ func (a *EndpointApiService) V1EndpointGetExecute(r ApiV1EndpointGetRequest) (En newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -543,7 +549,8 @@ func (a *EndpointApiService) V1EndpointGetExecute(r ApiV1EndpointGetRequest) (En newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -553,7 +560,8 @@ func (a *EndpointApiService) V1EndpointGetExecute(r ApiV1EndpointGetRequest) (En newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -563,7 +571,8 @@ func (a *EndpointApiService) V1EndpointGetExecute(r ApiV1EndpointGetRequest) (En newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -573,7 +582,8 @@ func (a *EndpointApiService) V1EndpointGetExecute(r ApiV1EndpointGetRequest) (En newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -583,14 +593,15 @@ func (a *EndpointApiService) V1EndpointGetExecute(r ApiV1EndpointGetRequest) (En newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -601,26 +612,27 @@ func (a *EndpointApiService) V1EndpointGetExecute(r ApiV1EndpointGetRequest) (En } type ApiV1EndpointGetHeadersRequest struct { - ctx _context.Context - ApiService *EndpointApiService + ctx context.Context + ApiService *EndpointAPIService appId string endpointId string } - -func (r ApiV1EndpointGetHeadersRequest) Execute() (EndpointHeadersOut, *_nethttp.Response, error) { +func (r ApiV1EndpointGetHeadersRequest) Execute() (*EndpointHeadersOut, *http.Response, error) { return r.ApiService.V1EndpointGetHeadersExecute(r) } /* - * V1EndpointGetHeaders Get Endpoint Headers - * Get the additional headers to be sent with the webhook - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param endpointId The ep's ID or UID - * @return ApiV1EndpointGetHeadersRequest - */ -func (a *EndpointApiService) V1EndpointGetHeaders(ctx _context.Context, appId string, endpointId string) ApiV1EndpointGetHeadersRequest { +V1EndpointGetHeaders Get Endpoint Headers + +Get the additional headers to be sent with the webhook + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param endpointId The ep's ID or UID + @return ApiV1EndpointGetHeadersRequest +*/ +func (a *EndpointAPIService) V1EndpointGetHeaders(ctx context.Context, appId string, endpointId string) ApiV1EndpointGetHeadersRequest { return ApiV1EndpointGetHeadersRequest{ ApiService: a, ctx: ctx, @@ -629,32 +641,28 @@ func (a *EndpointApiService) V1EndpointGetHeaders(ctx _context.Context, appId st } } -/* - * Execute executes the request - * @return EndpointHeadersOut - */ -func (a *EndpointApiService) V1EndpointGetHeadersExecute(r ApiV1EndpointGetHeadersRequest) (EndpointHeadersOut, *_nethttp.Response, error) { +// Execute executes the request +// @return EndpointHeadersOut +func (a *EndpointAPIService) V1EndpointGetHeadersExecute(r ApiV1EndpointGetHeadersRequest) (*EndpointHeadersOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue EndpointHeadersOut + formFiles []formFile + localVarReturnValue *EndpointHeadersOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointGetHeaders") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointAPIService.V1EndpointGetHeaders") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -685,7 +693,7 @@ func (a *EndpointApiService) V1EndpointGetHeadersExecute(r ApiV1EndpointGetHeade if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -695,15 +703,15 @@ func (a *EndpointApiService) V1EndpointGetHeadersExecute(r ApiV1EndpointGetHeade return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -714,7 +722,8 @@ func (a *EndpointApiService) V1EndpointGetHeadersExecute(r ApiV1EndpointGetHeade newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -724,7 +733,8 @@ func (a *EndpointApiService) V1EndpointGetHeadersExecute(r ApiV1EndpointGetHeade newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -734,7 +744,8 @@ func (a *EndpointApiService) V1EndpointGetHeadersExecute(r ApiV1EndpointGetHeade newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -744,7 +755,8 @@ func (a *EndpointApiService) V1EndpointGetHeadersExecute(r ApiV1EndpointGetHeade newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -754,7 +766,8 @@ func (a *EndpointApiService) V1EndpointGetHeadersExecute(r ApiV1EndpointGetHeade newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -764,7 +777,8 @@ func (a *EndpointApiService) V1EndpointGetHeadersExecute(r ApiV1EndpointGetHeade newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -774,14 +788,15 @@ func (a *EndpointApiService) V1EndpointGetHeadersExecute(r ApiV1EndpointGetHeade newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -792,29 +807,30 @@ func (a *EndpointApiService) V1EndpointGetHeadersExecute(r ApiV1EndpointGetHeade } type ApiV1EndpointGetSecretRequest struct { - ctx _context.Context - ApiService *EndpointApiService + ctx context.Context + ApiService *EndpointAPIService appId string endpointId string } - -func (r ApiV1EndpointGetSecretRequest) Execute() (EndpointSecretOut, *_nethttp.Response, error) { +func (r ApiV1EndpointGetSecretRequest) Execute() (*EndpointSecretOut, *http.Response, error) { return r.ApiService.V1EndpointGetSecretExecute(r) } /* - * V1EndpointGetSecret Get Endpoint Secret - * Get the endpoint's signing secret. +V1EndpointGetSecret Get Endpoint Secret + +Get the endpoint's signing secret. This is used to verify the authenticity of the webhook. For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/). - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param endpointId The ep's ID or UID - * @return ApiV1EndpointGetSecretRequest - */ -func (a *EndpointApiService) V1EndpointGetSecret(ctx _context.Context, appId string, endpointId string) ApiV1EndpointGetSecretRequest { + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param endpointId The ep's ID or UID + @return ApiV1EndpointGetSecretRequest +*/ +func (a *EndpointAPIService) V1EndpointGetSecret(ctx context.Context, appId string, endpointId string) ApiV1EndpointGetSecretRequest { return ApiV1EndpointGetSecretRequest{ ApiService: a, ctx: ctx, @@ -823,32 +839,28 @@ func (a *EndpointApiService) V1EndpointGetSecret(ctx _context.Context, appId str } } -/* - * Execute executes the request - * @return EndpointSecretOut - */ -func (a *EndpointApiService) V1EndpointGetSecretExecute(r ApiV1EndpointGetSecretRequest) (EndpointSecretOut, *_nethttp.Response, error) { +// Execute executes the request +// @return EndpointSecretOut +func (a *EndpointAPIService) V1EndpointGetSecretExecute(r ApiV1EndpointGetSecretRequest) (*EndpointSecretOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue EndpointSecretOut + formFiles []formFile + localVarReturnValue *EndpointSecretOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointGetSecret") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointAPIService.V1EndpointGetSecret") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -879,7 +891,7 @@ func (a *EndpointApiService) V1EndpointGetSecretExecute(r ApiV1EndpointGetSecret if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -889,15 +901,15 @@ func (a *EndpointApiService) V1EndpointGetSecretExecute(r ApiV1EndpointGetSecret return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -908,7 +920,8 @@ func (a *EndpointApiService) V1EndpointGetSecretExecute(r ApiV1EndpointGetSecret newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -918,7 +931,8 @@ func (a *EndpointApiService) V1EndpointGetSecretExecute(r ApiV1EndpointGetSecret newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -928,7 +942,8 @@ func (a *EndpointApiService) V1EndpointGetSecretExecute(r ApiV1EndpointGetSecret newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -938,7 +953,8 @@ func (a *EndpointApiService) V1EndpointGetSecretExecute(r ApiV1EndpointGetSecret newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -948,7 +964,8 @@ func (a *EndpointApiService) V1EndpointGetSecretExecute(r ApiV1EndpointGetSecret newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -958,7 +975,8 @@ func (a *EndpointApiService) V1EndpointGetSecretExecute(r ApiV1EndpointGetSecret newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -968,14 +986,15 @@ func (a *EndpointApiService) V1EndpointGetSecretExecute(r ApiV1EndpointGetSecret newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -986,36 +1005,41 @@ func (a *EndpointApiService) V1EndpointGetSecretExecute(r ApiV1EndpointGetSecret } type ApiV1EndpointGetStatsRequest struct { - ctx _context.Context - ApiService *EndpointApiService + ctx context.Context + ApiService *EndpointAPIService appId string endpointId string since *time.Time until *time.Time } +// Filter the range to data starting from this date func (r ApiV1EndpointGetStatsRequest) Since(since time.Time) ApiV1EndpointGetStatsRequest { r.since = &since return r } + +// Filter the range to data ending by this date func (r ApiV1EndpointGetStatsRequest) Until(until time.Time) ApiV1EndpointGetStatsRequest { r.until = &until return r } -func (r ApiV1EndpointGetStatsRequest) Execute() (EndpointStats, *_nethttp.Response, error) { +func (r ApiV1EndpointGetStatsRequest) Execute() (*EndpointStats, *http.Response, error) { return r.ApiService.V1EndpointGetStatsExecute(r) } /* - * V1EndpointGetStats Endpoint Stats - * Get basic statistics for the endpoint. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param endpointId The ep's ID or UID - * @return ApiV1EndpointGetStatsRequest - */ -func (a *EndpointApiService) V1EndpointGetStats(ctx _context.Context, appId string, endpointId string) ApiV1EndpointGetStatsRequest { +V1EndpointGetStats Endpoint Stats + +Get basic statistics for the endpoint. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param endpointId The ep's ID or UID + @return ApiV1EndpointGetStatsRequest +*/ +func (a *EndpointAPIService) V1EndpointGetStats(ctx context.Context, appId string, endpointId string) ApiV1EndpointGetStatsRequest { return ApiV1EndpointGetStatsRequest{ ApiService: a, ctx: ctx, @@ -1024,32 +1048,28 @@ func (a *EndpointApiService) V1EndpointGetStats(ctx _context.Context, appId stri } } -/* - * Execute executes the request - * @return EndpointStats - */ -func (a *EndpointApiService) V1EndpointGetStatsExecute(r ApiV1EndpointGetStatsRequest) (EndpointStats, *_nethttp.Response, error) { +// Execute executes the request +// @return EndpointStats +func (a *EndpointAPIService) V1EndpointGetStatsExecute(r ApiV1EndpointGetStatsRequest) (*EndpointStats, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue EndpointStats + formFiles []formFile + localVarReturnValue *EndpointStats ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointGetStats") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointAPIService.V1EndpointGetStats") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/stats/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -1064,10 +1084,10 @@ func (a *EndpointApiService) V1EndpointGetStatsExecute(r ApiV1EndpointGetStatsRe } if r.since != nil { - localVarQueryParams.Add("since", parameterToString(*r.since, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "since", r.since, "") } if r.until != nil { - localVarQueryParams.Add("until", parameterToString(*r.until, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "until", r.until, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1086,7 +1106,7 @@ func (a *EndpointApiService) V1EndpointGetStatsExecute(r ApiV1EndpointGetStatsRe if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1096,15 +1116,15 @@ func (a *EndpointApiService) V1EndpointGetStatsExecute(r ApiV1EndpointGetStatsRe return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1115,7 +1135,8 @@ func (a *EndpointApiService) V1EndpointGetStatsExecute(r ApiV1EndpointGetStatsRe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1125,7 +1146,8 @@ func (a *EndpointApiService) V1EndpointGetStatsExecute(r ApiV1EndpointGetStatsRe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1135,7 +1157,8 @@ func (a *EndpointApiService) V1EndpointGetStatsExecute(r ApiV1EndpointGetStatsRe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1145,7 +1168,8 @@ func (a *EndpointApiService) V1EndpointGetStatsExecute(r ApiV1EndpointGetStatsRe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -1155,7 +1179,8 @@ func (a *EndpointApiService) V1EndpointGetStatsExecute(r ApiV1EndpointGetStatsRe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1165,7 +1190,8 @@ func (a *EndpointApiService) V1EndpointGetStatsExecute(r ApiV1EndpointGetStatsRe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1175,14 +1201,15 @@ func (a *EndpointApiService) V1EndpointGetStatsExecute(r ApiV1EndpointGetStatsRe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1193,39 +1220,46 @@ func (a *EndpointApiService) V1EndpointGetStatsExecute(r ApiV1EndpointGetStatsRe } type ApiV1EndpointListRequest struct { - ctx _context.Context - ApiService *EndpointApiService + ctx context.Context + ApiService *EndpointAPIService appId string limit *int32 iterator *string order *Ordering } +// Limit the number of returned items func (r ApiV1EndpointListRequest) Limit(limit int32) ApiV1EndpointListRequest { r.limit = &limit return r } + +// The iterator returned from a prior invocation func (r ApiV1EndpointListRequest) Iterator(iterator string) ApiV1EndpointListRequest { r.iterator = &iterator return r } + +// The sorting order of the returned items func (r ApiV1EndpointListRequest) Order(order Ordering) ApiV1EndpointListRequest { r.order = &order return r } -func (r ApiV1EndpointListRequest) Execute() (ListResponseEndpointOut, *_nethttp.Response, error) { +func (r ApiV1EndpointListRequest) Execute() (*ListResponseEndpointOut, *http.Response, error) { return r.ApiService.V1EndpointListExecute(r) } /* - * V1EndpointList List Endpoints - * List the application's endpoints. - * @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 ApiV1EndpointListRequest - */ -func (a *EndpointApiService) V1EndpointList(ctx _context.Context, appId string) ApiV1EndpointListRequest { +V1EndpointList List Endpoints + +List the application's endpoints. + + @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 ApiV1EndpointListRequest +*/ +func (a *EndpointAPIService) V1EndpointList(ctx context.Context, appId string) ApiV1EndpointListRequest { return ApiV1EndpointListRequest{ ApiService: a, ctx: ctx, @@ -1233,31 +1267,27 @@ func (a *EndpointApiService) V1EndpointList(ctx _context.Context, appId string) } } -/* - * Execute executes the request - * @return ListResponseEndpointOut - */ -func (a *EndpointApiService) V1EndpointListExecute(r ApiV1EndpointListRequest) (ListResponseEndpointOut, *_nethttp.Response, error) { +// Execute executes the request +// @return ListResponseEndpointOut +func (a *EndpointAPIService) V1EndpointListExecute(r ApiV1EndpointListRequest) (*ListResponseEndpointOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ListResponseEndpointOut + formFiles []formFile + localVarReturnValue *ListResponseEndpointOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointList") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointAPIService.V1EndpointList") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -1266,13 +1296,13 @@ func (a *EndpointApiService) V1EndpointListExecute(r ApiV1EndpointListRequest) ( } if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") } if r.iterator != nil { - localVarQueryParams.Add("iterator", parameterToString(*r.iterator, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "iterator", r.iterator, "") } if r.order != nil { - localVarQueryParams.Add("order", parameterToString(*r.order, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "order", r.order, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1291,7 +1321,7 @@ func (a *EndpointApiService) V1EndpointListExecute(r ApiV1EndpointListRequest) ( if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1301,15 +1331,15 @@ func (a *EndpointApiService) V1EndpointListExecute(r ApiV1EndpointListRequest) ( return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1320,7 +1350,8 @@ func (a *EndpointApiService) V1EndpointListExecute(r ApiV1EndpointListRequest) ( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1330,7 +1361,8 @@ func (a *EndpointApiService) V1EndpointListExecute(r ApiV1EndpointListRequest) ( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1340,7 +1372,8 @@ func (a *EndpointApiService) V1EndpointListExecute(r ApiV1EndpointListRequest) ( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1350,7 +1383,8 @@ func (a *EndpointApiService) V1EndpointListExecute(r ApiV1EndpointListRequest) ( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -1360,7 +1394,8 @@ func (a *EndpointApiService) V1EndpointListExecute(r ApiV1EndpointListRequest) ( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1370,7 +1405,8 @@ func (a *EndpointApiService) V1EndpointListExecute(r ApiV1EndpointListRequest) ( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1380,14 +1416,15 @@ func (a *EndpointApiService) V1EndpointListExecute(r ApiV1EndpointListRequest) ( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1398,8 +1435,8 @@ func (a *EndpointApiService) V1EndpointListExecute(r ApiV1EndpointListRequest) ( } type ApiV1EndpointPatchRequest struct { - ctx _context.Context - ApiService *EndpointApiService + ctx context.Context + ApiService *EndpointAPIService appId string endpointId string endpointPatch *EndpointPatch @@ -1410,19 +1447,21 @@ func (r ApiV1EndpointPatchRequest) EndpointPatch(endpointPatch EndpointPatch) Ap return r } -func (r ApiV1EndpointPatchRequest) Execute() (EndpointOut, *_nethttp.Response, error) { +func (r ApiV1EndpointPatchRequest) Execute() (*EndpointOut, *http.Response, error) { return r.ApiService.V1EndpointPatchExecute(r) } /* - * V1EndpointPatch Patch Endpoint - * Partially update an endpoint. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param endpointId The ep's ID or UID - * @return ApiV1EndpointPatchRequest - */ -func (a *EndpointApiService) V1EndpointPatch(ctx _context.Context, appId string, endpointId string) ApiV1EndpointPatchRequest { +V1EndpointPatch Patch Endpoint + +Partially update an endpoint. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param endpointId The ep's ID or UID + @return ApiV1EndpointPatchRequest +*/ +func (a *EndpointAPIService) V1EndpointPatch(ctx context.Context, appId string, endpointId string) ApiV1EndpointPatchRequest { return ApiV1EndpointPatchRequest{ ApiService: a, ctx: ctx, @@ -1431,32 +1470,28 @@ func (a *EndpointApiService) V1EndpointPatch(ctx _context.Context, appId string, } } -/* - * Execute executes the request - * @return EndpointOut - */ -func (a *EndpointApiService) V1EndpointPatchExecute(r ApiV1EndpointPatchRequest) (EndpointOut, *_nethttp.Response, error) { +// Execute executes the request +// @return EndpointOut +func (a *EndpointAPIService) V1EndpointPatchExecute(r ApiV1EndpointPatchRequest) (*EndpointOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue EndpointOut + formFiles []formFile + localVarReturnValue *EndpointOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointPatch") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointAPIService.V1EndpointPatch") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -1492,7 +1527,7 @@ func (a *EndpointApiService) V1EndpointPatchExecute(r ApiV1EndpointPatchRequest) } // body params localVarPostBody = r.endpointPatch - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1502,15 +1537,15 @@ func (a *EndpointApiService) V1EndpointPatchExecute(r ApiV1EndpointPatchRequest) return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1521,7 +1556,8 @@ func (a *EndpointApiService) V1EndpointPatchExecute(r ApiV1EndpointPatchRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1531,7 +1567,8 @@ func (a *EndpointApiService) V1EndpointPatchExecute(r ApiV1EndpointPatchRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1541,7 +1578,8 @@ func (a *EndpointApiService) V1EndpointPatchExecute(r ApiV1EndpointPatchRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1551,7 +1589,8 @@ func (a *EndpointApiService) V1EndpointPatchExecute(r ApiV1EndpointPatchRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -1561,7 +1600,8 @@ func (a *EndpointApiService) V1EndpointPatchExecute(r ApiV1EndpointPatchRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1571,7 +1611,8 @@ func (a *EndpointApiService) V1EndpointPatchExecute(r ApiV1EndpointPatchRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1581,14 +1622,15 @@ func (a *EndpointApiService) V1EndpointPatchExecute(r ApiV1EndpointPatchRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1599,8 +1641,8 @@ func (a *EndpointApiService) V1EndpointPatchExecute(r ApiV1EndpointPatchRequest) } type ApiV1EndpointPatchHeadersRequest struct { - ctx _context.Context - ApiService *EndpointApiService + ctx context.Context + ApiService *EndpointAPIService appId string endpointId string endpointHeadersPatchIn *EndpointHeadersPatchIn @@ -1611,19 +1653,21 @@ func (r ApiV1EndpointPatchHeadersRequest) EndpointHeadersPatchIn(endpointHeaders return r } -func (r ApiV1EndpointPatchHeadersRequest) Execute() (*_nethttp.Response, error) { +func (r ApiV1EndpointPatchHeadersRequest) Execute() (*http.Response, error) { return r.ApiService.V1EndpointPatchHeadersExecute(r) } /* - * V1EndpointPatchHeaders Patch Endpoint Headers - * Partially set the additional headers to be sent with the webhook - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param endpointId The ep's ID or UID - * @return ApiV1EndpointPatchHeadersRequest - */ -func (a *EndpointApiService) V1EndpointPatchHeaders(ctx _context.Context, appId string, endpointId string) ApiV1EndpointPatchHeadersRequest { +V1EndpointPatchHeaders Patch Endpoint Headers + +Partially set the additional headers to be sent with the webhook + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param endpointId The ep's ID or UID + @return ApiV1EndpointPatchHeadersRequest +*/ +func (a *EndpointAPIService) V1EndpointPatchHeaders(ctx context.Context, appId string, endpointId string) ApiV1EndpointPatchHeadersRequest { return ApiV1EndpointPatchHeadersRequest{ ApiService: a, ctx: ctx, @@ -1632,30 +1676,26 @@ func (a *EndpointApiService) V1EndpointPatchHeaders(ctx _context.Context, appId } } -/* - * Execute executes the request - */ -func (a *EndpointApiService) V1EndpointPatchHeadersExecute(r ApiV1EndpointPatchHeadersRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *EndpointAPIService) V1EndpointPatchHeadersExecute(r ApiV1EndpointPatchHeadersRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointPatchHeaders") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointAPIService.V1EndpointPatchHeaders") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return nil, reportError("appId must have at least 1 elements") } @@ -1691,7 +1731,7 @@ func (a *EndpointApiService) V1EndpointPatchHeadersExecute(r ApiV1EndpointPatchH } // body params localVarPostBody = r.endpointHeadersPatchIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1701,15 +1741,15 @@ func (a *EndpointApiService) V1EndpointPatchHeadersExecute(r ApiV1EndpointPatchH return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1720,7 +1760,8 @@ func (a *EndpointApiService) V1EndpointPatchHeadersExecute(r ApiV1EndpointPatchH newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1730,7 +1771,8 @@ func (a *EndpointApiService) V1EndpointPatchHeadersExecute(r ApiV1EndpointPatchH newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1740,7 +1782,8 @@ func (a *EndpointApiService) V1EndpointPatchHeadersExecute(r ApiV1EndpointPatchH newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1750,7 +1793,8 @@ func (a *EndpointApiService) V1EndpointPatchHeadersExecute(r ApiV1EndpointPatchH newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -1760,7 +1804,8 @@ func (a *EndpointApiService) V1EndpointPatchHeadersExecute(r ApiV1EndpointPatchH newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1770,7 +1815,8 @@ func (a *EndpointApiService) V1EndpointPatchHeadersExecute(r ApiV1EndpointPatchH newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1780,7 +1826,8 @@ func (a *EndpointApiService) V1EndpointPatchHeadersExecute(r ApiV1EndpointPatchH newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -1789,8 +1836,8 @@ func (a *EndpointApiService) V1EndpointPatchHeadersExecute(r ApiV1EndpointPatchH } type ApiV1EndpointRecoverRequest struct { - ctx _context.Context - ApiService *EndpointApiService + ctx context.Context + ApiService *EndpointAPIService appId string endpointId string recoverIn *RecoverIn @@ -1801,24 +1848,28 @@ func (r ApiV1EndpointRecoverRequest) RecoverIn(recoverIn RecoverIn) ApiV1Endpoin r.recoverIn = &recoverIn return r } + +// The request's idempotency key func (r ApiV1EndpointRecoverRequest) IdempotencyKey(idempotencyKey string) ApiV1EndpointRecoverRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1EndpointRecoverRequest) Execute() (RecoverOut, *_nethttp.Response, error) { +func (r ApiV1EndpointRecoverRequest) Execute() (*RecoverOut, *http.Response, error) { return r.ApiService.V1EndpointRecoverExecute(r) } /* - * V1EndpointRecover Recover Failed Webhooks - * Resend all failed messages since a given time. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param endpointId The ep's ID or UID - * @return ApiV1EndpointRecoverRequest - */ -func (a *EndpointApiService) V1EndpointRecover(ctx _context.Context, appId string, endpointId string) ApiV1EndpointRecoverRequest { +V1EndpointRecover Recover Failed Webhooks + +Resend all failed messages since a given time. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param endpointId The ep's ID or UID + @return ApiV1EndpointRecoverRequest +*/ +func (a *EndpointAPIService) V1EndpointRecover(ctx context.Context, appId string, endpointId string) ApiV1EndpointRecoverRequest { return ApiV1EndpointRecoverRequest{ ApiService: a, ctx: ctx, @@ -1827,32 +1878,28 @@ func (a *EndpointApiService) V1EndpointRecover(ctx _context.Context, appId strin } } -/* - * Execute executes the request - * @return RecoverOut - */ -func (a *EndpointApiService) V1EndpointRecoverExecute(r ApiV1EndpointRecoverRequest) (RecoverOut, *_nethttp.Response, error) { +// Execute executes the request +// @return RecoverOut +func (a *EndpointAPIService) V1EndpointRecoverExecute(r ApiV1EndpointRecoverRequest) (*RecoverOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue RecoverOut + formFiles []formFile + localVarReturnValue *RecoverOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointRecover") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointAPIService.V1EndpointRecover") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -1887,11 +1934,11 @@ func (a *EndpointApiService) V1EndpointRecoverExecute(r ApiV1EndpointRecoverRequ localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } // body params localVarPostBody = r.recoverIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1901,15 +1948,15 @@ func (a *EndpointApiService) V1EndpointRecoverExecute(r ApiV1EndpointRecoverRequ return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1920,7 +1967,8 @@ func (a *EndpointApiService) V1EndpointRecoverExecute(r ApiV1EndpointRecoverRequ newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1930,7 +1978,8 @@ func (a *EndpointApiService) V1EndpointRecoverExecute(r ApiV1EndpointRecoverRequ newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1940,7 +1989,8 @@ func (a *EndpointApiService) V1EndpointRecoverExecute(r ApiV1EndpointRecoverRequ newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1950,7 +2000,8 @@ func (a *EndpointApiService) V1EndpointRecoverExecute(r ApiV1EndpointRecoverRequ newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -1960,7 +2011,8 @@ func (a *EndpointApiService) V1EndpointRecoverExecute(r ApiV1EndpointRecoverRequ newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1970,7 +2022,8 @@ func (a *EndpointApiService) V1EndpointRecoverExecute(r ApiV1EndpointRecoverRequ newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1980,14 +2033,15 @@ func (a *EndpointApiService) V1EndpointRecoverExecute(r ApiV1EndpointRecoverRequ newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1998,8 +2052,8 @@ func (a *EndpointApiService) V1EndpointRecoverExecute(r ApiV1EndpointRecoverRequ } type ApiV1EndpointReplayRequest struct { - ctx _context.Context - ApiService *EndpointApiService + ctx context.Context + ApiService *EndpointAPIService appId string endpointId string replayIn *ReplayIn @@ -2010,24 +2064,28 @@ func (r ApiV1EndpointReplayRequest) ReplayIn(replayIn ReplayIn) ApiV1EndpointRep r.replayIn = &replayIn return r } + +// The request's idempotency key func (r ApiV1EndpointReplayRequest) IdempotencyKey(idempotencyKey string) ApiV1EndpointReplayRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1EndpointReplayRequest) Execute() (ReplayOut, *_nethttp.Response, error) { +func (r ApiV1EndpointReplayRequest) Execute() (*ReplayOut, *http.Response, error) { return r.ApiService.V1EndpointReplayExecute(r) } /* - * V1EndpointReplay Replay Missing Webhooks - * Replays messages to the endpoint. Only messages that were created after `since` will be sent. Messages that were previously sent to the endpoint are not resent. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param endpointId The ep's ID or UID - * @return ApiV1EndpointReplayRequest - */ -func (a *EndpointApiService) V1EndpointReplay(ctx _context.Context, appId string, endpointId string) ApiV1EndpointReplayRequest { +V1EndpointReplay Replay Missing Webhooks + +Replays messages to the endpoint. Only messages that were created after `since` will be sent. Messages that were previously sent to the endpoint are not resent. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param endpointId The ep's ID or UID + @return ApiV1EndpointReplayRequest +*/ +func (a *EndpointAPIService) V1EndpointReplay(ctx context.Context, appId string, endpointId string) ApiV1EndpointReplayRequest { return ApiV1EndpointReplayRequest{ ApiService: a, ctx: ctx, @@ -2036,32 +2094,28 @@ func (a *EndpointApiService) V1EndpointReplay(ctx _context.Context, appId string } } -/* - * Execute executes the request - * @return ReplayOut - */ -func (a *EndpointApiService) V1EndpointReplayExecute(r ApiV1EndpointReplayRequest) (ReplayOut, *_nethttp.Response, error) { +// Execute executes the request +// @return ReplayOut +func (a *EndpointAPIService) V1EndpointReplayExecute(r ApiV1EndpointReplayRequest) (*ReplayOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ReplayOut + formFiles []formFile + localVarReturnValue *ReplayOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointReplay") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointAPIService.V1EndpointReplay") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -2096,11 +2150,11 @@ func (a *EndpointApiService) V1EndpointReplayExecute(r ApiV1EndpointReplayReques localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } // body params localVarPostBody = r.replayIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -2110,15 +2164,15 @@ func (a *EndpointApiService) V1EndpointReplayExecute(r ApiV1EndpointReplayReques return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2129,7 +2183,8 @@ func (a *EndpointApiService) V1EndpointReplayExecute(r ApiV1EndpointReplayReques newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -2139,7 +2194,8 @@ func (a *EndpointApiService) V1EndpointReplayExecute(r ApiV1EndpointReplayReques newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -2149,7 +2205,8 @@ func (a *EndpointApiService) V1EndpointReplayExecute(r ApiV1EndpointReplayReques newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -2159,7 +2216,8 @@ func (a *EndpointApiService) V1EndpointReplayExecute(r ApiV1EndpointReplayReques newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -2169,7 +2227,8 @@ func (a *EndpointApiService) V1EndpointReplayExecute(r ApiV1EndpointReplayReques newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -2179,7 +2238,8 @@ func (a *EndpointApiService) V1EndpointReplayExecute(r ApiV1EndpointReplayReques newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -2189,14 +2249,15 @@ func (a *EndpointApiService) V1EndpointReplayExecute(r ApiV1EndpointReplayReques newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -2207,8 +2268,8 @@ func (a *EndpointApiService) V1EndpointReplayExecute(r ApiV1EndpointReplayReques } type ApiV1EndpointRotateSecretRequest struct { - ctx _context.Context - ApiService *EndpointApiService + ctx context.Context + ApiService *EndpointAPIService appId string endpointId string endpointSecretRotateIn *EndpointSecretRotateIn @@ -2219,24 +2280,28 @@ func (r ApiV1EndpointRotateSecretRequest) EndpointSecretRotateIn(endpointSecretR r.endpointSecretRotateIn = &endpointSecretRotateIn return r } + +// The request's idempotency key func (r ApiV1EndpointRotateSecretRequest) IdempotencyKey(idempotencyKey string) ApiV1EndpointRotateSecretRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1EndpointRotateSecretRequest) Execute() (*_nethttp.Response, error) { +func (r ApiV1EndpointRotateSecretRequest) Execute() (*http.Response, error) { return r.ApiService.V1EndpointRotateSecretExecute(r) } /* - * V1EndpointRotateSecret Rotate Endpoint Secret - * Rotates the endpoint's signing secret. The previous secret will be valid for the next 24 hours. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param endpointId The ep's ID or UID - * @return ApiV1EndpointRotateSecretRequest - */ -func (a *EndpointApiService) V1EndpointRotateSecret(ctx _context.Context, appId string, endpointId string) ApiV1EndpointRotateSecretRequest { +V1EndpointRotateSecret Rotate Endpoint Secret + +Rotates the endpoint's signing secret. The previous secret will be valid for the next 24 hours. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param endpointId The ep's ID or UID + @return ApiV1EndpointRotateSecretRequest +*/ +func (a *EndpointAPIService) V1EndpointRotateSecret(ctx context.Context, appId string, endpointId string) ApiV1EndpointRotateSecretRequest { return ApiV1EndpointRotateSecretRequest{ ApiService: a, ctx: ctx, @@ -2245,30 +2310,26 @@ func (a *EndpointApiService) V1EndpointRotateSecret(ctx _context.Context, appId } } -/* - * Execute executes the request - */ -func (a *EndpointApiService) V1EndpointRotateSecretExecute(r ApiV1EndpointRotateSecretRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *EndpointAPIService) V1EndpointRotateSecretExecute(r ApiV1EndpointRotateSecretRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointRotateSecret") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointAPIService.V1EndpointRotateSecret") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return nil, reportError("appId must have at least 1 elements") } @@ -2303,11 +2364,11 @@ func (a *EndpointApiService) V1EndpointRotateSecretExecute(r ApiV1EndpointRotate localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } // body params localVarPostBody = r.endpointSecretRotateIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -2317,15 +2378,15 @@ func (a *EndpointApiService) V1EndpointRotateSecretExecute(r ApiV1EndpointRotate return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2336,7 +2397,8 @@ func (a *EndpointApiService) V1EndpointRotateSecretExecute(r ApiV1EndpointRotate newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -2346,7 +2408,8 @@ func (a *EndpointApiService) V1EndpointRotateSecretExecute(r ApiV1EndpointRotate newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -2356,7 +2419,8 @@ func (a *EndpointApiService) V1EndpointRotateSecretExecute(r ApiV1EndpointRotate newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -2366,7 +2430,8 @@ func (a *EndpointApiService) V1EndpointRotateSecretExecute(r ApiV1EndpointRotate newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -2376,7 +2441,8 @@ func (a *EndpointApiService) V1EndpointRotateSecretExecute(r ApiV1EndpointRotate newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -2386,7 +2452,8 @@ func (a *EndpointApiService) V1EndpointRotateSecretExecute(r ApiV1EndpointRotate newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -2396,7 +2463,8 @@ func (a *EndpointApiService) V1EndpointRotateSecretExecute(r ApiV1EndpointRotate newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -2405,8 +2473,8 @@ func (a *EndpointApiService) V1EndpointRotateSecretExecute(r ApiV1EndpointRotate } type ApiV1EndpointSendExampleRequest struct { - ctx _context.Context - ApiService *EndpointApiService + ctx context.Context + ApiService *EndpointAPIService appId string endpointId string eventExampleIn *EventExampleIn @@ -2417,24 +2485,28 @@ func (r ApiV1EndpointSendExampleRequest) EventExampleIn(eventExampleIn EventExam r.eventExampleIn = &eventExampleIn return r } + +// The request's idempotency key func (r ApiV1EndpointSendExampleRequest) IdempotencyKey(idempotencyKey string) ApiV1EndpointSendExampleRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1EndpointSendExampleRequest) Execute() (MessageOut, *_nethttp.Response, error) { +func (r ApiV1EndpointSendExampleRequest) Execute() (*MessageOut, *http.Response, error) { return r.ApiService.V1EndpointSendExampleExecute(r) } /* - * V1EndpointSendExample Send Event Type Example Message - * Send an example message for event - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param endpointId The ep's ID or UID - * @return ApiV1EndpointSendExampleRequest - */ -func (a *EndpointApiService) V1EndpointSendExample(ctx _context.Context, appId string, endpointId string) ApiV1EndpointSendExampleRequest { +V1EndpointSendExample Send Event Type Example Message + +Send an example message for event + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param endpointId The ep's ID or UID + @return ApiV1EndpointSendExampleRequest +*/ +func (a *EndpointAPIService) V1EndpointSendExample(ctx context.Context, appId string, endpointId string) ApiV1EndpointSendExampleRequest { return ApiV1EndpointSendExampleRequest{ ApiService: a, ctx: ctx, @@ -2443,32 +2515,28 @@ func (a *EndpointApiService) V1EndpointSendExample(ctx _context.Context, appId s } } -/* - * Execute executes the request - * @return MessageOut - */ -func (a *EndpointApiService) V1EndpointSendExampleExecute(r ApiV1EndpointSendExampleRequest) (MessageOut, *_nethttp.Response, error) { +// Execute executes the request +// @return MessageOut +func (a *EndpointAPIService) V1EndpointSendExampleExecute(r ApiV1EndpointSendExampleRequest) (*MessageOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue MessageOut + formFiles []formFile + localVarReturnValue *MessageOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointSendExample") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointAPIService.V1EndpointSendExample") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -2503,11 +2571,11 @@ func (a *EndpointApiService) V1EndpointSendExampleExecute(r ApiV1EndpointSendExa localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } // body params localVarPostBody = r.eventExampleIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -2517,15 +2585,15 @@ func (a *EndpointApiService) V1EndpointSendExampleExecute(r ApiV1EndpointSendExa return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2536,7 +2604,8 @@ func (a *EndpointApiService) V1EndpointSendExampleExecute(r ApiV1EndpointSendExa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -2546,7 +2615,8 @@ func (a *EndpointApiService) V1EndpointSendExampleExecute(r ApiV1EndpointSendExa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -2556,7 +2626,8 @@ func (a *EndpointApiService) V1EndpointSendExampleExecute(r ApiV1EndpointSendExa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -2566,7 +2637,8 @@ func (a *EndpointApiService) V1EndpointSendExampleExecute(r ApiV1EndpointSendExa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -2576,7 +2648,8 @@ func (a *EndpointApiService) V1EndpointSendExampleExecute(r ApiV1EndpointSendExa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -2586,7 +2659,8 @@ func (a *EndpointApiService) V1EndpointSendExampleExecute(r ApiV1EndpointSendExa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -2596,14 +2670,15 @@ func (a *EndpointApiService) V1EndpointSendExampleExecute(r ApiV1EndpointSendExa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -2614,26 +2689,27 @@ func (a *EndpointApiService) V1EndpointSendExampleExecute(r ApiV1EndpointSendExa } type ApiV1EndpointTransformationGetRequest struct { - ctx _context.Context - ApiService *EndpointApiService + ctx context.Context + ApiService *EndpointAPIService appId string endpointId string } - -func (r ApiV1EndpointTransformationGetRequest) Execute() (EndpointTransformationOut, *_nethttp.Response, error) { +func (r ApiV1EndpointTransformationGetRequest) Execute() (*EndpointTransformationOut, *http.Response, error) { return r.ApiService.V1EndpointTransformationGetExecute(r) } /* - * V1EndpointTransformationGet Get Endpoint Transformation - * Get the transformation code associated with this endpoint - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param endpointId The ep's ID or UID - * @return ApiV1EndpointTransformationGetRequest - */ -func (a *EndpointApiService) V1EndpointTransformationGet(ctx _context.Context, appId string, endpointId string) ApiV1EndpointTransformationGetRequest { +V1EndpointTransformationGet Get Endpoint Transformation + +Get the transformation code associated with this endpoint + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param endpointId The ep's ID or UID + @return ApiV1EndpointTransformationGetRequest +*/ +func (a *EndpointAPIService) V1EndpointTransformationGet(ctx context.Context, appId string, endpointId string) ApiV1EndpointTransformationGetRequest { return ApiV1EndpointTransformationGetRequest{ ApiService: a, ctx: ctx, @@ -2642,32 +2718,28 @@ func (a *EndpointApiService) V1EndpointTransformationGet(ctx _context.Context, a } } -/* - * Execute executes the request - * @return EndpointTransformationOut - */ -func (a *EndpointApiService) V1EndpointTransformationGetExecute(r ApiV1EndpointTransformationGetRequest) (EndpointTransformationOut, *_nethttp.Response, error) { +// Execute executes the request +// @return EndpointTransformationOut +func (a *EndpointAPIService) V1EndpointTransformationGetExecute(r ApiV1EndpointTransformationGetRequest) (*EndpointTransformationOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue EndpointTransformationOut + formFiles []formFile + localVarReturnValue *EndpointTransformationOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointTransformationGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointAPIService.V1EndpointTransformationGet") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -2698,7 +2770,7 @@ func (a *EndpointApiService) V1EndpointTransformationGetExecute(r ApiV1EndpointT if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -2708,15 +2780,15 @@ func (a *EndpointApiService) V1EndpointTransformationGetExecute(r ApiV1EndpointT return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2727,7 +2799,8 @@ func (a *EndpointApiService) V1EndpointTransformationGetExecute(r ApiV1EndpointT newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -2737,7 +2810,8 @@ func (a *EndpointApiService) V1EndpointTransformationGetExecute(r ApiV1EndpointT newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -2747,7 +2821,8 @@ func (a *EndpointApiService) V1EndpointTransformationGetExecute(r ApiV1EndpointT newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -2757,7 +2832,8 @@ func (a *EndpointApiService) V1EndpointTransformationGetExecute(r ApiV1EndpointT newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -2767,7 +2843,8 @@ func (a *EndpointApiService) V1EndpointTransformationGetExecute(r ApiV1EndpointT newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -2777,7 +2854,8 @@ func (a *EndpointApiService) V1EndpointTransformationGetExecute(r ApiV1EndpointT newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -2787,14 +2865,15 @@ func (a *EndpointApiService) V1EndpointTransformationGetExecute(r ApiV1EndpointT newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -2805,8 +2884,8 @@ func (a *EndpointApiService) V1EndpointTransformationGetExecute(r ApiV1EndpointT } type ApiV1EndpointTransformationPartialUpdateRequest struct { - ctx _context.Context - ApiService *EndpointApiService + ctx context.Context + ApiService *EndpointAPIService appId string endpointId string endpointTransformationIn *EndpointTransformationIn @@ -2817,19 +2896,21 @@ func (r ApiV1EndpointTransformationPartialUpdateRequest) EndpointTransformationI return r } -func (r ApiV1EndpointTransformationPartialUpdateRequest) Execute() (*_nethttp.Response, error) { +func (r ApiV1EndpointTransformationPartialUpdateRequest) Execute() (*http.Response, error) { return r.ApiService.V1EndpointTransformationPartialUpdateExecute(r) } /* - * V1EndpointTransformationPartialUpdate Set Endpoint Transformation - * Set or unset the transformation code associated with this endpoint - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param endpointId The ep's ID or UID - * @return ApiV1EndpointTransformationPartialUpdateRequest - */ -func (a *EndpointApiService) V1EndpointTransformationPartialUpdate(ctx _context.Context, appId string, endpointId string) ApiV1EndpointTransformationPartialUpdateRequest { +V1EndpointTransformationPartialUpdate Set Endpoint Transformation + +Set or unset the transformation code associated with this endpoint + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param endpointId The ep's ID or UID + @return ApiV1EndpointTransformationPartialUpdateRequest +*/ +func (a *EndpointAPIService) V1EndpointTransformationPartialUpdate(ctx context.Context, appId string, endpointId string) ApiV1EndpointTransformationPartialUpdateRequest { return ApiV1EndpointTransformationPartialUpdateRequest{ ApiService: a, ctx: ctx, @@ -2838,30 +2919,26 @@ func (a *EndpointApiService) V1EndpointTransformationPartialUpdate(ctx _context. } } -/* - * Execute executes the request - */ -func (a *EndpointApiService) V1EndpointTransformationPartialUpdateExecute(r ApiV1EndpointTransformationPartialUpdateRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *EndpointAPIService) V1EndpointTransformationPartialUpdateExecute(r ApiV1EndpointTransformationPartialUpdateRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointTransformationPartialUpdate") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointAPIService.V1EndpointTransformationPartialUpdate") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return nil, reportError("appId must have at least 1 elements") } @@ -2897,7 +2974,7 @@ func (a *EndpointApiService) V1EndpointTransformationPartialUpdateExecute(r ApiV } // body params localVarPostBody = r.endpointTransformationIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -2907,15 +2984,15 @@ func (a *EndpointApiService) V1EndpointTransformationPartialUpdateExecute(r ApiV return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2926,7 +3003,8 @@ func (a *EndpointApiService) V1EndpointTransformationPartialUpdateExecute(r ApiV newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -2936,7 +3014,8 @@ func (a *EndpointApiService) V1EndpointTransformationPartialUpdateExecute(r ApiV newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -2946,7 +3025,8 @@ func (a *EndpointApiService) V1EndpointTransformationPartialUpdateExecute(r ApiV newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -2956,7 +3036,8 @@ func (a *EndpointApiService) V1EndpointTransformationPartialUpdateExecute(r ApiV newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -2966,7 +3047,8 @@ func (a *EndpointApiService) V1EndpointTransformationPartialUpdateExecute(r ApiV newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -2976,7 +3058,8 @@ func (a *EndpointApiService) V1EndpointTransformationPartialUpdateExecute(r ApiV newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -2986,7 +3069,8 @@ func (a *EndpointApiService) V1EndpointTransformationPartialUpdateExecute(r ApiV newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -2995,8 +3079,8 @@ func (a *EndpointApiService) V1EndpointTransformationPartialUpdateExecute(r ApiV } type ApiV1EndpointTransformationSimulateRequest struct { - ctx _context.Context - ApiService *EndpointApiService + ctx context.Context + ApiService *EndpointAPIService appId string endpointId string endpointTransformationSimulateIn *EndpointTransformationSimulateIn @@ -3007,24 +3091,28 @@ func (r ApiV1EndpointTransformationSimulateRequest) EndpointTransformationSimula r.endpointTransformationSimulateIn = &endpointTransformationSimulateIn return r } + +// The request's idempotency key func (r ApiV1EndpointTransformationSimulateRequest) IdempotencyKey(idempotencyKey string) ApiV1EndpointTransformationSimulateRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1EndpointTransformationSimulateRequest) Execute() (EndpointTransformationSimulateOut, *_nethttp.Response, error) { +func (r ApiV1EndpointTransformationSimulateRequest) Execute() (*EndpointTransformationSimulateOut, *http.Response, error) { return r.ApiService.V1EndpointTransformationSimulateExecute(r) } /* - * V1EndpointTransformationSimulate Simulate - * Simulate running the transformation on the payload and code - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param endpointId The ep's ID or UID - * @return ApiV1EndpointTransformationSimulateRequest - */ -func (a *EndpointApiService) V1EndpointTransformationSimulate(ctx _context.Context, appId string, endpointId string) ApiV1EndpointTransformationSimulateRequest { +V1EndpointTransformationSimulate Simulate + +Simulate running the transformation on the payload and code + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param endpointId The ep's ID or UID + @return ApiV1EndpointTransformationSimulateRequest +*/ +func (a *EndpointAPIService) V1EndpointTransformationSimulate(ctx context.Context, appId string, endpointId string) ApiV1EndpointTransformationSimulateRequest { return ApiV1EndpointTransformationSimulateRequest{ ApiService: a, ctx: ctx, @@ -3033,32 +3121,28 @@ func (a *EndpointApiService) V1EndpointTransformationSimulate(ctx _context.Conte } } -/* - * Execute executes the request - * @return EndpointTransformationSimulateOut - */ -func (a *EndpointApiService) V1EndpointTransformationSimulateExecute(r ApiV1EndpointTransformationSimulateRequest) (EndpointTransformationSimulateOut, *_nethttp.Response, error) { +// Execute executes the request +// @return EndpointTransformationSimulateOut +func (a *EndpointAPIService) V1EndpointTransformationSimulateExecute(r ApiV1EndpointTransformationSimulateRequest) (*EndpointTransformationSimulateOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue EndpointTransformationSimulateOut + formFiles []formFile + localVarReturnValue *EndpointTransformationSimulateOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointTransformationSimulate") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointAPIService.V1EndpointTransformationSimulate") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation/simulate/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -3093,11 +3177,11 @@ func (a *EndpointApiService) V1EndpointTransformationSimulateExecute(r ApiV1Endp localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } // body params localVarPostBody = r.endpointTransformationSimulateIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -3107,15 +3191,15 @@ func (a *EndpointApiService) V1EndpointTransformationSimulateExecute(r ApiV1Endp return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -3126,7 +3210,8 @@ func (a *EndpointApiService) V1EndpointTransformationSimulateExecute(r ApiV1Endp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -3136,7 +3221,8 @@ func (a *EndpointApiService) V1EndpointTransformationSimulateExecute(r ApiV1Endp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -3146,7 +3232,8 @@ func (a *EndpointApiService) V1EndpointTransformationSimulateExecute(r ApiV1Endp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -3156,7 +3243,8 @@ func (a *EndpointApiService) V1EndpointTransformationSimulateExecute(r ApiV1Endp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -3166,7 +3254,8 @@ func (a *EndpointApiService) V1EndpointTransformationSimulateExecute(r ApiV1Endp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -3176,7 +3265,8 @@ func (a *EndpointApiService) V1EndpointTransformationSimulateExecute(r ApiV1Endp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -3186,14 +3276,15 @@ func (a *EndpointApiService) V1EndpointTransformationSimulateExecute(r ApiV1Endp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -3204,8 +3295,8 @@ func (a *EndpointApiService) V1EndpointTransformationSimulateExecute(r ApiV1Endp } type ApiV1EndpointUpdateRequest struct { - ctx _context.Context - ApiService *EndpointApiService + ctx context.Context + ApiService *EndpointAPIService appId string endpointId string endpointUpdate *EndpointUpdate @@ -3216,19 +3307,21 @@ func (r ApiV1EndpointUpdateRequest) EndpointUpdate(endpointUpdate EndpointUpdate return r } -func (r ApiV1EndpointUpdateRequest) Execute() (EndpointOut, *_nethttp.Response, error) { +func (r ApiV1EndpointUpdateRequest) Execute() (*EndpointOut, *http.Response, error) { return r.ApiService.V1EndpointUpdateExecute(r) } /* - * V1EndpointUpdate Update Endpoint - * Update an endpoint. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param endpointId The ep's ID or UID - * @return ApiV1EndpointUpdateRequest - */ -func (a *EndpointApiService) V1EndpointUpdate(ctx _context.Context, appId string, endpointId string) ApiV1EndpointUpdateRequest { +V1EndpointUpdate Update Endpoint + +Update an endpoint. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param endpointId The ep's ID or UID + @return ApiV1EndpointUpdateRequest +*/ +func (a *EndpointAPIService) V1EndpointUpdate(ctx context.Context, appId string, endpointId string) ApiV1EndpointUpdateRequest { return ApiV1EndpointUpdateRequest{ ApiService: a, ctx: ctx, @@ -3237,32 +3330,28 @@ func (a *EndpointApiService) V1EndpointUpdate(ctx _context.Context, appId string } } -/* - * Execute executes the request - * @return EndpointOut - */ -func (a *EndpointApiService) V1EndpointUpdateExecute(r ApiV1EndpointUpdateRequest) (EndpointOut, *_nethttp.Response, error) { +// Execute executes the request +// @return EndpointOut +func (a *EndpointAPIService) V1EndpointUpdateExecute(r ApiV1EndpointUpdateRequest) (*EndpointOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue EndpointOut + formFiles []formFile + localVarReturnValue *EndpointOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointUpdate") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointAPIService.V1EndpointUpdate") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -3298,7 +3387,7 @@ func (a *EndpointApiService) V1EndpointUpdateExecute(r ApiV1EndpointUpdateReques } // body params localVarPostBody = r.endpointUpdate - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -3308,15 +3397,15 @@ func (a *EndpointApiService) V1EndpointUpdateExecute(r ApiV1EndpointUpdateReques return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -3327,7 +3416,8 @@ func (a *EndpointApiService) V1EndpointUpdateExecute(r ApiV1EndpointUpdateReques newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -3337,7 +3427,8 @@ func (a *EndpointApiService) V1EndpointUpdateExecute(r ApiV1EndpointUpdateReques newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -3347,7 +3438,8 @@ func (a *EndpointApiService) V1EndpointUpdateExecute(r ApiV1EndpointUpdateReques newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -3357,7 +3449,8 @@ func (a *EndpointApiService) V1EndpointUpdateExecute(r ApiV1EndpointUpdateReques newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -3367,7 +3460,8 @@ func (a *EndpointApiService) V1EndpointUpdateExecute(r ApiV1EndpointUpdateReques newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -3377,7 +3471,8 @@ func (a *EndpointApiService) V1EndpointUpdateExecute(r ApiV1EndpointUpdateReques newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -3387,14 +3482,15 @@ func (a *EndpointApiService) V1EndpointUpdateExecute(r ApiV1EndpointUpdateReques newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -3405,8 +3501,8 @@ func (a *EndpointApiService) V1EndpointUpdateExecute(r ApiV1EndpointUpdateReques } type ApiV1EndpointUpdateHeadersRequest struct { - ctx _context.Context - ApiService *EndpointApiService + ctx context.Context + ApiService *EndpointAPIService appId string endpointId string endpointHeadersIn *EndpointHeadersIn @@ -3417,19 +3513,21 @@ func (r ApiV1EndpointUpdateHeadersRequest) EndpointHeadersIn(endpointHeadersIn E return r } -func (r ApiV1EndpointUpdateHeadersRequest) Execute() (*_nethttp.Response, error) { +func (r ApiV1EndpointUpdateHeadersRequest) Execute() (*http.Response, error) { return r.ApiService.V1EndpointUpdateHeadersExecute(r) } /* - * V1EndpointUpdateHeaders Update Endpoint Headers - * Set the additional headers to be sent with the webhook - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param endpointId The ep's ID or UID - * @return ApiV1EndpointUpdateHeadersRequest - */ -func (a *EndpointApiService) V1EndpointUpdateHeaders(ctx _context.Context, appId string, endpointId string) ApiV1EndpointUpdateHeadersRequest { +V1EndpointUpdateHeaders Update Endpoint Headers + +Set the additional headers to be sent with the webhook + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param endpointId The ep's ID or UID + @return ApiV1EndpointUpdateHeadersRequest +*/ +func (a *EndpointAPIService) V1EndpointUpdateHeaders(ctx context.Context, appId string, endpointId string) ApiV1EndpointUpdateHeadersRequest { return ApiV1EndpointUpdateHeadersRequest{ ApiService: a, ctx: ctx, @@ -3438,30 +3536,26 @@ func (a *EndpointApiService) V1EndpointUpdateHeaders(ctx _context.Context, appId } } -/* - * Execute executes the request - */ -func (a *EndpointApiService) V1EndpointUpdateHeadersExecute(r ApiV1EndpointUpdateHeadersRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *EndpointAPIService) V1EndpointUpdateHeadersExecute(r ApiV1EndpointUpdateHeadersRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointUpdateHeaders") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointAPIService.V1EndpointUpdateHeaders") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return nil, reportError("appId must have at least 1 elements") } @@ -3497,7 +3591,7 @@ func (a *EndpointApiService) V1EndpointUpdateHeadersExecute(r ApiV1EndpointUpdat } // body params localVarPostBody = r.endpointHeadersIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -3507,15 +3601,15 @@ func (a *EndpointApiService) V1EndpointUpdateHeadersExecute(r ApiV1EndpointUpdat return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -3526,7 +3620,8 @@ func (a *EndpointApiService) V1EndpointUpdateHeadersExecute(r ApiV1EndpointUpdat newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -3536,7 +3631,8 @@ func (a *EndpointApiService) V1EndpointUpdateHeadersExecute(r ApiV1EndpointUpdat newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -3546,7 +3642,8 @@ func (a *EndpointApiService) V1EndpointUpdateHeadersExecute(r ApiV1EndpointUpdat newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -3556,7 +3653,8 @@ func (a *EndpointApiService) V1EndpointUpdateHeadersExecute(r ApiV1EndpointUpdat newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -3566,7 +3664,8 @@ func (a *EndpointApiService) V1EndpointUpdateHeadersExecute(r ApiV1EndpointUpdat newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -3576,7 +3675,8 @@ func (a *EndpointApiService) V1EndpointUpdateHeadersExecute(r ApiV1EndpointUpdat newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -3586,7 +3686,8 @@ func (a *EndpointApiService) V1EndpointUpdateHeadersExecute(r ApiV1EndpointUpdat newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } diff --git a/go/internal/openapi/api_environment.go b/go/internal/openapi/api_environment.go index c92e71c0f..8d294e31b 100644 --- a/go/internal/openapi/api_environment.go +++ b/go/internal/openapi/api_environment.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,72 +12,67 @@ package openapi import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" ) -// Linger please -var ( - _ _context.Context -) -// EnvironmentApiService EnvironmentApi service -type EnvironmentApiService service +// EnvironmentAPIService EnvironmentAPI service +type EnvironmentAPIService service type ApiV1EnvironmentExportRequest struct { - ctx _context.Context - ApiService *EnvironmentApiService + ctx context.Context + ApiService *EnvironmentAPIService idempotencyKey *string } +// The request's idempotency key func (r ApiV1EnvironmentExportRequest) IdempotencyKey(idempotencyKey string) ApiV1EnvironmentExportRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1EnvironmentExportRequest) Execute() (EnvironmentOut, *_nethttp.Response, error) { +func (r ApiV1EnvironmentExportRequest) Execute() (*EnvironmentOut, *http.Response, error) { return r.ApiService.V1EnvironmentExportExecute(r) } /* - * V1EnvironmentExport 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 ApiV1EnvironmentExportRequest - */ -func (a *EnvironmentApiService) V1EnvironmentExport(ctx _context.Context) ApiV1EnvironmentExportRequest { +V1EnvironmentExport 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 ApiV1EnvironmentExportRequest +*/ +func (a *EnvironmentAPIService) V1EnvironmentExport(ctx context.Context) ApiV1EnvironmentExportRequest { return ApiV1EnvironmentExportRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return EnvironmentOut - */ -func (a *EnvironmentApiService) V1EnvironmentExportExecute(r ApiV1EnvironmentExportRequest) (EnvironmentOut, *_nethttp.Response, error) { +// Execute executes the request +// @return EnvironmentOut +func (a *EnvironmentAPIService) V1EnvironmentExportExecute(r ApiV1EnvironmentExportRequest) (*EnvironmentOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue EnvironmentOut + formFiles []formFile + localVarReturnValue *EnvironmentOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnvironmentApiService.V1EnvironmentExport") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnvironmentAPIService.V1EnvironmentExport") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/environment/export/" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -97,9 +92,9 @@ func (a *EnvironmentApiService) V1EnvironmentExportExecute(r ApiV1EnvironmentExp localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -109,15 +104,15 @@ func (a *EnvironmentApiService) V1EnvironmentExportExecute(r ApiV1EnvironmentExp return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -128,7 +123,8 @@ func (a *EnvironmentApiService) V1EnvironmentExportExecute(r ApiV1EnvironmentExp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -138,7 +134,8 @@ func (a *EnvironmentApiService) V1EnvironmentExportExecute(r ApiV1EnvironmentExp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -148,7 +145,8 @@ func (a *EnvironmentApiService) V1EnvironmentExportExecute(r ApiV1EnvironmentExp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -158,7 +156,8 @@ func (a *EnvironmentApiService) V1EnvironmentExportExecute(r ApiV1EnvironmentExp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -168,7 +167,8 @@ func (a *EnvironmentApiService) V1EnvironmentExportExecute(r ApiV1EnvironmentExp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -178,7 +178,8 @@ func (a *EnvironmentApiService) V1EnvironmentExportExecute(r ApiV1EnvironmentExp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -188,14 +189,15 @@ func (a *EnvironmentApiService) V1EnvironmentExportExecute(r ApiV1EnvironmentExp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -206,52 +208,49 @@ func (a *EnvironmentApiService) V1EnvironmentExportExecute(r ApiV1EnvironmentExp } type ApiV1EnvironmentExportGetRequest struct { - ctx _context.Context - ApiService *EnvironmentApiService + ctx context.Context + ApiService *EnvironmentAPIService } - -func (r ApiV1EnvironmentExportGetRequest) Execute() (EnvironmentOut, *_nethttp.Response, error) { +func (r ApiV1EnvironmentExportGetRequest) Execute() (*EnvironmentOut, *http.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 { +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) { +// Execute executes the request +// @return EnvironmentOut +func (a *EnvironmentAPIService) V1EnvironmentExportGetExecute(r ApiV1EnvironmentExportGetRequest) (*EnvironmentOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue EnvironmentOut + formFiles []formFile + localVarReturnValue *EnvironmentOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnvironmentApiService.V1EnvironmentExportGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnvironmentAPIService.V1EnvironmentExportGet") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/environment/export/" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -270,7 +269,7 @@ func (a *EnvironmentApiService) V1EnvironmentExportGetExecute(r ApiV1Environment if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -280,15 +279,15 @@ func (a *EnvironmentApiService) V1EnvironmentExportGetExecute(r ApiV1Environment return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -299,7 +298,8 @@ func (a *EnvironmentApiService) V1EnvironmentExportGetExecute(r ApiV1Environment newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -309,7 +309,8 @@ func (a *EnvironmentApiService) V1EnvironmentExportGetExecute(r ApiV1Environment newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -319,7 +320,8 @@ func (a *EnvironmentApiService) V1EnvironmentExportGetExecute(r ApiV1Environment newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -329,7 +331,8 @@ func (a *EnvironmentApiService) V1EnvironmentExportGetExecute(r ApiV1Environment newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -339,7 +342,8 @@ func (a *EnvironmentApiService) V1EnvironmentExportGetExecute(r ApiV1Environment newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -349,7 +353,8 @@ func (a *EnvironmentApiService) V1EnvironmentExportGetExecute(r ApiV1Environment newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -359,14 +364,15 @@ func (a *EnvironmentApiService) V1EnvironmentExportGetExecute(r ApiV1Environment newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -377,8 +383,8 @@ func (a *EnvironmentApiService) V1EnvironmentExportGetExecute(r ApiV1Environment } type ApiV1EnvironmentImportRequest struct { - ctx _context.Context - ApiService *EnvironmentApiService + ctx context.Context + ApiService *EnvironmentAPIService environmentIn *EnvironmentIn idempotencyKey *string } @@ -387,51 +393,51 @@ func (r ApiV1EnvironmentImportRequest) EnvironmentIn(environmentIn EnvironmentIn r.environmentIn = &environmentIn return r } + +// The request's idempotency key func (r ApiV1EnvironmentImportRequest) IdempotencyKey(idempotencyKey string) ApiV1EnvironmentImportRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1EnvironmentImportRequest) Execute() (*_nethttp.Response, error) { +func (r ApiV1EnvironmentImportRequest) Execute() (*http.Response, error) { return r.ApiService.V1EnvironmentImportExecute(r) } /* - * V1EnvironmentImport Import Environment Configuration - * Import a configuration into the active organization. +V1EnvironmentImport Import Environment Configuration + +Import a configuration into the active organization. It doesn't delete anything, only adds/updates what was passed to it. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiV1EnvironmentImportRequest - */ -func (a *EnvironmentApiService) V1EnvironmentImport(ctx _context.Context) ApiV1EnvironmentImportRequest { + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiV1EnvironmentImportRequest +*/ +func (a *EnvironmentAPIService) V1EnvironmentImport(ctx context.Context) ApiV1EnvironmentImportRequest { return ApiV1EnvironmentImportRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - */ -func (a *EnvironmentApiService) V1EnvironmentImportExecute(r ApiV1EnvironmentImportRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *EnvironmentAPIService) V1EnvironmentImportExecute(r ApiV1EnvironmentImportRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnvironmentApiService.V1EnvironmentImport") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnvironmentAPIService.V1EnvironmentImport") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/environment/import/" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.environmentIn == nil { return nil, reportError("environmentIn is required and must be specified") } @@ -454,11 +460,11 @@ func (a *EnvironmentApiService) V1EnvironmentImportExecute(r ApiV1EnvironmentImp localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } // body params localVarPostBody = r.environmentIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -468,15 +474,15 @@ func (a *EnvironmentApiService) V1EnvironmentImportExecute(r ApiV1EnvironmentImp return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -487,7 +493,8 @@ func (a *EnvironmentApiService) V1EnvironmentImportExecute(r ApiV1EnvironmentImp newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -497,7 +504,8 @@ func (a *EnvironmentApiService) V1EnvironmentImportExecute(r ApiV1EnvironmentImp newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -507,7 +515,8 @@ func (a *EnvironmentApiService) V1EnvironmentImportExecute(r ApiV1EnvironmentImp newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -517,7 +526,8 @@ func (a *EnvironmentApiService) V1EnvironmentImportExecute(r ApiV1EnvironmentImp newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -527,7 +537,8 @@ func (a *EnvironmentApiService) V1EnvironmentImportExecute(r ApiV1EnvironmentImp newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -537,7 +548,8 @@ func (a *EnvironmentApiService) V1EnvironmentImportExecute(r ApiV1EnvironmentImp newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -547,7 +559,8 @@ func (a *EnvironmentApiService) V1EnvironmentImportExecute(r ApiV1EnvironmentImp newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } diff --git a/go/internal/openapi/api_environment_settings.go b/go/internal/openapi/api_environment_settings.go index 5f8575325..6530ccd63 100644 --- a/go/internal/openapi/api_environment_settings.go +++ b/go/internal/openapi/api_environment_settings.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,67 +12,60 @@ package openapi import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" ) -// Linger please -var ( - _ _context.Context -) -// EnvironmentSettingsApiService EnvironmentSettingsApi service -type EnvironmentSettingsApiService service +// EnvironmentSettingsAPIService EnvironmentSettingsAPI service +type EnvironmentSettingsAPIService service type ApiV1EnvironmentGetSettingsRequest struct { - ctx _context.Context - ApiService *EnvironmentSettingsApiService + ctx context.Context + ApiService *EnvironmentSettingsAPIService } - -func (r ApiV1EnvironmentGetSettingsRequest) Execute() (EnvironmentSettingsOut, *_nethttp.Response, error) { +func (r ApiV1EnvironmentGetSettingsRequest) Execute() (*EnvironmentSettingsOut, *http.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 *EnvironmentSettingsApiService) V1EnvironmentGetSettings(ctx _context.Context) ApiV1EnvironmentGetSettingsRequest { +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 *EnvironmentSettingsAPIService) V1EnvironmentGetSettings(ctx context.Context) ApiV1EnvironmentGetSettingsRequest { return ApiV1EnvironmentGetSettingsRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return EnvironmentSettingsOut - */ -func (a *EnvironmentSettingsApiService) V1EnvironmentGetSettingsExecute(r ApiV1EnvironmentGetSettingsRequest) (EnvironmentSettingsOut, *_nethttp.Response, error) { +// Execute executes the request +// @return EnvironmentSettingsOut +func (a *EnvironmentSettingsAPIService) V1EnvironmentGetSettingsExecute(r ApiV1EnvironmentGetSettingsRequest) (*EnvironmentSettingsOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue EnvironmentSettingsOut + formFiles []formFile + localVarReturnValue *EnvironmentSettingsOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnvironmentSettingsApiService.V1EnvironmentGetSettings") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnvironmentSettingsAPIService.V1EnvironmentGetSettings") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/environment/settings/" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -91,7 +84,7 @@ func (a *EnvironmentSettingsApiService) V1EnvironmentGetSettingsExecute(r ApiV1E if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -101,15 +94,15 @@ func (a *EnvironmentSettingsApiService) V1EnvironmentGetSettingsExecute(r ApiV1E return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -120,7 +113,8 @@ func (a *EnvironmentSettingsApiService) V1EnvironmentGetSettingsExecute(r ApiV1E newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -130,7 +124,8 @@ func (a *EnvironmentSettingsApiService) V1EnvironmentGetSettingsExecute(r ApiV1E newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -140,7 +135,8 @@ func (a *EnvironmentSettingsApiService) V1EnvironmentGetSettingsExecute(r ApiV1E newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -150,7 +146,8 @@ func (a *EnvironmentSettingsApiService) V1EnvironmentGetSettingsExecute(r ApiV1E newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -160,7 +157,8 @@ func (a *EnvironmentSettingsApiService) V1EnvironmentGetSettingsExecute(r ApiV1E newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -170,7 +168,8 @@ func (a *EnvironmentSettingsApiService) V1EnvironmentGetSettingsExecute(r ApiV1E newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -180,14 +179,15 @@ func (a *EnvironmentSettingsApiService) V1EnvironmentGetSettingsExecute(r ApiV1E newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/go/internal/openapi/api_event_type.go b/go/internal/openapi/api_event_type.go index 771ce7b5e..c2a54b76b 100644 --- a/go/internal/openapi/api_event_type.go +++ b/go/internal/openapi/api_event_type.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,24 +12,20 @@ package openapi import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) -// EventTypeApiService EventTypeApi service -type EventTypeApiService service +// EventTypeAPIService EventTypeAPI service +type EventTypeAPIService service type ApiV1EventTypeCreateRequest struct { - ctx _context.Context - ApiService *EventTypeApiService + ctx context.Context + ApiService *EventTypeAPIService eventTypeIn *EventTypeIn idempotencyKey *string } @@ -38,56 +34,56 @@ func (r ApiV1EventTypeCreateRequest) EventTypeIn(eventTypeIn EventTypeIn) ApiV1E r.eventTypeIn = &eventTypeIn return r } + +// The request's idempotency key func (r ApiV1EventTypeCreateRequest) IdempotencyKey(idempotencyKey string) ApiV1EventTypeCreateRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1EventTypeCreateRequest) Execute() (EventTypeOut, *_nethttp.Response, error) { +func (r ApiV1EventTypeCreateRequest) Execute() (*EventTypeOut, *http.Response, error) { return r.ApiService.V1EventTypeCreateExecute(r) } /* - * V1EventTypeCreate Create Event Type - * Create new or unarchive existing event type. +V1EventTypeCreate Create Event Type + +Create new or unarchive existing event type. Unarchiving an event type will allow endpoints to filter on it and messages to be sent with it. Endpoints filtering on the event type before archival will continue to filter on it. This operation does not preserve the description and schemas. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiV1EventTypeCreateRequest - */ -func (a *EventTypeApiService) V1EventTypeCreate(ctx _context.Context) ApiV1EventTypeCreateRequest { + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiV1EventTypeCreateRequest +*/ +func (a *EventTypeAPIService) V1EventTypeCreate(ctx context.Context) ApiV1EventTypeCreateRequest { return ApiV1EventTypeCreateRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return EventTypeOut - */ -func (a *EventTypeApiService) V1EventTypeCreateExecute(r ApiV1EventTypeCreateRequest) (EventTypeOut, *_nethttp.Response, error) { +// Execute executes the request +// @return EventTypeOut +func (a *EventTypeAPIService) V1EventTypeCreateExecute(r ApiV1EventTypeCreateRequest) (*EventTypeOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue EventTypeOut + formFiles []formFile + localVarReturnValue *EventTypeOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventTypeApiService.V1EventTypeCreate") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventTypeAPIService.V1EventTypeCreate") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/event-type/" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.eventTypeIn == nil { return localVarReturnValue, nil, reportError("eventTypeIn is required and must be specified") } @@ -110,11 +106,11 @@ func (a *EventTypeApiService) V1EventTypeCreateExecute(r ApiV1EventTypeCreateReq localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } // body params localVarPostBody = r.eventTypeIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -124,15 +120,15 @@ func (a *EventTypeApiService) V1EventTypeCreateExecute(r ApiV1EventTypeCreateReq return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -143,7 +139,8 @@ func (a *EventTypeApiService) V1EventTypeCreateExecute(r ApiV1EventTypeCreateReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -153,7 +150,8 @@ func (a *EventTypeApiService) V1EventTypeCreateExecute(r ApiV1EventTypeCreateReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -163,7 +161,8 @@ func (a *EventTypeApiService) V1EventTypeCreateExecute(r ApiV1EventTypeCreateReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -173,7 +172,8 @@ func (a *EventTypeApiService) V1EventTypeCreateExecute(r ApiV1EventTypeCreateReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -183,7 +183,8 @@ func (a *EventTypeApiService) V1EventTypeCreateExecute(r ApiV1EventTypeCreateReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -193,7 +194,8 @@ func (a *EventTypeApiService) V1EventTypeCreateExecute(r ApiV1EventTypeCreateReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -203,14 +205,15 @@ func (a *EventTypeApiService) V1EventTypeCreateExecute(r ApiV1EventTypeCreateReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -221,34 +224,37 @@ func (a *EventTypeApiService) V1EventTypeCreateExecute(r ApiV1EventTypeCreateReq } type ApiV1EventTypeDeleteRequest struct { - ctx _context.Context - ApiService *EventTypeApiService + ctx context.Context + ApiService *EventTypeAPIService eventTypeName string expunge *bool } +// By default event types are archived when \"deleted\". Passing this to `true` deletes them entirely. func (r ApiV1EventTypeDeleteRequest) Expunge(expunge bool) ApiV1EventTypeDeleteRequest { r.expunge = &expunge return r } -func (r ApiV1EventTypeDeleteRequest) Execute() (*_nethttp.Response, error) { +func (r ApiV1EventTypeDeleteRequest) Execute() (*http.Response, error) { return r.ApiService.V1EventTypeDeleteExecute(r) } /* - * V1EventTypeDelete Delete Event Type - * Archive an event type. +V1EventTypeDelete Delete Event Type + +Archive an event type. Endpoints already configured to filter on an event type will continue to do so after archival. However, new messages can not be sent with it and endpoints can not filter on it. An event type can be unarchived with the [create operation](#operation/create_event_type_api_v1_event_type__post). - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param eventTypeName The event type's name - * @return ApiV1EventTypeDeleteRequest - */ -func (a *EventTypeApiService) V1EventTypeDelete(ctx _context.Context, eventTypeName string) ApiV1EventTypeDeleteRequest { + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param eventTypeName The event type's name + @return ApiV1EventTypeDeleteRequest +*/ +func (a *EventTypeAPIService) V1EventTypeDelete(ctx context.Context, eventTypeName string) ApiV1EventTypeDeleteRequest { return ApiV1EventTypeDeleteRequest{ ApiService: a, ctx: ctx, @@ -256,35 +262,34 @@ func (a *EventTypeApiService) V1EventTypeDelete(ctx _context.Context, eventTypeN } } -/* - * Execute executes the request - */ -func (a *EventTypeApiService) V1EventTypeDeleteExecute(r ApiV1EventTypeDeleteRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *EventTypeAPIService) V1EventTypeDeleteExecute(r ApiV1EventTypeDeleteRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventTypeApiService.V1EventTypeDelete") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventTypeAPIService.V1EventTypeDelete") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/event-type/{event_type_name}/" - localVarPath = strings.Replace(localVarPath, "{"+"event_type_name"+"}", _neturl.PathEscape(parameterToString(r.eventTypeName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"event_type_name"+"}", url.PathEscape(parameterValueToString(r.eventTypeName, "eventTypeName")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.eventTypeName) > 256 { return nil, reportError("eventTypeName must have less than 256 elements") } if r.expunge != nil { - localVarQueryParams.Add("expunge", parameterToString(*r.expunge, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "expunge", r.expunge, "") + } else { + var defaultValue bool = false + r.expunge = &defaultValue } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -303,7 +308,7 @@ func (a *EventTypeApiService) V1EventTypeDeleteExecute(r ApiV1EventTypeDeleteReq if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -313,15 +318,15 @@ func (a *EventTypeApiService) V1EventTypeDeleteExecute(r ApiV1EventTypeDeleteReq return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -332,7 +337,8 @@ func (a *EventTypeApiService) V1EventTypeDeleteExecute(r ApiV1EventTypeDeleteReq newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -342,7 +348,8 @@ func (a *EventTypeApiService) V1EventTypeDeleteExecute(r ApiV1EventTypeDeleteReq newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -352,7 +359,8 @@ func (a *EventTypeApiService) V1EventTypeDeleteExecute(r ApiV1EventTypeDeleteReq newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -362,7 +370,8 @@ func (a *EventTypeApiService) V1EventTypeDeleteExecute(r ApiV1EventTypeDeleteReq newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -372,7 +381,8 @@ func (a *EventTypeApiService) V1EventTypeDeleteExecute(r ApiV1EventTypeDeleteReq newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -382,7 +392,8 @@ func (a *EventTypeApiService) V1EventTypeDeleteExecute(r ApiV1EventTypeDeleteReq newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -392,7 +403,8 @@ func (a *EventTypeApiService) V1EventTypeDeleteExecute(r ApiV1EventTypeDeleteReq newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -401,58 +413,57 @@ func (a *EventTypeApiService) V1EventTypeDeleteExecute(r ApiV1EventTypeDeleteReq } type ApiV1EventTypeExportOpenapiRequest struct { - ctx _context.Context - ApiService *EventTypeApiService + ctx context.Context + ApiService *EventTypeAPIService idempotencyKey *string } +// The request's idempotency key func (r ApiV1EventTypeExportOpenapiRequest) IdempotencyKey(idempotencyKey string) ApiV1EventTypeExportOpenapiRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1EventTypeExportOpenapiRequest) Execute() (ExportEventTypeOut, *_nethttp.Response, error) { +func (r ApiV1EventTypeExportOpenapiRequest) Execute() (*ExportEventTypeOut, *http.Response, error) { return r.ApiService.V1EventTypeExportOpenapiExecute(r) } /* - * V1EventTypeExportOpenapi Event Type Export From Openapi - * Exports event type definitions based on the OpenAPI schemas associated +V1EventTypeExportOpenapi Event Type Export From Openapi + +Exports event type definitions based on the OpenAPI schemas associated with each existing event type - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiV1EventTypeExportOpenapiRequest - */ -func (a *EventTypeApiService) V1EventTypeExportOpenapi(ctx _context.Context) ApiV1EventTypeExportOpenapiRequest { + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiV1EventTypeExportOpenapiRequest +*/ +func (a *EventTypeAPIService) V1EventTypeExportOpenapi(ctx context.Context) ApiV1EventTypeExportOpenapiRequest { return ApiV1EventTypeExportOpenapiRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return ExportEventTypeOut - */ -func (a *EventTypeApiService) V1EventTypeExportOpenapiExecute(r ApiV1EventTypeExportOpenapiRequest) (ExportEventTypeOut, *_nethttp.Response, error) { +// Execute executes the request +// @return ExportEventTypeOut +func (a *EventTypeAPIService) V1EventTypeExportOpenapiExecute(r ApiV1EventTypeExportOpenapiRequest) (*ExportEventTypeOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ExportEventTypeOut + formFiles []formFile + localVarReturnValue *ExportEventTypeOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventTypeApiService.V1EventTypeExportOpenapi") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventTypeAPIService.V1EventTypeExportOpenapi") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/event-type/export/openapi/" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -472,9 +483,9 @@ func (a *EventTypeApiService) V1EventTypeExportOpenapiExecute(r ApiV1EventTypeEx localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -484,15 +495,15 @@ func (a *EventTypeApiService) V1EventTypeExportOpenapiExecute(r ApiV1EventTypeEx return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -503,7 +514,8 @@ func (a *EventTypeApiService) V1EventTypeExportOpenapiExecute(r ApiV1EventTypeEx newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -513,7 +525,8 @@ func (a *EventTypeApiService) V1EventTypeExportOpenapiExecute(r ApiV1EventTypeEx newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -523,7 +536,8 @@ func (a *EventTypeApiService) V1EventTypeExportOpenapiExecute(r ApiV1EventTypeEx newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -533,7 +547,8 @@ func (a *EventTypeApiService) V1EventTypeExportOpenapiExecute(r ApiV1EventTypeEx newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -543,7 +558,8 @@ func (a *EventTypeApiService) V1EventTypeExportOpenapiExecute(r ApiV1EventTypeEx newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -553,7 +569,8 @@ func (a *EventTypeApiService) V1EventTypeExportOpenapiExecute(r ApiV1EventTypeEx newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -563,14 +580,15 @@ func (a *EventTypeApiService) V1EventTypeExportOpenapiExecute(r ApiV1EventTypeEx newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -581,8 +599,8 @@ func (a *EventTypeApiService) V1EventTypeExportOpenapiExecute(r ApiV1EventTypeEx } type ApiV1EventTypeGenerateExampleRequest struct { - ctx _context.Context - ApiService *EventTypeApiService + ctx context.Context + ApiService *EventTypeAPIService eventTypeSchemaIn *EventTypeSchemaIn idempotencyKey *string } @@ -591,52 +609,52 @@ func (r ApiV1EventTypeGenerateExampleRequest) EventTypeSchemaIn(eventTypeSchemaI r.eventTypeSchemaIn = &eventTypeSchemaIn return r } + +// The request's idempotency key func (r ApiV1EventTypeGenerateExampleRequest) IdempotencyKey(idempotencyKey string) ApiV1EventTypeGenerateExampleRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1EventTypeGenerateExampleRequest) Execute() (EventTypeExampleOut, *_nethttp.Response, error) { +func (r ApiV1EventTypeGenerateExampleRequest) Execute() (*EventTypeExampleOut, *http.Response, error) { return r.ApiService.V1EventTypeGenerateExampleExecute(r) } /* - * V1EventTypeGenerateExample Generate Schema Example - * Generates a fake example from the given JSONSchema - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiV1EventTypeGenerateExampleRequest - */ -func (a *EventTypeApiService) V1EventTypeGenerateExample(ctx _context.Context) ApiV1EventTypeGenerateExampleRequest { +V1EventTypeGenerateExample Generate Schema Example + +Generates a fake example from the given JSONSchema + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiV1EventTypeGenerateExampleRequest +*/ +func (a *EventTypeAPIService) V1EventTypeGenerateExample(ctx context.Context) ApiV1EventTypeGenerateExampleRequest { return ApiV1EventTypeGenerateExampleRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return EventTypeExampleOut - */ -func (a *EventTypeApiService) V1EventTypeGenerateExampleExecute(r ApiV1EventTypeGenerateExampleRequest) (EventTypeExampleOut, *_nethttp.Response, error) { +// Execute executes the request +// @return EventTypeExampleOut +func (a *EventTypeAPIService) V1EventTypeGenerateExampleExecute(r ApiV1EventTypeGenerateExampleRequest) (*EventTypeExampleOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue EventTypeExampleOut + formFiles []formFile + localVarReturnValue *EventTypeExampleOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventTypeApiService.V1EventTypeGenerateExample") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventTypeAPIService.V1EventTypeGenerateExample") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/event-type/schema/generate-example/" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.eventTypeSchemaIn == nil { return localVarReturnValue, nil, reportError("eventTypeSchemaIn is required and must be specified") } @@ -659,11 +677,11 @@ func (a *EventTypeApiService) V1EventTypeGenerateExampleExecute(r ApiV1EventType localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } // body params localVarPostBody = r.eventTypeSchemaIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -673,15 +691,15 @@ func (a *EventTypeApiService) V1EventTypeGenerateExampleExecute(r ApiV1EventType return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -692,7 +710,8 @@ func (a *EventTypeApiService) V1EventTypeGenerateExampleExecute(r ApiV1EventType newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -702,7 +721,8 @@ func (a *EventTypeApiService) V1EventTypeGenerateExampleExecute(r ApiV1EventType newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -712,7 +732,8 @@ func (a *EventTypeApiService) V1EventTypeGenerateExampleExecute(r ApiV1EventType newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -722,7 +743,8 @@ func (a *EventTypeApiService) V1EventTypeGenerateExampleExecute(r ApiV1EventType newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -732,7 +754,8 @@ func (a *EventTypeApiService) V1EventTypeGenerateExampleExecute(r ApiV1EventType newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -742,7 +765,8 @@ func (a *EventTypeApiService) V1EventTypeGenerateExampleExecute(r ApiV1EventType newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -752,14 +776,15 @@ func (a *EventTypeApiService) V1EventTypeGenerateExampleExecute(r ApiV1EventType newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -770,24 +795,25 @@ func (a *EventTypeApiService) V1EventTypeGenerateExampleExecute(r ApiV1EventType } type ApiV1EventTypeGetRequest struct { - ctx _context.Context - ApiService *EventTypeApiService + ctx context.Context + ApiService *EventTypeAPIService eventTypeName string } - -func (r ApiV1EventTypeGetRequest) Execute() (EventTypeOut, *_nethttp.Response, error) { +func (r ApiV1EventTypeGetRequest) Execute() (*EventTypeOut, *http.Response, error) { return r.ApiService.V1EventTypeGetExecute(r) } /* - * V1EventTypeGet Get Event Type - * Get an event type. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param eventTypeName The event type's name - * @return ApiV1EventTypeGetRequest - */ -func (a *EventTypeApiService) V1EventTypeGet(ctx _context.Context, eventTypeName string) ApiV1EventTypeGetRequest { +V1EventTypeGet Get Event Type + +Get an event type. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param eventTypeName The event type's name + @return ApiV1EventTypeGetRequest +*/ +func (a *EventTypeAPIService) V1EventTypeGet(ctx context.Context, eventTypeName string) ApiV1EventTypeGetRequest { return ApiV1EventTypeGetRequest{ ApiService: a, ctx: ctx, @@ -795,31 +821,209 @@ func (a *EventTypeApiService) V1EventTypeGet(ctx _context.Context, eventTypeName } } -/* - * Execute executes the request - * @return EventTypeOut - */ -func (a *EventTypeApiService) V1EventTypeGetExecute(r ApiV1EventTypeGetRequest) (EventTypeOut, *_nethttp.Response, error) { +// Execute executes the request +// @return EventTypeOut +func (a *EventTypeAPIService) V1EventTypeGetExecute(r ApiV1EventTypeGetRequest) (*EventTypeOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue EventTypeOut + formFiles []formFile + localVarReturnValue *EventTypeOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventTypeApiService.V1EventTypeGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventTypeAPIService.V1EventTypeGet") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/event-type/{event_type_name}/" - localVarPath = strings.Replace(localVarPath, "{"+"event_type_name"+"}", _neturl.PathEscape(parameterToString(r.eventTypeName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"event_type_name"+"}", url.PathEscape(parameterValueToString(r.eventTypeName, "eventTypeName")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.eventTypeName) > 256 { + return localVarReturnValue, nil, reportError("eventTypeName must have less than 256 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v HTTPValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiV1EventTypeGetRetryScheduleRequest struct { + ctx context.Context + ApiService *EventTypeAPIService + eventTypeName string +} + +func (r ApiV1EventTypeGetRetryScheduleRequest) Execute() (*RetryScheduleInOut, *http.Response, error) { + return r.ApiService.V1EventTypeGetRetryScheduleExecute(r) +} + +/* +V1EventTypeGetRetrySchedule Get Retry Schedule + +Gets the retry schedule for messages using the given event type + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param eventTypeName The event type's name + @return ApiV1EventTypeGetRetryScheduleRequest +*/ +func (a *EventTypeAPIService) V1EventTypeGetRetrySchedule(ctx context.Context, eventTypeName string) ApiV1EventTypeGetRetryScheduleRequest { + return ApiV1EventTypeGetRetryScheduleRequest{ + ApiService: a, + ctx: ctx, + eventTypeName: eventTypeName, + } +} + +// Execute executes the request +// @return RetryScheduleInOut +func (a *EventTypeAPIService) V1EventTypeGetRetryScheduleExecute(r ApiV1EventTypeGetRetryScheduleRequest) (*RetryScheduleInOut, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RetryScheduleInOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventTypeAPIService.V1EventTypeGetRetrySchedule") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/event-type/{event_type_name}/retry-schedule/" + localVarPath = strings.Replace(localVarPath, "{"+"event_type_name"+"}", url.PathEscape(parameterValueToString(r.eventTypeName, "eventTypeName")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.eventTypeName) > 256 { return localVarReturnValue, nil, reportError("eventTypeName must have less than 256 elements") } @@ -841,7 +1045,7 @@ func (a *EventTypeApiService) V1EventTypeGetExecute(r ApiV1EventTypeGetRequest) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -851,15 +1055,15 @@ func (a *EventTypeApiService) V1EventTypeGetExecute(r ApiV1EventTypeGetRequest) return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -870,7 +1074,8 @@ func (a *EventTypeApiService) V1EventTypeGetExecute(r ApiV1EventTypeGetRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -880,7 +1085,8 @@ func (a *EventTypeApiService) V1EventTypeGetExecute(r ApiV1EventTypeGetRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -890,7 +1096,8 @@ func (a *EventTypeApiService) V1EventTypeGetExecute(r ApiV1EventTypeGetRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -900,7 +1107,8 @@ func (a *EventTypeApiService) V1EventTypeGetExecute(r ApiV1EventTypeGetRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -910,7 +1118,8 @@ func (a *EventTypeApiService) V1EventTypeGetExecute(r ApiV1EventTypeGetRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -920,7 +1129,8 @@ func (a *EventTypeApiService) V1EventTypeGetExecute(r ApiV1EventTypeGetRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -930,14 +1140,15 @@ func (a *EventTypeApiService) V1EventTypeGetExecute(r ApiV1EventTypeGetRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -948,66 +1159,67 @@ func (a *EventTypeApiService) V1EventTypeGetExecute(r ApiV1EventTypeGetRequest) } type ApiV1EventTypeImportOpenapiRequest struct { - ctx _context.Context - ApiService *EventTypeApiService + ctx context.Context + ApiService *EventTypeAPIService eventTypeImportOpenApiIn *EventTypeImportOpenApiIn idempotencyKey *string } +// Import a list of event types from webhooks defined in an OpenAPI spec. The OpenAPI spec can be specified as either `spec` given the spec as a JSON object, or as `specRaw` (a `string`) which will be parsed as YAML or JSON by the server. Sending neither or both is invalid, resulting in a `400` **Bad Request**. func (r ApiV1EventTypeImportOpenapiRequest) EventTypeImportOpenApiIn(eventTypeImportOpenApiIn EventTypeImportOpenApiIn) ApiV1EventTypeImportOpenapiRequest { r.eventTypeImportOpenApiIn = &eventTypeImportOpenApiIn return r } + +// The request's idempotency key func (r ApiV1EventTypeImportOpenapiRequest) IdempotencyKey(idempotencyKey string) ApiV1EventTypeImportOpenapiRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1EventTypeImportOpenapiRequest) Execute() (EventTypeImportOpenApiOut, *_nethttp.Response, error) { +func (r ApiV1EventTypeImportOpenapiRequest) Execute() (*EventTypeImportOpenApiOut, *http.Response, error) { return r.ApiService.V1EventTypeImportOpenapiExecute(r) } /* - * V1EventTypeImportOpenapi Event Type Import From Openapi - * Given an OpenAPI spec, create new or update existing event types. +V1EventTypeImportOpenapi Event Type Import From Openapi + +Given an OpenAPI spec, create new or update existing event types. If an existing `archived` event type is updated, it will be unarchvied. The importer will convert all webhooks found in the either the `webhooks` or `x-webhooks` top-level. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiV1EventTypeImportOpenapiRequest - */ -func (a *EventTypeApiService) V1EventTypeImportOpenapi(ctx _context.Context) ApiV1EventTypeImportOpenapiRequest { + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiV1EventTypeImportOpenapiRequest +*/ +func (a *EventTypeAPIService) V1EventTypeImportOpenapi(ctx context.Context) ApiV1EventTypeImportOpenapiRequest { return ApiV1EventTypeImportOpenapiRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return EventTypeImportOpenApiOut - */ -func (a *EventTypeApiService) V1EventTypeImportOpenapiExecute(r ApiV1EventTypeImportOpenapiRequest) (EventTypeImportOpenApiOut, *_nethttp.Response, error) { +// Execute executes the request +// @return EventTypeImportOpenApiOut +func (a *EventTypeAPIService) V1EventTypeImportOpenapiExecute(r ApiV1EventTypeImportOpenapiRequest) (*EventTypeImportOpenApiOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue EventTypeImportOpenApiOut + formFiles []formFile + localVarReturnValue *EventTypeImportOpenApiOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventTypeApiService.V1EventTypeImportOpenapi") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventTypeAPIService.V1EventTypeImportOpenapi") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/event-type/import/openapi/" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.eventTypeImportOpenApiIn == nil { return localVarReturnValue, nil, reportError("eventTypeImportOpenApiIn is required and must be specified") } @@ -1030,11 +1242,11 @@ func (a *EventTypeApiService) V1EventTypeImportOpenapiExecute(r ApiV1EventTypeIm localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } // body params localVarPostBody = r.eventTypeImportOpenApiIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1044,15 +1256,15 @@ func (a *EventTypeApiService) V1EventTypeImportOpenapiExecute(r ApiV1EventTypeIm return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1063,7 +1275,8 @@ func (a *EventTypeApiService) V1EventTypeImportOpenapiExecute(r ApiV1EventTypeIm newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1073,7 +1286,8 @@ func (a *EventTypeApiService) V1EventTypeImportOpenapiExecute(r ApiV1EventTypeIm newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1083,7 +1297,8 @@ func (a *EventTypeApiService) V1EventTypeImportOpenapiExecute(r ApiV1EventTypeIm newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1093,7 +1308,8 @@ func (a *EventTypeApiService) V1EventTypeImportOpenapiExecute(r ApiV1EventTypeIm newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -1103,7 +1319,8 @@ func (a *EventTypeApiService) V1EventTypeImportOpenapiExecute(r ApiV1EventTypeIm newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1113,7 +1330,8 @@ func (a *EventTypeApiService) V1EventTypeImportOpenapiExecute(r ApiV1EventTypeIm newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1123,14 +1341,15 @@ func (a *EventTypeApiService) V1EventTypeImportOpenapiExecute(r ApiV1EventTypeIm newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1141,8 +1360,8 @@ func (a *EventTypeApiService) V1EventTypeImportOpenapiExecute(r ApiV1EventTypeIm } type ApiV1EventTypeListRequest struct { - ctx _context.Context - ApiService *EventTypeApiService + ctx context.Context + ApiService *EventTypeAPIService limit *int32 iterator *string order *Ordering @@ -1150,83 +1369,96 @@ type ApiV1EventTypeListRequest struct { withContent *bool } +// Limit the number of returned items func (r ApiV1EventTypeListRequest) Limit(limit int32) ApiV1EventTypeListRequest { r.limit = &limit return r } + +// The iterator returned from a prior invocation func (r ApiV1EventTypeListRequest) Iterator(iterator string) ApiV1EventTypeListRequest { r.iterator = &iterator return r } + +// The sorting order of the returned items func (r ApiV1EventTypeListRequest) Order(order Ordering) ApiV1EventTypeListRequest { r.order = &order return r } + +// When `true` archived (deleted but not expunged) items are included in the response func (r ApiV1EventTypeListRequest) IncludeArchived(includeArchived bool) ApiV1EventTypeListRequest { r.includeArchived = &includeArchived return r } + +// When `true` the full item (including the schema) is included in the response func (r ApiV1EventTypeListRequest) WithContent(withContent bool) ApiV1EventTypeListRequest { r.withContent = &withContent return r } -func (r ApiV1EventTypeListRequest) Execute() (ListResponseEventTypeOut, *_nethttp.Response, error) { +func (r ApiV1EventTypeListRequest) Execute() (*ListResponseEventTypeOut, *http.Response, error) { return r.ApiService.V1EventTypeListExecute(r) } /* - * V1EventTypeList List Event Types - * Return the list of event types. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiV1EventTypeListRequest - */ -func (a *EventTypeApiService) V1EventTypeList(ctx _context.Context) ApiV1EventTypeListRequest { +V1EventTypeList List Event Types + +Return the list of event types. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiV1EventTypeListRequest +*/ +func (a *EventTypeAPIService) V1EventTypeList(ctx context.Context) ApiV1EventTypeListRequest { return ApiV1EventTypeListRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return ListResponseEventTypeOut - */ -func (a *EventTypeApiService) V1EventTypeListExecute(r ApiV1EventTypeListRequest) (ListResponseEventTypeOut, *_nethttp.Response, error) { +// Execute executes the request +// @return ListResponseEventTypeOut +func (a *EventTypeAPIService) V1EventTypeListExecute(r ApiV1EventTypeListRequest) (*ListResponseEventTypeOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ListResponseEventTypeOut + formFiles []formFile + localVarReturnValue *ListResponseEventTypeOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventTypeApiService.V1EventTypeList") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventTypeAPIService.V1EventTypeList") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/event-type/" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") } if r.iterator != nil { - localVarQueryParams.Add("iterator", parameterToString(*r.iterator, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "iterator", r.iterator, "") } if r.order != nil { - localVarQueryParams.Add("order", parameterToString(*r.order, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "order", r.order, "") } if r.includeArchived != nil { - localVarQueryParams.Add("include_archived", parameterToString(*r.includeArchived, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "include_archived", r.includeArchived, "") + } else { + var defaultValue bool = false + r.includeArchived = &defaultValue } if r.withContent != nil { - localVarQueryParams.Add("with_content", parameterToString(*r.withContent, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "with_content", r.withContent, "") + } else { + var defaultValue bool = false + r.withContent = &defaultValue } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1245,7 +1477,7 @@ func (a *EventTypeApiService) V1EventTypeListExecute(r ApiV1EventTypeListRequest if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1255,15 +1487,15 @@ func (a *EventTypeApiService) V1EventTypeListExecute(r ApiV1EventTypeListRequest return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1274,7 +1506,8 @@ func (a *EventTypeApiService) V1EventTypeListExecute(r ApiV1EventTypeListRequest newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1284,7 +1517,8 @@ func (a *EventTypeApiService) V1EventTypeListExecute(r ApiV1EventTypeListRequest newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1294,7 +1528,8 @@ func (a *EventTypeApiService) V1EventTypeListExecute(r ApiV1EventTypeListRequest newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1304,7 +1539,8 @@ func (a *EventTypeApiService) V1EventTypeListExecute(r ApiV1EventTypeListRequest newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -1314,7 +1550,8 @@ func (a *EventTypeApiService) V1EventTypeListExecute(r ApiV1EventTypeListRequest newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1324,7 +1561,8 @@ func (a *EventTypeApiService) V1EventTypeListExecute(r ApiV1EventTypeListRequest newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1334,14 +1572,15 @@ func (a *EventTypeApiService) V1EventTypeListExecute(r ApiV1EventTypeListRequest newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1352,8 +1591,8 @@ func (a *EventTypeApiService) V1EventTypeListExecute(r ApiV1EventTypeListRequest } type ApiV1EventTypePatchRequest struct { - ctx _context.Context - ApiService *EventTypeApiService + ctx context.Context + ApiService *EventTypeAPIService eventTypeName string eventTypePatch *EventTypePatch } @@ -1363,18 +1602,20 @@ func (r ApiV1EventTypePatchRequest) EventTypePatch(eventTypePatch EventTypePatch return r } -func (r ApiV1EventTypePatchRequest) Execute() (EventTypeOut, *_nethttp.Response, error) { +func (r ApiV1EventTypePatchRequest) Execute() (*EventTypeOut, *http.Response, error) { return r.ApiService.V1EventTypePatchExecute(r) } /* - * V1EventTypePatch Patch Event Type - * Partially update an event type. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param eventTypeName The event type's name - * @return ApiV1EventTypePatchRequest - */ -func (a *EventTypeApiService) V1EventTypePatch(ctx _context.Context, eventTypeName string) ApiV1EventTypePatchRequest { +V1EventTypePatch Patch Event Type + +Partially update an event type. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param eventTypeName The event type's name + @return ApiV1EventTypePatchRequest +*/ +func (a *EventTypeAPIService) V1EventTypePatch(ctx context.Context, eventTypeName string) ApiV1EventTypePatchRequest { return ApiV1EventTypePatchRequest{ ApiService: a, ctx: ctx, @@ -1382,31 +1623,27 @@ func (a *EventTypeApiService) V1EventTypePatch(ctx _context.Context, eventTypeNa } } -/* - * Execute executes the request - * @return EventTypeOut - */ -func (a *EventTypeApiService) V1EventTypePatchExecute(r ApiV1EventTypePatchRequest) (EventTypeOut, *_nethttp.Response, error) { +// Execute executes the request +// @return EventTypeOut +func (a *EventTypeAPIService) V1EventTypePatchExecute(r ApiV1EventTypePatchRequest) (*EventTypeOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue EventTypeOut + formFiles []formFile + localVarReturnValue *EventTypeOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventTypeApiService.V1EventTypePatch") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventTypeAPIService.V1EventTypePatch") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/event-type/{event_type_name}/" - localVarPath = strings.Replace(localVarPath, "{"+"event_type_name"+"}", _neturl.PathEscape(parameterToString(r.eventTypeName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"event_type_name"+"}", url.PathEscape(parameterValueToString(r.eventTypeName, "eventTypeName")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.eventTypeName) > 256 { return localVarReturnValue, nil, reportError("eventTypeName must have less than 256 elements") } @@ -1433,7 +1670,7 @@ func (a *EventTypeApiService) V1EventTypePatchExecute(r ApiV1EventTypePatchReque } // body params localVarPostBody = r.eventTypePatch - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1443,15 +1680,15 @@ func (a *EventTypeApiService) V1EventTypePatchExecute(r ApiV1EventTypePatchReque return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1462,7 +1699,8 @@ func (a *EventTypeApiService) V1EventTypePatchExecute(r ApiV1EventTypePatchReque newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1472,7 +1710,8 @@ func (a *EventTypeApiService) V1EventTypePatchExecute(r ApiV1EventTypePatchReque newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1482,7 +1721,8 @@ func (a *EventTypeApiService) V1EventTypePatchExecute(r ApiV1EventTypePatchReque newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1492,7 +1732,8 @@ func (a *EventTypeApiService) V1EventTypePatchExecute(r ApiV1EventTypePatchReque newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -1502,7 +1743,8 @@ func (a *EventTypeApiService) V1EventTypePatchExecute(r ApiV1EventTypePatchReque newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1512,7 +1754,8 @@ func (a *EventTypeApiService) V1EventTypePatchExecute(r ApiV1EventTypePatchReque newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1522,14 +1765,15 @@ func (a *EventTypeApiService) V1EventTypePatchExecute(r ApiV1EventTypePatchReque newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1540,8 +1784,8 @@ func (a *EventTypeApiService) V1EventTypePatchExecute(r ApiV1EventTypePatchReque } type ApiV1EventTypeUpdateRequest struct { - ctx _context.Context - ApiService *EventTypeApiService + ctx context.Context + ApiService *EventTypeAPIService eventTypeName string eventTypeUpdate *EventTypeUpdate } @@ -1551,18 +1795,20 @@ func (r ApiV1EventTypeUpdateRequest) EventTypeUpdate(eventTypeUpdate EventTypeUp return r } -func (r ApiV1EventTypeUpdateRequest) Execute() (EventTypeOut, *_nethttp.Response, error) { +func (r ApiV1EventTypeUpdateRequest) Execute() (*EventTypeOut, *http.Response, error) { return r.ApiService.V1EventTypeUpdateExecute(r) } /* - * V1EventTypeUpdate Update Event Type - * Update an event type. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param eventTypeName The event type's name - * @return ApiV1EventTypeUpdateRequest - */ -func (a *EventTypeApiService) V1EventTypeUpdate(ctx _context.Context, eventTypeName string) ApiV1EventTypeUpdateRequest { +V1EventTypeUpdate Update Event Type + +Update an event type. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param eventTypeName The event type's name + @return ApiV1EventTypeUpdateRequest +*/ +func (a *EventTypeAPIService) V1EventTypeUpdate(ctx context.Context, eventTypeName string) ApiV1EventTypeUpdateRequest { return ApiV1EventTypeUpdateRequest{ ApiService: a, ctx: ctx, @@ -1570,31 +1816,27 @@ func (a *EventTypeApiService) V1EventTypeUpdate(ctx _context.Context, eventTypeN } } -/* - * Execute executes the request - * @return EventTypeOut - */ -func (a *EventTypeApiService) V1EventTypeUpdateExecute(r ApiV1EventTypeUpdateRequest) (EventTypeOut, *_nethttp.Response, error) { +// Execute executes the request +// @return EventTypeOut +func (a *EventTypeAPIService) V1EventTypeUpdateExecute(r ApiV1EventTypeUpdateRequest) (*EventTypeOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue EventTypeOut + formFiles []formFile + localVarReturnValue *EventTypeOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventTypeApiService.V1EventTypeUpdate") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventTypeAPIService.V1EventTypeUpdate") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/event-type/{event_type_name}/" - localVarPath = strings.Replace(localVarPath, "{"+"event_type_name"+"}", _neturl.PathEscape(parameterToString(r.eventTypeName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"event_type_name"+"}", url.PathEscape(parameterValueToString(r.eventTypeName, "eventTypeName")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.eventTypeName) > 256 { return localVarReturnValue, nil, reportError("eventTypeName must have less than 256 elements") } @@ -1621,7 +1863,200 @@ func (a *EventTypeApiService) V1EventTypeUpdateExecute(r ApiV1EventTypeUpdateReq } // body params localVarPostBody = r.eventTypeUpdate - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v HTTPValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiV1EventTypeUpdateRetryScheduleRequest struct { + ctx context.Context + ApiService *EventTypeAPIService + eventTypeName string + retryScheduleInOut *RetryScheduleInOut +} + +func (r ApiV1EventTypeUpdateRetryScheduleRequest) RetryScheduleInOut(retryScheduleInOut RetryScheduleInOut) ApiV1EventTypeUpdateRetryScheduleRequest { + r.retryScheduleInOut = &retryScheduleInOut + return r +} + +func (r ApiV1EventTypeUpdateRetryScheduleRequest) Execute() (*RetryScheduleInOut, *http.Response, error) { + return r.ApiService.V1EventTypeUpdateRetryScheduleExecute(r) +} + +/* +V1EventTypeUpdateRetrySchedule Update Retry Schedule + +Sets a retry schedule for all messages using the given event type + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param eventTypeName The event type's name + @return ApiV1EventTypeUpdateRetryScheduleRequest +*/ +func (a *EventTypeAPIService) V1EventTypeUpdateRetrySchedule(ctx context.Context, eventTypeName string) ApiV1EventTypeUpdateRetryScheduleRequest { + return ApiV1EventTypeUpdateRetryScheduleRequest{ + ApiService: a, + ctx: ctx, + eventTypeName: eventTypeName, + } +} + +// Execute executes the request +// @return RetryScheduleInOut +func (a *EventTypeAPIService) V1EventTypeUpdateRetryScheduleExecute(r ApiV1EventTypeUpdateRetryScheduleRequest) (*RetryScheduleInOut, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RetryScheduleInOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventTypeAPIService.V1EventTypeUpdateRetrySchedule") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/event-type/{event_type_name}/retry-schedule/" + localVarPath = strings.Replace(localVarPath, "{"+"event_type_name"+"}", url.PathEscape(parameterValueToString(r.eventTypeName, "eventTypeName")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.eventTypeName) > 256 { + return localVarReturnValue, nil, reportError("eventTypeName must have less than 256 elements") + } + if r.retryScheduleInOut == nil { + return localVarReturnValue, nil, reportError("retryScheduleInOut is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.retryScheduleInOut + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1631,15 +2066,15 @@ func (a *EventTypeApiService) V1EventTypeUpdateExecute(r ApiV1EventTypeUpdateReq return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1650,7 +2085,8 @@ func (a *EventTypeApiService) V1EventTypeUpdateExecute(r ApiV1EventTypeUpdateReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1660,7 +2096,8 @@ func (a *EventTypeApiService) V1EventTypeUpdateExecute(r ApiV1EventTypeUpdateReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1670,7 +2107,8 @@ func (a *EventTypeApiService) V1EventTypeUpdateExecute(r ApiV1EventTypeUpdateReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1680,7 +2118,8 @@ func (a *EventTypeApiService) V1EventTypeUpdateExecute(r ApiV1EventTypeUpdateReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -1690,7 +2129,8 @@ func (a *EventTypeApiService) V1EventTypeUpdateExecute(r ApiV1EventTypeUpdateReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1700,7 +2140,8 @@ func (a *EventTypeApiService) V1EventTypeUpdateExecute(r ApiV1EventTypeUpdateReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1710,14 +2151,15 @@ func (a *EventTypeApiService) V1EventTypeUpdateExecute(r ApiV1EventTypeUpdateReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/go/internal/openapi/api_health.go b/go/internal/openapi/api_health.go index 02d504cad..c7eda73a5 100644 --- a/go/internal/openapi/api_health.go +++ b/go/internal/openapi/api_health.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,65 +12,58 @@ package openapi import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" ) -// Linger please -var ( - _ _context.Context -) -// HealthApiService HealthApi service -type HealthApiService service +// HealthAPIService HealthAPI service +type HealthAPIService service type ApiV1HealthGetRequest struct { - ctx _context.Context - ApiService *HealthApiService + ctx context.Context + ApiService *HealthAPIService } - -func (r ApiV1HealthGetRequest) Execute() (*_nethttp.Response, error) { +func (r ApiV1HealthGetRequest) Execute() (*http.Response, error) { return r.ApiService.V1HealthGetExecute(r) } /* - * V1HealthGet Health - * Verify the API server is up and running. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiV1HealthGetRequest - */ -func (a *HealthApiService) V1HealthGet(ctx _context.Context) ApiV1HealthGetRequest { +V1HealthGet Health + +Verify the API server is up and running. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiV1HealthGetRequest +*/ +func (a *HealthAPIService) V1HealthGet(ctx context.Context) ApiV1HealthGetRequest { return ApiV1HealthGetRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - */ -func (a *HealthApiService) V1HealthGetExecute(r ApiV1HealthGetRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *HealthAPIService) V1HealthGetExecute(r ApiV1HealthGetRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "HealthApiService.V1HealthGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "HealthAPIService.V1HealthGet") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/health/" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -89,7 +82,7 @@ func (a *HealthApiService) V1HealthGetExecute(r ApiV1HealthGetRequest) (*_nethtt if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -99,15 +92,15 @@ func (a *HealthApiService) V1HealthGetExecute(r ApiV1HealthGetRequest) (*_nethtt return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -118,7 +111,8 @@ func (a *HealthApiService) V1HealthGetExecute(r ApiV1HealthGetRequest) (*_nethtt newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -128,7 +122,8 @@ func (a *HealthApiService) V1HealthGetExecute(r ApiV1HealthGetRequest) (*_nethtt newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -138,7 +133,8 @@ func (a *HealthApiService) V1HealthGetExecute(r ApiV1HealthGetRequest) (*_nethtt newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -148,7 +144,8 @@ func (a *HealthApiService) V1HealthGetExecute(r ApiV1HealthGetRequest) (*_nethtt newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -158,7 +155,8 @@ func (a *HealthApiService) V1HealthGetExecute(r ApiV1HealthGetRequest) (*_nethtt newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -168,7 +166,8 @@ func (a *HealthApiService) V1HealthGetExecute(r ApiV1HealthGetRequest) (*_nethtt newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -178,7 +177,8 @@ func (a *HealthApiService) V1HealthGetExecute(r ApiV1HealthGetRequest) (*_nethtt newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } diff --git a/go/internal/openapi/api_inbound.go b/go/internal/openapi/api_inbound.go index e59a82395..02b128420 100644 --- a/go/internal/openapi/api_inbound.go +++ b/go/internal/openapi/api_inbound.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,57 +12,53 @@ package openapi import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) -// InboundApiService InboundApi service -type InboundApiService service +// InboundAPIService InboundAPI service +type InboundAPIService service type ApiV1InboundMsgRequest struct { - ctx _context.Context - ApiService *InboundApiService + ctx context.Context + ApiService *InboundAPIService appId string inboundToken string - body *string eventType *string idempotencyKey *string } -func (r ApiV1InboundMsgRequest) Body(body string) ApiV1InboundMsgRequest { - r.body = &body - return r -} +// The event type's name func (r ApiV1InboundMsgRequest) EventType(eventType string) ApiV1InboundMsgRequest { r.eventType = &eventType return r } + +// The request's idempotency key func (r ApiV1InboundMsgRequest) IdempotencyKey(idempotencyKey string) ApiV1InboundMsgRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1InboundMsgRequest) Execute() (MessageOut, *_nethttp.Response, error) { +func (r ApiV1InboundMsgRequest) Execute() (*MessageOut, *http.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 { +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, @@ -71,44 +67,37 @@ func (a *InboundApiService) V1InboundMsg(ctx _context.Context, appId string, inb } } -/* - * Execute executes the request - * @return MessageOut - */ -func (a *InboundApiService) V1InboundMsgExecute(r ApiV1InboundMsgRequest) (MessageOut, *_nethttp.Response, error) { +// Execute executes the request +// @return MessageOut +func (a *InboundAPIService) V1InboundMsgExecute(r ApiV1InboundMsgRequest) (*MessageOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue MessageOut + formFiles []formFile + localVarReturnValue *MessageOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InboundApiService.V1InboundMsg") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InboundAPIService.V1InboundMsg") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + 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) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"inbound_token"+"}", url.PathEscape(parameterValueToString(r.inboundToken, "inboundToken")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } if strlen(r.appId) > 256 { return localVarReturnValue, nil, reportError("appId must have less than 256 elements") } - if r.body == nil { - return localVarReturnValue, nil, reportError("body is required and must be specified") - } if r.eventType != nil { - localVarQueryParams.Add("event_type", parameterToString(*r.eventType, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "event_type", r.eventType, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{"text/plain; charset=utf-8"} @@ -128,11 +117,9 @@ func (a *InboundApiService) V1InboundMsgExecute(r ApiV1InboundMsgRequest) (Messa localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } - // body params - localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -142,15 +129,15 @@ func (a *InboundApiService) V1InboundMsgExecute(r ApiV1InboundMsgRequest) (Messa return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -161,7 +148,8 @@ func (a *InboundApiService) V1InboundMsgExecute(r ApiV1InboundMsgRequest) (Messa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -171,7 +159,8 @@ func (a *InboundApiService) V1InboundMsgExecute(r ApiV1InboundMsgRequest) (Messa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -181,7 +170,8 @@ func (a *InboundApiService) V1InboundMsgExecute(r ApiV1InboundMsgRequest) (Messa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -191,7 +181,8 @@ func (a *InboundApiService) V1InboundMsgExecute(r ApiV1InboundMsgRequest) (Messa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -201,7 +192,8 @@ func (a *InboundApiService) V1InboundMsgExecute(r ApiV1InboundMsgRequest) (Messa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -211,7 +203,8 @@ func (a *InboundApiService) V1InboundMsgExecute(r ApiV1InboundMsgRequest) (Messa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -221,14 +214,15 @@ func (a *InboundApiService) V1InboundMsgExecute(r ApiV1InboundMsgRequest) (Messa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -239,30 +233,33 @@ func (a *InboundApiService) V1InboundMsgExecute(r ApiV1InboundMsgRequest) (Messa } type ApiV1InboundRotateUrlRequest struct { - ctx _context.Context - ApiService *InboundApiService + ctx context.Context + ApiService *InboundAPIService appId string idempotencyKey *string } +// The request's idempotency key func (r ApiV1InboundRotateUrlRequest) IdempotencyKey(idempotencyKey string) ApiV1InboundRotateUrlRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1InboundRotateUrlRequest) Execute() (RotatedUrlOut, *_nethttp.Response, error) { +func (r ApiV1InboundRotateUrlRequest) Execute() (*RotatedUrlOut, *http.Response, error) { return r.ApiService.V1InboundRotateUrlExecute(r) } /* - * V1InboundRotateUrl Rotate Url - * Invalidates the previous inbound url (if one exists), producing a new inbound +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 { + + @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, @@ -270,31 +267,27 @@ func (a *InboundApiService) V1InboundRotateUrl(ctx _context.Context, appId strin } } -/* - * Execute executes the request - * @return RotatedUrlOut - */ -func (a *InboundApiService) V1InboundRotateUrlExecute(r ApiV1InboundRotateUrlRequest) (RotatedUrlOut, *_nethttp.Response, error) { +// Execute executes the request +// @return RotatedUrlOut +func (a *InboundAPIService) V1InboundRotateUrlExecute(r ApiV1InboundRotateUrlRequest) (*RotatedUrlOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue RotatedUrlOut + formFiles []formFile + localVarReturnValue *RotatedUrlOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InboundApiService.V1InboundRotateUrl") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InboundAPIService.V1InboundRotateUrl") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + 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) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -320,9 +313,9 @@ func (a *InboundApiService) V1InboundRotateUrlExecute(r ApiV1InboundRotateUrlReq localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -332,15 +325,15 @@ func (a *InboundApiService) V1InboundRotateUrlExecute(r ApiV1InboundRotateUrlReq return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -351,7 +344,8 @@ func (a *InboundApiService) V1InboundRotateUrlExecute(r ApiV1InboundRotateUrlReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -361,7 +355,8 @@ func (a *InboundApiService) V1InboundRotateUrlExecute(r ApiV1InboundRotateUrlReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -371,7 +366,8 @@ func (a *InboundApiService) V1InboundRotateUrlExecute(r ApiV1InboundRotateUrlReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -381,7 +377,8 @@ func (a *InboundApiService) V1InboundRotateUrlExecute(r ApiV1InboundRotateUrlReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -391,7 +388,8 @@ func (a *InboundApiService) V1InboundRotateUrlExecute(r ApiV1InboundRotateUrlReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -401,7 +399,8 @@ func (a *InboundApiService) V1InboundRotateUrlExecute(r ApiV1InboundRotateUrlReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -411,14 +410,15 @@ func (a *InboundApiService) V1InboundRotateUrlExecute(r ApiV1InboundRotateUrlReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/go/internal/openapi/api_integration.go b/go/internal/openapi/api_integration.go index 8b526c579..79626d1b4 100644 --- a/go/internal/openapi/api_integration.go +++ b/go/internal/openapi/api_integration.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,24 +12,20 @@ package openapi import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) -// IntegrationApiService IntegrationApi service -type IntegrationApiService service +// IntegrationAPIService IntegrationAPI service +type IntegrationAPIService service type ApiV1IntegrationCreateRequest struct { - ctx _context.Context - ApiService *IntegrationApiService + ctx context.Context + ApiService *IntegrationAPIService appId string integrationIn *IntegrationIn idempotencyKey *string @@ -39,23 +35,27 @@ func (r ApiV1IntegrationCreateRequest) IntegrationIn(integrationIn IntegrationIn r.integrationIn = &integrationIn return r } + +// The request's idempotency key func (r ApiV1IntegrationCreateRequest) IdempotencyKey(idempotencyKey string) ApiV1IntegrationCreateRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1IntegrationCreateRequest) Execute() (IntegrationOut, *_nethttp.Response, error) { +func (r ApiV1IntegrationCreateRequest) Execute() (*IntegrationOut, *http.Response, error) { return r.ApiService.V1IntegrationCreateExecute(r) } /* - * V1IntegrationCreate Create Integration - * Create an integration. - * @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 ApiV1IntegrationCreateRequest - */ -func (a *IntegrationApiService) V1IntegrationCreate(ctx _context.Context, appId string) ApiV1IntegrationCreateRequest { +V1IntegrationCreate Create Integration + +Create an integration. + + @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 ApiV1IntegrationCreateRequest +*/ +func (a *IntegrationAPIService) V1IntegrationCreate(ctx context.Context, appId string) ApiV1IntegrationCreateRequest { return ApiV1IntegrationCreateRequest{ ApiService: a, ctx: ctx, @@ -63,31 +63,27 @@ func (a *IntegrationApiService) V1IntegrationCreate(ctx _context.Context, appId } } -/* - * Execute executes the request - * @return IntegrationOut - */ -func (a *IntegrationApiService) V1IntegrationCreateExecute(r ApiV1IntegrationCreateRequest) (IntegrationOut, *_nethttp.Response, error) { +// Execute executes the request +// @return IntegrationOut +func (a *IntegrationAPIService) V1IntegrationCreateExecute(r ApiV1IntegrationCreateRequest) (*IntegrationOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue IntegrationOut + formFiles []formFile + localVarReturnValue *IntegrationOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IntegrationApiService.V1IntegrationCreate") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IntegrationAPIService.V1IntegrationCreate") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/integration/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -116,11 +112,11 @@ func (a *IntegrationApiService) V1IntegrationCreateExecute(r ApiV1IntegrationCre localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } // body params localVarPostBody = r.integrationIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -130,15 +126,15 @@ func (a *IntegrationApiService) V1IntegrationCreateExecute(r ApiV1IntegrationCre return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -149,7 +145,8 @@ func (a *IntegrationApiService) V1IntegrationCreateExecute(r ApiV1IntegrationCre newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -159,7 +156,8 @@ func (a *IntegrationApiService) V1IntegrationCreateExecute(r ApiV1IntegrationCre newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -169,7 +167,8 @@ func (a *IntegrationApiService) V1IntegrationCreateExecute(r ApiV1IntegrationCre newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -179,7 +178,8 @@ func (a *IntegrationApiService) V1IntegrationCreateExecute(r ApiV1IntegrationCre newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -189,7 +189,8 @@ func (a *IntegrationApiService) V1IntegrationCreateExecute(r ApiV1IntegrationCre newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -199,7 +200,8 @@ func (a *IntegrationApiService) V1IntegrationCreateExecute(r ApiV1IntegrationCre newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -209,14 +211,15 @@ func (a *IntegrationApiService) V1IntegrationCreateExecute(r ApiV1IntegrationCre newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -227,26 +230,27 @@ func (a *IntegrationApiService) V1IntegrationCreateExecute(r ApiV1IntegrationCre } type ApiV1IntegrationDeleteRequest struct { - ctx _context.Context - ApiService *IntegrationApiService + ctx context.Context + ApiService *IntegrationAPIService appId string integId string } - -func (r ApiV1IntegrationDeleteRequest) Execute() (*_nethttp.Response, error) { +func (r ApiV1IntegrationDeleteRequest) Execute() (*http.Response, error) { return r.ApiService.V1IntegrationDeleteExecute(r) } /* - * V1IntegrationDelete Delete Integration - * Delete an integration. - * @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 integId The integ's ID - * @return ApiV1IntegrationDeleteRequest - */ -func (a *IntegrationApiService) V1IntegrationDelete(ctx _context.Context, appId string, integId string) ApiV1IntegrationDeleteRequest { +V1IntegrationDelete Delete Integration + +Delete an integration. + + @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 integId The integ's ID + @return ApiV1IntegrationDeleteRequest +*/ +func (a *IntegrationAPIService) V1IntegrationDelete(ctx context.Context, appId string, integId string) ApiV1IntegrationDeleteRequest { return ApiV1IntegrationDeleteRequest{ ApiService: a, ctx: ctx, @@ -255,30 +259,26 @@ func (a *IntegrationApiService) V1IntegrationDelete(ctx _context.Context, appId } } -/* - * Execute executes the request - */ -func (a *IntegrationApiService) V1IntegrationDeleteExecute(r ApiV1IntegrationDeleteRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *IntegrationAPIService) V1IntegrationDeleteExecute(r ApiV1IntegrationDeleteRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IntegrationApiService.V1IntegrationDelete") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IntegrationAPIService.V1IntegrationDelete") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/integration/{integ_id}/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"integ_id"+"}", _neturl.PathEscape(parameterToString(r.integId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"integ_id"+"}", url.PathEscape(parameterValueToString(r.integId, "integId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return nil, reportError("appId must have at least 1 elements") } @@ -303,7 +303,7 @@ func (a *IntegrationApiService) V1IntegrationDeleteExecute(r ApiV1IntegrationDel if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -313,15 +313,15 @@ func (a *IntegrationApiService) V1IntegrationDeleteExecute(r ApiV1IntegrationDel return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -332,7 +332,8 @@ func (a *IntegrationApiService) V1IntegrationDeleteExecute(r ApiV1IntegrationDel newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -342,7 +343,8 @@ func (a *IntegrationApiService) V1IntegrationDeleteExecute(r ApiV1IntegrationDel newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -352,7 +354,8 @@ func (a *IntegrationApiService) V1IntegrationDeleteExecute(r ApiV1IntegrationDel newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -362,7 +365,8 @@ func (a *IntegrationApiService) V1IntegrationDeleteExecute(r ApiV1IntegrationDel newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -372,7 +376,8 @@ func (a *IntegrationApiService) V1IntegrationDeleteExecute(r ApiV1IntegrationDel newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -382,7 +387,8 @@ func (a *IntegrationApiService) V1IntegrationDeleteExecute(r ApiV1IntegrationDel newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -392,7 +398,8 @@ func (a *IntegrationApiService) V1IntegrationDeleteExecute(r ApiV1IntegrationDel newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -401,26 +408,27 @@ func (a *IntegrationApiService) V1IntegrationDeleteExecute(r ApiV1IntegrationDel } type ApiV1IntegrationGetRequest struct { - ctx _context.Context - ApiService *IntegrationApiService + ctx context.Context + ApiService *IntegrationAPIService appId string integId string } - -func (r ApiV1IntegrationGetRequest) Execute() (IntegrationOut, *_nethttp.Response, error) { +func (r ApiV1IntegrationGetRequest) Execute() (*IntegrationOut, *http.Response, error) { return r.ApiService.V1IntegrationGetExecute(r) } /* - * V1IntegrationGet Get Integration - * Get an integration. - * @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 integId The integ's ID - * @return ApiV1IntegrationGetRequest - */ -func (a *IntegrationApiService) V1IntegrationGet(ctx _context.Context, appId string, integId string) ApiV1IntegrationGetRequest { +V1IntegrationGet Get Integration + +Get an integration. + + @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 integId The integ's ID + @return ApiV1IntegrationGetRequest +*/ +func (a *IntegrationAPIService) V1IntegrationGet(ctx context.Context, appId string, integId string) ApiV1IntegrationGetRequest { return ApiV1IntegrationGetRequest{ ApiService: a, ctx: ctx, @@ -429,32 +437,28 @@ func (a *IntegrationApiService) V1IntegrationGet(ctx _context.Context, appId str } } -/* - * Execute executes the request - * @return IntegrationOut - */ -func (a *IntegrationApiService) V1IntegrationGetExecute(r ApiV1IntegrationGetRequest) (IntegrationOut, *_nethttp.Response, error) { +// Execute executes the request +// @return IntegrationOut +func (a *IntegrationAPIService) V1IntegrationGetExecute(r ApiV1IntegrationGetRequest) (*IntegrationOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue IntegrationOut + formFiles []formFile + localVarReturnValue *IntegrationOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IntegrationApiService.V1IntegrationGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IntegrationAPIService.V1IntegrationGet") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/integration/{integ_id}/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"integ_id"+"}", _neturl.PathEscape(parameterToString(r.integId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"integ_id"+"}", url.PathEscape(parameterValueToString(r.integId, "integId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -479,7 +483,7 @@ func (a *IntegrationApiService) V1IntegrationGetExecute(r ApiV1IntegrationGetReq if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -489,15 +493,15 @@ func (a *IntegrationApiService) V1IntegrationGetExecute(r ApiV1IntegrationGetReq return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -508,7 +512,8 @@ func (a *IntegrationApiService) V1IntegrationGetExecute(r ApiV1IntegrationGetReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -518,7 +523,8 @@ func (a *IntegrationApiService) V1IntegrationGetExecute(r ApiV1IntegrationGetReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -528,7 +534,8 @@ func (a *IntegrationApiService) V1IntegrationGetExecute(r ApiV1IntegrationGetReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -538,7 +545,8 @@ func (a *IntegrationApiService) V1IntegrationGetExecute(r ApiV1IntegrationGetReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -548,7 +556,8 @@ func (a *IntegrationApiService) V1IntegrationGetExecute(r ApiV1IntegrationGetReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -558,7 +567,8 @@ func (a *IntegrationApiService) V1IntegrationGetExecute(r ApiV1IntegrationGetReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -568,14 +578,15 @@ func (a *IntegrationApiService) V1IntegrationGetExecute(r ApiV1IntegrationGetReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -586,26 +597,27 @@ func (a *IntegrationApiService) V1IntegrationGetExecute(r ApiV1IntegrationGetReq } type ApiV1IntegrationGetKeyRequest struct { - ctx _context.Context - ApiService *IntegrationApiService + ctx context.Context + ApiService *IntegrationAPIService appId string integId string } - -func (r ApiV1IntegrationGetKeyRequest) Execute() (IntegrationKeyOut, *_nethttp.Response, error) { +func (r ApiV1IntegrationGetKeyRequest) Execute() (*IntegrationKeyOut, *http.Response, error) { return r.ApiService.V1IntegrationGetKeyExecute(r) } /* - * V1IntegrationGetKey Get Integration Key - * Get an integration's key. - * @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 integId The integ's ID - * @return ApiV1IntegrationGetKeyRequest - */ -func (a *IntegrationApiService) V1IntegrationGetKey(ctx _context.Context, appId string, integId string) ApiV1IntegrationGetKeyRequest { +V1IntegrationGetKey Get Integration Key + +Get an integration's key. + + @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 integId The integ's ID + @return ApiV1IntegrationGetKeyRequest +*/ +func (a *IntegrationAPIService) V1IntegrationGetKey(ctx context.Context, appId string, integId string) ApiV1IntegrationGetKeyRequest { return ApiV1IntegrationGetKeyRequest{ ApiService: a, ctx: ctx, @@ -614,32 +626,28 @@ func (a *IntegrationApiService) V1IntegrationGetKey(ctx _context.Context, appId } } -/* - * Execute executes the request - * @return IntegrationKeyOut - */ -func (a *IntegrationApiService) V1IntegrationGetKeyExecute(r ApiV1IntegrationGetKeyRequest) (IntegrationKeyOut, *_nethttp.Response, error) { +// Execute executes the request +// @return IntegrationKeyOut +func (a *IntegrationAPIService) V1IntegrationGetKeyExecute(r ApiV1IntegrationGetKeyRequest) (*IntegrationKeyOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue IntegrationKeyOut + formFiles []formFile + localVarReturnValue *IntegrationKeyOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IntegrationApiService.V1IntegrationGetKey") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IntegrationAPIService.V1IntegrationGetKey") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/integration/{integ_id}/key/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"integ_id"+"}", _neturl.PathEscape(parameterToString(r.integId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"integ_id"+"}", url.PathEscape(parameterValueToString(r.integId, "integId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -664,7 +672,7 @@ func (a *IntegrationApiService) V1IntegrationGetKeyExecute(r ApiV1IntegrationGet if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -674,15 +682,15 @@ func (a *IntegrationApiService) V1IntegrationGetKeyExecute(r ApiV1IntegrationGet return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -693,7 +701,8 @@ func (a *IntegrationApiService) V1IntegrationGetKeyExecute(r ApiV1IntegrationGet newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -703,7 +712,8 @@ func (a *IntegrationApiService) V1IntegrationGetKeyExecute(r ApiV1IntegrationGet newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -713,7 +723,8 @@ func (a *IntegrationApiService) V1IntegrationGetKeyExecute(r ApiV1IntegrationGet newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -723,7 +734,8 @@ func (a *IntegrationApiService) V1IntegrationGetKeyExecute(r ApiV1IntegrationGet newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -733,7 +745,8 @@ func (a *IntegrationApiService) V1IntegrationGetKeyExecute(r ApiV1IntegrationGet newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -743,7 +756,8 @@ func (a *IntegrationApiService) V1IntegrationGetKeyExecute(r ApiV1IntegrationGet newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -753,14 +767,15 @@ func (a *IntegrationApiService) V1IntegrationGetKeyExecute(r ApiV1IntegrationGet newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -771,34 +786,39 @@ func (a *IntegrationApiService) V1IntegrationGetKeyExecute(r ApiV1IntegrationGet } type ApiV1IntegrationListRequest struct { - ctx _context.Context - ApiService *IntegrationApiService + ctx context.Context + ApiService *IntegrationAPIService appId string limit *int32 iterator *string } +// Limit the number of returned items func (r ApiV1IntegrationListRequest) Limit(limit int32) ApiV1IntegrationListRequest { r.limit = &limit return r } + +// The iterator returned from a prior invocation func (r ApiV1IntegrationListRequest) Iterator(iterator string) ApiV1IntegrationListRequest { r.iterator = &iterator return r } -func (r ApiV1IntegrationListRequest) Execute() (ListResponseIntegrationOut, *_nethttp.Response, error) { +func (r ApiV1IntegrationListRequest) Execute() (*ListResponseIntegrationOut, *http.Response, error) { return r.ApiService.V1IntegrationListExecute(r) } /* - * V1IntegrationList List Integrations - * List the application's integrations. - * @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 ApiV1IntegrationListRequest - */ -func (a *IntegrationApiService) V1IntegrationList(ctx _context.Context, appId string) ApiV1IntegrationListRequest { +V1IntegrationList List Integrations + +List the application's integrations. + + @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 ApiV1IntegrationListRequest +*/ +func (a *IntegrationAPIService) V1IntegrationList(ctx context.Context, appId string) ApiV1IntegrationListRequest { return ApiV1IntegrationListRequest{ ApiService: a, ctx: ctx, @@ -806,31 +826,27 @@ func (a *IntegrationApiService) V1IntegrationList(ctx _context.Context, appId st } } -/* - * Execute executes the request - * @return ListResponseIntegrationOut - */ -func (a *IntegrationApiService) V1IntegrationListExecute(r ApiV1IntegrationListRequest) (ListResponseIntegrationOut, *_nethttp.Response, error) { +// Execute executes the request +// @return ListResponseIntegrationOut +func (a *IntegrationAPIService) V1IntegrationListExecute(r ApiV1IntegrationListRequest) (*ListResponseIntegrationOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ListResponseIntegrationOut + formFiles []formFile + localVarReturnValue *ListResponseIntegrationOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IntegrationApiService.V1IntegrationList") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IntegrationAPIService.V1IntegrationList") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/integration/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -839,10 +855,10 @@ func (a *IntegrationApiService) V1IntegrationListExecute(r ApiV1IntegrationListR } if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") } if r.iterator != nil { - localVarQueryParams.Add("iterator", parameterToString(*r.iterator, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "iterator", r.iterator, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -861,7 +877,7 @@ func (a *IntegrationApiService) V1IntegrationListExecute(r ApiV1IntegrationListR if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -871,15 +887,15 @@ func (a *IntegrationApiService) V1IntegrationListExecute(r ApiV1IntegrationListR return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -890,7 +906,8 @@ func (a *IntegrationApiService) V1IntegrationListExecute(r ApiV1IntegrationListR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -900,7 +917,8 @@ func (a *IntegrationApiService) V1IntegrationListExecute(r ApiV1IntegrationListR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -910,7 +928,8 @@ func (a *IntegrationApiService) V1IntegrationListExecute(r ApiV1IntegrationListR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -920,7 +939,8 @@ func (a *IntegrationApiService) V1IntegrationListExecute(r ApiV1IntegrationListR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -930,7 +950,8 @@ func (a *IntegrationApiService) V1IntegrationListExecute(r ApiV1IntegrationListR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -940,7 +961,8 @@ func (a *IntegrationApiService) V1IntegrationListExecute(r ApiV1IntegrationListR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -950,14 +972,15 @@ func (a *IntegrationApiService) V1IntegrationListExecute(r ApiV1IntegrationListR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -968,31 +991,34 @@ func (a *IntegrationApiService) V1IntegrationListExecute(r ApiV1IntegrationListR } type ApiV1IntegrationRotateKeyRequest struct { - ctx _context.Context - ApiService *IntegrationApiService + ctx context.Context + ApiService *IntegrationAPIService appId string integId string idempotencyKey *string } +// The request's idempotency key func (r ApiV1IntegrationRotateKeyRequest) IdempotencyKey(idempotencyKey string) ApiV1IntegrationRotateKeyRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1IntegrationRotateKeyRequest) Execute() (IntegrationKeyOut, *_nethttp.Response, error) { +func (r ApiV1IntegrationRotateKeyRequest) Execute() (*IntegrationKeyOut, *http.Response, error) { return r.ApiService.V1IntegrationRotateKeyExecute(r) } /* - * V1IntegrationRotateKey Rotate Integration Key - * Rotate the integration's key. The previous key will be immediately revoked. - * @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 integId The integ's ID - * @return ApiV1IntegrationRotateKeyRequest - */ -func (a *IntegrationApiService) V1IntegrationRotateKey(ctx _context.Context, appId string, integId string) ApiV1IntegrationRotateKeyRequest { +V1IntegrationRotateKey Rotate Integration Key + +Rotate the integration's key. The previous key will be immediately revoked. + + @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 integId The integ's ID + @return ApiV1IntegrationRotateKeyRequest +*/ +func (a *IntegrationAPIService) V1IntegrationRotateKey(ctx context.Context, appId string, integId string) ApiV1IntegrationRotateKeyRequest { return ApiV1IntegrationRotateKeyRequest{ ApiService: a, ctx: ctx, @@ -1001,32 +1027,28 @@ func (a *IntegrationApiService) V1IntegrationRotateKey(ctx _context.Context, app } } -/* - * Execute executes the request - * @return IntegrationKeyOut - */ -func (a *IntegrationApiService) V1IntegrationRotateKeyExecute(r ApiV1IntegrationRotateKeyRequest) (IntegrationKeyOut, *_nethttp.Response, error) { +// Execute executes the request +// @return IntegrationKeyOut +func (a *IntegrationAPIService) V1IntegrationRotateKeyExecute(r ApiV1IntegrationRotateKeyRequest) (*IntegrationKeyOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue IntegrationKeyOut + formFiles []formFile + localVarReturnValue *IntegrationKeyOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IntegrationApiService.V1IntegrationRotateKey") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IntegrationAPIService.V1IntegrationRotateKey") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/integration/{integ_id}/key/rotate/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"integ_id"+"}", _neturl.PathEscape(parameterToString(r.integId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"integ_id"+"}", url.PathEscape(parameterValueToString(r.integId, "integId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -1052,9 +1074,9 @@ func (a *IntegrationApiService) V1IntegrationRotateKeyExecute(r ApiV1Integration localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1064,15 +1086,15 @@ func (a *IntegrationApiService) V1IntegrationRotateKeyExecute(r ApiV1Integration return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1083,7 +1105,8 @@ func (a *IntegrationApiService) V1IntegrationRotateKeyExecute(r ApiV1Integration newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1093,7 +1116,8 @@ func (a *IntegrationApiService) V1IntegrationRotateKeyExecute(r ApiV1Integration newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1103,7 +1127,8 @@ func (a *IntegrationApiService) V1IntegrationRotateKeyExecute(r ApiV1Integration newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1113,7 +1138,8 @@ func (a *IntegrationApiService) V1IntegrationRotateKeyExecute(r ApiV1Integration newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -1123,7 +1149,8 @@ func (a *IntegrationApiService) V1IntegrationRotateKeyExecute(r ApiV1Integration newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1133,7 +1160,8 @@ func (a *IntegrationApiService) V1IntegrationRotateKeyExecute(r ApiV1Integration newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1143,14 +1171,15 @@ func (a *IntegrationApiService) V1IntegrationRotateKeyExecute(r ApiV1Integration newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1161,8 +1190,8 @@ func (a *IntegrationApiService) V1IntegrationRotateKeyExecute(r ApiV1Integration } type ApiV1IntegrationUpdateRequest struct { - ctx _context.Context - ApiService *IntegrationApiService + ctx context.Context + ApiService *IntegrationAPIService appId string integId string integrationUpdate *IntegrationUpdate @@ -1173,19 +1202,21 @@ func (r ApiV1IntegrationUpdateRequest) IntegrationUpdate(integrationUpdate Integ return r } -func (r ApiV1IntegrationUpdateRequest) Execute() (IntegrationOut, *_nethttp.Response, error) { +func (r ApiV1IntegrationUpdateRequest) Execute() (*IntegrationOut, *http.Response, error) { return r.ApiService.V1IntegrationUpdateExecute(r) } /* - * V1IntegrationUpdate Update Integration - * Update an integration. - * @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 integId The integ's ID - * @return ApiV1IntegrationUpdateRequest - */ -func (a *IntegrationApiService) V1IntegrationUpdate(ctx _context.Context, appId string, integId string) ApiV1IntegrationUpdateRequest { +V1IntegrationUpdate Update Integration + +Update an integration. + + @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 integId The integ's ID + @return ApiV1IntegrationUpdateRequest +*/ +func (a *IntegrationAPIService) V1IntegrationUpdate(ctx context.Context, appId string, integId string) ApiV1IntegrationUpdateRequest { return ApiV1IntegrationUpdateRequest{ ApiService: a, ctx: ctx, @@ -1194,32 +1225,28 @@ func (a *IntegrationApiService) V1IntegrationUpdate(ctx _context.Context, appId } } -/* - * Execute executes the request - * @return IntegrationOut - */ -func (a *IntegrationApiService) V1IntegrationUpdateExecute(r ApiV1IntegrationUpdateRequest) (IntegrationOut, *_nethttp.Response, error) { +// Execute executes the request +// @return IntegrationOut +func (a *IntegrationAPIService) V1IntegrationUpdateExecute(r ApiV1IntegrationUpdateRequest) (*IntegrationOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue IntegrationOut + formFiles []formFile + localVarReturnValue *IntegrationOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IntegrationApiService.V1IntegrationUpdate") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IntegrationAPIService.V1IntegrationUpdate") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/integration/{integ_id}/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"integ_id"+"}", _neturl.PathEscape(parameterToString(r.integId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"integ_id"+"}", url.PathEscape(parameterValueToString(r.integId, "integId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -1249,7 +1276,7 @@ func (a *IntegrationApiService) V1IntegrationUpdateExecute(r ApiV1IntegrationUpd } // body params localVarPostBody = r.integrationUpdate - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1259,15 +1286,15 @@ func (a *IntegrationApiService) V1IntegrationUpdateExecute(r ApiV1IntegrationUpd return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1278,7 +1305,8 @@ func (a *IntegrationApiService) V1IntegrationUpdateExecute(r ApiV1IntegrationUpd newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1288,7 +1316,8 @@ func (a *IntegrationApiService) V1IntegrationUpdateExecute(r ApiV1IntegrationUpd newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1298,7 +1327,8 @@ func (a *IntegrationApiService) V1IntegrationUpdateExecute(r ApiV1IntegrationUpd newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1308,7 +1338,8 @@ func (a *IntegrationApiService) V1IntegrationUpdateExecute(r ApiV1IntegrationUpd newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -1318,7 +1349,8 @@ func (a *IntegrationApiService) V1IntegrationUpdateExecute(r ApiV1IntegrationUpd newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1328,7 +1360,8 @@ func (a *IntegrationApiService) V1IntegrationUpdateExecute(r ApiV1IntegrationUpd newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1338,14 +1371,15 @@ func (a *IntegrationApiService) V1IntegrationUpdateExecute(r ApiV1IntegrationUpd newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/go/internal/openapi/api_message.go b/go/internal/openapi/api_message.go index 40eb9a9cd..c5d000160 100644 --- a/go/internal/openapi/api_message.go +++ b/go/internal/openapi/api_message.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,26 +12,22 @@ package openapi import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" "strings" "time" "reflect" ) -// Linger please -var ( - _ _context.Context -) -// MessageApiService MessageApi service -type MessageApiService service +// MessageAPIService MessageAPI service +type MessageAPIService service type ApiCreateMessageAttemptForEndpointRequest struct { - ctx _context.Context - ApiService *MessageApiService + ctx context.Context + ApiService *MessageAPIService appId string endpointId string messageIn *MessageIn @@ -42,25 +38,29 @@ func (r ApiCreateMessageAttemptForEndpointRequest) MessageIn(messageIn MessageIn r.messageIn = &messageIn return r } + +// The request's idempotency key func (r ApiCreateMessageAttemptForEndpointRequest) IdempotencyKey(idempotencyKey string) ApiCreateMessageAttemptForEndpointRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiCreateMessageAttemptForEndpointRequest) Execute() (MessageAttemptOut, *_nethttp.Response, error) { +func (r ApiCreateMessageAttemptForEndpointRequest) Execute() (*MessageAttemptOut, *http.Response, error) { return r.ApiService.CreateMessageAttemptForEndpointExecute(r) } /* - * CreateMessageAttemptForEndpoint Create Message Attempt For Endpoint - * Creates and sends a message to the specified endpoint. The message attempt and response from the endpoint is returned. +CreateMessageAttemptForEndpoint Create Message Attempt For Endpoint + +Creates and sends a message to the specified endpoint. The message attempt and response from the endpoint is returned. FIXME: use MessageIn for expediency, even though the `application` parameter is unused. Since this endpoint isn't publicly documented anyway, it should be fine - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param endpointId The ep's ID or UID - * @return ApiCreateMessageAttemptForEndpointRequest - */ -func (a *MessageApiService) CreateMessageAttemptForEndpoint(ctx _context.Context, appId string, endpointId string) ApiCreateMessageAttemptForEndpointRequest { + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param endpointId The ep's ID or UID + @return ApiCreateMessageAttemptForEndpointRequest +*/ +func (a *MessageAPIService) CreateMessageAttemptForEndpoint(ctx context.Context, appId string, endpointId string) ApiCreateMessageAttemptForEndpointRequest { return ApiCreateMessageAttemptForEndpointRequest{ ApiService: a, ctx: ctx, @@ -69,32 +69,28 @@ func (a *MessageApiService) CreateMessageAttemptForEndpoint(ctx _context.Context } } -/* - * Execute executes the request - * @return MessageAttemptOut - */ -func (a *MessageApiService) CreateMessageAttemptForEndpointExecute(r ApiCreateMessageAttemptForEndpointRequest) (MessageAttemptOut, *_nethttp.Response, error) { +// Execute executes the request +// @return MessageAttemptOut +func (a *MessageAPIService) CreateMessageAttemptForEndpointExecute(r ApiCreateMessageAttemptForEndpointRequest) (*MessageAttemptOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue MessageAttemptOut + formFiles []formFile + localVarReturnValue *MessageAttemptOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageApiService.CreateMessageAttemptForEndpoint") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAPIService.CreateMessageAttemptForEndpoint") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg/test-attempt/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -129,11 +125,11 @@ func (a *MessageApiService) CreateMessageAttemptForEndpointExecute(r ApiCreateMe localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } // body params localVarPostBody = r.messageIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -143,15 +139,15 @@ func (a *MessageApiService) CreateMessageAttemptForEndpointExecute(r ApiCreateMe return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -162,7 +158,8 @@ func (a *MessageApiService) CreateMessageAttemptForEndpointExecute(r ApiCreateMe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -172,7 +169,8 @@ func (a *MessageApiService) CreateMessageAttemptForEndpointExecute(r ApiCreateMe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -182,7 +180,8 @@ func (a *MessageApiService) CreateMessageAttemptForEndpointExecute(r ApiCreateMe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -192,7 +191,8 @@ func (a *MessageApiService) CreateMessageAttemptForEndpointExecute(r ApiCreateMe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -202,7 +202,8 @@ func (a *MessageApiService) CreateMessageAttemptForEndpointExecute(r ApiCreateMe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -212,7 +213,8 @@ func (a *MessageApiService) CreateMessageAttemptForEndpointExecute(r ApiCreateMe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -222,14 +224,15 @@ func (a *MessageApiService) CreateMessageAttemptForEndpointExecute(r ApiCreateMe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -240,8 +243,8 @@ func (a *MessageApiService) CreateMessageAttemptForEndpointExecute(r ApiCreateMe } type ApiV1MessageCreateRequest struct { - ctx _context.Context - ApiService *MessageApiService + ctx context.Context + ApiService *MessageAPIService appId string messageIn *MessageIn withContent *bool @@ -252,22 +255,27 @@ func (r ApiV1MessageCreateRequest) MessageIn(messageIn MessageIn) ApiV1MessageCr r.messageIn = &messageIn return r } + +// When `true` message payloads are included in the response func (r ApiV1MessageCreateRequest) WithContent(withContent bool) ApiV1MessageCreateRequest { r.withContent = &withContent return r } + +// The request's idempotency key func (r ApiV1MessageCreateRequest) IdempotencyKey(idempotencyKey string) ApiV1MessageCreateRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1MessageCreateRequest) Execute() (MessageOut, *_nethttp.Response, error) { +func (r ApiV1MessageCreateRequest) Execute() (*MessageOut, *http.Response, error) { return r.ApiService.V1MessageCreateExecute(r) } /* - * V1MessageCreate Create Message - * Creates a new message and dispatches it to all of the application's endpoints. +V1MessageCreate Create Message + +Creates a new message and dispatches it to all of the application's endpoints. The `eventId` is an optional custom unique ID. It's verified to be unique only up to a day, after that no verification will be made. If a message with the same `eventId` already exists for any application in your environment, a 409 conflict error will be returned. @@ -276,11 +284,12 @@ The `eventType` indicates the type and schema of the event. All messages of a ce Messages can also have `channels`, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don't imply a specific message content or schema. The `payload` property is the webhook's body (the actual webhook message). Svix supports payload sizes of up to ~350kb, though it's generally a good idea to keep webhook payloads small, probably no larger than 40kb. - * @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 ApiV1MessageCreateRequest - */ -func (a *MessageApiService) V1MessageCreate(ctx _context.Context, appId string) ApiV1MessageCreateRequest { + + @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 ApiV1MessageCreateRequest +*/ +func (a *MessageAPIService) V1MessageCreate(ctx context.Context, appId string) ApiV1MessageCreateRequest { return ApiV1MessageCreateRequest{ ApiService: a, ctx: ctx, @@ -288,31 +297,27 @@ func (a *MessageApiService) V1MessageCreate(ctx _context.Context, appId string) } } -/* - * Execute executes the request - * @return MessageOut - */ -func (a *MessageApiService) V1MessageCreateExecute(r ApiV1MessageCreateRequest) (MessageOut, *_nethttp.Response, error) { +// Execute executes the request +// @return MessageOut +func (a *MessageAPIService) V1MessageCreateExecute(r ApiV1MessageCreateRequest) (*MessageOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue MessageOut + formFiles []formFile + localVarReturnValue *MessageOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageApiService.V1MessageCreate") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAPIService.V1MessageCreate") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/msg/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -324,7 +329,10 @@ func (a *MessageApiService) V1MessageCreateExecute(r ApiV1MessageCreateRequest) } if r.withContent != nil { - localVarQueryParams.Add("with_content", parameterToString(*r.withContent, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "with_content", r.withContent, "") + } else { + var defaultValue bool = true + r.withContent = &defaultValue } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -344,11 +352,11 @@ func (a *MessageApiService) V1MessageCreateExecute(r ApiV1MessageCreateRequest) localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } // body params localVarPostBody = r.messageIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -358,15 +366,15 @@ func (a *MessageApiService) V1MessageCreateExecute(r ApiV1MessageCreateRequest) return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -377,7 +385,8 @@ func (a *MessageApiService) V1MessageCreateExecute(r ApiV1MessageCreateRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -387,7 +396,8 @@ func (a *MessageApiService) V1MessageCreateExecute(r ApiV1MessageCreateRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -397,7 +407,8 @@ func (a *MessageApiService) V1MessageCreateExecute(r ApiV1MessageCreateRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -407,7 +418,8 @@ func (a *MessageApiService) V1MessageCreateExecute(r ApiV1MessageCreateRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -417,7 +429,8 @@ func (a *MessageApiService) V1MessageCreateExecute(r ApiV1MessageCreateRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 413 { @@ -427,7 +440,8 @@ func (a *MessageApiService) V1MessageCreateExecute(r ApiV1MessageCreateRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -437,7 +451,8 @@ func (a *MessageApiService) V1MessageCreateExecute(r ApiV1MessageCreateRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -447,14 +462,15 @@ func (a *MessageApiService) V1MessageCreateExecute(r ApiV1MessageCreateRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -465,28 +481,29 @@ func (a *MessageApiService) V1MessageCreateExecute(r ApiV1MessageCreateRequest) } type ApiV1MessageExpungeContentRequest struct { - ctx _context.Context - ApiService *MessageApiService + ctx context.Context + ApiService *MessageAPIService appId string msgId string } - -func (r ApiV1MessageExpungeContentRequest) Execute() (*_nethttp.Response, error) { +func (r ApiV1MessageExpungeContentRequest) Execute() (*http.Response, error) { return r.ApiService.V1MessageExpungeContentExecute(r) } /* - * V1MessageExpungeContent Delete message payload - * Delete the given message's payload. Useful in cases when a message was accidentally sent with sensitive content. +V1MessageExpungeContent Delete message payload + +Delete the given message's payload. Useful in cases when a message was accidentally sent with sensitive content. The message can't be replayed or resent once its payload has been deleted or expired. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param msgId The msg's ID or UID - * @return ApiV1MessageExpungeContentRequest - */ -func (a *MessageApiService) V1MessageExpungeContent(ctx _context.Context, appId string, msgId string) ApiV1MessageExpungeContentRequest { + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param msgId The msg's ID or UID + @return ApiV1MessageExpungeContentRequest +*/ +func (a *MessageAPIService) V1MessageExpungeContent(ctx context.Context, appId string, msgId string) ApiV1MessageExpungeContentRequest { return ApiV1MessageExpungeContentRequest{ ApiService: a, ctx: ctx, @@ -495,30 +512,26 @@ func (a *MessageApiService) V1MessageExpungeContent(ctx _context.Context, appId } } -/* - * Execute executes the request - */ -func (a *MessageApiService) V1MessageExpungeContentExecute(r ApiV1MessageExpungeContentRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *MessageAPIService) V1MessageExpungeContentExecute(r ApiV1MessageExpungeContentRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageApiService.V1MessageExpungeContent") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAPIService.V1MessageExpungeContent") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/msg/{msg_id}/content/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"msg_id"+"}", _neturl.PathEscape(parameterToString(r.msgId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"msg_id"+"}", url.PathEscape(parameterValueToString(r.msgId, "msgId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return nil, reportError("appId must have at least 1 elements") } @@ -549,7 +562,7 @@ func (a *MessageApiService) V1MessageExpungeContentExecute(r ApiV1MessageExpunge if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -559,15 +572,15 @@ func (a *MessageApiService) V1MessageExpungeContentExecute(r ApiV1MessageExpunge return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -578,7 +591,8 @@ func (a *MessageApiService) V1MessageExpungeContentExecute(r ApiV1MessageExpunge newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -588,7 +602,8 @@ func (a *MessageApiService) V1MessageExpungeContentExecute(r ApiV1MessageExpunge newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -598,7 +613,8 @@ func (a *MessageApiService) V1MessageExpungeContentExecute(r ApiV1MessageExpunge newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -608,7 +624,8 @@ func (a *MessageApiService) V1MessageExpungeContentExecute(r ApiV1MessageExpunge newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -618,7 +635,8 @@ func (a *MessageApiService) V1MessageExpungeContentExecute(r ApiV1MessageExpunge newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -628,7 +646,8 @@ func (a *MessageApiService) V1MessageExpungeContentExecute(r ApiV1MessageExpunge newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -638,7 +657,8 @@ func (a *MessageApiService) V1MessageExpungeContentExecute(r ApiV1MessageExpunge newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -647,31 +667,34 @@ func (a *MessageApiService) V1MessageExpungeContentExecute(r ApiV1MessageExpunge } type ApiV1MessageGetRequest struct { - ctx _context.Context - ApiService *MessageApiService + ctx context.Context + ApiService *MessageAPIService appId string msgId string withContent *bool } +// When `true` message payloads are included in the response func (r ApiV1MessageGetRequest) WithContent(withContent bool) ApiV1MessageGetRequest { r.withContent = &withContent return r } -func (r ApiV1MessageGetRequest) Execute() (MessageOut, *_nethttp.Response, error) { +func (r ApiV1MessageGetRequest) Execute() (*MessageOut, *http.Response, error) { return r.ApiService.V1MessageGetExecute(r) } /* - * V1MessageGet Get Message - * Get a message by its ID or eventID. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param msgId The msg's ID or UID - * @return ApiV1MessageGetRequest - */ -func (a *MessageApiService) V1MessageGet(ctx _context.Context, appId string, msgId string) ApiV1MessageGetRequest { +V1MessageGet Get Message + +Get a message by its ID or eventID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param msgId The msg's ID or UID + @return ApiV1MessageGetRequest +*/ +func (a *MessageAPIService) V1MessageGet(ctx context.Context, appId string, msgId string) ApiV1MessageGetRequest { return ApiV1MessageGetRequest{ ApiService: a, ctx: ctx, @@ -680,32 +703,28 @@ func (a *MessageApiService) V1MessageGet(ctx _context.Context, appId string, msg } } -/* - * Execute executes the request - * @return MessageOut - */ -func (a *MessageApiService) V1MessageGetExecute(r ApiV1MessageGetRequest) (MessageOut, *_nethttp.Response, error) { +// Execute executes the request +// @return MessageOut +func (a *MessageAPIService) V1MessageGetExecute(r ApiV1MessageGetRequest) (*MessageOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue MessageOut + formFiles []formFile + localVarReturnValue *MessageOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageApiService.V1MessageGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAPIService.V1MessageGet") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/msg/{msg_id}/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"msg_id"+"}", _neturl.PathEscape(parameterToString(r.msgId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"msg_id"+"}", url.PathEscape(parameterValueToString(r.msgId, "msgId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -720,7 +739,10 @@ func (a *MessageApiService) V1MessageGetExecute(r ApiV1MessageGetRequest) (Messa } if r.withContent != nil { - localVarQueryParams.Add("with_content", parameterToString(*r.withContent, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "with_content", r.withContent, "") + } else { + var defaultValue bool = true + r.withContent = &defaultValue } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -739,7 +761,7 @@ func (a *MessageApiService) V1MessageGetExecute(r ApiV1MessageGetRequest) (Messa if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -749,15 +771,15 @@ func (a *MessageApiService) V1MessageGetExecute(r ApiV1MessageGetRequest) (Messa return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -768,7 +790,8 @@ func (a *MessageApiService) V1MessageGetExecute(r ApiV1MessageGetRequest) (Messa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -778,7 +801,8 @@ func (a *MessageApiService) V1MessageGetExecute(r ApiV1MessageGetRequest) (Messa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -788,7 +812,8 @@ func (a *MessageApiService) V1MessageGetExecute(r ApiV1MessageGetRequest) (Messa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -798,7 +823,8 @@ func (a *MessageApiService) V1MessageGetExecute(r ApiV1MessageGetRequest) (Messa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -808,7 +834,8 @@ func (a *MessageApiService) V1MessageGetExecute(r ApiV1MessageGetRequest) (Messa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -818,7 +845,8 @@ func (a *MessageApiService) V1MessageGetExecute(r ApiV1MessageGetRequest) (Messa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -828,14 +856,15 @@ func (a *MessageApiService) V1MessageGetExecute(r ApiV1MessageGetRequest) (Messa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -846,26 +875,27 @@ func (a *MessageApiService) V1MessageGetExecute(r ApiV1MessageGetRequest) (Messa } type ApiV1MessageGetRawPayloadRequest struct { - ctx _context.Context - ApiService *MessageApiService + ctx context.Context + ApiService *MessageAPIService appId string msgId string } - -func (r ApiV1MessageGetRawPayloadRequest) Execute() (MessageRawPayloadOut, *_nethttp.Response, error) { +func (r ApiV1MessageGetRawPayloadRequest) Execute() (*MessageRawPayloadOut, *http.Response, error) { return r.ApiService.V1MessageGetRawPayloadExecute(r) } /* - * V1MessageGetRawPayload Get Raw Message Payload - * Get a message raw payload by its ID or eventID. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param msgId The msg's ID or UID - * @return ApiV1MessageGetRawPayloadRequest - */ -func (a *MessageApiService) V1MessageGetRawPayload(ctx _context.Context, appId string, msgId string) ApiV1MessageGetRawPayloadRequest { +V1MessageGetRawPayload Get Raw Message Payload + +Get a message raw payload by its ID or eventID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param msgId The msg's ID or UID + @return ApiV1MessageGetRawPayloadRequest +*/ +func (a *MessageAPIService) V1MessageGetRawPayload(ctx context.Context, appId string, msgId string) ApiV1MessageGetRawPayloadRequest { return ApiV1MessageGetRawPayloadRequest{ ApiService: a, ctx: ctx, @@ -874,32 +904,28 @@ func (a *MessageApiService) V1MessageGetRawPayload(ctx _context.Context, appId s } } -/* - * Execute executes the request - * @return MessageRawPayloadOut - */ -func (a *MessageApiService) V1MessageGetRawPayloadExecute(r ApiV1MessageGetRawPayloadRequest) (MessageRawPayloadOut, *_nethttp.Response, error) { +// Execute executes the request +// @return MessageRawPayloadOut +func (a *MessageAPIService) V1MessageGetRawPayloadExecute(r ApiV1MessageGetRawPayloadRequest) (*MessageRawPayloadOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue MessageRawPayloadOut + formFiles []formFile + localVarReturnValue *MessageRawPayloadOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageApiService.V1MessageGetRawPayload") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAPIService.V1MessageGetRawPayload") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/msg/{msg_id}/raw/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"msg_id"+"}", _neturl.PathEscape(parameterToString(r.msgId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"msg_id"+"}", url.PathEscape(parameterValueToString(r.msgId, "msgId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -930,7 +956,7 @@ func (a *MessageApiService) V1MessageGetRawPayloadExecute(r ApiV1MessageGetRawPa if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -940,15 +966,15 @@ func (a *MessageApiService) V1MessageGetRawPayloadExecute(r ApiV1MessageGetRawPa return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -959,7 +985,8 @@ func (a *MessageApiService) V1MessageGetRawPayloadExecute(r ApiV1MessageGetRawPa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -969,7 +996,8 @@ func (a *MessageApiService) V1MessageGetRawPayloadExecute(r ApiV1MessageGetRawPa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -979,7 +1007,8 @@ func (a *MessageApiService) V1MessageGetRawPayloadExecute(r ApiV1MessageGetRawPa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -989,7 +1018,8 @@ func (a *MessageApiService) V1MessageGetRawPayloadExecute(r ApiV1MessageGetRawPa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -999,7 +1029,8 @@ func (a *MessageApiService) V1MessageGetRawPayloadExecute(r ApiV1MessageGetRawPa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1009,7 +1040,8 @@ func (a *MessageApiService) V1MessageGetRawPayloadExecute(r ApiV1MessageGetRawPa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1019,14 +1051,15 @@ func (a *MessageApiService) V1MessageGetRawPayloadExecute(r ApiV1MessageGetRawPa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1037,8 +1070,8 @@ func (a *MessageApiService) V1MessageGetRawPayloadExecute(r ApiV1MessageGetRawPa } type ApiV1MessageListRequest struct { - ctx _context.Context - ApiService *MessageApiService + ctx context.Context + ApiService *MessageAPIService appId string limit *int32 iterator *string @@ -1050,46 +1083,62 @@ type ApiV1MessageListRequest struct { eventTypes *[]string } +// Limit the number of returned items func (r ApiV1MessageListRequest) Limit(limit int32) ApiV1MessageListRequest { r.limit = &limit return r } + +// The iterator returned from a prior invocation func (r ApiV1MessageListRequest) Iterator(iterator string) ApiV1MessageListRequest { r.iterator = &iterator return r } + +// Filter response based on the channel func (r ApiV1MessageListRequest) Channel(channel string) ApiV1MessageListRequest { r.channel = &channel return r } + +// Only include items created before a certain date func (r ApiV1MessageListRequest) Before(before time.Time) ApiV1MessageListRequest { r.before = &before return r } + +// Only include items created after a certain date func (r ApiV1MessageListRequest) After(after time.Time) ApiV1MessageListRequest { r.after = &after return r } + +// When `true` message payloads are included in the response func (r ApiV1MessageListRequest) WithContent(withContent bool) ApiV1MessageListRequest { r.withContent = &withContent return r } + +// Filter messages matching the provided tag func (r ApiV1MessageListRequest) Tag(tag string) ApiV1MessageListRequest { r.tag = &tag return r } + +// Filter response based on the event type func (r ApiV1MessageListRequest) EventTypes(eventTypes []string) ApiV1MessageListRequest { r.eventTypes = &eventTypes return r } -func (r ApiV1MessageListRequest) Execute() (ListResponseMessageOut, *_nethttp.Response, error) { +func (r ApiV1MessageListRequest) Execute() (*ListResponseMessageOut, *http.Response, error) { return r.ApiService.V1MessageListExecute(r) } /* - * V1MessageList List Messages - * List all of the application's messages. +V1MessageList List Messages + +List all of the application's messages. The `before` and `after` parameters let you filter all items created before or after a certain date. These can be used alongside an iterator to paginate over results within a certain window. @@ -1099,11 +1148,12 @@ relative to now or, if an iterator is provided, 90 days before/after the time in by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @return ApiV1MessageListRequest - */ -func (a *MessageApiService) V1MessageList(ctx _context.Context, appId string) ApiV1MessageListRequest { + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @return ApiV1MessageListRequest +*/ +func (a *MessageAPIService) V1MessageList(ctx context.Context, appId string) ApiV1MessageListRequest { return ApiV1MessageListRequest{ ApiService: a, ctx: ctx, @@ -1111,31 +1161,27 @@ func (a *MessageApiService) V1MessageList(ctx _context.Context, appId string) Ap } } -/* - * Execute executes the request - * @return ListResponseMessageOut - */ -func (a *MessageApiService) V1MessageListExecute(r ApiV1MessageListRequest) (ListResponseMessageOut, *_nethttp.Response, error) { +// Execute executes the request +// @return ListResponseMessageOut +func (a *MessageAPIService) V1MessageListExecute(r ApiV1MessageListRequest) (*ListResponseMessageOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ListResponseMessageOut + formFiles []formFile + localVarReturnValue *ListResponseMessageOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageApiService.V1MessageList") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAPIService.V1MessageList") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/msg/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -1144,35 +1190,38 @@ func (a *MessageApiService) V1MessageListExecute(r ApiV1MessageListRequest) (Lis } if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") } if r.iterator != nil { - localVarQueryParams.Add("iterator", parameterToString(*r.iterator, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "iterator", r.iterator, "") } if r.channel != nil { - localVarQueryParams.Add("channel", parameterToString(*r.channel, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "channel", r.channel, "") } if r.before != nil { - localVarQueryParams.Add("before", parameterToString(*r.before, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "before", r.before, "") } if r.after != nil { - localVarQueryParams.Add("after", parameterToString(*r.after, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "after", r.after, "") } if r.withContent != nil { - localVarQueryParams.Add("with_content", parameterToString(*r.withContent, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "with_content", r.withContent, "") + } else { + var defaultValue bool = true + r.withContent = &defaultValue } if r.tag != nil { - localVarQueryParams.Add("tag", parameterToString(*r.tag, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", r.tag, "") } 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")) + parameterAddToHeaderOrQuery(localVarQueryParams, "event_types", s.Index(i).Interface(), "multi") } } else { - localVarQueryParams.Add("event_types", parameterToString(t, "multi")) + parameterAddToHeaderOrQuery(localVarQueryParams, "event_types", t, "multi") } } // to determine the Content-Type header @@ -1192,7 +1241,7 @@ func (a *MessageApiService) V1MessageListExecute(r ApiV1MessageListRequest) (Lis if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1202,15 +1251,15 @@ func (a *MessageApiService) V1MessageListExecute(r ApiV1MessageListRequest) (Lis return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1221,7 +1270,8 @@ func (a *MessageApiService) V1MessageListExecute(r ApiV1MessageListRequest) (Lis newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1231,7 +1281,8 @@ func (a *MessageApiService) V1MessageListExecute(r ApiV1MessageListRequest) (Lis newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1241,7 +1292,8 @@ func (a *MessageApiService) V1MessageListExecute(r ApiV1MessageListRequest) (Lis newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1251,7 +1303,8 @@ func (a *MessageApiService) V1MessageListExecute(r ApiV1MessageListRequest) (Lis newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -1261,7 +1314,8 @@ func (a *MessageApiService) V1MessageListExecute(r ApiV1MessageListRequest) (Lis newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1271,7 +1325,8 @@ func (a *MessageApiService) V1MessageListExecute(r ApiV1MessageListRequest) (Lis newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1281,14 +1336,15 @@ func (a *MessageApiService) V1MessageListExecute(r ApiV1MessageListRequest) (Lis newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1299,8 +1355,8 @@ func (a *MessageApiService) V1MessageListExecute(r ApiV1MessageListRequest) (Lis } type ApiV1MessageStreamRequest struct { - ctx _context.Context - ApiService *MessageApiService + ctx context.Context + ApiService *MessageAPIService appId string limit *int32 iterator *string @@ -1308,35 +1364,44 @@ type ApiV1MessageStreamRequest struct { channels *[]string } +// Limit the number of returned items func (r ApiV1MessageStreamRequest) Limit(limit int32) ApiV1MessageStreamRequest { r.limit = &limit return r } + +// The iterator returned from a prior invocation func (r ApiV1MessageStreamRequest) Iterator(iterator string) ApiV1MessageStreamRequest { r.iterator = &iterator return r } + +// Filter response based on the event type func (r ApiV1MessageStreamRequest) EventTypes(eventTypes []string) ApiV1MessageStreamRequest { r.eventTypes = &eventTypes return r } + +// Filter response based on the event type func (r ApiV1MessageStreamRequest) Channels(channels []string) ApiV1MessageStreamRequest { r.channels = &channels return r } -func (r ApiV1MessageStreamRequest) Execute() (MessageStreamOut, *_nethttp.Response, error) { +func (r ApiV1MessageStreamRequest) Execute() (*MessageStreamOut, *http.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 { +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, @@ -1344,31 +1409,27 @@ func (a *MessageApiService) V1MessageStream(ctx _context.Context, appId string) } } -/* - * Execute executes the request - * @return MessageStreamOut - */ -func (a *MessageApiService) V1MessageStreamExecute(r ApiV1MessageStreamRequest) (MessageStreamOut, *_nethttp.Response, error) { +// Execute executes the request +// @return MessageStreamOut +func (a *MessageAPIService) V1MessageStreamExecute(r ApiV1MessageStreamRequest) (*MessageStreamOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue MessageStreamOut + formFiles []formFile + localVarReturnValue *MessageStreamOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageApiService.V1MessageStream") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAPIService.V1MessageStream") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + 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) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -1377,20 +1438,20 @@ func (a *MessageApiService) V1MessageStreamExecute(r ApiV1MessageStreamRequest) } if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") } if r.iterator != nil { - localVarQueryParams.Add("iterator", parameterToString(*r.iterator, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "iterator", 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")) + parameterAddToHeaderOrQuery(localVarQueryParams, "event_types", s.Index(i).Interface(), "multi") } } else { - localVarQueryParams.Add("event_types", parameterToString(t, "multi")) + parameterAddToHeaderOrQuery(localVarQueryParams, "event_types", t, "multi") } } if r.channels != nil { @@ -1398,10 +1459,10 @@ func (a *MessageApiService) V1MessageStreamExecute(r ApiV1MessageStreamRequest) 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")) + parameterAddToHeaderOrQuery(localVarQueryParams, "channels", s.Index(i).Interface(), "multi") } } else { - localVarQueryParams.Add("channels", parameterToString(t, "multi")) + parameterAddToHeaderOrQuery(localVarQueryParams, "channels", t, "multi") } } // to determine the Content-Type header @@ -1421,7 +1482,7 @@ func (a *MessageApiService) V1MessageStreamExecute(r ApiV1MessageStreamRequest) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1431,15 +1492,15 @@ func (a *MessageApiService) V1MessageStreamExecute(r ApiV1MessageStreamRequest) return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1450,7 +1511,8 @@ func (a *MessageApiService) V1MessageStreamExecute(r ApiV1MessageStreamRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1460,7 +1522,8 @@ func (a *MessageApiService) V1MessageStreamExecute(r ApiV1MessageStreamRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1470,7 +1533,8 @@ func (a *MessageApiService) V1MessageStreamExecute(r ApiV1MessageStreamRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1480,7 +1544,8 @@ func (a *MessageApiService) V1MessageStreamExecute(r ApiV1MessageStreamRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -1490,7 +1555,8 @@ func (a *MessageApiService) V1MessageStreamExecute(r ApiV1MessageStreamRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1500,7 +1566,8 @@ func (a *MessageApiService) V1MessageStreamExecute(r ApiV1MessageStreamRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1510,14 +1577,15 @@ func (a *MessageApiService) V1MessageStreamExecute(r ApiV1MessageStreamRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/go/internal/openapi/api_message_attempt.go b/go/internal/openapi/api_message_attempt.go index 98cce9007..91df8d3ff 100644 --- a/go/internal/openapi/api_message_attempt.go +++ b/go/internal/openapi/api_message_attempt.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,46 +12,43 @@ package openapi import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" "strings" "time" "reflect" ) -// Linger please -var ( - _ _context.Context -) -// MessageAttemptApiService MessageAttemptApi service -type MessageAttemptApiService service +// MessageAttemptAPIService MessageAttemptAPI service +type MessageAttemptAPIService service type ApiV1MessageAttemptExpungeContentRequest struct { - ctx _context.Context - ApiService *MessageAttemptApiService + ctx context.Context + ApiService *MessageAttemptAPIService appId string msgId string attemptId string } - -func (r ApiV1MessageAttemptExpungeContentRequest) Execute() (*_nethttp.Response, error) { +func (r ApiV1MessageAttemptExpungeContentRequest) Execute() (*http.Response, error) { return r.ApiService.V1MessageAttemptExpungeContentExecute(r) } /* - * V1MessageAttemptExpungeContent Delete attempt response body - * Deletes the given attempt's response body. Useful when an endpoint accidentally returned sensitive content. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param msgId The msg's ID or UID - * @param attemptId The attempt's ID - * @return ApiV1MessageAttemptExpungeContentRequest - */ -func (a *MessageAttemptApiService) V1MessageAttemptExpungeContent(ctx _context.Context, appId string, msgId string, attemptId string) ApiV1MessageAttemptExpungeContentRequest { +V1MessageAttemptExpungeContent Delete attempt response body + +Deletes the given attempt's response body. Useful when an endpoint accidentally returned sensitive content. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param msgId The msg's ID or UID + @param attemptId The attempt's ID + @return ApiV1MessageAttemptExpungeContentRequest +*/ +func (a *MessageAttemptAPIService) V1MessageAttemptExpungeContent(ctx context.Context, appId string, msgId string, attemptId string) ApiV1MessageAttemptExpungeContentRequest { return ApiV1MessageAttemptExpungeContentRequest{ ApiService: a, ctx: ctx, @@ -61,31 +58,27 @@ func (a *MessageAttemptApiService) V1MessageAttemptExpungeContent(ctx _context.C } } -/* - * Execute executes the request - */ -func (a *MessageAttemptApiService) V1MessageAttemptExpungeContentExecute(r ApiV1MessageAttemptExpungeContentRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *MessageAttemptAPIService) V1MessageAttemptExpungeContentExecute(r ApiV1MessageAttemptExpungeContentRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAttemptApiService.V1MessageAttemptExpungeContent") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAttemptAPIService.V1MessageAttemptExpungeContent") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/content/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"msg_id"+"}", _neturl.PathEscape(parameterToString(r.msgId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"attempt_id"+"}", _neturl.PathEscape(parameterToString(r.attemptId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"msg_id"+"}", url.PathEscape(parameterValueToString(r.msgId, "msgId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"attempt_id"+"}", url.PathEscape(parameterValueToString(r.attemptId, "attemptId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return nil, reportError("appId must have at least 1 elements") } @@ -116,7 +109,7 @@ func (a *MessageAttemptApiService) V1MessageAttemptExpungeContentExecute(r ApiV1 if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -126,15 +119,15 @@ func (a *MessageAttemptApiService) V1MessageAttemptExpungeContentExecute(r ApiV1 return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -145,7 +138,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptExpungeContentExecute(r ApiV1 newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -155,7 +149,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptExpungeContentExecute(r ApiV1 newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -165,7 +160,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptExpungeContentExecute(r ApiV1 newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -175,7 +171,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptExpungeContentExecute(r ApiV1 newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -185,7 +182,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptExpungeContentExecute(r ApiV1 newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -195,7 +193,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptExpungeContentExecute(r ApiV1 newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -205,7 +204,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptExpungeContentExecute(r ApiV1 newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -214,28 +214,29 @@ func (a *MessageAttemptApiService) V1MessageAttemptExpungeContentExecute(r ApiV1 } type ApiV1MessageAttemptGetRequest struct { - ctx _context.Context - ApiService *MessageAttemptApiService + ctx context.Context + ApiService *MessageAttemptAPIService appId string msgId string attemptId string } - -func (r ApiV1MessageAttemptGetRequest) Execute() (MessageAttemptOut, *_nethttp.Response, error) { +func (r ApiV1MessageAttemptGetRequest) Execute() (*MessageAttemptOut, *http.Response, error) { return r.ApiService.V1MessageAttemptGetExecute(r) } /* - * V1MessageAttemptGet Get Attempt - * `msg_id`: Use a message id or a message `eventId` - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param msgId The msg's ID or UID - * @param attemptId The attempt's ID - * @return ApiV1MessageAttemptGetRequest - */ -func (a *MessageAttemptApiService) V1MessageAttemptGet(ctx _context.Context, appId string, msgId string, attemptId string) ApiV1MessageAttemptGetRequest { +V1MessageAttemptGet Get Attempt + +`msg_id`: Use a message id or a message `eventId` + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param msgId The msg's ID or UID + @param attemptId The attempt's ID + @return ApiV1MessageAttemptGetRequest +*/ +func (a *MessageAttemptAPIService) V1MessageAttemptGet(ctx context.Context, appId string, msgId string, attemptId string) ApiV1MessageAttemptGetRequest { return ApiV1MessageAttemptGetRequest{ ApiService: a, ctx: ctx, @@ -245,33 +246,29 @@ func (a *MessageAttemptApiService) V1MessageAttemptGet(ctx _context.Context, app } } -/* - * Execute executes the request - * @return MessageAttemptOut - */ -func (a *MessageAttemptApiService) V1MessageAttemptGetExecute(r ApiV1MessageAttemptGetRequest) (MessageAttemptOut, *_nethttp.Response, error) { +// Execute executes the request +// @return MessageAttemptOut +func (a *MessageAttemptAPIService) V1MessageAttemptGetExecute(r ApiV1MessageAttemptGetRequest) (*MessageAttemptOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue MessageAttemptOut + formFiles []formFile + localVarReturnValue *MessageAttemptOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAttemptApiService.V1MessageAttemptGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAttemptAPIService.V1MessageAttemptGet") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"msg_id"+"}", _neturl.PathEscape(parameterToString(r.msgId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"attempt_id"+"}", _neturl.PathEscape(parameterToString(r.attemptId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"msg_id"+"}", url.PathEscape(parameterValueToString(r.msgId, "msgId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"attempt_id"+"}", url.PathEscape(parameterValueToString(r.attemptId, "attemptId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -302,7 +299,7 @@ func (a *MessageAttemptApiService) V1MessageAttemptGetExecute(r ApiV1MessageAtte if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -312,15 +309,15 @@ func (a *MessageAttemptApiService) V1MessageAttemptGetExecute(r ApiV1MessageAtte return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -331,7 +328,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptGetExecute(r ApiV1MessageAtte newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -341,7 +339,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptGetExecute(r ApiV1MessageAtte newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -351,7 +350,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptGetExecute(r ApiV1MessageAtte newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -361,7 +361,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptGetExecute(r ApiV1MessageAtte newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -371,7 +372,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptGetExecute(r ApiV1MessageAtte newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -381,7 +383,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptGetExecute(r ApiV1MessageAtte newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -391,14 +394,15 @@ func (a *MessageAttemptApiService) V1MessageAttemptGetExecute(r ApiV1MessageAtte newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -409,28 +413,29 @@ func (a *MessageAttemptApiService) V1MessageAttemptGetExecute(r ApiV1MessageAtte } type ApiV1MessageAttemptGetHeadersRequest struct { - ctx _context.Context - ApiService *MessageAttemptApiService + ctx context.Context + ApiService *MessageAttemptAPIService appId string msgId string attemptId string } - -func (r ApiV1MessageAttemptGetHeadersRequest) Execute() (MessageAttemptHeadersOut, *_nethttp.Response, error) { +func (r ApiV1MessageAttemptGetHeadersRequest) Execute() (*MessageAttemptHeadersOut, *http.Response, error) { return r.ApiService.V1MessageAttemptGetHeadersExecute(r) } /* - * V1MessageAttemptGetHeaders Get Attempt Headers - * Calculate and return headers used on a given message attempt - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param msgId The msg's ID or UID - * @param attemptId The attempt's ID - * @return ApiV1MessageAttemptGetHeadersRequest - */ -func (a *MessageAttemptApiService) V1MessageAttemptGetHeaders(ctx _context.Context, appId string, msgId string, attemptId string) ApiV1MessageAttemptGetHeadersRequest { +V1MessageAttemptGetHeaders Get Attempt Headers + +Calculate and return headers used on a given message attempt + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param msgId The msg's ID or UID + @param attemptId The attempt's ID + @return ApiV1MessageAttemptGetHeadersRequest +*/ +func (a *MessageAttemptAPIService) V1MessageAttemptGetHeaders(ctx context.Context, appId string, msgId string, attemptId string) ApiV1MessageAttemptGetHeadersRequest { return ApiV1MessageAttemptGetHeadersRequest{ ApiService: a, ctx: ctx, @@ -440,33 +445,29 @@ func (a *MessageAttemptApiService) V1MessageAttemptGetHeaders(ctx _context.Conte } } -/* - * Execute executes the request - * @return MessageAttemptHeadersOut - */ -func (a *MessageAttemptApiService) V1MessageAttemptGetHeadersExecute(r ApiV1MessageAttemptGetHeadersRequest) (MessageAttemptHeadersOut, *_nethttp.Response, error) { +// Execute executes the request +// @return MessageAttemptHeadersOut +func (a *MessageAttemptAPIService) V1MessageAttemptGetHeadersExecute(r ApiV1MessageAttemptGetHeadersRequest) (*MessageAttemptHeadersOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue MessageAttemptHeadersOut + formFiles []formFile + localVarReturnValue *MessageAttemptHeadersOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAttemptApiService.V1MessageAttemptGetHeaders") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAttemptAPIService.V1MessageAttemptGetHeaders") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/headers/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"msg_id"+"}", _neturl.PathEscape(parameterToString(r.msgId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"attempt_id"+"}", _neturl.PathEscape(parameterToString(r.attemptId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"msg_id"+"}", url.PathEscape(parameterValueToString(r.msgId, "msgId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"attempt_id"+"}", url.PathEscape(parameterValueToString(r.attemptId, "attemptId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -497,7 +498,7 @@ func (a *MessageAttemptApiService) V1MessageAttemptGetHeadersExecute(r ApiV1Mess if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -507,15 +508,15 @@ func (a *MessageAttemptApiService) V1MessageAttemptGetHeadersExecute(r ApiV1Mess return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -526,7 +527,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptGetHeadersExecute(r ApiV1Mess newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -536,7 +538,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptGetHeadersExecute(r ApiV1Mess newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -546,7 +549,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptGetHeadersExecute(r ApiV1Mess newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -556,7 +560,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptGetHeadersExecute(r ApiV1Mess newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -566,7 +571,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptGetHeadersExecute(r ApiV1Mess newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -576,7 +582,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptGetHeadersExecute(r ApiV1Mess newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -586,14 +593,15 @@ func (a *MessageAttemptApiService) V1MessageAttemptGetHeadersExecute(r ApiV1Mess newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -604,37 +612,42 @@ func (a *MessageAttemptApiService) V1MessageAttemptGetHeadersExecute(r ApiV1Mess } type ApiV1MessageAttemptListAttemptedDestinationsRequest struct { - ctx _context.Context - ApiService *MessageAttemptApiService + ctx context.Context + ApiService *MessageAttemptAPIService appId string msgId string limit *int32 iterator *string } +// Limit the number of returned items func (r ApiV1MessageAttemptListAttemptedDestinationsRequest) Limit(limit int32) ApiV1MessageAttemptListAttemptedDestinationsRequest { r.limit = &limit return r } + +// The iterator returned from a prior invocation func (r ApiV1MessageAttemptListAttemptedDestinationsRequest) Iterator(iterator string) ApiV1MessageAttemptListAttemptedDestinationsRequest { r.iterator = &iterator return r } -func (r ApiV1MessageAttemptListAttemptedDestinationsRequest) Execute() (ListResponseMessageEndpointOut, *_nethttp.Response, error) { +func (r ApiV1MessageAttemptListAttemptedDestinationsRequest) Execute() (*ListResponseMessageEndpointOut, *http.Response, error) { return r.ApiService.V1MessageAttemptListAttemptedDestinationsExecute(r) } /* - * V1MessageAttemptListAttemptedDestinations List Attempted Destinations - * List endpoints attempted by a given message. Additionally includes metadata about the latest message attempt. +V1MessageAttemptListAttemptedDestinations List Attempted Destinations + +List endpoints attempted by a given message. Additionally includes metadata about the latest message attempt. By default, endpoints are listed in ascending order by ID. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param msgId The msg's ID or UID - * @return ApiV1MessageAttemptListAttemptedDestinationsRequest - */ -func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedDestinations(ctx _context.Context, appId string, msgId string) ApiV1MessageAttemptListAttemptedDestinationsRequest { + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param msgId The msg's ID or UID + @return ApiV1MessageAttemptListAttemptedDestinationsRequest +*/ +func (a *MessageAttemptAPIService) V1MessageAttemptListAttemptedDestinations(ctx context.Context, appId string, msgId string) ApiV1MessageAttemptListAttemptedDestinationsRequest { return ApiV1MessageAttemptListAttemptedDestinationsRequest{ ApiService: a, ctx: ctx, @@ -643,32 +656,28 @@ func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedDestinations(ctx } } -/* - * Execute executes the request - * @return ListResponseMessageEndpointOut - */ -func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedDestinationsExecute(r ApiV1MessageAttemptListAttemptedDestinationsRequest) (ListResponseMessageEndpointOut, *_nethttp.Response, error) { +// Execute executes the request +// @return ListResponseMessageEndpointOut +func (a *MessageAttemptAPIService) V1MessageAttemptListAttemptedDestinationsExecute(r ApiV1MessageAttemptListAttemptedDestinationsRequest) (*ListResponseMessageEndpointOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ListResponseMessageEndpointOut + formFiles []formFile + localVarReturnValue *ListResponseMessageEndpointOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAttemptApiService.V1MessageAttemptListAttemptedDestinations") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAttemptAPIService.V1MessageAttemptListAttemptedDestinations") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/msg/{msg_id}/endpoint/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"msg_id"+"}", _neturl.PathEscape(parameterToString(r.msgId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"msg_id"+"}", url.PathEscape(parameterValueToString(r.msgId, "msgId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -683,10 +692,10 @@ func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedDestinationsExec } if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") } if r.iterator != nil { - localVarQueryParams.Add("iterator", parameterToString(*r.iterator, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "iterator", r.iterator, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -705,7 +714,7 @@ func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedDestinationsExec if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -715,15 +724,15 @@ func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedDestinationsExec return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -734,7 +743,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedDestinationsExec newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -744,7 +754,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedDestinationsExec newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -754,7 +765,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedDestinationsExec newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -764,7 +776,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedDestinationsExec newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -774,7 +787,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedDestinationsExec newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -784,7 +798,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedDestinationsExec newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -794,14 +809,15 @@ func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedDestinationsExec newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -812,8 +828,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedDestinationsExec } type ApiV1MessageAttemptListAttemptedMessagesRequest struct { - ctx _context.Context - ApiService *MessageAttemptApiService + ctx context.Context + ApiService *MessageAttemptAPIService appId string endpointId string limit *int32 @@ -826,46 +842,62 @@ type ApiV1MessageAttemptListAttemptedMessagesRequest struct { eventTypes *[]string } +// Limit the number of returned items func (r ApiV1MessageAttemptListAttemptedMessagesRequest) Limit(limit int32) ApiV1MessageAttemptListAttemptedMessagesRequest { r.limit = &limit return r } + +// The iterator returned from a prior invocation func (r ApiV1MessageAttemptListAttemptedMessagesRequest) Iterator(iterator string) ApiV1MessageAttemptListAttemptedMessagesRequest { r.iterator = &iterator return r } + +// Filter response based on the channel func (r ApiV1MessageAttemptListAttemptedMessagesRequest) Channel(channel string) ApiV1MessageAttemptListAttemptedMessagesRequest { r.channel = &channel return r } + +// Filter response based on the delivery status func (r ApiV1MessageAttemptListAttemptedMessagesRequest) Status(status MessageStatus) ApiV1MessageAttemptListAttemptedMessagesRequest { r.status = &status return r } + +// Only include items created before a certain date func (r ApiV1MessageAttemptListAttemptedMessagesRequest) Before(before time.Time) ApiV1MessageAttemptListAttemptedMessagesRequest { r.before = &before return r } + +// Only include items created after a certain date func (r ApiV1MessageAttemptListAttemptedMessagesRequest) After(after time.Time) ApiV1MessageAttemptListAttemptedMessagesRequest { r.after = &after return r } + +// When `true` message payloads are included in the response func (r ApiV1MessageAttemptListAttemptedMessagesRequest) WithContent(withContent bool) ApiV1MessageAttemptListAttemptedMessagesRequest { r.withContent = &withContent return r } + +// Filter response based on the event type func (r ApiV1MessageAttemptListAttemptedMessagesRequest) EventTypes(eventTypes []string) ApiV1MessageAttemptListAttemptedMessagesRequest { r.eventTypes = &eventTypes return r } -func (r ApiV1MessageAttemptListAttemptedMessagesRequest) Execute() (ListResponseEndpointMessageOut, *_nethttp.Response, error) { +func (r ApiV1MessageAttemptListAttemptedMessagesRequest) Execute() (*ListResponseEndpointMessageOut, *http.Response, error) { return r.ApiService.V1MessageAttemptListAttemptedMessagesExecute(r) } /* - * V1MessageAttemptListAttemptedMessages List Attempted Messages - * List messages for a particular endpoint. Additionally includes metadata about the latest message attempt. +V1MessageAttemptListAttemptedMessages List Attempted Messages + +List messages for a particular endpoint. Additionally includes metadata about the latest message attempt. The `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed. @@ -874,12 +906,13 @@ relative to now or, if an iterator is provided, 90 days before/after the time in by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param endpointId The ep's ID or UID - * @return ApiV1MessageAttemptListAttemptedMessagesRequest - */ -func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedMessages(ctx _context.Context, appId string, endpointId string) ApiV1MessageAttemptListAttemptedMessagesRequest { + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param endpointId The ep's ID or UID + @return ApiV1MessageAttemptListAttemptedMessagesRequest +*/ +func (a *MessageAttemptAPIService) V1MessageAttemptListAttemptedMessages(ctx context.Context, appId string, endpointId string) ApiV1MessageAttemptListAttemptedMessagesRequest { return ApiV1MessageAttemptListAttemptedMessagesRequest{ ApiService: a, ctx: ctx, @@ -888,32 +921,28 @@ func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedMessages(ctx _co } } -/* - * Execute executes the request - * @return ListResponseEndpointMessageOut - */ -func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedMessagesExecute(r ApiV1MessageAttemptListAttemptedMessagesRequest) (ListResponseEndpointMessageOut, *_nethttp.Response, error) { +// Execute executes the request +// @return ListResponseEndpointMessageOut +func (a *MessageAttemptAPIService) V1MessageAttemptListAttemptedMessagesExecute(r ApiV1MessageAttemptListAttemptedMessagesRequest) (*ListResponseEndpointMessageOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ListResponseEndpointMessageOut + formFiles []formFile + localVarReturnValue *ListResponseEndpointMessageOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAttemptApiService.V1MessageAttemptListAttemptedMessages") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAttemptAPIService.V1MessageAttemptListAttemptedMessages") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -928,35 +957,38 @@ func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedMessagesExecute( } if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") } if r.iterator != nil { - localVarQueryParams.Add("iterator", parameterToString(*r.iterator, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "iterator", r.iterator, "") } if r.channel != nil { - localVarQueryParams.Add("channel", parameterToString(*r.channel, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "channel", r.channel, "") } if r.status != nil { - localVarQueryParams.Add("status", parameterToString(*r.status, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "") } if r.before != nil { - localVarQueryParams.Add("before", parameterToString(*r.before, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "before", r.before, "") } if r.after != nil { - localVarQueryParams.Add("after", parameterToString(*r.after, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "after", r.after, "") } if r.withContent != nil { - localVarQueryParams.Add("with_content", parameterToString(*r.withContent, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "with_content", r.withContent, "") + } else { + var defaultValue bool = true + r.withContent = &defaultValue } if r.eventTypes != nil { t := *r.eventTypes if reflect.TypeOf(t).Kind() == reflect.Slice { s := reflect.ValueOf(t) for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("event_types", parameterToString(s.Index(i), "multi")) + parameterAddToHeaderOrQuery(localVarQueryParams, "event_types", s.Index(i).Interface(), "multi") } } else { - localVarQueryParams.Add("event_types", parameterToString(t, "multi")) + parameterAddToHeaderOrQuery(localVarQueryParams, "event_types", t, "multi") } } // to determine the Content-Type header @@ -976,7 +1008,7 @@ func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedMessagesExecute( if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -986,15 +1018,15 @@ func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedMessagesExecute( return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1005,7 +1037,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedMessagesExecute( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1015,7 +1048,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedMessagesExecute( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1025,7 +1059,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedMessagesExecute( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1035,7 +1070,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedMessagesExecute( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -1045,7 +1081,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedMessagesExecute( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1055,7 +1092,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedMessagesExecute( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1065,14 +1103,15 @@ func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedMessagesExecute( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1083,8 +1122,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListAttemptedMessagesExecute( } type ApiV1MessageAttemptListByEndpointRequest struct { - ctx _context.Context - ApiService *MessageAttemptApiService + ctx context.Context + ApiService *MessageAttemptAPIService appId string endpointId string limit *int32 @@ -1099,66 +1138,87 @@ type ApiV1MessageAttemptListByEndpointRequest struct { eventTypes *[]string } +// Limit the number of returned items func (r ApiV1MessageAttemptListByEndpointRequest) Limit(limit int32) ApiV1MessageAttemptListByEndpointRequest { r.limit = &limit return r } + +// The iterator returned from a prior invocation func (r ApiV1MessageAttemptListByEndpointRequest) Iterator(iterator string) ApiV1MessageAttemptListByEndpointRequest { r.iterator = &iterator return r } + +// Filter response based on the delivery status func (r ApiV1MessageAttemptListByEndpointRequest) Status(status MessageStatus) ApiV1MessageAttemptListByEndpointRequest { r.status = &status return r } + +// Filter response based on the HTTP status code func (r ApiV1MessageAttemptListByEndpointRequest) StatusCodeClass(statusCodeClass StatusCodeClass) ApiV1MessageAttemptListByEndpointRequest { r.statusCodeClass = &statusCodeClass return r } + +// Filter response based on the channel func (r ApiV1MessageAttemptListByEndpointRequest) Channel(channel string) ApiV1MessageAttemptListByEndpointRequest { r.channel = &channel return r } + +// Only include items created before a certain date func (r ApiV1MessageAttemptListByEndpointRequest) Before(before time.Time) ApiV1MessageAttemptListByEndpointRequest { r.before = &before return r } + +// Only include items created after a certain date func (r ApiV1MessageAttemptListByEndpointRequest) After(after time.Time) ApiV1MessageAttemptListByEndpointRequest { r.after = &after return r } + +// When `true` attempt content is included in the response func (r ApiV1MessageAttemptListByEndpointRequest) WithContent(withContent bool) ApiV1MessageAttemptListByEndpointRequest { r.withContent = &withContent return r } + +// When `true`, the message information is included in the response func (r ApiV1MessageAttemptListByEndpointRequest) WithMsg(withMsg bool) ApiV1MessageAttemptListByEndpointRequest { r.withMsg = &withMsg return r } + +// Filter response based on the event type func (r ApiV1MessageAttemptListByEndpointRequest) EventTypes(eventTypes []string) ApiV1MessageAttemptListByEndpointRequest { r.eventTypes = &eventTypes return r } -func (r ApiV1MessageAttemptListByEndpointRequest) Execute() (ListResponseMessageAttemptOut, *_nethttp.Response, error) { +func (r ApiV1MessageAttemptListByEndpointRequest) Execute() (*ListResponseMessageAttemptOut, *http.Response, error) { return r.ApiService.V1MessageAttemptListByEndpointExecute(r) } /* - * V1MessageAttemptListByEndpoint List Attempts By Endpoint - * List attempts by endpoint id +V1MessageAttemptListByEndpoint List Attempts By Endpoint + +List attempts by endpoint id Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param endpointId The ep's ID or UID - * @return ApiV1MessageAttemptListByEndpointRequest - */ -func (a *MessageAttemptApiService) V1MessageAttemptListByEndpoint(ctx _context.Context, appId string, endpointId string) ApiV1MessageAttemptListByEndpointRequest { + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param endpointId The ep's ID or UID + @return ApiV1MessageAttemptListByEndpointRequest +*/ +func (a *MessageAttemptAPIService) V1MessageAttemptListByEndpoint(ctx context.Context, appId string, endpointId string) ApiV1MessageAttemptListByEndpointRequest { return ApiV1MessageAttemptListByEndpointRequest{ ApiService: a, ctx: ctx, @@ -1167,32 +1227,28 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByEndpoint(ctx _context.C } } -/* - * Execute executes the request - * @return ListResponseMessageAttemptOut - */ -func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointExecute(r ApiV1MessageAttemptListByEndpointRequest) (ListResponseMessageAttemptOut, *_nethttp.Response, error) { +// Execute executes the request +// @return ListResponseMessageAttemptOut +func (a *MessageAttemptAPIService) V1MessageAttemptListByEndpointExecute(r ApiV1MessageAttemptListByEndpointRequest) (*ListResponseMessageAttemptOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ListResponseMessageAttemptOut + formFiles []formFile + localVarReturnValue *ListResponseMessageAttemptOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAttemptApiService.V1MessageAttemptListByEndpoint") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAttemptAPIService.V1MessageAttemptListByEndpoint") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/attempt/endpoint/{endpoint_id}/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -1207,41 +1263,47 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointExecute(r ApiV1 } if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") } if r.iterator != nil { - localVarQueryParams.Add("iterator", parameterToString(*r.iterator, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "iterator", r.iterator, "") } if r.status != nil { - localVarQueryParams.Add("status", parameterToString(*r.status, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "") } if r.statusCodeClass != nil { - localVarQueryParams.Add("status_code_class", parameterToString(*r.statusCodeClass, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "status_code_class", r.statusCodeClass, "") } if r.channel != nil { - localVarQueryParams.Add("channel", parameterToString(*r.channel, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "channel", r.channel, "") } if r.before != nil { - localVarQueryParams.Add("before", parameterToString(*r.before, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "before", r.before, "") } if r.after != nil { - localVarQueryParams.Add("after", parameterToString(*r.after, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "after", r.after, "") } if r.withContent != nil { - localVarQueryParams.Add("with_content", parameterToString(*r.withContent, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "with_content", r.withContent, "") + } else { + var defaultValue bool = true + r.withContent = &defaultValue } if r.withMsg != nil { - localVarQueryParams.Add("with_msg", parameterToString(*r.withMsg, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "with_msg", r.withMsg, "") + } else { + var defaultValue bool = false + r.withMsg = &defaultValue } if r.eventTypes != nil { t := *r.eventTypes if reflect.TypeOf(t).Kind() == reflect.Slice { s := reflect.ValueOf(t) for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("event_types", parameterToString(s.Index(i), "multi")) + parameterAddToHeaderOrQuery(localVarQueryParams, "event_types", s.Index(i).Interface(), "multi") } } else { - localVarQueryParams.Add("event_types", parameterToString(t, "multi")) + parameterAddToHeaderOrQuery(localVarQueryParams, "event_types", t, "multi") } } // to determine the Content-Type header @@ -1261,7 +1323,7 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointExecute(r ApiV1 if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1271,15 +1333,15 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointExecute(r ApiV1 return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1290,7 +1352,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointExecute(r ApiV1 newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1300,7 +1363,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointExecute(r ApiV1 newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1310,7 +1374,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointExecute(r ApiV1 newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1320,7 +1385,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointExecute(r ApiV1 newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -1330,7 +1396,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointExecute(r ApiV1 newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1340,7 +1407,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointExecute(r ApiV1 newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1350,14 +1418,15 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointExecute(r ApiV1 newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1368,8 +1437,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointExecute(r ApiV1 } type ApiV1MessageAttemptListByEndpointDeprecatedRequest struct { - ctx _context.Context - ApiService *MessageAttemptApiService + ctx context.Context + ApiService *MessageAttemptAPIService appId string msgId string endpointId string @@ -1382,42 +1451,56 @@ type ApiV1MessageAttemptListByEndpointDeprecatedRequest struct { eventTypes *[]string } +// Limit the number of returned items func (r ApiV1MessageAttemptListByEndpointDeprecatedRequest) Limit(limit int32) ApiV1MessageAttemptListByEndpointDeprecatedRequest { r.limit = &limit return r } + +// The iterator returned from a prior invocation func (r ApiV1MessageAttemptListByEndpointDeprecatedRequest) Iterator(iterator string) ApiV1MessageAttemptListByEndpointDeprecatedRequest { r.iterator = &iterator return r } + +// Filter response based on the channel func (r ApiV1MessageAttemptListByEndpointDeprecatedRequest) Channel(channel string) ApiV1MessageAttemptListByEndpointDeprecatedRequest { r.channel = &channel return r } + +// Filter response based on the delivery status func (r ApiV1MessageAttemptListByEndpointDeprecatedRequest) Status(status MessageStatus) ApiV1MessageAttemptListByEndpointDeprecatedRequest { r.status = &status return r } + +// Only include items created before a certain date func (r ApiV1MessageAttemptListByEndpointDeprecatedRequest) Before(before time.Time) ApiV1MessageAttemptListByEndpointDeprecatedRequest { r.before = &before return r } + +// Only include items created after a certain date func (r ApiV1MessageAttemptListByEndpointDeprecatedRequest) After(after time.Time) ApiV1MessageAttemptListByEndpointDeprecatedRequest { r.after = &after return r } + +// Filter response based on the event type func (r ApiV1MessageAttemptListByEndpointDeprecatedRequest) EventTypes(eventTypes []string) ApiV1MessageAttemptListByEndpointDeprecatedRequest { r.eventTypes = &eventTypes return r } -func (r ApiV1MessageAttemptListByEndpointDeprecatedRequest) Execute() (ListResponseMessageAttemptEndpointOut, *_nethttp.Response, error) { +func (r ApiV1MessageAttemptListByEndpointDeprecatedRequest) Execute() (*ListResponseMessageAttemptEndpointOut, *http.Response, error) { return r.ApiService.V1MessageAttemptListByEndpointDeprecatedExecute(r) } /* - * V1MessageAttemptListByEndpointDeprecated List Attempts For Endpoint - * DEPRECATED: please use list_attempts with endpoint_id as a query parameter instead. +V1MessageAttemptListByEndpointDeprecated List Attempts For Endpoint + +DEPRECATED: please use list_attempts with endpoint_id as a query parameter instead. List the message attempts for a particular endpoint. @@ -1430,13 +1513,16 @@ relative to now or, if an iterator is provided, 90 days before/after the time in by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param msgId The msg's ID or UID - * @param endpointId The ep's ID or UID - * @return ApiV1MessageAttemptListByEndpointDeprecatedRequest - */ -func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointDeprecated(ctx _context.Context, appId string, msgId string, endpointId string) ApiV1MessageAttemptListByEndpointDeprecatedRequest { + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param msgId The msg's ID or UID + @param endpointId The ep's ID or UID + @return ApiV1MessageAttemptListByEndpointDeprecatedRequest + +Deprecated +*/ +func (a *MessageAttemptAPIService) V1MessageAttemptListByEndpointDeprecated(ctx context.Context, appId string, msgId string, endpointId string) ApiV1MessageAttemptListByEndpointDeprecatedRequest { return ApiV1MessageAttemptListByEndpointDeprecatedRequest{ ApiService: a, ctx: ctx, @@ -1446,33 +1532,30 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointDeprecated(ctx } } -/* - * Execute executes the request - * @return ListResponseMessageAttemptEndpointOut - */ -func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointDeprecatedExecute(r ApiV1MessageAttemptListByEndpointDeprecatedRequest) (ListResponseMessageAttemptEndpointOut, *_nethttp.Response, error) { +// Execute executes the request +// @return ListResponseMessageAttemptEndpointOut +// Deprecated +func (a *MessageAttemptAPIService) V1MessageAttemptListByEndpointDeprecatedExecute(r ApiV1MessageAttemptListByEndpointDeprecatedRequest) (*ListResponseMessageAttemptEndpointOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ListResponseMessageAttemptEndpointOut + formFiles []formFile + localVarReturnValue *ListResponseMessageAttemptEndpointOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAttemptApiService.V1MessageAttemptListByEndpointDeprecated") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAttemptAPIService.V1MessageAttemptListByEndpointDeprecated") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/attempt/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"msg_id"+"}", _neturl.PathEscape(parameterToString(r.msgId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"msg_id"+"}", url.PathEscape(parameterValueToString(r.msgId, "msgId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -1493,32 +1576,32 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointDeprecatedExecu } if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") } if r.iterator != nil { - localVarQueryParams.Add("iterator", parameterToString(*r.iterator, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "iterator", r.iterator, "") } if r.channel != nil { - localVarQueryParams.Add("channel", parameterToString(*r.channel, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "channel", r.channel, "") } if r.status != nil { - localVarQueryParams.Add("status", parameterToString(*r.status, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "") } if r.before != nil { - localVarQueryParams.Add("before", parameterToString(*r.before, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "before", r.before, "") } if r.after != nil { - localVarQueryParams.Add("after", parameterToString(*r.after, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "after", r.after, "") } 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")) + parameterAddToHeaderOrQuery(localVarQueryParams, "event_types", s.Index(i).Interface(), "multi") } } else { - localVarQueryParams.Add("event_types", parameterToString(t, "multi")) + parameterAddToHeaderOrQuery(localVarQueryParams, "event_types", t, "multi") } } // to determine the Content-Type header @@ -1538,7 +1621,7 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointDeprecatedExecu if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1548,15 +1631,15 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointDeprecatedExecu return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1567,7 +1650,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointDeprecatedExecu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1577,7 +1661,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointDeprecatedExecu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1587,7 +1672,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointDeprecatedExecu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1597,7 +1683,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointDeprecatedExecu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -1607,7 +1694,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointDeprecatedExecu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1617,7 +1705,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointDeprecatedExecu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1627,14 +1716,15 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointDeprecatedExecu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1645,8 +1735,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByEndpointDeprecatedExecu } type ApiV1MessageAttemptListByMsgRequest struct { - ctx _context.Context - ApiService *MessageAttemptApiService + ctx context.Context + ApiService *MessageAttemptAPIService appId string msgId string limit *int32 @@ -1661,66 +1751,87 @@ type ApiV1MessageAttemptListByMsgRequest struct { eventTypes *[]string } +// Limit the number of returned items func (r ApiV1MessageAttemptListByMsgRequest) Limit(limit int32) ApiV1MessageAttemptListByMsgRequest { r.limit = &limit return r } + +// The iterator returned from a prior invocation func (r ApiV1MessageAttemptListByMsgRequest) Iterator(iterator string) ApiV1MessageAttemptListByMsgRequest { r.iterator = &iterator return r } + +// Filter response based on the delivery status func (r ApiV1MessageAttemptListByMsgRequest) Status(status MessageStatus) ApiV1MessageAttemptListByMsgRequest { r.status = &status return r } + +// Filter response based on the HTTP status code func (r ApiV1MessageAttemptListByMsgRequest) StatusCodeClass(statusCodeClass StatusCodeClass) ApiV1MessageAttemptListByMsgRequest { r.statusCodeClass = &statusCodeClass return r } + +// Filter response based on the channel func (r ApiV1MessageAttemptListByMsgRequest) Channel(channel string) ApiV1MessageAttemptListByMsgRequest { r.channel = &channel return r } + +// Filter the attempts based on the attempted endpoint func (r ApiV1MessageAttemptListByMsgRequest) EndpointId(endpointId string) ApiV1MessageAttemptListByMsgRequest { r.endpointId = &endpointId return r } + +// Only include items created before a certain date func (r ApiV1MessageAttemptListByMsgRequest) Before(before time.Time) ApiV1MessageAttemptListByMsgRequest { r.before = &before return r } + +// Only include items created after a certain date func (r ApiV1MessageAttemptListByMsgRequest) After(after time.Time) ApiV1MessageAttemptListByMsgRequest { r.after = &after return r } + +// When `true` attempt content is included in the response func (r ApiV1MessageAttemptListByMsgRequest) WithContent(withContent bool) ApiV1MessageAttemptListByMsgRequest { r.withContent = &withContent return r } + +// Filter response based on the event type func (r ApiV1MessageAttemptListByMsgRequest) EventTypes(eventTypes []string) ApiV1MessageAttemptListByMsgRequest { r.eventTypes = &eventTypes return r } -func (r ApiV1MessageAttemptListByMsgRequest) Execute() (ListResponseMessageAttemptOut, *_nethttp.Response, error) { +func (r ApiV1MessageAttemptListByMsgRequest) Execute() (*ListResponseMessageAttemptOut, *http.Response, error) { return r.ApiService.V1MessageAttemptListByMsgExecute(r) } /* - * V1MessageAttemptListByMsg List Attempts By Msg - * List attempts by message id +V1MessageAttemptListByMsg List Attempts By Msg + +List attempts by message id Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param msgId The msg's ID or UID - * @return ApiV1MessageAttemptListByMsgRequest - */ -func (a *MessageAttemptApiService) V1MessageAttemptListByMsg(ctx _context.Context, appId string, msgId string) ApiV1MessageAttemptListByMsgRequest { + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param msgId The msg's ID or UID + @return ApiV1MessageAttemptListByMsgRequest +*/ +func (a *MessageAttemptAPIService) V1MessageAttemptListByMsg(ctx context.Context, appId string, msgId string) ApiV1MessageAttemptListByMsgRequest { return ApiV1MessageAttemptListByMsgRequest{ ApiService: a, ctx: ctx, @@ -1729,32 +1840,28 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByMsg(ctx _context.Contex } } -/* - * Execute executes the request - * @return ListResponseMessageAttemptOut - */ -func (a *MessageAttemptApiService) V1MessageAttemptListByMsgExecute(r ApiV1MessageAttemptListByMsgRequest) (ListResponseMessageAttemptOut, *_nethttp.Response, error) { +// Execute executes the request +// @return ListResponseMessageAttemptOut +func (a *MessageAttemptAPIService) V1MessageAttemptListByMsgExecute(r ApiV1MessageAttemptListByMsgRequest) (*ListResponseMessageAttemptOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ListResponseMessageAttemptOut + formFiles []formFile + localVarReturnValue *ListResponseMessageAttemptOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAttemptApiService.V1MessageAttemptListByMsg") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAttemptAPIService.V1MessageAttemptListByMsg") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/attempt/msg/{msg_id}/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"msg_id"+"}", _neturl.PathEscape(parameterToString(r.msgId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"msg_id"+"}", url.PathEscape(parameterValueToString(r.msgId, "msgId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -1769,41 +1876,44 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByMsgExecute(r ApiV1Messa } if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") } if r.iterator != nil { - localVarQueryParams.Add("iterator", parameterToString(*r.iterator, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "iterator", r.iterator, "") } if r.status != nil { - localVarQueryParams.Add("status", parameterToString(*r.status, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "") } if r.statusCodeClass != nil { - localVarQueryParams.Add("status_code_class", parameterToString(*r.statusCodeClass, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "status_code_class", r.statusCodeClass, "") } if r.channel != nil { - localVarQueryParams.Add("channel", parameterToString(*r.channel, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "channel", r.channel, "") } if r.endpointId != nil { - localVarQueryParams.Add("endpoint_id", parameterToString(*r.endpointId, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "endpoint_id", r.endpointId, "") } if r.before != nil { - localVarQueryParams.Add("before", parameterToString(*r.before, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "before", r.before, "") } if r.after != nil { - localVarQueryParams.Add("after", parameterToString(*r.after, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "after", r.after, "") } if r.withContent != nil { - localVarQueryParams.Add("with_content", parameterToString(*r.withContent, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "with_content", r.withContent, "") + } else { + var defaultValue bool = true + r.withContent = &defaultValue } if r.eventTypes != nil { t := *r.eventTypes if reflect.TypeOf(t).Kind() == reflect.Slice { s := reflect.ValueOf(t) for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("event_types", parameterToString(s.Index(i), "multi")) + parameterAddToHeaderOrQuery(localVarQueryParams, "event_types", s.Index(i).Interface(), "multi") } } else { - localVarQueryParams.Add("event_types", parameterToString(t, "multi")) + parameterAddToHeaderOrQuery(localVarQueryParams, "event_types", t, "multi") } } // to determine the Content-Type header @@ -1823,7 +1933,7 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByMsgExecute(r ApiV1Messa if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1833,15 +1943,15 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByMsgExecute(r ApiV1Messa return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1852,7 +1962,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByMsgExecute(r ApiV1Messa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1862,7 +1973,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByMsgExecute(r ApiV1Messa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1872,7 +1984,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByMsgExecute(r ApiV1Messa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1882,7 +1995,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByMsgExecute(r ApiV1Messa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -1892,7 +2006,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByMsgExecute(r ApiV1Messa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1902,7 +2017,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByMsgExecute(r ApiV1Messa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1912,14 +2028,15 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByMsgExecute(r ApiV1Messa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1930,8 +2047,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByMsgExecute(r ApiV1Messa } type ApiV1MessageAttemptListByMsgDeprecatedRequest struct { - ctx _context.Context - ApiService *MessageAttemptApiService + ctx context.Context + ApiService *MessageAttemptAPIService appId string msgId string limit *int32 @@ -1945,50 +2062,68 @@ type ApiV1MessageAttemptListByMsgDeprecatedRequest struct { eventTypes *[]string } +// Limit the number of returned items func (r ApiV1MessageAttemptListByMsgDeprecatedRequest) Limit(limit int32) ApiV1MessageAttemptListByMsgDeprecatedRequest { r.limit = &limit return r } + +// The iterator returned from a prior invocation func (r ApiV1MessageAttemptListByMsgDeprecatedRequest) Iterator(iterator string) ApiV1MessageAttemptListByMsgDeprecatedRequest { r.iterator = &iterator return r } + +// Filter the attempts based on the attempted endpoint func (r ApiV1MessageAttemptListByMsgDeprecatedRequest) EndpointId(endpointId string) ApiV1MessageAttemptListByMsgDeprecatedRequest { r.endpointId = &endpointId return r } + +// Filter response based on the channel func (r ApiV1MessageAttemptListByMsgDeprecatedRequest) Channel(channel string) ApiV1MessageAttemptListByMsgDeprecatedRequest { r.channel = &channel return r } + +// Filter response based on the delivery status func (r ApiV1MessageAttemptListByMsgDeprecatedRequest) Status(status MessageStatus) ApiV1MessageAttemptListByMsgDeprecatedRequest { r.status = &status return r } + +// Only include items created before a certain date func (r ApiV1MessageAttemptListByMsgDeprecatedRequest) Before(before time.Time) ApiV1MessageAttemptListByMsgDeprecatedRequest { r.before = &before return r } + +// Only include items created after a certain date func (r ApiV1MessageAttemptListByMsgDeprecatedRequest) After(after time.Time) ApiV1MessageAttemptListByMsgDeprecatedRequest { r.after = &after return r } + +// Filter response based on the HTTP status code func (r ApiV1MessageAttemptListByMsgDeprecatedRequest) StatusCodeClass(statusCodeClass StatusCodeClass) ApiV1MessageAttemptListByMsgDeprecatedRequest { r.statusCodeClass = &statusCodeClass return r } + +// Filter response based on the event type func (r ApiV1MessageAttemptListByMsgDeprecatedRequest) EventTypes(eventTypes []string) ApiV1MessageAttemptListByMsgDeprecatedRequest { r.eventTypes = &eventTypes return r } -func (r ApiV1MessageAttemptListByMsgDeprecatedRequest) Execute() (ListResponseMessageAttemptOut, *_nethttp.Response, error) { +func (r ApiV1MessageAttemptListByMsgDeprecatedRequest) Execute() (*ListResponseMessageAttemptOut, *http.Response, error) { return r.ApiService.V1MessageAttemptListByMsgDeprecatedExecute(r) } /* - * V1MessageAttemptListByMsgDeprecated List Attempts - * Deprecated: Please use "List Attempts by Endpoint" and "List Attempts by Msg" instead. +V1MessageAttemptListByMsgDeprecated List Attempts + +Deprecated: Please use "List Attempts by Endpoint" and "List Attempts by Msg" instead. Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated @@ -1996,12 +2131,15 @@ by the iterator ID. If you require data beyond those time ranges, you will need set the `before` or `after` parameter as appropriate. `msg_id`: Use a message id or a message `eventId` - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param msgId The msg's ID or UID - * @return ApiV1MessageAttemptListByMsgDeprecatedRequest - */ -func (a *MessageAttemptApiService) V1MessageAttemptListByMsgDeprecated(ctx _context.Context, appId string, msgId string) ApiV1MessageAttemptListByMsgDeprecatedRequest { + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param msgId The msg's ID or UID + @return ApiV1MessageAttemptListByMsgDeprecatedRequest + +Deprecated +*/ +func (a *MessageAttemptAPIService) V1MessageAttemptListByMsgDeprecated(ctx context.Context, appId string, msgId string) ApiV1MessageAttemptListByMsgDeprecatedRequest { return ApiV1MessageAttemptListByMsgDeprecatedRequest{ ApiService: a, ctx: ctx, @@ -2010,32 +2148,29 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByMsgDeprecated(ctx _cont } } -/* - * Execute executes the request - * @return ListResponseMessageAttemptOut - */ -func (a *MessageAttemptApiService) V1MessageAttemptListByMsgDeprecatedExecute(r ApiV1MessageAttemptListByMsgDeprecatedRequest) (ListResponseMessageAttemptOut, *_nethttp.Response, error) { +// Execute executes the request +// @return ListResponseMessageAttemptOut +// Deprecated +func (a *MessageAttemptAPIService) V1MessageAttemptListByMsgDeprecatedExecute(r ApiV1MessageAttemptListByMsgDeprecatedRequest) (*ListResponseMessageAttemptOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ListResponseMessageAttemptOut + formFiles []formFile + localVarReturnValue *ListResponseMessageAttemptOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAttemptApiService.V1MessageAttemptListByMsgDeprecated") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAttemptAPIService.V1MessageAttemptListByMsgDeprecated") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/msg/{msg_id}/attempt/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"msg_id"+"}", _neturl.PathEscape(parameterToString(r.msgId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"msg_id"+"}", url.PathEscape(parameterValueToString(r.msgId, "msgId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -2050,38 +2185,38 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByMsgDeprecatedExecute(r } if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") } if r.iterator != nil { - localVarQueryParams.Add("iterator", parameterToString(*r.iterator, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "iterator", r.iterator, "") } if r.endpointId != nil { - localVarQueryParams.Add("endpoint_id", parameterToString(*r.endpointId, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "endpoint_id", r.endpointId, "") } if r.channel != nil { - localVarQueryParams.Add("channel", parameterToString(*r.channel, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "channel", r.channel, "") } if r.status != nil { - localVarQueryParams.Add("status", parameterToString(*r.status, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "") } if r.before != nil { - localVarQueryParams.Add("before", parameterToString(*r.before, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "before", r.before, "") } if r.after != nil { - localVarQueryParams.Add("after", parameterToString(*r.after, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "after", r.after, "") } if r.statusCodeClass != nil { - localVarQueryParams.Add("status_code_class", parameterToString(*r.statusCodeClass, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "status_code_class", r.statusCodeClass, "") } 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")) + parameterAddToHeaderOrQuery(localVarQueryParams, "event_types", s.Index(i).Interface(), "multi") } } else { - localVarQueryParams.Add("event_types", parameterToString(t, "multi")) + parameterAddToHeaderOrQuery(localVarQueryParams, "event_types", t, "multi") } } // to determine the Content-Type header @@ -2101,7 +2236,7 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByMsgDeprecatedExecute(r if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -2111,15 +2246,15 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByMsgDeprecatedExecute(r return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2130,7 +2265,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByMsgDeprecatedExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -2140,7 +2276,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByMsgDeprecatedExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -2150,7 +2287,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByMsgDeprecatedExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -2160,7 +2298,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByMsgDeprecatedExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -2170,7 +2309,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByMsgDeprecatedExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -2180,7 +2320,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByMsgDeprecatedExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -2190,14 +2331,15 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByMsgDeprecatedExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -2208,33 +2350,36 @@ func (a *MessageAttemptApiService) V1MessageAttemptListByMsgDeprecatedExecute(r } type ApiV1MessageAttemptResendRequest struct { - ctx _context.Context - ApiService *MessageAttemptApiService + ctx context.Context + ApiService *MessageAttemptAPIService appId string msgId string endpointId string idempotencyKey *string } +// The request's idempotency key func (r ApiV1MessageAttemptResendRequest) IdempotencyKey(idempotencyKey string) ApiV1MessageAttemptResendRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1MessageAttemptResendRequest) Execute() (*_nethttp.Response, error) { +func (r ApiV1MessageAttemptResendRequest) Execute() (*http.Response, error) { return r.ApiService.V1MessageAttemptResendExecute(r) } /* - * V1MessageAttemptResend Resend Webhook - * Resend a message to the specified endpoint. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param msgId The msg's ID or UID - * @param endpointId The ep's ID or UID - * @return ApiV1MessageAttemptResendRequest - */ -func (a *MessageAttemptApiService) V1MessageAttemptResend(ctx _context.Context, appId string, msgId string, endpointId string) ApiV1MessageAttemptResendRequest { +V1MessageAttemptResend Resend Webhook + +Resend a message to the specified endpoint. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param msgId The msg's ID or UID + @param endpointId The ep's ID or UID + @return ApiV1MessageAttemptResendRequest +*/ +func (a *MessageAttemptAPIService) V1MessageAttemptResend(ctx context.Context, appId string, msgId string, endpointId string) ApiV1MessageAttemptResendRequest { return ApiV1MessageAttemptResendRequest{ ApiService: a, ctx: ctx, @@ -2244,31 +2389,27 @@ func (a *MessageAttemptApiService) V1MessageAttemptResend(ctx _context.Context, } } -/* - * Execute executes the request - */ -func (a *MessageAttemptApiService) V1MessageAttemptResendExecute(r ApiV1MessageAttemptResendRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *MessageAttemptAPIService) V1MessageAttemptResendExecute(r ApiV1MessageAttemptResendRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAttemptApiService.V1MessageAttemptResend") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MessageAttemptAPIService.V1MessageAttemptResend") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"msg_id"+"}", _neturl.PathEscape(parameterToString(r.msgId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"msg_id"+"}", url.PathEscape(parameterValueToString(r.msgId, "msgId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return nil, reportError("appId must have at least 1 elements") } @@ -2306,9 +2447,9 @@ func (a *MessageAttemptApiService) V1MessageAttemptResendExecute(r ApiV1MessageA localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -2318,15 +2459,15 @@ func (a *MessageAttemptApiService) V1MessageAttemptResendExecute(r ApiV1MessageA return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -2337,7 +2478,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptResendExecute(r ApiV1MessageA newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -2347,7 +2489,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptResendExecute(r ApiV1MessageA newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -2357,7 +2500,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptResendExecute(r ApiV1MessageA newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -2367,7 +2511,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptResendExecute(r ApiV1MessageA newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -2377,7 +2522,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptResendExecute(r ApiV1MessageA newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -2387,7 +2533,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptResendExecute(r ApiV1MessageA newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -2397,7 +2544,8 @@ func (a *MessageAttemptApiService) V1MessageAttemptResendExecute(r ApiV1MessageA newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } diff --git a/go/internal/openapi/api_statistics.go b/go/internal/openapi/api_statistics.go index 6f2d2a3dd..84c1a7720 100644 --- a/go/internal/openapi/api_statistics.go +++ b/go/internal/openapi/api_statistics.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,25 +12,21 @@ package openapi import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" "strings" "time" ) -// Linger please -var ( - _ _context.Context -) -// StatisticsApiService StatisticsApi service -type StatisticsApiService service +// StatisticsAPIService StatisticsAPI service +type StatisticsAPIService service type ApiV1StatisticsAggregateAppStatsRequest struct { - ctx _context.Context - ApiService *StatisticsApiService + ctx context.Context + ApiService *StatisticsAPIService appUsageStatsIn *AppUsageStatsIn idempotencyKey *string } @@ -39,55 +35,55 @@ func (r ApiV1StatisticsAggregateAppStatsRequest) AppUsageStatsIn(appUsageStatsIn r.appUsageStatsIn = &appUsageStatsIn return r } + +// The request's idempotency key func (r ApiV1StatisticsAggregateAppStatsRequest) IdempotencyKey(idempotencyKey string) ApiV1StatisticsAggregateAppStatsRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1StatisticsAggregateAppStatsRequest) Execute() (AppUsageStatsOut, *_nethttp.Response, error) { +func (r ApiV1StatisticsAggregateAppStatsRequest) Execute() (*AppUsageStatsOut, *http.Response, error) { return r.ApiService.V1StatisticsAggregateAppStatsExecute(r) } /* - * V1StatisticsAggregateAppStats Aggregate App Stats - * Creates a background task to calculate the message destinations for all applications in the environment. +V1StatisticsAggregateAppStats Aggregate App Stats + +Creates a background task to calculate the message destinations for all applications in the environment. Note that this endpoint is asynchronous. You will need to poll the `Get Background Task` endpoint to retrieve the results of the operation. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiV1StatisticsAggregateAppStatsRequest - */ -func (a *StatisticsApiService) V1StatisticsAggregateAppStats(ctx _context.Context) ApiV1StatisticsAggregateAppStatsRequest { + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiV1StatisticsAggregateAppStatsRequest +*/ +func (a *StatisticsAPIService) V1StatisticsAggregateAppStats(ctx context.Context) ApiV1StatisticsAggregateAppStatsRequest { return ApiV1StatisticsAggregateAppStatsRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return AppUsageStatsOut - */ -func (a *StatisticsApiService) V1StatisticsAggregateAppStatsExecute(r ApiV1StatisticsAggregateAppStatsRequest) (AppUsageStatsOut, *_nethttp.Response, error) { +// Execute executes the request +// @return AppUsageStatsOut +func (a *StatisticsAPIService) V1StatisticsAggregateAppStatsExecute(r ApiV1StatisticsAggregateAppStatsRequest) (*AppUsageStatsOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue AppUsageStatsOut + formFiles []formFile + localVarReturnValue *AppUsageStatsOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StatisticsApiService.V1StatisticsAggregateAppStats") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StatisticsAPIService.V1StatisticsAggregateAppStats") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/stats/usage/app/" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.appUsageStatsIn == nil { return localVarReturnValue, nil, reportError("appUsageStatsIn is required and must be specified") } @@ -110,11 +106,11 @@ func (a *StatisticsApiService) V1StatisticsAggregateAppStatsExecute(r ApiV1Stati localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } // body params localVarPostBody = r.appUsageStatsIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -124,15 +120,15 @@ func (a *StatisticsApiService) V1StatisticsAggregateAppStatsExecute(r ApiV1Stati return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -143,7 +139,8 @@ func (a *StatisticsApiService) V1StatisticsAggregateAppStatsExecute(r ApiV1Stati newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -153,7 +150,8 @@ func (a *StatisticsApiService) V1StatisticsAggregateAppStatsExecute(r ApiV1Stati newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -163,7 +161,8 @@ func (a *StatisticsApiService) V1StatisticsAggregateAppStatsExecute(r ApiV1Stati newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -173,7 +172,8 @@ func (a *StatisticsApiService) V1StatisticsAggregateAppStatsExecute(r ApiV1Stati newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -183,7 +183,8 @@ func (a *StatisticsApiService) V1StatisticsAggregateAppStatsExecute(r ApiV1Stati newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -193,7 +194,8 @@ func (a *StatisticsApiService) V1StatisticsAggregateAppStatsExecute(r ApiV1Stati newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -203,14 +205,15 @@ func (a *StatisticsApiService) V1StatisticsAggregateAppStatsExecute(r ApiV1Stati newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -221,55 +224,52 @@ func (a *StatisticsApiService) V1StatisticsAggregateAppStatsExecute(r ApiV1Stati } type ApiV1StatisticsAggregateEventTypesRequest struct { - ctx _context.Context - ApiService *StatisticsApiService + ctx context.Context + ApiService *StatisticsAPIService } - -func (r ApiV1StatisticsAggregateEventTypesRequest) Execute() (AggregateEventTypesOut, *_nethttp.Response, error) { +func (r ApiV1StatisticsAggregateEventTypesRequest) Execute() (*AggregateEventTypesOut, *http.Response, error) { return r.ApiService.V1StatisticsAggregateEventTypesExecute(r) } /* - * V1StatisticsAggregateEventTypes Aggregate Event Types - * Creates a background task to calculate the listed event types for all apps in the organization. +V1StatisticsAggregateEventTypes Aggregate Event Types + +Creates a background task to calculate the listed event types for all apps in the organization. Note that this endpoint is asynchronous. You will need to poll the `Get Background Task` endpoint to retrieve the results of the operation. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiV1StatisticsAggregateEventTypesRequest - */ -func (a *StatisticsApiService) V1StatisticsAggregateEventTypes(ctx _context.Context) ApiV1StatisticsAggregateEventTypesRequest { + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiV1StatisticsAggregateEventTypesRequest +*/ +func (a *StatisticsAPIService) V1StatisticsAggregateEventTypes(ctx context.Context) ApiV1StatisticsAggregateEventTypesRequest { return ApiV1StatisticsAggregateEventTypesRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return AggregateEventTypesOut - */ -func (a *StatisticsApiService) V1StatisticsAggregateEventTypesExecute(r ApiV1StatisticsAggregateEventTypesRequest) (AggregateEventTypesOut, *_nethttp.Response, error) { +// Execute executes the request +// @return AggregateEventTypesOut +func (a *StatisticsAPIService) V1StatisticsAggregateEventTypesExecute(r ApiV1StatisticsAggregateEventTypesRequest) (*AggregateEventTypesOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue AggregateEventTypesOut + formFiles []formFile + localVarReturnValue *AggregateEventTypesOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StatisticsApiService.V1StatisticsAggregateEventTypes") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StatisticsAPIService.V1StatisticsAggregateEventTypes") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/stats/usage/event-types/" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -288,7 +288,7 @@ func (a *StatisticsApiService) V1StatisticsAggregateEventTypesExecute(r ApiV1Sta if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -298,15 +298,15 @@ func (a *StatisticsApiService) V1StatisticsAggregateEventTypesExecute(r ApiV1Sta return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -317,7 +317,8 @@ func (a *StatisticsApiService) V1StatisticsAggregateEventTypesExecute(r ApiV1Sta newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -327,7 +328,8 @@ func (a *StatisticsApiService) V1StatisticsAggregateEventTypesExecute(r ApiV1Sta newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -337,7 +339,8 @@ func (a *StatisticsApiService) V1StatisticsAggregateEventTypesExecute(r ApiV1Sta newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -347,7 +350,8 @@ func (a *StatisticsApiService) V1StatisticsAggregateEventTypesExecute(r ApiV1Sta newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -357,7 +361,8 @@ func (a *StatisticsApiService) V1StatisticsAggregateEventTypesExecute(r ApiV1Sta newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -367,7 +372,8 @@ func (a *StatisticsApiService) V1StatisticsAggregateEventTypesExecute(r ApiV1Sta newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -377,14 +383,15 @@ func (a *StatisticsApiService) V1StatisticsAggregateEventTypesExecute(r ApiV1Sta newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -395,34 +402,39 @@ func (a *StatisticsApiService) V1StatisticsAggregateEventTypesExecute(r ApiV1Sta } type ApiV1StatsAppAttemptsRequest struct { - ctx _context.Context - ApiService *StatisticsApiService + ctx context.Context + ApiService *StatisticsAPIService appId string startDate *time.Time endDate *time.Time } +// Filter the range to data starting from this date func (r ApiV1StatsAppAttemptsRequest) StartDate(startDate time.Time) ApiV1StatsAppAttemptsRequest { r.startDate = &startDate return r } + +// Filter the range to data ending by this date func (r ApiV1StatsAppAttemptsRequest) EndDate(endDate time.Time) ApiV1StatsAppAttemptsRequest { r.endDate = &endDate return r } -func (r ApiV1StatsAppAttemptsRequest) Execute() (AttemptStatisticsResponse, *_nethttp.Response, error) { +func (r ApiV1StatsAppAttemptsRequest) Execute() (*AttemptStatisticsResponse, *http.Response, error) { return r.ApiService.V1StatsAppAttemptsExecute(r) } /* - * V1StatsAppAttempts Get App Attempt Stats - * Returns application-level statistics on message attempts - * @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 ApiV1StatsAppAttemptsRequest - */ -func (a *StatisticsApiService) V1StatsAppAttempts(ctx _context.Context, appId string) ApiV1StatsAppAttemptsRequest { +V1StatsAppAttempts Get App Attempt Stats + +Returns application-level statistics on message attempts + + @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 ApiV1StatsAppAttemptsRequest +*/ +func (a *StatisticsAPIService) V1StatsAppAttempts(ctx context.Context, appId string) ApiV1StatsAppAttemptsRequest { return ApiV1StatsAppAttemptsRequest{ ApiService: a, ctx: ctx, @@ -430,31 +442,27 @@ func (a *StatisticsApiService) V1StatsAppAttempts(ctx _context.Context, appId st } } -/* - * Execute executes the request - * @return AttemptStatisticsResponse - */ -func (a *StatisticsApiService) V1StatsAppAttemptsExecute(r ApiV1StatsAppAttemptsRequest) (AttemptStatisticsResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return AttemptStatisticsResponse +func (a *StatisticsAPIService) V1StatsAppAttemptsExecute(r ApiV1StatsAppAttemptsRequest) (*AttemptStatisticsResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue AttemptStatisticsResponse + formFiles []formFile + localVarReturnValue *AttemptStatisticsResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StatisticsApiService.V1StatsAppAttempts") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StatisticsAPIService.V1StatsAppAttempts") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/stats/app/{app_id}/attempt/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -463,10 +471,10 @@ func (a *StatisticsApiService) V1StatsAppAttemptsExecute(r ApiV1StatsAppAttempts } if r.startDate != nil { - localVarQueryParams.Add("startDate", parameterToString(*r.startDate, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "startDate", r.startDate, "") } if r.endDate != nil { - localVarQueryParams.Add("endDate", parameterToString(*r.endDate, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "endDate", r.endDate, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -485,7 +493,7 @@ func (a *StatisticsApiService) V1StatsAppAttemptsExecute(r ApiV1StatsAppAttempts if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -495,15 +503,15 @@ func (a *StatisticsApiService) V1StatsAppAttemptsExecute(r ApiV1StatsAppAttempts return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -514,7 +522,8 @@ func (a *StatisticsApiService) V1StatsAppAttemptsExecute(r ApiV1StatsAppAttempts newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -524,7 +533,8 @@ func (a *StatisticsApiService) V1StatsAppAttemptsExecute(r ApiV1StatsAppAttempts newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -534,7 +544,8 @@ func (a *StatisticsApiService) V1StatsAppAttemptsExecute(r ApiV1StatsAppAttempts newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -544,7 +555,8 @@ func (a *StatisticsApiService) V1StatsAppAttemptsExecute(r ApiV1StatsAppAttempts newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -554,7 +566,8 @@ func (a *StatisticsApiService) V1StatsAppAttemptsExecute(r ApiV1StatsAppAttempts newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -564,7 +577,8 @@ func (a *StatisticsApiService) V1StatsAppAttemptsExecute(r ApiV1StatsAppAttempts newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -574,14 +588,15 @@ func (a *StatisticsApiService) V1StatsAppAttemptsExecute(r ApiV1StatsAppAttempts newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -592,36 +607,41 @@ func (a *StatisticsApiService) V1StatsAppAttemptsExecute(r ApiV1StatsAppAttempts } type ApiV1StatsEndpointAttemptsRequest struct { - ctx _context.Context - ApiService *StatisticsApiService + ctx context.Context + ApiService *StatisticsAPIService appId string endpointId string startDate *time.Time endDate *time.Time } +// Filter the range to data starting from this date func (r ApiV1StatsEndpointAttemptsRequest) StartDate(startDate time.Time) ApiV1StatsEndpointAttemptsRequest { r.startDate = &startDate return r } + +// Filter the range to data ending by this date func (r ApiV1StatsEndpointAttemptsRequest) EndDate(endDate time.Time) ApiV1StatsEndpointAttemptsRequest { r.endDate = &endDate return r } -func (r ApiV1StatsEndpointAttemptsRequest) Execute() (AttemptStatisticsResponse, *_nethttp.Response, error) { +func (r ApiV1StatsEndpointAttemptsRequest) Execute() (*AttemptStatisticsResponse, *http.Response, error) { return r.ApiService.V1StatsEndpointAttemptsExecute(r) } /* - * V1StatsEndpointAttempts Get Ep Stats - * Returns endpoint-level statistics on message attempts - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param appId The app's ID or UID - * @param endpointId The ep's ID or UID - * @return ApiV1StatsEndpointAttemptsRequest - */ -func (a *StatisticsApiService) V1StatsEndpointAttempts(ctx _context.Context, appId string, endpointId string) ApiV1StatsEndpointAttemptsRequest { +V1StatsEndpointAttempts Get Ep Stats + +Returns endpoint-level statistics on message attempts + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param endpointId The ep's ID or UID + @return ApiV1StatsEndpointAttemptsRequest +*/ +func (a *StatisticsAPIService) V1StatsEndpointAttempts(ctx context.Context, appId string, endpointId string) ApiV1StatsEndpointAttemptsRequest { return ApiV1StatsEndpointAttemptsRequest{ ApiService: a, ctx: ctx, @@ -630,32 +650,28 @@ func (a *StatisticsApiService) V1StatsEndpointAttempts(ctx _context.Context, app } } -/* - * Execute executes the request - * @return AttemptStatisticsResponse - */ -func (a *StatisticsApiService) V1StatsEndpointAttemptsExecute(r ApiV1StatsEndpointAttemptsRequest) (AttemptStatisticsResponse, *_nethttp.Response, error) { +// Execute executes the request +// @return AttemptStatisticsResponse +func (a *StatisticsAPIService) V1StatsEndpointAttemptsExecute(r ApiV1StatsEndpointAttemptsRequest) (*AttemptStatisticsResponse, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue AttemptStatisticsResponse + formFiles []formFile + localVarReturnValue *AttemptStatisticsResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StatisticsApiService.V1StatsEndpointAttempts") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StatisticsAPIService.V1StatsEndpointAttempts") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/stats/app/{app_id}/ep/{endpoint_id}/attempt/" - localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if strlen(r.appId) < 1 { return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } @@ -670,10 +686,10 @@ func (a *StatisticsApiService) V1StatsEndpointAttemptsExecute(r ApiV1StatsEndpoi } if r.startDate != nil { - localVarQueryParams.Add("startDate", parameterToString(*r.startDate, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "startDate", r.startDate, "") } if r.endDate != nil { - localVarQueryParams.Add("endDate", parameterToString(*r.endDate, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "endDate", r.endDate, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -692,7 +708,7 @@ func (a *StatisticsApiService) V1StatsEndpointAttemptsExecute(r ApiV1StatsEndpoi if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -702,15 +718,15 @@ func (a *StatisticsApiService) V1StatsEndpointAttemptsExecute(r ApiV1StatsEndpoi return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -721,7 +737,8 @@ func (a *StatisticsApiService) V1StatsEndpointAttemptsExecute(r ApiV1StatsEndpoi newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -731,7 +748,8 @@ func (a *StatisticsApiService) V1StatsEndpointAttemptsExecute(r ApiV1StatsEndpoi newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -741,7 +759,8 @@ func (a *StatisticsApiService) V1StatsEndpointAttemptsExecute(r ApiV1StatsEndpoi newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -751,7 +770,8 @@ func (a *StatisticsApiService) V1StatsEndpointAttemptsExecute(r ApiV1StatsEndpoi newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -761,7 +781,8 @@ func (a *StatisticsApiService) V1StatsEndpointAttemptsExecute(r ApiV1StatsEndpoi newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -771,7 +792,8 @@ func (a *StatisticsApiService) V1StatsEndpointAttemptsExecute(r ApiV1StatsEndpoi newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -781,14 +803,15 @@ func (a *StatisticsApiService) V1StatsEndpointAttemptsExecute(r ApiV1StatsEndpoi newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/go/internal/openapi/api_transformation_template.go b/go/internal/openapi/api_transformation_template.go index 7f1ffde5b..45cbd81af 100644 --- a/go/internal/openapi/api_transformation_template.go +++ b/go/internal/openapi/api_transformation_template.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,24 +12,20 @@ package openapi import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) -// TransformationTemplateApiService TransformationTemplateApi service -type TransformationTemplateApiService service +// TransformationTemplateAPIService TransformationTemplateAPI service +type TransformationTemplateAPIService service type ApiV1TransformationTemplateCreateRequest struct { - ctx _context.Context - ApiService *TransformationTemplateApiService + ctx context.Context + ApiService *TransformationTemplateAPIService templateIn *TemplateIn idempotencyKey *string } @@ -38,52 +34,52 @@ func (r ApiV1TransformationTemplateCreateRequest) TemplateIn(templateIn Template r.templateIn = &templateIn return r } + +// The request's idempotency key func (r ApiV1TransformationTemplateCreateRequest) IdempotencyKey(idempotencyKey string) ApiV1TransformationTemplateCreateRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1TransformationTemplateCreateRequest) Execute() (TemplateOut, *_nethttp.Response, error) { +func (r ApiV1TransformationTemplateCreateRequest) Execute() (*TemplateOut, *http.Response, error) { return r.ApiService.V1TransformationTemplateCreateExecute(r) } /* - * V1TransformationTemplateCreate Create Transformation Template - * Create a new transformation template - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiV1TransformationTemplateCreateRequest - */ -func (a *TransformationTemplateApiService) V1TransformationTemplateCreate(ctx _context.Context) ApiV1TransformationTemplateCreateRequest { +V1TransformationTemplateCreate Create Transformation Template + +Create a new transformation template + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiV1TransformationTemplateCreateRequest +*/ +func (a *TransformationTemplateAPIService) V1TransformationTemplateCreate(ctx context.Context) ApiV1TransformationTemplateCreateRequest { return ApiV1TransformationTemplateCreateRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return TemplateOut - */ -func (a *TransformationTemplateApiService) V1TransformationTemplateCreateExecute(r ApiV1TransformationTemplateCreateRequest) (TemplateOut, *_nethttp.Response, error) { +// Execute executes the request +// @return TemplateOut +func (a *TransformationTemplateAPIService) V1TransformationTemplateCreateExecute(r ApiV1TransformationTemplateCreateRequest) (*TemplateOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue TemplateOut + formFiles []formFile + localVarReturnValue *TemplateOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransformationTemplateApiService.V1TransformationTemplateCreate") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransformationTemplateAPIService.V1TransformationTemplateCreate") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/transformation-template/" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.templateIn == nil { return localVarReturnValue, nil, reportError("templateIn is required and must be specified") } @@ -106,11 +102,11 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateCreateExecute localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } // body params localVarPostBody = r.templateIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -120,15 +116,15 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateCreateExecute return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -139,7 +135,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateCreateExecute newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -149,7 +146,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateCreateExecute newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -159,7 +157,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateCreateExecute newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -169,7 +168,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateCreateExecute newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -179,7 +179,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateCreateExecute newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -189,7 +190,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateCreateExecute newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -199,14 +201,15 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateCreateExecute newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -217,24 +220,25 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateCreateExecute } type ApiV1TransformationTemplateDeleteRequest struct { - ctx _context.Context - ApiService *TransformationTemplateApiService + ctx context.Context + ApiService *TransformationTemplateAPIService transformationTemplateId string } - -func (r ApiV1TransformationTemplateDeleteRequest) Execute() (*_nethttp.Response, error) { +func (r ApiV1TransformationTemplateDeleteRequest) Execute() (*http.Response, error) { return r.ApiService.V1TransformationTemplateDeleteExecute(r) } /* - * V1TransformationTemplateDelete Delete Transformation Template - * Delete a transformation template - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param transformationTemplateId - * @return ApiV1TransformationTemplateDeleteRequest - */ -func (a *TransformationTemplateApiService) V1TransformationTemplateDelete(ctx _context.Context, transformationTemplateId string) ApiV1TransformationTemplateDeleteRequest { +V1TransformationTemplateDelete Delete Transformation Template + +Delete a transformation template + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param transformationTemplateId + @return ApiV1TransformationTemplateDeleteRequest +*/ +func (a *TransformationTemplateAPIService) V1TransformationTemplateDelete(ctx context.Context, transformationTemplateId string) ApiV1TransformationTemplateDeleteRequest { return ApiV1TransformationTemplateDeleteRequest{ ApiService: a, ctx: ctx, @@ -242,29 +246,25 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateDelete(ctx _c } } -/* - * Execute executes the request - */ -func (a *TransformationTemplateApiService) V1TransformationTemplateDeleteExecute(r ApiV1TransformationTemplateDeleteRequest) (*_nethttp.Response, error) { +// Execute executes the request +func (a *TransformationTemplateAPIService) V1TransformationTemplateDeleteExecute(r ApiV1TransformationTemplateDeleteRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransformationTemplateApiService.V1TransformationTemplateDelete") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransformationTemplateAPIService.V1TransformationTemplateDelete") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/transformation-template/{transformation_template_id}" - localVarPath = strings.Replace(localVarPath, "{"+"transformation_template_id"+"}", _neturl.PathEscape(parameterToString(r.transformationTemplateId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"transformation_template_id"+"}", url.PathEscape(parameterValueToString(r.transformationTemplateId, "transformationTemplateId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -283,7 +283,7 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateDeleteExecute if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -293,15 +293,15 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateDeleteExecute return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -312,7 +312,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateDeleteExecute newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -322,7 +323,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateDeleteExecute newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -332,7 +334,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateDeleteExecute newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -342,7 +345,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateDeleteExecute newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -352,7 +356,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateDeleteExecute newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -362,7 +367,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateDeleteExecute newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -372,7 +378,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateDeleteExecute newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -381,8 +388,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateDeleteExecute } type ApiV1TransformationTemplateGenerateRequest struct { - ctx _context.Context - ApiService *TransformationTemplateApiService + ctx context.Context + ApiService *TransformationTemplateAPIService generateIn *GenerateIn idempotencyKey *string } @@ -391,52 +398,52 @@ func (r ApiV1TransformationTemplateGenerateRequest) GenerateIn(generateIn Genera r.generateIn = &generateIn return r } + +// The request's idempotency key func (r ApiV1TransformationTemplateGenerateRequest) IdempotencyKey(idempotencyKey string) ApiV1TransformationTemplateGenerateRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1TransformationTemplateGenerateRequest) Execute() (GenerateOut, *_nethttp.Response, error) { +func (r ApiV1TransformationTemplateGenerateRequest) Execute() (*GenerateOut, *http.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 { +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) { +// Execute executes the request +// @return GenerateOut +func (a *TransformationTemplateAPIService) V1TransformationTemplateGenerateExecute(r ApiV1TransformationTemplateGenerateRequest) (*GenerateOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue GenerateOut + formFiles []formFile + localVarReturnValue *GenerateOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransformationTemplateApiService.V1TransformationTemplateGenerate") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransformationTemplateAPIService.V1TransformationTemplateGenerate") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + 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{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.generateIn == nil { return localVarReturnValue, nil, reportError("generateIn is required and must be specified") } @@ -459,11 +466,11 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateGenerateExecu localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } // body params localVarPostBody = r.generateIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -473,15 +480,15 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateGenerateExecu return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -492,7 +499,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateGenerateExecu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -502,7 +510,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateGenerateExecu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -512,7 +521,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateGenerateExecu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -522,7 +532,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateGenerateExecu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -532,7 +543,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateGenerateExecu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -542,7 +554,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateGenerateExecu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -552,14 +565,15 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateGenerateExecu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -570,24 +584,25 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateGenerateExecu } type ApiV1TransformationTemplateGetRequest struct { - ctx _context.Context - ApiService *TransformationTemplateApiService + ctx context.Context + ApiService *TransformationTemplateAPIService transformationTemplateId string } - -func (r ApiV1TransformationTemplateGetRequest) Execute() (TemplateOut, *_nethttp.Response, error) { +func (r ApiV1TransformationTemplateGetRequest) Execute() (*TemplateOut, *http.Response, error) { return r.ApiService.V1TransformationTemplateGetExecute(r) } /* - * V1TransformationTemplateGet Get Transformation Template - * Get a transformation template - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param transformationTemplateId - * @return ApiV1TransformationTemplateGetRequest - */ -func (a *TransformationTemplateApiService) V1TransformationTemplateGet(ctx _context.Context, transformationTemplateId string) ApiV1TransformationTemplateGetRequest { +V1TransformationTemplateGet Get Transformation Template + +Get a transformation template + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param transformationTemplateId + @return ApiV1TransformationTemplateGetRequest +*/ +func (a *TransformationTemplateAPIService) V1TransformationTemplateGet(ctx context.Context, transformationTemplateId string) ApiV1TransformationTemplateGetRequest { return ApiV1TransformationTemplateGetRequest{ ApiService: a, ctx: ctx, @@ -595,31 +610,27 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateGet(ctx _cont } } -/* - * Execute executes the request - * @return TemplateOut - */ -func (a *TransformationTemplateApiService) V1TransformationTemplateGetExecute(r ApiV1TransformationTemplateGetRequest) (TemplateOut, *_nethttp.Response, error) { +// Execute executes the request +// @return TemplateOut +func (a *TransformationTemplateAPIService) V1TransformationTemplateGetExecute(r ApiV1TransformationTemplateGetRequest) (*TemplateOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue TemplateOut + formFiles []formFile + localVarReturnValue *TemplateOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransformationTemplateApiService.V1TransformationTemplateGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransformationTemplateAPIService.V1TransformationTemplateGet") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/transformation-template/{transformation_template_id}" - localVarPath = strings.Replace(localVarPath, "{"+"transformation_template_id"+"}", _neturl.PathEscape(parameterToString(r.transformationTemplateId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"transformation_template_id"+"}", url.PathEscape(parameterValueToString(r.transformationTemplateId, "transformationTemplateId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -638,7 +649,7 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateGetExecute(r if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -648,15 +659,15 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateGetExecute(r return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -667,7 +678,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateGetExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -677,7 +689,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateGetExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -687,7 +700,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateGetExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -697,7 +711,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateGetExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -707,7 +722,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateGetExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -717,7 +733,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateGetExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -727,14 +744,15 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateGetExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -745,76 +763,79 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateGetExecute(r } type ApiV1TransformationTemplateListRequest struct { - ctx _context.Context - ApiService *TransformationTemplateApiService + ctx context.Context + ApiService *TransformationTemplateAPIService limit *int32 iterator *string order *Ordering } +// Limit the number of returned items func (r ApiV1TransformationTemplateListRequest) Limit(limit int32) ApiV1TransformationTemplateListRequest { r.limit = &limit return r } + +// The iterator returned from a prior invocation func (r ApiV1TransformationTemplateListRequest) Iterator(iterator string) ApiV1TransformationTemplateListRequest { r.iterator = &iterator return r } + +// The sorting order of the returned items func (r ApiV1TransformationTemplateListRequest) Order(order Ordering) ApiV1TransformationTemplateListRequest { r.order = &order return r } -func (r ApiV1TransformationTemplateListRequest) Execute() (ListResponseTemplateOut, *_nethttp.Response, error) { +func (r ApiV1TransformationTemplateListRequest) Execute() (*ListResponseTemplateOut, *http.Response, error) { return r.ApiService.V1TransformationTemplateListExecute(r) } /* - * V1TransformationTemplateList List Transformation Templates - * List all transformation templates for an application - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiV1TransformationTemplateListRequest - */ -func (a *TransformationTemplateApiService) V1TransformationTemplateList(ctx _context.Context) ApiV1TransformationTemplateListRequest { +V1TransformationTemplateList List Transformation Templates + +List all transformation templates for an application + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiV1TransformationTemplateListRequest +*/ +func (a *TransformationTemplateAPIService) V1TransformationTemplateList(ctx context.Context) ApiV1TransformationTemplateListRequest { return ApiV1TransformationTemplateListRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return ListResponseTemplateOut - */ -func (a *TransformationTemplateApiService) V1TransformationTemplateListExecute(r ApiV1TransformationTemplateListRequest) (ListResponseTemplateOut, *_nethttp.Response, error) { +// Execute executes the request +// @return ListResponseTemplateOut +func (a *TransformationTemplateAPIService) V1TransformationTemplateListExecute(r ApiV1TransformationTemplateListRequest) (*ListResponseTemplateOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ListResponseTemplateOut + formFiles []formFile + localVarReturnValue *ListResponseTemplateOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransformationTemplateApiService.V1TransformationTemplateList") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransformationTemplateAPIService.V1TransformationTemplateList") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/transformation-template/" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") } if r.iterator != nil { - localVarQueryParams.Add("iterator", parameterToString(*r.iterator, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "iterator", r.iterator, "") } if r.order != nil { - localVarQueryParams.Add("order", parameterToString(*r.order, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "order", r.order, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -833,7 +854,7 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateListExecute(r if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -843,15 +864,15 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateListExecute(r return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -862,7 +883,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateListExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -872,7 +894,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateListExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -882,7 +905,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateListExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -892,7 +916,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateListExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -902,7 +927,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateListExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -912,7 +938,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateListExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -922,14 +949,15 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateListExecute(r newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -940,8 +968,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateListExecute(r } type ApiV1TransformationTemplateOauthDiscordRequest struct { - ctx _context.Context - ApiService *TransformationTemplateApiService + ctx context.Context + ApiService *TransformationTemplateAPIService oauthPayloadIn *OauthPayloadIn idempotencyKey *string } @@ -950,52 +978,52 @@ func (r ApiV1TransformationTemplateOauthDiscordRequest) OauthPayloadIn(oauthPayl r.oauthPayloadIn = &oauthPayloadIn return r } + +// The request's idempotency key func (r ApiV1TransformationTemplateOauthDiscordRequest) IdempotencyKey(idempotencyKey string) ApiV1TransformationTemplateOauthDiscordRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1TransformationTemplateOauthDiscordRequest) Execute() (OauthPayloadOut, *_nethttp.Response, error) { +func (r ApiV1TransformationTemplateOauthDiscordRequest) Execute() (*OauthPayloadOut, *http.Response, error) { return r.ApiService.V1TransformationTemplateOauthDiscordExecute(r) } /* - * V1TransformationTemplateOauthDiscord Authorize Discord - * Get Discord Incoming webhook URL - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiV1TransformationTemplateOauthDiscordRequest - */ -func (a *TransformationTemplateApiService) V1TransformationTemplateOauthDiscord(ctx _context.Context) ApiV1TransformationTemplateOauthDiscordRequest { +V1TransformationTemplateOauthDiscord Authorize Discord + +Get Discord Incoming webhook URL + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiV1TransformationTemplateOauthDiscordRequest +*/ +func (a *TransformationTemplateAPIService) V1TransformationTemplateOauthDiscord(ctx context.Context) ApiV1TransformationTemplateOauthDiscordRequest { return ApiV1TransformationTemplateOauthDiscordRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return OauthPayloadOut - */ -func (a *TransformationTemplateApiService) V1TransformationTemplateOauthDiscordExecute(r ApiV1TransformationTemplateOauthDiscordRequest) (OauthPayloadOut, *_nethttp.Response, error) { +// Execute executes the request +// @return OauthPayloadOut +func (a *TransformationTemplateAPIService) V1TransformationTemplateOauthDiscordExecute(r ApiV1TransformationTemplateOauthDiscordRequest) (*OauthPayloadOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue OauthPayloadOut + formFiles []formFile + localVarReturnValue *OauthPayloadOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransformationTemplateApiService.V1TransformationTemplateOauthDiscord") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransformationTemplateAPIService.V1TransformationTemplateOauthDiscord") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/transformation-template/oauth/discord" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.oauthPayloadIn == nil { return localVarReturnValue, nil, reportError("oauthPayloadIn is required and must be specified") } @@ -1018,11 +1046,11 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthDiscordE localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } // body params localVarPostBody = r.oauthPayloadIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1032,15 +1060,15 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthDiscordE return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1051,7 +1079,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthDiscordE newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1061,7 +1090,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthDiscordE newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1071,7 +1101,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthDiscordE newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1081,7 +1112,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthDiscordE newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -1091,7 +1123,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthDiscordE newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1101,7 +1134,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthDiscordE newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1111,14 +1145,15 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthDiscordE newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1129,8 +1164,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthDiscordE } type ApiV1TransformationTemplateOauthSlackRequest struct { - ctx _context.Context - ApiService *TransformationTemplateApiService + ctx context.Context + ApiService *TransformationTemplateAPIService oauthPayloadIn *OauthPayloadIn idempotencyKey *string } @@ -1139,52 +1174,52 @@ func (r ApiV1TransformationTemplateOauthSlackRequest) OauthPayloadIn(oauthPayloa r.oauthPayloadIn = &oauthPayloadIn return r } + +// The request's idempotency key func (r ApiV1TransformationTemplateOauthSlackRequest) IdempotencyKey(idempotencyKey string) ApiV1TransformationTemplateOauthSlackRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1TransformationTemplateOauthSlackRequest) Execute() (OauthPayloadOut, *_nethttp.Response, error) { +func (r ApiV1TransformationTemplateOauthSlackRequest) Execute() (*OauthPayloadOut, *http.Response, error) { return r.ApiService.V1TransformationTemplateOauthSlackExecute(r) } /* - * V1TransformationTemplateOauthSlack Authorize Slack - * Get Slack Incoming webhook URL - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiV1TransformationTemplateOauthSlackRequest - */ -func (a *TransformationTemplateApiService) V1TransformationTemplateOauthSlack(ctx _context.Context) ApiV1TransformationTemplateOauthSlackRequest { +V1TransformationTemplateOauthSlack Authorize Slack + +Get Slack Incoming webhook URL + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiV1TransformationTemplateOauthSlackRequest +*/ +func (a *TransformationTemplateAPIService) V1TransformationTemplateOauthSlack(ctx context.Context) ApiV1TransformationTemplateOauthSlackRequest { return ApiV1TransformationTemplateOauthSlackRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return OauthPayloadOut - */ -func (a *TransformationTemplateApiService) V1TransformationTemplateOauthSlackExecute(r ApiV1TransformationTemplateOauthSlackRequest) (OauthPayloadOut, *_nethttp.Response, error) { +// Execute executes the request +// @return OauthPayloadOut +func (a *TransformationTemplateAPIService) V1TransformationTemplateOauthSlackExecute(r ApiV1TransformationTemplateOauthSlackRequest) (*OauthPayloadOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue OauthPayloadOut + formFiles []formFile + localVarReturnValue *OauthPayloadOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransformationTemplateApiService.V1TransformationTemplateOauthSlack") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransformationTemplateAPIService.V1TransformationTemplateOauthSlack") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/transformation-template/oauth/slack" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.oauthPayloadIn == nil { return localVarReturnValue, nil, reportError("oauthPayloadIn is required and must be specified") } @@ -1207,11 +1242,11 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthSlackExe localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } // body params localVarPostBody = r.oauthPayloadIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1221,15 +1256,15 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthSlackExe return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1240,7 +1275,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthSlackExe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1250,7 +1286,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthSlackExe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1260,7 +1297,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthSlackExe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1270,7 +1308,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthSlackExe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -1280,7 +1319,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthSlackExe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1290,7 +1330,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthSlackExe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1300,14 +1341,15 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthSlackExe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1318,8 +1360,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthSlackExe } type ApiV1TransformationTemplatePatchRequest struct { - ctx _context.Context - ApiService *TransformationTemplateApiService + ctx context.Context + ApiService *TransformationTemplateAPIService transformationTemplateId string templatePatch *TemplatePatch } @@ -1329,18 +1371,20 @@ func (r ApiV1TransformationTemplatePatchRequest) TemplatePatch(templatePatch Tem return r } -func (r ApiV1TransformationTemplatePatchRequest) Execute() (TemplateOut, *_nethttp.Response, error) { +func (r ApiV1TransformationTemplatePatchRequest) Execute() (*TemplateOut, *http.Response, error) { return r.ApiService.V1TransformationTemplatePatchExecute(r) } /* - * V1TransformationTemplatePatch Patch Transformation Template - * Partially update a transformation template - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param transformationTemplateId - * @return ApiV1TransformationTemplatePatchRequest - */ -func (a *TransformationTemplateApiService) V1TransformationTemplatePatch(ctx _context.Context, transformationTemplateId string) ApiV1TransformationTemplatePatchRequest { +V1TransformationTemplatePatch Patch Transformation Template + +Partially update a transformation template + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param transformationTemplateId + @return ApiV1TransformationTemplatePatchRequest +*/ +func (a *TransformationTemplateAPIService) V1TransformationTemplatePatch(ctx context.Context, transformationTemplateId string) ApiV1TransformationTemplatePatchRequest { return ApiV1TransformationTemplatePatchRequest{ ApiService: a, ctx: ctx, @@ -1348,31 +1392,27 @@ func (a *TransformationTemplateApiService) V1TransformationTemplatePatch(ctx _co } } -/* - * Execute executes the request - * @return TemplateOut - */ -func (a *TransformationTemplateApiService) V1TransformationTemplatePatchExecute(r ApiV1TransformationTemplatePatchRequest) (TemplateOut, *_nethttp.Response, error) { +// Execute executes the request +// @return TemplateOut +func (a *TransformationTemplateAPIService) V1TransformationTemplatePatchExecute(r ApiV1TransformationTemplatePatchRequest) (*TemplateOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue TemplateOut + formFiles []formFile + localVarReturnValue *TemplateOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransformationTemplateApiService.V1TransformationTemplatePatch") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransformationTemplateAPIService.V1TransformationTemplatePatch") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/transformation-template/{transformation_template_id}" - localVarPath = strings.Replace(localVarPath, "{"+"transformation_template_id"+"}", _neturl.PathEscape(parameterToString(r.transformationTemplateId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"transformation_template_id"+"}", url.PathEscape(parameterValueToString(r.transformationTemplateId, "transformationTemplateId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.templatePatch == nil { return localVarReturnValue, nil, reportError("templatePatch is required and must be specified") } @@ -1396,7 +1436,7 @@ func (a *TransformationTemplateApiService) V1TransformationTemplatePatchExecute( } // body params localVarPostBody = r.templatePatch - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1406,15 +1446,15 @@ func (a *TransformationTemplateApiService) V1TransformationTemplatePatchExecute( return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1425,7 +1465,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplatePatchExecute( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1435,7 +1476,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplatePatchExecute( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1445,7 +1487,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplatePatchExecute( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1455,7 +1498,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplatePatchExecute( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -1465,7 +1509,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplatePatchExecute( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1475,7 +1520,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplatePatchExecute( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1485,14 +1531,15 @@ func (a *TransformationTemplateApiService) V1TransformationTemplatePatchExecute( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1503,8 +1550,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplatePatchExecute( } type ApiV1TransformationTemplateSimulateRequest struct { - ctx _context.Context - ApiService *TransformationTemplateApiService + ctx context.Context + ApiService *TransformationTemplateAPIService transformationSimulateIn *TransformationSimulateIn idempotencyKey *string } @@ -1513,52 +1560,52 @@ func (r ApiV1TransformationTemplateSimulateRequest) TransformationSimulateIn(tra r.transformationSimulateIn = &transformationSimulateIn return r } + +// The request's idempotency key func (r ApiV1TransformationTemplateSimulateRequest) IdempotencyKey(idempotencyKey string) ApiV1TransformationTemplateSimulateRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1TransformationTemplateSimulateRequest) Execute() (TransformationSimulateOut, *_nethttp.Response, error) { +func (r ApiV1TransformationTemplateSimulateRequest) Execute() (*TransformationSimulateOut, *http.Response, error) { return r.ApiService.V1TransformationTemplateSimulateExecute(r) } /* - * V1TransformationTemplateSimulate Simulate - * Simulate running the transformation on the payload and code - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiV1TransformationTemplateSimulateRequest - */ -func (a *TransformationTemplateApiService) V1TransformationTemplateSimulate(ctx _context.Context) ApiV1TransformationTemplateSimulateRequest { +V1TransformationTemplateSimulate Simulate + +Simulate running the transformation on the payload and code + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiV1TransformationTemplateSimulateRequest +*/ +func (a *TransformationTemplateAPIService) V1TransformationTemplateSimulate(ctx context.Context) ApiV1TransformationTemplateSimulateRequest { return ApiV1TransformationTemplateSimulateRequest{ ApiService: a, ctx: ctx, } } -/* - * Execute executes the request - * @return TransformationSimulateOut - */ -func (a *TransformationTemplateApiService) V1TransformationTemplateSimulateExecute(r ApiV1TransformationTemplateSimulateRequest) (TransformationSimulateOut, *_nethttp.Response, error) { +// Execute executes the request +// @return TransformationSimulateOut +func (a *TransformationTemplateAPIService) V1TransformationTemplateSimulateExecute(r ApiV1TransformationTemplateSimulateRequest) (*TransformationSimulateOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue TransformationSimulateOut + formFiles []formFile + localVarReturnValue *TransformationSimulateOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransformationTemplateApiService.V1TransformationTemplateSimulate") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransformationTemplateAPIService.V1TransformationTemplateSimulate") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/transformation-template/simulate" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.transformationSimulateIn == nil { return localVarReturnValue, nil, reportError("transformationSimulateIn is required and must be specified") } @@ -1581,11 +1628,11 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateSimulateExecu localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") } // body params localVarPostBody = r.transformationSimulateIn - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1595,15 +1642,15 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateSimulateExecu return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1614,7 +1661,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateSimulateExecu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1624,7 +1672,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateSimulateExecu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1634,7 +1683,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateSimulateExecu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1644,7 +1694,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateSimulateExecu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -1654,7 +1705,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateSimulateExecu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1664,7 +1716,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateSimulateExecu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1674,14 +1727,15 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateSimulateExecu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1692,8 +1746,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateSimulateExecu } type ApiV1TransformationTemplateUpdateRequest struct { - ctx _context.Context - ApiService *TransformationTemplateApiService + ctx context.Context + ApiService *TransformationTemplateAPIService transformationTemplateId string templateUpdate *TemplateUpdate } @@ -1703,18 +1757,20 @@ func (r ApiV1TransformationTemplateUpdateRequest) TemplateUpdate(templateUpdate return r } -func (r ApiV1TransformationTemplateUpdateRequest) Execute() (TemplateOut, *_nethttp.Response, error) { +func (r ApiV1TransformationTemplateUpdateRequest) Execute() (*TemplateOut, *http.Response, error) { return r.ApiService.V1TransformationTemplateUpdateExecute(r) } /* - * V1TransformationTemplateUpdate Update Transformation Template - * Update a transformation template - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param transformationTemplateId - * @return ApiV1TransformationTemplateUpdateRequest - */ -func (a *TransformationTemplateApiService) V1TransformationTemplateUpdate(ctx _context.Context, transformationTemplateId string) ApiV1TransformationTemplateUpdateRequest { +V1TransformationTemplateUpdate Update Transformation Template + +Update a transformation template + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param transformationTemplateId + @return ApiV1TransformationTemplateUpdateRequest +*/ +func (a *TransformationTemplateAPIService) V1TransformationTemplateUpdate(ctx context.Context, transformationTemplateId string) ApiV1TransformationTemplateUpdateRequest { return ApiV1TransformationTemplateUpdateRequest{ ApiService: a, ctx: ctx, @@ -1722,31 +1778,27 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateUpdate(ctx _c } } -/* - * Execute executes the request - * @return TemplateOut - */ -func (a *TransformationTemplateApiService) V1TransformationTemplateUpdateExecute(r ApiV1TransformationTemplateUpdateRequest) (TemplateOut, *_nethttp.Response, error) { +// Execute executes the request +// @return TemplateOut +func (a *TransformationTemplateAPIService) V1TransformationTemplateUpdateExecute(r ApiV1TransformationTemplateUpdateRequest) (*TemplateOut, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue TemplateOut + formFiles []formFile + localVarReturnValue *TemplateOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransformationTemplateApiService.V1TransformationTemplateUpdate") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransformationTemplateAPIService.V1TransformationTemplateUpdate") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/v1/transformation-template/{transformation_template_id}" - localVarPath = strings.Replace(localVarPath, "{"+"transformation_template_id"+"}", _neturl.PathEscape(parameterToString(r.transformationTemplateId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"transformation_template_id"+"}", url.PathEscape(parameterValueToString(r.transformationTemplateId, "transformationTemplateId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.templateUpdate == nil { return localVarReturnValue, nil, reportError("templateUpdate is required and must be specified") } @@ -1770,7 +1822,7 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateUpdateExecute } // body params localVarPostBody = r.templateUpdate - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1780,15 +1832,15 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateUpdateExecute return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1799,7 +1851,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateUpdateExecute newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1809,7 +1862,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateUpdateExecute newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1819,7 +1873,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateUpdateExecute newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1829,7 +1884,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateUpdateExecute newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -1839,7 +1895,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateUpdateExecute newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { @@ -1849,7 +1906,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateUpdateExecute newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { @@ -1859,14 +1917,15 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateUpdateExecute newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/go/internal/openapi/client.go b/go/internal/openapi/client.go index 044aa4725..07dffb509 100644 --- a/go/internal/openapi/client.go +++ b/go/internal/openapi/client.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -52,35 +52,35 @@ type APIClient struct { // API Services - ApplicationApi *ApplicationApiService + ApplicationAPI *ApplicationAPIService - AuthenticationApi *AuthenticationApiService + AuthenticationAPI *AuthenticationAPIService - BackgroundTasksApi *BackgroundTasksApiService + BackgroundTasksAPI *BackgroundTasksAPIService - BroadcastApi *BroadcastApiService + BroadcastAPI *BroadcastAPIService - EndpointApi *EndpointApiService + EndpointAPI *EndpointAPIService - EnvironmentApi *EnvironmentApiService + EnvironmentAPI *EnvironmentAPIService - EnvironmentSettingsApi *EnvironmentSettingsApiService + EnvironmentSettingsAPI *EnvironmentSettingsAPIService - EventTypeApi *EventTypeApiService + EventTypeAPI *EventTypeAPIService - HealthApi *HealthApiService + HealthAPI *HealthAPIService - InboundApi *InboundApiService + InboundAPI *InboundAPIService - IntegrationApi *IntegrationApiService + IntegrationAPI *IntegrationAPIService - MessageApi *MessageApiService + MessageAPI *MessageAPIService - MessageAttemptApi *MessageAttemptApiService + MessageAttemptAPI *MessageAttemptAPIService - StatisticsApi *StatisticsApiService + StatisticsAPI *StatisticsAPIService - TransformationTemplateApi *TransformationTemplateApiService + TransformationTemplateAPI *TransformationTemplateAPIService } type service struct { @@ -99,21 +99,21 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.common.client = c // API Services - c.ApplicationApi = (*ApplicationApiService)(&c.common) - c.AuthenticationApi = (*AuthenticationApiService)(&c.common) - c.BackgroundTasksApi = (*BackgroundTasksApiService)(&c.common) - 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) - c.StatisticsApi = (*StatisticsApiService)(&c.common) - c.TransformationTemplateApi = (*TransformationTemplateApiService)(&c.common) + c.ApplicationAPI = (*ApplicationAPIService)(&c.common) + c.AuthenticationAPI = (*AuthenticationAPIService)(&c.common) + c.BackgroundTasksAPI = (*BackgroundTasksAPIService)(&c.common) + 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) + c.StatisticsAPI = (*StatisticsAPIService)(&c.common) + c.TransformationTemplateAPI = (*TransformationTemplateAPIService)(&c.common) return c } diff --git a/go/internal/openapi/configuration.go b/go/internal/openapi/configuration.go index 5a351486a..48f3ceec5 100644 --- a/go/internal/openapi/configuration.go +++ b/go/internal/openapi/configuration.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -28,21 +28,9 @@ func (c contextKey) String() string { } var ( - // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. - ContextOAuth2 = contextKey("token") - - // ContextBasicAuth takes BasicAuth as authentication for the request. - ContextBasicAuth = contextKey("basic") - // ContextAccessToken takes a string oauth2 access token as authentication for the request. ContextAccessToken = contextKey("accesstoken") - // ContextAPIKeys takes a string apikey as authentication for the request - ContextAPIKeys = contextKey("apiKeys") - - // ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request. - ContextHttpSignatureAuth = contextKey("httpsignature") - // ContextServerIndex uses a server configuration from the index. ContextServerIndex = contextKey("serverIndex") @@ -127,7 +115,7 @@ func (c *Configuration) AddDefaultHeader(key string, value string) { // URL formats template on a index using given variables func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { if index < 0 || len(sc) <= index { - return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1) + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) } server := sc[index] url := server.URL @@ -142,7 +130,7 @@ func (sc ServerConfigurations) URL(index int, variables map[string]string) (stri } } if !found { - return "", fmt.Errorf("The variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) } url = strings.Replace(url, "{"+name+"}", value, -1) } else { diff --git a/go/internal/openapi/model_aggregate_event_types_out.go b/go/internal/openapi/model_aggregate_event_types_out.go index a059869a3..1d6f5168d 100644 --- a/go/internal/openapi/model_aggregate_event_types_out.go +++ b/go/internal/openapi/model_aggregate_event_types_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the AggregateEventTypesOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AggregateEventTypesOut{} + // AggregateEventTypesOut struct for AggregateEventTypesOut type AggregateEventTypesOut struct { Id string `json:"id"` @@ -21,6 +26,8 @@ type AggregateEventTypesOut struct { Task BackgroundTaskType `json:"task"` } +type _AggregateEventTypesOut AggregateEventTypesOut + // NewAggregateEventTypesOut instantiates a new AggregateEventTypesOut 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 @@ -54,7 +61,7 @@ func (o *AggregateEventTypesOut) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *AggregateEventTypesOut) GetIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Id, true @@ -78,7 +85,7 @@ func (o *AggregateEventTypesOut) GetStatus() BackgroundTaskStatus { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. func (o *AggregateEventTypesOut) GetStatusOk() (*BackgroundTaskStatus, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Status, true @@ -102,7 +109,7 @@ func (o *AggregateEventTypesOut) GetTask() BackgroundTaskType { // GetTaskOk returns a tuple with the Task field value // and a boolean to check if the value has been set. func (o *AggregateEventTypesOut) GetTaskOk() (*BackgroundTaskType, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Task, true @@ -114,17 +121,58 @@ func (o *AggregateEventTypesOut) SetTask(v BackgroundTaskType) { } func (o AggregateEventTypesOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AggregateEventTypesOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["id"] = o.Id + toSerialize["id"] = o.Id + toSerialize["status"] = o.Status + toSerialize["task"] = o.Task + return toSerialize, nil +} + +func (o *AggregateEventTypesOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "status", + "task", } - if true { - toSerialize["status"] = o.Status + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["task"] = o.Task + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varAggregateEventTypesOut := _AggregateEventTypesOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAggregateEventTypesOut) + + if err != nil { + return err + } + + *o = AggregateEventTypesOut(varAggregateEventTypesOut) + + return err } type NullableAggregateEventTypesOut struct { diff --git a/go/internal/openapi/model_app_portal_access_in.go b/go/internal/openapi/model_app_portal_access_in.go index 796fb9e60..ea913fd82 100644 --- a/go/internal/openapi/model_app_portal_access_in.go +++ b/go/internal/openapi/model_app_portal_access_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -14,10 +14,13 @@ import ( "encoding/json" ) +// checks if the AppPortalAccessIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AppPortalAccessIn{} + // AppPortalAccessIn struct for AppPortalAccessIn type AppPortalAccessIn struct { // The set of feature flags the created token will have access to. - FeatureFlags *[]string `json:"featureFlags,omitempty"` + FeatureFlags []string `json:"featureFlags,omitempty"` } // NewAppPortalAccessIn instantiates a new AppPortalAccessIn object @@ -39,17 +42,17 @@ func NewAppPortalAccessInWithDefaults() *AppPortalAccessIn { // GetFeatureFlags returns the FeatureFlags field value if set, zero value otherwise. func (o *AppPortalAccessIn) GetFeatureFlags() []string { - if o == nil || o.FeatureFlags == nil { + if o == nil || IsNil(o.FeatureFlags) { var ret []string return ret } - return *o.FeatureFlags + return o.FeatureFlags } // GetFeatureFlagsOk returns a tuple with the FeatureFlags field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AppPortalAccessIn) GetFeatureFlagsOk() (*[]string, bool) { - if o == nil || o.FeatureFlags == nil { +func (o *AppPortalAccessIn) GetFeatureFlagsOk() ([]string, bool) { + if o == nil || IsNil(o.FeatureFlags) { return nil, false } return o.FeatureFlags, true @@ -57,7 +60,7 @@ func (o *AppPortalAccessIn) GetFeatureFlagsOk() (*[]string, bool) { // HasFeatureFlags returns a boolean if a field has been set. func (o *AppPortalAccessIn) HasFeatureFlags() bool { - if o != nil && o.FeatureFlags != nil { + if o != nil && !IsNil(o.FeatureFlags) { return true } @@ -66,15 +69,23 @@ func (o *AppPortalAccessIn) HasFeatureFlags() bool { // SetFeatureFlags gets a reference to the given []string and assigns it to the FeatureFlags field. func (o *AppPortalAccessIn) SetFeatureFlags(v []string) { - o.FeatureFlags = &v + o.FeatureFlags = v } func (o AppPortalAccessIn) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AppPortalAccessIn) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.FeatureFlags != nil { + if !IsNil(o.FeatureFlags) { toSerialize["featureFlags"] = o.FeatureFlags } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableAppPortalAccessIn struct { diff --git a/go/internal/openapi/model_app_portal_access_out.go b/go/internal/openapi/model_app_portal_access_out.go index 487ba0b8d..5ef7b2fe0 100644 --- a/go/internal/openapi/model_app_portal_access_out.go +++ b/go/internal/openapi/model_app_portal_access_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,14 +12,21 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the AppPortalAccessOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AppPortalAccessOut{} + // AppPortalAccessOut struct for AppPortalAccessOut type AppPortalAccessOut struct { Token string `json:"token"` Url string `json:"url"` } +type _AppPortalAccessOut AppPortalAccessOut + // NewAppPortalAccessOut instantiates a new AppPortalAccessOut 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 @@ -52,7 +59,7 @@ func (o *AppPortalAccessOut) GetToken() string { // GetTokenOk returns a tuple with the Token field value // and a boolean to check if the value has been set. func (o *AppPortalAccessOut) GetTokenOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Token, true @@ -76,7 +83,7 @@ func (o *AppPortalAccessOut) GetUrl() string { // GetUrlOk returns a tuple with the Url field value // and a boolean to check if the value has been set. func (o *AppPortalAccessOut) GetUrlOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Url, true @@ -88,14 +95,56 @@ func (o *AppPortalAccessOut) SetUrl(v string) { } func (o AppPortalAccessOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AppPortalAccessOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["token"] = o.Token + toSerialize["token"] = o.Token + toSerialize["url"] = o.Url + return toSerialize, nil +} + +func (o *AppPortalAccessOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "token", + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["url"] = o.Url + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varAppPortalAccessOut := _AppPortalAccessOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAppPortalAccessOut) + + if err != nil { + return err + } + + *o = AppPortalAccessOut(varAppPortalAccessOut) + + return err } type NullableAppPortalAccessOut struct { diff --git a/go/internal/openapi/model_app_usage_stats_in.go b/go/internal/openapi/model_app_usage_stats_in.go index 3b0713a60..f2138cd07 100644 --- a/go/internal/openapi/model_app_usage_stats_in.go +++ b/go/internal/openapi/model_app_usage_stats_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -13,8 +13,13 @@ package openapi import ( "encoding/json" "time" + "bytes" + "fmt" ) +// checks if the AppUsageStatsIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AppUsageStatsIn{} + // AppUsageStatsIn struct for AppUsageStatsIn type AppUsageStatsIn struct { AppIds []string `json:"appIds,omitempty"` @@ -22,6 +27,8 @@ type AppUsageStatsIn struct { Until time.Time `json:"until"` } +type _AppUsageStatsIn AppUsageStatsIn + // NewAppUsageStatsIn instantiates a new AppUsageStatsIn 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 @@ -43,7 +50,7 @@ func NewAppUsageStatsInWithDefaults() *AppUsageStatsIn { // GetAppIds returns the AppIds field value if set, zero value otherwise (both if not set or set to explicit null). func (o *AppUsageStatsIn) GetAppIds() []string { - if o == nil { + if o == nil { var ret []string return ret } @@ -53,16 +60,16 @@ func (o *AppUsageStatsIn) GetAppIds() []string { // GetAppIdsOk returns a tuple with the AppIds 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 *AppUsageStatsIn) GetAppIdsOk() (*[]string, bool) { - if o == nil || o.AppIds == nil { +func (o *AppUsageStatsIn) GetAppIdsOk() ([]string, bool) { + if o == nil || IsNil(o.AppIds) { return nil, false } - return &o.AppIds, true + return o.AppIds, true } // HasAppIds returns a boolean if a field has been set. func (o *AppUsageStatsIn) HasAppIds() bool { - if o != nil && o.AppIds != nil { + if o != nil && IsNil(o.AppIds) { return true } @@ -87,7 +94,7 @@ func (o *AppUsageStatsIn) GetSince() time.Time { // GetSinceOk returns a tuple with the Since field value // and a boolean to check if the value has been set. func (o *AppUsageStatsIn) GetSinceOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Since, true @@ -111,7 +118,7 @@ func (o *AppUsageStatsIn) GetUntil() time.Time { // GetUntilOk returns a tuple with the Until field value // and a boolean to check if the value has been set. func (o *AppUsageStatsIn) GetUntilOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Until, true @@ -123,17 +130,59 @@ func (o *AppUsageStatsIn) SetUntil(v time.Time) { } func (o AppUsageStatsIn) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AppUsageStatsIn) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if o.AppIds != nil { toSerialize["appIds"] = o.AppIds } - if true { - toSerialize["since"] = o.Since + toSerialize["since"] = o.Since + toSerialize["until"] = o.Until + return toSerialize, nil +} + +func (o *AppUsageStatsIn) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "since", + "until", } - if true { - toSerialize["until"] = o.Until + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - return json.Marshal(toSerialize) + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAppUsageStatsIn := _AppUsageStatsIn{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAppUsageStatsIn) + + if err != nil { + return err + } + + *o = AppUsageStatsIn(varAppUsageStatsIn) + + return err } type NullableAppUsageStatsIn struct { diff --git a/go/internal/openapi/model_app_usage_stats_out.go b/go/internal/openapi/model_app_usage_stats_out.go index 890754314..a4de62898 100644 --- a/go/internal/openapi/model_app_usage_stats_out.go +++ b/go/internal/openapi/model_app_usage_stats_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the AppUsageStatsOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AppUsageStatsOut{} + // AppUsageStatsOut struct for AppUsageStatsOut type AppUsageStatsOut struct { Id string `json:"id"` @@ -21,6 +26,8 @@ type AppUsageStatsOut struct { Task BackgroundTaskType `json:"task"` } +type _AppUsageStatsOut AppUsageStatsOut + // NewAppUsageStatsOut instantiates a new AppUsageStatsOut 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 @@ -54,7 +61,7 @@ func (o *AppUsageStatsOut) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *AppUsageStatsOut) GetIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Id, true @@ -78,7 +85,7 @@ func (o *AppUsageStatsOut) GetStatus() BackgroundTaskStatus { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. func (o *AppUsageStatsOut) GetStatusOk() (*BackgroundTaskStatus, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Status, true @@ -102,7 +109,7 @@ func (o *AppUsageStatsOut) GetTask() BackgroundTaskType { // GetTaskOk returns a tuple with the Task field value // and a boolean to check if the value has been set. func (o *AppUsageStatsOut) GetTaskOk() (*BackgroundTaskType, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Task, true @@ -114,17 +121,58 @@ func (o *AppUsageStatsOut) SetTask(v BackgroundTaskType) { } func (o AppUsageStatsOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AppUsageStatsOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["id"] = o.Id + toSerialize["id"] = o.Id + toSerialize["status"] = o.Status + toSerialize["task"] = o.Task + return toSerialize, nil +} + +func (o *AppUsageStatsOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "status", + "task", } - if true { - toSerialize["status"] = o.Status + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["task"] = o.Task + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varAppUsageStatsOut := _AppUsageStatsOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAppUsageStatsOut) + + if err != nil { + return err + } + + *o = AppUsageStatsOut(varAppUsageStatsOut) + + return err } type NullableAppUsageStatsOut struct { diff --git a/go/internal/openapi/model_application_in.go b/go/internal/openapi/model_application_in.go index 55c84e03b..29e01646a 100644 --- a/go/internal/openapi/model_application_in.go +++ b/go/internal/openapi/model_application_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the ApplicationIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationIn{} + // ApplicationIn struct for ApplicationIn type ApplicationIn struct { Metadata *map[string]string `json:"metadata,omitempty"` @@ -23,6 +28,8 @@ type ApplicationIn struct { Uid NullableString `json:"uid,omitempty"` } +type _ApplicationIn ApplicationIn + // NewApplicationIn instantiates a new ApplicationIn 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 @@ -43,7 +50,7 @@ func NewApplicationInWithDefaults() *ApplicationIn { // GetMetadata returns the Metadata field value if set, zero value otherwise. func (o *ApplicationIn) GetMetadata() map[string]string { - if o == nil || o.Metadata == nil { + if o == nil || IsNil(o.Metadata) { var ret map[string]string return ret } @@ -53,7 +60,7 @@ func (o *ApplicationIn) GetMetadata() map[string]string { // GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ApplicationIn) GetMetadataOk() (*map[string]string, bool) { - if o == nil || o.Metadata == nil { + if o == nil || IsNil(o.Metadata) { return nil, false } return o.Metadata, true @@ -61,7 +68,7 @@ func (o *ApplicationIn) GetMetadataOk() (*map[string]string, bool) { // HasMetadata returns a boolean if a field has been set. func (o *ApplicationIn) HasMetadata() bool { - if o != nil && o.Metadata != nil { + if o != nil && !IsNil(o.Metadata) { return true } @@ -86,7 +93,7 @@ func (o *ApplicationIn) GetName() string { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *ApplicationIn) GetNameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Name, true @@ -99,7 +106,7 @@ func (o *ApplicationIn) SetName(v string) { // GetRateLimit returns the RateLimit field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ApplicationIn) GetRateLimit() int32 { - if o == nil || o.RateLimit.Get() == nil { + if o == nil || IsNil(o.RateLimit.Get()) { var ret int32 return ret } @@ -110,7 +117,7 @@ func (o *ApplicationIn) GetRateLimit() int32 { // 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 *ApplicationIn) GetRateLimitOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return o.RateLimit.Get(), o.RateLimit.IsSet() @@ -141,7 +148,7 @@ func (o *ApplicationIn) UnsetRateLimit() { // GetUid returns the Uid field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ApplicationIn) GetUid() string { - if o == nil || o.Uid.Get() == nil { + if o == nil || IsNil(o.Uid.Get()) { var ret string return ret } @@ -152,7 +159,7 @@ func (o *ApplicationIn) GetUid() string { // 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 *ApplicationIn) GetUidOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Uid.Get(), o.Uid.IsSet() @@ -182,20 +189,63 @@ func (o *ApplicationIn) UnsetUid() { } func (o ApplicationIn) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationIn) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Metadata != nil { + if !IsNil(o.Metadata) { toSerialize["metadata"] = o.Metadata } - if true { - toSerialize["name"] = o.Name - } + toSerialize["name"] = o.Name if o.RateLimit.IsSet() { toSerialize["rateLimit"] = o.RateLimit.Get() } if o.Uid.IsSet() { toSerialize["uid"] = o.Uid.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *ApplicationIn) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varApplicationIn := _ApplicationIn{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varApplicationIn) + + if err != nil { + return err + } + + *o = ApplicationIn(varApplicationIn) + + return err } type NullableApplicationIn struct { diff --git a/go/internal/openapi/model_application_out.go b/go/internal/openapi/model_application_out.go index 37b96f685..ba2606634 100644 --- a/go/internal/openapi/model_application_out.go +++ b/go/internal/openapi/model_application_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -13,8 +13,13 @@ package openapi import ( "encoding/json" "time" + "bytes" + "fmt" ) +// checks if the ApplicationOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationOut{} + // ApplicationOut struct for ApplicationOut type ApplicationOut struct { CreatedAt time.Time `json:"createdAt"` @@ -28,6 +33,8 @@ type ApplicationOut struct { UpdatedAt time.Time `json:"updatedAt"` } +type _ApplicationOut ApplicationOut + // NewApplicationOut instantiates a new ApplicationOut 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 @@ -63,7 +70,7 @@ func (o *ApplicationOut) GetCreatedAt() time.Time { // GetCreatedAtOk returns a tuple with the CreatedAt field value // and a boolean to check if the value has been set. func (o *ApplicationOut) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.CreatedAt, true @@ -87,7 +94,7 @@ func (o *ApplicationOut) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *ApplicationOut) GetIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Id, true @@ -111,7 +118,7 @@ func (o *ApplicationOut) GetMetadata() map[string]string { // GetMetadataOk returns a tuple with the Metadata field value // and a boolean to check if the value has been set. func (o *ApplicationOut) GetMetadataOk() (*map[string]string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Metadata, true @@ -135,7 +142,7 @@ func (o *ApplicationOut) GetName() string { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *ApplicationOut) GetNameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Name, true @@ -148,7 +155,7 @@ func (o *ApplicationOut) SetName(v string) { // GetRateLimit returns the RateLimit field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ApplicationOut) GetRateLimit() int32 { - if o == nil || o.RateLimit.Get() == nil { + if o == nil || IsNil(o.RateLimit.Get()) { var ret int32 return ret } @@ -159,7 +166,7 @@ func (o *ApplicationOut) GetRateLimit() int32 { // 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 *ApplicationOut) GetRateLimitOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return o.RateLimit.Get(), o.RateLimit.IsSet() @@ -190,7 +197,7 @@ func (o *ApplicationOut) UnsetRateLimit() { // GetUid returns the Uid field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ApplicationOut) GetUid() string { - if o == nil || o.Uid.Get() == nil { + if o == nil || IsNil(o.Uid.Get()) { var ret string return ret } @@ -201,7 +208,7 @@ func (o *ApplicationOut) GetUid() string { // 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 *ApplicationOut) GetUidOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Uid.Get(), o.Uid.IsSet() @@ -243,7 +250,7 @@ func (o *ApplicationOut) GetUpdatedAt() time.Time { // GetUpdatedAtOk returns a tuple with the UpdatedAt field value // and a boolean to check if the value has been set. func (o *ApplicationOut) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.UpdatedAt, true @@ -255,29 +262,68 @@ func (o *ApplicationOut) SetUpdatedAt(v time.Time) { } func (o ApplicationOut) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["createdAt"] = o.CreatedAt - } - if true { - toSerialize["id"] = o.Id - } - if true { - toSerialize["metadata"] = o.Metadata - } - if true { - toSerialize["name"] = o.Name + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o ApplicationOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["createdAt"] = o.CreatedAt + toSerialize["id"] = o.Id + toSerialize["metadata"] = o.Metadata + toSerialize["name"] = o.Name if o.RateLimit.IsSet() { toSerialize["rateLimit"] = o.RateLimit.Get() } if o.Uid.IsSet() { toSerialize["uid"] = o.Uid.Get() } - if true { - toSerialize["updatedAt"] = o.UpdatedAt + toSerialize["updatedAt"] = o.UpdatedAt + return toSerialize, nil +} + +func (o *ApplicationOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "createdAt", + "id", + "metadata", + "name", + "updatedAt", } - return json.Marshal(toSerialize) + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varApplicationOut := _ApplicationOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varApplicationOut) + + if err != nil { + return err + } + + *o = ApplicationOut(varApplicationOut) + + return err } type NullableApplicationOut struct { diff --git a/go/internal/openapi/model_application_patch.go b/go/internal/openapi/model_application_patch.go index 40c33c15e..2afc0dd89 100644 --- a/go/internal/openapi/model_application_patch.go +++ b/go/internal/openapi/model_application_patch.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -14,6 +14,9 @@ import ( "encoding/json" ) +// checks if the ApplicationPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationPatch{} + // ApplicationPatch struct for ApplicationPatch type ApplicationPatch struct { Metadata *map[string]string `json:"metadata,omitempty"` @@ -42,7 +45,7 @@ func NewApplicationPatchWithDefaults() *ApplicationPatch { // GetMetadata returns the Metadata field value if set, zero value otherwise. func (o *ApplicationPatch) GetMetadata() map[string]string { - if o == nil || o.Metadata == nil { + if o == nil || IsNil(o.Metadata) { var ret map[string]string return ret } @@ -52,7 +55,7 @@ func (o *ApplicationPatch) GetMetadata() map[string]string { // GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ApplicationPatch) GetMetadataOk() (*map[string]string, bool) { - if o == nil || o.Metadata == nil { + if o == nil || IsNil(o.Metadata) { return nil, false } return o.Metadata, true @@ -60,7 +63,7 @@ func (o *ApplicationPatch) GetMetadataOk() (*map[string]string, bool) { // HasMetadata returns a boolean if a field has been set. func (o *ApplicationPatch) HasMetadata() bool { - if o != nil && o.Metadata != nil { + if o != nil && !IsNil(o.Metadata) { return true } @@ -74,7 +77,7 @@ func (o *ApplicationPatch) SetMetadata(v map[string]string) { // GetName returns the Name field value if set, zero value otherwise. func (o *ApplicationPatch) GetName() string { - if o == nil || o.Name == nil { + if o == nil || IsNil(o.Name) { var ret string return ret } @@ -84,7 +87,7 @@ func (o *ApplicationPatch) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ApplicationPatch) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { + if o == nil || IsNil(o.Name) { return nil, false } return o.Name, true @@ -92,7 +95,7 @@ func (o *ApplicationPatch) GetNameOk() (*string, bool) { // HasName returns a boolean if a field has been set. func (o *ApplicationPatch) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !IsNil(o.Name) { return true } @@ -106,7 +109,7 @@ func (o *ApplicationPatch) SetName(v string) { // GetRateLimit returns the RateLimit field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ApplicationPatch) GetRateLimit() int32 { - if o == nil || o.RateLimit.Get() == nil { + if o == nil || IsNil(o.RateLimit.Get()) { var ret int32 return ret } @@ -117,7 +120,7 @@ func (o *ApplicationPatch) GetRateLimit() int32 { // 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 *ApplicationPatch) GetRateLimitOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return o.RateLimit.Get(), o.RateLimit.IsSet() @@ -148,7 +151,7 @@ func (o *ApplicationPatch) UnsetRateLimit() { // GetUid returns the Uid field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ApplicationPatch) GetUid() string { - if o == nil || o.Uid.Get() == nil { + if o == nil || IsNil(o.Uid.Get()) { var ret string return ret } @@ -159,7 +162,7 @@ func (o *ApplicationPatch) GetUid() string { // 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 *ApplicationPatch) GetUidOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Uid.Get(), o.Uid.IsSet() @@ -189,11 +192,19 @@ func (o *ApplicationPatch) UnsetUid() { } func (o ApplicationPatch) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationPatch) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Metadata != nil { + if !IsNil(o.Metadata) { toSerialize["metadata"] = o.Metadata } - if o.Name != nil { + if !IsNil(o.Name) { toSerialize["name"] = o.Name } if o.RateLimit.IsSet() { @@ -202,7 +213,7 @@ func (o ApplicationPatch) MarshalJSON() ([]byte, error) { if o.Uid.IsSet() { toSerialize["uid"] = o.Uid.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableApplicationPatch struct { diff --git a/go/internal/openapi/model_application_stats.go b/go/internal/openapi/model_application_stats.go index 9ae055e01..d0658a755 100644 --- a/go/internal/openapi/model_application_stats.go +++ b/go/internal/openapi/model_application_stats.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the ApplicationStats type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationStats{} + // ApplicationStats struct for ApplicationStats type ApplicationStats struct { // The app's ID @@ -23,6 +28,8 @@ type ApplicationStats struct { MessageDestinations int32 `json:"messageDestinations"` } +type _ApplicationStats ApplicationStats + // NewApplicationStats instantiates a new ApplicationStats 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 @@ -55,7 +62,7 @@ func (o *ApplicationStats) GetAppId() string { // GetAppIdOk returns a tuple with the AppId field value // and a boolean to check if the value has been set. func (o *ApplicationStats) GetAppIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.AppId, true @@ -68,7 +75,7 @@ func (o *ApplicationStats) SetAppId(v string) { // GetAppUid returns the AppUid field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ApplicationStats) GetAppUid() string { - if o == nil || o.AppUid.Get() == nil { + if o == nil || IsNil(o.AppUid.Get()) { var ret string return ret } @@ -79,7 +86,7 @@ func (o *ApplicationStats) GetAppUid() string { // 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 *ApplicationStats) GetAppUidOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.AppUid.Get(), o.AppUid.IsSet() @@ -121,7 +128,7 @@ func (o *ApplicationStats) GetMessageDestinations() int32 { // GetMessageDestinationsOk returns a tuple with the MessageDestinations field value // and a boolean to check if the value has been set. func (o *ApplicationStats) GetMessageDestinationsOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return &o.MessageDestinations, true @@ -133,17 +140,59 @@ func (o *ApplicationStats) SetMessageDestinations(v int32) { } func (o ApplicationStats) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["appId"] = o.AppId + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o ApplicationStats) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["appId"] = o.AppId if o.AppUid.IsSet() { toSerialize["appUid"] = o.AppUid.Get() } - if true { - toSerialize["messageDestinations"] = o.MessageDestinations + toSerialize["messageDestinations"] = o.MessageDestinations + return toSerialize, nil +} + +func (o *ApplicationStats) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "appId", + "messageDestinations", } - return json.Marshal(toSerialize) + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varApplicationStats := _ApplicationStats{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varApplicationStats) + + if err != nil { + return err + } + + *o = ApplicationStats(varApplicationStats) + + return err } type NullableApplicationStats struct { diff --git a/go/internal/openapi/model_application_token_expire_in.go b/go/internal/openapi/model_application_token_expire_in.go index 48773329f..5d091ed0e 100644 --- a/go/internal/openapi/model_application_token_expire_in.go +++ b/go/internal/openapi/model_application_token_expire_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -14,6 +14,9 @@ import ( "encoding/json" ) +// checks if the ApplicationTokenExpireIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationTokenExpireIn{} + // ApplicationTokenExpireIn struct for ApplicationTokenExpireIn type ApplicationTokenExpireIn struct { // How many seconds until the old key is expired. @@ -39,7 +42,7 @@ func NewApplicationTokenExpireInWithDefaults() *ApplicationTokenExpireIn { // GetExpiry returns the Expiry field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ApplicationTokenExpireIn) GetExpiry() int64 { - if o == nil || o.Expiry.Get() == nil { + if o == nil || IsNil(o.Expiry.Get()) { var ret int64 return ret } @@ -50,7 +53,7 @@ func (o *ApplicationTokenExpireIn) GetExpiry() int64 { // 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 *ApplicationTokenExpireIn) GetExpiryOk() (*int64, bool) { - if o == nil { + if o == nil { return nil, false } return o.Expiry.Get(), o.Expiry.IsSet() @@ -80,11 +83,19 @@ func (o *ApplicationTokenExpireIn) UnsetExpiry() { } func (o ApplicationTokenExpireIn) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationTokenExpireIn) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if o.Expiry.IsSet() { toSerialize["expiry"] = o.Expiry.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableApplicationTokenExpireIn struct { diff --git a/go/internal/openapi/model_attempt_statistics_data.go b/go/internal/openapi/model_attempt_statistics_data.go index 8b49bf53a..3ee06bbef 100644 --- a/go/internal/openapi/model_attempt_statistics_data.go +++ b/go/internal/openapi/model_attempt_statistics_data.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -14,6 +14,9 @@ import ( "encoding/json" ) +// checks if the AttemptStatisticsData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AttemptStatisticsData{} + // AttemptStatisticsData struct for AttemptStatisticsData type AttemptStatisticsData struct { FailureCount []int32 `json:"failureCount,omitempty"` @@ -39,7 +42,7 @@ func NewAttemptStatisticsDataWithDefaults() *AttemptStatisticsData { // GetFailureCount returns the FailureCount field value if set, zero value otherwise (both if not set or set to explicit null). func (o *AttemptStatisticsData) GetFailureCount() []int32 { - if o == nil { + if o == nil { var ret []int32 return ret } @@ -49,16 +52,16 @@ func (o *AttemptStatisticsData) GetFailureCount() []int32 { // GetFailureCountOk returns a tuple with the FailureCount 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 *AttemptStatisticsData) GetFailureCountOk() (*[]int32, bool) { - if o == nil || o.FailureCount == nil { +func (o *AttemptStatisticsData) GetFailureCountOk() ([]int32, bool) { + if o == nil || IsNil(o.FailureCount) { return nil, false } - return &o.FailureCount, true + return o.FailureCount, true } // HasFailureCount returns a boolean if a field has been set. func (o *AttemptStatisticsData) HasFailureCount() bool { - if o != nil && o.FailureCount != nil { + if o != nil && IsNil(o.FailureCount) { return true } @@ -72,7 +75,7 @@ func (o *AttemptStatisticsData) SetFailureCount(v []int32) { // GetSuccessCount returns the SuccessCount field value if set, zero value otherwise (both if not set or set to explicit null). func (o *AttemptStatisticsData) GetSuccessCount() []int32 { - if o == nil { + if o == nil { var ret []int32 return ret } @@ -82,16 +85,16 @@ func (o *AttemptStatisticsData) GetSuccessCount() []int32 { // GetSuccessCountOk returns a tuple with the SuccessCount 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 *AttemptStatisticsData) GetSuccessCountOk() (*[]int32, bool) { - if o == nil || o.SuccessCount == nil { +func (o *AttemptStatisticsData) GetSuccessCountOk() ([]int32, bool) { + if o == nil || IsNil(o.SuccessCount) { return nil, false } - return &o.SuccessCount, true + return o.SuccessCount, true } // HasSuccessCount returns a boolean if a field has been set. func (o *AttemptStatisticsData) HasSuccessCount() bool { - if o != nil && o.SuccessCount != nil { + if o != nil && IsNil(o.SuccessCount) { return true } @@ -104,6 +107,14 @@ func (o *AttemptStatisticsData) SetSuccessCount(v []int32) { } func (o AttemptStatisticsData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AttemptStatisticsData) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if o.FailureCount != nil { toSerialize["failureCount"] = o.FailureCount @@ -111,7 +122,7 @@ func (o AttemptStatisticsData) MarshalJSON() ([]byte, error) { if o.SuccessCount != nil { toSerialize["successCount"] = o.SuccessCount } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableAttemptStatisticsData struct { diff --git a/go/internal/openapi/model_attempt_statistics_response.go b/go/internal/openapi/model_attempt_statistics_response.go index 5aa33184d..09af2db31 100644 --- a/go/internal/openapi/model_attempt_statistics_response.go +++ b/go/internal/openapi/model_attempt_statistics_response.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -13,8 +13,13 @@ package openapi import ( "encoding/json" "time" + "bytes" + "fmt" ) +// checks if the AttemptStatisticsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AttemptStatisticsResponse{} + // AttemptStatisticsResponse struct for AttemptStatisticsResponse type AttemptStatisticsResponse struct { Data AttemptStatisticsData `json:"data"` @@ -23,6 +28,8 @@ type AttemptStatisticsResponse struct { StartDate time.Time `json:"startDate"` } +type _AttemptStatisticsResponse AttemptStatisticsResponse + // NewAttemptStatisticsResponse instantiates a new AttemptStatisticsResponse 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 @@ -57,7 +64,7 @@ func (o *AttemptStatisticsResponse) GetData() AttemptStatisticsData { // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. func (o *AttemptStatisticsResponse) GetDataOk() (*AttemptStatisticsData, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Data, true @@ -81,7 +88,7 @@ func (o *AttemptStatisticsResponse) GetEndDate() time.Time { // GetEndDateOk returns a tuple with the EndDate field value // and a boolean to check if the value has been set. func (o *AttemptStatisticsResponse) GetEndDateOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.EndDate, true @@ -105,7 +112,7 @@ func (o *AttemptStatisticsResponse) GetPeriod() StatisticsPeriod { // GetPeriodOk returns a tuple with the Period field value // and a boolean to check if the value has been set. func (o *AttemptStatisticsResponse) GetPeriodOk() (*StatisticsPeriod, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Period, true @@ -129,7 +136,7 @@ func (o *AttemptStatisticsResponse) GetStartDate() time.Time { // GetStartDateOk returns a tuple with the StartDate field value // and a boolean to check if the value has been set. func (o *AttemptStatisticsResponse) GetStartDateOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.StartDate, true @@ -141,20 +148,60 @@ func (o *AttemptStatisticsResponse) SetStartDate(v time.Time) { } func (o AttemptStatisticsResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AttemptStatisticsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["data"] = o.Data + toSerialize["data"] = o.Data + toSerialize["endDate"] = o.EndDate + toSerialize["period"] = o.Period + toSerialize["startDate"] = o.StartDate + return toSerialize, nil +} + +func (o *AttemptStatisticsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + "endDate", + "period", + "startDate", } - if true { - toSerialize["endDate"] = o.EndDate + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["period"] = o.Period + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - if true { - toSerialize["startDate"] = o.StartDate + + varAttemptStatisticsResponse := _AttemptStatisticsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAttemptStatisticsResponse) + + if err != nil { + return err } - return json.Marshal(toSerialize) + + *o = AttemptStatisticsResponse(varAttemptStatisticsResponse) + + return err } type NullableAttemptStatisticsResponse struct { diff --git a/go/internal/openapi/model_background_task_out.go b/go/internal/openapi/model_background_task_out.go index 9c396293e..4640ec058 100644 --- a/go/internal/openapi/model_background_task_out.go +++ b/go/internal/openapi/model_background_task_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the BackgroundTaskOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackgroundTaskOut{} + // BackgroundTaskOut struct for BackgroundTaskOut type BackgroundTaskOut struct { Data map[string]interface{} `json:"data"` @@ -22,6 +27,8 @@ type BackgroundTaskOut struct { Task BackgroundTaskType `json:"task"` } +type _BackgroundTaskOut BackgroundTaskOut + // NewBackgroundTaskOut instantiates a new BackgroundTaskOut 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 @@ -55,11 +62,11 @@ func (o *BackgroundTaskOut) GetData() map[string]interface{} { // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. -func (o *BackgroundTaskOut) GetDataOk() (*map[string]interface{}, bool) { - if o == nil { - return nil, false +func (o *BackgroundTaskOut) GetDataOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false } - return &o.Data, true + return o.Data, true } // SetData sets field value @@ -80,7 +87,7 @@ func (o *BackgroundTaskOut) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *BackgroundTaskOut) GetIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Id, true @@ -104,7 +111,7 @@ func (o *BackgroundTaskOut) GetStatus() BackgroundTaskStatus { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. func (o *BackgroundTaskOut) GetStatusOk() (*BackgroundTaskStatus, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Status, true @@ -128,7 +135,7 @@ func (o *BackgroundTaskOut) GetTask() BackgroundTaskType { // GetTaskOk returns a tuple with the Task field value // and a boolean to check if the value has been set. func (o *BackgroundTaskOut) GetTaskOk() (*BackgroundTaskType, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Task, true @@ -140,20 +147,60 @@ func (o *BackgroundTaskOut) SetTask(v BackgroundTaskType) { } func (o BackgroundTaskOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BackgroundTaskOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["data"] = o.Data + toSerialize["data"] = o.Data + toSerialize["id"] = o.Id + toSerialize["status"] = o.Status + toSerialize["task"] = o.Task + return toSerialize, nil +} + +func (o *BackgroundTaskOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + "id", + "status", + "task", } - if true { - toSerialize["id"] = o.Id + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["status"] = o.Status + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - if true { - toSerialize["task"] = o.Task + + varBackgroundTaskOut := _BackgroundTaskOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBackgroundTaskOut) + + if err != nil { + return err } - return json.Marshal(toSerialize) + + *o = BackgroundTaskOut(varBackgroundTaskOut) + + return err } type NullableBackgroundTaskOut struct { diff --git a/go/internal/openapi/model_background_task_status.go b/go/internal/openapi/model_background_task_status.go index 36f77e5dc..7002fdf43 100644 --- a/go/internal/openapi/model_background_task_status.go +++ b/go/internal/openapi/model_background_task_status.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -25,7 +25,8 @@ const ( BACKGROUNDTASKSTATUS_FAILED BackgroundTaskStatus = "failed" ) -var allowedBackgroundTaskStatusEnumValues = []BackgroundTaskStatus{ +// All allowed values of BackgroundTaskStatus enum +var AllowedBackgroundTaskStatusEnumValues = []BackgroundTaskStatus{ "running", "finished", "failed", @@ -38,7 +39,7 @@ func (v *BackgroundTaskStatus) UnmarshalJSON(src []byte) error { return err } enumTypeValue := BackgroundTaskStatus(value) - for _, existing := range allowedBackgroundTaskStatusEnumValues { + for _, existing := range AllowedBackgroundTaskStatusEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -55,13 +56,13 @@ func NewBackgroundTaskStatusFromValue(v string) (*BackgroundTaskStatus, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for BackgroundTaskStatus: valid values are %v", v, allowedBackgroundTaskStatusEnumValues) + return nil, fmt.Errorf("invalid value '%v' for BackgroundTaskStatus: valid values are %v", v, AllowedBackgroundTaskStatusEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v BackgroundTaskStatus) IsValid() bool { - for _, existing := range allowedBackgroundTaskStatusEnumValues { + for _, existing := range AllowedBackgroundTaskStatusEnumValues { if existing == v { return true } diff --git a/go/internal/openapi/model_background_task_type.go b/go/internal/openapi/model_background_task_type.go index 32504c50a..6d50f4626 100644 --- a/go/internal/openapi/model_background_task_type.go +++ b/go/internal/openapi/model_background_task_type.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -28,7 +28,8 @@ const ( BACKGROUNDTASKTYPE_EVENT_TYPE_AGGREGATE BackgroundTaskType = "event-type.aggregate" ) -var allowedBackgroundTaskTypeEnumValues = []BackgroundTaskType{ +// All allowed values of BackgroundTaskType enum +var AllowedBackgroundTaskTypeEnumValues = []BackgroundTaskType{ "endpoint.replay", "endpoint.recover", "application.stats", @@ -44,7 +45,7 @@ func (v *BackgroundTaskType) UnmarshalJSON(src []byte) error { return err } enumTypeValue := BackgroundTaskType(value) - for _, existing := range allowedBackgroundTaskTypeEnumValues { + for _, existing := range AllowedBackgroundTaskTypeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -61,13 +62,13 @@ func NewBackgroundTaskTypeFromValue(v string) (*BackgroundTaskType, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for BackgroundTaskType: valid values are %v", v, allowedBackgroundTaskTypeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for BackgroundTaskType: valid values are %v", v, AllowedBackgroundTaskTypeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v BackgroundTaskType) IsValid() bool { - for _, existing := range allowedBackgroundTaskTypeEnumValues { + for _, existing := range AllowedBackgroundTaskTypeEnumValues { if existing == v { return true } diff --git a/go/internal/openapi/model_border_radius_config.go b/go/internal/openapi/model_border_radius_config.go index cbba5f50c..f3469c9c6 100644 --- a/go/internal/openapi/model_border_radius_config.go +++ b/go/internal/openapi/model_border_radius_config.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -14,6 +14,9 @@ import ( "encoding/json" ) +// checks if the BorderRadiusConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BorderRadiusConfig{} + // BorderRadiusConfig struct for BorderRadiusConfig type BorderRadiusConfig struct { Button *BorderRadiusEnum `json:"button,omitempty"` @@ -40,7 +43,7 @@ func NewBorderRadiusConfigWithDefaults() *BorderRadiusConfig { // GetButton returns the Button field value if set, zero value otherwise. func (o *BorderRadiusConfig) GetButton() BorderRadiusEnum { - if o == nil || o.Button == nil { + if o == nil || IsNil(o.Button) { var ret BorderRadiusEnum return ret } @@ -50,7 +53,7 @@ func (o *BorderRadiusConfig) GetButton() BorderRadiusEnum { // GetButtonOk returns a tuple with the Button field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *BorderRadiusConfig) GetButtonOk() (*BorderRadiusEnum, bool) { - if o == nil || o.Button == nil { + if o == nil || IsNil(o.Button) { return nil, false } return o.Button, true @@ -58,7 +61,7 @@ func (o *BorderRadiusConfig) GetButtonOk() (*BorderRadiusEnum, bool) { // HasButton returns a boolean if a field has been set. func (o *BorderRadiusConfig) HasButton() bool { - if o != nil && o.Button != nil { + if o != nil && !IsNil(o.Button) { return true } @@ -72,7 +75,7 @@ func (o *BorderRadiusConfig) SetButton(v BorderRadiusEnum) { // GetCard returns the Card field value if set, zero value otherwise. func (o *BorderRadiusConfig) GetCard() BorderRadiusEnum { - if o == nil || o.Card == nil { + if o == nil || IsNil(o.Card) { var ret BorderRadiusEnum return ret } @@ -82,7 +85,7 @@ func (o *BorderRadiusConfig) GetCard() BorderRadiusEnum { // GetCardOk returns a tuple with the Card field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *BorderRadiusConfig) GetCardOk() (*BorderRadiusEnum, bool) { - if o == nil || o.Card == nil { + if o == nil || IsNil(o.Card) { return nil, false } return o.Card, true @@ -90,7 +93,7 @@ func (o *BorderRadiusConfig) GetCardOk() (*BorderRadiusEnum, bool) { // HasCard returns a boolean if a field has been set. func (o *BorderRadiusConfig) HasCard() bool { - if o != nil && o.Card != nil { + if o != nil && !IsNil(o.Card) { return true } @@ -104,7 +107,7 @@ func (o *BorderRadiusConfig) SetCard(v BorderRadiusEnum) { // GetInput returns the Input field value if set, zero value otherwise. func (o *BorderRadiusConfig) GetInput() BorderRadiusEnum { - if o == nil || o.Input == nil { + if o == nil || IsNil(o.Input) { var ret BorderRadiusEnum return ret } @@ -114,7 +117,7 @@ func (o *BorderRadiusConfig) GetInput() BorderRadiusEnum { // GetInputOk returns a tuple with the Input field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *BorderRadiusConfig) GetInputOk() (*BorderRadiusEnum, bool) { - if o == nil || o.Input == nil { + if o == nil || IsNil(o.Input) { return nil, false } return o.Input, true @@ -122,7 +125,7 @@ func (o *BorderRadiusConfig) GetInputOk() (*BorderRadiusEnum, bool) { // HasInput returns a boolean if a field has been set. func (o *BorderRadiusConfig) HasInput() bool { - if o != nil && o.Input != nil { + if o != nil && !IsNil(o.Input) { return true } @@ -135,17 +138,25 @@ func (o *BorderRadiusConfig) SetInput(v BorderRadiusEnum) { } func (o BorderRadiusConfig) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BorderRadiusConfig) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Button != nil { + if !IsNil(o.Button) { toSerialize["button"] = o.Button } - if o.Card != nil { + if !IsNil(o.Card) { toSerialize["card"] = o.Card } - if o.Input != nil { + if !IsNil(o.Input) { toSerialize["input"] = o.Input } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableBorderRadiusConfig struct { diff --git a/go/internal/openapi/model_border_radius_enum.go b/go/internal/openapi/model_border_radius_enum.go index 6a9bc7474..99080a34e 100644 --- a/go/internal/openapi/model_border_radius_enum.go +++ b/go/internal/openapi/model_border_radius_enum.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -27,7 +27,8 @@ const ( BORDERRADIUSENUM_FULL BorderRadiusEnum = "full" ) -var allowedBorderRadiusEnumEnumValues = []BorderRadiusEnum{ +// All allowed values of BorderRadiusEnum enum +var AllowedBorderRadiusEnumEnumValues = []BorderRadiusEnum{ "none", "lg", "md", @@ -42,7 +43,7 @@ func (v *BorderRadiusEnum) UnmarshalJSON(src []byte) error { return err } enumTypeValue := BorderRadiusEnum(value) - for _, existing := range allowedBorderRadiusEnumEnumValues { + for _, existing := range AllowedBorderRadiusEnumEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -59,13 +60,13 @@ func NewBorderRadiusEnumFromValue(v string) (*BorderRadiusEnum, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for BorderRadiusEnum: valid values are %v", v, allowedBorderRadiusEnumEnumValues) + return nil, fmt.Errorf("invalid value '%v' for BorderRadiusEnum: valid values are %v", v, AllowedBorderRadiusEnumEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v BorderRadiusEnum) IsValid() bool { - for _, existing := range allowedBorderRadiusEnumEnumValues { + for _, existing := range AllowedBorderRadiusEnumEnumValues { if existing == v { return true } diff --git a/go/internal/openapi/model_completion_choice.go b/go/internal/openapi/model_completion_choice.go index a372473da..c19ffe6d0 100644 --- a/go/internal/openapi/model_completion_choice.go +++ b/go/internal/openapi/model_completion_choice.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the CompletionChoice type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CompletionChoice{} + // CompletionChoice struct for CompletionChoice type CompletionChoice struct { FinishReason string `json:"finish_reason"` @@ -21,6 +26,8 @@ type CompletionChoice struct { Message CompletionMessage `json:"message"` } +type _CompletionChoice CompletionChoice + // 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 @@ -54,7 +61,7 @@ func (o *CompletionChoice) GetFinishReason() string { // 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 { + if o == nil { return nil, false } return &o.FinishReason, true @@ -78,7 +85,7 @@ func (o *CompletionChoice) GetIndex() int64 { // 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 { + if o == nil { return nil, false } return &o.Index, true @@ -102,7 +109,7 @@ func (o *CompletionChoice) GetMessage() CompletionMessage { // 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 { + if o == nil { return nil, false } return &o.Message, true @@ -114,17 +121,58 @@ func (o *CompletionChoice) SetMessage(v CompletionMessage) { } func (o CompletionChoice) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CompletionChoice) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["finish_reason"] = o.FinishReason + toSerialize["finish_reason"] = o.FinishReason + toSerialize["index"] = o.Index + toSerialize["message"] = o.Message + return toSerialize, nil +} + +func (o *CompletionChoice) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "finish_reason", + "index", + "message", } - if true { - toSerialize["index"] = o.Index + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["message"] = o.Message + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varCompletionChoice := _CompletionChoice{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCompletionChoice) + + if err != nil { + return err + } + + *o = CompletionChoice(varCompletionChoice) + + return err } type NullableCompletionChoice struct { diff --git a/go/internal/openapi/model_completion_message.go b/go/internal/openapi/model_completion_message.go index 37267257e..6fcb1fd6e 100644 --- a/go/internal/openapi/model_completion_message.go +++ b/go/internal/openapi/model_completion_message.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,14 +12,21 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the CompletionMessage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CompletionMessage{} + // CompletionMessage struct for CompletionMessage type CompletionMessage struct { Content string `json:"content"` Role string `json:"role"` } +type _CompletionMessage CompletionMessage + // 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 @@ -52,7 +59,7 @@ func (o *CompletionMessage) GetContent() string { // 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 { + if o == nil { return nil, false } return &o.Content, true @@ -76,7 +83,7 @@ func (o *CompletionMessage) GetRole() string { // 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 { + if o == nil { return nil, false } return &o.Role, true @@ -88,14 +95,56 @@ func (o *CompletionMessage) SetRole(v string) { } func (o CompletionMessage) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CompletionMessage) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["content"] = o.Content + toSerialize["content"] = o.Content + toSerialize["role"] = o.Role + return toSerialize, nil +} + +func (o *CompletionMessage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "content", + "role", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["role"] = o.Role + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varCompletionMessage := _CompletionMessage{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCompletionMessage) + + if err != nil { + return err + } + + *o = CompletionMessage(varCompletionMessage) + + return err } type NullableCompletionMessage struct { diff --git a/go/internal/openapi/model_custom_color_palette.go b/go/internal/openapi/model_custom_color_palette.go index a256bb9ae..8a27fc5f6 100644 --- a/go/internal/openapi/model_custom_color_palette.go +++ b/go/internal/openapi/model_custom_color_palette.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -14,6 +14,9 @@ import ( "encoding/json" ) +// checks if the CustomColorPalette type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CustomColorPalette{} + // CustomColorPalette struct for CustomColorPalette type CustomColorPalette struct { BackgroundHover *string `json:"backgroundHover,omitempty"` @@ -46,7 +49,7 @@ func NewCustomColorPaletteWithDefaults() *CustomColorPalette { // GetBackgroundHover returns the BackgroundHover field value if set, zero value otherwise. func (o *CustomColorPalette) GetBackgroundHover() string { - if o == nil || o.BackgroundHover == nil { + if o == nil || IsNil(o.BackgroundHover) { var ret string return ret } @@ -56,7 +59,7 @@ func (o *CustomColorPalette) GetBackgroundHover() string { // GetBackgroundHoverOk returns a tuple with the BackgroundHover field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CustomColorPalette) GetBackgroundHoverOk() (*string, bool) { - if o == nil || o.BackgroundHover == nil { + if o == nil || IsNil(o.BackgroundHover) { return nil, false } return o.BackgroundHover, true @@ -64,7 +67,7 @@ func (o *CustomColorPalette) GetBackgroundHoverOk() (*string, bool) { // HasBackgroundHover returns a boolean if a field has been set. func (o *CustomColorPalette) HasBackgroundHover() bool { - if o != nil && o.BackgroundHover != nil { + if o != nil && !IsNil(o.BackgroundHover) { return true } @@ -78,7 +81,7 @@ func (o *CustomColorPalette) SetBackgroundHover(v string) { // GetBackgroundPrimary returns the BackgroundPrimary field value if set, zero value otherwise. func (o *CustomColorPalette) GetBackgroundPrimary() string { - if o == nil || o.BackgroundPrimary == nil { + if o == nil || IsNil(o.BackgroundPrimary) { var ret string return ret } @@ -88,7 +91,7 @@ func (o *CustomColorPalette) GetBackgroundPrimary() string { // GetBackgroundPrimaryOk returns a tuple with the BackgroundPrimary field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CustomColorPalette) GetBackgroundPrimaryOk() (*string, bool) { - if o == nil || o.BackgroundPrimary == nil { + if o == nil || IsNil(o.BackgroundPrimary) { return nil, false } return o.BackgroundPrimary, true @@ -96,7 +99,7 @@ func (o *CustomColorPalette) GetBackgroundPrimaryOk() (*string, bool) { // HasBackgroundPrimary returns a boolean if a field has been set. func (o *CustomColorPalette) HasBackgroundPrimary() bool { - if o != nil && o.BackgroundPrimary != nil { + if o != nil && !IsNil(o.BackgroundPrimary) { return true } @@ -110,7 +113,7 @@ func (o *CustomColorPalette) SetBackgroundPrimary(v string) { // GetBackgroundSecondary returns the BackgroundSecondary field value if set, zero value otherwise. func (o *CustomColorPalette) GetBackgroundSecondary() string { - if o == nil || o.BackgroundSecondary == nil { + if o == nil || IsNil(o.BackgroundSecondary) { var ret string return ret } @@ -120,7 +123,7 @@ func (o *CustomColorPalette) GetBackgroundSecondary() string { // GetBackgroundSecondaryOk returns a tuple with the BackgroundSecondary field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CustomColorPalette) GetBackgroundSecondaryOk() (*string, bool) { - if o == nil || o.BackgroundSecondary == nil { + if o == nil || IsNil(o.BackgroundSecondary) { return nil, false } return o.BackgroundSecondary, true @@ -128,7 +131,7 @@ func (o *CustomColorPalette) GetBackgroundSecondaryOk() (*string, bool) { // HasBackgroundSecondary returns a boolean if a field has been set. func (o *CustomColorPalette) HasBackgroundSecondary() bool { - if o != nil && o.BackgroundSecondary != nil { + if o != nil && !IsNil(o.BackgroundSecondary) { return true } @@ -142,7 +145,7 @@ func (o *CustomColorPalette) SetBackgroundSecondary(v string) { // GetButtonPrimary returns the ButtonPrimary field value if set, zero value otherwise. func (o *CustomColorPalette) GetButtonPrimary() string { - if o == nil || o.ButtonPrimary == nil { + if o == nil || IsNil(o.ButtonPrimary) { var ret string return ret } @@ -152,7 +155,7 @@ func (o *CustomColorPalette) GetButtonPrimary() string { // GetButtonPrimaryOk returns a tuple with the ButtonPrimary field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CustomColorPalette) GetButtonPrimaryOk() (*string, bool) { - if o == nil || o.ButtonPrimary == nil { + if o == nil || IsNil(o.ButtonPrimary) { return nil, false } return o.ButtonPrimary, true @@ -160,7 +163,7 @@ func (o *CustomColorPalette) GetButtonPrimaryOk() (*string, bool) { // HasButtonPrimary returns a boolean if a field has been set. func (o *CustomColorPalette) HasButtonPrimary() bool { - if o != nil && o.ButtonPrimary != nil { + if o != nil && !IsNil(o.ButtonPrimary) { return true } @@ -174,7 +177,7 @@ func (o *CustomColorPalette) SetButtonPrimary(v string) { // GetInteractiveAccent returns the InteractiveAccent field value if set, zero value otherwise. func (o *CustomColorPalette) GetInteractiveAccent() string { - if o == nil || o.InteractiveAccent == nil { + if o == nil || IsNil(o.InteractiveAccent) { var ret string return ret } @@ -184,7 +187,7 @@ func (o *CustomColorPalette) GetInteractiveAccent() string { // GetInteractiveAccentOk returns a tuple with the InteractiveAccent field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CustomColorPalette) GetInteractiveAccentOk() (*string, bool) { - if o == nil || o.InteractiveAccent == nil { + if o == nil || IsNil(o.InteractiveAccent) { return nil, false } return o.InteractiveAccent, true @@ -192,7 +195,7 @@ func (o *CustomColorPalette) GetInteractiveAccentOk() (*string, bool) { // HasInteractiveAccent returns a boolean if a field has been set. func (o *CustomColorPalette) HasInteractiveAccent() bool { - if o != nil && o.InteractiveAccent != nil { + if o != nil && !IsNil(o.InteractiveAccent) { return true } @@ -206,7 +209,7 @@ func (o *CustomColorPalette) SetInteractiveAccent(v string) { // GetNavigationAccent returns the NavigationAccent field value if set, zero value otherwise. func (o *CustomColorPalette) GetNavigationAccent() string { - if o == nil || o.NavigationAccent == nil { + if o == nil || IsNil(o.NavigationAccent) { var ret string return ret } @@ -216,7 +219,7 @@ func (o *CustomColorPalette) GetNavigationAccent() string { // GetNavigationAccentOk returns a tuple with the NavigationAccent field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CustomColorPalette) GetNavigationAccentOk() (*string, bool) { - if o == nil || o.NavigationAccent == nil { + if o == nil || IsNil(o.NavigationAccent) { return nil, false } return o.NavigationAccent, true @@ -224,7 +227,7 @@ func (o *CustomColorPalette) GetNavigationAccentOk() (*string, bool) { // HasNavigationAccent returns a boolean if a field has been set. func (o *CustomColorPalette) HasNavigationAccent() bool { - if o != nil && o.NavigationAccent != nil { + if o != nil && !IsNil(o.NavigationAccent) { return true } @@ -238,7 +241,7 @@ func (o *CustomColorPalette) SetNavigationAccent(v string) { // GetPrimary returns the Primary field value if set, zero value otherwise. func (o *CustomColorPalette) GetPrimary() string { - if o == nil || o.Primary == nil { + if o == nil || IsNil(o.Primary) { var ret string return ret } @@ -248,7 +251,7 @@ func (o *CustomColorPalette) GetPrimary() string { // 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 { + if o == nil || IsNil(o.Primary) { return nil, false } return o.Primary, true @@ -256,7 +259,7 @@ func (o *CustomColorPalette) GetPrimaryOk() (*string, bool) { // HasPrimary returns a boolean if a field has been set. func (o *CustomColorPalette) HasPrimary() bool { - if o != nil && o.Primary != nil { + if o != nil && !IsNil(o.Primary) { return true } @@ -270,7 +273,7 @@ func (o *CustomColorPalette) SetPrimary(v string) { // GetTextDanger returns the TextDanger field value if set, zero value otherwise. func (o *CustomColorPalette) GetTextDanger() string { - if o == nil || o.TextDanger == nil { + if o == nil || IsNil(o.TextDanger) { var ret string return ret } @@ -280,7 +283,7 @@ func (o *CustomColorPalette) GetTextDanger() string { // GetTextDangerOk returns a tuple with the TextDanger field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CustomColorPalette) GetTextDangerOk() (*string, bool) { - if o == nil || o.TextDanger == nil { + if o == nil || IsNil(o.TextDanger) { return nil, false } return o.TextDanger, true @@ -288,7 +291,7 @@ func (o *CustomColorPalette) GetTextDangerOk() (*string, bool) { // HasTextDanger returns a boolean if a field has been set. func (o *CustomColorPalette) HasTextDanger() bool { - if o != nil && o.TextDanger != nil { + if o != nil && !IsNil(o.TextDanger) { return true } @@ -302,7 +305,7 @@ func (o *CustomColorPalette) SetTextDanger(v string) { // GetTextPrimary returns the TextPrimary field value if set, zero value otherwise. func (o *CustomColorPalette) GetTextPrimary() string { - if o == nil || o.TextPrimary == nil { + if o == nil || IsNil(o.TextPrimary) { var ret string return ret } @@ -312,7 +315,7 @@ func (o *CustomColorPalette) GetTextPrimary() string { // GetTextPrimaryOk returns a tuple with the TextPrimary field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CustomColorPalette) GetTextPrimaryOk() (*string, bool) { - if o == nil || o.TextPrimary == nil { + if o == nil || IsNil(o.TextPrimary) { return nil, false } return o.TextPrimary, true @@ -320,7 +323,7 @@ func (o *CustomColorPalette) GetTextPrimaryOk() (*string, bool) { // HasTextPrimary returns a boolean if a field has been set. func (o *CustomColorPalette) HasTextPrimary() bool { - if o != nil && o.TextPrimary != nil { + if o != nil && !IsNil(o.TextPrimary) { return true } @@ -333,35 +336,43 @@ func (o *CustomColorPalette) SetTextPrimary(v string) { } func (o CustomColorPalette) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CustomColorPalette) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.BackgroundHover != nil { + if !IsNil(o.BackgroundHover) { toSerialize["backgroundHover"] = o.BackgroundHover } - if o.BackgroundPrimary != nil { + if !IsNil(o.BackgroundPrimary) { toSerialize["backgroundPrimary"] = o.BackgroundPrimary } - if o.BackgroundSecondary != nil { + if !IsNil(o.BackgroundSecondary) { toSerialize["backgroundSecondary"] = o.BackgroundSecondary } - if o.ButtonPrimary != nil { + if !IsNil(o.ButtonPrimary) { toSerialize["buttonPrimary"] = o.ButtonPrimary } - if o.InteractiveAccent != nil { + if !IsNil(o.InteractiveAccent) { toSerialize["interactiveAccent"] = o.InteractiveAccent } - if o.NavigationAccent != nil { + if !IsNil(o.NavigationAccent) { toSerialize["navigationAccent"] = o.NavigationAccent } - if o.Primary != nil { + if !IsNil(o.Primary) { toSerialize["primary"] = o.Primary } - if o.TextDanger != nil { + if !IsNil(o.TextDanger) { toSerialize["textDanger"] = o.TextDanger } - if o.TextPrimary != nil { + if !IsNil(o.TextPrimary) { toSerialize["textPrimary"] = o.TextPrimary } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableCustomColorPalette struct { diff --git a/go/internal/openapi/model_custom_theme_override.go b/go/internal/openapi/model_custom_theme_override.go index b6646e865..e1d1a97fd 100644 --- a/go/internal/openapi/model_custom_theme_override.go +++ b/go/internal/openapi/model_custom_theme_override.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -14,6 +14,9 @@ import ( "encoding/json" ) +// checks if the CustomThemeOverride type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CustomThemeOverride{} + // CustomThemeOverride struct for CustomThemeOverride type CustomThemeOverride struct { BorderRadius *BorderRadiusConfig `json:"borderRadius,omitempty"` @@ -39,7 +42,7 @@ func NewCustomThemeOverrideWithDefaults() *CustomThemeOverride { // GetBorderRadius returns the BorderRadius field value if set, zero value otherwise. func (o *CustomThemeOverride) GetBorderRadius() BorderRadiusConfig { - if o == nil || o.BorderRadius == nil { + if o == nil || IsNil(o.BorderRadius) { var ret BorderRadiusConfig return ret } @@ -49,7 +52,7 @@ func (o *CustomThemeOverride) GetBorderRadius() BorderRadiusConfig { // GetBorderRadiusOk returns a tuple with the BorderRadius field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CustomThemeOverride) GetBorderRadiusOk() (*BorderRadiusConfig, bool) { - if o == nil || o.BorderRadius == nil { + if o == nil || IsNil(o.BorderRadius) { return nil, false } return o.BorderRadius, true @@ -57,7 +60,7 @@ func (o *CustomThemeOverride) GetBorderRadiusOk() (*BorderRadiusConfig, bool) { // HasBorderRadius returns a boolean if a field has been set. func (o *CustomThemeOverride) HasBorderRadius() bool { - if o != nil && o.BorderRadius != nil { + if o != nil && !IsNil(o.BorderRadius) { return true } @@ -71,7 +74,7 @@ func (o *CustomThemeOverride) SetBorderRadius(v BorderRadiusConfig) { // GetFontSize returns the FontSize field value if set, zero value otherwise. func (o *CustomThemeOverride) GetFontSize() FontSizeConfig { - if o == nil || o.FontSize == nil { + if o == nil || IsNil(o.FontSize) { var ret FontSizeConfig return ret } @@ -81,7 +84,7 @@ func (o *CustomThemeOverride) GetFontSize() FontSizeConfig { // GetFontSizeOk returns a tuple with the FontSize field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CustomThemeOverride) GetFontSizeOk() (*FontSizeConfig, bool) { - if o == nil || o.FontSize == nil { + if o == nil || IsNil(o.FontSize) { return nil, false } return o.FontSize, true @@ -89,7 +92,7 @@ func (o *CustomThemeOverride) GetFontSizeOk() (*FontSizeConfig, bool) { // HasFontSize returns a boolean if a field has been set. func (o *CustomThemeOverride) HasFontSize() bool { - if o != nil && o.FontSize != nil { + if o != nil && !IsNil(o.FontSize) { return true } @@ -102,14 +105,22 @@ func (o *CustomThemeOverride) SetFontSize(v FontSizeConfig) { } func (o CustomThemeOverride) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CustomThemeOverride) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.BorderRadius != nil { + if !IsNil(o.BorderRadius) { toSerialize["borderRadius"] = o.BorderRadius } - if o.FontSize != nil { + if !IsNil(o.FontSize) { toSerialize["fontSize"] = o.FontSize } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableCustomThemeOverride struct { diff --git a/go/internal/openapi/model_dashboard_access_out.go b/go/internal/openapi/model_dashboard_access_out.go index e8a95ce5e..9d3a6dc8f 100644 --- a/go/internal/openapi/model_dashboard_access_out.go +++ b/go/internal/openapi/model_dashboard_access_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,14 +12,21 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the DashboardAccessOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DashboardAccessOut{} + // DashboardAccessOut struct for DashboardAccessOut type DashboardAccessOut struct { Token string `json:"token"` Url string `json:"url"` } +type _DashboardAccessOut DashboardAccessOut + // NewDashboardAccessOut instantiates a new DashboardAccessOut 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 @@ -52,7 +59,7 @@ func (o *DashboardAccessOut) GetToken() string { // GetTokenOk returns a tuple with the Token field value // and a boolean to check if the value has been set. func (o *DashboardAccessOut) GetTokenOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Token, true @@ -76,7 +83,7 @@ func (o *DashboardAccessOut) GetUrl() string { // GetUrlOk returns a tuple with the Url field value // and a boolean to check if the value has been set. func (o *DashboardAccessOut) GetUrlOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Url, true @@ -88,14 +95,56 @@ func (o *DashboardAccessOut) SetUrl(v string) { } func (o DashboardAccessOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DashboardAccessOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["token"] = o.Token + toSerialize["token"] = o.Token + toSerialize["url"] = o.Url + return toSerialize, nil +} + +func (o *DashboardAccessOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "token", + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["url"] = o.Url + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varDashboardAccessOut := _DashboardAccessOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDashboardAccessOut) + + if err != nil { + return err + } + + *o = DashboardAccessOut(varDashboardAccessOut) + + return err } type NullableDashboardAccessOut struct { diff --git a/go/internal/openapi/model_endpoint_created_event.go b/go/internal/openapi/model_endpoint_created_event.go index fbe7ba491..9a44ffeab 100644 --- a/go/internal/openapi/model_endpoint_created_event.go +++ b/go/internal/openapi/model_endpoint_created_event.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,14 +12,21 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the EndpointCreatedEvent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointCreatedEvent{} + // EndpointCreatedEvent Sent when an endpoint is created. type EndpointCreatedEvent struct { Data EndpointCreatedEventData `json:"data"` Type string `json:"type"` } +type _EndpointCreatedEvent EndpointCreatedEvent + // NewEndpointCreatedEvent instantiates a new EndpointCreatedEvent 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 @@ -54,7 +61,7 @@ func (o *EndpointCreatedEvent) GetData() EndpointCreatedEventData { // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. func (o *EndpointCreatedEvent) GetDataOk() (*EndpointCreatedEventData, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Data, true @@ -78,7 +85,7 @@ func (o *EndpointCreatedEvent) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *EndpointCreatedEvent) GetTypeOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Type, true @@ -90,14 +97,56 @@ func (o *EndpointCreatedEvent) SetType(v string) { } func (o EndpointCreatedEvent) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointCreatedEvent) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["data"] = o.Data + toSerialize["data"] = o.Data + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *EndpointCreatedEvent) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["type"] = o.Type + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varEndpointCreatedEvent := _EndpointCreatedEvent{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEndpointCreatedEvent) + + if err != nil { + return err + } + + *o = EndpointCreatedEvent(varEndpointCreatedEvent) + + return err } type NullableEndpointCreatedEvent struct { diff --git a/go/internal/openapi/model_endpoint_created_event_data.go b/go/internal/openapi/model_endpoint_created_event_data.go index c136e5074..6b372698e 100644 --- a/go/internal/openapi/model_endpoint_created_event_data.go +++ b/go/internal/openapi/model_endpoint_created_event_data.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the EndpointCreatedEventData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointCreatedEventData{} + // EndpointCreatedEventData struct for EndpointCreatedEventData type EndpointCreatedEventData struct { // The app's ID @@ -26,6 +31,8 @@ type EndpointCreatedEventData struct { EndpointUid NullableString `json:"endpointUid,omitempty"` } +type _EndpointCreatedEventData EndpointCreatedEventData + // NewEndpointCreatedEventData instantiates a new EndpointCreatedEventData 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 @@ -58,7 +65,7 @@ func (o *EndpointCreatedEventData) GetAppId() string { // GetAppIdOk returns a tuple with the AppId field value // and a boolean to check if the value has been set. func (o *EndpointCreatedEventData) GetAppIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.AppId, true @@ -71,7 +78,7 @@ func (o *EndpointCreatedEventData) SetAppId(v string) { // GetAppUid returns the AppUid field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointCreatedEventData) GetAppUid() string { - if o == nil || o.AppUid.Get() == nil { + if o == nil || IsNil(o.AppUid.Get()) { var ret string return ret } @@ -82,7 +89,7 @@ func (o *EndpointCreatedEventData) GetAppUid() string { // 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 *EndpointCreatedEventData) GetAppUidOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.AppUid.Get(), o.AppUid.IsSet() @@ -124,7 +131,7 @@ func (o *EndpointCreatedEventData) GetEndpointId() string { // GetEndpointIdOk returns a tuple with the EndpointId field value // and a boolean to check if the value has been set. func (o *EndpointCreatedEventData) GetEndpointIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.EndpointId, true @@ -137,7 +144,7 @@ func (o *EndpointCreatedEventData) SetEndpointId(v string) { // GetEndpointUid returns the EndpointUid field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointCreatedEventData) GetEndpointUid() string { - if o == nil || o.EndpointUid.Get() == nil { + if o == nil || IsNil(o.EndpointUid.Get()) { var ret string return ret } @@ -148,7 +155,7 @@ func (o *EndpointCreatedEventData) GetEndpointUid() string { // 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 *EndpointCreatedEventData) GetEndpointUidOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.EndpointUid.Get(), o.EndpointUid.IsSet() @@ -178,20 +185,62 @@ func (o *EndpointCreatedEventData) UnsetEndpointUid() { } func (o EndpointCreatedEventData) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["appId"] = o.AppId + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o EndpointCreatedEventData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["appId"] = o.AppId if o.AppUid.IsSet() { toSerialize["appUid"] = o.AppUid.Get() } - if true { - toSerialize["endpointId"] = o.EndpointId - } + toSerialize["endpointId"] = o.EndpointId if o.EndpointUid.IsSet() { toSerialize["endpointUid"] = o.EndpointUid.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *EndpointCreatedEventData) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "appId", + "endpointId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEndpointCreatedEventData := _EndpointCreatedEventData{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEndpointCreatedEventData) + + if err != nil { + return err + } + + *o = EndpointCreatedEventData(varEndpointCreatedEventData) + + return err } type NullableEndpointCreatedEventData struct { diff --git a/go/internal/openapi/model_endpoint_deleted_event.go b/go/internal/openapi/model_endpoint_deleted_event.go index 205b40f3c..d1523e02a 100644 --- a/go/internal/openapi/model_endpoint_deleted_event.go +++ b/go/internal/openapi/model_endpoint_deleted_event.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,14 +12,21 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the EndpointDeletedEvent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointDeletedEvent{} + // EndpointDeletedEvent Sent when an endpoint is deleted. type EndpointDeletedEvent struct { Data EndpointDeletedEventData `json:"data"` Type string `json:"type"` } +type _EndpointDeletedEvent EndpointDeletedEvent + // NewEndpointDeletedEvent instantiates a new EndpointDeletedEvent 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 @@ -54,7 +61,7 @@ func (o *EndpointDeletedEvent) GetData() EndpointDeletedEventData { // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. func (o *EndpointDeletedEvent) GetDataOk() (*EndpointDeletedEventData, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Data, true @@ -78,7 +85,7 @@ func (o *EndpointDeletedEvent) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *EndpointDeletedEvent) GetTypeOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Type, true @@ -90,14 +97,56 @@ func (o *EndpointDeletedEvent) SetType(v string) { } func (o EndpointDeletedEvent) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointDeletedEvent) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["data"] = o.Data + toSerialize["data"] = o.Data + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *EndpointDeletedEvent) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["type"] = o.Type + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varEndpointDeletedEvent := _EndpointDeletedEvent{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEndpointDeletedEvent) + + if err != nil { + return err + } + + *o = EndpointDeletedEvent(varEndpointDeletedEvent) + + return err } type NullableEndpointDeletedEvent struct { diff --git a/go/internal/openapi/model_endpoint_deleted_event_data.go b/go/internal/openapi/model_endpoint_deleted_event_data.go index 50165e100..2515aede6 100644 --- a/go/internal/openapi/model_endpoint_deleted_event_data.go +++ b/go/internal/openapi/model_endpoint_deleted_event_data.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the EndpointDeletedEventData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointDeletedEventData{} + // EndpointDeletedEventData struct for EndpointDeletedEventData type EndpointDeletedEventData struct { // The app's ID @@ -26,6 +31,8 @@ type EndpointDeletedEventData struct { EndpointUid NullableString `json:"endpointUid,omitempty"` } +type _EndpointDeletedEventData EndpointDeletedEventData + // NewEndpointDeletedEventData instantiates a new EndpointDeletedEventData 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 @@ -58,7 +65,7 @@ func (o *EndpointDeletedEventData) GetAppId() string { // GetAppIdOk returns a tuple with the AppId field value // and a boolean to check if the value has been set. func (o *EndpointDeletedEventData) GetAppIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.AppId, true @@ -71,7 +78,7 @@ func (o *EndpointDeletedEventData) SetAppId(v string) { // GetAppUid returns the AppUid field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointDeletedEventData) GetAppUid() string { - if o == nil || o.AppUid.Get() == nil { + if o == nil || IsNil(o.AppUid.Get()) { var ret string return ret } @@ -82,7 +89,7 @@ func (o *EndpointDeletedEventData) GetAppUid() string { // 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 *EndpointDeletedEventData) GetAppUidOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.AppUid.Get(), o.AppUid.IsSet() @@ -124,7 +131,7 @@ func (o *EndpointDeletedEventData) GetEndpointId() string { // GetEndpointIdOk returns a tuple with the EndpointId field value // and a boolean to check if the value has been set. func (o *EndpointDeletedEventData) GetEndpointIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.EndpointId, true @@ -137,7 +144,7 @@ func (o *EndpointDeletedEventData) SetEndpointId(v string) { // GetEndpointUid returns the EndpointUid field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointDeletedEventData) GetEndpointUid() string { - if o == nil || o.EndpointUid.Get() == nil { + if o == nil || IsNil(o.EndpointUid.Get()) { var ret string return ret } @@ -148,7 +155,7 @@ func (o *EndpointDeletedEventData) GetEndpointUid() string { // 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 *EndpointDeletedEventData) GetEndpointUidOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.EndpointUid.Get(), o.EndpointUid.IsSet() @@ -178,20 +185,62 @@ func (o *EndpointDeletedEventData) UnsetEndpointUid() { } func (o EndpointDeletedEventData) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["appId"] = o.AppId + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o EndpointDeletedEventData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["appId"] = o.AppId if o.AppUid.IsSet() { toSerialize["appUid"] = o.AppUid.Get() } - if true { - toSerialize["endpointId"] = o.EndpointId - } + toSerialize["endpointId"] = o.EndpointId if o.EndpointUid.IsSet() { toSerialize["endpointUid"] = o.EndpointUid.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *EndpointDeletedEventData) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "appId", + "endpointId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEndpointDeletedEventData := _EndpointDeletedEventData{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEndpointDeletedEventData) + + if err != nil { + return err + } + + *o = EndpointDeletedEventData(varEndpointDeletedEventData) + + return err } type NullableEndpointDeletedEventData struct { diff --git a/go/internal/openapi/model_endpoint_disabled_event.go b/go/internal/openapi/model_endpoint_disabled_event.go index 536a77652..39825a3e7 100644 --- a/go/internal/openapi/model_endpoint_disabled_event.go +++ b/go/internal/openapi/model_endpoint_disabled_event.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,14 +12,21 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the EndpointDisabledEvent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointDisabledEvent{} + // EndpointDisabledEvent Sent when an endpoint has been automatically disabled after continuous failures. type EndpointDisabledEvent struct { Data EndpointDisabledEventData `json:"data"` Type string `json:"type"` } +type _EndpointDisabledEvent EndpointDisabledEvent + // NewEndpointDisabledEvent instantiates a new EndpointDisabledEvent 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 @@ -54,7 +61,7 @@ func (o *EndpointDisabledEvent) GetData() EndpointDisabledEventData { // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. func (o *EndpointDisabledEvent) GetDataOk() (*EndpointDisabledEventData, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Data, true @@ -78,7 +85,7 @@ func (o *EndpointDisabledEvent) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *EndpointDisabledEvent) GetTypeOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Type, true @@ -90,14 +97,56 @@ func (o *EndpointDisabledEvent) SetType(v string) { } func (o EndpointDisabledEvent) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointDisabledEvent) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["data"] = o.Data + toSerialize["data"] = o.Data + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *EndpointDisabledEvent) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["type"] = o.Type + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varEndpointDisabledEvent := _EndpointDisabledEvent{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEndpointDisabledEvent) + + if err != nil { + return err + } + + *o = EndpointDisabledEvent(varEndpointDisabledEvent) + + return err } type NullableEndpointDisabledEvent struct { diff --git a/go/internal/openapi/model_endpoint_disabled_event_data.go b/go/internal/openapi/model_endpoint_disabled_event_data.go index 31b161bd0..abdd38242 100644 --- a/go/internal/openapi/model_endpoint_disabled_event_data.go +++ b/go/internal/openapi/model_endpoint_disabled_event_data.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -13,8 +13,13 @@ package openapi import ( "encoding/json" "time" + "bytes" + "fmt" ) +// checks if the EndpointDisabledEventData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointDisabledEventData{} + // EndpointDisabledEventData Sent when an endpoint has been automatically disabled after continuous failures. type EndpointDisabledEventData struct { // The app's ID @@ -28,6 +33,8 @@ type EndpointDisabledEventData struct { FailSince time.Time `json:"failSince"` } +type _EndpointDisabledEventData EndpointDisabledEventData + // NewEndpointDisabledEventData instantiates a new EndpointDisabledEventData 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 @@ -61,7 +68,7 @@ func (o *EndpointDisabledEventData) GetAppId() string { // GetAppIdOk returns a tuple with the AppId field value // and a boolean to check if the value has been set. func (o *EndpointDisabledEventData) GetAppIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.AppId, true @@ -74,7 +81,7 @@ func (o *EndpointDisabledEventData) SetAppId(v string) { // GetAppUid returns the AppUid field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointDisabledEventData) GetAppUid() string { - if o == nil || o.AppUid.Get() == nil { + if o == nil || IsNil(o.AppUid.Get()) { var ret string return ret } @@ -85,7 +92,7 @@ func (o *EndpointDisabledEventData) GetAppUid() string { // 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 *EndpointDisabledEventData) GetAppUidOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.AppUid.Get(), o.AppUid.IsSet() @@ -127,7 +134,7 @@ func (o *EndpointDisabledEventData) GetEndpointId() string { // GetEndpointIdOk returns a tuple with the EndpointId field value // and a boolean to check if the value has been set. func (o *EndpointDisabledEventData) GetEndpointIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.EndpointId, true @@ -140,7 +147,7 @@ func (o *EndpointDisabledEventData) SetEndpointId(v string) { // GetEndpointUid returns the EndpointUid field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointDisabledEventData) GetEndpointUid() string { - if o == nil || o.EndpointUid.Get() == nil { + if o == nil || IsNil(o.EndpointUid.Get()) { var ret string return ret } @@ -151,7 +158,7 @@ func (o *EndpointDisabledEventData) GetEndpointUid() string { // 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 *EndpointDisabledEventData) GetEndpointUidOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.EndpointUid.Get(), o.EndpointUid.IsSet() @@ -193,7 +200,7 @@ func (o *EndpointDisabledEventData) GetFailSince() time.Time { // GetFailSinceOk returns a tuple with the FailSince field value // and a boolean to check if the value has been set. func (o *EndpointDisabledEventData) GetFailSinceOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.FailSince, true @@ -205,23 +212,64 @@ func (o *EndpointDisabledEventData) SetFailSince(v time.Time) { } func (o EndpointDisabledEventData) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["appId"] = o.AppId + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o EndpointDisabledEventData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["appId"] = o.AppId if o.AppUid.IsSet() { toSerialize["appUid"] = o.AppUid.Get() } - if true { - toSerialize["endpointId"] = o.EndpointId - } + toSerialize["endpointId"] = o.EndpointId if o.EndpointUid.IsSet() { toSerialize["endpointUid"] = o.EndpointUid.Get() } - if true { - toSerialize["failSince"] = o.FailSince + toSerialize["failSince"] = o.FailSince + return toSerialize, nil +} + +func (o *EndpointDisabledEventData) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "appId", + "endpointId", + "failSince", } - return json.Marshal(toSerialize) + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEndpointDisabledEventData := _EndpointDisabledEventData{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEndpointDisabledEventData) + + if err != nil { + return err + } + + *o = EndpointDisabledEventData(varEndpointDisabledEventData) + + return err } type NullableEndpointDisabledEventData struct { diff --git a/go/internal/openapi/model_endpoint_headers_in.go b/go/internal/openapi/model_endpoint_headers_in.go index 81cbf10b1..40c29d47c 100644 --- a/go/internal/openapi/model_endpoint_headers_in.go +++ b/go/internal/openapi/model_endpoint_headers_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,13 +12,20 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the EndpointHeadersIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointHeadersIn{} + // EndpointHeadersIn struct for EndpointHeadersIn type EndpointHeadersIn struct { Headers map[string]string `json:"headers"` } +type _EndpointHeadersIn EndpointHeadersIn + // NewEndpointHeadersIn instantiates a new EndpointHeadersIn 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 @@ -50,7 +57,7 @@ func (o *EndpointHeadersIn) GetHeaders() map[string]string { // GetHeadersOk returns a tuple with the Headers field value // and a boolean to check if the value has been set. func (o *EndpointHeadersIn) GetHeadersOk() (*map[string]string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Headers, true @@ -62,13 +69,56 @@ func (o *EndpointHeadersIn) SetHeaders(v map[string]string) { } func (o EndpointHeadersIn) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["headers"] = o.Headers + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o EndpointHeadersIn) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["headers"] = o.Headers + return toSerialize, nil +} + +func (o *EndpointHeadersIn) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "headers", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEndpointHeadersIn := _EndpointHeadersIn{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEndpointHeadersIn) + + if err != nil { + return err + } + + *o = EndpointHeadersIn(varEndpointHeadersIn) + + return err +} + type NullableEndpointHeadersIn struct { value *EndpointHeadersIn isSet bool diff --git a/go/internal/openapi/model_endpoint_headers_out.go b/go/internal/openapi/model_endpoint_headers_out.go index d89084410..8ed4f4b4a 100644 --- a/go/internal/openapi/model_endpoint_headers_out.go +++ b/go/internal/openapi/model_endpoint_headers_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,14 +12,21 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the EndpointHeadersOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointHeadersOut{} + // EndpointHeadersOut The value of the headers is returned in the `headers` field. Sensitive headers that have been redacted are returned in the sensitive field. type EndpointHeadersOut struct { Headers map[string]string `json:"headers"` Sensitive []string `json:"sensitive"` } +type _EndpointHeadersOut EndpointHeadersOut + // NewEndpointHeadersOut instantiates a new EndpointHeadersOut 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 @@ -52,7 +59,7 @@ func (o *EndpointHeadersOut) GetHeaders() map[string]string { // GetHeadersOk returns a tuple with the Headers field value // and a boolean to check if the value has been set. func (o *EndpointHeadersOut) GetHeadersOk() (*map[string]string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Headers, true @@ -75,11 +82,11 @@ func (o *EndpointHeadersOut) GetSensitive() []string { // GetSensitiveOk returns a tuple with the Sensitive field value // and a boolean to check if the value has been set. -func (o *EndpointHeadersOut) GetSensitiveOk() (*[]string, bool) { - if o == nil { +func (o *EndpointHeadersOut) GetSensitiveOk() ([]string, bool) { + if o == nil { return nil, false } - return &o.Sensitive, true + return o.Sensitive, true } // SetSensitive sets field value @@ -88,14 +95,56 @@ func (o *EndpointHeadersOut) SetSensitive(v []string) { } func (o EndpointHeadersOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointHeadersOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["headers"] = o.Headers + toSerialize["headers"] = o.Headers + toSerialize["sensitive"] = o.Sensitive + return toSerialize, nil +} + +func (o *EndpointHeadersOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "headers", + "sensitive", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["sensitive"] = o.Sensitive + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varEndpointHeadersOut := _EndpointHeadersOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEndpointHeadersOut) + + if err != nil { + return err + } + + *o = EndpointHeadersOut(varEndpointHeadersOut) + + return err } type NullableEndpointHeadersOut struct { diff --git a/go/internal/openapi/model_endpoint_headers_patch_in.go b/go/internal/openapi/model_endpoint_headers_patch_in.go index 838c23e91..d5d61548f 100644 --- a/go/internal/openapi/model_endpoint_headers_patch_in.go +++ b/go/internal/openapi/model_endpoint_headers_patch_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,13 +12,20 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the EndpointHeadersPatchIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointHeadersPatchIn{} + // EndpointHeadersPatchIn struct for EndpointHeadersPatchIn type EndpointHeadersPatchIn struct { Headers map[string]string `json:"headers"` } +type _EndpointHeadersPatchIn EndpointHeadersPatchIn + // NewEndpointHeadersPatchIn instantiates a new EndpointHeadersPatchIn 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 @@ -50,7 +57,7 @@ func (o *EndpointHeadersPatchIn) GetHeaders() map[string]string { // GetHeadersOk returns a tuple with the Headers field value // and a boolean to check if the value has been set. func (o *EndpointHeadersPatchIn) GetHeadersOk() (*map[string]string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Headers, true @@ -62,13 +69,56 @@ func (o *EndpointHeadersPatchIn) SetHeaders(v map[string]string) { } func (o EndpointHeadersPatchIn) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["headers"] = o.Headers + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o EndpointHeadersPatchIn) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["headers"] = o.Headers + return toSerialize, nil +} + +func (o *EndpointHeadersPatchIn) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "headers", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEndpointHeadersPatchIn := _EndpointHeadersPatchIn{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEndpointHeadersPatchIn) + + if err != nil { + return err + } + + *o = EndpointHeadersPatchIn(varEndpointHeadersPatchIn) + + return err +} + type NullableEndpointHeadersPatchIn struct { value *EndpointHeadersPatchIn isSet bool diff --git a/go/internal/openapi/model_endpoint_in.go b/go/internal/openapi/model_endpoint_in.go index ea255b76a..828d476d5 100644 --- a/go/internal/openapi/model_endpoint_in.go +++ b/go/internal/openapi/model_endpoint_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the EndpointIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointIn{} + // EndpointIn struct for EndpointIn type EndpointIn struct { // List of message channels this endpoint listens to (omit for all) @@ -28,9 +33,12 @@ type EndpointIn struct { // Optional unique identifier for the endpoint Uid NullableString `json:"uid,omitempty"` Url string `json:"url"` + // Deprecated Version NullableInt32 `json:"version,omitempty"` } +type _EndpointIn EndpointIn + // NewEndpointIn instantiates a new EndpointIn 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 @@ -63,7 +71,7 @@ func NewEndpointInWithDefaults() *EndpointIn { // GetChannels returns the Channels field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointIn) GetChannels() []string { - if o == nil { + if o == nil { var ret []string return ret } @@ -73,16 +81,16 @@ func (o *EndpointIn) GetChannels() []string { // GetChannelsOk returns a tuple with the Channels 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 *EndpointIn) GetChannelsOk() (*[]string, bool) { - if o == nil || o.Channels == nil { +func (o *EndpointIn) GetChannelsOk() ([]string, bool) { + if o == nil || IsNil(o.Channels) { return nil, false } - return &o.Channels, true + return o.Channels, true } // HasChannels returns a boolean if a field has been set. func (o *EndpointIn) HasChannels() bool { - if o != nil && o.Channels != nil { + if o != nil && IsNil(o.Channels) { return true } @@ -96,7 +104,7 @@ func (o *EndpointIn) SetChannels(v []string) { // GetDescription returns the Description field value if set, zero value otherwise. func (o *EndpointIn) GetDescription() string { - if o == nil || o.Description == nil { + if o == nil || IsNil(o.Description) { var ret string return ret } @@ -106,7 +114,7 @@ func (o *EndpointIn) GetDescription() string { // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EndpointIn) GetDescriptionOk() (*string, bool) { - if o == nil || o.Description == nil { + if o == nil || IsNil(o.Description) { return nil, false } return o.Description, true @@ -114,7 +122,7 @@ func (o *EndpointIn) GetDescriptionOk() (*string, bool) { // HasDescription returns a boolean if a field has been set. func (o *EndpointIn) HasDescription() bool { - if o != nil && o.Description != nil { + if o != nil && !IsNil(o.Description) { return true } @@ -128,7 +136,7 @@ func (o *EndpointIn) SetDescription(v string) { // GetDisabled returns the Disabled field value if set, zero value otherwise. func (o *EndpointIn) GetDisabled() bool { - if o == nil || o.Disabled == nil { + if o == nil || IsNil(o.Disabled) { var ret bool return ret } @@ -138,7 +146,7 @@ func (o *EndpointIn) GetDisabled() bool { // GetDisabledOk returns a tuple with the Disabled field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EndpointIn) GetDisabledOk() (*bool, bool) { - if o == nil || o.Disabled == nil { + if o == nil || IsNil(o.Disabled) { return nil, false } return o.Disabled, true @@ -146,7 +154,7 @@ func (o *EndpointIn) GetDisabledOk() (*bool, bool) { // HasDisabled returns a boolean if a field has been set. func (o *EndpointIn) HasDisabled() bool { - if o != nil && o.Disabled != nil { + if o != nil && !IsNil(o.Disabled) { return true } @@ -160,7 +168,7 @@ func (o *EndpointIn) SetDisabled(v bool) { // GetFilterTypes returns the FilterTypes field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointIn) GetFilterTypes() []string { - if o == nil { + if o == nil { var ret []string return ret } @@ -170,16 +178,16 @@ func (o *EndpointIn) GetFilterTypes() []string { // GetFilterTypesOk returns a tuple with the FilterTypes field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *EndpointIn) GetFilterTypesOk() (*[]string, bool) { - if o == nil || o.FilterTypes == nil { +func (o *EndpointIn) GetFilterTypesOk() ([]string, bool) { + if o == nil || IsNil(o.FilterTypes) { return nil, false } - return &o.FilterTypes, true + return o.FilterTypes, true } // HasFilterTypes returns a boolean if a field has been set. func (o *EndpointIn) HasFilterTypes() bool { - if o != nil && o.FilterTypes != nil { + if o != nil && IsNil(o.FilterTypes) { return true } @@ -193,7 +201,7 @@ func (o *EndpointIn) SetFilterTypes(v []string) { // GetMetadata returns the Metadata field value if set, zero value otherwise. func (o *EndpointIn) GetMetadata() map[string]string { - if o == nil || o.Metadata == nil { + if o == nil || IsNil(o.Metadata) { var ret map[string]string return ret } @@ -203,7 +211,7 @@ func (o *EndpointIn) GetMetadata() map[string]string { // GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EndpointIn) GetMetadataOk() (*map[string]string, bool) { - if o == nil || o.Metadata == nil { + if o == nil || IsNil(o.Metadata) { return nil, false } return o.Metadata, true @@ -211,7 +219,7 @@ func (o *EndpointIn) GetMetadataOk() (*map[string]string, bool) { // HasMetadata returns a boolean if a field has been set. func (o *EndpointIn) HasMetadata() bool { - if o != nil && o.Metadata != nil { + if o != nil && !IsNil(o.Metadata) { return true } @@ -225,7 +233,7 @@ func (o *EndpointIn) SetMetadata(v map[string]string) { // GetRateLimit returns the RateLimit field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointIn) GetRateLimit() int32 { - if o == nil || o.RateLimit.Get() == nil { + if o == nil || IsNil(o.RateLimit.Get()) { var ret int32 return ret } @@ -236,7 +244,7 @@ func (o *EndpointIn) GetRateLimit() int32 { // 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 *EndpointIn) GetRateLimitOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return o.RateLimit.Get(), o.RateLimit.IsSet() @@ -267,7 +275,7 @@ func (o *EndpointIn) UnsetRateLimit() { // GetSecret returns the Secret field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointIn) GetSecret() string { - if o == nil || o.Secret.Get() == nil { + if o == nil || IsNil(o.Secret.Get()) { var ret string return ret } @@ -278,7 +286,7 @@ func (o *EndpointIn) GetSecret() string { // 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 *EndpointIn) GetSecretOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Secret.Get(), o.Secret.IsSet() @@ -309,7 +317,7 @@ func (o *EndpointIn) UnsetSecret() { // GetUid returns the Uid field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointIn) GetUid() string { - if o == nil || o.Uid.Get() == nil { + if o == nil || IsNil(o.Uid.Get()) { var ret string return ret } @@ -320,7 +328,7 @@ func (o *EndpointIn) GetUid() string { // 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 *EndpointIn) GetUidOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Uid.Get(), o.Uid.IsSet() @@ -362,7 +370,7 @@ func (o *EndpointIn) GetUrl() string { // GetUrlOk returns a tuple with the Url field value // and a boolean to check if the value has been set. func (o *EndpointIn) GetUrlOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Url, true @@ -374,8 +382,9 @@ func (o *EndpointIn) SetUrl(v string) { } // GetVersion returns the Version field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated func (o *EndpointIn) GetVersion() int32 { - if o == nil || o.Version.Get() == nil { + if o == nil || IsNil(o.Version.Get()) { var ret int32 return ret } @@ -385,8 +394,9 @@ func (o *EndpointIn) GetVersion() int32 { // GetVersionOk returns a tuple with the Version 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 +// Deprecated func (o *EndpointIn) GetVersionOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return o.Version.Get(), o.Version.IsSet() @@ -402,6 +412,7 @@ func (o *EndpointIn) HasVersion() bool { } // SetVersion gets a reference to the given NullableInt32 and assigns it to the Version field. +// Deprecated func (o *EndpointIn) SetVersion(v int32) { o.Version.Set(&v) } @@ -416,20 +427,28 @@ func (o *EndpointIn) UnsetVersion() { } func (o EndpointIn) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointIn) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if o.Channels != nil { toSerialize["channels"] = o.Channels } - if o.Description != nil { + if !IsNil(o.Description) { toSerialize["description"] = o.Description } - if o.Disabled != nil { + if !IsNil(o.Disabled) { toSerialize["disabled"] = o.Disabled } if o.FilterTypes != nil { toSerialize["filterTypes"] = o.FilterTypes } - if o.Metadata != nil { + if !IsNil(o.Metadata) { toSerialize["metadata"] = o.Metadata } if o.RateLimit.IsSet() { @@ -441,13 +460,48 @@ func (o EndpointIn) MarshalJSON() ([]byte, error) { if o.Uid.IsSet() { toSerialize["uid"] = o.Uid.Get() } - if true { - toSerialize["url"] = o.Url - } + toSerialize["url"] = o.Url if o.Version.IsSet() { toSerialize["version"] = o.Version.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *EndpointIn) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEndpointIn := _EndpointIn{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEndpointIn) + + if err != nil { + return err + } + + *o = EndpointIn(varEndpointIn) + + return err } type NullableEndpointIn struct { diff --git a/go/internal/openapi/model_endpoint_message_out.go b/go/internal/openapi/model_endpoint_message_out.go index 737b8b1dd..6e1c3cdf3 100644 --- a/go/internal/openapi/model_endpoint_message_out.go +++ b/go/internal/openapi/model_endpoint_message_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -13,8 +13,13 @@ package openapi import ( "encoding/json" "time" + "bytes" + "fmt" ) +// checks if the EndpointMessageOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointMessageOut{} + // EndpointMessageOut A model containing information on a given message plus additional fields on the last attempt for that message. type EndpointMessageOut struct { // List of free-form identifiers that endpoints can filter by @@ -31,6 +36,8 @@ type EndpointMessageOut struct { Timestamp time.Time `json:"timestamp"` } +type _EndpointMessageOut EndpointMessageOut + // NewEndpointMessageOut instantiates a new EndpointMessageOut 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 @@ -55,7 +62,7 @@ func NewEndpointMessageOutWithDefaults() *EndpointMessageOut { // GetChannels returns the Channels field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointMessageOut) GetChannels() []string { - if o == nil { + if o == nil { var ret []string return ret } @@ -65,16 +72,16 @@ func (o *EndpointMessageOut) GetChannels() []string { // GetChannelsOk returns a tuple with the Channels 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 *EndpointMessageOut) GetChannelsOk() (*[]string, bool) { - if o == nil || o.Channels == nil { +func (o *EndpointMessageOut) GetChannelsOk() ([]string, bool) { + if o == nil || IsNil(o.Channels) { return nil, false } - return &o.Channels, true + return o.Channels, true } // HasChannels returns a boolean if a field has been set. func (o *EndpointMessageOut) HasChannels() bool { - if o != nil && o.Channels != nil { + if o != nil && IsNil(o.Channels) { return true } @@ -88,7 +95,7 @@ func (o *EndpointMessageOut) SetChannels(v []string) { // GetEventId returns the EventId field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointMessageOut) GetEventId() string { - if o == nil || o.EventId.Get() == nil { + if o == nil || IsNil(o.EventId.Get()) { var ret string return ret } @@ -99,7 +106,7 @@ func (o *EndpointMessageOut) GetEventId() string { // 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 *EndpointMessageOut) GetEventIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.EventId.Get(), o.EventId.IsSet() @@ -141,7 +148,7 @@ func (o *EndpointMessageOut) GetEventType() string { // GetEventTypeOk returns a tuple with the EventType field value // and a boolean to check if the value has been set. func (o *EndpointMessageOut) GetEventTypeOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.EventType, true @@ -165,7 +172,7 @@ func (o *EndpointMessageOut) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *EndpointMessageOut) GetIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Id, true @@ -178,7 +185,7 @@ func (o *EndpointMessageOut) SetId(v string) { // GetNextAttempt returns the NextAttempt field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointMessageOut) GetNextAttempt() time.Time { - if o == nil || o.NextAttempt.Get() == nil { + if o == nil || IsNil(o.NextAttempt.Get()) { var ret time.Time return ret } @@ -189,7 +196,7 @@ func (o *EndpointMessageOut) GetNextAttempt() time.Time { // 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 *EndpointMessageOut) GetNextAttemptOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return o.NextAttempt.Get(), o.NextAttempt.IsSet() @@ -230,11 +237,11 @@ func (o *EndpointMessageOut) GetPayload() map[string]interface{} { // GetPayloadOk returns a tuple with the Payload field value // and a boolean to check if the value has been set. -func (o *EndpointMessageOut) GetPayloadOk() (*map[string]interface{}, bool) { - if o == nil { - return nil, false +func (o *EndpointMessageOut) GetPayloadOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false } - return &o.Payload, true + return o.Payload, true } // SetPayload sets field value @@ -255,7 +262,7 @@ func (o *EndpointMessageOut) GetStatus() MessageStatus { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. func (o *EndpointMessageOut) GetStatusOk() (*MessageStatus, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Status, true @@ -279,7 +286,7 @@ func (o *EndpointMessageOut) GetTimestamp() time.Time { // GetTimestampOk returns a tuple with the Timestamp field value // and a boolean to check if the value has been set. func (o *EndpointMessageOut) GetTimestampOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Timestamp, true @@ -291,6 +298,14 @@ func (o *EndpointMessageOut) SetTimestamp(v time.Time) { } func (o EndpointMessageOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointMessageOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if o.Channels != nil { toSerialize["channels"] = o.Channels @@ -298,25 +313,56 @@ func (o EndpointMessageOut) MarshalJSON() ([]byte, error) { if o.EventId.IsSet() { toSerialize["eventId"] = o.EventId.Get() } - if true { - toSerialize["eventType"] = o.EventType - } - if true { - toSerialize["id"] = o.Id - } + toSerialize["eventType"] = o.EventType + toSerialize["id"] = o.Id if o.NextAttempt.IsSet() { toSerialize["nextAttempt"] = o.NextAttempt.Get() } - if true { - toSerialize["payload"] = o.Payload + toSerialize["payload"] = o.Payload + toSerialize["status"] = o.Status + toSerialize["timestamp"] = o.Timestamp + return toSerialize, nil +} + +func (o *EndpointMessageOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "eventType", + "id", + "payload", + "status", + "timestamp", } - if true { - toSerialize["status"] = o.Status + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["timestamp"] = o.Timestamp + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varEndpointMessageOut := _EndpointMessageOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEndpointMessageOut) + + if err != nil { + return err + } + + *o = EndpointMessageOut(varEndpointMessageOut) + + return err } type NullableEndpointMessageOut struct { diff --git a/go/internal/openapi/model_endpoint_out.go b/go/internal/openapi/model_endpoint_out.go index a58217765..2be3b8960 100644 --- a/go/internal/openapi/model_endpoint_out.go +++ b/go/internal/openapi/model_endpoint_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -13,8 +13,13 @@ package openapi import ( "encoding/json" "time" + "bytes" + "fmt" ) +// checks if the EndpointOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointOut{} + // EndpointOut struct for EndpointOut type EndpointOut struct { // List of message channels this endpoint listens to (omit for all) @@ -32,9 +37,12 @@ type EndpointOut struct { Uid NullableString `json:"uid,omitempty"` UpdatedAt time.Time `json:"updatedAt"` Url string `json:"url"` + // Deprecated Version int32 `json:"version"` } +type _EndpointOut EndpointOut + // NewEndpointOut instantiates a new EndpointOut 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 @@ -65,7 +73,7 @@ func NewEndpointOutWithDefaults() *EndpointOut { // GetChannels returns the Channels field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointOut) GetChannels() []string { - if o == nil { + if o == nil { var ret []string return ret } @@ -75,16 +83,16 @@ func (o *EndpointOut) GetChannels() []string { // GetChannelsOk returns a tuple with the Channels 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 *EndpointOut) GetChannelsOk() (*[]string, bool) { - if o == nil || o.Channels == nil { +func (o *EndpointOut) GetChannelsOk() ([]string, bool) { + if o == nil || IsNil(o.Channels) { return nil, false } - return &o.Channels, true + return o.Channels, true } // HasChannels returns a boolean if a field has been set. func (o *EndpointOut) HasChannels() bool { - if o != nil && o.Channels != nil { + if o != nil && IsNil(o.Channels) { return true } @@ -109,7 +117,7 @@ func (o *EndpointOut) GetCreatedAt() time.Time { // GetCreatedAtOk returns a tuple with the CreatedAt field value // and a boolean to check if the value has been set. func (o *EndpointOut) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.CreatedAt, true @@ -133,7 +141,7 @@ func (o *EndpointOut) GetDescription() string { // GetDescriptionOk returns a tuple with the Description field value // and a boolean to check if the value has been set. func (o *EndpointOut) GetDescriptionOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Description, true @@ -146,7 +154,7 @@ func (o *EndpointOut) SetDescription(v string) { // GetDisabled returns the Disabled field value if set, zero value otherwise. func (o *EndpointOut) GetDisabled() bool { - if o == nil || o.Disabled == nil { + if o == nil || IsNil(o.Disabled) { var ret bool return ret } @@ -156,7 +164,7 @@ func (o *EndpointOut) GetDisabled() bool { // GetDisabledOk returns a tuple with the Disabled field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EndpointOut) GetDisabledOk() (*bool, bool) { - if o == nil || o.Disabled == nil { + if o == nil || IsNil(o.Disabled) { return nil, false } return o.Disabled, true @@ -164,7 +172,7 @@ func (o *EndpointOut) GetDisabledOk() (*bool, bool) { // HasDisabled returns a boolean if a field has been set. func (o *EndpointOut) HasDisabled() bool { - if o != nil && o.Disabled != nil { + if o != nil && !IsNil(o.Disabled) { return true } @@ -178,7 +186,7 @@ func (o *EndpointOut) SetDisabled(v bool) { // GetFilterTypes returns the FilterTypes field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointOut) GetFilterTypes() []string { - if o == nil { + if o == nil { var ret []string return ret } @@ -188,16 +196,16 @@ func (o *EndpointOut) GetFilterTypes() []string { // GetFilterTypesOk returns a tuple with the FilterTypes field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *EndpointOut) GetFilterTypesOk() (*[]string, bool) { - if o == nil || o.FilterTypes == nil { +func (o *EndpointOut) GetFilterTypesOk() ([]string, bool) { + if o == nil || IsNil(o.FilterTypes) { return nil, false } - return &o.FilterTypes, true + return o.FilterTypes, true } // HasFilterTypes returns a boolean if a field has been set. func (o *EndpointOut) HasFilterTypes() bool { - if o != nil && o.FilterTypes != nil { + if o != nil && IsNil(o.FilterTypes) { return true } @@ -222,7 +230,7 @@ func (o *EndpointOut) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *EndpointOut) GetIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Id, true @@ -246,7 +254,7 @@ func (o *EndpointOut) GetMetadata() map[string]string { // GetMetadataOk returns a tuple with the Metadata field value // and a boolean to check if the value has been set. func (o *EndpointOut) GetMetadataOk() (*map[string]string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Metadata, true @@ -259,7 +267,7 @@ func (o *EndpointOut) SetMetadata(v map[string]string) { // GetRateLimit returns the RateLimit field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointOut) GetRateLimit() int32 { - if o == nil || o.RateLimit.Get() == nil { + if o == nil || IsNil(o.RateLimit.Get()) { var ret int32 return ret } @@ -270,7 +278,7 @@ func (o *EndpointOut) GetRateLimit() int32 { // 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 *EndpointOut) GetRateLimitOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return o.RateLimit.Get(), o.RateLimit.IsSet() @@ -301,7 +309,7 @@ func (o *EndpointOut) UnsetRateLimit() { // GetUid returns the Uid field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointOut) GetUid() string { - if o == nil || o.Uid.Get() == nil { + if o == nil || IsNil(o.Uid.Get()) { var ret string return ret } @@ -312,7 +320,7 @@ func (o *EndpointOut) GetUid() string { // 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 *EndpointOut) GetUidOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Uid.Get(), o.Uid.IsSet() @@ -354,7 +362,7 @@ func (o *EndpointOut) GetUpdatedAt() time.Time { // GetUpdatedAtOk returns a tuple with the UpdatedAt field value // and a boolean to check if the value has been set. func (o *EndpointOut) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.UpdatedAt, true @@ -378,7 +386,7 @@ func (o *EndpointOut) GetUrl() string { // GetUrlOk returns a tuple with the Url field value // and a boolean to check if the value has been set. func (o *EndpointOut) GetUrlOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Url, true @@ -390,6 +398,7 @@ func (o *EndpointOut) SetUrl(v string) { } // GetVersion returns the Version field value +// Deprecated func (o *EndpointOut) GetVersion() int32 { if o == nil { var ret int32 @@ -401,57 +410,96 @@ func (o *EndpointOut) GetVersion() int32 { // GetVersionOk returns a tuple with the Version field value // and a boolean to check if the value has been set. +// Deprecated func (o *EndpointOut) GetVersionOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Version, true } // SetVersion sets field value +// Deprecated func (o *EndpointOut) SetVersion(v int32) { o.Version = v } func (o EndpointOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if o.Channels != nil { toSerialize["channels"] = o.Channels } - if true { - toSerialize["createdAt"] = o.CreatedAt - } - if true { - toSerialize["description"] = o.Description - } - if o.Disabled != nil { + toSerialize["createdAt"] = o.CreatedAt + toSerialize["description"] = o.Description + if !IsNil(o.Disabled) { toSerialize["disabled"] = o.Disabled } if o.FilterTypes != nil { toSerialize["filterTypes"] = o.FilterTypes } - if true { - toSerialize["id"] = o.Id - } - if true { - toSerialize["metadata"] = o.Metadata - } + toSerialize["id"] = o.Id + toSerialize["metadata"] = o.Metadata if o.RateLimit.IsSet() { toSerialize["rateLimit"] = o.RateLimit.Get() } if o.Uid.IsSet() { toSerialize["uid"] = o.Uid.Get() } - if true { - toSerialize["updatedAt"] = o.UpdatedAt + toSerialize["updatedAt"] = o.UpdatedAt + toSerialize["url"] = o.Url + toSerialize["version"] = o.Version + return toSerialize, nil +} + +func (o *EndpointOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "createdAt", + "description", + "id", + "metadata", + "updatedAt", + "url", + "version", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["url"] = o.Url + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - if true { - toSerialize["version"] = o.Version + + varEndpointOut := _EndpointOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEndpointOut) + + if err != nil { + return err } - return json.Marshal(toSerialize) + + *o = EndpointOut(varEndpointOut) + + return err } type NullableEndpointOut struct { diff --git a/go/internal/openapi/model_endpoint_patch.go b/go/internal/openapi/model_endpoint_patch.go index 1269ec5b7..de00aa295 100644 --- a/go/internal/openapi/model_endpoint_patch.go +++ b/go/internal/openapi/model_endpoint_patch.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -14,6 +14,9 @@ import ( "encoding/json" ) +// checks if the EndpointPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointPatch{} + // EndpointPatch struct for EndpointPatch type EndpointPatch struct { Channels []string `json:"channels,omitempty"` @@ -27,6 +30,7 @@ type EndpointPatch struct { // The ep's UID Uid NullableString `json:"uid,omitempty"` Url *string `json:"url,omitempty"` + // Deprecated Version *int32 `json:"version,omitempty"` } @@ -49,7 +53,7 @@ func NewEndpointPatchWithDefaults() *EndpointPatch { // GetChannels returns the Channels field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointPatch) GetChannels() []string { - if o == nil { + if o == nil { var ret []string return ret } @@ -59,16 +63,16 @@ func (o *EndpointPatch) GetChannels() []string { // GetChannelsOk returns a tuple with the Channels 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 *EndpointPatch) GetChannelsOk() (*[]string, bool) { - if o == nil || o.Channels == nil { +func (o *EndpointPatch) GetChannelsOk() ([]string, bool) { + if o == nil || IsNil(o.Channels) { return nil, false } - return &o.Channels, true + return o.Channels, true } // HasChannels returns a boolean if a field has been set. func (o *EndpointPatch) HasChannels() bool { - if o != nil && o.Channels != nil { + if o != nil && IsNil(o.Channels) { return true } @@ -82,7 +86,7 @@ func (o *EndpointPatch) SetChannels(v []string) { // GetDescription returns the Description field value if set, zero value otherwise. func (o *EndpointPatch) GetDescription() string { - if o == nil || o.Description == nil { + if o == nil || IsNil(o.Description) { var ret string return ret } @@ -92,7 +96,7 @@ func (o *EndpointPatch) GetDescription() string { // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EndpointPatch) GetDescriptionOk() (*string, bool) { - if o == nil || o.Description == nil { + if o == nil || IsNil(o.Description) { return nil, false } return o.Description, true @@ -100,7 +104,7 @@ func (o *EndpointPatch) GetDescriptionOk() (*string, bool) { // HasDescription returns a boolean if a field has been set. func (o *EndpointPatch) HasDescription() bool { - if o != nil && o.Description != nil { + if o != nil && !IsNil(o.Description) { return true } @@ -114,7 +118,7 @@ func (o *EndpointPatch) SetDescription(v string) { // GetDisabled returns the Disabled field value if set, zero value otherwise. func (o *EndpointPatch) GetDisabled() bool { - if o == nil || o.Disabled == nil { + if o == nil || IsNil(o.Disabled) { var ret bool return ret } @@ -124,7 +128,7 @@ func (o *EndpointPatch) GetDisabled() bool { // GetDisabledOk returns a tuple with the Disabled field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EndpointPatch) GetDisabledOk() (*bool, bool) { - if o == nil || o.Disabled == nil { + if o == nil || IsNil(o.Disabled) { return nil, false } return o.Disabled, true @@ -132,7 +136,7 @@ func (o *EndpointPatch) GetDisabledOk() (*bool, bool) { // HasDisabled returns a boolean if a field has been set. func (o *EndpointPatch) HasDisabled() bool { - if o != nil && o.Disabled != nil { + if o != nil && !IsNil(o.Disabled) { return true } @@ -146,7 +150,7 @@ func (o *EndpointPatch) SetDisabled(v bool) { // GetFilterTypes returns the FilterTypes field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointPatch) GetFilterTypes() []string { - if o == nil { + if o == nil { var ret []string return ret } @@ -156,16 +160,16 @@ func (o *EndpointPatch) GetFilterTypes() []string { // GetFilterTypesOk returns a tuple with the FilterTypes field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *EndpointPatch) GetFilterTypesOk() (*[]string, bool) { - if o == nil || o.FilterTypes == nil { +func (o *EndpointPatch) GetFilterTypesOk() ([]string, bool) { + if o == nil || IsNil(o.FilterTypes) { return nil, false } - return &o.FilterTypes, true + return o.FilterTypes, true } // HasFilterTypes returns a boolean if a field has been set. func (o *EndpointPatch) HasFilterTypes() bool { - if o != nil && o.FilterTypes != nil { + if o != nil && IsNil(o.FilterTypes) { return true } @@ -179,7 +183,7 @@ func (o *EndpointPatch) SetFilterTypes(v []string) { // GetMetadata returns the Metadata field value if set, zero value otherwise. func (o *EndpointPatch) GetMetadata() map[string]string { - if o == nil || o.Metadata == nil { + if o == nil || IsNil(o.Metadata) { var ret map[string]string return ret } @@ -189,7 +193,7 @@ func (o *EndpointPatch) GetMetadata() map[string]string { // GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EndpointPatch) GetMetadataOk() (*map[string]string, bool) { - if o == nil || o.Metadata == nil { + if o == nil || IsNil(o.Metadata) { return nil, false } return o.Metadata, true @@ -197,7 +201,7 @@ func (o *EndpointPatch) GetMetadataOk() (*map[string]string, bool) { // HasMetadata returns a boolean if a field has been set. func (o *EndpointPatch) HasMetadata() bool { - if o != nil && o.Metadata != nil { + if o != nil && !IsNil(o.Metadata) { return true } @@ -211,7 +215,7 @@ func (o *EndpointPatch) SetMetadata(v map[string]string) { // GetRateLimit returns the RateLimit field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointPatch) GetRateLimit() int32 { - if o == nil || o.RateLimit.Get() == nil { + if o == nil || IsNil(o.RateLimit.Get()) { var ret int32 return ret } @@ -222,7 +226,7 @@ func (o *EndpointPatch) GetRateLimit() int32 { // 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 *EndpointPatch) GetRateLimitOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return o.RateLimit.Get(), o.RateLimit.IsSet() @@ -253,7 +257,7 @@ func (o *EndpointPatch) UnsetRateLimit() { // GetSecret returns the Secret field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointPatch) GetSecret() string { - if o == nil || o.Secret.Get() == nil { + if o == nil || IsNil(o.Secret.Get()) { var ret string return ret } @@ -264,7 +268,7 @@ func (o *EndpointPatch) GetSecret() string { // 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 *EndpointPatch) GetSecretOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Secret.Get(), o.Secret.IsSet() @@ -295,7 +299,7 @@ func (o *EndpointPatch) UnsetSecret() { // GetUid returns the Uid field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointPatch) GetUid() string { - if o == nil || o.Uid.Get() == nil { + if o == nil || IsNil(o.Uid.Get()) { var ret string return ret } @@ -306,7 +310,7 @@ func (o *EndpointPatch) GetUid() string { // 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 *EndpointPatch) GetUidOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Uid.Get(), o.Uid.IsSet() @@ -337,7 +341,7 @@ func (o *EndpointPatch) UnsetUid() { // GetUrl returns the Url field value if set, zero value otherwise. func (o *EndpointPatch) GetUrl() string { - if o == nil || o.Url == nil { + if o == nil || IsNil(o.Url) { var ret string return ret } @@ -347,7 +351,7 @@ func (o *EndpointPatch) GetUrl() string { // GetUrlOk returns a tuple with the Url field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EndpointPatch) GetUrlOk() (*string, bool) { - if o == nil || o.Url == nil { + if o == nil || IsNil(o.Url) { return nil, false } return o.Url, true @@ -355,7 +359,7 @@ func (o *EndpointPatch) GetUrlOk() (*string, bool) { // HasUrl returns a boolean if a field has been set. func (o *EndpointPatch) HasUrl() bool { - if o != nil && o.Url != nil { + if o != nil && !IsNil(o.Url) { return true } @@ -368,8 +372,9 @@ func (o *EndpointPatch) SetUrl(v string) { } // GetVersion returns the Version field value if set, zero value otherwise. +// Deprecated func (o *EndpointPatch) GetVersion() int32 { - if o == nil || o.Version == nil { + if o == nil || IsNil(o.Version) { var ret int32 return ret } @@ -378,8 +383,9 @@ func (o *EndpointPatch) GetVersion() int32 { // GetVersionOk returns a tuple with the Version field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *EndpointPatch) GetVersionOk() (*int32, bool) { - if o == nil || o.Version == nil { + if o == nil || IsNil(o.Version) { return nil, false } return o.Version, true @@ -387,7 +393,7 @@ func (o *EndpointPatch) GetVersionOk() (*int32, bool) { // HasVersion returns a boolean if a field has been set. func (o *EndpointPatch) HasVersion() bool { - if o != nil && o.Version != nil { + if o != nil && !IsNil(o.Version) { return true } @@ -395,25 +401,34 @@ func (o *EndpointPatch) HasVersion() bool { } // SetVersion gets a reference to the given int32 and assigns it to the Version field. +// Deprecated func (o *EndpointPatch) SetVersion(v int32) { o.Version = &v } func (o EndpointPatch) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointPatch) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if o.Channels != nil { toSerialize["channels"] = o.Channels } - if o.Description != nil { + if !IsNil(o.Description) { toSerialize["description"] = o.Description } - if o.Disabled != nil { + if !IsNil(o.Disabled) { toSerialize["disabled"] = o.Disabled } if o.FilterTypes != nil { toSerialize["filterTypes"] = o.FilterTypes } - if o.Metadata != nil { + if !IsNil(o.Metadata) { toSerialize["metadata"] = o.Metadata } if o.RateLimit.IsSet() { @@ -425,13 +440,13 @@ func (o EndpointPatch) MarshalJSON() ([]byte, error) { if o.Uid.IsSet() { toSerialize["uid"] = o.Uid.Get() } - if o.Url != nil { + if !IsNil(o.Url) { toSerialize["url"] = o.Url } - if o.Version != nil { + if !IsNil(o.Version) { toSerialize["version"] = o.Version } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableEndpointPatch struct { diff --git a/go/internal/openapi/model_endpoint_secret_out.go b/go/internal/openapi/model_endpoint_secret_out.go index 165e8a698..38f094f9a 100644 --- a/go/internal/openapi/model_endpoint_secret_out.go +++ b/go/internal/openapi/model_endpoint_secret_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,14 +12,21 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the EndpointSecretOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointSecretOut{} + // EndpointSecretOut struct for EndpointSecretOut type EndpointSecretOut struct { // The endpoint's verification secret. If `null` is passed, a secret is automatically generated. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24. Key string `json:"key"` } +type _EndpointSecretOut EndpointSecretOut + // NewEndpointSecretOut instantiates a new EndpointSecretOut 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 @@ -51,7 +58,7 @@ func (o *EndpointSecretOut) GetKey() string { // GetKeyOk returns a tuple with the Key field value // and a boolean to check if the value has been set. func (o *EndpointSecretOut) GetKeyOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Key, true @@ -63,13 +70,56 @@ func (o *EndpointSecretOut) SetKey(v string) { } func (o EndpointSecretOut) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["key"] = o.Key + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o EndpointSecretOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +func (o *EndpointSecretOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "key", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEndpointSecretOut := _EndpointSecretOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEndpointSecretOut) + + if err != nil { + return err + } + + *o = EndpointSecretOut(varEndpointSecretOut) + + return err +} + type NullableEndpointSecretOut struct { value *EndpointSecretOut isSet bool diff --git a/go/internal/openapi/model_endpoint_secret_rotate_in.go b/go/internal/openapi/model_endpoint_secret_rotate_in.go index b51d042a1..42c7ff0ec 100644 --- a/go/internal/openapi/model_endpoint_secret_rotate_in.go +++ b/go/internal/openapi/model_endpoint_secret_rotate_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -14,6 +14,9 @@ import ( "encoding/json" ) +// checks if the EndpointSecretRotateIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointSecretRotateIn{} + // EndpointSecretRotateIn struct for EndpointSecretRotateIn type EndpointSecretRotateIn struct { // The endpoint's verification secret. If `null` is passed, a secret is automatically generated. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24. @@ -26,8 +29,6 @@ type EndpointSecretRotateIn struct { // will change when the set of required properties is changed func NewEndpointSecretRotateIn() *EndpointSecretRotateIn { this := EndpointSecretRotateIn{} - var key string = "null" - this.Key = *NewNullableString(&key) return &this } @@ -36,14 +37,12 @@ func NewEndpointSecretRotateIn() *EndpointSecretRotateIn { // but it doesn't guarantee that properties required by API are set func NewEndpointSecretRotateInWithDefaults() *EndpointSecretRotateIn { this := EndpointSecretRotateIn{} - var key string = "null" - this.Key = *NewNullableString(&key) return &this } // GetKey returns the Key field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointSecretRotateIn) GetKey() string { - if o == nil || o.Key.Get() == nil { + if o == nil || IsNil(o.Key.Get()) { var ret string return ret } @@ -54,7 +53,7 @@ func (o *EndpointSecretRotateIn) GetKey() string { // 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 *EndpointSecretRotateIn) GetKeyOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Key.Get(), o.Key.IsSet() @@ -84,11 +83,19 @@ func (o *EndpointSecretRotateIn) UnsetKey() { } func (o EndpointSecretRotateIn) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointSecretRotateIn) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if o.Key.IsSet() { toSerialize["key"] = o.Key.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableEndpointSecretRotateIn struct { diff --git a/go/internal/openapi/model_endpoint_stats.go b/go/internal/openapi/model_endpoint_stats.go index a1155bf66..3e5da724c 100644 --- a/go/internal/openapi/model_endpoint_stats.go +++ b/go/internal/openapi/model_endpoint_stats.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the EndpointStats type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointStats{} + // EndpointStats struct for EndpointStats type EndpointStats struct { Fail int64 `json:"fail"` @@ -22,6 +27,8 @@ type EndpointStats struct { Success int64 `json:"success"` } +type _EndpointStats EndpointStats + // NewEndpointStats instantiates a new EndpointStats 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 @@ -56,7 +63,7 @@ func (o *EndpointStats) GetFail() int64 { // GetFailOk returns a tuple with the Fail field value // and a boolean to check if the value has been set. func (o *EndpointStats) GetFailOk() (*int64, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Fail, true @@ -80,7 +87,7 @@ func (o *EndpointStats) GetPending() int64 { // GetPendingOk returns a tuple with the Pending field value // and a boolean to check if the value has been set. func (o *EndpointStats) GetPendingOk() (*int64, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Pending, true @@ -104,7 +111,7 @@ func (o *EndpointStats) GetSending() int64 { // GetSendingOk returns a tuple with the Sending field value // and a boolean to check if the value has been set. func (o *EndpointStats) GetSendingOk() (*int64, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Sending, true @@ -128,7 +135,7 @@ func (o *EndpointStats) GetSuccess() int64 { // GetSuccessOk returns a tuple with the Success field value // and a boolean to check if the value has been set. func (o *EndpointStats) GetSuccessOk() (*int64, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Success, true @@ -140,20 +147,60 @@ func (o *EndpointStats) SetSuccess(v int64) { } func (o EndpointStats) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointStats) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["fail"] = o.Fail + toSerialize["fail"] = o.Fail + toSerialize["pending"] = o.Pending + toSerialize["sending"] = o.Sending + toSerialize["success"] = o.Success + return toSerialize, nil +} + +func (o *EndpointStats) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "fail", + "pending", + "sending", + "success", } - if true { - toSerialize["pending"] = o.Pending + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["sending"] = o.Sending + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - if true { - toSerialize["success"] = o.Success + + varEndpointStats := _EndpointStats{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEndpointStats) + + if err != nil { + return err } - return json.Marshal(toSerialize) + + *o = EndpointStats(varEndpointStats) + + return err } type NullableEndpointStats struct { diff --git a/go/internal/openapi/model_endpoint_transformation_in.go b/go/internal/openapi/model_endpoint_transformation_in.go index c31e6e843..1a584bc34 100644 --- a/go/internal/openapi/model_endpoint_transformation_in.go +++ b/go/internal/openapi/model_endpoint_transformation_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -14,6 +14,9 @@ import ( "encoding/json" ) +// checks if the EndpointTransformationIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointTransformationIn{} + // EndpointTransformationIn struct for EndpointTransformationIn type EndpointTransformationIn struct { Code NullableString `json:"code,omitempty"` @@ -39,7 +42,7 @@ func NewEndpointTransformationInWithDefaults() *EndpointTransformationIn { // GetCode returns the Code field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointTransformationIn) GetCode() string { - if o == nil || o.Code.Get() == nil { + if o == nil || IsNil(o.Code.Get()) { var ret string return ret } @@ -50,7 +53,7 @@ func (o *EndpointTransformationIn) GetCode() string { // 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 *EndpointTransformationIn) GetCodeOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Code.Get(), o.Code.IsSet() @@ -81,7 +84,7 @@ func (o *EndpointTransformationIn) UnsetCode() { // GetEnabled returns the Enabled field value if set, zero value otherwise. func (o *EndpointTransformationIn) GetEnabled() bool { - if o == nil || o.Enabled == nil { + if o == nil || IsNil(o.Enabled) { var ret bool return ret } @@ -91,7 +94,7 @@ func (o *EndpointTransformationIn) GetEnabled() bool { // GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EndpointTransformationIn) GetEnabledOk() (*bool, bool) { - if o == nil || o.Enabled == nil { + if o == nil || IsNil(o.Enabled) { return nil, false } return o.Enabled, true @@ -99,7 +102,7 @@ func (o *EndpointTransformationIn) GetEnabledOk() (*bool, bool) { // HasEnabled returns a boolean if a field has been set. func (o *EndpointTransformationIn) HasEnabled() bool { - if o != nil && o.Enabled != nil { + if o != nil && !IsNil(o.Enabled) { return true } @@ -112,14 +115,22 @@ func (o *EndpointTransformationIn) SetEnabled(v bool) { } func (o EndpointTransformationIn) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointTransformationIn) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if o.Code.IsSet() { toSerialize["code"] = o.Code.Get() } - if o.Enabled != nil { + if !IsNil(o.Enabled) { toSerialize["enabled"] = o.Enabled } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableEndpointTransformationIn struct { diff --git a/go/internal/openapi/model_endpoint_transformation_out.go b/go/internal/openapi/model_endpoint_transformation_out.go index 57571d43d..4b420ad25 100644 --- a/go/internal/openapi/model_endpoint_transformation_out.go +++ b/go/internal/openapi/model_endpoint_transformation_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -14,6 +14,9 @@ import ( "encoding/json" ) +// checks if the EndpointTransformationOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointTransformationOut{} + // EndpointTransformationOut struct for EndpointTransformationOut type EndpointTransformationOut struct { Code NullableString `json:"code,omitempty"` @@ -43,7 +46,7 @@ func NewEndpointTransformationOutWithDefaults() *EndpointTransformationOut { // GetCode returns the Code field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointTransformationOut) GetCode() string { - if o == nil || o.Code.Get() == nil { + if o == nil || IsNil(o.Code.Get()) { var ret string return ret } @@ -54,7 +57,7 @@ func (o *EndpointTransformationOut) GetCode() string { // 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 *EndpointTransformationOut) GetCodeOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Code.Get(), o.Code.IsSet() @@ -85,7 +88,7 @@ func (o *EndpointTransformationOut) UnsetCode() { // GetEnabled returns the Enabled field value if set, zero value otherwise. func (o *EndpointTransformationOut) GetEnabled() bool { - if o == nil || o.Enabled == nil { + if o == nil || IsNil(o.Enabled) { var ret bool return ret } @@ -95,7 +98,7 @@ func (o *EndpointTransformationOut) GetEnabled() bool { // GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EndpointTransformationOut) GetEnabledOk() (*bool, bool) { - if o == nil || o.Enabled == nil { + if o == nil || IsNil(o.Enabled) { return nil, false } return o.Enabled, true @@ -103,7 +106,7 @@ func (o *EndpointTransformationOut) GetEnabledOk() (*bool, bool) { // HasEnabled returns a boolean if a field has been set. func (o *EndpointTransformationOut) HasEnabled() bool { - if o != nil && o.Enabled != nil { + if o != nil && !IsNil(o.Enabled) { return true } @@ -116,14 +119,22 @@ func (o *EndpointTransformationOut) SetEnabled(v bool) { } func (o EndpointTransformationOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointTransformationOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if o.Code.IsSet() { toSerialize["code"] = o.Code.Get() } - if o.Enabled != nil { + if !IsNil(o.Enabled) { toSerialize["enabled"] = o.Enabled } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableEndpointTransformationOut struct { diff --git a/go/internal/openapi/model_endpoint_transformation_simulate_in.go b/go/internal/openapi/model_endpoint_transformation_simulate_in.go index b2d71d1b3..f5ee7253c 100644 --- a/go/internal/openapi/model_endpoint_transformation_simulate_in.go +++ b/go/internal/openapi/model_endpoint_transformation_simulate_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the EndpointTransformationSimulateIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointTransformationSimulateIn{} + // EndpointTransformationSimulateIn struct for EndpointTransformationSimulateIn type EndpointTransformationSimulateIn struct { Channels []string `json:"channels,omitempty"` @@ -23,6 +28,8 @@ type EndpointTransformationSimulateIn struct { Payload map[string]interface{} `json:"payload"` } +type _EndpointTransformationSimulateIn EndpointTransformationSimulateIn + // NewEndpointTransformationSimulateIn instantiates a new EndpointTransformationSimulateIn 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 @@ -45,7 +52,7 @@ func NewEndpointTransformationSimulateInWithDefaults() *EndpointTransformationSi // GetChannels returns the Channels field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointTransformationSimulateIn) GetChannels() []string { - if o == nil { + if o == nil { var ret []string return ret } @@ -55,16 +62,16 @@ func (o *EndpointTransformationSimulateIn) GetChannels() []string { // GetChannelsOk returns a tuple with the Channels 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 *EndpointTransformationSimulateIn) GetChannelsOk() (*[]string, bool) { - if o == nil || o.Channels == nil { +func (o *EndpointTransformationSimulateIn) GetChannelsOk() ([]string, bool) { + if o == nil || IsNil(o.Channels) { return nil, false } - return &o.Channels, true + return o.Channels, true } // HasChannels returns a boolean if a field has been set. func (o *EndpointTransformationSimulateIn) HasChannels() bool { - if o != nil && o.Channels != nil { + if o != nil && IsNil(o.Channels) { return true } @@ -89,7 +96,7 @@ func (o *EndpointTransformationSimulateIn) GetCode() string { // GetCodeOk returns a tuple with the Code field value // and a boolean to check if the value has been set. func (o *EndpointTransformationSimulateIn) GetCodeOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Code, true @@ -113,7 +120,7 @@ func (o *EndpointTransformationSimulateIn) GetEventType() string { // GetEventTypeOk returns a tuple with the EventType field value // and a boolean to check if the value has been set. func (o *EndpointTransformationSimulateIn) GetEventTypeOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.EventType, true @@ -136,11 +143,11 @@ func (o *EndpointTransformationSimulateIn) GetPayload() map[string]interface{} { // GetPayloadOk returns a tuple with the Payload field value // and a boolean to check if the value has been set. -func (o *EndpointTransformationSimulateIn) GetPayloadOk() (*map[string]interface{}, bool) { - if o == nil { - return nil, false +func (o *EndpointTransformationSimulateIn) GetPayloadOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false } - return &o.Payload, true + return o.Payload, true } // SetPayload sets field value @@ -149,20 +156,61 @@ func (o *EndpointTransformationSimulateIn) SetPayload(v map[string]interface{}) } func (o EndpointTransformationSimulateIn) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointTransformationSimulateIn) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if o.Channels != nil { toSerialize["channels"] = o.Channels } - if true { - toSerialize["code"] = o.Code + toSerialize["code"] = o.Code + toSerialize["eventType"] = o.EventType + toSerialize["payload"] = o.Payload + return toSerialize, nil +} + +func (o *EndpointTransformationSimulateIn) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "code", + "eventType", + "payload", } - if true { - toSerialize["eventType"] = o.EventType + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["payload"] = o.Payload + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varEndpointTransformationSimulateIn := _EndpointTransformationSimulateIn{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEndpointTransformationSimulateIn) + + if err != nil { + return err + } + + *o = EndpointTransformationSimulateIn(varEndpointTransformationSimulateIn) + + return err } type NullableEndpointTransformationSimulateIn struct { diff --git a/go/internal/openapi/model_endpoint_transformation_simulate_out.go b/go/internal/openapi/model_endpoint_transformation_simulate_out.go index 12756777a..376107bbe 100644 --- a/go/internal/openapi/model_endpoint_transformation_simulate_out.go +++ b/go/internal/openapi/model_endpoint_transformation_simulate_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the EndpointTransformationSimulateOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointTransformationSimulateOut{} + // EndpointTransformationSimulateOut struct for EndpointTransformationSimulateOut type EndpointTransformationSimulateOut struct { Method *TransformationHttpMethod `json:"method,omitempty"` @@ -21,6 +26,8 @@ type EndpointTransformationSimulateOut struct { Url string `json:"url"` } +type _EndpointTransformationSimulateOut EndpointTransformationSimulateOut + // NewEndpointTransformationSimulateOut instantiates a new EndpointTransformationSimulateOut 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 @@ -42,7 +49,7 @@ func NewEndpointTransformationSimulateOutWithDefaults() *EndpointTransformationS // GetMethod returns the Method field value if set, zero value otherwise. func (o *EndpointTransformationSimulateOut) GetMethod() TransformationHttpMethod { - if o == nil || o.Method == nil { + if o == nil || IsNil(o.Method) { var ret TransformationHttpMethod return ret } @@ -52,7 +59,7 @@ func (o *EndpointTransformationSimulateOut) GetMethod() TransformationHttpMethod // GetMethodOk returns a tuple with the Method field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EndpointTransformationSimulateOut) GetMethodOk() (*TransformationHttpMethod, bool) { - if o == nil || o.Method == nil { + if o == nil || IsNil(o.Method) { return nil, false } return o.Method, true @@ -60,7 +67,7 @@ func (o *EndpointTransformationSimulateOut) GetMethodOk() (*TransformationHttpMe // HasMethod returns a boolean if a field has been set. func (o *EndpointTransformationSimulateOut) HasMethod() bool { - if o != nil && o.Method != nil { + if o != nil && !IsNil(o.Method) { return true } @@ -85,7 +92,7 @@ func (o *EndpointTransformationSimulateOut) GetPayload() string { // GetPayloadOk returns a tuple with the Payload field value // and a boolean to check if the value has been set. func (o *EndpointTransformationSimulateOut) GetPayloadOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Payload, true @@ -109,7 +116,7 @@ func (o *EndpointTransformationSimulateOut) GetUrl() string { // GetUrlOk returns a tuple with the Url field value // and a boolean to check if the value has been set. func (o *EndpointTransformationSimulateOut) GetUrlOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Url, true @@ -121,17 +128,59 @@ func (o *EndpointTransformationSimulateOut) SetUrl(v string) { } func (o EndpointTransformationSimulateOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointTransformationSimulateOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Method != nil { + if !IsNil(o.Method) { toSerialize["method"] = o.Method } - if true { - toSerialize["payload"] = o.Payload + toSerialize["payload"] = o.Payload + toSerialize["url"] = o.Url + return toSerialize, nil +} + +func (o *EndpointTransformationSimulateOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "payload", + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["url"] = o.Url + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varEndpointTransformationSimulateOut := _EndpointTransformationSimulateOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEndpointTransformationSimulateOut) + + if err != nil { + return err + } + + *o = EndpointTransformationSimulateOut(varEndpointTransformationSimulateOut) + + return err } type NullableEndpointTransformationSimulateOut struct { diff --git a/go/internal/openapi/model_endpoint_update.go b/go/internal/openapi/model_endpoint_update.go index dabd712ba..16e3d1fdb 100644 --- a/go/internal/openapi/model_endpoint_update.go +++ b/go/internal/openapi/model_endpoint_update.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the EndpointUpdate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointUpdate{} + // EndpointUpdate struct for EndpointUpdate type EndpointUpdate struct { // List of message channels this endpoint listens to (omit for all) @@ -26,9 +31,12 @@ type EndpointUpdate struct { // Optional unique identifier for the endpoint Uid NullableString `json:"uid,omitempty"` Url string `json:"url"` + // Deprecated Version NullableInt32 `json:"version,omitempty"` } +type _EndpointUpdate EndpointUpdate + // NewEndpointUpdate instantiates a new EndpointUpdate 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 @@ -61,7 +69,7 @@ func NewEndpointUpdateWithDefaults() *EndpointUpdate { // GetChannels returns the Channels field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointUpdate) GetChannels() []string { - if o == nil { + if o == nil { var ret []string return ret } @@ -71,16 +79,16 @@ func (o *EndpointUpdate) GetChannels() []string { // GetChannelsOk returns a tuple with the Channels 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 *EndpointUpdate) GetChannelsOk() (*[]string, bool) { - if o == nil || o.Channels == nil { +func (o *EndpointUpdate) GetChannelsOk() ([]string, bool) { + if o == nil || IsNil(o.Channels) { return nil, false } - return &o.Channels, true + return o.Channels, true } // HasChannels returns a boolean if a field has been set. func (o *EndpointUpdate) HasChannels() bool { - if o != nil && o.Channels != nil { + if o != nil && IsNil(o.Channels) { return true } @@ -94,7 +102,7 @@ func (o *EndpointUpdate) SetChannels(v []string) { // GetDescription returns the Description field value if set, zero value otherwise. func (o *EndpointUpdate) GetDescription() string { - if o == nil || o.Description == nil { + if o == nil || IsNil(o.Description) { var ret string return ret } @@ -104,7 +112,7 @@ func (o *EndpointUpdate) GetDescription() string { // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EndpointUpdate) GetDescriptionOk() (*string, bool) { - if o == nil || o.Description == nil { + if o == nil || IsNil(o.Description) { return nil, false } return o.Description, true @@ -112,7 +120,7 @@ func (o *EndpointUpdate) GetDescriptionOk() (*string, bool) { // HasDescription returns a boolean if a field has been set. func (o *EndpointUpdate) HasDescription() bool { - if o != nil && o.Description != nil { + if o != nil && !IsNil(o.Description) { return true } @@ -126,7 +134,7 @@ func (o *EndpointUpdate) SetDescription(v string) { // GetDisabled returns the Disabled field value if set, zero value otherwise. func (o *EndpointUpdate) GetDisabled() bool { - if o == nil || o.Disabled == nil { + if o == nil || IsNil(o.Disabled) { var ret bool return ret } @@ -136,7 +144,7 @@ func (o *EndpointUpdate) GetDisabled() bool { // GetDisabledOk returns a tuple with the Disabled field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EndpointUpdate) GetDisabledOk() (*bool, bool) { - if o == nil || o.Disabled == nil { + if o == nil || IsNil(o.Disabled) { return nil, false } return o.Disabled, true @@ -144,7 +152,7 @@ func (o *EndpointUpdate) GetDisabledOk() (*bool, bool) { // HasDisabled returns a boolean if a field has been set. func (o *EndpointUpdate) HasDisabled() bool { - if o != nil && o.Disabled != nil { + if o != nil && !IsNil(o.Disabled) { return true } @@ -158,7 +166,7 @@ func (o *EndpointUpdate) SetDisabled(v bool) { // GetFilterTypes returns the FilterTypes field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointUpdate) GetFilterTypes() []string { - if o == nil { + if o == nil { var ret []string return ret } @@ -168,16 +176,16 @@ func (o *EndpointUpdate) GetFilterTypes() []string { // GetFilterTypesOk returns a tuple with the FilterTypes field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *EndpointUpdate) GetFilterTypesOk() (*[]string, bool) { - if o == nil || o.FilterTypes == nil { +func (o *EndpointUpdate) GetFilterTypesOk() ([]string, bool) { + if o == nil || IsNil(o.FilterTypes) { return nil, false } - return &o.FilterTypes, true + return o.FilterTypes, true } // HasFilterTypes returns a boolean if a field has been set. func (o *EndpointUpdate) HasFilterTypes() bool { - if o != nil && o.FilterTypes != nil { + if o != nil && IsNil(o.FilterTypes) { return true } @@ -191,7 +199,7 @@ func (o *EndpointUpdate) SetFilterTypes(v []string) { // GetMetadata returns the Metadata field value if set, zero value otherwise. func (o *EndpointUpdate) GetMetadata() map[string]string { - if o == nil || o.Metadata == nil { + if o == nil || IsNil(o.Metadata) { var ret map[string]string return ret } @@ -201,7 +209,7 @@ func (o *EndpointUpdate) GetMetadata() map[string]string { // GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EndpointUpdate) GetMetadataOk() (*map[string]string, bool) { - if o == nil || o.Metadata == nil { + if o == nil || IsNil(o.Metadata) { return nil, false } return o.Metadata, true @@ -209,7 +217,7 @@ func (o *EndpointUpdate) GetMetadataOk() (*map[string]string, bool) { // HasMetadata returns a boolean if a field has been set. func (o *EndpointUpdate) HasMetadata() bool { - if o != nil && o.Metadata != nil { + if o != nil && !IsNil(o.Metadata) { return true } @@ -223,7 +231,7 @@ func (o *EndpointUpdate) SetMetadata(v map[string]string) { // GetRateLimit returns the RateLimit field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointUpdate) GetRateLimit() int32 { - if o == nil || o.RateLimit.Get() == nil { + if o == nil || IsNil(o.RateLimit.Get()) { var ret int32 return ret } @@ -234,7 +242,7 @@ func (o *EndpointUpdate) GetRateLimit() int32 { // 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 *EndpointUpdate) GetRateLimitOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return o.RateLimit.Get(), o.RateLimit.IsSet() @@ -265,7 +273,7 @@ func (o *EndpointUpdate) UnsetRateLimit() { // GetUid returns the Uid field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointUpdate) GetUid() string { - if o == nil || o.Uid.Get() == nil { + if o == nil || IsNil(o.Uid.Get()) { var ret string return ret } @@ -276,7 +284,7 @@ func (o *EndpointUpdate) GetUid() string { // 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 *EndpointUpdate) GetUidOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Uid.Get(), o.Uid.IsSet() @@ -318,7 +326,7 @@ func (o *EndpointUpdate) GetUrl() string { // GetUrlOk returns a tuple with the Url field value // and a boolean to check if the value has been set. func (o *EndpointUpdate) GetUrlOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Url, true @@ -330,8 +338,9 @@ func (o *EndpointUpdate) SetUrl(v string) { } // GetVersion returns the Version field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated func (o *EndpointUpdate) GetVersion() int32 { - if o == nil || o.Version.Get() == nil { + if o == nil || IsNil(o.Version.Get()) { var ret int32 return ret } @@ -341,8 +350,9 @@ func (o *EndpointUpdate) GetVersion() int32 { // GetVersionOk returns a tuple with the Version 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 +// Deprecated func (o *EndpointUpdate) GetVersionOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return o.Version.Get(), o.Version.IsSet() @@ -358,6 +368,7 @@ func (o *EndpointUpdate) HasVersion() bool { } // SetVersion gets a reference to the given NullableInt32 and assigns it to the Version field. +// Deprecated func (o *EndpointUpdate) SetVersion(v int32) { o.Version.Set(&v) } @@ -372,20 +383,28 @@ func (o *EndpointUpdate) UnsetVersion() { } func (o EndpointUpdate) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointUpdate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if o.Channels != nil { toSerialize["channels"] = o.Channels } - if o.Description != nil { + if !IsNil(o.Description) { toSerialize["description"] = o.Description } - if o.Disabled != nil { + if !IsNil(o.Disabled) { toSerialize["disabled"] = o.Disabled } if o.FilterTypes != nil { toSerialize["filterTypes"] = o.FilterTypes } - if o.Metadata != nil { + if !IsNil(o.Metadata) { toSerialize["metadata"] = o.Metadata } if o.RateLimit.IsSet() { @@ -394,13 +413,48 @@ func (o EndpointUpdate) MarshalJSON() ([]byte, error) { if o.Uid.IsSet() { toSerialize["uid"] = o.Uid.Get() } - if true { - toSerialize["url"] = o.Url - } + toSerialize["url"] = o.Url if o.Version.IsSet() { toSerialize["version"] = o.Version.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *EndpointUpdate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEndpointUpdate := _EndpointUpdate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEndpointUpdate) + + if err != nil { + return err + } + + *o = EndpointUpdate(varEndpointUpdate) + + return err } type NullableEndpointUpdate struct { diff --git a/go/internal/openapi/model_endpoint_updated_event.go b/go/internal/openapi/model_endpoint_updated_event.go index 9dd26875b..762fed4da 100644 --- a/go/internal/openapi/model_endpoint_updated_event.go +++ b/go/internal/openapi/model_endpoint_updated_event.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,14 +12,21 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the EndpointUpdatedEvent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointUpdatedEvent{} + // EndpointUpdatedEvent Sent when an endpoint is updated. type EndpointUpdatedEvent struct { Data EndpointUpdatedEventData `json:"data"` Type string `json:"type"` } +type _EndpointUpdatedEvent EndpointUpdatedEvent + // NewEndpointUpdatedEvent instantiates a new EndpointUpdatedEvent 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 @@ -54,7 +61,7 @@ func (o *EndpointUpdatedEvent) GetData() EndpointUpdatedEventData { // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. func (o *EndpointUpdatedEvent) GetDataOk() (*EndpointUpdatedEventData, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Data, true @@ -78,7 +85,7 @@ func (o *EndpointUpdatedEvent) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *EndpointUpdatedEvent) GetTypeOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Type, true @@ -90,14 +97,56 @@ func (o *EndpointUpdatedEvent) SetType(v string) { } func (o EndpointUpdatedEvent) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointUpdatedEvent) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["data"] = o.Data + toSerialize["data"] = o.Data + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *EndpointUpdatedEvent) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["type"] = o.Type + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varEndpointUpdatedEvent := _EndpointUpdatedEvent{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEndpointUpdatedEvent) + + if err != nil { + return err + } + + *o = EndpointUpdatedEvent(varEndpointUpdatedEvent) + + return err } type NullableEndpointUpdatedEvent struct { diff --git a/go/internal/openapi/model_endpoint_updated_event_data.go b/go/internal/openapi/model_endpoint_updated_event_data.go index b1acf1fb0..131f12cd8 100644 --- a/go/internal/openapi/model_endpoint_updated_event_data.go +++ b/go/internal/openapi/model_endpoint_updated_event_data.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the EndpointUpdatedEventData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointUpdatedEventData{} + // EndpointUpdatedEventData struct for EndpointUpdatedEventData type EndpointUpdatedEventData struct { // The app's ID @@ -26,6 +31,8 @@ type EndpointUpdatedEventData struct { EndpointUid NullableString `json:"endpointUid,omitempty"` } +type _EndpointUpdatedEventData EndpointUpdatedEventData + // NewEndpointUpdatedEventData instantiates a new EndpointUpdatedEventData 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 @@ -58,7 +65,7 @@ func (o *EndpointUpdatedEventData) GetAppId() string { // GetAppIdOk returns a tuple with the AppId field value // and a boolean to check if the value has been set. func (o *EndpointUpdatedEventData) GetAppIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.AppId, true @@ -71,7 +78,7 @@ func (o *EndpointUpdatedEventData) SetAppId(v string) { // GetAppUid returns the AppUid field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointUpdatedEventData) GetAppUid() string { - if o == nil || o.AppUid.Get() == nil { + if o == nil || IsNil(o.AppUid.Get()) { var ret string return ret } @@ -82,7 +89,7 @@ func (o *EndpointUpdatedEventData) GetAppUid() string { // 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 *EndpointUpdatedEventData) GetAppUidOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.AppUid.Get(), o.AppUid.IsSet() @@ -124,7 +131,7 @@ func (o *EndpointUpdatedEventData) GetEndpointId() string { // GetEndpointIdOk returns a tuple with the EndpointId field value // and a boolean to check if the value has been set. func (o *EndpointUpdatedEventData) GetEndpointIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.EndpointId, true @@ -137,7 +144,7 @@ func (o *EndpointUpdatedEventData) SetEndpointId(v string) { // GetEndpointUid returns the EndpointUid field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EndpointUpdatedEventData) GetEndpointUid() string { - if o == nil || o.EndpointUid.Get() == nil { + if o == nil || IsNil(o.EndpointUid.Get()) { var ret string return ret } @@ -148,7 +155,7 @@ func (o *EndpointUpdatedEventData) GetEndpointUid() string { // 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 *EndpointUpdatedEventData) GetEndpointUidOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.EndpointUid.Get(), o.EndpointUid.IsSet() @@ -178,20 +185,62 @@ func (o *EndpointUpdatedEventData) UnsetEndpointUid() { } func (o EndpointUpdatedEventData) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["appId"] = o.AppId + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o EndpointUpdatedEventData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["appId"] = o.AppId if o.AppUid.IsSet() { toSerialize["appUid"] = o.AppUid.Get() } - if true { - toSerialize["endpointId"] = o.EndpointId - } + toSerialize["endpointId"] = o.EndpointId if o.EndpointUid.IsSet() { toSerialize["endpointUid"] = o.EndpointUid.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *EndpointUpdatedEventData) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "appId", + "endpointId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEndpointUpdatedEventData := _EndpointUpdatedEventData{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEndpointUpdatedEventData) + + if err != nil { + return err + } + + *o = EndpointUpdatedEventData(varEndpointUpdatedEventData) + + return err } type NullableEndpointUpdatedEventData struct { diff --git a/go/internal/openapi/model_environment_in.go b/go/internal/openapi/model_environment_in.go index f8377d09f..351d2ecbe 100644 --- a/go/internal/openapi/model_environment_in.go +++ b/go/internal/openapi/model_environment_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -13,8 +13,13 @@ package openapi import ( "encoding/json" "time" + "bytes" + "fmt" ) +// checks if the EnvironmentIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EnvironmentIn{} + // EnvironmentIn struct for EnvironmentIn type EnvironmentIn struct { CreatedAt time.Time `json:"createdAt"` @@ -23,6 +28,8 @@ type EnvironmentIn struct { Version int32 `json:"version"` } +type _EnvironmentIn EnvironmentIn + // NewEnvironmentIn instantiates a new EnvironmentIn object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -55,7 +62,7 @@ func (o *EnvironmentIn) GetCreatedAt() time.Time { // GetCreatedAtOk returns a tuple with the CreatedAt field value // and a boolean to check if the value has been set. func (o *EnvironmentIn) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.CreatedAt, true @@ -68,7 +75,7 @@ func (o *EnvironmentIn) SetCreatedAt(v time.Time) { // GetEventTypes returns the EventTypes field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EnvironmentIn) GetEventTypes() []EventTypeIn { - if o == nil { + if o == nil { var ret []EventTypeIn return ret } @@ -78,16 +85,16 @@ func (o *EnvironmentIn) GetEventTypes() []EventTypeIn { // GetEventTypesOk returns a tuple with the EventTypes field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *EnvironmentIn) GetEventTypesOk() (*[]EventTypeIn, bool) { - if o == nil || o.EventTypes == nil { +func (o *EnvironmentIn) GetEventTypesOk() ([]EventTypeIn, bool) { + if o == nil || IsNil(o.EventTypes) { return nil, false } - return &o.EventTypes, true + return o.EventTypes, true } // HasEventTypes returns a boolean if a field has been set. func (o *EnvironmentIn) HasEventTypes() bool { - if o != nil && o.EventTypes != nil { + if o != nil && IsNil(o.EventTypes) { return true } @@ -101,7 +108,7 @@ func (o *EnvironmentIn) SetEventTypes(v []EventTypeIn) { // GetSettings returns the Settings field value if set, zero value otherwise. func (o *EnvironmentIn) GetSettings() SettingsIn { - if o == nil || o.Settings == nil { + if o == nil || IsNil(o.Settings) { var ret SettingsIn return ret } @@ -111,7 +118,7 @@ func (o *EnvironmentIn) GetSettings() SettingsIn { // GetSettingsOk returns a tuple with the Settings field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EnvironmentIn) GetSettingsOk() (*SettingsIn, bool) { - if o == nil || o.Settings == nil { + if o == nil || IsNil(o.Settings) { return nil, false } return o.Settings, true @@ -119,7 +126,7 @@ func (o *EnvironmentIn) GetSettingsOk() (*SettingsIn, bool) { // HasSettings returns a boolean if a field has been set. func (o *EnvironmentIn) HasSettings() bool { - if o != nil && o.Settings != nil { + if o != nil && !IsNil(o.Settings) { return true } @@ -144,7 +151,7 @@ func (o *EnvironmentIn) GetVersion() int32 { // GetVersionOk returns a tuple with the Version field value // and a boolean to check if the value has been set. func (o *EnvironmentIn) GetVersionOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Version, true @@ -156,20 +163,62 @@ func (o *EnvironmentIn) SetVersion(v int32) { } func (o EnvironmentIn) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["createdAt"] = o.CreatedAt + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o EnvironmentIn) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["createdAt"] = o.CreatedAt if o.EventTypes != nil { toSerialize["eventTypes"] = o.EventTypes } - if o.Settings != nil { + if !IsNil(o.Settings) { toSerialize["settings"] = o.Settings } - if true { - toSerialize["version"] = o.Version + toSerialize["version"] = o.Version + return toSerialize, nil +} + +func (o *EnvironmentIn) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "createdAt", + "version", } - return json.Marshal(toSerialize) + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEnvironmentIn := _EnvironmentIn{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEnvironmentIn) + + if err != nil { + return err + } + + *o = EnvironmentIn(varEnvironmentIn) + + return err } type NullableEnvironmentIn struct { diff --git a/go/internal/openapi/model_environment_out.go b/go/internal/openapi/model_environment_out.go index 3698ad562..d419a98a5 100644 --- a/go/internal/openapi/model_environment_out.go +++ b/go/internal/openapi/model_environment_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -13,8 +13,13 @@ package openapi import ( "encoding/json" "time" + "bytes" + "fmt" ) +// checks if the EnvironmentOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EnvironmentOut{} + // EnvironmentOut struct for EnvironmentOut type EnvironmentOut struct { CreatedAt time.Time `json:"createdAt"` @@ -23,6 +28,8 @@ type EnvironmentOut struct { Version *int32 `json:"version,omitempty"` } +type _EnvironmentOut EnvironmentOut + // NewEnvironmentOut instantiates a new EnvironmentOut 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 @@ -59,7 +66,7 @@ func (o *EnvironmentOut) GetCreatedAt() time.Time { // GetCreatedAtOk returns a tuple with the CreatedAt field value // and a boolean to check if the value has been set. func (o *EnvironmentOut) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.CreatedAt, true @@ -82,11 +89,11 @@ func (o *EnvironmentOut) GetEventTypes() []EventTypeOut { // GetEventTypesOk returns a tuple with the EventTypes field value // and a boolean to check if the value has been set. -func (o *EnvironmentOut) GetEventTypesOk() (*[]EventTypeOut, bool) { - if o == nil { +func (o *EnvironmentOut) GetEventTypesOk() ([]EventTypeOut, bool) { + if o == nil { return nil, false } - return &o.EventTypes, true + return o.EventTypes, true } // SetEventTypes sets field value @@ -96,7 +103,7 @@ func (o *EnvironmentOut) SetEventTypes(v []EventTypeOut) { // GetSettings returns the Settings field value if set, zero value otherwise. func (o *EnvironmentOut) GetSettings() SettingsOut { - if o == nil || o.Settings == nil { + if o == nil || IsNil(o.Settings) { var ret SettingsOut return ret } @@ -106,7 +113,7 @@ func (o *EnvironmentOut) GetSettings() SettingsOut { // GetSettingsOk returns a tuple with the Settings field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EnvironmentOut) GetSettingsOk() (*SettingsOut, bool) { - if o == nil || o.Settings == nil { + if o == nil || IsNil(o.Settings) { return nil, false } return o.Settings, true @@ -114,7 +121,7 @@ func (o *EnvironmentOut) GetSettingsOk() (*SettingsOut, bool) { // HasSettings returns a boolean if a field has been set. func (o *EnvironmentOut) HasSettings() bool { - if o != nil && o.Settings != nil { + if o != nil && !IsNil(o.Settings) { return true } @@ -128,7 +135,7 @@ func (o *EnvironmentOut) SetSettings(v SettingsOut) { // GetVersion returns the Version field value if set, zero value otherwise. func (o *EnvironmentOut) GetVersion() int32 { - if o == nil || o.Version == nil { + if o == nil || IsNil(o.Version) { var ret int32 return ret } @@ -138,7 +145,7 @@ func (o *EnvironmentOut) GetVersion() int32 { // GetVersionOk returns a tuple with the Version field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EnvironmentOut) GetVersionOk() (*int32, bool) { - if o == nil || o.Version == nil { + if o == nil || IsNil(o.Version) { return nil, false } return o.Version, true @@ -146,7 +153,7 @@ func (o *EnvironmentOut) GetVersionOk() (*int32, bool) { // HasVersion returns a boolean if a field has been set. func (o *EnvironmentOut) HasVersion() bool { - if o != nil && o.Version != nil { + if o != nil && !IsNil(o.Version) { return true } @@ -159,20 +166,62 @@ func (o *EnvironmentOut) SetVersion(v int32) { } func (o EnvironmentOut) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["createdAt"] = o.CreatedAt + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if true { - toSerialize["eventTypes"] = o.EventTypes - } - if o.Settings != nil { + return json.Marshal(toSerialize) +} + +func (o EnvironmentOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["createdAt"] = o.CreatedAt + toSerialize["eventTypes"] = o.EventTypes + if !IsNil(o.Settings) { toSerialize["settings"] = o.Settings } - if o.Version != nil { + if !IsNil(o.Version) { toSerialize["version"] = o.Version } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *EnvironmentOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "createdAt", + "eventTypes", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEnvironmentOut := _EnvironmentOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEnvironmentOut) + + if err != nil { + return err + } + + *o = EnvironmentOut(varEnvironmentOut) + + return err } type NullableEnvironmentOut struct { diff --git a/go/internal/openapi/model_environment_settings_out.go b/go/internal/openapi/model_environment_settings_out.go index 20597eda7..3030b81ec 100644 --- a/go/internal/openapi/model_environment_settings_out.go +++ b/go/internal/openapi/model_environment_settings_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -14,6 +14,9 @@ import ( "encoding/json" ) +// checks if the EnvironmentSettingsOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EnvironmentSettingsOut{} + // EnvironmentSettingsOut struct for EnvironmentSettingsOut type EnvironmentSettingsOut struct { ColorPaletteDark *CustomColorPalette `json:"colorPaletteDark,omitempty"` @@ -60,7 +63,7 @@ func NewEnvironmentSettingsOutWithDefaults() *EnvironmentSettingsOut { // GetColorPaletteDark returns the ColorPaletteDark field value if set, zero value otherwise. func (o *EnvironmentSettingsOut) GetColorPaletteDark() CustomColorPalette { - if o == nil || o.ColorPaletteDark == nil { + if o == nil || IsNil(o.ColorPaletteDark) { var ret CustomColorPalette return ret } @@ -70,7 +73,7 @@ func (o *EnvironmentSettingsOut) GetColorPaletteDark() CustomColorPalette { // GetColorPaletteDarkOk returns a tuple with the ColorPaletteDark field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EnvironmentSettingsOut) GetColorPaletteDarkOk() (*CustomColorPalette, bool) { - if o == nil || o.ColorPaletteDark == nil { + if o == nil || IsNil(o.ColorPaletteDark) { return nil, false } return o.ColorPaletteDark, true @@ -78,7 +81,7 @@ func (o *EnvironmentSettingsOut) GetColorPaletteDarkOk() (*CustomColorPalette, b // HasColorPaletteDark returns a boolean if a field has been set. func (o *EnvironmentSettingsOut) HasColorPaletteDark() bool { - if o != nil && o.ColorPaletteDark != nil { + if o != nil && !IsNil(o.ColorPaletteDark) { return true } @@ -92,7 +95,7 @@ func (o *EnvironmentSettingsOut) SetColorPaletteDark(v CustomColorPalette) { // GetColorPaletteLight returns the ColorPaletteLight field value if set, zero value otherwise. func (o *EnvironmentSettingsOut) GetColorPaletteLight() CustomColorPalette { - if o == nil || o.ColorPaletteLight == nil { + if o == nil || IsNil(o.ColorPaletteLight) { var ret CustomColorPalette return ret } @@ -102,7 +105,7 @@ func (o *EnvironmentSettingsOut) GetColorPaletteLight() CustomColorPalette { // GetColorPaletteLightOk returns a tuple with the ColorPaletteLight field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EnvironmentSettingsOut) GetColorPaletteLightOk() (*CustomColorPalette, bool) { - if o == nil || o.ColorPaletteLight == nil { + if o == nil || IsNil(o.ColorPaletteLight) { return nil, false } return o.ColorPaletteLight, true @@ -110,7 +113,7 @@ func (o *EnvironmentSettingsOut) GetColorPaletteLightOk() (*CustomColorPalette, // HasColorPaletteLight returns a boolean if a field has been set. func (o *EnvironmentSettingsOut) HasColorPaletteLight() bool { - if o != nil && o.ColorPaletteLight != nil { + if o != nil && !IsNil(o.ColorPaletteLight) { return true } @@ -124,7 +127,7 @@ func (o *EnvironmentSettingsOut) SetColorPaletteLight(v CustomColorPalette) { // GetCustomColor returns the CustomColor field value if set, zero value otherwise. func (o *EnvironmentSettingsOut) GetCustomColor() string { - if o == nil || o.CustomColor == nil { + if o == nil || IsNil(o.CustomColor) { var ret string return ret } @@ -134,7 +137,7 @@ func (o *EnvironmentSettingsOut) GetCustomColor() string { // GetCustomColorOk returns a tuple with the CustomColor field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EnvironmentSettingsOut) GetCustomColorOk() (*string, bool) { - if o == nil || o.CustomColor == nil { + if o == nil || IsNil(o.CustomColor) { return nil, false } return o.CustomColor, true @@ -142,7 +145,7 @@ func (o *EnvironmentSettingsOut) GetCustomColorOk() (*string, bool) { // HasCustomColor returns a boolean if a field has been set. func (o *EnvironmentSettingsOut) HasCustomColor() bool { - if o != nil && o.CustomColor != nil { + if o != nil && !IsNil(o.CustomColor) { return true } @@ -156,7 +159,7 @@ func (o *EnvironmentSettingsOut) SetCustomColor(v string) { // GetCustomFontFamily returns the CustomFontFamily field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EnvironmentSettingsOut) GetCustomFontFamily() string { - if o == nil || o.CustomFontFamily.Get() == nil { + if o == nil || IsNil(o.CustomFontFamily.Get()) { var ret string return ret } @@ -167,7 +170,7 @@ func (o *EnvironmentSettingsOut) GetCustomFontFamily() string { // 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) GetCustomFontFamilyOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.CustomFontFamily.Get(), o.CustomFontFamily.IsSet() @@ -198,7 +201,7 @@ func (o *EnvironmentSettingsOut) UnsetCustomFontFamily() { // GetCustomFontFamilyUrl returns the CustomFontFamilyUrl field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EnvironmentSettingsOut) GetCustomFontFamilyUrl() string { - if o == nil || o.CustomFontFamilyUrl.Get() == nil { + if o == nil || IsNil(o.CustomFontFamilyUrl.Get()) { var ret string return ret } @@ -209,7 +212,7 @@ func (o *EnvironmentSettingsOut) GetCustomFontFamilyUrl() string { // 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) GetCustomFontFamilyUrlOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.CustomFontFamilyUrl.Get(), o.CustomFontFamilyUrl.IsSet() @@ -240,7 +243,7 @@ func (o *EnvironmentSettingsOut) UnsetCustomFontFamilyUrl() { // GetCustomLogoUrl returns the CustomLogoUrl field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EnvironmentSettingsOut) GetCustomLogoUrl() string { - if o == nil || o.CustomLogoUrl.Get() == nil { + if o == nil || IsNil(o.CustomLogoUrl.Get()) { var ret string return ret } @@ -251,7 +254,7 @@ func (o *EnvironmentSettingsOut) GetCustomLogoUrl() string { // 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) GetCustomLogoUrlOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.CustomLogoUrl.Get(), o.CustomLogoUrl.IsSet() @@ -282,7 +285,7 @@ func (o *EnvironmentSettingsOut) UnsetCustomLogoUrl() { // GetCustomThemeOverride returns the CustomThemeOverride field value if set, zero value otherwise. func (o *EnvironmentSettingsOut) GetCustomThemeOverride() CustomThemeOverride { - if o == nil || o.CustomThemeOverride == nil { + if o == nil || IsNil(o.CustomThemeOverride) { var ret CustomThemeOverride return ret } @@ -292,7 +295,7 @@ func (o *EnvironmentSettingsOut) GetCustomThemeOverride() CustomThemeOverride { // GetCustomThemeOverrideOk returns a tuple with the CustomThemeOverride field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EnvironmentSettingsOut) GetCustomThemeOverrideOk() (*CustomThemeOverride, bool) { - if o == nil || o.CustomThemeOverride == nil { + if o == nil || IsNil(o.CustomThemeOverride) { return nil, false } return o.CustomThemeOverride, true @@ -300,7 +303,7 @@ func (o *EnvironmentSettingsOut) GetCustomThemeOverrideOk() (*CustomThemeOverrid // HasCustomThemeOverride returns a boolean if a field has been set. func (o *EnvironmentSettingsOut) HasCustomThemeOverride() bool { - if o != nil && o.CustomThemeOverride != nil { + if o != nil && !IsNil(o.CustomThemeOverride) { return true } @@ -314,7 +317,7 @@ func (o *EnvironmentSettingsOut) SetCustomThemeOverride(v CustomThemeOverride) { // GetDisplayName returns the DisplayName field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EnvironmentSettingsOut) GetDisplayName() string { - if o == nil || o.DisplayName.Get() == nil { + if o == nil || IsNil(o.DisplayName.Get()) { var ret string return ret } @@ -325,7 +328,7 @@ func (o *EnvironmentSettingsOut) GetDisplayName() string { // 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) GetDisplayNameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.DisplayName.Get(), o.DisplayName.IsSet() @@ -356,7 +359,7 @@ func (o *EnvironmentSettingsOut) UnsetDisplayName() { // GetEnableChannels returns the EnableChannels field value if set, zero value otherwise. func (o *EnvironmentSettingsOut) GetEnableChannels() bool { - if o == nil || o.EnableChannels == nil { + if o == nil || IsNil(o.EnableChannels) { var ret bool return ret } @@ -366,7 +369,7 @@ func (o *EnvironmentSettingsOut) GetEnableChannels() bool { // GetEnableChannelsOk returns a tuple with the EnableChannels field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EnvironmentSettingsOut) GetEnableChannelsOk() (*bool, bool) { - if o == nil || o.EnableChannels == nil { + if o == nil || IsNil(o.EnableChannels) { return nil, false } return o.EnableChannels, true @@ -374,7 +377,7 @@ func (o *EnvironmentSettingsOut) GetEnableChannelsOk() (*bool, bool) { // HasEnableChannels returns a boolean if a field has been set. func (o *EnvironmentSettingsOut) HasEnableChannels() bool { - if o != nil && o.EnableChannels != nil { + if o != nil && !IsNil(o.EnableChannels) { return true } @@ -388,7 +391,7 @@ func (o *EnvironmentSettingsOut) SetEnableChannels(v bool) { // GetEnableIntegrationManagement returns the EnableIntegrationManagement field value if set, zero value otherwise. func (o *EnvironmentSettingsOut) GetEnableIntegrationManagement() bool { - if o == nil || o.EnableIntegrationManagement == nil { + if o == nil || IsNil(o.EnableIntegrationManagement) { var ret bool return ret } @@ -398,7 +401,7 @@ func (o *EnvironmentSettingsOut) GetEnableIntegrationManagement() bool { // GetEnableIntegrationManagementOk returns a tuple with the EnableIntegrationManagement field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EnvironmentSettingsOut) GetEnableIntegrationManagementOk() (*bool, bool) { - if o == nil || o.EnableIntegrationManagement == nil { + if o == nil || IsNil(o.EnableIntegrationManagement) { return nil, false } return o.EnableIntegrationManagement, true @@ -406,7 +409,7 @@ func (o *EnvironmentSettingsOut) GetEnableIntegrationManagementOk() (*bool, bool // HasEnableIntegrationManagement returns a boolean if a field has been set. func (o *EnvironmentSettingsOut) HasEnableIntegrationManagement() bool { - if o != nil && o.EnableIntegrationManagement != nil { + if o != nil && !IsNil(o.EnableIntegrationManagement) { return true } @@ -420,7 +423,7 @@ func (o *EnvironmentSettingsOut) SetEnableIntegrationManagement(v bool) { // GetEnableTransformations returns the EnableTransformations field value if set, zero value otherwise. func (o *EnvironmentSettingsOut) GetEnableTransformations() bool { - if o == nil || o.EnableTransformations == nil { + if o == nil || IsNil(o.EnableTransformations) { var ret bool return ret } @@ -430,7 +433,7 @@ func (o *EnvironmentSettingsOut) GetEnableTransformations() bool { // GetEnableTransformationsOk returns a tuple with the EnableTransformations field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EnvironmentSettingsOut) GetEnableTransformationsOk() (*bool, bool) { - if o == nil || o.EnableTransformations == nil { + if o == nil || IsNil(o.EnableTransformations) { return nil, false } return o.EnableTransformations, true @@ -438,7 +441,7 @@ func (o *EnvironmentSettingsOut) GetEnableTransformationsOk() (*bool, bool) { // HasEnableTransformations returns a boolean if a field has been set. func (o *EnvironmentSettingsOut) HasEnableTransformations() bool { - if o != nil && o.EnableTransformations != nil { + if o != nil && !IsNil(o.EnableTransformations) { return true } @@ -451,14 +454,22 @@ func (o *EnvironmentSettingsOut) SetEnableTransformations(v bool) { } func (o EnvironmentSettingsOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EnvironmentSettingsOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.ColorPaletteDark != nil { + if !IsNil(o.ColorPaletteDark) { toSerialize["colorPaletteDark"] = o.ColorPaletteDark } - if o.ColorPaletteLight != nil { + if !IsNil(o.ColorPaletteLight) { toSerialize["colorPaletteLight"] = o.ColorPaletteLight } - if o.CustomColor != nil { + if !IsNil(o.CustomColor) { toSerialize["customColor"] = o.CustomColor } if o.CustomFontFamily.IsSet() { @@ -470,22 +481,22 @@ func (o EnvironmentSettingsOut) MarshalJSON() ([]byte, error) { if o.CustomLogoUrl.IsSet() { toSerialize["customLogoUrl"] = o.CustomLogoUrl.Get() } - if o.CustomThemeOverride != nil { + if !IsNil(o.CustomThemeOverride) { toSerialize["customThemeOverride"] = o.CustomThemeOverride } if o.DisplayName.IsSet() { toSerialize["displayName"] = o.DisplayName.Get() } - if o.EnableChannels != nil { + if !IsNil(o.EnableChannels) { toSerialize["enableChannels"] = o.EnableChannels } - if o.EnableIntegrationManagement != nil { + if !IsNil(o.EnableIntegrationManagement) { toSerialize["enableIntegrationManagement"] = o.EnableIntegrationManagement } - if o.EnableTransformations != nil { + if !IsNil(o.EnableTransformations) { toSerialize["enableTransformations"] = o.EnableTransformations } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableEnvironmentSettingsOut struct { diff --git a/go/internal/openapi/model_event_example_in.go b/go/internal/openapi/model_event_example_in.go index 22bd5cd1f..30ebb8499 100644 --- a/go/internal/openapi/model_event_example_in.go +++ b/go/internal/openapi/model_event_example_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,14 +12,21 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the EventExampleIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EventExampleIn{} + // EventExampleIn struct for EventExampleIn type EventExampleIn struct { // The event type's name EventType string `json:"eventType"` } +type _EventExampleIn EventExampleIn + // NewEventExampleIn instantiates a new EventExampleIn 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 @@ -51,7 +58,7 @@ func (o *EventExampleIn) GetEventType() string { // GetEventTypeOk returns a tuple with the EventType field value // and a boolean to check if the value has been set. func (o *EventExampleIn) GetEventTypeOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.EventType, true @@ -63,13 +70,56 @@ func (o *EventExampleIn) SetEventType(v string) { } func (o EventExampleIn) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["eventType"] = o.EventType + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o EventExampleIn) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["eventType"] = o.EventType + return toSerialize, nil +} + +func (o *EventExampleIn) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "eventType", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEventExampleIn := _EventExampleIn{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEventExampleIn) + + if err != nil { + return err + } + + *o = EventExampleIn(varEventExampleIn) + + return err +} + type NullableEventExampleIn struct { value *EventExampleIn isSet bool diff --git a/go/internal/openapi/model_event_type_example_out.go b/go/internal/openapi/model_event_type_example_out.go index 03efd83cf..444348e4d 100644 --- a/go/internal/openapi/model_event_type_example_out.go +++ b/go/internal/openapi/model_event_type_example_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,13 +12,20 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the EventTypeExampleOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EventTypeExampleOut{} + // EventTypeExampleOut struct for EventTypeExampleOut type EventTypeExampleOut struct { Example map[string]map[string]interface{} `json:"example"` } +type _EventTypeExampleOut EventTypeExampleOut + // NewEventTypeExampleOut instantiates a new EventTypeExampleOut 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 @@ -49,11 +56,11 @@ func (o *EventTypeExampleOut) GetExample() map[string]map[string]interface{} { // GetExampleOk returns a tuple with the Example field value // and a boolean to check if the value has been set. -func (o *EventTypeExampleOut) GetExampleOk() (*map[string]map[string]interface{}, bool) { - if o == nil { - return nil, false +func (o *EventTypeExampleOut) GetExampleOk() (map[string]map[string]interface{}, bool) { + if o == nil { + return map[string]map[string]interface{}{}, false } - return &o.Example, true + return o.Example, true } // SetExample sets field value @@ -62,13 +69,56 @@ func (o *EventTypeExampleOut) SetExample(v map[string]map[string]interface{}) { } func (o EventTypeExampleOut) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["example"] = o.Example + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o EventTypeExampleOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["example"] = o.Example + return toSerialize, nil +} + +func (o *EventTypeExampleOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "example", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEventTypeExampleOut := _EventTypeExampleOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEventTypeExampleOut) + + if err != nil { + return err + } + + *o = EventTypeExampleOut(varEventTypeExampleOut) + + return err +} + type NullableEventTypeExampleOut struct { value *EventTypeExampleOut isSet bool diff --git a/go/internal/openapi/model_event_type_import_open_api_in.go b/go/internal/openapi/model_event_type_import_open_api_in.go index 273fad4a8..ecc4a0be8 100644 --- a/go/internal/openapi/model_event_type_import_open_api_in.go +++ b/go/internal/openapi/model_event_type_import_open_api_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -14,6 +14,9 @@ import ( "encoding/json" ) +// checks if the EventTypeImportOpenApiIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EventTypeImportOpenApiIn{} + // EventTypeImportOpenApiIn Import a list of event types from webhooks defined in an OpenAPI spec. The OpenAPI spec can be specified as either `spec` given the spec as a JSON object, or as `specRaw` (a `string`) which will be parsed as YAML or JSON by the server. Sending neither or both is invalid, resulting in a `400` **Bad Request**. type EventTypeImportOpenApiIn struct { // A pre-parsed JSON spec. @@ -41,7 +44,7 @@ func NewEventTypeImportOpenApiInWithDefaults() *EventTypeImportOpenApiIn { // GetSpec returns the Spec field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EventTypeImportOpenApiIn) GetSpec() map[string]map[string]interface{} { - if o == nil { + if o == nil { var ret map[string]map[string]interface{} return ret } @@ -51,16 +54,16 @@ func (o *EventTypeImportOpenApiIn) GetSpec() map[string]map[string]interface{} { // GetSpecOk returns a tuple with the Spec 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 *EventTypeImportOpenApiIn) GetSpecOk() (*map[string]map[string]interface{}, bool) { - if o == nil || o.Spec == nil { - return nil, false +func (o *EventTypeImportOpenApiIn) GetSpecOk() (map[string]map[string]interface{}, bool) { + if o == nil || IsNil(o.Spec) { + return map[string]map[string]interface{}{}, false } - return &o.Spec, true + return o.Spec, true } // HasSpec returns a boolean if a field has been set. func (o *EventTypeImportOpenApiIn) HasSpec() bool { - if o != nil && o.Spec != nil { + if o != nil && IsNil(o.Spec) { return true } @@ -74,7 +77,7 @@ func (o *EventTypeImportOpenApiIn) SetSpec(v map[string]map[string]interface{}) // GetSpecRaw returns the SpecRaw field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EventTypeImportOpenApiIn) GetSpecRaw() string { - if o == nil || o.SpecRaw.Get() == nil { + if o == nil || IsNil(o.SpecRaw.Get()) { var ret string return ret } @@ -85,7 +88,7 @@ func (o *EventTypeImportOpenApiIn) GetSpecRaw() string { // 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 *EventTypeImportOpenApiIn) GetSpecRawOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.SpecRaw.Get(), o.SpecRaw.IsSet() @@ -115,6 +118,14 @@ func (o *EventTypeImportOpenApiIn) UnsetSpecRaw() { } func (o EventTypeImportOpenApiIn) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EventTypeImportOpenApiIn) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if o.Spec != nil { toSerialize["spec"] = o.Spec @@ -122,7 +133,7 @@ func (o EventTypeImportOpenApiIn) MarshalJSON() ([]byte, error) { if o.SpecRaw.IsSet() { toSerialize["specRaw"] = o.SpecRaw.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableEventTypeImportOpenApiIn struct { diff --git a/go/internal/openapi/model_event_type_import_open_api_out.go b/go/internal/openapi/model_event_type_import_open_api_out.go index 21452b4d9..189e3c218 100644 --- a/go/internal/openapi/model_event_type_import_open_api_out.go +++ b/go/internal/openapi/model_event_type_import_open_api_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,13 +12,20 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the EventTypeImportOpenApiOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EventTypeImportOpenApiOut{} + // EventTypeImportOpenApiOut struct for EventTypeImportOpenApiOut type EventTypeImportOpenApiOut struct { Data EventTypeImportOpenApiOutData `json:"data"` } +type _EventTypeImportOpenApiOut EventTypeImportOpenApiOut + // NewEventTypeImportOpenApiOut instantiates a new EventTypeImportOpenApiOut 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 @@ -50,7 +57,7 @@ func (o *EventTypeImportOpenApiOut) GetData() EventTypeImportOpenApiOutData { // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. func (o *EventTypeImportOpenApiOut) GetDataOk() (*EventTypeImportOpenApiOutData, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Data, true @@ -62,13 +69,56 @@ func (o *EventTypeImportOpenApiOut) SetData(v EventTypeImportOpenApiOutData) { } func (o EventTypeImportOpenApiOut) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["data"] = o.Data + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o EventTypeImportOpenApiOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize, nil +} + +func (o *EventTypeImportOpenApiOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEventTypeImportOpenApiOut := _EventTypeImportOpenApiOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEventTypeImportOpenApiOut) + + if err != nil { + return err + } + + *o = EventTypeImportOpenApiOut(varEventTypeImportOpenApiOut) + + return err +} + type NullableEventTypeImportOpenApiOut struct { value *EventTypeImportOpenApiOut isSet bool diff --git a/go/internal/openapi/model_event_type_import_open_api_out_data.go b/go/internal/openapi/model_event_type_import_open_api_out_data.go index 7d80893ca..8c25a5388 100644 --- a/go/internal/openapi/model_event_type_import_open_api_out_data.go +++ b/go/internal/openapi/model_event_type_import_open_api_out_data.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,13 +12,20 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the EventTypeImportOpenApiOutData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EventTypeImportOpenApiOutData{} + // EventTypeImportOpenApiOutData struct for EventTypeImportOpenApiOutData type EventTypeImportOpenApiOutData struct { Modified []string `json:"modified"` } +type _EventTypeImportOpenApiOutData EventTypeImportOpenApiOutData + // NewEventTypeImportOpenApiOutData instantiates a new EventTypeImportOpenApiOutData 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 @@ -49,11 +56,11 @@ func (o *EventTypeImportOpenApiOutData) GetModified() []string { // GetModifiedOk returns a tuple with the Modified field value // and a boolean to check if the value has been set. -func (o *EventTypeImportOpenApiOutData) GetModifiedOk() (*[]string, bool) { - if o == nil { +func (o *EventTypeImportOpenApiOutData) GetModifiedOk() ([]string, bool) { + if o == nil { return nil, false } - return &o.Modified, true + return o.Modified, true } // SetModified sets field value @@ -62,13 +69,56 @@ func (o *EventTypeImportOpenApiOutData) SetModified(v []string) { } func (o EventTypeImportOpenApiOutData) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["modified"] = o.Modified + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o EventTypeImportOpenApiOutData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["modified"] = o.Modified + return toSerialize, nil +} + +func (o *EventTypeImportOpenApiOutData) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "modified", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEventTypeImportOpenApiOutData := _EventTypeImportOpenApiOutData{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEventTypeImportOpenApiOutData) + + if err != nil { + return err + } + + *o = EventTypeImportOpenApiOutData(varEventTypeImportOpenApiOutData) + + return err +} + type NullableEventTypeImportOpenApiOutData struct { value *EventTypeImportOpenApiOutData isSet bool diff --git a/go/internal/openapi/model_event_type_in.go b/go/internal/openapi/model_event_type_in.go index 7967892e9..68eb66f23 100644 --- a/go/internal/openapi/model_event_type_in.go +++ b/go/internal/openapi/model_event_type_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the EventTypeIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EventTypeIn{} + // EventTypeIn struct for EventTypeIn type EventTypeIn struct { Archived *bool `json:"archived,omitempty"` @@ -25,6 +30,8 @@ type EventTypeIn struct { Schemas map[string]map[string]interface{} `json:"schemas,omitempty"` } +type _EventTypeIn EventTypeIn + // NewEventTypeIn instantiates a new EventTypeIn 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 @@ -50,7 +57,7 @@ func NewEventTypeInWithDefaults() *EventTypeIn { // GetArchived returns the Archived field value if set, zero value otherwise. func (o *EventTypeIn) GetArchived() bool { - if o == nil || o.Archived == nil { + if o == nil || IsNil(o.Archived) { var ret bool return ret } @@ -60,7 +67,7 @@ func (o *EventTypeIn) GetArchived() bool { // GetArchivedOk returns a tuple with the Archived field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EventTypeIn) GetArchivedOk() (*bool, bool) { - if o == nil || o.Archived == nil { + if o == nil || IsNil(o.Archived) { return nil, false } return o.Archived, true @@ -68,7 +75,7 @@ func (o *EventTypeIn) GetArchivedOk() (*bool, bool) { // HasArchived returns a boolean if a field has been set. func (o *EventTypeIn) HasArchived() bool { - if o != nil && o.Archived != nil { + if o != nil && !IsNil(o.Archived) { return true } @@ -93,7 +100,7 @@ func (o *EventTypeIn) GetDescription() string { // GetDescriptionOk returns a tuple with the Description field value // and a boolean to check if the value has been set. func (o *EventTypeIn) GetDescriptionOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Description, true @@ -106,7 +113,7 @@ func (o *EventTypeIn) SetDescription(v string) { // GetFeatureFlag returns the FeatureFlag field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EventTypeIn) GetFeatureFlag() string { - if o == nil || o.FeatureFlag.Get() == nil { + if o == nil || IsNil(o.FeatureFlag.Get()) { var ret string return ret } @@ -117,7 +124,7 @@ func (o *EventTypeIn) GetFeatureFlag() string { // 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 *EventTypeIn) GetFeatureFlagOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.FeatureFlag.Get(), o.FeatureFlag.IsSet() @@ -159,7 +166,7 @@ func (o *EventTypeIn) GetName() string { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *EventTypeIn) GetNameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Name, true @@ -172,7 +179,7 @@ func (o *EventTypeIn) SetName(v string) { // GetSchemas returns the Schemas field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EventTypeIn) GetSchemas() map[string]map[string]interface{} { - if o == nil { + if o == nil { var ret map[string]map[string]interface{} return ret } @@ -182,16 +189,16 @@ func (o *EventTypeIn) GetSchemas() map[string]map[string]interface{} { // GetSchemasOk returns a tuple with the Schemas 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 *EventTypeIn) GetSchemasOk() (*map[string]map[string]interface{}, bool) { - if o == nil || o.Schemas == nil { - return nil, false +func (o *EventTypeIn) GetSchemasOk() (map[string]map[string]interface{}, bool) { + if o == nil || IsNil(o.Schemas) { + return map[string]map[string]interface{}{}, false } - return &o.Schemas, true + return o.Schemas, true } // HasSchemas returns a boolean if a field has been set. func (o *EventTypeIn) HasSchemas() bool { - if o != nil && o.Schemas != nil { + if o != nil && IsNil(o.Schemas) { return true } @@ -204,23 +211,65 @@ func (o *EventTypeIn) SetSchemas(v map[string]map[string]interface{}) { } func (o EventTypeIn) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EventTypeIn) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Archived != nil { + if !IsNil(o.Archived) { toSerialize["archived"] = o.Archived } - if true { - toSerialize["description"] = o.Description - } + toSerialize["description"] = o.Description if o.FeatureFlag.IsSet() { toSerialize["featureFlag"] = o.FeatureFlag.Get() } - if true { - toSerialize["name"] = o.Name - } + toSerialize["name"] = o.Name if o.Schemas != nil { toSerialize["schemas"] = o.Schemas } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *EventTypeIn) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEventTypeIn := _EventTypeIn{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEventTypeIn) + + if err != nil { + return err + } + + *o = EventTypeIn(varEventTypeIn) + + return err } type NullableEventTypeIn struct { diff --git a/go/internal/openapi/model_event_type_out.go b/go/internal/openapi/model_event_type_out.go index a94cdf3eb..f8ddf2122 100644 --- a/go/internal/openapi/model_event_type_out.go +++ b/go/internal/openapi/model_event_type_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -13,8 +13,13 @@ package openapi import ( "encoding/json" "time" + "bytes" + "fmt" ) +// checks if the EventTypeOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EventTypeOut{} + // EventTypeOut struct for EventTypeOut type EventTypeOut struct { Archived *bool `json:"archived,omitempty"` @@ -28,6 +33,8 @@ type EventTypeOut struct { UpdatedAt time.Time `json:"updatedAt"` } +type _EventTypeOut EventTypeOut + // NewEventTypeOut instantiates a new EventTypeOut 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 @@ -55,7 +62,7 @@ func NewEventTypeOutWithDefaults() *EventTypeOut { // GetArchived returns the Archived field value if set, zero value otherwise. func (o *EventTypeOut) GetArchived() bool { - if o == nil || o.Archived == nil { + if o == nil || IsNil(o.Archived) { var ret bool return ret } @@ -65,7 +72,7 @@ func (o *EventTypeOut) GetArchived() bool { // GetArchivedOk returns a tuple with the Archived field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EventTypeOut) GetArchivedOk() (*bool, bool) { - if o == nil || o.Archived == nil { + if o == nil || IsNil(o.Archived) { return nil, false } return o.Archived, true @@ -73,7 +80,7 @@ func (o *EventTypeOut) GetArchivedOk() (*bool, bool) { // HasArchived returns a boolean if a field has been set. func (o *EventTypeOut) HasArchived() bool { - if o != nil && o.Archived != nil { + if o != nil && !IsNil(o.Archived) { return true } @@ -98,7 +105,7 @@ func (o *EventTypeOut) GetCreatedAt() time.Time { // GetCreatedAtOk returns a tuple with the CreatedAt field value // and a boolean to check if the value has been set. func (o *EventTypeOut) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.CreatedAt, true @@ -122,7 +129,7 @@ func (o *EventTypeOut) GetDescription() string { // GetDescriptionOk returns a tuple with the Description field value // and a boolean to check if the value has been set. func (o *EventTypeOut) GetDescriptionOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Description, true @@ -135,7 +142,7 @@ func (o *EventTypeOut) SetDescription(v string) { // GetFeatureFlag returns the FeatureFlag field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EventTypeOut) GetFeatureFlag() string { - if o == nil || o.FeatureFlag.Get() == nil { + if o == nil || IsNil(o.FeatureFlag.Get()) { var ret string return ret } @@ -146,7 +153,7 @@ func (o *EventTypeOut) GetFeatureFlag() string { // 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 *EventTypeOut) GetFeatureFlagOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.FeatureFlag.Get(), o.FeatureFlag.IsSet() @@ -188,7 +195,7 @@ func (o *EventTypeOut) GetName() string { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *EventTypeOut) GetNameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Name, true @@ -201,7 +208,7 @@ func (o *EventTypeOut) SetName(v string) { // GetSchemas returns the Schemas field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EventTypeOut) GetSchemas() map[string]map[string]interface{} { - if o == nil { + if o == nil { var ret map[string]map[string]interface{} return ret } @@ -211,16 +218,16 @@ func (o *EventTypeOut) GetSchemas() map[string]map[string]interface{} { // GetSchemasOk returns a tuple with the Schemas 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 *EventTypeOut) GetSchemasOk() (*map[string]map[string]interface{}, bool) { - if o == nil || o.Schemas == nil { - return nil, false +func (o *EventTypeOut) GetSchemasOk() (map[string]map[string]interface{}, bool) { + if o == nil || IsNil(o.Schemas) { + return map[string]map[string]interface{}{}, false } - return &o.Schemas, true + return o.Schemas, true } // HasSchemas returns a boolean if a field has been set. func (o *EventTypeOut) HasSchemas() bool { - if o != nil && o.Schemas != nil { + if o != nil && IsNil(o.Schemas) { return true } @@ -245,7 +252,7 @@ func (o *EventTypeOut) GetUpdatedAt() time.Time { // GetUpdatedAtOk returns a tuple with the UpdatedAt field value // and a boolean to check if the value has been set. func (o *EventTypeOut) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.UpdatedAt, true @@ -257,29 +264,69 @@ func (o *EventTypeOut) SetUpdatedAt(v time.Time) { } func (o EventTypeOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EventTypeOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Archived != nil { + if !IsNil(o.Archived) { toSerialize["archived"] = o.Archived } - if true { - toSerialize["createdAt"] = o.CreatedAt - } - if true { - toSerialize["description"] = o.Description - } + toSerialize["createdAt"] = o.CreatedAt + toSerialize["description"] = o.Description if o.FeatureFlag.IsSet() { toSerialize["featureFlag"] = o.FeatureFlag.Get() } - if true { - toSerialize["name"] = o.Name - } + toSerialize["name"] = o.Name if o.Schemas != nil { toSerialize["schemas"] = o.Schemas } - if true { - toSerialize["updatedAt"] = o.UpdatedAt + toSerialize["updatedAt"] = o.UpdatedAt + return toSerialize, nil +} + +func (o *EventTypeOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "createdAt", + "description", + "name", + "updatedAt", } - return json.Marshal(toSerialize) + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEventTypeOut := _EventTypeOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEventTypeOut) + + if err != nil { + return err + } + + *o = EventTypeOut(varEventTypeOut) + + return err } type NullableEventTypeOut struct { diff --git a/go/internal/openapi/model_event_type_patch.go b/go/internal/openapi/model_event_type_patch.go index 3deb9597d..742c767de 100644 --- a/go/internal/openapi/model_event_type_patch.go +++ b/go/internal/openapi/model_event_type_patch.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -14,6 +14,9 @@ import ( "encoding/json" ) +// checks if the EventTypePatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EventTypePatch{} + // EventTypePatch struct for EventTypePatch type EventTypePatch struct { Archived *bool `json:"archived,omitempty"` @@ -41,7 +44,7 @@ func NewEventTypePatchWithDefaults() *EventTypePatch { // GetArchived returns the Archived field value if set, zero value otherwise. func (o *EventTypePatch) GetArchived() bool { - if o == nil || o.Archived == nil { + if o == nil || IsNil(o.Archived) { var ret bool return ret } @@ -51,7 +54,7 @@ func (o *EventTypePatch) GetArchived() bool { // GetArchivedOk returns a tuple with the Archived field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EventTypePatch) GetArchivedOk() (*bool, bool) { - if o == nil || o.Archived == nil { + if o == nil || IsNil(o.Archived) { return nil, false } return o.Archived, true @@ -59,7 +62,7 @@ func (o *EventTypePatch) GetArchivedOk() (*bool, bool) { // HasArchived returns a boolean if a field has been set. func (o *EventTypePatch) HasArchived() bool { - if o != nil && o.Archived != nil { + if o != nil && !IsNil(o.Archived) { return true } @@ -73,7 +76,7 @@ func (o *EventTypePatch) SetArchived(v bool) { // GetDescription returns the Description field value if set, zero value otherwise. func (o *EventTypePatch) GetDescription() string { - if o == nil || o.Description == nil { + if o == nil || IsNil(o.Description) { var ret string return ret } @@ -83,7 +86,7 @@ func (o *EventTypePatch) GetDescription() string { // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EventTypePatch) GetDescriptionOk() (*string, bool) { - if o == nil || o.Description == nil { + if o == nil || IsNil(o.Description) { return nil, false } return o.Description, true @@ -91,7 +94,7 @@ func (o *EventTypePatch) GetDescriptionOk() (*string, bool) { // HasDescription returns a boolean if a field has been set. func (o *EventTypePatch) HasDescription() bool { - if o != nil && o.Description != nil { + if o != nil && !IsNil(o.Description) { return true } @@ -105,7 +108,7 @@ func (o *EventTypePatch) SetDescription(v string) { // GetFeatureFlag returns the FeatureFlag field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EventTypePatch) GetFeatureFlag() string { - if o == nil || o.FeatureFlag.Get() == nil { + if o == nil || IsNil(o.FeatureFlag.Get()) { var ret string return ret } @@ -116,7 +119,7 @@ func (o *EventTypePatch) GetFeatureFlag() string { // 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 *EventTypePatch) GetFeatureFlagOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.FeatureFlag.Get(), o.FeatureFlag.IsSet() @@ -147,7 +150,7 @@ func (o *EventTypePatch) UnsetFeatureFlag() { // GetSchemas returns the Schemas field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EventTypePatch) GetSchemas() map[string]map[string]interface{} { - if o == nil { + if o == nil { var ret map[string]map[string]interface{} return ret } @@ -157,16 +160,16 @@ func (o *EventTypePatch) GetSchemas() map[string]map[string]interface{} { // GetSchemasOk returns a tuple with the Schemas 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 *EventTypePatch) GetSchemasOk() (*map[string]map[string]interface{}, bool) { - if o == nil || o.Schemas == nil { - return nil, false +func (o *EventTypePatch) GetSchemasOk() (map[string]map[string]interface{}, bool) { + if o == nil || IsNil(o.Schemas) { + return map[string]map[string]interface{}{}, false } - return &o.Schemas, true + return o.Schemas, true } // HasSchemas returns a boolean if a field has been set. func (o *EventTypePatch) HasSchemas() bool { - if o != nil && o.Schemas != nil { + if o != nil && IsNil(o.Schemas) { return true } @@ -179,11 +182,19 @@ func (o *EventTypePatch) SetSchemas(v map[string]map[string]interface{}) { } func (o EventTypePatch) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EventTypePatch) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Archived != nil { + if !IsNil(o.Archived) { toSerialize["archived"] = o.Archived } - if o.Description != nil { + if !IsNil(o.Description) { toSerialize["description"] = o.Description } if o.FeatureFlag.IsSet() { @@ -192,7 +203,7 @@ func (o EventTypePatch) MarshalJSON() ([]byte, error) { if o.Schemas != nil { toSerialize["schemas"] = o.Schemas } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableEventTypePatch struct { diff --git a/go/internal/openapi/model_event_type_schema_in.go b/go/internal/openapi/model_event_type_schema_in.go index f2890dd7a..0c5747600 100644 --- a/go/internal/openapi/model_event_type_schema_in.go +++ b/go/internal/openapi/model_event_type_schema_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,13 +12,20 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the EventTypeSchemaIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EventTypeSchemaIn{} + // EventTypeSchemaIn struct for EventTypeSchemaIn type EventTypeSchemaIn struct { Schema map[string]interface{} `json:"schema"` } +type _EventTypeSchemaIn EventTypeSchemaIn + // NewEventTypeSchemaIn instantiates a new EventTypeSchemaIn 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 @@ -49,11 +56,11 @@ func (o *EventTypeSchemaIn) GetSchema() map[string]interface{} { // GetSchemaOk returns a tuple with the Schema field value // and a boolean to check if the value has been set. -func (o *EventTypeSchemaIn) GetSchemaOk() (*map[string]interface{}, bool) { - if o == nil { - return nil, false +func (o *EventTypeSchemaIn) GetSchemaOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false } - return &o.Schema, true + return o.Schema, true } // SetSchema sets field value @@ -62,13 +69,56 @@ func (o *EventTypeSchemaIn) SetSchema(v map[string]interface{}) { } func (o EventTypeSchemaIn) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["schema"] = o.Schema + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o EventTypeSchemaIn) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["schema"] = o.Schema + return toSerialize, nil +} + +func (o *EventTypeSchemaIn) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "schema", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEventTypeSchemaIn := _EventTypeSchemaIn{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEventTypeSchemaIn) + + if err != nil { + return err + } + + *o = EventTypeSchemaIn(varEventTypeSchemaIn) + + return err +} + type NullableEventTypeSchemaIn struct { value *EventTypeSchemaIn isSet bool diff --git a/go/internal/openapi/model_event_type_update.go b/go/internal/openapi/model_event_type_update.go index ff5dfcd0b..091e6b4ef 100644 --- a/go/internal/openapi/model_event_type_update.go +++ b/go/internal/openapi/model_event_type_update.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the EventTypeUpdate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EventTypeUpdate{} + // EventTypeUpdate struct for EventTypeUpdate type EventTypeUpdate struct { Archived *bool `json:"archived,omitempty"` @@ -23,6 +28,8 @@ type EventTypeUpdate struct { Schemas map[string]map[string]interface{} `json:"schemas,omitempty"` } +type _EventTypeUpdate EventTypeUpdate + // NewEventTypeUpdate instantiates a new EventTypeUpdate 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 @@ -47,7 +54,7 @@ func NewEventTypeUpdateWithDefaults() *EventTypeUpdate { // GetArchived returns the Archived field value if set, zero value otherwise. func (o *EventTypeUpdate) GetArchived() bool { - if o == nil || o.Archived == nil { + if o == nil || IsNil(o.Archived) { var ret bool return ret } @@ -57,7 +64,7 @@ func (o *EventTypeUpdate) GetArchived() bool { // GetArchivedOk returns a tuple with the Archived field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EventTypeUpdate) GetArchivedOk() (*bool, bool) { - if o == nil || o.Archived == nil { + if o == nil || IsNil(o.Archived) { return nil, false } return o.Archived, true @@ -65,7 +72,7 @@ func (o *EventTypeUpdate) GetArchivedOk() (*bool, bool) { // HasArchived returns a boolean if a field has been set. func (o *EventTypeUpdate) HasArchived() bool { - if o != nil && o.Archived != nil { + if o != nil && !IsNil(o.Archived) { return true } @@ -90,7 +97,7 @@ func (o *EventTypeUpdate) GetDescription() string { // GetDescriptionOk returns a tuple with the Description field value // and a boolean to check if the value has been set. func (o *EventTypeUpdate) GetDescriptionOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Description, true @@ -103,7 +110,7 @@ func (o *EventTypeUpdate) SetDescription(v string) { // GetFeatureFlag returns the FeatureFlag field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EventTypeUpdate) GetFeatureFlag() string { - if o == nil || o.FeatureFlag.Get() == nil { + if o == nil || IsNil(o.FeatureFlag.Get()) { var ret string return ret } @@ -114,7 +121,7 @@ func (o *EventTypeUpdate) GetFeatureFlag() string { // 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 *EventTypeUpdate) GetFeatureFlagOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.FeatureFlag.Get(), o.FeatureFlag.IsSet() @@ -145,7 +152,7 @@ func (o *EventTypeUpdate) UnsetFeatureFlag() { // GetSchemas returns the Schemas field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EventTypeUpdate) GetSchemas() map[string]map[string]interface{} { - if o == nil { + if o == nil { var ret map[string]map[string]interface{} return ret } @@ -155,16 +162,16 @@ func (o *EventTypeUpdate) GetSchemas() map[string]map[string]interface{} { // GetSchemasOk returns a tuple with the Schemas 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 *EventTypeUpdate) GetSchemasOk() (*map[string]map[string]interface{}, bool) { - if o == nil || o.Schemas == nil { - return nil, false +func (o *EventTypeUpdate) GetSchemasOk() (map[string]map[string]interface{}, bool) { + if o == nil || IsNil(o.Schemas) { + return map[string]map[string]interface{}{}, false } - return &o.Schemas, true + return o.Schemas, true } // HasSchemas returns a boolean if a field has been set. func (o *EventTypeUpdate) HasSchemas() bool { - if o != nil && o.Schemas != nil { + if o != nil && IsNil(o.Schemas) { return true } @@ -177,20 +184,63 @@ func (o *EventTypeUpdate) SetSchemas(v map[string]map[string]interface{}) { } func (o EventTypeUpdate) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EventTypeUpdate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Archived != nil { + if !IsNil(o.Archived) { toSerialize["archived"] = o.Archived } - if true { - toSerialize["description"] = o.Description - } + toSerialize["description"] = o.Description if o.FeatureFlag.IsSet() { toSerialize["featureFlag"] = o.FeatureFlag.Get() } if o.Schemas != nil { toSerialize["schemas"] = o.Schemas } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *EventTypeUpdate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEventTypeUpdate := _EventTypeUpdate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varEventTypeUpdate) + + if err != nil { + return err + } + + *o = EventTypeUpdate(varEventTypeUpdate) + + return err } type NullableEventTypeUpdate struct { diff --git a/go/internal/openapi/model_export_event_type_out.go b/go/internal/openapi/model_export_event_type_out.go index 75b8f9cea..3a26c9dc2 100644 --- a/go/internal/openapi/model_export_event_type_out.go +++ b/go/internal/openapi/model_export_event_type_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the ExportEventTypeOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ExportEventTypeOut{} + // ExportEventTypeOut struct for ExportEventTypeOut type ExportEventTypeOut struct { Id string `json:"id"` @@ -21,6 +26,8 @@ type ExportEventTypeOut struct { Task BackgroundTaskType `json:"task"` } +type _ExportEventTypeOut ExportEventTypeOut + // NewExportEventTypeOut instantiates a new ExportEventTypeOut 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 @@ -54,7 +61,7 @@ func (o *ExportEventTypeOut) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *ExportEventTypeOut) GetIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Id, true @@ -78,7 +85,7 @@ func (o *ExportEventTypeOut) GetStatus() BackgroundTaskStatus { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. func (o *ExportEventTypeOut) GetStatusOk() (*BackgroundTaskStatus, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Status, true @@ -102,7 +109,7 @@ func (o *ExportEventTypeOut) GetTask() BackgroundTaskType { // GetTaskOk returns a tuple with the Task field value // and a boolean to check if the value has been set. func (o *ExportEventTypeOut) GetTaskOk() (*BackgroundTaskType, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Task, true @@ -114,17 +121,58 @@ func (o *ExportEventTypeOut) SetTask(v BackgroundTaskType) { } func (o ExportEventTypeOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ExportEventTypeOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["id"] = o.Id + toSerialize["id"] = o.Id + toSerialize["status"] = o.Status + toSerialize["task"] = o.Task + return toSerialize, nil +} + +func (o *ExportEventTypeOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "status", + "task", } - if true { - toSerialize["status"] = o.Status + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["task"] = o.Task + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varExportEventTypeOut := _ExportEventTypeOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varExportEventTypeOut) + + if err != nil { + return err + } + + *o = ExportEventTypeOut(varExportEventTypeOut) + + return err } type NullableExportEventTypeOut struct { diff --git a/go/internal/openapi/model_font_size_config.go b/go/internal/openapi/model_font_size_config.go index 8743d3e58..7adff4080 100644 --- a/go/internal/openapi/model_font_size_config.go +++ b/go/internal/openapi/model_font_size_config.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -14,6 +14,9 @@ import ( "encoding/json" ) +// checks if the FontSizeConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FontSizeConfig{} + // FontSizeConfig struct for FontSizeConfig type FontSizeConfig struct { Base NullableInt32 `json:"base,omitempty"` @@ -38,7 +41,7 @@ func NewFontSizeConfigWithDefaults() *FontSizeConfig { // GetBase returns the Base field value if set, zero value otherwise (both if not set or set to explicit null). func (o *FontSizeConfig) GetBase() int32 { - if o == nil || o.Base.Get() == nil { + if o == nil || IsNil(o.Base.Get()) { var ret int32 return ret } @@ -49,7 +52,7 @@ func (o *FontSizeConfig) GetBase() int32 { // 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 *FontSizeConfig) GetBaseOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return o.Base.Get(), o.Base.IsSet() @@ -79,11 +82,19 @@ func (o *FontSizeConfig) UnsetBase() { } func (o FontSizeConfig) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FontSizeConfig) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if o.Base.IsSet() { toSerialize["base"] = o.Base.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableFontSizeConfig struct { diff --git a/go/internal/openapi/model_generate_in.go b/go/internal/openapi/model_generate_in.go index 4961b3e03..8180619f6 100644 --- a/go/internal/openapi/model_generate_in.go +++ b/go/internal/openapi/model_generate_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,13 +12,20 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the GenerateIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GenerateIn{} + // GenerateIn struct for GenerateIn type GenerateIn struct { Prompt string `json:"prompt"` } +type _GenerateIn GenerateIn + // 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 @@ -50,7 +57,7 @@ func (o *GenerateIn) GetPrompt() string { // 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 { + if o == nil { return nil, false } return &o.Prompt, true @@ -62,13 +69,56 @@ func (o *GenerateIn) SetPrompt(v string) { } func (o GenerateIn) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["prompt"] = o.Prompt + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o GenerateIn) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["prompt"] = o.Prompt + return toSerialize, nil +} + +func (o *GenerateIn) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prompt", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGenerateIn := _GenerateIn{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGenerateIn) + + if err != nil { + return err + } + + *o = GenerateIn(varGenerateIn) + + return err +} + type NullableGenerateIn struct { value *GenerateIn isSet bool diff --git a/go/internal/openapi/model_generate_out.go b/go/internal/openapi/model_generate_out.go index 8ec75ca5f..d8afdbbf5 100644 --- a/go/internal/openapi/model_generate_out.go +++ b/go/internal/openapi/model_generate_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the GenerateOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GenerateOut{} + // GenerateOut struct for GenerateOut type GenerateOut struct { Choices []CompletionChoice `json:"choices"` @@ -23,6 +28,8 @@ type GenerateOut struct { Object string `json:"object"` } +type _GenerateOut GenerateOut + // 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 @@ -57,11 +64,11 @@ func (o *GenerateOut) GetChoices() []CompletionChoice { // 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 { +func (o *GenerateOut) GetChoicesOk() ([]CompletionChoice, bool) { + if o == nil { return nil, false } - return &o.Choices, true + return o.Choices, true } // SetChoices sets field value @@ -82,7 +89,7 @@ func (o *GenerateOut) GetCreated() int64 { // 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 { + if o == nil { return nil, false } return &o.Created, true @@ -106,7 +113,7 @@ func (o *GenerateOut) GetId() string { // 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 { + if o == nil { return nil, false } return &o.Id, true @@ -130,7 +137,7 @@ func (o *GenerateOut) GetModel() string { // 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 { + if o == nil { return nil, false } return &o.Model, true @@ -154,7 +161,7 @@ func (o *GenerateOut) GetObject() string { // 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 { + if o == nil { return nil, false } return &o.Object, true @@ -166,23 +173,62 @@ func (o *GenerateOut) SetObject(v string) { } func (o GenerateOut) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["choices"] = o.Choices + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if true { - toSerialize["created"] = o.Created + return json.Marshal(toSerialize) +} + +func (o GenerateOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["choices"] = o.Choices + toSerialize["created"] = o.Created + toSerialize["id"] = o.Id + toSerialize["model"] = o.Model + toSerialize["object"] = o.Object + return toSerialize, nil +} + +func (o *GenerateOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "choices", + "created", + "id", + "model", + "object", } - if true { - toSerialize["id"] = o.Id + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["model"] = o.Model + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - if true { - toSerialize["object"] = o.Object + + varGenerateOut := _GenerateOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGenerateOut) + + if err != nil { + return err } - return json.Marshal(toSerialize) + + *o = GenerateOut(varGenerateOut) + + return err } type NullableGenerateOut struct { diff --git a/go/internal/openapi/model_http_error_out.go b/go/internal/openapi/model_http_error_out.go index e5e95857d..ab8921516 100644 --- a/go/internal/openapi/model_http_error_out.go +++ b/go/internal/openapi/model_http_error_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,14 +12,21 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the HttpErrorOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HttpErrorOut{} + // HttpErrorOut struct for HttpErrorOut type HttpErrorOut struct { Code string `json:"code"` Detail string `json:"detail"` } +type _HttpErrorOut HttpErrorOut + // NewHttpErrorOut instantiates a new HttpErrorOut 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 @@ -52,7 +59,7 @@ func (o *HttpErrorOut) GetCode() string { // GetCodeOk returns a tuple with the Code field value // and a boolean to check if the value has been set. func (o *HttpErrorOut) GetCodeOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Code, true @@ -76,7 +83,7 @@ func (o *HttpErrorOut) GetDetail() string { // GetDetailOk returns a tuple with the Detail field value // and a boolean to check if the value has been set. func (o *HttpErrorOut) GetDetailOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Detail, true @@ -88,14 +95,56 @@ func (o *HttpErrorOut) SetDetail(v string) { } func (o HttpErrorOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HttpErrorOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["code"] = o.Code + toSerialize["code"] = o.Code + toSerialize["detail"] = o.Detail + return toSerialize, nil +} + +func (o *HttpErrorOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "code", + "detail", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["detail"] = o.Detail + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varHttpErrorOut := _HttpErrorOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varHttpErrorOut) + + if err != nil { + return err + } + + *o = HttpErrorOut(varHttpErrorOut) + + return err } type NullableHttpErrorOut struct { diff --git a/go/internal/openapi/model_http_validation_error.go b/go/internal/openapi/model_http_validation_error.go index dc48b29f9..ed3bbb964 100644 --- a/go/internal/openapi/model_http_validation_error.go +++ b/go/internal/openapi/model_http_validation_error.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,13 +12,20 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the HTTPValidationError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HTTPValidationError{} + // HTTPValidationError struct for HTTPValidationError type HTTPValidationError struct { Detail []ValidationError `json:"detail"` } +type _HTTPValidationError HTTPValidationError + // NewHTTPValidationError instantiates a new HTTPValidationError 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 @@ -49,11 +56,11 @@ func (o *HTTPValidationError) GetDetail() []ValidationError { // GetDetailOk returns a tuple with the Detail field value // and a boolean to check if the value has been set. -func (o *HTTPValidationError) GetDetailOk() (*[]ValidationError, bool) { - if o == nil { +func (o *HTTPValidationError) GetDetailOk() ([]ValidationError, bool) { + if o == nil { return nil, false } - return &o.Detail, true + return o.Detail, true } // SetDetail sets field value @@ -62,13 +69,56 @@ func (o *HTTPValidationError) SetDetail(v []ValidationError) { } func (o HTTPValidationError) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["detail"] = o.Detail + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o HTTPValidationError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["detail"] = o.Detail + return toSerialize, nil +} + +func (o *HTTPValidationError) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "detail", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHTTPValidationError := _HTTPValidationError{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varHTTPValidationError) + + if err != nil { + return err + } + + *o = HTTPValidationError(varHTTPValidationError) + + return err +} + type NullableHTTPValidationError struct { value *HTTPValidationError isSet bool diff --git a/go/internal/openapi/model_inbound_path_params.go b/go/internal/openapi/model_inbound_path_params.go index 8b665b591..df3de576d 100644 --- a/go/internal/openapi/model_inbound_path_params.go +++ b/go/internal/openapi/model_inbound_path_params.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the InboundPathParams type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InboundPathParams{} + // InboundPathParams struct for InboundPathParams type InboundPathParams struct { // The app's ID or UID @@ -21,6 +26,8 @@ type InboundPathParams struct { InboundToken string `json:"inbound_token"` } +type _InboundPathParams InboundPathParams + // 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 @@ -53,7 +60,7 @@ func (o *InboundPathParams) GetAppId() string { // 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 { + if o == nil { return nil, false } return &o.AppId, true @@ -77,7 +84,7 @@ func (o *InboundPathParams) GetInboundToken() string { // 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 { + if o == nil { return nil, false } return &o.InboundToken, true @@ -89,14 +96,56 @@ func (o *InboundPathParams) SetInboundToken(v string) { } func (o InboundPathParams) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InboundPathParams) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["app_id"] = o.AppId + toSerialize["app_id"] = o.AppId + toSerialize["inbound_token"] = o.InboundToken + return toSerialize, nil +} + +func (o *InboundPathParams) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "app_id", + "inbound_token", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["inbound_token"] = o.InboundToken + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varInboundPathParams := _InboundPathParams{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varInboundPathParams) + + if err != nil { + return err + } + + *o = InboundPathParams(varInboundPathParams) + + return err } type NullableInboundPathParams struct { diff --git a/go/internal/openapi/model_integration_in.go b/go/internal/openapi/model_integration_in.go index 2e4ef47ab..82105efb0 100644 --- a/go/internal/openapi/model_integration_in.go +++ b/go/internal/openapi/model_integration_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,13 +12,20 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the IntegrationIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IntegrationIn{} + // IntegrationIn struct for IntegrationIn type IntegrationIn struct { Name string `json:"name"` } +type _IntegrationIn IntegrationIn + // NewIntegrationIn instantiates a new IntegrationIn 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 @@ -50,7 +57,7 @@ func (o *IntegrationIn) GetName() string { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *IntegrationIn) GetNameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Name, true @@ -62,13 +69,56 @@ func (o *IntegrationIn) SetName(v string) { } func (o IntegrationIn) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["name"] = o.Name + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o IntegrationIn) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + return toSerialize, nil +} + +func (o *IntegrationIn) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIntegrationIn := _IntegrationIn{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varIntegrationIn) + + if err != nil { + return err + } + + *o = IntegrationIn(varIntegrationIn) + + return err +} + type NullableIntegrationIn struct { value *IntegrationIn isSet bool diff --git a/go/internal/openapi/model_integration_key_out.go b/go/internal/openapi/model_integration_key_out.go index 3ecb56df0..9da79b3f0 100644 --- a/go/internal/openapi/model_integration_key_out.go +++ b/go/internal/openapi/model_integration_key_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,13 +12,20 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the IntegrationKeyOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IntegrationKeyOut{} + // IntegrationKeyOut struct for IntegrationKeyOut type IntegrationKeyOut struct { Key string `json:"key"` } +type _IntegrationKeyOut IntegrationKeyOut + // NewIntegrationKeyOut instantiates a new IntegrationKeyOut 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 @@ -50,7 +57,7 @@ func (o *IntegrationKeyOut) GetKey() string { // GetKeyOk returns a tuple with the Key field value // and a boolean to check if the value has been set. func (o *IntegrationKeyOut) GetKeyOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Key, true @@ -62,13 +69,56 @@ func (o *IntegrationKeyOut) SetKey(v string) { } func (o IntegrationKeyOut) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["key"] = o.Key + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o IntegrationKeyOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +func (o *IntegrationKeyOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "key", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIntegrationKeyOut := _IntegrationKeyOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varIntegrationKeyOut) + + if err != nil { + return err + } + + *o = IntegrationKeyOut(varIntegrationKeyOut) + + return err +} + type NullableIntegrationKeyOut struct { value *IntegrationKeyOut isSet bool diff --git a/go/internal/openapi/model_integration_out.go b/go/internal/openapi/model_integration_out.go index 5eeba7c6e..3228e2200 100644 --- a/go/internal/openapi/model_integration_out.go +++ b/go/internal/openapi/model_integration_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -13,8 +13,13 @@ package openapi import ( "encoding/json" "time" + "bytes" + "fmt" ) +// checks if the IntegrationOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IntegrationOut{} + // IntegrationOut struct for IntegrationOut type IntegrationOut struct { CreatedAt time.Time `json:"createdAt"` @@ -24,6 +29,8 @@ type IntegrationOut struct { UpdatedAt time.Time `json:"updatedAt"` } +type _IntegrationOut IntegrationOut + // NewIntegrationOut instantiates a new IntegrationOut 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 @@ -58,7 +65,7 @@ func (o *IntegrationOut) GetCreatedAt() time.Time { // GetCreatedAtOk returns a tuple with the CreatedAt field value // and a boolean to check if the value has been set. func (o *IntegrationOut) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.CreatedAt, true @@ -82,7 +89,7 @@ func (o *IntegrationOut) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *IntegrationOut) GetIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Id, true @@ -106,7 +113,7 @@ func (o *IntegrationOut) GetName() string { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *IntegrationOut) GetNameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Name, true @@ -130,7 +137,7 @@ func (o *IntegrationOut) GetUpdatedAt() time.Time { // GetUpdatedAtOk returns a tuple with the UpdatedAt field value // and a boolean to check if the value has been set. func (o *IntegrationOut) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.UpdatedAt, true @@ -142,20 +149,60 @@ func (o *IntegrationOut) SetUpdatedAt(v time.Time) { } func (o IntegrationOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IntegrationOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["createdAt"] = o.CreatedAt + toSerialize["createdAt"] = o.CreatedAt + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["updatedAt"] = o.UpdatedAt + return toSerialize, nil +} + +func (o *IntegrationOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "createdAt", + "id", + "name", + "updatedAt", } - if true { - toSerialize["id"] = o.Id + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["name"] = o.Name + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - if true { - toSerialize["updatedAt"] = o.UpdatedAt + + varIntegrationOut := _IntegrationOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varIntegrationOut) + + if err != nil { + return err } - return json.Marshal(toSerialize) + + *o = IntegrationOut(varIntegrationOut) + + return err } type NullableIntegrationOut struct { diff --git a/go/internal/openapi/model_integration_update.go b/go/internal/openapi/model_integration_update.go index 8bbc94345..6b49dabea 100644 --- a/go/internal/openapi/model_integration_update.go +++ b/go/internal/openapi/model_integration_update.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,13 +12,20 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the IntegrationUpdate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IntegrationUpdate{} + // IntegrationUpdate struct for IntegrationUpdate type IntegrationUpdate struct { Name string `json:"name"` } +type _IntegrationUpdate IntegrationUpdate + // NewIntegrationUpdate instantiates a new IntegrationUpdate 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 @@ -50,7 +57,7 @@ func (o *IntegrationUpdate) GetName() string { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *IntegrationUpdate) GetNameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Name, true @@ -62,13 +69,56 @@ func (o *IntegrationUpdate) SetName(v string) { } func (o IntegrationUpdate) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["name"] = o.Name + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o IntegrationUpdate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + return toSerialize, nil +} + +func (o *IntegrationUpdate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIntegrationUpdate := _IntegrationUpdate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varIntegrationUpdate) + + if err != nil { + return err + } + + *o = IntegrationUpdate(varIntegrationUpdate) + + return err +} + type NullableIntegrationUpdate struct { value *IntegrationUpdate isSet bool diff --git a/go/internal/openapi/model_list_response_application_out_.go b/go/internal/openapi/model_list_response_application_out_.go index ad0dcf0ae..a19938884 100644 --- a/go/internal/openapi/model_list_response_application_out_.go +++ b/go/internal/openapi/model_list_response_application_out_.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the ListResponseApplicationOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListResponseApplicationOut{} + // ListResponseApplicationOut struct for ListResponseApplicationOut type ListResponseApplicationOut struct { Data []ApplicationOut `json:"data"` @@ -22,6 +27,8 @@ type ListResponseApplicationOut struct { PrevIterator NullableString `json:"prevIterator,omitempty"` } +type _ListResponseApplicationOut ListResponseApplicationOut + // NewListResponseApplicationOut instantiates a new ListResponseApplicationOut 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 @@ -53,11 +60,11 @@ func (o *ListResponseApplicationOut) GetData() []ApplicationOut { // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. -func (o *ListResponseApplicationOut) GetDataOk() (*[]ApplicationOut, bool) { - if o == nil { +func (o *ListResponseApplicationOut) GetDataOk() ([]ApplicationOut, bool) { + if o == nil { return nil, false } - return &o.Data, true + return o.Data, true } // SetData sets field value @@ -78,7 +85,7 @@ func (o *ListResponseApplicationOut) GetDone() bool { // GetDoneOk returns a tuple with the Done field value // and a boolean to check if the value has been set. func (o *ListResponseApplicationOut) GetDoneOk() (*bool, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Done, true @@ -91,7 +98,7 @@ func (o *ListResponseApplicationOut) SetDone(v bool) { // GetIterator returns the Iterator field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ListResponseApplicationOut) GetIterator() string { - if o == nil || o.Iterator.Get() == nil { + if o == nil || IsNil(o.Iterator.Get()) { var ret string return ret } @@ -102,7 +109,7 @@ func (o *ListResponseApplicationOut) GetIterator() string { // 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 *ListResponseApplicationOut) GetIteratorOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Iterator.Get(), o.Iterator.IsSet() @@ -133,7 +140,7 @@ func (o *ListResponseApplicationOut) UnsetIterator() { // GetPrevIterator returns the PrevIterator field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ListResponseApplicationOut) GetPrevIterator() string { - if o == nil || o.PrevIterator.Get() == nil { + if o == nil || IsNil(o.PrevIterator.Get()) { var ret string return ret } @@ -144,7 +151,7 @@ func (o *ListResponseApplicationOut) GetPrevIterator() string { // 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 *ListResponseApplicationOut) GetPrevIteratorOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.PrevIterator.Get(), o.PrevIterator.IsSet() @@ -174,20 +181,62 @@ func (o *ListResponseApplicationOut) UnsetPrevIterator() { } func (o ListResponseApplicationOut) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["data"] = o.Data - } - if true { - toSerialize["done"] = o.Done + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o ListResponseApplicationOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["done"] = o.Done if o.Iterator.IsSet() { toSerialize["iterator"] = o.Iterator.Get() } if o.PrevIterator.IsSet() { toSerialize["prevIterator"] = o.PrevIterator.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *ListResponseApplicationOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + "done", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListResponseApplicationOut := _ListResponseApplicationOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListResponseApplicationOut) + + if err != nil { + return err + } + + *o = ListResponseApplicationOut(varListResponseApplicationOut) + + return err } type NullableListResponseApplicationOut struct { diff --git a/go/internal/openapi/model_list_response_application_stats_.go b/go/internal/openapi/model_list_response_application_stats_.go index d011df619..befd1ec7a 100644 --- a/go/internal/openapi/model_list_response_application_stats_.go +++ b/go/internal/openapi/model_list_response_application_stats_.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the ListResponseApplicationStats type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListResponseApplicationStats{} + // ListResponseApplicationStats struct for ListResponseApplicationStats type ListResponseApplicationStats struct { Data []ApplicationStats `json:"data"` @@ -22,6 +27,8 @@ type ListResponseApplicationStats struct { PrevIterator NullableString `json:"prevIterator,omitempty"` } +type _ListResponseApplicationStats ListResponseApplicationStats + // NewListResponseApplicationStats instantiates a new ListResponseApplicationStats 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 @@ -53,11 +60,11 @@ func (o *ListResponseApplicationStats) GetData() []ApplicationStats { // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. -func (o *ListResponseApplicationStats) GetDataOk() (*[]ApplicationStats, bool) { - if o == nil { +func (o *ListResponseApplicationStats) GetDataOk() ([]ApplicationStats, bool) { + if o == nil { return nil, false } - return &o.Data, true + return o.Data, true } // SetData sets field value @@ -78,7 +85,7 @@ func (o *ListResponseApplicationStats) GetDone() bool { // GetDoneOk returns a tuple with the Done field value // and a boolean to check if the value has been set. func (o *ListResponseApplicationStats) GetDoneOk() (*bool, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Done, true @@ -91,7 +98,7 @@ func (o *ListResponseApplicationStats) SetDone(v bool) { // GetIterator returns the Iterator field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ListResponseApplicationStats) GetIterator() string { - if o == nil || o.Iterator.Get() == nil { + if o == nil || IsNil(o.Iterator.Get()) { var ret string return ret } @@ -102,7 +109,7 @@ func (o *ListResponseApplicationStats) GetIterator() string { // 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 *ListResponseApplicationStats) GetIteratorOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Iterator.Get(), o.Iterator.IsSet() @@ -133,7 +140,7 @@ func (o *ListResponseApplicationStats) UnsetIterator() { // GetPrevIterator returns the PrevIterator field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ListResponseApplicationStats) GetPrevIterator() string { - if o == nil || o.PrevIterator.Get() == nil { + if o == nil || IsNil(o.PrevIterator.Get()) { var ret string return ret } @@ -144,7 +151,7 @@ func (o *ListResponseApplicationStats) GetPrevIterator() string { // 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 *ListResponseApplicationStats) GetPrevIteratorOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.PrevIterator.Get(), o.PrevIterator.IsSet() @@ -174,20 +181,62 @@ func (o *ListResponseApplicationStats) UnsetPrevIterator() { } func (o ListResponseApplicationStats) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["data"] = o.Data - } - if true { - toSerialize["done"] = o.Done + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o ListResponseApplicationStats) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["done"] = o.Done if o.Iterator.IsSet() { toSerialize["iterator"] = o.Iterator.Get() } if o.PrevIterator.IsSet() { toSerialize["prevIterator"] = o.PrevIterator.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *ListResponseApplicationStats) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + "done", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListResponseApplicationStats := _ListResponseApplicationStats{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListResponseApplicationStats) + + if err != nil { + return err + } + + *o = ListResponseApplicationStats(varListResponseApplicationStats) + + return err } type NullableListResponseApplicationStats struct { diff --git a/go/internal/openapi/model_list_response_background_task_out_.go b/go/internal/openapi/model_list_response_background_task_out_.go index 2d9235db6..502ba5a0d 100644 --- a/go/internal/openapi/model_list_response_background_task_out_.go +++ b/go/internal/openapi/model_list_response_background_task_out_.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the ListResponseBackgroundTaskOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListResponseBackgroundTaskOut{} + // ListResponseBackgroundTaskOut struct for ListResponseBackgroundTaskOut type ListResponseBackgroundTaskOut struct { Data []BackgroundTaskOut `json:"data"` @@ -22,6 +27,8 @@ type ListResponseBackgroundTaskOut struct { PrevIterator NullableString `json:"prevIterator,omitempty"` } +type _ListResponseBackgroundTaskOut ListResponseBackgroundTaskOut + // NewListResponseBackgroundTaskOut instantiates a new ListResponseBackgroundTaskOut 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 @@ -53,11 +60,11 @@ func (o *ListResponseBackgroundTaskOut) GetData() []BackgroundTaskOut { // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. -func (o *ListResponseBackgroundTaskOut) GetDataOk() (*[]BackgroundTaskOut, bool) { - if o == nil { +func (o *ListResponseBackgroundTaskOut) GetDataOk() ([]BackgroundTaskOut, bool) { + if o == nil { return nil, false } - return &o.Data, true + return o.Data, true } // SetData sets field value @@ -78,7 +85,7 @@ func (o *ListResponseBackgroundTaskOut) GetDone() bool { // GetDoneOk returns a tuple with the Done field value // and a boolean to check if the value has been set. func (o *ListResponseBackgroundTaskOut) GetDoneOk() (*bool, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Done, true @@ -91,7 +98,7 @@ func (o *ListResponseBackgroundTaskOut) SetDone(v bool) { // GetIterator returns the Iterator field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ListResponseBackgroundTaskOut) GetIterator() string { - if o == nil || o.Iterator.Get() == nil { + if o == nil || IsNil(o.Iterator.Get()) { var ret string return ret } @@ -102,7 +109,7 @@ func (o *ListResponseBackgroundTaskOut) GetIterator() string { // 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 *ListResponseBackgroundTaskOut) GetIteratorOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Iterator.Get(), o.Iterator.IsSet() @@ -133,7 +140,7 @@ func (o *ListResponseBackgroundTaskOut) UnsetIterator() { // GetPrevIterator returns the PrevIterator field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ListResponseBackgroundTaskOut) GetPrevIterator() string { - if o == nil || o.PrevIterator.Get() == nil { + if o == nil || IsNil(o.PrevIterator.Get()) { var ret string return ret } @@ -144,7 +151,7 @@ func (o *ListResponseBackgroundTaskOut) GetPrevIterator() string { // 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 *ListResponseBackgroundTaskOut) GetPrevIteratorOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.PrevIterator.Get(), o.PrevIterator.IsSet() @@ -174,20 +181,62 @@ func (o *ListResponseBackgroundTaskOut) UnsetPrevIterator() { } func (o ListResponseBackgroundTaskOut) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["data"] = o.Data - } - if true { - toSerialize["done"] = o.Done + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o ListResponseBackgroundTaskOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["done"] = o.Done if o.Iterator.IsSet() { toSerialize["iterator"] = o.Iterator.Get() } if o.PrevIterator.IsSet() { toSerialize["prevIterator"] = o.PrevIterator.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *ListResponseBackgroundTaskOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + "done", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListResponseBackgroundTaskOut := _ListResponseBackgroundTaskOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListResponseBackgroundTaskOut) + + if err != nil { + return err + } + + *o = ListResponseBackgroundTaskOut(varListResponseBackgroundTaskOut) + + return err } type NullableListResponseBackgroundTaskOut struct { diff --git a/go/internal/openapi/model_list_response_endpoint_message_out_.go b/go/internal/openapi/model_list_response_endpoint_message_out_.go index 36283e084..bb418aeeb 100644 --- a/go/internal/openapi/model_list_response_endpoint_message_out_.go +++ b/go/internal/openapi/model_list_response_endpoint_message_out_.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the ListResponseEndpointMessageOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListResponseEndpointMessageOut{} + // ListResponseEndpointMessageOut struct for ListResponseEndpointMessageOut type ListResponseEndpointMessageOut struct { Data []EndpointMessageOut `json:"data"` @@ -22,6 +27,8 @@ type ListResponseEndpointMessageOut struct { PrevIterator NullableString `json:"prevIterator,omitempty"` } +type _ListResponseEndpointMessageOut ListResponseEndpointMessageOut + // NewListResponseEndpointMessageOut instantiates a new ListResponseEndpointMessageOut 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 @@ -53,11 +60,11 @@ func (o *ListResponseEndpointMessageOut) GetData() []EndpointMessageOut { // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. -func (o *ListResponseEndpointMessageOut) GetDataOk() (*[]EndpointMessageOut, bool) { - if o == nil { +func (o *ListResponseEndpointMessageOut) GetDataOk() ([]EndpointMessageOut, bool) { + if o == nil { return nil, false } - return &o.Data, true + return o.Data, true } // SetData sets field value @@ -78,7 +85,7 @@ func (o *ListResponseEndpointMessageOut) GetDone() bool { // GetDoneOk returns a tuple with the Done field value // and a boolean to check if the value has been set. func (o *ListResponseEndpointMessageOut) GetDoneOk() (*bool, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Done, true @@ -91,7 +98,7 @@ func (o *ListResponseEndpointMessageOut) SetDone(v bool) { // GetIterator returns the Iterator field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ListResponseEndpointMessageOut) GetIterator() string { - if o == nil || o.Iterator.Get() == nil { + if o == nil || IsNil(o.Iterator.Get()) { var ret string return ret } @@ -102,7 +109,7 @@ func (o *ListResponseEndpointMessageOut) GetIterator() string { // 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 *ListResponseEndpointMessageOut) GetIteratorOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Iterator.Get(), o.Iterator.IsSet() @@ -133,7 +140,7 @@ func (o *ListResponseEndpointMessageOut) UnsetIterator() { // GetPrevIterator returns the PrevIterator field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ListResponseEndpointMessageOut) GetPrevIterator() string { - if o == nil || o.PrevIterator.Get() == nil { + if o == nil || IsNil(o.PrevIterator.Get()) { var ret string return ret } @@ -144,7 +151,7 @@ func (o *ListResponseEndpointMessageOut) GetPrevIterator() string { // 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 *ListResponseEndpointMessageOut) GetPrevIteratorOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.PrevIterator.Get(), o.PrevIterator.IsSet() @@ -174,20 +181,62 @@ func (o *ListResponseEndpointMessageOut) UnsetPrevIterator() { } func (o ListResponseEndpointMessageOut) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["data"] = o.Data - } - if true { - toSerialize["done"] = o.Done + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o ListResponseEndpointMessageOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["done"] = o.Done if o.Iterator.IsSet() { toSerialize["iterator"] = o.Iterator.Get() } if o.PrevIterator.IsSet() { toSerialize["prevIterator"] = o.PrevIterator.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *ListResponseEndpointMessageOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + "done", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListResponseEndpointMessageOut := _ListResponseEndpointMessageOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListResponseEndpointMessageOut) + + if err != nil { + return err + } + + *o = ListResponseEndpointMessageOut(varListResponseEndpointMessageOut) + + return err } type NullableListResponseEndpointMessageOut struct { diff --git a/go/internal/openapi/model_list_response_endpoint_out_.go b/go/internal/openapi/model_list_response_endpoint_out_.go index d7eb57dd5..3449d9ebf 100644 --- a/go/internal/openapi/model_list_response_endpoint_out_.go +++ b/go/internal/openapi/model_list_response_endpoint_out_.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the ListResponseEndpointOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListResponseEndpointOut{} + // ListResponseEndpointOut struct for ListResponseEndpointOut type ListResponseEndpointOut struct { Data []EndpointOut `json:"data"` @@ -22,6 +27,8 @@ type ListResponseEndpointOut struct { PrevIterator NullableString `json:"prevIterator,omitempty"` } +type _ListResponseEndpointOut ListResponseEndpointOut + // NewListResponseEndpointOut instantiates a new ListResponseEndpointOut 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 @@ -53,11 +60,11 @@ func (o *ListResponseEndpointOut) GetData() []EndpointOut { // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. -func (o *ListResponseEndpointOut) GetDataOk() (*[]EndpointOut, bool) { - if o == nil { +func (o *ListResponseEndpointOut) GetDataOk() ([]EndpointOut, bool) { + if o == nil { return nil, false } - return &o.Data, true + return o.Data, true } // SetData sets field value @@ -78,7 +85,7 @@ func (o *ListResponseEndpointOut) GetDone() bool { // GetDoneOk returns a tuple with the Done field value // and a boolean to check if the value has been set. func (o *ListResponseEndpointOut) GetDoneOk() (*bool, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Done, true @@ -91,7 +98,7 @@ func (o *ListResponseEndpointOut) SetDone(v bool) { // GetIterator returns the Iterator field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ListResponseEndpointOut) GetIterator() string { - if o == nil || o.Iterator.Get() == nil { + if o == nil || IsNil(o.Iterator.Get()) { var ret string return ret } @@ -102,7 +109,7 @@ func (o *ListResponseEndpointOut) GetIterator() string { // 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 *ListResponseEndpointOut) GetIteratorOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Iterator.Get(), o.Iterator.IsSet() @@ -133,7 +140,7 @@ func (o *ListResponseEndpointOut) UnsetIterator() { // GetPrevIterator returns the PrevIterator field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ListResponseEndpointOut) GetPrevIterator() string { - if o == nil || o.PrevIterator.Get() == nil { + if o == nil || IsNil(o.PrevIterator.Get()) { var ret string return ret } @@ -144,7 +151,7 @@ func (o *ListResponseEndpointOut) GetPrevIterator() string { // 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 *ListResponseEndpointOut) GetPrevIteratorOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.PrevIterator.Get(), o.PrevIterator.IsSet() @@ -174,20 +181,62 @@ func (o *ListResponseEndpointOut) UnsetPrevIterator() { } func (o ListResponseEndpointOut) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["data"] = o.Data - } - if true { - toSerialize["done"] = o.Done + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o ListResponseEndpointOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["done"] = o.Done if o.Iterator.IsSet() { toSerialize["iterator"] = o.Iterator.Get() } if o.PrevIterator.IsSet() { toSerialize["prevIterator"] = o.PrevIterator.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *ListResponseEndpointOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + "done", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListResponseEndpointOut := _ListResponseEndpointOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListResponseEndpointOut) + + if err != nil { + return err + } + + *o = ListResponseEndpointOut(varListResponseEndpointOut) + + return err } type NullableListResponseEndpointOut struct { diff --git a/go/internal/openapi/model_list_response_event_type_out_.go b/go/internal/openapi/model_list_response_event_type_out_.go index b13151bbf..aa91c5f01 100644 --- a/go/internal/openapi/model_list_response_event_type_out_.go +++ b/go/internal/openapi/model_list_response_event_type_out_.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the ListResponseEventTypeOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListResponseEventTypeOut{} + // ListResponseEventTypeOut struct for ListResponseEventTypeOut type ListResponseEventTypeOut struct { Data []EventTypeOut `json:"data"` @@ -22,6 +27,8 @@ type ListResponseEventTypeOut struct { PrevIterator NullableString `json:"prevIterator,omitempty"` } +type _ListResponseEventTypeOut ListResponseEventTypeOut + // NewListResponseEventTypeOut instantiates a new ListResponseEventTypeOut 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 @@ -53,11 +60,11 @@ func (o *ListResponseEventTypeOut) GetData() []EventTypeOut { // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. -func (o *ListResponseEventTypeOut) GetDataOk() (*[]EventTypeOut, bool) { - if o == nil { +func (o *ListResponseEventTypeOut) GetDataOk() ([]EventTypeOut, bool) { + if o == nil { return nil, false } - return &o.Data, true + return o.Data, true } // SetData sets field value @@ -78,7 +85,7 @@ func (o *ListResponseEventTypeOut) GetDone() bool { // GetDoneOk returns a tuple with the Done field value // and a boolean to check if the value has been set. func (o *ListResponseEventTypeOut) GetDoneOk() (*bool, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Done, true @@ -91,7 +98,7 @@ func (o *ListResponseEventTypeOut) SetDone(v bool) { // GetIterator returns the Iterator field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ListResponseEventTypeOut) GetIterator() string { - if o == nil || o.Iterator.Get() == nil { + if o == nil || IsNil(o.Iterator.Get()) { var ret string return ret } @@ -102,7 +109,7 @@ func (o *ListResponseEventTypeOut) GetIterator() string { // 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 *ListResponseEventTypeOut) GetIteratorOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Iterator.Get(), o.Iterator.IsSet() @@ -133,7 +140,7 @@ func (o *ListResponseEventTypeOut) UnsetIterator() { // GetPrevIterator returns the PrevIterator field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ListResponseEventTypeOut) GetPrevIterator() string { - if o == nil || o.PrevIterator.Get() == nil { + if o == nil || IsNil(o.PrevIterator.Get()) { var ret string return ret } @@ -144,7 +151,7 @@ func (o *ListResponseEventTypeOut) GetPrevIterator() string { // 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 *ListResponseEventTypeOut) GetPrevIteratorOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.PrevIterator.Get(), o.PrevIterator.IsSet() @@ -174,20 +181,62 @@ func (o *ListResponseEventTypeOut) UnsetPrevIterator() { } func (o ListResponseEventTypeOut) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["data"] = o.Data - } - if true { - toSerialize["done"] = o.Done + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o ListResponseEventTypeOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["done"] = o.Done if o.Iterator.IsSet() { toSerialize["iterator"] = o.Iterator.Get() } if o.PrevIterator.IsSet() { toSerialize["prevIterator"] = o.PrevIterator.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *ListResponseEventTypeOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + "done", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListResponseEventTypeOut := _ListResponseEventTypeOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListResponseEventTypeOut) + + if err != nil { + return err + } + + *o = ListResponseEventTypeOut(varListResponseEventTypeOut) + + return err } type NullableListResponseEventTypeOut struct { diff --git a/go/internal/openapi/model_list_response_integration_out_.go b/go/internal/openapi/model_list_response_integration_out_.go index af961f5ac..4c939fad2 100644 --- a/go/internal/openapi/model_list_response_integration_out_.go +++ b/go/internal/openapi/model_list_response_integration_out_.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the ListResponseIntegrationOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListResponseIntegrationOut{} + // ListResponseIntegrationOut struct for ListResponseIntegrationOut type ListResponseIntegrationOut struct { Data []IntegrationOut `json:"data"` @@ -22,6 +27,8 @@ type ListResponseIntegrationOut struct { PrevIterator NullableString `json:"prevIterator,omitempty"` } +type _ListResponseIntegrationOut ListResponseIntegrationOut + // NewListResponseIntegrationOut instantiates a new ListResponseIntegrationOut 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 @@ -53,11 +60,11 @@ func (o *ListResponseIntegrationOut) GetData() []IntegrationOut { // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. -func (o *ListResponseIntegrationOut) GetDataOk() (*[]IntegrationOut, bool) { - if o == nil { +func (o *ListResponseIntegrationOut) GetDataOk() ([]IntegrationOut, bool) { + if o == nil { return nil, false } - return &o.Data, true + return o.Data, true } // SetData sets field value @@ -78,7 +85,7 @@ func (o *ListResponseIntegrationOut) GetDone() bool { // GetDoneOk returns a tuple with the Done field value // and a boolean to check if the value has been set. func (o *ListResponseIntegrationOut) GetDoneOk() (*bool, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Done, true @@ -91,7 +98,7 @@ func (o *ListResponseIntegrationOut) SetDone(v bool) { // GetIterator returns the Iterator field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ListResponseIntegrationOut) GetIterator() string { - if o == nil || o.Iterator.Get() == nil { + if o == nil || IsNil(o.Iterator.Get()) { var ret string return ret } @@ -102,7 +109,7 @@ func (o *ListResponseIntegrationOut) GetIterator() string { // 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 *ListResponseIntegrationOut) GetIteratorOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Iterator.Get(), o.Iterator.IsSet() @@ -133,7 +140,7 @@ func (o *ListResponseIntegrationOut) UnsetIterator() { // GetPrevIterator returns the PrevIterator field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ListResponseIntegrationOut) GetPrevIterator() string { - if o == nil || o.PrevIterator.Get() == nil { + if o == nil || IsNil(o.PrevIterator.Get()) { var ret string return ret } @@ -144,7 +151,7 @@ func (o *ListResponseIntegrationOut) GetPrevIterator() string { // 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 *ListResponseIntegrationOut) GetPrevIteratorOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.PrevIterator.Get(), o.PrevIterator.IsSet() @@ -174,20 +181,62 @@ func (o *ListResponseIntegrationOut) UnsetPrevIterator() { } func (o ListResponseIntegrationOut) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["data"] = o.Data - } - if true { - toSerialize["done"] = o.Done + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o ListResponseIntegrationOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["done"] = o.Done if o.Iterator.IsSet() { toSerialize["iterator"] = o.Iterator.Get() } if o.PrevIterator.IsSet() { toSerialize["prevIterator"] = o.PrevIterator.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *ListResponseIntegrationOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + "done", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListResponseIntegrationOut := _ListResponseIntegrationOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListResponseIntegrationOut) + + if err != nil { + return err + } + + *o = ListResponseIntegrationOut(varListResponseIntegrationOut) + + return err } type NullableListResponseIntegrationOut struct { diff --git a/go/internal/openapi/model_list_response_message_attempt_endpoint_out_.go b/go/internal/openapi/model_list_response_message_attempt_endpoint_out_.go index 4ea0e1712..f41752348 100644 --- a/go/internal/openapi/model_list_response_message_attempt_endpoint_out_.go +++ b/go/internal/openapi/model_list_response_message_attempt_endpoint_out_.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the ListResponseMessageAttemptEndpointOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListResponseMessageAttemptEndpointOut{} + // ListResponseMessageAttemptEndpointOut struct for ListResponseMessageAttemptEndpointOut type ListResponseMessageAttemptEndpointOut struct { Data []MessageAttemptEndpointOut `json:"data"` @@ -22,6 +27,8 @@ type ListResponseMessageAttemptEndpointOut struct { PrevIterator NullableString `json:"prevIterator,omitempty"` } +type _ListResponseMessageAttemptEndpointOut ListResponseMessageAttemptEndpointOut + // NewListResponseMessageAttemptEndpointOut instantiates a new ListResponseMessageAttemptEndpointOut 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 @@ -53,11 +60,11 @@ func (o *ListResponseMessageAttemptEndpointOut) GetData() []MessageAttemptEndpoi // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. -func (o *ListResponseMessageAttemptEndpointOut) GetDataOk() (*[]MessageAttemptEndpointOut, bool) { - if o == nil { +func (o *ListResponseMessageAttemptEndpointOut) GetDataOk() ([]MessageAttemptEndpointOut, bool) { + if o == nil { return nil, false } - return &o.Data, true + return o.Data, true } // SetData sets field value @@ -78,7 +85,7 @@ func (o *ListResponseMessageAttemptEndpointOut) GetDone() bool { // GetDoneOk returns a tuple with the Done field value // and a boolean to check if the value has been set. func (o *ListResponseMessageAttemptEndpointOut) GetDoneOk() (*bool, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Done, true @@ -91,7 +98,7 @@ func (o *ListResponseMessageAttemptEndpointOut) SetDone(v bool) { // GetIterator returns the Iterator field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ListResponseMessageAttemptEndpointOut) GetIterator() string { - if o == nil || o.Iterator.Get() == nil { + if o == nil || IsNil(o.Iterator.Get()) { var ret string return ret } @@ -102,7 +109,7 @@ func (o *ListResponseMessageAttemptEndpointOut) GetIterator() string { // 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 *ListResponseMessageAttemptEndpointOut) GetIteratorOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Iterator.Get(), o.Iterator.IsSet() @@ -133,7 +140,7 @@ func (o *ListResponseMessageAttemptEndpointOut) UnsetIterator() { // GetPrevIterator returns the PrevIterator field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ListResponseMessageAttemptEndpointOut) GetPrevIterator() string { - if o == nil || o.PrevIterator.Get() == nil { + if o == nil || IsNil(o.PrevIterator.Get()) { var ret string return ret } @@ -144,7 +151,7 @@ func (o *ListResponseMessageAttemptEndpointOut) GetPrevIterator() string { // 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 *ListResponseMessageAttemptEndpointOut) GetPrevIteratorOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.PrevIterator.Get(), o.PrevIterator.IsSet() @@ -174,20 +181,62 @@ func (o *ListResponseMessageAttemptEndpointOut) UnsetPrevIterator() { } func (o ListResponseMessageAttemptEndpointOut) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["data"] = o.Data - } - if true { - toSerialize["done"] = o.Done + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o ListResponseMessageAttemptEndpointOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["done"] = o.Done if o.Iterator.IsSet() { toSerialize["iterator"] = o.Iterator.Get() } if o.PrevIterator.IsSet() { toSerialize["prevIterator"] = o.PrevIterator.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *ListResponseMessageAttemptEndpointOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + "done", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListResponseMessageAttemptEndpointOut := _ListResponseMessageAttemptEndpointOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListResponseMessageAttemptEndpointOut) + + if err != nil { + return err + } + + *o = ListResponseMessageAttemptEndpointOut(varListResponseMessageAttemptEndpointOut) + + return err } type NullableListResponseMessageAttemptEndpointOut struct { diff --git a/go/internal/openapi/model_list_response_message_attempt_out_.go b/go/internal/openapi/model_list_response_message_attempt_out_.go index beb0121d5..c8376e59d 100644 --- a/go/internal/openapi/model_list_response_message_attempt_out_.go +++ b/go/internal/openapi/model_list_response_message_attempt_out_.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the ListResponseMessageAttemptOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListResponseMessageAttemptOut{} + // ListResponseMessageAttemptOut struct for ListResponseMessageAttemptOut type ListResponseMessageAttemptOut struct { Data []MessageAttemptOut `json:"data"` @@ -22,6 +27,8 @@ type ListResponseMessageAttemptOut struct { PrevIterator NullableString `json:"prevIterator,omitempty"` } +type _ListResponseMessageAttemptOut ListResponseMessageAttemptOut + // NewListResponseMessageAttemptOut instantiates a new ListResponseMessageAttemptOut 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 @@ -53,11 +60,11 @@ func (o *ListResponseMessageAttemptOut) GetData() []MessageAttemptOut { // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. -func (o *ListResponseMessageAttemptOut) GetDataOk() (*[]MessageAttemptOut, bool) { - if o == nil { +func (o *ListResponseMessageAttemptOut) GetDataOk() ([]MessageAttemptOut, bool) { + if o == nil { return nil, false } - return &o.Data, true + return o.Data, true } // SetData sets field value @@ -78,7 +85,7 @@ func (o *ListResponseMessageAttemptOut) GetDone() bool { // GetDoneOk returns a tuple with the Done field value // and a boolean to check if the value has been set. func (o *ListResponseMessageAttemptOut) GetDoneOk() (*bool, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Done, true @@ -91,7 +98,7 @@ func (o *ListResponseMessageAttemptOut) SetDone(v bool) { // GetIterator returns the Iterator field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ListResponseMessageAttemptOut) GetIterator() string { - if o == nil || o.Iterator.Get() == nil { + if o == nil || IsNil(o.Iterator.Get()) { var ret string return ret } @@ -102,7 +109,7 @@ func (o *ListResponseMessageAttemptOut) GetIterator() string { // 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 *ListResponseMessageAttemptOut) GetIteratorOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Iterator.Get(), o.Iterator.IsSet() @@ -133,7 +140,7 @@ func (o *ListResponseMessageAttemptOut) UnsetIterator() { // GetPrevIterator returns the PrevIterator field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ListResponseMessageAttemptOut) GetPrevIterator() string { - if o == nil || o.PrevIterator.Get() == nil { + if o == nil || IsNil(o.PrevIterator.Get()) { var ret string return ret } @@ -144,7 +151,7 @@ func (o *ListResponseMessageAttemptOut) GetPrevIterator() string { // 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 *ListResponseMessageAttemptOut) GetPrevIteratorOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.PrevIterator.Get(), o.PrevIterator.IsSet() @@ -174,20 +181,62 @@ func (o *ListResponseMessageAttemptOut) UnsetPrevIterator() { } func (o ListResponseMessageAttemptOut) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["data"] = o.Data - } - if true { - toSerialize["done"] = o.Done + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o ListResponseMessageAttemptOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["done"] = o.Done if o.Iterator.IsSet() { toSerialize["iterator"] = o.Iterator.Get() } if o.PrevIterator.IsSet() { toSerialize["prevIterator"] = o.PrevIterator.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *ListResponseMessageAttemptOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + "done", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListResponseMessageAttemptOut := _ListResponseMessageAttemptOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListResponseMessageAttemptOut) + + if err != nil { + return err + } + + *o = ListResponseMessageAttemptOut(varListResponseMessageAttemptOut) + + return err } type NullableListResponseMessageAttemptOut struct { diff --git a/go/internal/openapi/model_list_response_message_endpoint_out_.go b/go/internal/openapi/model_list_response_message_endpoint_out_.go index 4d036c3a2..93e621b58 100644 --- a/go/internal/openapi/model_list_response_message_endpoint_out_.go +++ b/go/internal/openapi/model_list_response_message_endpoint_out_.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the ListResponseMessageEndpointOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListResponseMessageEndpointOut{} + // ListResponseMessageEndpointOut struct for ListResponseMessageEndpointOut type ListResponseMessageEndpointOut struct { Data []MessageEndpointOut `json:"data"` @@ -22,6 +27,8 @@ type ListResponseMessageEndpointOut struct { PrevIterator NullableString `json:"prevIterator,omitempty"` } +type _ListResponseMessageEndpointOut ListResponseMessageEndpointOut + // NewListResponseMessageEndpointOut instantiates a new ListResponseMessageEndpointOut 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 @@ -53,11 +60,11 @@ func (o *ListResponseMessageEndpointOut) GetData() []MessageEndpointOut { // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. -func (o *ListResponseMessageEndpointOut) GetDataOk() (*[]MessageEndpointOut, bool) { - if o == nil { +func (o *ListResponseMessageEndpointOut) GetDataOk() ([]MessageEndpointOut, bool) { + if o == nil { return nil, false } - return &o.Data, true + return o.Data, true } // SetData sets field value @@ -78,7 +85,7 @@ func (o *ListResponseMessageEndpointOut) GetDone() bool { // GetDoneOk returns a tuple with the Done field value // and a boolean to check if the value has been set. func (o *ListResponseMessageEndpointOut) GetDoneOk() (*bool, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Done, true @@ -91,7 +98,7 @@ func (o *ListResponseMessageEndpointOut) SetDone(v bool) { // GetIterator returns the Iterator field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ListResponseMessageEndpointOut) GetIterator() string { - if o == nil || o.Iterator.Get() == nil { + if o == nil || IsNil(o.Iterator.Get()) { var ret string return ret } @@ -102,7 +109,7 @@ func (o *ListResponseMessageEndpointOut) GetIterator() string { // 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 *ListResponseMessageEndpointOut) GetIteratorOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Iterator.Get(), o.Iterator.IsSet() @@ -133,7 +140,7 @@ func (o *ListResponseMessageEndpointOut) UnsetIterator() { // GetPrevIterator returns the PrevIterator field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ListResponseMessageEndpointOut) GetPrevIterator() string { - if o == nil || o.PrevIterator.Get() == nil { + if o == nil || IsNil(o.PrevIterator.Get()) { var ret string return ret } @@ -144,7 +151,7 @@ func (o *ListResponseMessageEndpointOut) GetPrevIterator() string { // 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 *ListResponseMessageEndpointOut) GetPrevIteratorOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.PrevIterator.Get(), o.PrevIterator.IsSet() @@ -174,20 +181,62 @@ func (o *ListResponseMessageEndpointOut) UnsetPrevIterator() { } func (o ListResponseMessageEndpointOut) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["data"] = o.Data - } - if true { - toSerialize["done"] = o.Done + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o ListResponseMessageEndpointOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["done"] = o.Done if o.Iterator.IsSet() { toSerialize["iterator"] = o.Iterator.Get() } if o.PrevIterator.IsSet() { toSerialize["prevIterator"] = o.PrevIterator.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *ListResponseMessageEndpointOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + "done", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListResponseMessageEndpointOut := _ListResponseMessageEndpointOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListResponseMessageEndpointOut) + + if err != nil { + return err + } + + *o = ListResponseMessageEndpointOut(varListResponseMessageEndpointOut) + + return err } type NullableListResponseMessageEndpointOut struct { diff --git a/go/internal/openapi/model_list_response_message_out_.go b/go/internal/openapi/model_list_response_message_out_.go index 63a6ebfec..897b5b5a1 100644 --- a/go/internal/openapi/model_list_response_message_out_.go +++ b/go/internal/openapi/model_list_response_message_out_.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the ListResponseMessageOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListResponseMessageOut{} + // ListResponseMessageOut struct for ListResponseMessageOut type ListResponseMessageOut struct { Data []MessageOut `json:"data"` @@ -22,6 +27,8 @@ type ListResponseMessageOut struct { PrevIterator NullableString `json:"prevIterator,omitempty"` } +type _ListResponseMessageOut ListResponseMessageOut + // NewListResponseMessageOut instantiates a new ListResponseMessageOut 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 @@ -53,11 +60,11 @@ func (o *ListResponseMessageOut) GetData() []MessageOut { // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. -func (o *ListResponseMessageOut) GetDataOk() (*[]MessageOut, bool) { - if o == nil { +func (o *ListResponseMessageOut) GetDataOk() ([]MessageOut, bool) { + if o == nil { return nil, false } - return &o.Data, true + return o.Data, true } // SetData sets field value @@ -78,7 +85,7 @@ func (o *ListResponseMessageOut) GetDone() bool { // GetDoneOk returns a tuple with the Done field value // and a boolean to check if the value has been set. func (o *ListResponseMessageOut) GetDoneOk() (*bool, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Done, true @@ -91,7 +98,7 @@ func (o *ListResponseMessageOut) SetDone(v bool) { // GetIterator returns the Iterator field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ListResponseMessageOut) GetIterator() string { - if o == nil || o.Iterator.Get() == nil { + if o == nil || IsNil(o.Iterator.Get()) { var ret string return ret } @@ -102,7 +109,7 @@ func (o *ListResponseMessageOut) GetIterator() string { // 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 *ListResponseMessageOut) GetIteratorOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Iterator.Get(), o.Iterator.IsSet() @@ -133,7 +140,7 @@ func (o *ListResponseMessageOut) UnsetIterator() { // GetPrevIterator returns the PrevIterator field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ListResponseMessageOut) GetPrevIterator() string { - if o == nil || o.PrevIterator.Get() == nil { + if o == nil || IsNil(o.PrevIterator.Get()) { var ret string return ret } @@ -144,7 +151,7 @@ func (o *ListResponseMessageOut) GetPrevIterator() string { // 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 *ListResponseMessageOut) GetPrevIteratorOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.PrevIterator.Get(), o.PrevIterator.IsSet() @@ -174,20 +181,62 @@ func (o *ListResponseMessageOut) UnsetPrevIterator() { } func (o ListResponseMessageOut) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["data"] = o.Data - } - if true { - toSerialize["done"] = o.Done + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o ListResponseMessageOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["done"] = o.Done if o.Iterator.IsSet() { toSerialize["iterator"] = o.Iterator.Get() } if o.PrevIterator.IsSet() { toSerialize["prevIterator"] = o.PrevIterator.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *ListResponseMessageOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + "done", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListResponseMessageOut := _ListResponseMessageOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListResponseMessageOut) + + if err != nil { + return err + } + + *o = ListResponseMessageOut(varListResponseMessageOut) + + return err } type NullableListResponseMessageOut struct { diff --git a/go/internal/openapi/model_list_response_template_out_.go b/go/internal/openapi/model_list_response_template_out_.go index e6c2e60e0..355066233 100644 --- a/go/internal/openapi/model_list_response_template_out_.go +++ b/go/internal/openapi/model_list_response_template_out_.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the ListResponseTemplateOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListResponseTemplateOut{} + // ListResponseTemplateOut struct for ListResponseTemplateOut type ListResponseTemplateOut struct { Data []TemplateOut `json:"data"` @@ -22,6 +27,8 @@ type ListResponseTemplateOut struct { PrevIterator NullableString `json:"prevIterator,omitempty"` } +type _ListResponseTemplateOut ListResponseTemplateOut + // NewListResponseTemplateOut instantiates a new ListResponseTemplateOut 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 @@ -53,11 +60,11 @@ func (o *ListResponseTemplateOut) GetData() []TemplateOut { // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. -func (o *ListResponseTemplateOut) GetDataOk() (*[]TemplateOut, bool) { - if o == nil { +func (o *ListResponseTemplateOut) GetDataOk() ([]TemplateOut, bool) { + if o == nil { return nil, false } - return &o.Data, true + return o.Data, true } // SetData sets field value @@ -78,7 +85,7 @@ func (o *ListResponseTemplateOut) GetDone() bool { // GetDoneOk returns a tuple with the Done field value // and a boolean to check if the value has been set. func (o *ListResponseTemplateOut) GetDoneOk() (*bool, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Done, true @@ -91,7 +98,7 @@ func (o *ListResponseTemplateOut) SetDone(v bool) { // GetIterator returns the Iterator field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ListResponseTemplateOut) GetIterator() string { - if o == nil || o.Iterator.Get() == nil { + if o == nil || IsNil(o.Iterator.Get()) { var ret string return ret } @@ -102,7 +109,7 @@ func (o *ListResponseTemplateOut) GetIterator() string { // 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 *ListResponseTemplateOut) GetIteratorOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Iterator.Get(), o.Iterator.IsSet() @@ -133,7 +140,7 @@ func (o *ListResponseTemplateOut) UnsetIterator() { // GetPrevIterator returns the PrevIterator field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ListResponseTemplateOut) GetPrevIterator() string { - if o == nil || o.PrevIterator.Get() == nil { + if o == nil || IsNil(o.PrevIterator.Get()) { var ret string return ret } @@ -144,7 +151,7 @@ func (o *ListResponseTemplateOut) GetPrevIterator() string { // 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 *ListResponseTemplateOut) GetPrevIteratorOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.PrevIterator.Get(), o.PrevIterator.IsSet() @@ -174,20 +181,62 @@ func (o *ListResponseTemplateOut) UnsetPrevIterator() { } func (o ListResponseTemplateOut) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["data"] = o.Data - } - if true { - toSerialize["done"] = o.Done + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o ListResponseTemplateOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["done"] = o.Done if o.Iterator.IsSet() { toSerialize["iterator"] = o.Iterator.Get() } if o.PrevIterator.IsSet() { toSerialize["prevIterator"] = o.PrevIterator.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *ListResponseTemplateOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + "done", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListResponseTemplateOut := _ListResponseTemplateOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListResponseTemplateOut) + + if err != nil { + return err + } + + *o = ListResponseTemplateOut(varListResponseTemplateOut) + + return err } type NullableListResponseTemplateOut struct { diff --git a/go/internal/openapi/model_message_attempt_endpoint_out.go b/go/internal/openapi/model_message_attempt_endpoint_out.go index 4bf84d3c7..f4bcbd213 100644 --- a/go/internal/openapi/model_message_attempt_endpoint_out.go +++ b/go/internal/openapi/model_message_attempt_endpoint_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -13,8 +13,13 @@ package openapi import ( "encoding/json" "time" + "bytes" + "fmt" ) +// checks if the MessageAttemptEndpointOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MessageAttemptEndpointOut{} + // MessageAttemptEndpointOut struct for MessageAttemptEndpointOut type MessageAttemptEndpointOut struct { // The ep's ID @@ -32,6 +37,8 @@ type MessageAttemptEndpointOut struct { Url string `json:"url"` } +type _MessageAttemptEndpointOut MessageAttemptEndpointOut + // NewMessageAttemptEndpointOut instantiates a new MessageAttemptEndpointOut 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 @@ -71,7 +78,7 @@ func (o *MessageAttemptEndpointOut) GetEndpointId() string { // GetEndpointIdOk returns a tuple with the EndpointId field value // and a boolean to check if the value has been set. func (o *MessageAttemptEndpointOut) GetEndpointIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.EndpointId, true @@ -95,7 +102,7 @@ func (o *MessageAttemptEndpointOut) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *MessageAttemptEndpointOut) GetIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Id, true @@ -108,7 +115,7 @@ func (o *MessageAttemptEndpointOut) SetId(v string) { // GetMsg returns the Msg field value if set, zero value otherwise. func (o *MessageAttemptEndpointOut) GetMsg() MessageOut { - if o == nil || o.Msg == nil { + if o == nil || IsNil(o.Msg) { var ret MessageOut return ret } @@ -118,7 +125,7 @@ func (o *MessageAttemptEndpointOut) GetMsg() MessageOut { // GetMsgOk returns a tuple with the Msg field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MessageAttemptEndpointOut) GetMsgOk() (*MessageOut, bool) { - if o == nil || o.Msg == nil { + if o == nil || IsNil(o.Msg) { return nil, false } return o.Msg, true @@ -126,7 +133,7 @@ func (o *MessageAttemptEndpointOut) GetMsgOk() (*MessageOut, bool) { // HasMsg returns a boolean if a field has been set. func (o *MessageAttemptEndpointOut) HasMsg() bool { - if o != nil && o.Msg != nil { + if o != nil && !IsNil(o.Msg) { return true } @@ -151,7 +158,7 @@ func (o *MessageAttemptEndpointOut) GetMsgId() string { // GetMsgIdOk returns a tuple with the MsgId field value // and a boolean to check if the value has been set. func (o *MessageAttemptEndpointOut) GetMsgIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.MsgId, true @@ -175,7 +182,7 @@ func (o *MessageAttemptEndpointOut) GetResponse() string { // GetResponseOk returns a tuple with the Response field value // and a boolean to check if the value has been set. func (o *MessageAttemptEndpointOut) GetResponseOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Response, true @@ -199,7 +206,7 @@ func (o *MessageAttemptEndpointOut) GetResponseStatusCode() int32 { // GetResponseStatusCodeOk returns a tuple with the ResponseStatusCode field value // and a boolean to check if the value has been set. func (o *MessageAttemptEndpointOut) GetResponseStatusCodeOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return &o.ResponseStatusCode, true @@ -223,7 +230,7 @@ func (o *MessageAttemptEndpointOut) GetStatus() MessageStatus { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. func (o *MessageAttemptEndpointOut) GetStatusOk() (*MessageStatus, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Status, true @@ -247,7 +254,7 @@ func (o *MessageAttemptEndpointOut) GetTimestamp() time.Time { // GetTimestampOk returns a tuple with the Timestamp field value // and a boolean to check if the value has been set. func (o *MessageAttemptEndpointOut) GetTimestampOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Timestamp, true @@ -271,7 +278,7 @@ func (o *MessageAttemptEndpointOut) GetTriggerType() MessageAttemptTriggerType { // GetTriggerTypeOk returns a tuple with the TriggerType field value // and a boolean to check if the value has been set. func (o *MessageAttemptEndpointOut) GetTriggerTypeOk() (*MessageAttemptTriggerType, bool) { - if o == nil { + if o == nil { return nil, false } return &o.TriggerType, true @@ -295,7 +302,7 @@ func (o *MessageAttemptEndpointOut) GetUrl() string { // GetUrlOk returns a tuple with the Url field value // and a boolean to check if the value has been set. func (o *MessageAttemptEndpointOut) GetUrlOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Url, true @@ -307,38 +314,73 @@ func (o *MessageAttemptEndpointOut) SetUrl(v string) { } func (o MessageAttemptEndpointOut) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["endpointId"] = o.EndpointId + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if true { - toSerialize["id"] = o.Id - } - if o.Msg != nil { + return json.Marshal(toSerialize) +} + +func (o MessageAttemptEndpointOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["endpointId"] = o.EndpointId + toSerialize["id"] = o.Id + if !IsNil(o.Msg) { toSerialize["msg"] = o.Msg } - if true { - toSerialize["msgId"] = o.MsgId - } - if true { - toSerialize["response"] = o.Response + toSerialize["msgId"] = o.MsgId + toSerialize["response"] = o.Response + toSerialize["responseStatusCode"] = o.ResponseStatusCode + toSerialize["status"] = o.Status + toSerialize["timestamp"] = o.Timestamp + toSerialize["triggerType"] = o.TriggerType + toSerialize["url"] = o.Url + return toSerialize, nil +} + +func (o *MessageAttemptEndpointOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "endpointId", + "id", + "msgId", + "response", + "responseStatusCode", + "status", + "timestamp", + "triggerType", + "url", } - if true { - toSerialize["responseStatusCode"] = o.ResponseStatusCode - } - if true { - toSerialize["status"] = o.Status - } - if true { - toSerialize["timestamp"] = o.Timestamp + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["triggerType"] = o.TriggerType + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - if true { - toSerialize["url"] = o.Url + + varMessageAttemptEndpointOut := _MessageAttemptEndpointOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMessageAttemptEndpointOut) + + if err != nil { + return err } - return json.Marshal(toSerialize) + + *o = MessageAttemptEndpointOut(varMessageAttemptEndpointOut) + + return err } type NullableMessageAttemptEndpointOut struct { diff --git a/go/internal/openapi/model_message_attempt_exhausted_event.go b/go/internal/openapi/model_message_attempt_exhausted_event.go index 8e1eca82e..cb9d09482 100644 --- a/go/internal/openapi/model_message_attempt_exhausted_event.go +++ b/go/internal/openapi/model_message_attempt_exhausted_event.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,14 +12,21 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the MessageAttemptExhaustedEvent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MessageAttemptExhaustedEvent{} + // MessageAttemptExhaustedEvent Sent when a message delivery has failed (all of the retry attempts have been exhausted). type MessageAttemptExhaustedEvent struct { Data MessageAttemptExhaustedEventData `json:"data"` Type string `json:"type"` } +type _MessageAttemptExhaustedEvent MessageAttemptExhaustedEvent + // NewMessageAttemptExhaustedEvent instantiates a new MessageAttemptExhaustedEvent 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 @@ -54,7 +61,7 @@ func (o *MessageAttemptExhaustedEvent) GetData() MessageAttemptExhaustedEventDat // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. func (o *MessageAttemptExhaustedEvent) GetDataOk() (*MessageAttemptExhaustedEventData, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Data, true @@ -78,7 +85,7 @@ func (o *MessageAttemptExhaustedEvent) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *MessageAttemptExhaustedEvent) GetTypeOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Type, true @@ -90,14 +97,56 @@ func (o *MessageAttemptExhaustedEvent) SetType(v string) { } func (o MessageAttemptExhaustedEvent) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MessageAttemptExhaustedEvent) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["data"] = o.Data + toSerialize["data"] = o.Data + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *MessageAttemptExhaustedEvent) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["type"] = o.Type + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varMessageAttemptExhaustedEvent := _MessageAttemptExhaustedEvent{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMessageAttemptExhaustedEvent) + + if err != nil { + return err + } + + *o = MessageAttemptExhaustedEvent(varMessageAttemptExhaustedEvent) + + return err } type NullableMessageAttemptExhaustedEvent struct { diff --git a/go/internal/openapi/model_message_attempt_exhausted_event_data.go b/go/internal/openapi/model_message_attempt_exhausted_event_data.go index b55029633..7e4da165f 100644 --- a/go/internal/openapi/model_message_attempt_exhausted_event_data.go +++ b/go/internal/openapi/model_message_attempt_exhausted_event_data.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the MessageAttemptExhaustedEventData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MessageAttemptExhaustedEventData{} + // MessageAttemptExhaustedEventData Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a \"message.attempt.exhausted\" type or after it's failed four times as a \"message.attempt.failing\" event. type MessageAttemptExhaustedEventData struct { // The app's ID @@ -29,6 +34,8 @@ type MessageAttemptExhaustedEventData struct { MsgId string `json:"msgId"` } +type _MessageAttemptExhaustedEventData MessageAttemptExhaustedEventData + // NewMessageAttemptExhaustedEventData instantiates a new MessageAttemptExhaustedEventData 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 @@ -63,7 +70,7 @@ func (o *MessageAttemptExhaustedEventData) GetAppId() string { // GetAppIdOk returns a tuple with the AppId field value // and a boolean to check if the value has been set. func (o *MessageAttemptExhaustedEventData) GetAppIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.AppId, true @@ -76,7 +83,7 @@ func (o *MessageAttemptExhaustedEventData) SetAppId(v string) { // GetAppUid returns the AppUid field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MessageAttemptExhaustedEventData) GetAppUid() string { - if o == nil || o.AppUid.Get() == nil { + if o == nil || IsNil(o.AppUid.Get()) { var ret string return ret } @@ -87,7 +94,7 @@ func (o *MessageAttemptExhaustedEventData) GetAppUid() string { // 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 *MessageAttemptExhaustedEventData) GetAppUidOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.AppUid.Get(), o.AppUid.IsSet() @@ -129,7 +136,7 @@ func (o *MessageAttemptExhaustedEventData) GetEndpointId() string { // GetEndpointIdOk returns a tuple with the EndpointId field value // and a boolean to check if the value has been set. func (o *MessageAttemptExhaustedEventData) GetEndpointIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.EndpointId, true @@ -153,7 +160,7 @@ func (o *MessageAttemptExhaustedEventData) GetLastAttempt() MessageAttemptFailed // GetLastAttemptOk returns a tuple with the LastAttempt field value // and a boolean to check if the value has been set. func (o *MessageAttemptExhaustedEventData) GetLastAttemptOk() (*MessageAttemptFailedData, bool) { - if o == nil { + if o == nil { return nil, false } return &o.LastAttempt, true @@ -166,7 +173,7 @@ func (o *MessageAttemptExhaustedEventData) SetLastAttempt(v MessageAttemptFailed // GetMsgEventId returns the MsgEventId field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MessageAttemptExhaustedEventData) GetMsgEventId() string { - if o == nil || o.MsgEventId.Get() == nil { + if o == nil || IsNil(o.MsgEventId.Get()) { var ret string return ret } @@ -177,7 +184,7 @@ func (o *MessageAttemptExhaustedEventData) GetMsgEventId() string { // 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 *MessageAttemptExhaustedEventData) GetMsgEventIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.MsgEventId.Get(), o.MsgEventId.IsSet() @@ -219,7 +226,7 @@ func (o *MessageAttemptExhaustedEventData) GetMsgId() string { // GetMsgIdOk returns a tuple with the MsgId field value // and a boolean to check if the value has been set. func (o *MessageAttemptExhaustedEventData) GetMsgIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.MsgId, true @@ -231,26 +238,66 @@ func (o *MessageAttemptExhaustedEventData) SetMsgId(v string) { } func (o MessageAttemptExhaustedEventData) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["appId"] = o.AppId + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o MessageAttemptExhaustedEventData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["appId"] = o.AppId if o.AppUid.IsSet() { toSerialize["appUid"] = o.AppUid.Get() } - if true { - toSerialize["endpointId"] = o.EndpointId - } - if true { - toSerialize["lastAttempt"] = o.LastAttempt - } + toSerialize["endpointId"] = o.EndpointId + toSerialize["lastAttempt"] = o.LastAttempt if o.MsgEventId.IsSet() { toSerialize["msgEventId"] = o.MsgEventId.Get() } - if true { - toSerialize["msgId"] = o.MsgId + toSerialize["msgId"] = o.MsgId + return toSerialize, nil +} + +func (o *MessageAttemptExhaustedEventData) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "appId", + "endpointId", + "lastAttempt", + "msgId", } - return json.Marshal(toSerialize) + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMessageAttemptExhaustedEventData := _MessageAttemptExhaustedEventData{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMessageAttemptExhaustedEventData) + + if err != nil { + return err + } + + *o = MessageAttemptExhaustedEventData(varMessageAttemptExhaustedEventData) + + return err } type NullableMessageAttemptExhaustedEventData struct { diff --git a/go/internal/openapi/model_message_attempt_failed_data.go b/go/internal/openapi/model_message_attempt_failed_data.go index 429bfd791..0432bb41f 100644 --- a/go/internal/openapi/model_message_attempt_failed_data.go +++ b/go/internal/openapi/model_message_attempt_failed_data.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -13,8 +13,13 @@ package openapi import ( "encoding/json" "time" + "bytes" + "fmt" ) +// checks if the MessageAttemptFailedData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MessageAttemptFailedData{} + // MessageAttemptFailedData struct for MessageAttemptFailedData type MessageAttemptFailedData struct { // The attempt's ID @@ -23,6 +28,8 @@ type MessageAttemptFailedData struct { Timestamp time.Time `json:"timestamp"` } +type _MessageAttemptFailedData MessageAttemptFailedData + // NewMessageAttemptFailedData instantiates a new MessageAttemptFailedData 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 @@ -56,7 +63,7 @@ func (o *MessageAttemptFailedData) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *MessageAttemptFailedData) GetIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Id, true @@ -80,7 +87,7 @@ func (o *MessageAttemptFailedData) GetResponseStatusCode() int32 { // GetResponseStatusCodeOk returns a tuple with the ResponseStatusCode field value // and a boolean to check if the value has been set. func (o *MessageAttemptFailedData) GetResponseStatusCodeOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return &o.ResponseStatusCode, true @@ -104,7 +111,7 @@ func (o *MessageAttemptFailedData) GetTimestamp() time.Time { // GetTimestampOk returns a tuple with the Timestamp field value // and a boolean to check if the value has been set. func (o *MessageAttemptFailedData) GetTimestampOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Timestamp, true @@ -116,17 +123,58 @@ func (o *MessageAttemptFailedData) SetTimestamp(v time.Time) { } func (o MessageAttemptFailedData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MessageAttemptFailedData) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["id"] = o.Id + toSerialize["id"] = o.Id + toSerialize["responseStatusCode"] = o.ResponseStatusCode + toSerialize["timestamp"] = o.Timestamp + return toSerialize, nil +} + +func (o *MessageAttemptFailedData) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "responseStatusCode", + "timestamp", } - if true { - toSerialize["responseStatusCode"] = o.ResponseStatusCode + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["timestamp"] = o.Timestamp + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varMessageAttemptFailedData := _MessageAttemptFailedData{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMessageAttemptFailedData) + + if err != nil { + return err + } + + *o = MessageAttemptFailedData(varMessageAttemptFailedData) + + return err } type NullableMessageAttemptFailedData struct { diff --git a/go/internal/openapi/model_message_attempt_failing_event.go b/go/internal/openapi/model_message_attempt_failing_event.go index 6a432ef8a..4020b90e9 100644 --- a/go/internal/openapi/model_message_attempt_failing_event.go +++ b/go/internal/openapi/model_message_attempt_failing_event.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,14 +12,21 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the MessageAttemptFailingEvent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MessageAttemptFailingEvent{} + // MessageAttemptFailingEvent Sent after a message has been failing for a few times. It's sent on the fourth failure. It complements `message.attempt.exhausted` which is sent after the last failure. type MessageAttemptFailingEvent struct { Data MessageAttemptFailingEventData `json:"data"` Type string `json:"type"` } +type _MessageAttemptFailingEvent MessageAttemptFailingEvent + // NewMessageAttemptFailingEvent instantiates a new MessageAttemptFailingEvent 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 @@ -54,7 +61,7 @@ func (o *MessageAttemptFailingEvent) GetData() MessageAttemptFailingEventData { // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. func (o *MessageAttemptFailingEvent) GetDataOk() (*MessageAttemptFailingEventData, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Data, true @@ -78,7 +85,7 @@ func (o *MessageAttemptFailingEvent) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *MessageAttemptFailingEvent) GetTypeOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Type, true @@ -90,14 +97,56 @@ func (o *MessageAttemptFailingEvent) SetType(v string) { } func (o MessageAttemptFailingEvent) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MessageAttemptFailingEvent) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["data"] = o.Data + toSerialize["data"] = o.Data + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *MessageAttemptFailingEvent) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["type"] = o.Type + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varMessageAttemptFailingEvent := _MessageAttemptFailingEvent{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMessageAttemptFailingEvent) + + if err != nil { + return err + } + + *o = MessageAttemptFailingEvent(varMessageAttemptFailingEvent) + + return err } type NullableMessageAttemptFailingEvent struct { diff --git a/go/internal/openapi/model_message_attempt_failing_event_data.go b/go/internal/openapi/model_message_attempt_failing_event_data.go index a9822bd82..3538556b7 100644 --- a/go/internal/openapi/model_message_attempt_failing_event_data.go +++ b/go/internal/openapi/model_message_attempt_failing_event_data.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the MessageAttemptFailingEventData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MessageAttemptFailingEventData{} + // MessageAttemptFailingEventData Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a \"message.attempt.exhausted\" type or after it's failed four times as a \"message.attempt.failing\" event. type MessageAttemptFailingEventData struct { // The app's ID @@ -29,6 +34,8 @@ type MessageAttemptFailingEventData struct { MsgId string `json:"msgId"` } +type _MessageAttemptFailingEventData MessageAttemptFailingEventData + // NewMessageAttemptFailingEventData instantiates a new MessageAttemptFailingEventData 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 @@ -63,7 +70,7 @@ func (o *MessageAttemptFailingEventData) GetAppId() string { // GetAppIdOk returns a tuple with the AppId field value // and a boolean to check if the value has been set. func (o *MessageAttemptFailingEventData) GetAppIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.AppId, true @@ -76,7 +83,7 @@ func (o *MessageAttemptFailingEventData) SetAppId(v string) { // GetAppUid returns the AppUid field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MessageAttemptFailingEventData) GetAppUid() string { - if o == nil || o.AppUid.Get() == nil { + if o == nil || IsNil(o.AppUid.Get()) { var ret string return ret } @@ -87,7 +94,7 @@ func (o *MessageAttemptFailingEventData) GetAppUid() string { // 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 *MessageAttemptFailingEventData) GetAppUidOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.AppUid.Get(), o.AppUid.IsSet() @@ -129,7 +136,7 @@ func (o *MessageAttemptFailingEventData) GetEndpointId() string { // GetEndpointIdOk returns a tuple with the EndpointId field value // and a boolean to check if the value has been set. func (o *MessageAttemptFailingEventData) GetEndpointIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.EndpointId, true @@ -153,7 +160,7 @@ func (o *MessageAttemptFailingEventData) GetLastAttempt() MessageAttemptFailedDa // GetLastAttemptOk returns a tuple with the LastAttempt field value // and a boolean to check if the value has been set. func (o *MessageAttemptFailingEventData) GetLastAttemptOk() (*MessageAttemptFailedData, bool) { - if o == nil { + if o == nil { return nil, false } return &o.LastAttempt, true @@ -166,7 +173,7 @@ func (o *MessageAttemptFailingEventData) SetLastAttempt(v MessageAttemptFailedDa // GetMsgEventId returns the MsgEventId field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MessageAttemptFailingEventData) GetMsgEventId() string { - if o == nil || o.MsgEventId.Get() == nil { + if o == nil || IsNil(o.MsgEventId.Get()) { var ret string return ret } @@ -177,7 +184,7 @@ func (o *MessageAttemptFailingEventData) GetMsgEventId() string { // 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 *MessageAttemptFailingEventData) GetMsgEventIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.MsgEventId.Get(), o.MsgEventId.IsSet() @@ -219,7 +226,7 @@ func (o *MessageAttemptFailingEventData) GetMsgId() string { // GetMsgIdOk returns a tuple with the MsgId field value // and a boolean to check if the value has been set. func (o *MessageAttemptFailingEventData) GetMsgIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.MsgId, true @@ -231,26 +238,66 @@ func (o *MessageAttemptFailingEventData) SetMsgId(v string) { } func (o MessageAttemptFailingEventData) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["appId"] = o.AppId + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o MessageAttemptFailingEventData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["appId"] = o.AppId if o.AppUid.IsSet() { toSerialize["appUid"] = o.AppUid.Get() } - if true { - toSerialize["endpointId"] = o.EndpointId - } - if true { - toSerialize["lastAttempt"] = o.LastAttempt - } + toSerialize["endpointId"] = o.EndpointId + toSerialize["lastAttempt"] = o.LastAttempt if o.MsgEventId.IsSet() { toSerialize["msgEventId"] = o.MsgEventId.Get() } - if true { - toSerialize["msgId"] = o.MsgId + toSerialize["msgId"] = o.MsgId + return toSerialize, nil +} + +func (o *MessageAttemptFailingEventData) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "appId", + "endpointId", + "lastAttempt", + "msgId", } - return json.Marshal(toSerialize) + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMessageAttemptFailingEventData := _MessageAttemptFailingEventData{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMessageAttemptFailingEventData) + + if err != nil { + return err + } + + *o = MessageAttemptFailingEventData(varMessageAttemptFailingEventData) + + return err } type NullableMessageAttemptFailingEventData struct { diff --git a/go/internal/openapi/model_message_attempt_headers_out.go b/go/internal/openapi/model_message_attempt_headers_out.go index 25d87e8d8..115e1d858 100644 --- a/go/internal/openapi/model_message_attempt_headers_out.go +++ b/go/internal/openapi/model_message_attempt_headers_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the MessageAttemptHeadersOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MessageAttemptHeadersOut{} + // MessageAttemptHeadersOut struct for MessageAttemptHeadersOut type MessageAttemptHeadersOut struct { ResponseHeaders [][]string `json:"responseHeaders,omitempty"` @@ -21,6 +26,8 @@ type MessageAttemptHeadersOut struct { SentHeaders map[string]string `json:"sentHeaders"` } +type _MessageAttemptHeadersOut MessageAttemptHeadersOut + // NewMessageAttemptHeadersOut instantiates a new MessageAttemptHeadersOut 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 @@ -42,7 +49,7 @@ func NewMessageAttemptHeadersOutWithDefaults() *MessageAttemptHeadersOut { // GetResponseHeaders returns the ResponseHeaders field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MessageAttemptHeadersOut) GetResponseHeaders() [][]string { - if o == nil { + if o == nil { var ret [][]string return ret } @@ -52,16 +59,16 @@ func (o *MessageAttemptHeadersOut) GetResponseHeaders() [][]string { // GetResponseHeadersOk returns a tuple with the ResponseHeaders 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 *MessageAttemptHeadersOut) GetResponseHeadersOk() (*[][]string, bool) { - if o == nil || o.ResponseHeaders == nil { +func (o *MessageAttemptHeadersOut) GetResponseHeadersOk() ([][]string, bool) { + if o == nil || IsNil(o.ResponseHeaders) { return nil, false } - return &o.ResponseHeaders, true + return o.ResponseHeaders, true } // HasResponseHeaders returns a boolean if a field has been set. func (o *MessageAttemptHeadersOut) HasResponseHeaders() bool { - if o != nil && o.ResponseHeaders != nil { + if o != nil && IsNil(o.ResponseHeaders) { return true } @@ -85,11 +92,11 @@ func (o *MessageAttemptHeadersOut) GetSensitive() []string { // GetSensitiveOk returns a tuple with the Sensitive field value // and a boolean to check if the value has been set. -func (o *MessageAttemptHeadersOut) GetSensitiveOk() (*[]string, bool) { - if o == nil { +func (o *MessageAttemptHeadersOut) GetSensitiveOk() ([]string, bool) { + if o == nil { return nil, false } - return &o.Sensitive, true + return o.Sensitive, true } // SetSensitive sets field value @@ -110,7 +117,7 @@ func (o *MessageAttemptHeadersOut) GetSentHeaders() map[string]string { // GetSentHeadersOk returns a tuple with the SentHeaders field value // and a boolean to check if the value has been set. func (o *MessageAttemptHeadersOut) GetSentHeadersOk() (*map[string]string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.SentHeaders, true @@ -122,17 +129,59 @@ func (o *MessageAttemptHeadersOut) SetSentHeaders(v map[string]string) { } func (o MessageAttemptHeadersOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MessageAttemptHeadersOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if o.ResponseHeaders != nil { toSerialize["responseHeaders"] = o.ResponseHeaders } - if true { - toSerialize["sensitive"] = o.Sensitive + toSerialize["sensitive"] = o.Sensitive + toSerialize["sentHeaders"] = o.SentHeaders + return toSerialize, nil +} + +func (o *MessageAttemptHeadersOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "sensitive", + "sentHeaders", } - if true { - toSerialize["sentHeaders"] = o.SentHeaders + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - return json.Marshal(toSerialize) + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMessageAttemptHeadersOut := _MessageAttemptHeadersOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMessageAttemptHeadersOut) + + if err != nil { + return err + } + + *o = MessageAttemptHeadersOut(varMessageAttemptHeadersOut) + + return err } type NullableMessageAttemptHeadersOut struct { diff --git a/go/internal/openapi/model_message_attempt_out.go b/go/internal/openapi/model_message_attempt_out.go index 06067eebc..8e890e819 100644 --- a/go/internal/openapi/model_message_attempt_out.go +++ b/go/internal/openapi/model_message_attempt_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -13,8 +13,13 @@ package openapi import ( "encoding/json" "time" + "bytes" + "fmt" ) +// checks if the MessageAttemptOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MessageAttemptOut{} + // MessageAttemptOut struct for MessageAttemptOut type MessageAttemptOut struct { // The ep's ID @@ -32,6 +37,8 @@ type MessageAttemptOut struct { Url string `json:"url"` } +type _MessageAttemptOut MessageAttemptOut + // NewMessageAttemptOut instantiates a new MessageAttemptOut 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 @@ -71,7 +78,7 @@ func (o *MessageAttemptOut) GetEndpointId() string { // GetEndpointIdOk returns a tuple with the EndpointId field value // and a boolean to check if the value has been set. func (o *MessageAttemptOut) GetEndpointIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.EndpointId, true @@ -95,7 +102,7 @@ func (o *MessageAttemptOut) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *MessageAttemptOut) GetIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Id, true @@ -108,7 +115,7 @@ func (o *MessageAttemptOut) SetId(v string) { // GetMsg returns the Msg field value if set, zero value otherwise. func (o *MessageAttemptOut) GetMsg() MessageOut { - if o == nil || o.Msg == nil { + if o == nil || IsNil(o.Msg) { var ret MessageOut return ret } @@ -118,7 +125,7 @@ func (o *MessageAttemptOut) GetMsg() MessageOut { // GetMsgOk returns a tuple with the Msg field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MessageAttemptOut) GetMsgOk() (*MessageOut, bool) { - if o == nil || o.Msg == nil { + if o == nil || IsNil(o.Msg) { return nil, false } return o.Msg, true @@ -126,7 +133,7 @@ func (o *MessageAttemptOut) GetMsgOk() (*MessageOut, bool) { // HasMsg returns a boolean if a field has been set. func (o *MessageAttemptOut) HasMsg() bool { - if o != nil && o.Msg != nil { + if o != nil && !IsNil(o.Msg) { return true } @@ -151,7 +158,7 @@ func (o *MessageAttemptOut) GetMsgId() string { // GetMsgIdOk returns a tuple with the MsgId field value // and a boolean to check if the value has been set. func (o *MessageAttemptOut) GetMsgIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.MsgId, true @@ -175,7 +182,7 @@ func (o *MessageAttemptOut) GetResponse() string { // GetResponseOk returns a tuple with the Response field value // and a boolean to check if the value has been set. func (o *MessageAttemptOut) GetResponseOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Response, true @@ -199,7 +206,7 @@ func (o *MessageAttemptOut) GetResponseStatusCode() int32 { // GetResponseStatusCodeOk returns a tuple with the ResponseStatusCode field value // and a boolean to check if the value has been set. func (o *MessageAttemptOut) GetResponseStatusCodeOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return &o.ResponseStatusCode, true @@ -223,7 +230,7 @@ func (o *MessageAttemptOut) GetStatus() MessageStatus { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. func (o *MessageAttemptOut) GetStatusOk() (*MessageStatus, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Status, true @@ -247,7 +254,7 @@ func (o *MessageAttemptOut) GetTimestamp() time.Time { // GetTimestampOk returns a tuple with the Timestamp field value // and a boolean to check if the value has been set. func (o *MessageAttemptOut) GetTimestampOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Timestamp, true @@ -271,7 +278,7 @@ func (o *MessageAttemptOut) GetTriggerType() MessageAttemptTriggerType { // GetTriggerTypeOk returns a tuple with the TriggerType field value // and a boolean to check if the value has been set. func (o *MessageAttemptOut) GetTriggerTypeOk() (*MessageAttemptTriggerType, bool) { - if o == nil { + if o == nil { return nil, false } return &o.TriggerType, true @@ -295,7 +302,7 @@ func (o *MessageAttemptOut) GetUrl() string { // GetUrlOk returns a tuple with the Url field value // and a boolean to check if the value has been set. func (o *MessageAttemptOut) GetUrlOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Url, true @@ -307,38 +314,73 @@ func (o *MessageAttemptOut) SetUrl(v string) { } func (o MessageAttemptOut) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["endpointId"] = o.EndpointId + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if true { - toSerialize["id"] = o.Id - } - if o.Msg != nil { + return json.Marshal(toSerialize) +} + +func (o MessageAttemptOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["endpointId"] = o.EndpointId + toSerialize["id"] = o.Id + if !IsNil(o.Msg) { toSerialize["msg"] = o.Msg } - if true { - toSerialize["msgId"] = o.MsgId - } - if true { - toSerialize["response"] = o.Response + toSerialize["msgId"] = o.MsgId + toSerialize["response"] = o.Response + toSerialize["responseStatusCode"] = o.ResponseStatusCode + toSerialize["status"] = o.Status + toSerialize["timestamp"] = o.Timestamp + toSerialize["triggerType"] = o.TriggerType + toSerialize["url"] = o.Url + return toSerialize, nil +} + +func (o *MessageAttemptOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "endpointId", + "id", + "msgId", + "response", + "responseStatusCode", + "status", + "timestamp", + "triggerType", + "url", } - if true { - toSerialize["responseStatusCode"] = o.ResponseStatusCode - } - if true { - toSerialize["status"] = o.Status - } - if true { - toSerialize["timestamp"] = o.Timestamp + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["triggerType"] = o.TriggerType + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - if true { - toSerialize["url"] = o.Url + + varMessageAttemptOut := _MessageAttemptOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMessageAttemptOut) + + if err != nil { + return err } - return json.Marshal(toSerialize) + + *o = MessageAttemptOut(varMessageAttemptOut) + + return err } type NullableMessageAttemptOut struct { diff --git a/go/internal/openapi/model_message_attempt_recovered_event.go b/go/internal/openapi/model_message_attempt_recovered_event.go index ff48a5877..f574112f5 100644 --- a/go/internal/openapi/model_message_attempt_recovered_event.go +++ b/go/internal/openapi/model_message_attempt_recovered_event.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,14 +12,21 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the MessageAttemptRecoveredEvent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MessageAttemptRecoveredEvent{} + // MessageAttemptRecoveredEvent Sent on a successful dispatch after an earlier failure op webhook has already been sent. type MessageAttemptRecoveredEvent struct { Data MessageAttemptRecoveredEventData `json:"data"` Type string `json:"type"` } +type _MessageAttemptRecoveredEvent MessageAttemptRecoveredEvent + // NewMessageAttemptRecoveredEvent instantiates a new MessageAttemptRecoveredEvent 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 @@ -54,7 +61,7 @@ func (o *MessageAttemptRecoveredEvent) GetData() MessageAttemptRecoveredEventDat // GetDataOk returns a tuple with the Data field value // and a boolean to check if the value has been set. func (o *MessageAttemptRecoveredEvent) GetDataOk() (*MessageAttemptRecoveredEventData, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Data, true @@ -78,7 +85,7 @@ func (o *MessageAttemptRecoveredEvent) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *MessageAttemptRecoveredEvent) GetTypeOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Type, true @@ -90,14 +97,56 @@ func (o *MessageAttemptRecoveredEvent) SetType(v string) { } func (o MessageAttemptRecoveredEvent) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MessageAttemptRecoveredEvent) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["data"] = o.Data + toSerialize["data"] = o.Data + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *MessageAttemptRecoveredEvent) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["type"] = o.Type + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varMessageAttemptRecoveredEvent := _MessageAttemptRecoveredEvent{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMessageAttemptRecoveredEvent) + + if err != nil { + return err + } + + *o = MessageAttemptRecoveredEvent(varMessageAttemptRecoveredEvent) + + return err } type NullableMessageAttemptRecoveredEvent struct { diff --git a/go/internal/openapi/model_message_attempt_recovered_event_data.go b/go/internal/openapi/model_message_attempt_recovered_event_data.go index a11a28870..c539a16e0 100644 --- a/go/internal/openapi/model_message_attempt_recovered_event_data.go +++ b/go/internal/openapi/model_message_attempt_recovered_event_data.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the MessageAttemptRecoveredEventData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MessageAttemptRecoveredEventData{} + // MessageAttemptRecoveredEventData Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a \"message.attempt.exhausted\" type or after it's failed four times as a \"message.attempt.failing\" event. type MessageAttemptRecoveredEventData struct { // The app's ID @@ -29,6 +34,8 @@ type MessageAttemptRecoveredEventData struct { MsgId string `json:"msgId"` } +type _MessageAttemptRecoveredEventData MessageAttemptRecoveredEventData + // NewMessageAttemptRecoveredEventData instantiates a new MessageAttemptRecoveredEventData 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 @@ -63,7 +70,7 @@ func (o *MessageAttemptRecoveredEventData) GetAppId() string { // GetAppIdOk returns a tuple with the AppId field value // and a boolean to check if the value has been set. func (o *MessageAttemptRecoveredEventData) GetAppIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.AppId, true @@ -76,7 +83,7 @@ func (o *MessageAttemptRecoveredEventData) SetAppId(v string) { // GetAppUid returns the AppUid field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MessageAttemptRecoveredEventData) GetAppUid() string { - if o == nil || o.AppUid.Get() == nil { + if o == nil || IsNil(o.AppUid.Get()) { var ret string return ret } @@ -87,7 +94,7 @@ func (o *MessageAttemptRecoveredEventData) GetAppUid() string { // 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 *MessageAttemptRecoveredEventData) GetAppUidOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.AppUid.Get(), o.AppUid.IsSet() @@ -129,7 +136,7 @@ func (o *MessageAttemptRecoveredEventData) GetEndpointId() string { // GetEndpointIdOk returns a tuple with the EndpointId field value // and a boolean to check if the value has been set. func (o *MessageAttemptRecoveredEventData) GetEndpointIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.EndpointId, true @@ -153,7 +160,7 @@ func (o *MessageAttemptRecoveredEventData) GetLastAttempt() MessageAttemptFailed // GetLastAttemptOk returns a tuple with the LastAttempt field value // and a boolean to check if the value has been set. func (o *MessageAttemptRecoveredEventData) GetLastAttemptOk() (*MessageAttemptFailedData, bool) { - if o == nil { + if o == nil { return nil, false } return &o.LastAttempt, true @@ -166,7 +173,7 @@ func (o *MessageAttemptRecoveredEventData) SetLastAttempt(v MessageAttemptFailed // GetMsgEventId returns the MsgEventId field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MessageAttemptRecoveredEventData) GetMsgEventId() string { - if o == nil || o.MsgEventId.Get() == nil { + if o == nil || IsNil(o.MsgEventId.Get()) { var ret string return ret } @@ -177,7 +184,7 @@ func (o *MessageAttemptRecoveredEventData) GetMsgEventId() string { // 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 *MessageAttemptRecoveredEventData) GetMsgEventIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.MsgEventId.Get(), o.MsgEventId.IsSet() @@ -219,7 +226,7 @@ func (o *MessageAttemptRecoveredEventData) GetMsgId() string { // GetMsgIdOk returns a tuple with the MsgId field value // and a boolean to check if the value has been set. func (o *MessageAttemptRecoveredEventData) GetMsgIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.MsgId, true @@ -231,26 +238,66 @@ func (o *MessageAttemptRecoveredEventData) SetMsgId(v string) { } func (o MessageAttemptRecoveredEventData) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["appId"] = o.AppId + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o MessageAttemptRecoveredEventData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["appId"] = o.AppId if o.AppUid.IsSet() { toSerialize["appUid"] = o.AppUid.Get() } - if true { - toSerialize["endpointId"] = o.EndpointId - } - if true { - toSerialize["lastAttempt"] = o.LastAttempt - } + toSerialize["endpointId"] = o.EndpointId + toSerialize["lastAttempt"] = o.LastAttempt if o.MsgEventId.IsSet() { toSerialize["msgEventId"] = o.MsgEventId.Get() } - if true { - toSerialize["msgId"] = o.MsgId + toSerialize["msgId"] = o.MsgId + return toSerialize, nil +} + +func (o *MessageAttemptRecoveredEventData) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "appId", + "endpointId", + "lastAttempt", + "msgId", } - return json.Marshal(toSerialize) + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMessageAttemptRecoveredEventData := _MessageAttemptRecoveredEventData{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMessageAttemptRecoveredEventData) + + if err != nil { + return err + } + + *o = MessageAttemptRecoveredEventData(varMessageAttemptRecoveredEventData) + + return err } type NullableMessageAttemptRecoveredEventData struct { diff --git a/go/internal/openapi/model_message_attempt_trigger_type.go b/go/internal/openapi/model_message_attempt_trigger_type.go index fe65af0de..fdd4c3476 100644 --- a/go/internal/openapi/model_message_attempt_trigger_type.go +++ b/go/internal/openapi/model_message_attempt_trigger_type.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -24,7 +24,8 @@ const ( MESSAGEATTEMPTTRIGGERTYPE_Manual MessageAttemptTriggerType = 1 ) -var allowedMessageAttemptTriggerTypeEnumValues = []MessageAttemptTriggerType{ +// All allowed values of MessageAttemptTriggerType enum +var AllowedMessageAttemptTriggerTypeEnumValues = []MessageAttemptTriggerType{ 0, 1, } @@ -36,7 +37,7 @@ func (v *MessageAttemptTriggerType) UnmarshalJSON(src []byte) error { return err } enumTypeValue := MessageAttemptTriggerType(value) - for _, existing := range allowedMessageAttemptTriggerTypeEnumValues { + for _, existing := range AllowedMessageAttemptTriggerTypeEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -53,13 +54,13 @@ func NewMessageAttemptTriggerTypeFromValue(v int32) (*MessageAttemptTriggerType, if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for MessageAttemptTriggerType: valid values are %v", v, allowedMessageAttemptTriggerTypeEnumValues) + return nil, fmt.Errorf("invalid value '%v' for MessageAttemptTriggerType: valid values are %v", v, AllowedMessageAttemptTriggerTypeEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v MessageAttemptTriggerType) IsValid() bool { - for _, existing := range allowedMessageAttemptTriggerTypeEnumValues { + for _, existing := range AllowedMessageAttemptTriggerTypeEnumValues { if existing == v { return true } diff --git a/go/internal/openapi/model_message_broadcast_in.go b/go/internal/openapi/model_message_broadcast_in.go index 98d29c7c7..0b027f1bb 100644 --- a/go/internal/openapi/model_message_broadcast_in.go +++ b/go/internal/openapi/model_message_broadcast_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the MessageBroadcastIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MessageBroadcastIn{} + // MessageBroadcastIn struct for MessageBroadcastIn type MessageBroadcastIn struct { // List of free-form identifiers that endpoints can filter by @@ -26,6 +31,8 @@ type MessageBroadcastIn struct { PayloadRetentionPeriod *int64 `json:"payloadRetentionPeriod,omitempty"` } +type _MessageBroadcastIn MessageBroadcastIn + // NewMessageBroadcastIn instantiates a new MessageBroadcastIn 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 @@ -51,7 +58,7 @@ func NewMessageBroadcastInWithDefaults() *MessageBroadcastIn { // GetChannels returns the Channels field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MessageBroadcastIn) GetChannels() []string { - if o == nil { + if o == nil { var ret []string return ret } @@ -61,16 +68,16 @@ func (o *MessageBroadcastIn) GetChannels() []string { // GetChannelsOk returns a tuple with the Channels 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 *MessageBroadcastIn) GetChannelsOk() (*[]string, bool) { - if o == nil || o.Channels == nil { +func (o *MessageBroadcastIn) GetChannelsOk() ([]string, bool) { + if o == nil || IsNil(o.Channels) { return nil, false } - return &o.Channels, true + return o.Channels, true } // HasChannels returns a boolean if a field has been set. func (o *MessageBroadcastIn) HasChannels() bool { - if o != nil && o.Channels != nil { + if o != nil && IsNil(o.Channels) { return true } @@ -84,7 +91,7 @@ func (o *MessageBroadcastIn) SetChannels(v []string) { // GetEventId returns the EventId field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MessageBroadcastIn) GetEventId() string { - if o == nil || o.EventId.Get() == nil { + if o == nil || IsNil(o.EventId.Get()) { var ret string return ret } @@ -95,7 +102,7 @@ func (o *MessageBroadcastIn) GetEventId() string { // 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 *MessageBroadcastIn) GetEventIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.EventId.Get(), o.EventId.IsSet() @@ -137,7 +144,7 @@ func (o *MessageBroadcastIn) GetEventType() string { // GetEventTypeOk returns a tuple with the EventType field value // and a boolean to check if the value has been set. func (o *MessageBroadcastIn) GetEventTypeOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.EventType, true @@ -160,11 +167,11 @@ func (o *MessageBroadcastIn) GetPayload() map[string]interface{} { // GetPayloadOk returns a tuple with the Payload field value // and a boolean to check if the value has been set. -func (o *MessageBroadcastIn) GetPayloadOk() (*map[string]interface{}, bool) { - if o == nil { - return nil, false +func (o *MessageBroadcastIn) GetPayloadOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false } - return &o.Payload, true + return o.Payload, true } // SetPayload sets field value @@ -174,7 +181,7 @@ func (o *MessageBroadcastIn) SetPayload(v map[string]interface{}) { // GetPayloadRetentionPeriod returns the PayloadRetentionPeriod field value if set, zero value otherwise. func (o *MessageBroadcastIn) GetPayloadRetentionPeriod() int64 { - if o == nil || o.PayloadRetentionPeriod == nil { + if o == nil || IsNil(o.PayloadRetentionPeriod) { var ret int64 return ret } @@ -184,7 +191,7 @@ func (o *MessageBroadcastIn) GetPayloadRetentionPeriod() int64 { // GetPayloadRetentionPeriodOk returns a tuple with the PayloadRetentionPeriod field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MessageBroadcastIn) GetPayloadRetentionPeriodOk() (*int64, bool) { - if o == nil || o.PayloadRetentionPeriod == nil { + if o == nil || IsNil(o.PayloadRetentionPeriod) { return nil, false } return o.PayloadRetentionPeriod, true @@ -192,7 +199,7 @@ func (o *MessageBroadcastIn) GetPayloadRetentionPeriodOk() (*int64, bool) { // HasPayloadRetentionPeriod returns a boolean if a field has been set. func (o *MessageBroadcastIn) HasPayloadRetentionPeriod() bool { - if o != nil && o.PayloadRetentionPeriod != nil { + if o != nil && !IsNil(o.PayloadRetentionPeriod) { return true } @@ -205,6 +212,14 @@ func (o *MessageBroadcastIn) SetPayloadRetentionPeriod(v int64) { } func (o MessageBroadcastIn) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MessageBroadcastIn) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if o.Channels != nil { toSerialize["channels"] = o.Channels @@ -212,16 +227,50 @@ func (o MessageBroadcastIn) MarshalJSON() ([]byte, error) { if o.EventId.IsSet() { toSerialize["eventId"] = o.EventId.Get() } - if true { - toSerialize["eventType"] = o.EventType + toSerialize["eventType"] = o.EventType + toSerialize["payload"] = o.Payload + if !IsNil(o.PayloadRetentionPeriod) { + toSerialize["payloadRetentionPeriod"] = o.PayloadRetentionPeriod } - if true { - toSerialize["payload"] = o.Payload + return toSerialize, nil +} + +func (o *MessageBroadcastIn) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "eventType", + "payload", } - if o.PayloadRetentionPeriod != nil { - toSerialize["payloadRetentionPeriod"] = o.PayloadRetentionPeriod + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - return json.Marshal(toSerialize) + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMessageBroadcastIn := _MessageBroadcastIn{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMessageBroadcastIn) + + if err != nil { + return err + } + + *o = MessageBroadcastIn(varMessageBroadcastIn) + + return err } type NullableMessageBroadcastIn struct { diff --git a/go/internal/openapi/model_message_broadcast_out.go b/go/internal/openapi/model_message_broadcast_out.go index 938b28b45..7b0c5ecfd 100644 --- a/go/internal/openapi/model_message_broadcast_out.go +++ b/go/internal/openapi/model_message_broadcast_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the MessageBroadcastOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MessageBroadcastOut{} + // MessageBroadcastOut struct for MessageBroadcastOut type MessageBroadcastOut struct { Id string `json:"id"` @@ -21,6 +26,8 @@ type MessageBroadcastOut struct { Task BackgroundTaskType `json:"task"` } +type _MessageBroadcastOut MessageBroadcastOut + // NewMessageBroadcastOut instantiates a new MessageBroadcastOut 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 @@ -54,7 +61,7 @@ func (o *MessageBroadcastOut) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *MessageBroadcastOut) GetIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Id, true @@ -78,7 +85,7 @@ func (o *MessageBroadcastOut) GetStatus() BackgroundTaskStatus { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. func (o *MessageBroadcastOut) GetStatusOk() (*BackgroundTaskStatus, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Status, true @@ -102,7 +109,7 @@ func (o *MessageBroadcastOut) GetTask() BackgroundTaskType { // GetTaskOk returns a tuple with the Task field value // and a boolean to check if the value has been set. func (o *MessageBroadcastOut) GetTaskOk() (*BackgroundTaskType, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Task, true @@ -114,17 +121,58 @@ func (o *MessageBroadcastOut) SetTask(v BackgroundTaskType) { } func (o MessageBroadcastOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MessageBroadcastOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["id"] = o.Id + toSerialize["id"] = o.Id + toSerialize["status"] = o.Status + toSerialize["task"] = o.Task + return toSerialize, nil +} + +func (o *MessageBroadcastOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "status", + "task", } - if true { - toSerialize["status"] = o.Status + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["task"] = o.Task + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varMessageBroadcastOut := _MessageBroadcastOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMessageBroadcastOut) + + if err != nil { + return err + } + + *o = MessageBroadcastOut(varMessageBroadcastOut) + + return err } type NullableMessageBroadcastOut struct { diff --git a/go/internal/openapi/model_message_endpoint_out.go b/go/internal/openapi/model_message_endpoint_out.go index 7c9f74a17..a89d046d4 100644 --- a/go/internal/openapi/model_message_endpoint_out.go +++ b/go/internal/openapi/model_message_endpoint_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -13,8 +13,13 @@ package openapi import ( "encoding/json" "time" + "bytes" + "fmt" ) +// checks if the MessageEndpointOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MessageEndpointOut{} + // MessageEndpointOut struct for MessageEndpointOut type MessageEndpointOut struct { // List of message channels this endpoint listens to (omit for all) @@ -33,9 +38,12 @@ type MessageEndpointOut struct { Uid NullableString `json:"uid,omitempty"` UpdatedAt time.Time `json:"updatedAt"` Url string `json:"url"` + // Deprecated Version int32 `json:"version"` } +type _MessageEndpointOut MessageEndpointOut + // NewMessageEndpointOut instantiates a new MessageEndpointOut 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 @@ -66,7 +74,7 @@ func NewMessageEndpointOutWithDefaults() *MessageEndpointOut { // GetChannels returns the Channels field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MessageEndpointOut) GetChannels() []string { - if o == nil { + if o == nil { var ret []string return ret } @@ -76,16 +84,16 @@ func (o *MessageEndpointOut) GetChannels() []string { // GetChannelsOk returns a tuple with the Channels 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 *MessageEndpointOut) GetChannelsOk() (*[]string, bool) { - if o == nil || o.Channels == nil { +func (o *MessageEndpointOut) GetChannelsOk() ([]string, bool) { + if o == nil || IsNil(o.Channels) { return nil, false } - return &o.Channels, true + return o.Channels, true } // HasChannels returns a boolean if a field has been set. func (o *MessageEndpointOut) HasChannels() bool { - if o != nil && o.Channels != nil { + if o != nil && IsNil(o.Channels) { return true } @@ -110,7 +118,7 @@ func (o *MessageEndpointOut) GetCreatedAt() time.Time { // GetCreatedAtOk returns a tuple with the CreatedAt field value // and a boolean to check if the value has been set. func (o *MessageEndpointOut) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.CreatedAt, true @@ -134,7 +142,7 @@ func (o *MessageEndpointOut) GetDescription() string { // GetDescriptionOk returns a tuple with the Description field value // and a boolean to check if the value has been set. func (o *MessageEndpointOut) GetDescriptionOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Description, true @@ -147,7 +155,7 @@ func (o *MessageEndpointOut) SetDescription(v string) { // GetDisabled returns the Disabled field value if set, zero value otherwise. func (o *MessageEndpointOut) GetDisabled() bool { - if o == nil || o.Disabled == nil { + if o == nil || IsNil(o.Disabled) { var ret bool return ret } @@ -157,7 +165,7 @@ func (o *MessageEndpointOut) GetDisabled() bool { // GetDisabledOk returns a tuple with the Disabled field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MessageEndpointOut) GetDisabledOk() (*bool, bool) { - if o == nil || o.Disabled == nil { + if o == nil || IsNil(o.Disabled) { return nil, false } return o.Disabled, true @@ -165,7 +173,7 @@ func (o *MessageEndpointOut) GetDisabledOk() (*bool, bool) { // HasDisabled returns a boolean if a field has been set. func (o *MessageEndpointOut) HasDisabled() bool { - if o != nil && o.Disabled != nil { + if o != nil && !IsNil(o.Disabled) { return true } @@ -179,7 +187,7 @@ func (o *MessageEndpointOut) SetDisabled(v bool) { // GetFilterTypes returns the FilterTypes field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MessageEndpointOut) GetFilterTypes() []string { - if o == nil { + if o == nil { var ret []string return ret } @@ -189,16 +197,16 @@ func (o *MessageEndpointOut) GetFilterTypes() []string { // GetFilterTypesOk returns a tuple with the FilterTypes field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *MessageEndpointOut) GetFilterTypesOk() (*[]string, bool) { - if o == nil || o.FilterTypes == nil { +func (o *MessageEndpointOut) GetFilterTypesOk() ([]string, bool) { + if o == nil || IsNil(o.FilterTypes) { return nil, false } - return &o.FilterTypes, true + return o.FilterTypes, true } // HasFilterTypes returns a boolean if a field has been set. func (o *MessageEndpointOut) HasFilterTypes() bool { - if o != nil && o.FilterTypes != nil { + if o != nil && IsNil(o.FilterTypes) { return true } @@ -223,7 +231,7 @@ func (o *MessageEndpointOut) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *MessageEndpointOut) GetIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Id, true @@ -236,7 +244,7 @@ func (o *MessageEndpointOut) SetId(v string) { // GetNextAttempt returns the NextAttempt field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MessageEndpointOut) GetNextAttempt() time.Time { - if o == nil || o.NextAttempt.Get() == nil { + if o == nil || IsNil(o.NextAttempt.Get()) { var ret time.Time return ret } @@ -247,7 +255,7 @@ func (o *MessageEndpointOut) GetNextAttempt() time.Time { // 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 *MessageEndpointOut) GetNextAttemptOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return o.NextAttempt.Get(), o.NextAttempt.IsSet() @@ -278,7 +286,7 @@ func (o *MessageEndpointOut) UnsetNextAttempt() { // GetRateLimit returns the RateLimit field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MessageEndpointOut) GetRateLimit() int32 { - if o == nil || o.RateLimit.Get() == nil { + if o == nil || IsNil(o.RateLimit.Get()) { var ret int32 return ret } @@ -289,7 +297,7 @@ func (o *MessageEndpointOut) GetRateLimit() int32 { // 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 *MessageEndpointOut) GetRateLimitOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return o.RateLimit.Get(), o.RateLimit.IsSet() @@ -331,7 +339,7 @@ func (o *MessageEndpointOut) GetStatus() MessageStatus { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. func (o *MessageEndpointOut) GetStatusOk() (*MessageStatus, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Status, true @@ -344,7 +352,7 @@ func (o *MessageEndpointOut) SetStatus(v MessageStatus) { // GetUid returns the Uid field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MessageEndpointOut) GetUid() string { - if o == nil || o.Uid.Get() == nil { + if o == nil || IsNil(o.Uid.Get()) { var ret string return ret } @@ -355,7 +363,7 @@ func (o *MessageEndpointOut) GetUid() string { // 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 *MessageEndpointOut) GetUidOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Uid.Get(), o.Uid.IsSet() @@ -397,7 +405,7 @@ func (o *MessageEndpointOut) GetUpdatedAt() time.Time { // GetUpdatedAtOk returns a tuple with the UpdatedAt field value // and a boolean to check if the value has been set. func (o *MessageEndpointOut) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.UpdatedAt, true @@ -421,7 +429,7 @@ func (o *MessageEndpointOut) GetUrl() string { // GetUrlOk returns a tuple with the Url field value // and a boolean to check if the value has been set. func (o *MessageEndpointOut) GetUrlOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Url, true @@ -433,6 +441,7 @@ func (o *MessageEndpointOut) SetUrl(v string) { } // GetVersion returns the Version field value +// Deprecated func (o *MessageEndpointOut) GetVersion() int32 { if o == nil { var ret int32 @@ -444,60 +453,99 @@ func (o *MessageEndpointOut) GetVersion() int32 { // GetVersionOk returns a tuple with the Version field value // and a boolean to check if the value has been set. +// Deprecated func (o *MessageEndpointOut) GetVersionOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Version, true } // SetVersion sets field value +// Deprecated func (o *MessageEndpointOut) SetVersion(v int32) { o.Version = v } func (o MessageEndpointOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MessageEndpointOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if o.Channels != nil { toSerialize["channels"] = o.Channels } - if true { - toSerialize["createdAt"] = o.CreatedAt - } - if true { - toSerialize["description"] = o.Description - } - if o.Disabled != nil { + toSerialize["createdAt"] = o.CreatedAt + toSerialize["description"] = o.Description + if !IsNil(o.Disabled) { toSerialize["disabled"] = o.Disabled } if o.FilterTypes != nil { toSerialize["filterTypes"] = o.FilterTypes } - if true { - toSerialize["id"] = o.Id - } + toSerialize["id"] = o.Id if o.NextAttempt.IsSet() { toSerialize["nextAttempt"] = o.NextAttempt.Get() } if o.RateLimit.IsSet() { toSerialize["rateLimit"] = o.RateLimit.Get() } - if true { - toSerialize["status"] = o.Status - } + toSerialize["status"] = o.Status if o.Uid.IsSet() { toSerialize["uid"] = o.Uid.Get() } - if true { - toSerialize["updatedAt"] = o.UpdatedAt + toSerialize["updatedAt"] = o.UpdatedAt + toSerialize["url"] = o.Url + toSerialize["version"] = o.Version + return toSerialize, nil +} + +func (o *MessageEndpointOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "createdAt", + "description", + "id", + "status", + "updatedAt", + "url", + "version", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["url"] = o.Url + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - if true { - toSerialize["version"] = o.Version + + varMessageEndpointOut := _MessageEndpointOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMessageEndpointOut) + + if err != nil { + return err } - return json.Marshal(toSerialize) + + *o = MessageEndpointOut(varMessageEndpointOut) + + return err } type NullableMessageEndpointOut struct { diff --git a/go/internal/openapi/model_message_in.go b/go/internal/openapi/model_message_in.go index 899958d9d..62f416c9e 100644 --- a/go/internal/openapi/model_message_in.go +++ b/go/internal/openapi/model_message_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the MessageIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MessageIn{} + // MessageIn struct for MessageIn type MessageIn struct { Application *ApplicationIn `json:"application,omitempty"` @@ -27,8 +32,12 @@ type MessageIn struct { PayloadRetentionPeriod *int64 `json:"payloadRetentionPeriod,omitempty"` // List of free-form tags that can be filtered by when listing messages Tags []string `json:"tags,omitempty"` + // Extra parameters to pass to Transformations (for future use) + TransformationsParams map[string]interface{} `json:"transformationsParams,omitempty"` } +type _MessageIn MessageIn + // NewMessageIn instantiates a new MessageIn 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 @@ -54,7 +63,7 @@ func NewMessageInWithDefaults() *MessageIn { // GetApplication returns the Application field value if set, zero value otherwise. func (o *MessageIn) GetApplication() ApplicationIn { - if o == nil || o.Application == nil { + if o == nil || IsNil(o.Application) { var ret ApplicationIn return ret } @@ -64,7 +73,7 @@ func (o *MessageIn) GetApplication() ApplicationIn { // GetApplicationOk returns a tuple with the Application field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MessageIn) GetApplicationOk() (*ApplicationIn, bool) { - if o == nil || o.Application == nil { + if o == nil || IsNil(o.Application) { return nil, false } return o.Application, true @@ -72,7 +81,7 @@ func (o *MessageIn) GetApplicationOk() (*ApplicationIn, bool) { // HasApplication returns a boolean if a field has been set. func (o *MessageIn) HasApplication() bool { - if o != nil && o.Application != nil { + if o != nil && !IsNil(o.Application) { return true } @@ -86,7 +95,7 @@ func (o *MessageIn) SetApplication(v ApplicationIn) { // GetChannels returns the Channels field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MessageIn) GetChannels() []string { - if o == nil { + if o == nil { var ret []string return ret } @@ -96,16 +105,16 @@ func (o *MessageIn) GetChannels() []string { // GetChannelsOk returns a tuple with the Channels 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 *MessageIn) GetChannelsOk() (*[]string, bool) { - if o == nil || o.Channels == nil { +func (o *MessageIn) GetChannelsOk() ([]string, bool) { + if o == nil || IsNil(o.Channels) { return nil, false } - return &o.Channels, true + return o.Channels, true } // HasChannels returns a boolean if a field has been set. func (o *MessageIn) HasChannels() bool { - if o != nil && o.Channels != nil { + if o != nil && IsNil(o.Channels) { return true } @@ -119,7 +128,7 @@ func (o *MessageIn) SetChannels(v []string) { // GetEventId returns the EventId field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MessageIn) GetEventId() string { - if o == nil || o.EventId.Get() == nil { + if o == nil || IsNil(o.EventId.Get()) { var ret string return ret } @@ -130,7 +139,7 @@ func (o *MessageIn) GetEventId() string { // 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 *MessageIn) GetEventIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.EventId.Get(), o.EventId.IsSet() @@ -172,7 +181,7 @@ func (o *MessageIn) GetEventType() string { // GetEventTypeOk returns a tuple with the EventType field value // and a boolean to check if the value has been set. func (o *MessageIn) GetEventTypeOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.EventType, true @@ -195,11 +204,11 @@ func (o *MessageIn) GetPayload() map[string]interface{} { // GetPayloadOk returns a tuple with the Payload field value // and a boolean to check if the value has been set. -func (o *MessageIn) GetPayloadOk() (*map[string]interface{}, bool) { - if o == nil { - return nil, false +func (o *MessageIn) GetPayloadOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false } - return &o.Payload, true + return o.Payload, true } // SetPayload sets field value @@ -209,7 +218,7 @@ func (o *MessageIn) SetPayload(v map[string]interface{}) { // GetPayloadRetentionPeriod returns the PayloadRetentionPeriod field value if set, zero value otherwise. func (o *MessageIn) GetPayloadRetentionPeriod() int64 { - if o == nil || o.PayloadRetentionPeriod == nil { + if o == nil || IsNil(o.PayloadRetentionPeriod) { var ret int64 return ret } @@ -219,7 +228,7 @@ func (o *MessageIn) GetPayloadRetentionPeriod() int64 { // GetPayloadRetentionPeriodOk returns a tuple with the PayloadRetentionPeriod field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MessageIn) GetPayloadRetentionPeriodOk() (*int64, bool) { - if o == nil || o.PayloadRetentionPeriod == nil { + if o == nil || IsNil(o.PayloadRetentionPeriod) { return nil, false } return o.PayloadRetentionPeriod, true @@ -227,7 +236,7 @@ func (o *MessageIn) GetPayloadRetentionPeriodOk() (*int64, bool) { // HasPayloadRetentionPeriod returns a boolean if a field has been set. func (o *MessageIn) HasPayloadRetentionPeriod() bool { - if o != nil && o.PayloadRetentionPeriod != nil { + if o != nil && !IsNil(o.PayloadRetentionPeriod) { return true } @@ -241,7 +250,7 @@ func (o *MessageIn) SetPayloadRetentionPeriod(v int64) { // GetTags returns the Tags field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MessageIn) GetTags() []string { - if o == nil { + if o == nil { var ret []string return ret } @@ -251,16 +260,16 @@ func (o *MessageIn) GetTags() []string { // GetTagsOk returns a tuple with the Tags 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 *MessageIn) GetTagsOk() (*[]string, bool) { - if o == nil || o.Tags == nil { +func (o *MessageIn) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { return nil, false } - return &o.Tags, true + return o.Tags, true } // HasTags returns a boolean if a field has been set. func (o *MessageIn) HasTags() bool { - if o != nil && o.Tags != nil { + if o != nil && IsNil(o.Tags) { return true } @@ -272,9 +281,50 @@ func (o *MessageIn) SetTags(v []string) { o.Tags = v } +// GetTransformationsParams returns the TransformationsParams field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *MessageIn) GetTransformationsParams() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.TransformationsParams +} + +// GetTransformationsParamsOk returns a tuple with the TransformationsParams 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 *MessageIn) GetTransformationsParamsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.TransformationsParams) { + return map[string]interface{}{}, false + } + return o.TransformationsParams, true +} + +// HasTransformationsParams returns a boolean if a field has been set. +func (o *MessageIn) HasTransformationsParams() bool { + if o != nil && IsNil(o.TransformationsParams) { + return true + } + + return false +} + +// SetTransformationsParams gets a reference to the given map[string]interface{} and assigns it to the TransformationsParams field. +func (o *MessageIn) SetTransformationsParams(v map[string]interface{}) { + o.TransformationsParams = v +} + func (o MessageIn) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MessageIn) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Application != nil { + if !IsNil(o.Application) { toSerialize["application"] = o.Application } if o.Channels != nil { @@ -283,19 +333,56 @@ func (o MessageIn) MarshalJSON() ([]byte, error) { if o.EventId.IsSet() { toSerialize["eventId"] = o.EventId.Get() } - if true { - toSerialize["eventType"] = o.EventType - } - if true { - toSerialize["payload"] = o.Payload - } - if o.PayloadRetentionPeriod != nil { + toSerialize["eventType"] = o.EventType + toSerialize["payload"] = o.Payload + if !IsNil(o.PayloadRetentionPeriod) { toSerialize["payloadRetentionPeriod"] = o.PayloadRetentionPeriod } if o.Tags != nil { toSerialize["tags"] = o.Tags } - return json.Marshal(toSerialize) + if o.TransformationsParams != nil { + toSerialize["transformationsParams"] = o.TransformationsParams + } + return toSerialize, nil +} + +func (o *MessageIn) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "eventType", + "payload", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMessageIn := _MessageIn{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMessageIn) + + if err != nil { + return err + } + + *o = MessageIn(varMessageIn) + + return err } type NullableMessageIn struct { diff --git a/go/internal/openapi/model_message_out.go b/go/internal/openapi/model_message_out.go index 0bff7158b..0f79625ed 100644 --- a/go/internal/openapi/model_message_out.go +++ b/go/internal/openapi/model_message_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -13,8 +13,13 @@ package openapi import ( "encoding/json" "time" + "bytes" + "fmt" ) +// checks if the MessageOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MessageOut{} + // MessageOut struct for MessageOut type MessageOut struct { // List of free-form identifiers that endpoints can filter by @@ -29,6 +34,8 @@ type MessageOut struct { Timestamp time.Time `json:"timestamp"` } +type _MessageOut MessageOut + // NewMessageOut instantiates a new MessageOut 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 @@ -52,7 +59,7 @@ func NewMessageOutWithDefaults() *MessageOut { // GetChannels returns the Channels field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MessageOut) GetChannels() []string { - if o == nil { + if o == nil { var ret []string return ret } @@ -62,16 +69,16 @@ func (o *MessageOut) GetChannels() []string { // GetChannelsOk returns a tuple with the Channels 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 *MessageOut) GetChannelsOk() (*[]string, bool) { - if o == nil || o.Channels == nil { +func (o *MessageOut) GetChannelsOk() ([]string, bool) { + if o == nil || IsNil(o.Channels) { return nil, false } - return &o.Channels, true + return o.Channels, true } // HasChannels returns a boolean if a field has been set. func (o *MessageOut) HasChannels() bool { - if o != nil && o.Channels != nil { + if o != nil && IsNil(o.Channels) { return true } @@ -85,7 +92,7 @@ func (o *MessageOut) SetChannels(v []string) { // GetEventId returns the EventId field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MessageOut) GetEventId() string { - if o == nil || o.EventId.Get() == nil { + if o == nil || IsNil(o.EventId.Get()) { var ret string return ret } @@ -96,7 +103,7 @@ func (o *MessageOut) GetEventId() string { // 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 *MessageOut) GetEventIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.EventId.Get(), o.EventId.IsSet() @@ -138,7 +145,7 @@ func (o *MessageOut) GetEventType() string { // GetEventTypeOk returns a tuple with the EventType field value // and a boolean to check if the value has been set. func (o *MessageOut) GetEventTypeOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.EventType, true @@ -162,7 +169,7 @@ func (o *MessageOut) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *MessageOut) GetIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Id, true @@ -185,11 +192,11 @@ func (o *MessageOut) GetPayload() map[string]interface{} { // GetPayloadOk returns a tuple with the Payload field value // and a boolean to check if the value has been set. -func (o *MessageOut) GetPayloadOk() (*map[string]interface{}, bool) { - if o == nil { - return nil, false +func (o *MessageOut) GetPayloadOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false } - return &o.Payload, true + return o.Payload, true } // SetPayload sets field value @@ -210,7 +217,7 @@ func (o *MessageOut) GetTimestamp() time.Time { // GetTimestampOk returns a tuple with the Timestamp field value // and a boolean to check if the value has been set. func (o *MessageOut) GetTimestampOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Timestamp, true @@ -222,6 +229,14 @@ func (o *MessageOut) SetTimestamp(v time.Time) { } func (o MessageOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MessageOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if o.Channels != nil { toSerialize["channels"] = o.Channels @@ -229,19 +244,51 @@ func (o MessageOut) MarshalJSON() ([]byte, error) { if o.EventId.IsSet() { toSerialize["eventId"] = o.EventId.Get() } - if true { - toSerialize["eventType"] = o.EventType + toSerialize["eventType"] = o.EventType + toSerialize["id"] = o.Id + toSerialize["payload"] = o.Payload + toSerialize["timestamp"] = o.Timestamp + return toSerialize, nil +} + +func (o *MessageOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "eventType", + "id", + "payload", + "timestamp", } - if true { - toSerialize["id"] = o.Id + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["payload"] = o.Payload + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - if true { - toSerialize["timestamp"] = o.Timestamp + + varMessageOut := _MessageOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMessageOut) + + if err != nil { + return err } - return json.Marshal(toSerialize) + + *o = MessageOut(varMessageOut) + + return err } type NullableMessageOut struct { diff --git a/go/internal/openapi/model_message_raw_payload_out.go b/go/internal/openapi/model_message_raw_payload_out.go index 7da0d5e88..4785a9fb1 100644 --- a/go/internal/openapi/model_message_raw_payload_out.go +++ b/go/internal/openapi/model_message_raw_payload_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,13 +12,20 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the MessageRawPayloadOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MessageRawPayloadOut{} + // MessageRawPayloadOut struct for MessageRawPayloadOut type MessageRawPayloadOut struct { Payload string `json:"payload"` } +type _MessageRawPayloadOut MessageRawPayloadOut + // NewMessageRawPayloadOut instantiates a new MessageRawPayloadOut 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 @@ -50,7 +57,7 @@ func (o *MessageRawPayloadOut) GetPayload() string { // GetPayloadOk returns a tuple with the Payload field value // and a boolean to check if the value has been set. func (o *MessageRawPayloadOut) GetPayloadOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Payload, true @@ -62,13 +69,56 @@ func (o *MessageRawPayloadOut) SetPayload(v string) { } func (o MessageRawPayloadOut) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["payload"] = o.Payload + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o MessageRawPayloadOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["payload"] = o.Payload + return toSerialize, nil +} + +func (o *MessageRawPayloadOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "payload", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMessageRawPayloadOut := _MessageRawPayloadOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMessageRawPayloadOut) + + if err != nil { + return err + } + + *o = MessageRawPayloadOut(varMessageRawPayloadOut) + + return err +} + type NullableMessageRawPayloadOut struct { value *MessageRawPayloadOut isSet bool diff --git a/go/internal/openapi/model_message_status.go b/go/internal/openapi/model_message_status.go index 1f5969358..40104c7fe 100644 --- a/go/internal/openapi/model_message_status.go +++ b/go/internal/openapi/model_message_status.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -26,7 +26,8 @@ const ( MESSAGESTATUS_Sending MessageStatus = 3 ) -var allowedMessageStatusEnumValues = []MessageStatus{ +// All allowed values of MessageStatus enum +var AllowedMessageStatusEnumValues = []MessageStatus{ 0, 1, 2, @@ -40,7 +41,7 @@ func (v *MessageStatus) UnmarshalJSON(src []byte) error { return err } enumTypeValue := MessageStatus(value) - for _, existing := range allowedMessageStatusEnumValues { + for _, existing := range AllowedMessageStatusEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -57,13 +58,13 @@ func NewMessageStatusFromValue(v int32) (*MessageStatus, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for MessageStatus: valid values are %v", v, allowedMessageStatusEnumValues) + return nil, fmt.Errorf("invalid value '%v' for MessageStatus: valid values are %v", v, AllowedMessageStatusEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v MessageStatus) IsValid() bool { - for _, existing := range allowedMessageStatusEnumValues { + for _, existing := range AllowedMessageStatusEnumValues { if existing == v { return true } diff --git a/go/internal/openapi/model_message_stream_out.go b/go/internal/openapi/model_message_stream_out.go index d37bf5ca1..8d2efb42d 100644 --- a/go/internal/openapi/model_message_stream_out.go +++ b/go/internal/openapi/model_message_stream_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the MessageStreamOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MessageStreamOut{} + // MessageStreamOut struct for MessageStreamOut type MessageStreamOut struct { Data []MessageOut `json:"data"` @@ -21,6 +26,8 @@ type MessageStreamOut struct { Iterator string `json:"iterator"` } +type _MessageStreamOut MessageStreamOut + // 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 @@ -53,11 +60,11 @@ func (o *MessageStreamOut) GetData() []MessageOut { // 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 { +func (o *MessageStreamOut) GetDataOk() ([]MessageOut, bool) { + if o == nil { return nil, false } - return &o.Data, true + return o.Data, true } // SetData sets field value @@ -78,7 +85,7 @@ func (o *MessageStreamOut) GetDone() bool { // 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 { + if o == nil { return nil, false } return &o.Done, true @@ -102,7 +109,7 @@ func (o *MessageStreamOut) GetIterator() string { // 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 { + if o == nil { return nil, false } return &o.Iterator, true @@ -114,17 +121,58 @@ func (o *MessageStreamOut) SetIterator(v string) { } func (o MessageStreamOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MessageStreamOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["data"] = o.Data + toSerialize["data"] = o.Data + toSerialize["done"] = o.Done + toSerialize["iterator"] = o.Iterator + return toSerialize, nil +} + +func (o *MessageStreamOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + "done", + "iterator", } - if true { - toSerialize["done"] = o.Done + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["iterator"] = o.Iterator + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varMessageStreamOut := _MessageStreamOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMessageStreamOut) + + if err != nil { + return err + } + + *o = MessageStreamOut(varMessageStreamOut) + + return err } type NullableMessageStreamOut struct { diff --git a/go/internal/openapi/model_oauth_payload_in.go b/go/internal/openapi/model_oauth_payload_in.go index 739153915..155496793 100644 --- a/go/internal/openapi/model_oauth_payload_in.go +++ b/go/internal/openapi/model_oauth_payload_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,14 +12,21 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the OauthPayloadIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OauthPayloadIn{} + // OauthPayloadIn struct for OauthPayloadIn type OauthPayloadIn struct { Code string `json:"code"` RedirectUri string `json:"redirectUri"` } +type _OauthPayloadIn OauthPayloadIn + // NewOauthPayloadIn instantiates a new OauthPayloadIn 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 @@ -52,7 +59,7 @@ func (o *OauthPayloadIn) GetCode() string { // GetCodeOk returns a tuple with the Code field value // and a boolean to check if the value has been set. func (o *OauthPayloadIn) GetCodeOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Code, true @@ -76,7 +83,7 @@ func (o *OauthPayloadIn) GetRedirectUri() string { // GetRedirectUriOk returns a tuple with the RedirectUri field value // and a boolean to check if the value has been set. func (o *OauthPayloadIn) GetRedirectUriOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.RedirectUri, true @@ -88,14 +95,56 @@ func (o *OauthPayloadIn) SetRedirectUri(v string) { } func (o OauthPayloadIn) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OauthPayloadIn) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["code"] = o.Code + toSerialize["code"] = o.Code + toSerialize["redirectUri"] = o.RedirectUri + return toSerialize, nil +} + +func (o *OauthPayloadIn) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "code", + "redirectUri", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["redirectUri"] = o.RedirectUri + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varOauthPayloadIn := _OauthPayloadIn{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varOauthPayloadIn) + + if err != nil { + return err + } + + *o = OauthPayloadIn(varOauthPayloadIn) + + return err } type NullableOauthPayloadIn struct { diff --git a/go/internal/openapi/model_oauth_payload_out.go b/go/internal/openapi/model_oauth_payload_out.go index b74c3d14b..fa011cbd3 100644 --- a/go/internal/openapi/model_oauth_payload_out.go +++ b/go/internal/openapi/model_oauth_payload_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -14,6 +14,9 @@ import ( "encoding/json" ) +// checks if the OauthPayloadOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OauthPayloadOut{} + // OauthPayloadOut struct for OauthPayloadOut type OauthPayloadOut struct { Channel NullableString `json:"channel,omitempty"` @@ -40,7 +43,7 @@ func NewOauthPayloadOutWithDefaults() *OauthPayloadOut { // GetChannel returns the Channel field value if set, zero value otherwise (both if not set or set to explicit null). func (o *OauthPayloadOut) GetChannel() string { - if o == nil || o.Channel.Get() == nil { + if o == nil || IsNil(o.Channel.Get()) { var ret string return ret } @@ -51,7 +54,7 @@ func (o *OauthPayloadOut) GetChannel() string { // 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 *OauthPayloadOut) GetChannelOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Channel.Get(), o.Channel.IsSet() @@ -82,7 +85,7 @@ func (o *OauthPayloadOut) UnsetChannel() { // GetError returns the Error field value if set, zero value otherwise (both if not set or set to explicit null). func (o *OauthPayloadOut) GetError() string { - if o == nil || o.Error.Get() == nil { + if o == nil || IsNil(o.Error.Get()) { var ret string return ret } @@ -93,7 +96,7 @@ func (o *OauthPayloadOut) GetError() string { // 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 *OauthPayloadOut) GetErrorOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Error.Get(), o.Error.IsSet() @@ -124,7 +127,7 @@ func (o *OauthPayloadOut) UnsetError() { // GetIncomingWebhookUrl returns the IncomingWebhookUrl field value if set, zero value otherwise (both if not set or set to explicit null). func (o *OauthPayloadOut) GetIncomingWebhookUrl() string { - if o == nil || o.IncomingWebhookUrl.Get() == nil { + if o == nil || IsNil(o.IncomingWebhookUrl.Get()) { var ret string return ret } @@ -135,7 +138,7 @@ func (o *OauthPayloadOut) GetIncomingWebhookUrl() string { // 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 *OauthPayloadOut) GetIncomingWebhookUrlOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.IncomingWebhookUrl.Get(), o.IncomingWebhookUrl.IsSet() @@ -165,6 +168,14 @@ func (o *OauthPayloadOut) UnsetIncomingWebhookUrl() { } func (o OauthPayloadOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OauthPayloadOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if o.Channel.IsSet() { toSerialize["channel"] = o.Channel.Get() @@ -175,7 +186,7 @@ func (o OauthPayloadOut) MarshalJSON() ([]byte, error) { if o.IncomingWebhookUrl.IsSet() { toSerialize["incomingWebhookUrl"] = o.IncomingWebhookUrl.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableOauthPayloadOut struct { diff --git a/go/internal/openapi/model_one_time_token_in.go b/go/internal/openapi/model_one_time_token_in.go index 38b92c149..5dde199a0 100644 --- a/go/internal/openapi/model_one_time_token_in.go +++ b/go/internal/openapi/model_one_time_token_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,13 +12,20 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the OneTimeTokenIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OneTimeTokenIn{} + // OneTimeTokenIn struct for OneTimeTokenIn type OneTimeTokenIn struct { OneTimeToken string `json:"oneTimeToken"` } +type _OneTimeTokenIn OneTimeTokenIn + // NewOneTimeTokenIn instantiates a new OneTimeTokenIn 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 @@ -50,7 +57,7 @@ func (o *OneTimeTokenIn) GetOneTimeToken() string { // GetOneTimeTokenOk returns a tuple with the OneTimeToken field value // and a boolean to check if the value has been set. func (o *OneTimeTokenIn) GetOneTimeTokenOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.OneTimeToken, true @@ -62,13 +69,56 @@ func (o *OneTimeTokenIn) SetOneTimeToken(v string) { } func (o OneTimeTokenIn) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["oneTimeToken"] = o.OneTimeToken + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o OneTimeTokenIn) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["oneTimeToken"] = o.OneTimeToken + return toSerialize, nil +} + +func (o *OneTimeTokenIn) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "oneTimeToken", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOneTimeTokenIn := _OneTimeTokenIn{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varOneTimeTokenIn) + + if err != nil { + return err + } + + *o = OneTimeTokenIn(varOneTimeTokenIn) + + return err +} + type NullableOneTimeTokenIn struct { value *OneTimeTokenIn isSet bool diff --git a/go/internal/openapi/model_one_time_token_out.go b/go/internal/openapi/model_one_time_token_out.go index 3a6655882..208b0865e 100644 --- a/go/internal/openapi/model_one_time_token_out.go +++ b/go/internal/openapi/model_one_time_token_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,13 +12,20 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the OneTimeTokenOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OneTimeTokenOut{} + // OneTimeTokenOut struct for OneTimeTokenOut type OneTimeTokenOut struct { Token string `json:"token"` } +type _OneTimeTokenOut OneTimeTokenOut + // NewOneTimeTokenOut instantiates a new OneTimeTokenOut 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 @@ -50,7 +57,7 @@ func (o *OneTimeTokenOut) GetToken() string { // GetTokenOk returns a tuple with the Token field value // and a boolean to check if the value has been set. func (o *OneTimeTokenOut) GetTokenOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Token, true @@ -62,13 +69,56 @@ func (o *OneTimeTokenOut) SetToken(v string) { } func (o OneTimeTokenOut) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["token"] = o.Token + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o OneTimeTokenOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["token"] = o.Token + return toSerialize, nil +} + +func (o *OneTimeTokenOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "token", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOneTimeTokenOut := _OneTimeTokenOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varOneTimeTokenOut) + + if err != nil { + return err + } + + *o = OneTimeTokenOut(varOneTimeTokenOut) + + return err +} + type NullableOneTimeTokenOut struct { value *OneTimeTokenOut isSet bool diff --git a/go/internal/openapi/model_ordering.go b/go/internal/openapi/model_ordering.go index 61b527c6a..5e954adb8 100644 --- a/go/internal/openapi/model_ordering.go +++ b/go/internal/openapi/model_ordering.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -24,7 +24,8 @@ const ( ORDERING_DESCENDING Ordering = "descending" ) -var allowedOrderingEnumValues = []Ordering{ +// All allowed values of Ordering enum +var AllowedOrderingEnumValues = []Ordering{ "ascending", "descending", } @@ -36,7 +37,7 @@ func (v *Ordering) UnmarshalJSON(src []byte) error { return err } enumTypeValue := Ordering(value) - for _, existing := range allowedOrderingEnumValues { + for _, existing := range AllowedOrderingEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -53,13 +54,13 @@ func NewOrderingFromValue(v string) (*Ordering, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for Ordering: valid values are %v", v, allowedOrderingEnumValues) + return nil, fmt.Errorf("invalid value '%v' for Ordering: valid values are %v", v, AllowedOrderingEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v Ordering) IsValid() bool { - for _, existing := range allowedOrderingEnumValues { + for _, existing := range AllowedOrderingEnumValues { if existing == v { return true } diff --git a/go/internal/openapi/model_recover_in.go b/go/internal/openapi/model_recover_in.go index a78b0bf91..11531bf27 100644 --- a/go/internal/openapi/model_recover_in.go +++ b/go/internal/openapi/model_recover_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -13,14 +13,21 @@ package openapi import ( "encoding/json" "time" + "bytes" + "fmt" ) +// checks if the RecoverIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RecoverIn{} + // RecoverIn struct for RecoverIn type RecoverIn struct { Since time.Time `json:"since"` Until NullableTime `json:"until,omitempty"` } +type _RecoverIn RecoverIn + // NewRecoverIn instantiates a new RecoverIn 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 @@ -52,7 +59,7 @@ func (o *RecoverIn) GetSince() time.Time { // GetSinceOk returns a tuple with the Since field value // and a boolean to check if the value has been set. func (o *RecoverIn) GetSinceOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Since, true @@ -65,7 +72,7 @@ func (o *RecoverIn) SetSince(v time.Time) { // GetUntil returns the Until field value if set, zero value otherwise (both if not set or set to explicit null). func (o *RecoverIn) GetUntil() time.Time { - if o == nil || o.Until.Get() == nil { + if o == nil || IsNil(o.Until.Get()) { var ret time.Time return ret } @@ -76,7 +83,7 @@ func (o *RecoverIn) GetUntil() time.Time { // 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 *RecoverIn) GetUntilOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return o.Until.Get(), o.Until.IsSet() @@ -106,14 +113,57 @@ func (o *RecoverIn) UnsetUntil() { } func (o RecoverIn) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["since"] = o.Since + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o RecoverIn) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["since"] = o.Since if o.Until.IsSet() { toSerialize["until"] = o.Until.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *RecoverIn) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "since", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRecoverIn := _RecoverIn{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRecoverIn) + + if err != nil { + return err + } + + *o = RecoverIn(varRecoverIn) + + return err } type NullableRecoverIn struct { diff --git a/go/internal/openapi/model_recover_out.go b/go/internal/openapi/model_recover_out.go index cbe46628c..39b855943 100644 --- a/go/internal/openapi/model_recover_out.go +++ b/go/internal/openapi/model_recover_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the RecoverOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RecoverOut{} + // RecoverOut struct for RecoverOut type RecoverOut struct { Id string `json:"id"` @@ -21,6 +26,8 @@ type RecoverOut struct { Task BackgroundTaskType `json:"task"` } +type _RecoverOut RecoverOut + // NewRecoverOut instantiates a new RecoverOut 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 @@ -54,7 +61,7 @@ func (o *RecoverOut) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *RecoverOut) GetIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Id, true @@ -78,7 +85,7 @@ func (o *RecoverOut) GetStatus() BackgroundTaskStatus { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. func (o *RecoverOut) GetStatusOk() (*BackgroundTaskStatus, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Status, true @@ -102,7 +109,7 @@ func (o *RecoverOut) GetTask() BackgroundTaskType { // GetTaskOk returns a tuple with the Task field value // and a boolean to check if the value has been set. func (o *RecoverOut) GetTaskOk() (*BackgroundTaskType, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Task, true @@ -114,17 +121,58 @@ func (o *RecoverOut) SetTask(v BackgroundTaskType) { } func (o RecoverOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RecoverOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["id"] = o.Id + toSerialize["id"] = o.Id + toSerialize["status"] = o.Status + toSerialize["task"] = o.Task + return toSerialize, nil +} + +func (o *RecoverOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "status", + "task", } - if true { - toSerialize["status"] = o.Status + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["task"] = o.Task + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varRecoverOut := _RecoverOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRecoverOut) + + if err != nil { + return err + } + + *o = RecoverOut(varRecoverOut) + + return err } type NullableRecoverOut struct { diff --git a/go/internal/openapi/model_replay_in.go b/go/internal/openapi/model_replay_in.go index f78e5543b..6cb791d47 100644 --- a/go/internal/openapi/model_replay_in.go +++ b/go/internal/openapi/model_replay_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -13,14 +13,21 @@ package openapi import ( "encoding/json" "time" + "bytes" + "fmt" ) +// checks if the ReplayIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ReplayIn{} + // ReplayIn struct for ReplayIn type ReplayIn struct { Since time.Time `json:"since"` Until NullableTime `json:"until,omitempty"` } +type _ReplayIn ReplayIn + // NewReplayIn instantiates a new ReplayIn 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 @@ -52,7 +59,7 @@ func (o *ReplayIn) GetSince() time.Time { // GetSinceOk returns a tuple with the Since field value // and a boolean to check if the value has been set. func (o *ReplayIn) GetSinceOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Since, true @@ -65,7 +72,7 @@ func (o *ReplayIn) SetSince(v time.Time) { // GetUntil returns the Until field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ReplayIn) GetUntil() time.Time { - if o == nil || o.Until.Get() == nil { + if o == nil || IsNil(o.Until.Get()) { var ret time.Time return ret } @@ -76,7 +83,7 @@ func (o *ReplayIn) GetUntil() time.Time { // 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 *ReplayIn) GetUntilOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return o.Until.Get(), o.Until.IsSet() @@ -106,14 +113,57 @@ func (o *ReplayIn) UnsetUntil() { } func (o ReplayIn) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["since"] = o.Since + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o ReplayIn) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["since"] = o.Since if o.Until.IsSet() { toSerialize["until"] = o.Until.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil +} + +func (o *ReplayIn) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "since", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varReplayIn := _ReplayIn{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varReplayIn) + + if err != nil { + return err + } + + *o = ReplayIn(varReplayIn) + + return err } type NullableReplayIn struct { diff --git a/go/internal/openapi/model_replay_out.go b/go/internal/openapi/model_replay_out.go index 258f41eeb..a95f012e8 100644 --- a/go/internal/openapi/model_replay_out.go +++ b/go/internal/openapi/model_replay_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the ReplayOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ReplayOut{} + // ReplayOut struct for ReplayOut type ReplayOut struct { Id string `json:"id"` @@ -21,6 +26,8 @@ type ReplayOut struct { Task BackgroundTaskType `json:"task"` } +type _ReplayOut ReplayOut + // NewReplayOut instantiates a new ReplayOut 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 @@ -54,7 +61,7 @@ func (o *ReplayOut) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *ReplayOut) GetIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Id, true @@ -78,7 +85,7 @@ func (o *ReplayOut) GetStatus() BackgroundTaskStatus { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. func (o *ReplayOut) GetStatusOk() (*BackgroundTaskStatus, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Status, true @@ -102,7 +109,7 @@ func (o *ReplayOut) GetTask() BackgroundTaskType { // GetTaskOk returns a tuple with the Task field value // and a boolean to check if the value has been set. func (o *ReplayOut) GetTaskOk() (*BackgroundTaskType, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Task, true @@ -114,17 +121,58 @@ func (o *ReplayOut) SetTask(v BackgroundTaskType) { } func (o ReplayOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ReplayOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["id"] = o.Id + toSerialize["id"] = o.Id + toSerialize["status"] = o.Status + toSerialize["task"] = o.Task + return toSerialize, nil +} + +func (o *ReplayOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "status", + "task", } - if true { - toSerialize["status"] = o.Status + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["task"] = o.Task + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varReplayOut := _ReplayOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varReplayOut) + + if err != nil { + return err + } + + *o = ReplayOut(varReplayOut) + + return err } type NullableReplayOut struct { diff --git a/go/internal/openapi/model_rotated_url_out.go b/go/internal/openapi/model_rotated_url_out.go index 8fa241e63..a01e898a8 100644 --- a/go/internal/openapi/model_rotated_url_out.go +++ b/go/internal/openapi/model_rotated_url_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,13 +12,20 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the RotatedUrlOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RotatedUrlOut{} + // RotatedUrlOut struct for RotatedUrlOut type RotatedUrlOut struct { Url string `json:"url"` } +type _RotatedUrlOut RotatedUrlOut + // 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 @@ -50,7 +57,7 @@ func (o *RotatedUrlOut) GetUrl() string { // 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 { + if o == nil { return nil, false } return &o.Url, true @@ -62,13 +69,56 @@ func (o *RotatedUrlOut) SetUrl(v string) { } func (o RotatedUrlOut) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["url"] = o.Url + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o RotatedUrlOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["url"] = o.Url + return toSerialize, nil +} + +func (o *RotatedUrlOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRotatedUrlOut := _RotatedUrlOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRotatedUrlOut) + + if err != nil { + return err + } + + *o = RotatedUrlOut(varRotatedUrlOut) + + return err +} + type NullableRotatedUrlOut struct { value *RotatedUrlOut isSet bool diff --git a/go/internal/openapi/model_settings_in.go b/go/internal/openapi/model_settings_in.go index 57595ca79..2d5a09557 100644 --- a/go/internal/openapi/model_settings_in.go +++ b/go/internal/openapi/model_settings_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -14,6 +14,9 @@ import ( "encoding/json" ) +// checks if the SettingsIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SettingsIn{} + // SettingsIn struct for SettingsIn type SettingsIn struct { ColorPaletteDark *CustomColorPalette `json:"colorPaletteDark,omitempty"` @@ -81,7 +84,7 @@ func NewSettingsInWithDefaults() *SettingsIn { // GetColorPaletteDark returns the ColorPaletteDark field value if set, zero value otherwise. func (o *SettingsIn) GetColorPaletteDark() CustomColorPalette { - if o == nil || o.ColorPaletteDark == nil { + if o == nil || IsNil(o.ColorPaletteDark) { var ret CustomColorPalette return ret } @@ -91,7 +94,7 @@ func (o *SettingsIn) GetColorPaletteDark() CustomColorPalette { // GetColorPaletteDarkOk returns a tuple with the ColorPaletteDark field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SettingsIn) GetColorPaletteDarkOk() (*CustomColorPalette, bool) { - if o == nil || o.ColorPaletteDark == nil { + if o == nil || IsNil(o.ColorPaletteDark) { return nil, false } return o.ColorPaletteDark, true @@ -99,7 +102,7 @@ func (o *SettingsIn) GetColorPaletteDarkOk() (*CustomColorPalette, bool) { // HasColorPaletteDark returns a boolean if a field has been set. func (o *SettingsIn) HasColorPaletteDark() bool { - if o != nil && o.ColorPaletteDark != nil { + if o != nil && !IsNil(o.ColorPaletteDark) { return true } @@ -113,7 +116,7 @@ func (o *SettingsIn) SetColorPaletteDark(v CustomColorPalette) { // GetColorPaletteLight returns the ColorPaletteLight field value if set, zero value otherwise. func (o *SettingsIn) GetColorPaletteLight() CustomColorPalette { - if o == nil || o.ColorPaletteLight == nil { + if o == nil || IsNil(o.ColorPaletteLight) { var ret CustomColorPalette return ret } @@ -123,7 +126,7 @@ func (o *SettingsIn) GetColorPaletteLight() CustomColorPalette { // GetColorPaletteLightOk returns a tuple with the ColorPaletteLight field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SettingsIn) GetColorPaletteLightOk() (*CustomColorPalette, bool) { - if o == nil || o.ColorPaletteLight == nil { + if o == nil || IsNil(o.ColorPaletteLight) { return nil, false } return o.ColorPaletteLight, true @@ -131,7 +134,7 @@ func (o *SettingsIn) GetColorPaletteLightOk() (*CustomColorPalette, bool) { // HasColorPaletteLight returns a boolean if a field has been set. func (o *SettingsIn) HasColorPaletteLight() bool { - if o != nil && o.ColorPaletteLight != nil { + if o != nil && !IsNil(o.ColorPaletteLight) { return true } @@ -145,7 +148,7 @@ func (o *SettingsIn) SetColorPaletteLight(v CustomColorPalette) { // GetCustomBaseFontSize returns the CustomBaseFontSize field value if set, zero value otherwise (both if not set or set to explicit null). func (o *SettingsIn) GetCustomBaseFontSize() int32 { - if o == nil || o.CustomBaseFontSize.Get() == nil { + if o == nil || IsNil(o.CustomBaseFontSize.Get()) { var ret int32 return ret } @@ -156,7 +159,7 @@ func (o *SettingsIn) GetCustomBaseFontSize() int32 { // 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) GetCustomBaseFontSizeOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return o.CustomBaseFontSize.Get(), o.CustomBaseFontSize.IsSet() @@ -187,7 +190,7 @@ func (o *SettingsIn) UnsetCustomBaseFontSize() { // GetCustomColor returns the CustomColor field value if set, zero value otherwise. func (o *SettingsIn) GetCustomColor() string { - if o == nil || o.CustomColor == nil { + if o == nil || IsNil(o.CustomColor) { var ret string return ret } @@ -197,7 +200,7 @@ func (o *SettingsIn) GetCustomColor() string { // GetCustomColorOk returns a tuple with the CustomColor field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SettingsIn) GetCustomColorOk() (*string, bool) { - if o == nil || o.CustomColor == nil { + if o == nil || IsNil(o.CustomColor) { return nil, false } return o.CustomColor, true @@ -205,7 +208,7 @@ func (o *SettingsIn) GetCustomColorOk() (*string, bool) { // HasCustomColor returns a boolean if a field has been set. func (o *SettingsIn) HasCustomColor() bool { - if o != nil && o.CustomColor != nil { + if o != nil && !IsNil(o.CustomColor) { return true } @@ -219,7 +222,7 @@ func (o *SettingsIn) SetCustomColor(v string) { // GetCustomFontFamily returns the CustomFontFamily field value if set, zero value otherwise (both if not set or set to explicit null). func (o *SettingsIn) GetCustomFontFamily() string { - if o == nil || o.CustomFontFamily.Get() == nil { + if o == nil || IsNil(o.CustomFontFamily.Get()) { var ret string return ret } @@ -230,7 +233,7 @@ func (o *SettingsIn) GetCustomFontFamily() string { // 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) GetCustomFontFamilyOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.CustomFontFamily.Get(), o.CustomFontFamily.IsSet() @@ -261,7 +264,7 @@ func (o *SettingsIn) UnsetCustomFontFamily() { // GetCustomFontFamilyUrl returns the CustomFontFamilyUrl field value if set, zero value otherwise (both if not set or set to explicit null). func (o *SettingsIn) GetCustomFontFamilyUrl() string { - if o == nil || o.CustomFontFamilyUrl.Get() == nil { + if o == nil || IsNil(o.CustomFontFamilyUrl.Get()) { var ret string return ret } @@ -272,7 +275,7 @@ func (o *SettingsIn) GetCustomFontFamilyUrl() string { // 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) GetCustomFontFamilyUrlOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.CustomFontFamilyUrl.Get(), o.CustomFontFamilyUrl.IsSet() @@ -303,7 +306,7 @@ func (o *SettingsIn) UnsetCustomFontFamilyUrl() { // GetCustomLogoUrl returns the CustomLogoUrl field value if set, zero value otherwise (both if not set or set to explicit null). func (o *SettingsIn) GetCustomLogoUrl() string { - if o == nil || o.CustomLogoUrl.Get() == nil { + if o == nil || IsNil(o.CustomLogoUrl.Get()) { var ret string return ret } @@ -314,7 +317,7 @@ func (o *SettingsIn) GetCustomLogoUrl() string { // 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) GetCustomLogoUrlOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.CustomLogoUrl.Get(), o.CustomLogoUrl.IsSet() @@ -345,7 +348,7 @@ func (o *SettingsIn) UnsetCustomLogoUrl() { // GetCustomThemeOverride returns the CustomThemeOverride field value if set, zero value otherwise. func (o *SettingsIn) GetCustomThemeOverride() CustomThemeOverride { - if o == nil || o.CustomThemeOverride == nil { + if o == nil || IsNil(o.CustomThemeOverride) { var ret CustomThemeOverride return ret } @@ -355,7 +358,7 @@ func (o *SettingsIn) GetCustomThemeOverride() CustomThemeOverride { // GetCustomThemeOverrideOk returns a tuple with the CustomThemeOverride field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SettingsIn) GetCustomThemeOverrideOk() (*CustomThemeOverride, bool) { - if o == nil || o.CustomThemeOverride == nil { + if o == nil || IsNil(o.CustomThemeOverride) { return nil, false } return o.CustomThemeOverride, true @@ -363,7 +366,7 @@ func (o *SettingsIn) GetCustomThemeOverrideOk() (*CustomThemeOverride, bool) { // HasCustomThemeOverride returns a boolean if a field has been set. func (o *SettingsIn) HasCustomThemeOverride() bool { - if o != nil && o.CustomThemeOverride != nil { + if o != nil && !IsNil(o.CustomThemeOverride) { return true } @@ -377,7 +380,7 @@ func (o *SettingsIn) SetCustomThemeOverride(v CustomThemeOverride) { // GetDisableEndpointOnFailure returns the DisableEndpointOnFailure field value if set, zero value otherwise. func (o *SettingsIn) GetDisableEndpointOnFailure() bool { - if o == nil || o.DisableEndpointOnFailure == nil { + if o == nil || IsNil(o.DisableEndpointOnFailure) { var ret bool return ret } @@ -387,7 +390,7 @@ func (o *SettingsIn) GetDisableEndpointOnFailure() bool { // GetDisableEndpointOnFailureOk returns a tuple with the DisableEndpointOnFailure field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SettingsIn) GetDisableEndpointOnFailureOk() (*bool, bool) { - if o == nil || o.DisableEndpointOnFailure == nil { + if o == nil || IsNil(o.DisableEndpointOnFailure) { return nil, false } return o.DisableEndpointOnFailure, true @@ -395,7 +398,7 @@ func (o *SettingsIn) GetDisableEndpointOnFailureOk() (*bool, bool) { // HasDisableEndpointOnFailure returns a boolean if a field has been set. func (o *SettingsIn) HasDisableEndpointOnFailure() bool { - if o != nil && o.DisableEndpointOnFailure != nil { + if o != nil && !IsNil(o.DisableEndpointOnFailure) { return true } @@ -409,7 +412,7 @@ func (o *SettingsIn) SetDisableEndpointOnFailure(v bool) { // GetDisplayName returns the DisplayName field value if set, zero value otherwise (both if not set or set to explicit null). func (o *SettingsIn) GetDisplayName() string { - if o == nil || o.DisplayName.Get() == nil { + if o == nil || IsNil(o.DisplayName.Get()) { var ret string return ret } @@ -420,7 +423,7 @@ func (o *SettingsIn) GetDisplayName() string { // 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) GetDisplayNameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.DisplayName.Get(), o.DisplayName.IsSet() @@ -451,7 +454,7 @@ func (o *SettingsIn) UnsetDisplayName() { // GetEnableChannels returns the EnableChannels field value if set, zero value otherwise. func (o *SettingsIn) GetEnableChannels() bool { - if o == nil || o.EnableChannels == nil { + if o == nil || IsNil(o.EnableChannels) { var ret bool return ret } @@ -461,7 +464,7 @@ func (o *SettingsIn) GetEnableChannels() bool { // GetEnableChannelsOk returns a tuple with the EnableChannels field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SettingsIn) GetEnableChannelsOk() (*bool, bool) { - if o == nil || o.EnableChannels == nil { + if o == nil || IsNil(o.EnableChannels) { return nil, false } return o.EnableChannels, true @@ -469,7 +472,7 @@ func (o *SettingsIn) GetEnableChannelsOk() (*bool, bool) { // HasEnableChannels returns a boolean if a field has been set. func (o *SettingsIn) HasEnableChannels() bool { - if o != nil && o.EnableChannels != nil { + if o != nil && !IsNil(o.EnableChannels) { return true } @@ -483,7 +486,7 @@ func (o *SettingsIn) SetEnableChannels(v bool) { // GetEnableIntegrationManagement returns the EnableIntegrationManagement field value if set, zero value otherwise. func (o *SettingsIn) GetEnableIntegrationManagement() bool { - if o == nil || o.EnableIntegrationManagement == nil { + if o == nil || IsNil(o.EnableIntegrationManagement) { var ret bool return ret } @@ -493,7 +496,7 @@ func (o *SettingsIn) GetEnableIntegrationManagement() bool { // GetEnableIntegrationManagementOk returns a tuple with the EnableIntegrationManagement field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SettingsIn) GetEnableIntegrationManagementOk() (*bool, bool) { - if o == nil || o.EnableIntegrationManagement == nil { + if o == nil || IsNil(o.EnableIntegrationManagement) { return nil, false } return o.EnableIntegrationManagement, true @@ -501,7 +504,7 @@ func (o *SettingsIn) GetEnableIntegrationManagementOk() (*bool, bool) { // HasEnableIntegrationManagement returns a boolean if a field has been set. func (o *SettingsIn) HasEnableIntegrationManagement() bool { - if o != nil && o.EnableIntegrationManagement != nil { + if o != nil && !IsNil(o.EnableIntegrationManagement) { return true } @@ -515,7 +518,7 @@ func (o *SettingsIn) SetEnableIntegrationManagement(v bool) { // GetEnableTransformations returns the EnableTransformations field value if set, zero value otherwise. func (o *SettingsIn) GetEnableTransformations() bool { - if o == nil || o.EnableTransformations == nil { + if o == nil || IsNil(o.EnableTransformations) { var ret bool return ret } @@ -525,7 +528,7 @@ func (o *SettingsIn) GetEnableTransformations() bool { // GetEnableTransformationsOk returns a tuple with the EnableTransformations field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SettingsIn) GetEnableTransformationsOk() (*bool, bool) { - if o == nil || o.EnableTransformations == nil { + if o == nil || IsNil(o.EnableTransformations) { return nil, false } return o.EnableTransformations, true @@ -533,7 +536,7 @@ func (o *SettingsIn) GetEnableTransformationsOk() (*bool, bool) { // HasEnableTransformations returns a boolean if a field has been set. func (o *SettingsIn) HasEnableTransformations() bool { - if o != nil && o.EnableTransformations != nil { + if o != nil && !IsNil(o.EnableTransformations) { return true } @@ -547,7 +550,7 @@ func (o *SettingsIn) SetEnableTransformations(v bool) { // GetEnforceHttps returns the EnforceHttps field value if set, zero value otherwise. func (o *SettingsIn) GetEnforceHttps() bool { - if o == nil || o.EnforceHttps == nil { + if o == nil || IsNil(o.EnforceHttps) { var ret bool return ret } @@ -557,7 +560,7 @@ func (o *SettingsIn) GetEnforceHttps() bool { // GetEnforceHttpsOk returns a tuple with the EnforceHttps field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SettingsIn) GetEnforceHttpsOk() (*bool, bool) { - if o == nil || o.EnforceHttps == nil { + if o == nil || IsNil(o.EnforceHttps) { return nil, false } return o.EnforceHttps, true @@ -565,7 +568,7 @@ func (o *SettingsIn) GetEnforceHttpsOk() (*bool, bool) { // HasEnforceHttps returns a boolean if a field has been set. func (o *SettingsIn) HasEnforceHttps() bool { - if o != nil && o.EnforceHttps != nil { + if o != nil && !IsNil(o.EnforceHttps) { return true } @@ -579,7 +582,7 @@ func (o *SettingsIn) SetEnforceHttps(v bool) { // GetEventCatalogPublished returns the EventCatalogPublished field value if set, zero value otherwise. func (o *SettingsIn) GetEventCatalogPublished() bool { - if o == nil || o.EventCatalogPublished == nil { + if o == nil || IsNil(o.EventCatalogPublished) { var ret bool return ret } @@ -589,7 +592,7 @@ func (o *SettingsIn) GetEventCatalogPublished() bool { // GetEventCatalogPublishedOk returns a tuple with the EventCatalogPublished field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SettingsIn) GetEventCatalogPublishedOk() (*bool, bool) { - if o == nil || o.EventCatalogPublished == nil { + if o == nil || IsNil(o.EventCatalogPublished) { return nil, false } return o.EventCatalogPublished, true @@ -597,7 +600,7 @@ func (o *SettingsIn) GetEventCatalogPublishedOk() (*bool, bool) { // HasEventCatalogPublished returns a boolean if a field has been set. func (o *SettingsIn) HasEventCatalogPublished() bool { - if o != nil && o.EventCatalogPublished != nil { + if o != nil && !IsNil(o.EventCatalogPublished) { return true } @@ -611,7 +614,7 @@ func (o *SettingsIn) SetEventCatalogPublished(v bool) { // GetReadOnly returns the ReadOnly field value if set, zero value otherwise. func (o *SettingsIn) GetReadOnly() bool { - if o == nil || o.ReadOnly == nil { + if o == nil || IsNil(o.ReadOnly) { var ret bool return ret } @@ -621,7 +624,7 @@ func (o *SettingsIn) GetReadOnly() bool { // GetReadOnlyOk returns a tuple with the ReadOnly field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SettingsIn) GetReadOnlyOk() (*bool, bool) { - if o == nil || o.ReadOnly == nil { + if o == nil || IsNil(o.ReadOnly) { return nil, false } return o.ReadOnly, true @@ -629,7 +632,7 @@ func (o *SettingsIn) GetReadOnlyOk() (*bool, bool) { // HasReadOnly returns a boolean if a field has been set. func (o *SettingsIn) HasReadOnly() bool { - if o != nil && o.ReadOnly != nil { + if o != nil && !IsNil(o.ReadOnly) { return true } @@ -642,17 +645,25 @@ func (o *SettingsIn) SetReadOnly(v bool) { } func (o SettingsIn) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SettingsIn) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.ColorPaletteDark != nil { + if !IsNil(o.ColorPaletteDark) { toSerialize["colorPaletteDark"] = o.ColorPaletteDark } - if o.ColorPaletteLight != nil { + if !IsNil(o.ColorPaletteLight) { toSerialize["colorPaletteLight"] = o.ColorPaletteLight } if o.CustomBaseFontSize.IsSet() { toSerialize["customBaseFontSize"] = o.CustomBaseFontSize.Get() } - if o.CustomColor != nil { + if !IsNil(o.CustomColor) { toSerialize["customColor"] = o.CustomColor } if o.CustomFontFamily.IsSet() { @@ -664,34 +675,34 @@ func (o SettingsIn) MarshalJSON() ([]byte, error) { if o.CustomLogoUrl.IsSet() { toSerialize["customLogoUrl"] = o.CustomLogoUrl.Get() } - if o.CustomThemeOverride != nil { + if !IsNil(o.CustomThemeOverride) { toSerialize["customThemeOverride"] = o.CustomThemeOverride } - if o.DisableEndpointOnFailure != nil { + if !IsNil(o.DisableEndpointOnFailure) { toSerialize["disableEndpointOnFailure"] = o.DisableEndpointOnFailure } if o.DisplayName.IsSet() { toSerialize["displayName"] = o.DisplayName.Get() } - if o.EnableChannels != nil { + if !IsNil(o.EnableChannels) { toSerialize["enableChannels"] = o.EnableChannels } - if o.EnableIntegrationManagement != nil { + if !IsNil(o.EnableIntegrationManagement) { toSerialize["enableIntegrationManagement"] = o.EnableIntegrationManagement } - if o.EnableTransformations != nil { + if !IsNil(o.EnableTransformations) { toSerialize["enableTransformations"] = o.EnableTransformations } - if o.EnforceHttps != nil { + if !IsNil(o.EnforceHttps) { toSerialize["enforceHttps"] = o.EnforceHttps } - if o.EventCatalogPublished != nil { + if !IsNil(o.EventCatalogPublished) { toSerialize["eventCatalogPublished"] = o.EventCatalogPublished } - if o.ReadOnly != nil { + if !IsNil(o.ReadOnly) { toSerialize["readOnly"] = o.ReadOnly } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableSettingsIn struct { diff --git a/go/internal/openapi/model_settings_out.go b/go/internal/openapi/model_settings_out.go index d87470b52..8520dbb9f 100644 --- a/go/internal/openapi/model_settings_out.go +++ b/go/internal/openapi/model_settings_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -14,6 +14,9 @@ import ( "encoding/json" ) +// checks if the SettingsOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SettingsOut{} + // SettingsOut struct for SettingsOut type SettingsOut struct { ColorPaletteDark *CustomColorPalette `json:"colorPaletteDark,omitempty"` @@ -81,7 +84,7 @@ func NewSettingsOutWithDefaults() *SettingsOut { // GetColorPaletteDark returns the ColorPaletteDark field value if set, zero value otherwise. func (o *SettingsOut) GetColorPaletteDark() CustomColorPalette { - if o == nil || o.ColorPaletteDark == nil { + if o == nil || IsNil(o.ColorPaletteDark) { var ret CustomColorPalette return ret } @@ -91,7 +94,7 @@ func (o *SettingsOut) GetColorPaletteDark() CustomColorPalette { // GetColorPaletteDarkOk returns a tuple with the ColorPaletteDark field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SettingsOut) GetColorPaletteDarkOk() (*CustomColorPalette, bool) { - if o == nil || o.ColorPaletteDark == nil { + if o == nil || IsNil(o.ColorPaletteDark) { return nil, false } return o.ColorPaletteDark, true @@ -99,7 +102,7 @@ func (o *SettingsOut) GetColorPaletteDarkOk() (*CustomColorPalette, bool) { // HasColorPaletteDark returns a boolean if a field has been set. func (o *SettingsOut) HasColorPaletteDark() bool { - if o != nil && o.ColorPaletteDark != nil { + if o != nil && !IsNil(o.ColorPaletteDark) { return true } @@ -113,7 +116,7 @@ func (o *SettingsOut) SetColorPaletteDark(v CustomColorPalette) { // GetColorPaletteLight returns the ColorPaletteLight field value if set, zero value otherwise. func (o *SettingsOut) GetColorPaletteLight() CustomColorPalette { - if o == nil || o.ColorPaletteLight == nil { + if o == nil || IsNil(o.ColorPaletteLight) { var ret CustomColorPalette return ret } @@ -123,7 +126,7 @@ func (o *SettingsOut) GetColorPaletteLight() CustomColorPalette { // GetColorPaletteLightOk returns a tuple with the ColorPaletteLight field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SettingsOut) GetColorPaletteLightOk() (*CustomColorPalette, bool) { - if o == nil || o.ColorPaletteLight == nil { + if o == nil || IsNil(o.ColorPaletteLight) { return nil, false } return o.ColorPaletteLight, true @@ -131,7 +134,7 @@ func (o *SettingsOut) GetColorPaletteLightOk() (*CustomColorPalette, bool) { // HasColorPaletteLight returns a boolean if a field has been set. func (o *SettingsOut) HasColorPaletteLight() bool { - if o != nil && o.ColorPaletteLight != nil { + if o != nil && !IsNil(o.ColorPaletteLight) { return true } @@ -145,7 +148,7 @@ func (o *SettingsOut) SetColorPaletteLight(v CustomColorPalette) { // GetCustomBaseFontSize returns the CustomBaseFontSize field value if set, zero value otherwise (both if not set or set to explicit null). func (o *SettingsOut) GetCustomBaseFontSize() int32 { - if o == nil || o.CustomBaseFontSize.Get() == nil { + if o == nil || IsNil(o.CustomBaseFontSize.Get()) { var ret int32 return ret } @@ -156,7 +159,7 @@ func (o *SettingsOut) GetCustomBaseFontSize() int32 { // 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) GetCustomBaseFontSizeOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return o.CustomBaseFontSize.Get(), o.CustomBaseFontSize.IsSet() @@ -187,7 +190,7 @@ func (o *SettingsOut) UnsetCustomBaseFontSize() { // GetCustomColor returns the CustomColor field value if set, zero value otherwise. func (o *SettingsOut) GetCustomColor() string { - if o == nil || o.CustomColor == nil { + if o == nil || IsNil(o.CustomColor) { var ret string return ret } @@ -197,7 +200,7 @@ func (o *SettingsOut) GetCustomColor() string { // GetCustomColorOk returns a tuple with the CustomColor field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SettingsOut) GetCustomColorOk() (*string, bool) { - if o == nil || o.CustomColor == nil { + if o == nil || IsNil(o.CustomColor) { return nil, false } return o.CustomColor, true @@ -205,7 +208,7 @@ func (o *SettingsOut) GetCustomColorOk() (*string, bool) { // HasCustomColor returns a boolean if a field has been set. func (o *SettingsOut) HasCustomColor() bool { - if o != nil && o.CustomColor != nil { + if o != nil && !IsNil(o.CustomColor) { return true } @@ -219,7 +222,7 @@ func (o *SettingsOut) SetCustomColor(v string) { // GetCustomFontFamily returns the CustomFontFamily field value if set, zero value otherwise (both if not set or set to explicit null). func (o *SettingsOut) GetCustomFontFamily() string { - if o == nil || o.CustomFontFamily.Get() == nil { + if o == nil || IsNil(o.CustomFontFamily.Get()) { var ret string return ret } @@ -230,7 +233,7 @@ func (o *SettingsOut) GetCustomFontFamily() string { // 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) GetCustomFontFamilyOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.CustomFontFamily.Get(), o.CustomFontFamily.IsSet() @@ -261,7 +264,7 @@ func (o *SettingsOut) UnsetCustomFontFamily() { // GetCustomFontFamilyUrl returns the CustomFontFamilyUrl field value if set, zero value otherwise (both if not set or set to explicit null). func (o *SettingsOut) GetCustomFontFamilyUrl() string { - if o == nil || o.CustomFontFamilyUrl.Get() == nil { + if o == nil || IsNil(o.CustomFontFamilyUrl.Get()) { var ret string return ret } @@ -272,7 +275,7 @@ func (o *SettingsOut) GetCustomFontFamilyUrl() string { // 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) GetCustomFontFamilyUrlOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.CustomFontFamilyUrl.Get(), o.CustomFontFamilyUrl.IsSet() @@ -303,7 +306,7 @@ func (o *SettingsOut) UnsetCustomFontFamilyUrl() { // GetCustomLogoUrl returns the CustomLogoUrl field value if set, zero value otherwise (both if not set or set to explicit null). func (o *SettingsOut) GetCustomLogoUrl() string { - if o == nil || o.CustomLogoUrl.Get() == nil { + if o == nil || IsNil(o.CustomLogoUrl.Get()) { var ret string return ret } @@ -314,7 +317,7 @@ func (o *SettingsOut) GetCustomLogoUrl() string { // 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) GetCustomLogoUrlOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.CustomLogoUrl.Get(), o.CustomLogoUrl.IsSet() @@ -345,7 +348,7 @@ func (o *SettingsOut) UnsetCustomLogoUrl() { // GetCustomThemeOverride returns the CustomThemeOverride field value if set, zero value otherwise. func (o *SettingsOut) GetCustomThemeOverride() CustomThemeOverride { - if o == nil || o.CustomThemeOverride == nil { + if o == nil || IsNil(o.CustomThemeOverride) { var ret CustomThemeOverride return ret } @@ -355,7 +358,7 @@ func (o *SettingsOut) GetCustomThemeOverride() CustomThemeOverride { // GetCustomThemeOverrideOk returns a tuple with the CustomThemeOverride field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SettingsOut) GetCustomThemeOverrideOk() (*CustomThemeOverride, bool) { - if o == nil || o.CustomThemeOverride == nil { + if o == nil || IsNil(o.CustomThemeOverride) { return nil, false } return o.CustomThemeOverride, true @@ -363,7 +366,7 @@ func (o *SettingsOut) GetCustomThemeOverrideOk() (*CustomThemeOverride, bool) { // HasCustomThemeOverride returns a boolean if a field has been set. func (o *SettingsOut) HasCustomThemeOverride() bool { - if o != nil && o.CustomThemeOverride != nil { + if o != nil && !IsNil(o.CustomThemeOverride) { return true } @@ -377,7 +380,7 @@ func (o *SettingsOut) SetCustomThemeOverride(v CustomThemeOverride) { // GetDisableEndpointOnFailure returns the DisableEndpointOnFailure field value if set, zero value otherwise. func (o *SettingsOut) GetDisableEndpointOnFailure() bool { - if o == nil || o.DisableEndpointOnFailure == nil { + if o == nil || IsNil(o.DisableEndpointOnFailure) { var ret bool return ret } @@ -387,7 +390,7 @@ func (o *SettingsOut) GetDisableEndpointOnFailure() bool { // GetDisableEndpointOnFailureOk returns a tuple with the DisableEndpointOnFailure field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SettingsOut) GetDisableEndpointOnFailureOk() (*bool, bool) { - if o == nil || o.DisableEndpointOnFailure == nil { + if o == nil || IsNil(o.DisableEndpointOnFailure) { return nil, false } return o.DisableEndpointOnFailure, true @@ -395,7 +398,7 @@ func (o *SettingsOut) GetDisableEndpointOnFailureOk() (*bool, bool) { // HasDisableEndpointOnFailure returns a boolean if a field has been set. func (o *SettingsOut) HasDisableEndpointOnFailure() bool { - if o != nil && o.DisableEndpointOnFailure != nil { + if o != nil && !IsNil(o.DisableEndpointOnFailure) { return true } @@ -409,7 +412,7 @@ func (o *SettingsOut) SetDisableEndpointOnFailure(v bool) { // GetDisplayName returns the DisplayName field value if set, zero value otherwise (both if not set or set to explicit null). func (o *SettingsOut) GetDisplayName() string { - if o == nil || o.DisplayName.Get() == nil { + if o == nil || IsNil(o.DisplayName.Get()) { var ret string return ret } @@ -420,7 +423,7 @@ func (o *SettingsOut) GetDisplayName() string { // 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) GetDisplayNameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.DisplayName.Get(), o.DisplayName.IsSet() @@ -451,7 +454,7 @@ func (o *SettingsOut) UnsetDisplayName() { // GetEnableChannels returns the EnableChannels field value if set, zero value otherwise. func (o *SettingsOut) GetEnableChannels() bool { - if o == nil || o.EnableChannels == nil { + if o == nil || IsNil(o.EnableChannels) { var ret bool return ret } @@ -461,7 +464,7 @@ func (o *SettingsOut) GetEnableChannels() bool { // GetEnableChannelsOk returns a tuple with the EnableChannels field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SettingsOut) GetEnableChannelsOk() (*bool, bool) { - if o == nil || o.EnableChannels == nil { + if o == nil || IsNil(o.EnableChannels) { return nil, false } return o.EnableChannels, true @@ -469,7 +472,7 @@ func (o *SettingsOut) GetEnableChannelsOk() (*bool, bool) { // HasEnableChannels returns a boolean if a field has been set. func (o *SettingsOut) HasEnableChannels() bool { - if o != nil && o.EnableChannels != nil { + if o != nil && !IsNil(o.EnableChannels) { return true } @@ -483,7 +486,7 @@ func (o *SettingsOut) SetEnableChannels(v bool) { // GetEnableIntegrationManagement returns the EnableIntegrationManagement field value if set, zero value otherwise. func (o *SettingsOut) GetEnableIntegrationManagement() bool { - if o == nil || o.EnableIntegrationManagement == nil { + if o == nil || IsNil(o.EnableIntegrationManagement) { var ret bool return ret } @@ -493,7 +496,7 @@ func (o *SettingsOut) GetEnableIntegrationManagement() bool { // GetEnableIntegrationManagementOk returns a tuple with the EnableIntegrationManagement field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SettingsOut) GetEnableIntegrationManagementOk() (*bool, bool) { - if o == nil || o.EnableIntegrationManagement == nil { + if o == nil || IsNil(o.EnableIntegrationManagement) { return nil, false } return o.EnableIntegrationManagement, true @@ -501,7 +504,7 @@ func (o *SettingsOut) GetEnableIntegrationManagementOk() (*bool, bool) { // HasEnableIntegrationManagement returns a boolean if a field has been set. func (o *SettingsOut) HasEnableIntegrationManagement() bool { - if o != nil && o.EnableIntegrationManagement != nil { + if o != nil && !IsNil(o.EnableIntegrationManagement) { return true } @@ -515,7 +518,7 @@ func (o *SettingsOut) SetEnableIntegrationManagement(v bool) { // GetEnableTransformations returns the EnableTransformations field value if set, zero value otherwise. func (o *SettingsOut) GetEnableTransformations() bool { - if o == nil || o.EnableTransformations == nil { + if o == nil || IsNil(o.EnableTransformations) { var ret bool return ret } @@ -525,7 +528,7 @@ func (o *SettingsOut) GetEnableTransformations() bool { // GetEnableTransformationsOk returns a tuple with the EnableTransformations field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SettingsOut) GetEnableTransformationsOk() (*bool, bool) { - if o == nil || o.EnableTransformations == nil { + if o == nil || IsNil(o.EnableTransformations) { return nil, false } return o.EnableTransformations, true @@ -533,7 +536,7 @@ func (o *SettingsOut) GetEnableTransformationsOk() (*bool, bool) { // HasEnableTransformations returns a boolean if a field has been set. func (o *SettingsOut) HasEnableTransformations() bool { - if o != nil && o.EnableTransformations != nil { + if o != nil && !IsNil(o.EnableTransformations) { return true } @@ -547,7 +550,7 @@ func (o *SettingsOut) SetEnableTransformations(v bool) { // GetEnforceHttps returns the EnforceHttps field value if set, zero value otherwise. func (o *SettingsOut) GetEnforceHttps() bool { - if o == nil || o.EnforceHttps == nil { + if o == nil || IsNil(o.EnforceHttps) { var ret bool return ret } @@ -557,7 +560,7 @@ func (o *SettingsOut) GetEnforceHttps() bool { // GetEnforceHttpsOk returns a tuple with the EnforceHttps field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SettingsOut) GetEnforceHttpsOk() (*bool, bool) { - if o == nil || o.EnforceHttps == nil { + if o == nil || IsNil(o.EnforceHttps) { return nil, false } return o.EnforceHttps, true @@ -565,7 +568,7 @@ func (o *SettingsOut) GetEnforceHttpsOk() (*bool, bool) { // HasEnforceHttps returns a boolean if a field has been set. func (o *SettingsOut) HasEnforceHttps() bool { - if o != nil && o.EnforceHttps != nil { + if o != nil && !IsNil(o.EnforceHttps) { return true } @@ -579,7 +582,7 @@ func (o *SettingsOut) SetEnforceHttps(v bool) { // GetEventCatalogPublished returns the EventCatalogPublished field value if set, zero value otherwise. func (o *SettingsOut) GetEventCatalogPublished() bool { - if o == nil || o.EventCatalogPublished == nil { + if o == nil || IsNil(o.EventCatalogPublished) { var ret bool return ret } @@ -589,7 +592,7 @@ func (o *SettingsOut) GetEventCatalogPublished() bool { // GetEventCatalogPublishedOk returns a tuple with the EventCatalogPublished field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SettingsOut) GetEventCatalogPublishedOk() (*bool, bool) { - if o == nil || o.EventCatalogPublished == nil { + if o == nil || IsNil(o.EventCatalogPublished) { return nil, false } return o.EventCatalogPublished, true @@ -597,7 +600,7 @@ func (o *SettingsOut) GetEventCatalogPublishedOk() (*bool, bool) { // HasEventCatalogPublished returns a boolean if a field has been set. func (o *SettingsOut) HasEventCatalogPublished() bool { - if o != nil && o.EventCatalogPublished != nil { + if o != nil && !IsNil(o.EventCatalogPublished) { return true } @@ -611,7 +614,7 @@ func (o *SettingsOut) SetEventCatalogPublished(v bool) { // GetReadOnly returns the ReadOnly field value if set, zero value otherwise. func (o *SettingsOut) GetReadOnly() bool { - if o == nil || o.ReadOnly == nil { + if o == nil || IsNil(o.ReadOnly) { var ret bool return ret } @@ -621,7 +624,7 @@ func (o *SettingsOut) GetReadOnly() bool { // GetReadOnlyOk returns a tuple with the ReadOnly field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SettingsOut) GetReadOnlyOk() (*bool, bool) { - if o == nil || o.ReadOnly == nil { + if o == nil || IsNil(o.ReadOnly) { return nil, false } return o.ReadOnly, true @@ -629,7 +632,7 @@ func (o *SettingsOut) GetReadOnlyOk() (*bool, bool) { // HasReadOnly returns a boolean if a field has been set. func (o *SettingsOut) HasReadOnly() bool { - if o != nil && o.ReadOnly != nil { + if o != nil && !IsNil(o.ReadOnly) { return true } @@ -642,17 +645,25 @@ func (o *SettingsOut) SetReadOnly(v bool) { } func (o SettingsOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SettingsOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.ColorPaletteDark != nil { + if !IsNil(o.ColorPaletteDark) { toSerialize["colorPaletteDark"] = o.ColorPaletteDark } - if o.ColorPaletteLight != nil { + if !IsNil(o.ColorPaletteLight) { toSerialize["colorPaletteLight"] = o.ColorPaletteLight } if o.CustomBaseFontSize.IsSet() { toSerialize["customBaseFontSize"] = o.CustomBaseFontSize.Get() } - if o.CustomColor != nil { + if !IsNil(o.CustomColor) { toSerialize["customColor"] = o.CustomColor } if o.CustomFontFamily.IsSet() { @@ -664,34 +675,34 @@ func (o SettingsOut) MarshalJSON() ([]byte, error) { if o.CustomLogoUrl.IsSet() { toSerialize["customLogoUrl"] = o.CustomLogoUrl.Get() } - if o.CustomThemeOverride != nil { + if !IsNil(o.CustomThemeOverride) { toSerialize["customThemeOverride"] = o.CustomThemeOverride } - if o.DisableEndpointOnFailure != nil { + if !IsNil(o.DisableEndpointOnFailure) { toSerialize["disableEndpointOnFailure"] = o.DisableEndpointOnFailure } if o.DisplayName.IsSet() { toSerialize["displayName"] = o.DisplayName.Get() } - if o.EnableChannels != nil { + if !IsNil(o.EnableChannels) { toSerialize["enableChannels"] = o.EnableChannels } - if o.EnableIntegrationManagement != nil { + if !IsNil(o.EnableIntegrationManagement) { toSerialize["enableIntegrationManagement"] = o.EnableIntegrationManagement } - if o.EnableTransformations != nil { + if !IsNil(o.EnableTransformations) { toSerialize["enableTransformations"] = o.EnableTransformations } - if o.EnforceHttps != nil { + if !IsNil(o.EnforceHttps) { toSerialize["enforceHttps"] = o.EnforceHttps } - if o.EventCatalogPublished != nil { + if !IsNil(o.EventCatalogPublished) { toSerialize["eventCatalogPublished"] = o.EventCatalogPublished } - if o.ReadOnly != nil { + if !IsNil(o.ReadOnly) { toSerialize["readOnly"] = o.ReadOnly } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableSettingsOut struct { diff --git a/go/internal/openapi/model_statistics_period.go b/go/internal/openapi/model_statistics_period.go index 789436c61..2a9404b81 100644 --- a/go/internal/openapi/model_statistics_period.go +++ b/go/internal/openapi/model_statistics_period.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -24,7 +24,8 @@ const ( STATISTICSPERIOD_FIVE_MINUTES StatisticsPeriod = "FiveMinutes" ) -var allowedStatisticsPeriodEnumValues = []StatisticsPeriod{ +// All allowed values of StatisticsPeriod enum +var AllowedStatisticsPeriodEnumValues = []StatisticsPeriod{ "OneDay", "FiveMinutes", } @@ -36,7 +37,7 @@ func (v *StatisticsPeriod) UnmarshalJSON(src []byte) error { return err } enumTypeValue := StatisticsPeriod(value) - for _, existing := range allowedStatisticsPeriodEnumValues { + for _, existing := range AllowedStatisticsPeriodEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -53,13 +54,13 @@ func NewStatisticsPeriodFromValue(v string) (*StatisticsPeriod, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for StatisticsPeriod: valid values are %v", v, allowedStatisticsPeriodEnumValues) + return nil, fmt.Errorf("invalid value '%v' for StatisticsPeriod: valid values are %v", v, AllowedStatisticsPeriodEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v StatisticsPeriod) IsValid() bool { - for _, existing := range allowedStatisticsPeriodEnumValues { + for _, existing := range AllowedStatisticsPeriodEnumValues { if existing == v { return true } diff --git a/go/internal/openapi/model_status_code_class.go b/go/internal/openapi/model_status_code_class.go index c0faf01c5..82189148e 100644 --- a/go/internal/openapi/model_status_code_class.go +++ b/go/internal/openapi/model_status_code_class.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -28,7 +28,8 @@ const ( STATUSCODECLASS_Code5xx StatusCodeClass = 500 ) -var allowedStatusCodeClassEnumValues = []StatusCodeClass{ +// All allowed values of StatusCodeClass enum +var AllowedStatusCodeClassEnumValues = []StatusCodeClass{ 0, 100, 200, @@ -44,7 +45,7 @@ func (v *StatusCodeClass) UnmarshalJSON(src []byte) error { return err } enumTypeValue := StatusCodeClass(value) - for _, existing := range allowedStatusCodeClassEnumValues { + for _, existing := range AllowedStatusCodeClassEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -61,13 +62,13 @@ func NewStatusCodeClassFromValue(v int32) (*StatusCodeClass, error) { if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for StatusCodeClass: valid values are %v", v, allowedStatusCodeClassEnumValues) + return nil, fmt.Errorf("invalid value '%v' for StatusCodeClass: valid values are %v", v, AllowedStatusCodeClassEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v StatusCodeClass) IsValid() bool { - for _, existing := range allowedStatusCodeClassEnumValues { + for _, existing := range AllowedStatusCodeClassEnumValues { if existing == v { return true } diff --git a/go/internal/openapi/model_template_in.go b/go/internal/openapi/model_template_in.go index a2005eae8..503e068ef 100644 --- a/go/internal/openapi/model_template_in.go +++ b/go/internal/openapi/model_template_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the TemplateIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TemplateIn{} + // TemplateIn struct for TemplateIn type TemplateIn struct { Description *string `json:"description,omitempty"` @@ -27,6 +32,8 @@ type TemplateIn struct { Transformation string `json:"transformation"` } +type _TemplateIn TemplateIn + // NewTemplateIn instantiates a new TemplateIn 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 @@ -37,8 +44,6 @@ func NewTemplateIn(logo string, name string, transformation string) *TemplateIn this.Description = &description var instructions string = "" this.Instructions = &instructions - var instructionsLink string = "null" - this.InstructionsLink = *NewNullableString(&instructionsLink) this.Logo = logo this.Name = name this.Transformation = transformation @@ -54,14 +59,12 @@ func NewTemplateInWithDefaults() *TemplateIn { this.Description = &description var instructions string = "" this.Instructions = &instructions - var instructionsLink string = "null" - this.InstructionsLink = *NewNullableString(&instructionsLink) return &this } // GetDescription returns the Description field value if set, zero value otherwise. func (o *TemplateIn) GetDescription() string { - if o == nil || o.Description == nil { + if o == nil || IsNil(o.Description) { var ret string return ret } @@ -71,7 +74,7 @@ func (o *TemplateIn) GetDescription() string { // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TemplateIn) GetDescriptionOk() (*string, bool) { - if o == nil || o.Description == nil { + if o == nil || IsNil(o.Description) { return nil, false } return o.Description, true @@ -79,7 +82,7 @@ func (o *TemplateIn) GetDescriptionOk() (*string, bool) { // HasDescription returns a boolean if a field has been set. func (o *TemplateIn) HasDescription() bool { - if o != nil && o.Description != nil { + if o != nil && !IsNil(o.Description) { return true } @@ -93,7 +96,7 @@ func (o *TemplateIn) SetDescription(v string) { // GetFeatureFlag returns the FeatureFlag field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TemplateIn) GetFeatureFlag() string { - if o == nil || o.FeatureFlag.Get() == nil { + if o == nil || IsNil(o.FeatureFlag.Get()) { var ret string return ret } @@ -104,7 +107,7 @@ func (o *TemplateIn) GetFeatureFlag() string { // 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 *TemplateIn) GetFeatureFlagOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.FeatureFlag.Get(), o.FeatureFlag.IsSet() @@ -135,7 +138,7 @@ func (o *TemplateIn) UnsetFeatureFlag() { // GetFilterTypes returns the FilterTypes field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TemplateIn) GetFilterTypes() []string { - if o == nil { + if o == nil { var ret []string return ret } @@ -145,16 +148,16 @@ func (o *TemplateIn) GetFilterTypes() []string { // GetFilterTypesOk returns a tuple with the FilterTypes field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *TemplateIn) GetFilterTypesOk() (*[]string, bool) { - if o == nil || o.FilterTypes == nil { +func (o *TemplateIn) GetFilterTypesOk() ([]string, bool) { + if o == nil || IsNil(o.FilterTypes) { return nil, false } - return &o.FilterTypes, true + return o.FilterTypes, true } // HasFilterTypes returns a boolean if a field has been set. func (o *TemplateIn) HasFilterTypes() bool { - if o != nil && o.FilterTypes != nil { + if o != nil && IsNil(o.FilterTypes) { return true } @@ -168,7 +171,7 @@ func (o *TemplateIn) SetFilterTypes(v []string) { // GetInstructions returns the Instructions field value if set, zero value otherwise. func (o *TemplateIn) GetInstructions() string { - if o == nil || o.Instructions == nil { + if o == nil || IsNil(o.Instructions) { var ret string return ret } @@ -178,7 +181,7 @@ func (o *TemplateIn) GetInstructions() string { // GetInstructionsOk returns a tuple with the Instructions field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TemplateIn) GetInstructionsOk() (*string, bool) { - if o == nil || o.Instructions == nil { + if o == nil || IsNil(o.Instructions) { return nil, false } return o.Instructions, true @@ -186,7 +189,7 @@ func (o *TemplateIn) GetInstructionsOk() (*string, bool) { // HasInstructions returns a boolean if a field has been set. func (o *TemplateIn) HasInstructions() bool { - if o != nil && o.Instructions != nil { + if o != nil && !IsNil(o.Instructions) { return true } @@ -200,7 +203,7 @@ func (o *TemplateIn) SetInstructions(v string) { // GetInstructionsLink returns the InstructionsLink field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TemplateIn) GetInstructionsLink() string { - if o == nil || o.InstructionsLink.Get() == nil { + if o == nil || IsNil(o.InstructionsLink.Get()) { var ret string return ret } @@ -211,7 +214,7 @@ func (o *TemplateIn) GetInstructionsLink() string { // 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 *TemplateIn) GetInstructionsLinkOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.InstructionsLink.Get(), o.InstructionsLink.IsSet() @@ -242,7 +245,7 @@ func (o *TemplateIn) UnsetInstructionsLink() { // GetKind returns the Kind field value if set, zero value otherwise. func (o *TemplateIn) GetKind() TransformationTemplateKind { - if o == nil || o.Kind == nil { + if o == nil || IsNil(o.Kind) { var ret TransformationTemplateKind return ret } @@ -252,7 +255,7 @@ func (o *TemplateIn) GetKind() TransformationTemplateKind { // GetKindOk returns a tuple with the Kind field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TemplateIn) GetKindOk() (*TransformationTemplateKind, bool) { - if o == nil || o.Kind == nil { + if o == nil || IsNil(o.Kind) { return nil, false } return o.Kind, true @@ -260,7 +263,7 @@ func (o *TemplateIn) GetKindOk() (*TransformationTemplateKind, bool) { // HasKind returns a boolean if a field has been set. func (o *TemplateIn) HasKind() bool { - if o != nil && o.Kind != nil { + if o != nil && !IsNil(o.Kind) { return true } @@ -285,7 +288,7 @@ func (o *TemplateIn) GetLogo() string { // GetLogoOk returns a tuple with the Logo field value // and a boolean to check if the value has been set. func (o *TemplateIn) GetLogoOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Logo, true @@ -309,7 +312,7 @@ func (o *TemplateIn) GetName() string { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *TemplateIn) GetNameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Name, true @@ -333,7 +336,7 @@ func (o *TemplateIn) GetTransformation() string { // GetTransformationOk returns a tuple with the Transformation field value // and a boolean to check if the value has been set. func (o *TemplateIn) GetTransformationOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Transformation, true @@ -345,8 +348,16 @@ func (o *TemplateIn) SetTransformation(v string) { } func (o TemplateIn) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TemplateIn) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Description != nil { + if !IsNil(o.Description) { toSerialize["description"] = o.Description } if o.FeatureFlag.IsSet() { @@ -355,25 +366,58 @@ func (o TemplateIn) MarshalJSON() ([]byte, error) { if o.FilterTypes != nil { toSerialize["filterTypes"] = o.FilterTypes } - if o.Instructions != nil { + if !IsNil(o.Instructions) { toSerialize["instructions"] = o.Instructions } if o.InstructionsLink.IsSet() { toSerialize["instructionsLink"] = o.InstructionsLink.Get() } - if o.Kind != nil { + if !IsNil(o.Kind) { toSerialize["kind"] = o.Kind } - if true { - toSerialize["logo"] = o.Logo + toSerialize["logo"] = o.Logo + toSerialize["name"] = o.Name + toSerialize["transformation"] = o.Transformation + return toSerialize, nil +} + +func (o *TemplateIn) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "logo", + "name", + "transformation", } - if true { - toSerialize["name"] = o.Name + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["transformation"] = o.Transformation + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varTemplateIn := _TemplateIn{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varTemplateIn) + + if err != nil { + return err + } + + *o = TemplateIn(varTemplateIn) + + return err } type NullableTemplateIn struct { diff --git a/go/internal/openapi/model_template_out.go b/go/internal/openapi/model_template_out.go index 500943115..3b446a458 100644 --- a/go/internal/openapi/model_template_out.go +++ b/go/internal/openapi/model_template_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -13,8 +13,13 @@ package openapi import ( "encoding/json" "time" + "bytes" + "fmt" ) +// checks if the TemplateOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TemplateOut{} + // TemplateOut struct for TemplateOut type TemplateOut struct { CreatedAt time.Time `json:"createdAt"` @@ -32,6 +37,8 @@ type TemplateOut struct { UpdatedAt time.Time `json:"updatedAt"` } +type _TemplateOut TemplateOut + // NewTemplateOut instantiates a new TemplateOut 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 @@ -72,7 +79,7 @@ func (o *TemplateOut) GetCreatedAt() time.Time { // GetCreatedAtOk returns a tuple with the CreatedAt field value // and a boolean to check if the value has been set. func (o *TemplateOut) GetCreatedAtOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.CreatedAt, true @@ -96,7 +103,7 @@ func (o *TemplateOut) GetDescription() string { // GetDescriptionOk returns a tuple with the Description field value // and a boolean to check if the value has been set. func (o *TemplateOut) GetDescriptionOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Description, true @@ -109,7 +116,7 @@ func (o *TemplateOut) SetDescription(v string) { // GetFeatureFlag returns the FeatureFlag field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TemplateOut) GetFeatureFlag() string { - if o == nil || o.FeatureFlag.Get() == nil { + if o == nil || IsNil(o.FeatureFlag.Get()) { var ret string return ret } @@ -120,7 +127,7 @@ func (o *TemplateOut) GetFeatureFlag() string { // 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 *TemplateOut) GetFeatureFlagOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.FeatureFlag.Get(), o.FeatureFlag.IsSet() @@ -151,7 +158,7 @@ func (o *TemplateOut) UnsetFeatureFlag() { // GetFilterTypes returns the FilterTypes field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TemplateOut) GetFilterTypes() []string { - if o == nil { + if o == nil { var ret []string return ret } @@ -161,16 +168,16 @@ func (o *TemplateOut) GetFilterTypes() []string { // GetFilterTypesOk returns a tuple with the FilterTypes field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *TemplateOut) GetFilterTypesOk() (*[]string, bool) { - if o == nil || o.FilterTypes == nil { +func (o *TemplateOut) GetFilterTypesOk() ([]string, bool) { + if o == nil || IsNil(o.FilterTypes) { return nil, false } - return &o.FilterTypes, true + return o.FilterTypes, true } // HasFilterTypes returns a boolean if a field has been set. func (o *TemplateOut) HasFilterTypes() bool { - if o != nil && o.FilterTypes != nil { + if o != nil && IsNil(o.FilterTypes) { return true } @@ -195,7 +202,7 @@ func (o *TemplateOut) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *TemplateOut) GetIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Id, true @@ -219,7 +226,7 @@ func (o *TemplateOut) GetInstructions() string { // GetInstructionsOk returns a tuple with the Instructions field value // and a boolean to check if the value has been set. func (o *TemplateOut) GetInstructionsOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Instructions, true @@ -232,7 +239,7 @@ func (o *TemplateOut) SetInstructions(v string) { // GetInstructionsLink returns the InstructionsLink field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TemplateOut) GetInstructionsLink() string { - if o == nil || o.InstructionsLink.Get() == nil { + if o == nil || IsNil(o.InstructionsLink.Get()) { var ret string return ret } @@ -243,7 +250,7 @@ func (o *TemplateOut) GetInstructionsLink() string { // 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 *TemplateOut) GetInstructionsLinkOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.InstructionsLink.Get(), o.InstructionsLink.IsSet() @@ -285,7 +292,7 @@ func (o *TemplateOut) GetKind() TransformationTemplateKind { // GetKindOk returns a tuple with the Kind field value // and a boolean to check if the value has been set. func (o *TemplateOut) GetKindOk() (*TransformationTemplateKind, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Kind, true @@ -309,7 +316,7 @@ func (o *TemplateOut) GetLogo() string { // GetLogoOk returns a tuple with the Logo field value // and a boolean to check if the value has been set. func (o *TemplateOut) GetLogoOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Logo, true @@ -333,7 +340,7 @@ func (o *TemplateOut) GetName() string { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *TemplateOut) GetNameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Name, true @@ -357,7 +364,7 @@ func (o *TemplateOut) GetOrgId() string { // GetOrgIdOk returns a tuple with the OrgId field value // and a boolean to check if the value has been set. func (o *TemplateOut) GetOrgIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.OrgId, true @@ -381,7 +388,7 @@ func (o *TemplateOut) GetTransformation() string { // GetTransformationOk returns a tuple with the Transformation field value // and a boolean to check if the value has been set. func (o *TemplateOut) GetTransformationOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Transformation, true @@ -405,7 +412,7 @@ func (o *TemplateOut) GetUpdatedAt() time.Time { // GetUpdatedAtOk returns a tuple with the UpdatedAt field value // and a boolean to check if the value has been set. func (o *TemplateOut) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return &o.UpdatedAt, true @@ -417,47 +424,81 @@ func (o *TemplateOut) SetUpdatedAt(v time.Time) { } func (o TemplateOut) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["createdAt"] = o.CreatedAt - } - if true { - toSerialize["description"] = o.Description + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o TemplateOut) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["createdAt"] = o.CreatedAt + toSerialize["description"] = o.Description if o.FeatureFlag.IsSet() { toSerialize["featureFlag"] = o.FeatureFlag.Get() } if o.FilterTypes != nil { toSerialize["filterTypes"] = o.FilterTypes } - if true { - toSerialize["id"] = o.Id - } - if true { - toSerialize["instructions"] = o.Instructions - } + toSerialize["id"] = o.Id + toSerialize["instructions"] = o.Instructions if o.InstructionsLink.IsSet() { toSerialize["instructionsLink"] = o.InstructionsLink.Get() } - if true { - toSerialize["kind"] = o.Kind - } - if true { - toSerialize["logo"] = o.Logo - } - if true { - toSerialize["name"] = o.Name + toSerialize["kind"] = o.Kind + toSerialize["logo"] = o.Logo + toSerialize["name"] = o.Name + toSerialize["orgId"] = o.OrgId + toSerialize["transformation"] = o.Transformation + toSerialize["updatedAt"] = o.UpdatedAt + return toSerialize, nil +} + +func (o *TemplateOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "createdAt", + "description", + "id", + "instructions", + "kind", + "logo", + "name", + "orgId", + "transformation", + "updatedAt", } - if true { - toSerialize["orgId"] = o.OrgId + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["transformation"] = o.Transformation + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - if true { - toSerialize["updatedAt"] = o.UpdatedAt + + varTemplateOut := _TemplateOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varTemplateOut) + + if err != nil { + return err } - return json.Marshal(toSerialize) + + *o = TemplateOut(varTemplateOut) + + return err } type NullableTemplateOut struct { diff --git a/go/internal/openapi/model_template_patch.go b/go/internal/openapi/model_template_patch.go index 871e977fa..9663747af 100644 --- a/go/internal/openapi/model_template_patch.go +++ b/go/internal/openapi/model_template_patch.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -14,6 +14,9 @@ import ( "encoding/json" ) +// checks if the TemplatePatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TemplatePatch{} + // TemplatePatch struct for TemplatePatch type TemplatePatch struct { Description *string `json:"description,omitempty"` @@ -46,7 +49,7 @@ func NewTemplatePatchWithDefaults() *TemplatePatch { // GetDescription returns the Description field value if set, zero value otherwise. func (o *TemplatePatch) GetDescription() string { - if o == nil || o.Description == nil { + if o == nil || IsNil(o.Description) { var ret string return ret } @@ -56,7 +59,7 @@ func (o *TemplatePatch) GetDescription() string { // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TemplatePatch) GetDescriptionOk() (*string, bool) { - if o == nil || o.Description == nil { + if o == nil || IsNil(o.Description) { return nil, false } return o.Description, true @@ -64,7 +67,7 @@ func (o *TemplatePatch) GetDescriptionOk() (*string, bool) { // HasDescription returns a boolean if a field has been set. func (o *TemplatePatch) HasDescription() bool { - if o != nil && o.Description != nil { + if o != nil && !IsNil(o.Description) { return true } @@ -78,7 +81,7 @@ func (o *TemplatePatch) SetDescription(v string) { // GetFeatureFlag returns the FeatureFlag field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TemplatePatch) GetFeatureFlag() string { - if o == nil || o.FeatureFlag.Get() == nil { + if o == nil || IsNil(o.FeatureFlag.Get()) { var ret string return ret } @@ -89,7 +92,7 @@ func (o *TemplatePatch) GetFeatureFlag() string { // 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 *TemplatePatch) GetFeatureFlagOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.FeatureFlag.Get(), o.FeatureFlag.IsSet() @@ -120,7 +123,7 @@ func (o *TemplatePatch) UnsetFeatureFlag() { // GetFilterTypes returns the FilterTypes field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TemplatePatch) GetFilterTypes() []string { - if o == nil { + if o == nil { var ret []string return ret } @@ -130,16 +133,16 @@ func (o *TemplatePatch) GetFilterTypes() []string { // GetFilterTypesOk returns a tuple with the FilterTypes field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *TemplatePatch) GetFilterTypesOk() (*[]string, bool) { - if o == nil || o.FilterTypes == nil { +func (o *TemplatePatch) GetFilterTypesOk() ([]string, bool) { + if o == nil || IsNil(o.FilterTypes) { return nil, false } - return &o.FilterTypes, true + return o.FilterTypes, true } // HasFilterTypes returns a boolean if a field has been set. func (o *TemplatePatch) HasFilterTypes() bool { - if o != nil && o.FilterTypes != nil { + if o != nil && IsNil(o.FilterTypes) { return true } @@ -153,7 +156,7 @@ func (o *TemplatePatch) SetFilterTypes(v []string) { // GetInstructions returns the Instructions field value if set, zero value otherwise. func (o *TemplatePatch) GetInstructions() string { - if o == nil || o.Instructions == nil { + if o == nil || IsNil(o.Instructions) { var ret string return ret } @@ -163,7 +166,7 @@ func (o *TemplatePatch) GetInstructions() string { // GetInstructionsOk returns a tuple with the Instructions field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TemplatePatch) GetInstructionsOk() (*string, bool) { - if o == nil || o.Instructions == nil { + if o == nil || IsNil(o.Instructions) { return nil, false } return o.Instructions, true @@ -171,7 +174,7 @@ func (o *TemplatePatch) GetInstructionsOk() (*string, bool) { // HasInstructions returns a boolean if a field has been set. func (o *TemplatePatch) HasInstructions() bool { - if o != nil && o.Instructions != nil { + if o != nil && !IsNil(o.Instructions) { return true } @@ -185,7 +188,7 @@ func (o *TemplatePatch) SetInstructions(v string) { // GetInstructionsLink returns the InstructionsLink field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TemplatePatch) GetInstructionsLink() string { - if o == nil || o.InstructionsLink.Get() == nil { + if o == nil || IsNil(o.InstructionsLink.Get()) { var ret string return ret } @@ -196,7 +199,7 @@ func (o *TemplatePatch) GetInstructionsLink() string { // 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 *TemplatePatch) GetInstructionsLinkOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.InstructionsLink.Get(), o.InstructionsLink.IsSet() @@ -227,7 +230,7 @@ func (o *TemplatePatch) UnsetInstructionsLink() { // GetKind returns the Kind field value if set, zero value otherwise. func (o *TemplatePatch) GetKind() TransformationTemplateKind { - if o == nil || o.Kind == nil { + if o == nil || IsNil(o.Kind) { var ret TransformationTemplateKind return ret } @@ -237,7 +240,7 @@ func (o *TemplatePatch) GetKind() TransformationTemplateKind { // GetKindOk returns a tuple with the Kind field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TemplatePatch) GetKindOk() (*TransformationTemplateKind, bool) { - if o == nil || o.Kind == nil { + if o == nil || IsNil(o.Kind) { return nil, false } return o.Kind, true @@ -245,7 +248,7 @@ func (o *TemplatePatch) GetKindOk() (*TransformationTemplateKind, bool) { // HasKind returns a boolean if a field has been set. func (o *TemplatePatch) HasKind() bool { - if o != nil && o.Kind != nil { + if o != nil && !IsNil(o.Kind) { return true } @@ -259,7 +262,7 @@ func (o *TemplatePatch) SetKind(v TransformationTemplateKind) { // GetLogo returns the Logo field value if set, zero value otherwise. func (o *TemplatePatch) GetLogo() string { - if o == nil || o.Logo == nil { + if o == nil || IsNil(o.Logo) { var ret string return ret } @@ -269,7 +272,7 @@ func (o *TemplatePatch) GetLogo() string { // GetLogoOk returns a tuple with the Logo field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TemplatePatch) GetLogoOk() (*string, bool) { - if o == nil || o.Logo == nil { + if o == nil || IsNil(o.Logo) { return nil, false } return o.Logo, true @@ -277,7 +280,7 @@ func (o *TemplatePatch) GetLogoOk() (*string, bool) { // HasLogo returns a boolean if a field has been set. func (o *TemplatePatch) HasLogo() bool { - if o != nil && o.Logo != nil { + if o != nil && !IsNil(o.Logo) { return true } @@ -291,7 +294,7 @@ func (o *TemplatePatch) SetLogo(v string) { // GetName returns the Name field value if set, zero value otherwise. func (o *TemplatePatch) GetName() string { - if o == nil || o.Name == nil { + if o == nil || IsNil(o.Name) { var ret string return ret } @@ -301,7 +304,7 @@ func (o *TemplatePatch) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TemplatePatch) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { + if o == nil || IsNil(o.Name) { return nil, false } return o.Name, true @@ -309,7 +312,7 @@ func (o *TemplatePatch) GetNameOk() (*string, bool) { // HasName returns a boolean if a field has been set. func (o *TemplatePatch) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !IsNil(o.Name) { return true } @@ -323,7 +326,7 @@ func (o *TemplatePatch) SetName(v string) { // GetTransformation returns the Transformation field value if set, zero value otherwise. func (o *TemplatePatch) GetTransformation() string { - if o == nil || o.Transformation == nil { + if o == nil || IsNil(o.Transformation) { var ret string return ret } @@ -333,7 +336,7 @@ func (o *TemplatePatch) GetTransformation() string { // GetTransformationOk returns a tuple with the Transformation field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TemplatePatch) GetTransformationOk() (*string, bool) { - if o == nil || o.Transformation == nil { + if o == nil || IsNil(o.Transformation) { return nil, false } return o.Transformation, true @@ -341,7 +344,7 @@ func (o *TemplatePatch) GetTransformationOk() (*string, bool) { // HasTransformation returns a boolean if a field has been set. func (o *TemplatePatch) HasTransformation() bool { - if o != nil && o.Transformation != nil { + if o != nil && !IsNil(o.Transformation) { return true } @@ -354,8 +357,16 @@ func (o *TemplatePatch) SetTransformation(v string) { } func (o TemplatePatch) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TemplatePatch) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Description != nil { + if !IsNil(o.Description) { toSerialize["description"] = o.Description } if o.FeatureFlag.IsSet() { @@ -364,25 +375,25 @@ func (o TemplatePatch) MarshalJSON() ([]byte, error) { if o.FilterTypes != nil { toSerialize["filterTypes"] = o.FilterTypes } - if o.Instructions != nil { + if !IsNil(o.Instructions) { toSerialize["instructions"] = o.Instructions } if o.InstructionsLink.IsSet() { toSerialize["instructionsLink"] = o.InstructionsLink.Get() } - if o.Kind != nil { + if !IsNil(o.Kind) { toSerialize["kind"] = o.Kind } - if o.Logo != nil { + if !IsNil(o.Logo) { toSerialize["logo"] = o.Logo } - if o.Name != nil { + if !IsNil(o.Name) { toSerialize["name"] = o.Name } - if o.Transformation != nil { + if !IsNil(o.Transformation) { toSerialize["transformation"] = o.Transformation } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableTemplatePatch struct { diff --git a/go/internal/openapi/model_template_update.go b/go/internal/openapi/model_template_update.go index 3d45c67f9..1b90cb9a6 100644 --- a/go/internal/openapi/model_template_update.go +++ b/go/internal/openapi/model_template_update.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the TemplateUpdate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TemplateUpdate{} + // TemplateUpdate struct for TemplateUpdate type TemplateUpdate struct { Description *string `json:"description,omitempty"` @@ -27,6 +32,8 @@ type TemplateUpdate struct { Transformation string `json:"transformation"` } +type _TemplateUpdate TemplateUpdate + // NewTemplateUpdate instantiates a new TemplateUpdate 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 @@ -60,7 +67,7 @@ func NewTemplateUpdateWithDefaults() *TemplateUpdate { // GetDescription returns the Description field value if set, zero value otherwise. func (o *TemplateUpdate) GetDescription() string { - if o == nil || o.Description == nil { + if o == nil || IsNil(o.Description) { var ret string return ret } @@ -70,7 +77,7 @@ func (o *TemplateUpdate) GetDescription() string { // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TemplateUpdate) GetDescriptionOk() (*string, bool) { - if o == nil || o.Description == nil { + if o == nil || IsNil(o.Description) { return nil, false } return o.Description, true @@ -78,7 +85,7 @@ func (o *TemplateUpdate) GetDescriptionOk() (*string, bool) { // HasDescription returns a boolean if a field has been set. func (o *TemplateUpdate) HasDescription() bool { - if o != nil && o.Description != nil { + if o != nil && !IsNil(o.Description) { return true } @@ -92,7 +99,7 @@ func (o *TemplateUpdate) SetDescription(v string) { // GetFeatureFlag returns the FeatureFlag field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TemplateUpdate) GetFeatureFlag() string { - if o == nil || o.FeatureFlag.Get() == nil { + if o == nil || IsNil(o.FeatureFlag.Get()) { var ret string return ret } @@ -103,7 +110,7 @@ func (o *TemplateUpdate) GetFeatureFlag() string { // 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 *TemplateUpdate) GetFeatureFlagOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.FeatureFlag.Get(), o.FeatureFlag.IsSet() @@ -134,7 +141,7 @@ func (o *TemplateUpdate) UnsetFeatureFlag() { // GetFilterTypes returns the FilterTypes field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TemplateUpdate) GetFilterTypes() []string { - if o == nil { + if o == nil { var ret []string return ret } @@ -144,16 +151,16 @@ func (o *TemplateUpdate) GetFilterTypes() []string { // GetFilterTypesOk returns a tuple with the FilterTypes field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *TemplateUpdate) GetFilterTypesOk() (*[]string, bool) { - if o == nil || o.FilterTypes == nil { +func (o *TemplateUpdate) GetFilterTypesOk() ([]string, bool) { + if o == nil || IsNil(o.FilterTypes) { return nil, false } - return &o.FilterTypes, true + return o.FilterTypes, true } // HasFilterTypes returns a boolean if a field has been set. func (o *TemplateUpdate) HasFilterTypes() bool { - if o != nil && o.FilterTypes != nil { + if o != nil && IsNil(o.FilterTypes) { return true } @@ -167,7 +174,7 @@ func (o *TemplateUpdate) SetFilterTypes(v []string) { // GetInstructions returns the Instructions field value if set, zero value otherwise. func (o *TemplateUpdate) GetInstructions() string { - if o == nil || o.Instructions == nil { + if o == nil || IsNil(o.Instructions) { var ret string return ret } @@ -177,7 +184,7 @@ func (o *TemplateUpdate) GetInstructions() string { // GetInstructionsOk returns a tuple with the Instructions field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TemplateUpdate) GetInstructionsOk() (*string, bool) { - if o == nil || o.Instructions == nil { + if o == nil || IsNil(o.Instructions) { return nil, false } return o.Instructions, true @@ -185,7 +192,7 @@ func (o *TemplateUpdate) GetInstructionsOk() (*string, bool) { // HasInstructions returns a boolean if a field has been set. func (o *TemplateUpdate) HasInstructions() bool { - if o != nil && o.Instructions != nil { + if o != nil && !IsNil(o.Instructions) { return true } @@ -199,7 +206,7 @@ func (o *TemplateUpdate) SetInstructions(v string) { // GetInstructionsLink returns the InstructionsLink field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TemplateUpdate) GetInstructionsLink() string { - if o == nil || o.InstructionsLink.Get() == nil { + if o == nil || IsNil(o.InstructionsLink.Get()) { var ret string return ret } @@ -210,7 +217,7 @@ func (o *TemplateUpdate) GetInstructionsLink() string { // 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 *TemplateUpdate) GetInstructionsLinkOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.InstructionsLink.Get(), o.InstructionsLink.IsSet() @@ -241,7 +248,7 @@ func (o *TemplateUpdate) UnsetInstructionsLink() { // GetKind returns the Kind field value if set, zero value otherwise. func (o *TemplateUpdate) GetKind() TransformationTemplateKind { - if o == nil || o.Kind == nil { + if o == nil || IsNil(o.Kind) { var ret TransformationTemplateKind return ret } @@ -251,7 +258,7 @@ func (o *TemplateUpdate) GetKind() TransformationTemplateKind { // GetKindOk returns a tuple with the Kind field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TemplateUpdate) GetKindOk() (*TransformationTemplateKind, bool) { - if o == nil || o.Kind == nil { + if o == nil || IsNil(o.Kind) { return nil, false } return o.Kind, true @@ -259,7 +266,7 @@ func (o *TemplateUpdate) GetKindOk() (*TransformationTemplateKind, bool) { // HasKind returns a boolean if a field has been set. func (o *TemplateUpdate) HasKind() bool { - if o != nil && o.Kind != nil { + if o != nil && !IsNil(o.Kind) { return true } @@ -284,7 +291,7 @@ func (o *TemplateUpdate) GetLogo() string { // GetLogoOk returns a tuple with the Logo field value // and a boolean to check if the value has been set. func (o *TemplateUpdate) GetLogoOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Logo, true @@ -297,7 +304,7 @@ func (o *TemplateUpdate) SetLogo(v string) { // GetName returns the Name field value if set, zero value otherwise. func (o *TemplateUpdate) GetName() string { - if o == nil || o.Name == nil { + if o == nil || IsNil(o.Name) { var ret string return ret } @@ -307,7 +314,7 @@ func (o *TemplateUpdate) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TemplateUpdate) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { + if o == nil || IsNil(o.Name) { return nil, false } return o.Name, true @@ -315,7 +322,7 @@ func (o *TemplateUpdate) GetNameOk() (*string, bool) { // HasName returns a boolean if a field has been set. func (o *TemplateUpdate) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !IsNil(o.Name) { return true } @@ -340,7 +347,7 @@ func (o *TemplateUpdate) GetTransformation() string { // GetTransformationOk returns a tuple with the Transformation field value // and a boolean to check if the value has been set. func (o *TemplateUpdate) GetTransformationOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Transformation, true @@ -352,8 +359,16 @@ func (o *TemplateUpdate) SetTransformation(v string) { } func (o TemplateUpdate) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TemplateUpdate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Description != nil { + if !IsNil(o.Description) { toSerialize["description"] = o.Description } if o.FeatureFlag.IsSet() { @@ -362,25 +377,59 @@ func (o TemplateUpdate) MarshalJSON() ([]byte, error) { if o.FilterTypes != nil { toSerialize["filterTypes"] = o.FilterTypes } - if o.Instructions != nil { + if !IsNil(o.Instructions) { toSerialize["instructions"] = o.Instructions } if o.InstructionsLink.IsSet() { toSerialize["instructionsLink"] = o.InstructionsLink.Get() } - if o.Kind != nil { + if !IsNil(o.Kind) { toSerialize["kind"] = o.Kind } - if true { - toSerialize["logo"] = o.Logo - } - if o.Name != nil { + toSerialize["logo"] = o.Logo + if !IsNil(o.Name) { toSerialize["name"] = o.Name } - if true { - toSerialize["transformation"] = o.Transformation + toSerialize["transformation"] = o.Transformation + return toSerialize, nil +} + +func (o *TemplateUpdate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "logo", + "transformation", } - return json.Marshal(toSerialize) + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTemplateUpdate := _TemplateUpdate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varTemplateUpdate) + + if err != nil { + return err + } + + *o = TemplateUpdate(varTemplateUpdate) + + return err } type NullableTemplateUpdate struct { diff --git a/go/internal/openapi/model_transformation_http_method.go b/go/internal/openapi/model_transformation_http_method.go index cca0df6e0..89bc0c128 100644 --- a/go/internal/openapi/model_transformation_http_method.go +++ b/go/internal/openapi/model_transformation_http_method.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -24,7 +24,8 @@ const ( TRANSFORMATIONHTTPMETHOD_PUT TransformationHttpMethod = "PUT" ) -var allowedTransformationHttpMethodEnumValues = []TransformationHttpMethod{ +// All allowed values of TransformationHttpMethod enum +var AllowedTransformationHttpMethodEnumValues = []TransformationHttpMethod{ "POST", "PUT", } @@ -36,7 +37,7 @@ func (v *TransformationHttpMethod) UnmarshalJSON(src []byte) error { return err } enumTypeValue := TransformationHttpMethod(value) - for _, existing := range allowedTransformationHttpMethodEnumValues { + for _, existing := range AllowedTransformationHttpMethodEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -53,13 +54,13 @@ func NewTransformationHttpMethodFromValue(v string) (*TransformationHttpMethod, if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for TransformationHttpMethod: valid values are %v", v, allowedTransformationHttpMethodEnumValues) + return nil, fmt.Errorf("invalid value '%v' for TransformationHttpMethod: valid values are %v", v, AllowedTransformationHttpMethodEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v TransformationHttpMethod) IsValid() bool { - for _, existing := range allowedTransformationHttpMethodEnumValues { + for _, existing := range AllowedTransformationHttpMethodEnumValues { if existing == v { return true } diff --git a/go/internal/openapi/model_transformation_simulate_in.go b/go/internal/openapi/model_transformation_simulate_in.go index 2708438c6..4c67871c1 100644 --- a/go/internal/openapi/model_transformation_simulate_in.go +++ b/go/internal/openapi/model_transformation_simulate_in.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the TransformationSimulateIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransformationSimulateIn{} + // TransformationSimulateIn struct for TransformationSimulateIn type TransformationSimulateIn struct { Channels []string `json:"channels,omitempty"` @@ -23,6 +28,8 @@ type TransformationSimulateIn struct { Payload map[string]interface{} `json:"payload"` } +type _TransformationSimulateIn TransformationSimulateIn + // NewTransformationSimulateIn instantiates a new TransformationSimulateIn 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 @@ -45,7 +52,7 @@ func NewTransformationSimulateInWithDefaults() *TransformationSimulateIn { // GetChannels returns the Channels field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TransformationSimulateIn) GetChannels() []string { - if o == nil { + if o == nil { var ret []string return ret } @@ -55,16 +62,16 @@ func (o *TransformationSimulateIn) GetChannels() []string { // GetChannelsOk returns a tuple with the Channels 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 *TransformationSimulateIn) GetChannelsOk() (*[]string, bool) { - if o == nil || o.Channels == nil { +func (o *TransformationSimulateIn) GetChannelsOk() ([]string, bool) { + if o == nil || IsNil(o.Channels) { return nil, false } - return &o.Channels, true + return o.Channels, true } // HasChannels returns a boolean if a field has been set. func (o *TransformationSimulateIn) HasChannels() bool { - if o != nil && o.Channels != nil { + if o != nil && IsNil(o.Channels) { return true } @@ -89,7 +96,7 @@ func (o *TransformationSimulateIn) GetCode() string { // GetCodeOk returns a tuple with the Code field value // and a boolean to check if the value has been set. func (o *TransformationSimulateIn) GetCodeOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Code, true @@ -113,7 +120,7 @@ func (o *TransformationSimulateIn) GetEventType() string { // GetEventTypeOk returns a tuple with the EventType field value // and a boolean to check if the value has been set. func (o *TransformationSimulateIn) GetEventTypeOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.EventType, true @@ -136,11 +143,11 @@ func (o *TransformationSimulateIn) GetPayload() map[string]interface{} { // GetPayloadOk returns a tuple with the Payload field value // and a boolean to check if the value has been set. -func (o *TransformationSimulateIn) GetPayloadOk() (*map[string]interface{}, bool) { - if o == nil { - return nil, false +func (o *TransformationSimulateIn) GetPayloadOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false } - return &o.Payload, true + return o.Payload, true } // SetPayload sets field value @@ -149,20 +156,61 @@ func (o *TransformationSimulateIn) SetPayload(v map[string]interface{}) { } func (o TransformationSimulateIn) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransformationSimulateIn) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if o.Channels != nil { toSerialize["channels"] = o.Channels } - if true { - toSerialize["code"] = o.Code + toSerialize["code"] = o.Code + toSerialize["eventType"] = o.EventType + toSerialize["payload"] = o.Payload + return toSerialize, nil +} + +func (o *TransformationSimulateIn) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "code", + "eventType", + "payload", } - if true { - toSerialize["eventType"] = o.EventType + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["payload"] = o.Payload + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varTransformationSimulateIn := _TransformationSimulateIn{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varTransformationSimulateIn) + + if err != nil { + return err + } + + *o = TransformationSimulateIn(varTransformationSimulateIn) + + return err } type NullableTransformationSimulateIn struct { diff --git a/go/internal/openapi/model_transformation_simulate_out.go b/go/internal/openapi/model_transformation_simulate_out.go index cc56fd03b..95f2556dd 100644 --- a/go/internal/openapi/model_transformation_simulate_out.go +++ b/go/internal/openapi/model_transformation_simulate_out.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the TransformationSimulateOut type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransformationSimulateOut{} + // TransformationSimulateOut struct for TransformationSimulateOut type TransformationSimulateOut struct { Method *TransformationHttpMethod `json:"method,omitempty"` @@ -21,6 +26,8 @@ type TransformationSimulateOut struct { Url string `json:"url"` } +type _TransformationSimulateOut TransformationSimulateOut + // NewTransformationSimulateOut instantiates a new TransformationSimulateOut 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 @@ -42,7 +49,7 @@ func NewTransformationSimulateOutWithDefaults() *TransformationSimulateOut { // GetMethod returns the Method field value if set, zero value otherwise. func (o *TransformationSimulateOut) GetMethod() TransformationHttpMethod { - if o == nil || o.Method == nil { + if o == nil || IsNil(o.Method) { var ret TransformationHttpMethod return ret } @@ -52,7 +59,7 @@ func (o *TransformationSimulateOut) GetMethod() TransformationHttpMethod { // GetMethodOk returns a tuple with the Method field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TransformationSimulateOut) GetMethodOk() (*TransformationHttpMethod, bool) { - if o == nil || o.Method == nil { + if o == nil || IsNil(o.Method) { return nil, false } return o.Method, true @@ -60,7 +67,7 @@ func (o *TransformationSimulateOut) GetMethodOk() (*TransformationHttpMethod, bo // HasMethod returns a boolean if a field has been set. func (o *TransformationSimulateOut) HasMethod() bool { - if o != nil && o.Method != nil { + if o != nil && !IsNil(o.Method) { return true } @@ -85,7 +92,7 @@ func (o *TransformationSimulateOut) GetPayload() string { // GetPayloadOk returns a tuple with the Payload field value // and a boolean to check if the value has been set. func (o *TransformationSimulateOut) GetPayloadOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Payload, true @@ -109,7 +116,7 @@ func (o *TransformationSimulateOut) GetUrl() string { // GetUrlOk returns a tuple with the Url field value // and a boolean to check if the value has been set. func (o *TransformationSimulateOut) GetUrlOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Url, true @@ -121,17 +128,59 @@ func (o *TransformationSimulateOut) SetUrl(v string) { } func (o TransformationSimulateOut) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransformationSimulateOut) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Method != nil { + if !IsNil(o.Method) { toSerialize["method"] = o.Method } - if true { - toSerialize["payload"] = o.Payload + toSerialize["payload"] = o.Payload + toSerialize["url"] = o.Url + return toSerialize, nil +} + +func (o *TransformationSimulateOut) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "payload", + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["url"] = o.Url + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varTransformationSimulateOut := _TransformationSimulateOut{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varTransformationSimulateOut) + + if err != nil { + return err + } + + *o = TransformationSimulateOut(varTransformationSimulateOut) + + return err } type NullableTransformationSimulateOut struct { diff --git a/go/internal/openapi/model_transformation_template_kind.go b/go/internal/openapi/model_transformation_template_kind.go index 27c805e18..514d555cf 100644 --- a/go/internal/openapi/model_transformation_template_kind.go +++ b/go/internal/openapi/model_transformation_template_kind.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -34,7 +34,8 @@ const ( TRANSFORMATIONTEMPLATEKIND_ZAPIER TransformationTemplateKind = "Zapier" ) -var allowedTransformationTemplateKindEnumValues = []TransformationTemplateKind{ +// All allowed values of TransformationTemplateKind enum +var AllowedTransformationTemplateKindEnumValues = []TransformationTemplateKind{ "Custom", "CustomerIO", "Discord", @@ -56,7 +57,7 @@ func (v *TransformationTemplateKind) UnmarshalJSON(src []byte) error { return err } enumTypeValue := TransformationTemplateKind(value) - for _, existing := range allowedTransformationTemplateKindEnumValues { + for _, existing := range AllowedTransformationTemplateKindEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil @@ -73,13 +74,13 @@ func NewTransformationTemplateKindFromValue(v string) (*TransformationTemplateKi if ev.IsValid() { return &ev, nil } else { - return nil, fmt.Errorf("invalid value '%v' for TransformationTemplateKind: valid values are %v", v, allowedTransformationTemplateKindEnumValues) + return nil, fmt.Errorf("invalid value '%v' for TransformationTemplateKind: valid values are %v", v, AllowedTransformationTemplateKindEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v TransformationTemplateKind) IsValid() bool { - for _, existing := range allowedTransformationTemplateKindEnumValues { + for _, existing := range AllowedTransformationTemplateKindEnumValues { if existing == v { return true } diff --git a/go/internal/openapi/model_validation_error.go b/go/internal/openapi/model_validation_error.go index d63d73420..5199657e2 100644 --- a/go/internal/openapi/model_validation_error.go +++ b/go/internal/openapi/model_validation_error.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,8 +12,13 @@ package openapi import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the ValidationError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ValidationError{} + // ValidationError Validation errors have their own schema to provide context for invalid requests eg. mismatched types and out of bounds values. There may be any number of these per 422 UNPROCESSABLE ENTITY error. type ValidationError struct { // The location as a [`Vec`] of [`String`]s -- often in the form `[\"body\", \"field_name\"]`, `[\"query\", \"field_name\"]`, etc. They may, however, be arbitrarily deep. @@ -24,6 +29,8 @@ type ValidationError struct { Type string `json:"type"` } +type _ValidationError ValidationError + // NewValidationError instantiates a new ValidationError 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 @@ -56,11 +63,11 @@ func (o *ValidationError) GetLoc() []string { // GetLocOk returns a tuple with the Loc field value // and a boolean to check if the value has been set. -func (o *ValidationError) GetLocOk() (*[]string, bool) { - if o == nil { +func (o *ValidationError) GetLocOk() ([]string, bool) { + if o == nil { return nil, false } - return &o.Loc, true + return o.Loc, true } // SetLoc sets field value @@ -81,7 +88,7 @@ func (o *ValidationError) GetMsg() string { // GetMsgOk returns a tuple with the Msg field value // and a boolean to check if the value has been set. func (o *ValidationError) GetMsgOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Msg, true @@ -105,7 +112,7 @@ func (o *ValidationError) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *ValidationError) GetTypeOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Type, true @@ -117,17 +124,58 @@ func (o *ValidationError) SetType(v string) { } func (o ValidationError) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ValidationError) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["loc"] = o.Loc + toSerialize["loc"] = o.Loc + toSerialize["msg"] = o.Msg + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *ValidationError) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "loc", + "msg", + "type", } - if true { - toSerialize["msg"] = o.Msg + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["type"] = o.Type + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varValidationError := _ValidationError{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varValidationError) + + if err != nil { + return err + } + + *o = ValidationError(varValidationError) + + return err } type NullableValidationError struct { diff --git a/go/internal/openapi/response.go b/go/internal/openapi/response.go index ec9f08af2..e72dcae80 100644 --- a/go/internal/openapi/response.go +++ b/go/internal/openapi/response.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. diff --git a/go/internal/openapi/utils.go b/go/internal/openapi/utils.go index 628892195..5ea2fe6de 100644 --- a/go/internal/openapi/utils.go +++ b/go/internal/openapi/utils.go @@ -1,10 +1,10 @@ /* - * Svix API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 1.1.1 - */ +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. @@ -12,6 +12,7 @@ package openapi import ( "encoding/json" + "reflect" "time" ) @@ -326,3 +327,21 @@ func (v *NullableTime) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/openapitools.json b/openapitools.json index 29f5d0699..64f2cbb54 100644 --- a/openapitools.json +++ b/openapitools.json @@ -2,6 +2,6 @@ "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json", "spaces": 2, "generator-cli": { - "version": "5.2.0" + "version": "7.2.0" } } diff --git a/package.json b/package.json index bedabd834..948b14ebd 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "generate": "bash ./regen_openapi.sh" }, "devDependencies": { - "@openapitools/openapi-generator-cli": "^2.6.0", + "@openapitools/openapi-generator-cli": "^2.9.0", "axios": "^0.26.1", "openapi-to-postmanv2": "^3.1.0", "semver": "^7.5.2" diff --git a/regen_openapi.sh b/regen_openapi.sh index 229bd856a..392c26358 100755 --- a/regen_openapi.sh +++ b/regen_openapi.sh @@ -16,7 +16,7 @@ yarn openapi-generator-cli generate -i openapi.json -g kotlin -o kotlin/lib/gene yarn openapi-generator-cli generate -i openapi.json -g ruby -o ruby -c ruby/openapi-generator-config.json -t ruby/templates -yarn openapi-generator-cli generate -i openapi.json -g csharp-netcore -o csharp/ -c csharp/openapi-generator-config.json --global-property apis,models,supportingFiles,apiTests=false,apiDocs=false,modelTests=false,modelDocs=false +yarn openapi-generator-cli generate -i openapi.json -g csharp -o csharp/ -c csharp/openapi-generator-config.json --global-property apis,models,supportingFiles,apiTests=false,apiDocs=false,modelTests=false,modelDocs=false yarn openapi-generator-cli generate -i openapi.json -g rust -o rust/ -c rust/openapi-generator-config.json -t rust/templates diff --git a/yarn.lock b/yarn.lock index cf60f6e9c..c73781e20 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1,1109 +1,1529 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@lukeed/csprng@^1.0.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@lukeed/csprng/-/csprng-1.1.0.tgz#1e3e4bd05c1cc7a0b2ddbd8a03f39f6e4b5e6cfe" - integrity sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA== - -"@nestjs/axios@0.0.8": - version "0.0.8" - resolved "https://registry.yarnpkg.com/@nestjs/axios/-/axios-0.0.8.tgz#4e321e36b6bc3ab0f02d80bafe04ae39edfdcacf" - integrity sha512-oJyfR9/h9tVk776il0829xyj3b2e81yTu6HjPraxynwNtMNGqZBHHmAQL24yMB3tVbBM0RvG3eUXH8+pRCGwlg== - dependencies: - axios "0.27.2" - -"@nestjs/common@9.3.11": - version "9.3.11" - resolved "https://registry.yarnpkg.com/@nestjs/common/-/common-9.3.11.tgz#95a54a2dd0fec0a7abc1edba793c53a53b59c783" - integrity sha512-IFZ2G/5UKWC2Uo7tJ4SxGed2+aiA+sJyWeWsGTogKVDhq90oxVBToh+uCDeI31HNUpqYGoWmkletfty42zUd8A== - dependencies: - uid "2.0.1" - iterare "1.2.1" - tslib "2.5.0" - -"@nestjs/core@9.3.11": - version "9.3.11" - resolved "https://registry.yarnpkg.com/@nestjs/core/-/core-9.3.11.tgz#1be65db0e889f8f12b87aec12c9cf66ea6043205" - integrity sha512-CI27a2JFd5rvvbgkalWqsiwQNhcP4EAG5BUK8usjp29wVp1kx30ghfBT8FLqIgmkRVo65A0IcEnWsxeXMntkxQ== - dependencies: - uid "2.0.1" - "@nuxtjs/opencollective" "0.3.2" - fast-safe-stringify "2.1.1" - iterare "1.2.1" - path-to-regexp "3.2.0" - tslib "2.5.0" - -"@nuxtjs/opencollective@0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@nuxtjs/opencollective/-/opencollective-0.3.2.tgz#620ce1044f7ac77185e825e1936115bb38e2681c" - integrity sha512-um0xL3fO7Mf4fDxcqx9KryrB7zgRM5JSlvGN5AGkP6JLM5XEKyjeAiPbNxdXVXQ16isuAhYpvP88NgL2BGd6aA== - dependencies: - chalk "^4.1.0" - consola "^2.15.0" - node-fetch "^2.6.1" - -"@openapitools/openapi-generator-cli@^2.6.0": - version "2.6.0" - resolved "https://registry.yarnpkg.com/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.6.0.tgz#5e4afad66394b4ab907847c454066ac37608644c" - integrity sha512-M/aOpR7G+Y1nMf+ofuar8pGszajgfhs1aSPSijkcr2tHTxKAI3sA3YYcOGbszxaNRKFyvOcDq+KP9pcJvKoCHg== - dependencies: - "@nestjs/axios" "0.0.8" - "@nestjs/common" "9.3.11" - "@nestjs/core" "9.3.11" - "@nuxtjs/opencollective" "0.3.2" - chalk "4.1.2" - commander "8.3.0" - compare-versions "4.1.4" - concurrently "6.5.1" - console.table "0.10.0" - fs-extra "10.1.0" - glob "7.1.6" - inquirer "8.2.5" - lodash "4.17.21" - reflect-metadata "0.1.13" - rxjs "7.8.0" - tslib "2.0.3" - -ajv-formats@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ajv-formats/-/ajv-formats-2.1.1.tgz#6e669400659eb74973bbf2e33327180a0996b520" - integrity sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA== - dependencies: - ajv "^8.0.0" - -ajv@8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.1.0.tgz#45d5d3d36c7cdd808930cc3e603cf6200dbeb736" - integrity sha512-B/Sk2Ix7A36fs/ZkuGLIR86EdjbgR6fsAcbx9lOP/QBSXujDNbVmIS/U4Itz5k8fPFDeVZl/zQ/gJW4Jrq6XjQ== - dependencies: - fast-deep-equal "^3.1.1" - json-schema-traverse "^1.0.0" - require-from-string "^2.0.2" - uri-js "^4.2.2" - -ajv@^8.0.0: - version "8.12.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.12.0.tgz#d1a0527323e22f53562c567c00991577dfbe19d1" - integrity sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA== - dependencies: - fast-deep-equal "^3.1.1" - json-schema-traverse "^1.0.0" - require-from-string "^2.0.2" - uri-js "^4.2.2" - -ansi-escapes@^4.2.1: - version "4.3.2" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" - integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== - dependencies: - type-fest "^0.21.3" - -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - -ansi-styles@^4.0.0, ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - -async@3.2.3: - version "3.2.3" - resolved "https://registry.yarnpkg.com/async/-/async-3.2.3.tgz#ac53dafd3f4720ee9e8a160628f18ea91df196c9" - integrity sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g== - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== - -axios@0.27.2: - version "0.27.2" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972" - integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ== - dependencies: - follow-redirects "^1.14.9" - form-data "^4.0.0" - -axios@^0.26.1: - version "0.26.1" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.26.1.tgz#1ede41c51fcf51bbbd6fd43669caaa4f0495aaa9" - integrity sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA== - dependencies: - follow-redirects "^1.14.8" - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -base64-js@^1.3.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" - integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== - -bl@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" - integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== - dependencies: - buffer "^5.5.0" - inherits "^2.0.4" - readable-stream "^3.4.0" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -buffer@^5.5.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" - integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.1.13" - -chalk@4.1.2, chalk@^4.1.0, chalk@^4.1.1: - version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -chardet@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" - integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== - -charset@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/charset/-/charset-1.0.1.tgz#8d59546c355be61049a8fa9164747793319852bd" - integrity sha512-6dVyOOYjpfFcL1Y4qChrAoQLRHvj2ziyhcm0QJlhOcAhykL/k1kTUPbeo+87MNRTRdk2OIIsIXbuF3x2wi5EXg== - -cli-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" - integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== - dependencies: - restore-cursor "^3.1.0" - -cli-spinners@^2.5.0: - version "2.6.1" - resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.6.1.tgz#adc954ebe281c37a6319bfa401e6dd2488ffb70d" - integrity sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g== - -cli-width@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" - integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== - -cliui@^7.0.2: - version "7.0.4" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" - integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^7.0.0" - -cliui@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" - integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.1" - wrap-ansi "^7.0.0" - -clone@^1.0.2: - version "1.0.4" - resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" - integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -combined-stream@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - -commander@2.20.3: - version "2.20.3" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" - integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== - -commander@8.3.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" - integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== - -compare-versions@4.1.4: - version "4.1.4" - resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-4.1.4.tgz#3571f4d610924d4414846a4183d386c8f3d51112" - integrity sha512-FemMreK9xNyL8gQevsdRMrvO4lFCkQP7qbuktn1q8ndcNk1+0mz7lgE7b/sNvbhVgY4w6tMN1FDp6aADjqw2rw== - -compute-gcd@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/compute-gcd/-/compute-gcd-1.2.1.tgz#34d639f3825625e1357ce81f0e456a6249d8c77f" - integrity sha512-TwMbxBNz0l71+8Sc4czv13h4kEqnchV9igQZBi6QUaz09dnz13juGnnaWWJTRsP3brxOoxeB4SA2WELLw1hCtg== - dependencies: - validate.io-array "^1.0.3" - validate.io-function "^1.0.2" - validate.io-integer-array "^1.0.0" - -compute-lcm@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/compute-lcm/-/compute-lcm-1.1.2.tgz#9107c66b9dca28cefb22b4ab4545caac4034af23" - integrity sha512-OFNPdQAXnQhDSKioX8/XYT6sdUlXwpeMjfd6ApxMJfyZ4GxmLR1xvMERctlYhlHwIiz6CSpBc2+qYKjHGZw4TQ== - dependencies: - compute-gcd "^1.2.1" - validate.io-array "^1.0.3" - validate.io-function "^1.0.2" - validate.io-integer-array "^1.0.0" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== - -concurrently@6.5.1: - version "6.5.1" - resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-6.5.1.tgz#4518c67f7ac680cf5c34d5adf399a2a2047edc8c" - integrity sha512-FlSwNpGjWQfRwPLXvJ/OgysbBxPkWpiVjy1042b0U7on7S7qwwMIILRj7WTN1mTgqa582bG6NFuScOoh6Zgdag== - dependencies: - chalk "^4.1.0" - date-fns "^2.16.1" - lodash "^4.17.21" - rxjs "^6.6.3" - spawn-command "^0.0.2-1" - supports-color "^8.1.0" - tree-kill "^1.2.2" - yargs "^16.2.0" - -consola@^2.15.0: - version "2.15.3" - resolved "https://registry.yarnpkg.com/consola/-/consola-2.15.3.tgz#2e11f98d6a4be71ff72e0bdf07bd23e12cb61550" - integrity sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw== - -console.table@0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/console.table/-/console.table-0.10.0.tgz#0917025588875befd70cf2eff4bef2c6e2d75d04" - integrity sha1-CRcCVYiHW+/XDPLv9L7yxuLXXQQ= - dependencies: - easy-table "1.1.0" - -date-fns@^2.16.1: - version "2.27.0" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.27.0.tgz#e1ff3c3ddbbab8a2eaadbb6106be2929a5a2d92b" - integrity sha512-sj+J0Mo2p2X1e306MHq282WS4/A8Pz/95GIFcsPNMPMZVI3EUrAdSv90al1k+p74WGLCruMXk23bfEDZa71X9Q== - -defaults@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" - integrity sha1-xlYFHpgX2f8I7YgUd/P+QBnz730= - dependencies: - clone "^1.0.2" - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== - -easy-table@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/easy-table/-/easy-table-1.1.0.tgz#86f9ab4c102f0371b7297b92a651d5824bc8cb73" - integrity sha1-hvmrTBAvA3G3KXuSplHVgkvIy3M= - optionalDependencies: - wcwidth ">=1.0.1" - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== - -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - -esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -external-editor@^3.0.3: - version "3.1.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" - integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== - dependencies: - chardet "^0.7.0" - iconv-lite "^0.4.24" - tmp "^0.0.33" - -faker@5.5.3: - version "5.5.3" - resolved "https://registry.yarnpkg.com/faker/-/faker-5.5.3.tgz#c57974ee484431b25205c2c8dc09fda861e51e0e" - integrity sha512-wLTv2a28wjUyWkbnX7u/ABZBkUkIF2fCd73V6P2oFqEGEktDfzWx4UxrSqtPRw0xPRAcjeAOIiJWqZm3pP4u3g== - -fast-deep-equal@^3.1.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" - integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== - -fast-safe-stringify@2.1.1, fast-safe-stringify@^2.0.7: - version "2.1.1" - resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz#c406a83b6e70d9e35ce3b30a81141df30aeba884" - integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA== - -figures@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" - integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== - dependencies: - escape-string-regexp "^1.0.5" - -file-type@3.9.0: - version "3.9.0" - resolved "https://registry.yarnpkg.com/file-type/-/file-type-3.9.0.tgz#257a078384d1db8087bc449d107d52a52672b9e9" - integrity sha512-RLoqTXE8/vPmMuTI88DAzhMYC99I8BWv7zYP4A1puo5HIjEJ5EX48ighy4ZyKMG9EDXxBgW6e++cn7d1xuFghA== - -follow-redirects@^1.14.8, follow-redirects@^1.14.9: - version "1.15.4" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.4.tgz#cdc7d308bf6493126b17ea2191ea0ccf3e535adf" - integrity sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw== - -form-data@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" - integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - -fs-extra@10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" - integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -get-caller-file@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -glob@7.1.6: - version "7.1.6" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" - integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -graceful-fs@^4.1.6, graceful-fs@^4.2.0: - version "4.2.8" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" - integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -http-reasons@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/http-reasons/-/http-reasons-0.1.0.tgz#a953ca670078669dde142ce899401b9d6e85d3b4" - integrity sha512-P6kYh0lKZ+y29T2Gqz+RlC9WBLhKe8kDmcJ+A+611jFfxdPsbMRQ5aNmFRM3lENqFkK+HTTL+tlQviAiv0AbLQ== - -http2-client@^1.2.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/http2-client/-/http2-client-1.3.5.tgz#20c9dc909e3cc98284dd20af2432c524086df181" - integrity sha512-EC2utToWl4RKfs5zd36Mxq7nzHHBuomZboI0yYL6Y0RmBgT7Sgkq4rQ0ezFTYoIsSs7Tm9SJe+o2FcAg6GBhGA== - -iconv-lite@0.6.3: - version "0.6.3" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" - integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== - dependencies: - safer-buffer ">= 2.1.2 < 3.0.0" - -iconv-lite@^0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ieee754@^1.1.13: - version "1.2.1" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" - integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@^2.0.3, inherits@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -inquirer@8.2.5: - version "8.2.5" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-8.2.5.tgz#d8654a7542c35a9b9e069d27e2df4858784d54f8" - integrity sha512-QAgPDQMEgrDssk1XiwwHoOGYF9BAbUcc1+j+FhEvaOt8/cKRqyLn0U5qA6F74fGhTMGxf92pOvPBeh29jQJDTQ== - dependencies: - ansi-escapes "^4.2.1" - chalk "^4.1.1" - cli-cursor "^3.1.0" - cli-width "^3.0.0" - external-editor "^3.0.3" - figures "^3.0.0" - lodash "^4.17.21" - mute-stream "0.0.8" - ora "^5.4.1" - run-async "^2.4.0" - rxjs "^7.5.5" - string-width "^4.1.0" - strip-ansi "^6.0.0" - through "^2.3.6" - wrap-ansi "^7.0.0" - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-interactive@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" - integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== - -is-unicode-supported@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" - integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== - -iterare@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/iterare/-/iterare-1.2.1.tgz#139c400ff7363690e33abffa33cbba8920f00042" - integrity sha512-RKYVTCjAnRthyJes037NX/IiqeidgN1xc3j1RjFfECFp28A1GVwK9nA+i0rJPaHqSZwygLzRnFlzUuHFoWWy+Q== - -js-yaml@3.14.1: - version "3.14.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -json-schema-compare@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/json-schema-compare/-/json-schema-compare-0.2.2.tgz#dd601508335a90c7f4cfadb6b2e397225c908e56" - integrity sha512-c4WYmDKyJXhs7WWvAWm3uIYnfyWFoIp+JEoX34rctVvEkMYCPGhXtvmFFXiffBbxfZsvQ0RNnV5H7GvDF5HCqQ== - dependencies: - lodash "^4.17.4" - -json-schema-merge-allof@0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/json-schema-merge-allof/-/json-schema-merge-allof-0.8.1.tgz#ed2828cdd958616ff74f932830a26291789eaaf2" - integrity sha512-CTUKmIlPJbsWfzRRnOXz+0MjIqvnleIXwFTzz+t9T86HnYX/Rozria6ZVGLktAU9e+NygNljveP+yxqtQp/Q4w== - dependencies: - compute-lcm "^1.1.2" - json-schema-compare "^0.2.2" - lodash "^4.17.20" - -json-schema-traverse@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" - integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== - -jsonfile@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" - integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== - dependencies: - universalify "^2.0.0" - optionalDependencies: - graceful-fs "^4.1.6" - -liquid-json@0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/liquid-json/-/liquid-json-0.3.1.tgz#9155a18136d8a6b2615e5f16f9a2448ab6b50eea" - integrity sha512-wUayTU8MS827Dam6MxgD72Ui+KOSF+u/eIqpatOtjnvgJ0+mnDq33uC2M7J0tPK+upe/DpUAuK4JUU89iBoNKQ== - -lodash@4.17.21, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -log-symbols@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" - integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== - dependencies: - chalk "^4.1.0" - is-unicode-supported "^0.1.0" - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -mime-db@1.48.0: - version "1.48.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.48.0.tgz#e35b31045dd7eada3aaad537ed88a33afbef2d1d" - integrity sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ== - -mime-db@1.52.0: - version "1.52.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" - integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== - -mime-format@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/mime-format/-/mime-format-2.0.1.tgz#1274876d58bc803332427a515f5f7036e07b9413" - integrity sha512-XxU3ngPbEnrYnNbIX+lYSaYg0M01v6p2ntd2YaFksTu0vayaw5OJvbdRyWs07EYRlLED5qadUZ+xo+XhOvFhwg== - dependencies: - charset "^1.0.0" - -mime-types@2.1.31: - version "2.1.31" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.31.tgz#a00d76b74317c61f9c2db2218b8e9f8e9c5c9e6b" - integrity sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg== - dependencies: - mime-db "1.48.0" - -mime-types@^2.1.12: - version "2.1.35" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" - integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== - dependencies: - mime-db "1.52.0" - -mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - -minimatch@^3.0.4: - version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - -mute-stream@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" - integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== - -node-fetch-h2@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/node-fetch-h2/-/node-fetch-h2-2.3.0.tgz#c6188325f9bd3d834020bf0f2d6dc17ced2241ac" - integrity sha512-ofRW94Ab0T4AOh5Fk8t0h8OBWrmjb0SSB20xh1H8YnPV9EJ+f5AMoYSUQ2zgJ4Iq2HAK0I2l5/Nequ8YzFS3Hg== - dependencies: - http2-client "^1.2.5" - -node-fetch@^2.6.1: - version "2.6.7" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" - integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== - dependencies: - whatwg-url "^5.0.0" - -oas-kit-common@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/oas-kit-common/-/oas-kit-common-1.0.8.tgz#6d8cacf6e9097967a4c7ea8bcbcbd77018e1f535" - integrity sha512-pJTS2+T0oGIwgjGpw7sIRU8RQMcUoKCDWFLdBqKB2BNmGpbBMH2sdqAaOXUg8OzonZHU0L7vfJu1mJFEiYDWOQ== - dependencies: - fast-safe-stringify "^2.0.7" - -oas-resolver-browser@2.5.6: - version "2.5.6" - resolved "https://registry.yarnpkg.com/oas-resolver-browser/-/oas-resolver-browser-2.5.6.tgz#1974db66d594fa8c67d3aa866b46b9e2156a8b55" - integrity sha512-Jw5elT/kwUJrnGaVuRWe1D7hmnYWB8rfDDjBnpQ+RYY/dzAewGXeTexXzt4fGEo6PUE4eqKqPWF79MZxxvMppA== - dependencies: - node-fetch-h2 "^2.3.0" - oas-kit-common "^1.0.8" - path-browserify "^1.0.1" - reftools "^1.1.9" - yaml "^1.10.0" - yargs "^17.0.1" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -onetime@^5.1.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" - integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== - dependencies: - mimic-fn "^2.1.0" - -openapi-to-postmanv2@^3.1.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/openapi-to-postmanv2/-/openapi-to-postmanv2-3.2.1.tgz#8c227709b97bbea707d95611d728cb02e6e63f7f" - integrity sha512-4gwGkx4IE+xVucN5j+gN85pIr51xF+XCWLNInXHSPs8YInn1+wEOsxa6uFtJFqnBLtqYbRjXwJLVe2mYv9n3og== - dependencies: - ajv "8.1.0" - ajv-formats "2.1.1" - async "3.2.3" - commander "2.20.3" - js-yaml "3.14.1" - json-schema-merge-allof "0.8.1" - lodash "4.17.21" - oas-resolver-browser "2.5.6" - path-browserify "1.0.1" - postman-collection "4.0.0" - yaml "1.10.2" - -ora@^5.4.1: - version "5.4.1" - resolved "https://registry.yarnpkg.com/ora/-/ora-5.4.1.tgz#1b2678426af4ac4a509008e5e4ac9e9959db9e18" - integrity sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ== - dependencies: - bl "^4.1.0" - chalk "^4.1.0" - cli-cursor "^3.1.0" - cli-spinners "^2.5.0" - is-interactive "^1.0.0" - is-unicode-supported "^0.1.0" - log-symbols "^4.1.0" - strip-ansi "^6.0.0" - wcwidth "^1.0.1" - -os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= - -path-browserify@1.0.1, path-browserify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" - integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-to-regexp@3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-3.2.0.tgz#fa7877ecbc495c601907562222453c43cc204a5f" - integrity sha512-jczvQbCUS7XmS7o+y1aEO9OBVFeZBQ1MDSEqmO7xSoPgOPoowY/SxLpZ6Vh97/8qHZOteiCKb7gkG9gA2ZUxJA== - -postman-collection@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/postman-collection/-/postman-collection-4.0.0.tgz#4a72c60f0d9725656d0e02d44e294e1c22ef3ffa" - integrity sha512-vDrXG/dclSu6RMqPqBz4ZqoQBwcj/a80sJYsQZmzWJ6dWgXiudPhwu6Vm3C1Hy7zX5W8A6am1Z6vb/TB4eyURA== - dependencies: - faker "5.5.3" - file-type "3.9.0" - http-reasons "0.1.0" - iconv-lite "0.6.3" - liquid-json "0.3.1" - lodash "4.17.21" - mime-format "2.0.1" - mime-types "2.1.31" - postman-url-encoder "3.0.1" - semver "7.3.5" - uuid "8.3.2" - -postman-url-encoder@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/postman-url-encoder/-/postman-url-encoder-3.0.1.tgz#a7434a169567c45f022dc435d46a86d71de6a8aa" - integrity sha512-dMPqXnkDlstM2Eya+Gw4MIGWEan8TzldDcUKZIhZUsJ/G5JjubfQPhFhVWKzuATDMvwvrWbSjF+8VmAvbu6giw== - dependencies: - punycode "^2.1.1" - -punycode@^2.1.0, punycode@^2.1.1: - version "2.3.0" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" - integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== - -readable-stream@^3.4.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" - integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -reflect-metadata@0.1.13: - version "0.1.13" - resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.13.tgz#67ae3ca57c972a2aa1642b10fe363fe32d49dc08" - integrity sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg== - -reftools@^1.1.9: - version "1.1.9" - resolved "https://registry.yarnpkg.com/reftools/-/reftools-1.1.9.tgz#e16e19f662ccd4648605312c06d34e5da3a2b77e" - integrity sha512-OVede/NQE13xBQ+ob5CKd5KyeJYU2YInb1bmV4nRoOfquZPkAkxuOXicSe1PvqIuZZ4kD13sPKBbR7UFDmli6w== - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== - -require-from-string@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== - -restore-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" - integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== - dependencies: - onetime "^5.1.0" - signal-exit "^3.0.2" - -run-async@^2.4.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" - integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== - -rxjs@7.8.0: - version "7.8.0" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.0.tgz#90a938862a82888ff4c7359811a595e14e1e09a4" - integrity sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg== - dependencies: - tslib "^2.1.0" - -rxjs@^6.6.3: - version "6.6.7" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" - integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== - dependencies: - tslib "^1.9.0" - -rxjs@^7.5.5: - version "7.8.1" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543" - integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== - dependencies: - tslib "^2.1.0" - -safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -semver@7.3.5: - version "7.3.5" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" - integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== - dependencies: - lru-cache "^6.0.0" - -semver@^7.5.2: - version "7.5.2" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.2.tgz#5b851e66d1be07c1cdaf37dfc856f543325a2beb" - integrity sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ== - dependencies: - lru-cache "^6.0.0" - -signal-exit@^3.0.2: - version "3.0.6" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.6.tgz#24e630c4b0f03fea446a2bd299e62b4a6ca8d0af" - integrity sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ== - -spawn-command@^0.0.2-1: - version "0.0.2-1" - resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2-1.tgz#62f5e9466981c1b796dc5929937e11c9c6921bd0" - integrity sha1-YvXpRmmBwbeW3Fkpk34RycaSG9A= - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== - -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -supports-color@^8.1.0: - version "8.1.1" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" - integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== - dependencies: - has-flag "^4.0.0" - -through@^2.3.6: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= - -tmp@^0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== - dependencies: - os-tmpdir "~1.0.2" - -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= - -tree-kill@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" - integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== - -tslib@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.3.tgz#8e0741ac45fc0c226e58a17bfc3e64b9bc6ca61c" - integrity sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ== - -tslib@2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" - integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== - -tslib@^1.9.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" - integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== - -tslib@^2.1.0: - version "2.5.2" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.2.tgz#1b6f07185c881557b0ffa84b111a0106989e8338" - integrity sha512-5svOrSA2w3iGFDs1HibEVBGbDrAY82bFQ3HZ3ixB+88nsbsWQoKqDRb5UBYAUPEzbBn6dAp5gRNXglySbx1MlA== - -type-fest@^0.21.3: - version "0.21.3" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" - integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== - -uid@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/uid/-/uid-2.0.1.tgz#a3f57c962828ea65256cd622fc363028cdf4526b" - integrity sha512-PF+1AnZgycpAIEmNtjxGBVmKbZAQguaa4pBUq6KNaGEcpzZ2klCNZLM34tsjp76maN00TttiiUf6zkIBpJQm2A== - dependencies: - "@lukeed/csprng" "^1.0.0" - -universalify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" - integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== - -uri-js@^4.2.2: - version "4.4.1" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" - integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== - dependencies: - punycode "^2.1.0" - -util-deprecate@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= - -uuid@8.3.2: - version "8.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" - integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== - -validate.io-array@^1.0.3: - version "1.0.6" - resolved "https://registry.yarnpkg.com/validate.io-array/-/validate.io-array-1.0.6.tgz#5b5a2cafd8f8b85abb2f886ba153f2d93a27774d" - integrity sha512-DeOy7CnPEziggrOO5CZhVKJw6S3Yi7e9e65R1Nl/RTN1vTQKnzjfvks0/8kQ40FP/dsjRAOd4hxmJ7uLa6vxkg== - -validate.io-function@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/validate.io-function/-/validate.io-function-1.0.2.tgz#343a19802ed3b1968269c780e558e93411c0bad7" - integrity sha512-LlFybRJEriSuBnUhQyG5bwglhh50EpTL2ul23MPIuR1odjO7XaMLFV8vHGwp7AZciFxtYOeiSCT5st+XSPONiQ== - -validate.io-integer-array@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/validate.io-integer-array/-/validate.io-integer-array-1.0.0.tgz#2cabde033293a6bcbe063feafe91eaf46b13a089" - integrity sha512-mTrMk/1ytQHtCY0oNO3dztafHYyGU88KL+jRxWuzfOmQb+4qqnWmI+gykvGp8usKZOM0H7keJHEbRaFiYA0VrA== - dependencies: - validate.io-array "^1.0.3" - validate.io-integer "^1.0.4" - -validate.io-integer@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/validate.io-integer/-/validate.io-integer-1.0.5.tgz#168496480b95be2247ec443f2233de4f89878068" - integrity sha512-22izsYSLojN/P6bppBqhgUDjCkr5RY2jd+N2a3DCAUey8ydvrZ/OkGvFPR7qfOpwR2LC5p4Ngzxz36g5Vgr/hQ== - dependencies: - validate.io-number "^1.0.3" - -validate.io-number@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/validate.io-number/-/validate.io-number-1.0.3.tgz#f63ffeda248bf28a67a8d48e0e3b461a1665baf8" - integrity sha512-kRAyotcbNaSYoDnXvb4MHg/0a1egJdLwS6oJ38TJY7aw9n93Fl/3blIXdyYvPOp55CNxywooG/3BcrwNrBpcSg== - -wcwidth@>=1.0.1, wcwidth@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" - integrity sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g= - dependencies: - defaults "^1.0.3" - -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= - -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -y18n@^5.0.5: - version "5.0.8" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" - integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - -yaml@1.10.2, yaml@^1.10.0: - version "1.10.2" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" - integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== - -yargs-parser@^20.2.2: - version "20.2.9" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - -yargs-parser@^21.1.1: - version "21.1.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" - integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== - -yargs@^16.2.0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" - integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2" - -yargs@^17.0.1: - version "17.7.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" - integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== - dependencies: - cliui "^8.0.1" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.3" - y18n "^5.0.5" - yargs-parser "^21.1.1" +# This file is generated by running "yarn install" inside your project. +# Manual changes might be lost - proceed with caution! + +__metadata: + version: 6 + cacheKey: 8 + +"@lukeed/csprng@npm:^1.0.0": + version: 1.1.0 + resolution: "@lukeed/csprng@npm:1.1.0" + checksum: 926f5f7fc629470ca9a8af355bfcd0271d34535f7be3890f69902432bddc3262029bb5dbe9025542cf6c9883d878692eef2815fc2f3ba5b92e9da1f9eba2e51b + languageName: node + linkType: hard + +"@nestjs/axios@npm:3.0.1": + version: 3.0.1 + resolution: "@nestjs/axios@npm:3.0.1" + peerDependencies: + "@nestjs/common": ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 + axios: ^1.3.1 + reflect-metadata: ^0.1.12 + rxjs: ^6.0.0 || ^7.0.0 + checksum: 01cebc64efa7a1d9df7a9053fbc5124986a95078789a0f280a2a61c31601a70a35745e07fc385497b4f85c7bdb6216a3575728646f1e6e684c038ac31900129c + languageName: node + linkType: hard + +"@nestjs/common@npm:10.3.0": + version: 10.3.0 + resolution: "@nestjs/common@npm:10.3.0" + dependencies: + iterare: 1.2.1 + tslib: 2.6.2 + uid: 2.0.2 + peerDependencies: + class-transformer: "*" + class-validator: "*" + reflect-metadata: ^0.1.12 + rxjs: ^7.1.0 + peerDependenciesMeta: + class-transformer: + optional: true + class-validator: + optional: true + checksum: c5444cb46bd4f4a4d28b5031f7c28a0cf9863bc2d5518910bfed6a49734f59e1ea08dd4651e2117ae82df81c933ef84f0963c5cdeee5ef1608cf1bd36ee291c5 + languageName: node + linkType: hard + +"@nestjs/core@npm:10.3.0": + version: 10.3.0 + resolution: "@nestjs/core@npm:10.3.0" + dependencies: + "@nuxtjs/opencollective": 0.3.2 + fast-safe-stringify: 2.1.1 + iterare: 1.2.1 + path-to-regexp: 3.2.0 + tslib: 2.6.2 + uid: 2.0.2 + peerDependencies: + "@nestjs/common": ^10.0.0 + "@nestjs/microservices": ^10.0.0 + "@nestjs/platform-express": ^10.0.0 + "@nestjs/websockets": ^10.0.0 + reflect-metadata: ^0.1.12 + rxjs: ^7.1.0 + peerDependenciesMeta: + "@nestjs/microservices": + optional: true + "@nestjs/platform-express": + optional: true + "@nestjs/websockets": + optional: true + checksum: 7677b9fb97c8dec512c2a736c273ef08698b377af8c046bc5aad442ba3d35acbc17d177e76bf44a66678cae2ced2d265183e85be4190c501a195f16496df6396 + languageName: node + linkType: hard + +"@nuxtjs/opencollective@npm:0.3.2": + version: 0.3.2 + resolution: "@nuxtjs/opencollective@npm:0.3.2" + dependencies: + chalk: ^4.1.0 + consola: ^2.15.0 + node-fetch: ^2.6.1 + bin: + opencollective: bin/opencollective.js + checksum: fd3737c12edf55b5c2279674664c3ed5e756410ea82e9cd324c3f0e032ed5ccd8df1959ec69ea97f2f1c9c33c884aae3d7a7108a73ea0faa90d74ea47cf364d4 + languageName: node + linkType: hard + +"@openapitools/openapi-generator-cli@npm:^2.9.0": + version: 2.9.0 + resolution: "@openapitools/openapi-generator-cli@npm:2.9.0" + dependencies: + "@nestjs/axios": 3.0.1 + "@nestjs/common": 10.3.0 + "@nestjs/core": 10.3.0 + "@nuxtjs/opencollective": 0.3.2 + axios: 1.6.5 + chalk: 4.1.2 + commander: 8.3.0 + compare-versions: 4.1.4 + concurrently: 6.5.1 + console.table: 0.10.0 + fs-extra: 10.1.0 + glob: 7.2.3 + inquirer: 8.2.6 + lodash: 4.17.21 + reflect-metadata: 0.1.13 + rxjs: 7.8.1 + tslib: 2.6.2 + bin: + openapi-generator-cli: main.js + checksum: 102040381b42edbab4fa34aa49c3cf8188fdb892c3e251bcb5bdf7c599597f3572d52d44fed7bead5fcaec24d624491c20dc96d2f164fa44e7fc232c7d787f69 + languageName: node + linkType: hard + +"ajv-formats@npm:2.1.1": + version: 2.1.1 + resolution: "ajv-formats@npm:2.1.1" + dependencies: + ajv: ^8.0.0 + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + checksum: 4a287d937f1ebaad4683249a4c40c0fa3beed30d9ddc0adba04859026a622da0d317851316ea64b3680dc60f5c3c708105ddd5d5db8fe595d9d0207fd19f90b7 + languageName: node + linkType: hard + +"ajv@npm:8.1.0": + version: 8.1.0 + resolution: "ajv@npm:8.1.0" + dependencies: + fast-deep-equal: ^3.1.1 + json-schema-traverse: ^1.0.0 + require-from-string: ^2.0.2 + uri-js: ^4.2.2 + checksum: 612cb595ff113ffca09bce2987bf76b117de9b5257981eb21369ed444fb57ecce0025d43476788b7ca5dd0d5c28f8e1dcf428cfbd0803fc5e576647d4ef4bfbb + languageName: node + linkType: hard + +"ajv@npm:^8.0.0": + version: 8.12.0 + resolution: "ajv@npm:8.12.0" + dependencies: + fast-deep-equal: ^3.1.1 + json-schema-traverse: ^1.0.0 + require-from-string: ^2.0.2 + uri-js: ^4.2.2 + checksum: 4dc13714e316e67537c8b31bc063f99a1d9d9a497eb4bbd55191ac0dcd5e4985bbb71570352ad6f1e76684fb6d790928f96ba3b2d4fd6e10024be9612fe3f001 + languageName: node + linkType: hard + +"ansi-escapes@npm:^4.2.1": + version: 4.3.2 + resolution: "ansi-escapes@npm:4.3.2" + dependencies: + type-fest: ^0.21.3 + checksum: 93111c42189c0a6bed9cdb4d7f2829548e943827ee8479c74d6e0b22ee127b2a21d3f8b5ca57723b8ef78ce011fbfc2784350eb2bde3ccfccf2f575fa8489815 + languageName: node + linkType: hard + +"ansi-regex@npm:^5.0.1": + version: 5.0.1 + resolution: "ansi-regex@npm:5.0.1" + checksum: 2aa4bb54caf2d622f1afdad09441695af2a83aa3fe8b8afa581d205e57ed4261c183c4d3877cee25794443fde5876417d859c108078ab788d6af7e4fe52eb66b + languageName: node + linkType: hard + +"ansi-styles@npm:^4.0.0, ansi-styles@npm:^4.1.0": + version: 4.3.0 + resolution: "ansi-styles@npm:4.3.0" + dependencies: + color-convert: ^2.0.1 + checksum: 513b44c3b2105dd14cc42a19271e80f386466c4be574bccf60b627432f9198571ebf4ab1e4c3ba17347658f4ee1711c163d574248c0c1cdc2d5917a0ad582ec4 + languageName: node + linkType: hard + +"argparse@npm:^1.0.7": + version: 1.0.10 + resolution: "argparse@npm:1.0.10" + dependencies: + sprintf-js: ~1.0.2 + checksum: 7ca6e45583a28de7258e39e13d81e925cfa25d7d4aacbf806a382d3c02fcb13403a07fb8aeef949f10a7cfe4a62da0e2e807b348a5980554cc28ee573ef95945 + languageName: node + linkType: hard + +"async@npm:3.2.3": + version: 3.2.3 + resolution: "async@npm:3.2.3" + checksum: c4bee57ab2249af3dc83ca3ef9acfa8e822c0d5e5aa41bae3eaf7f673648343cd64ecd7d26091ffd357f3f044428b17b5f00098494b6cf8b6b3e9681f0636ca1 + languageName: node + linkType: hard + +"asynckit@npm:^0.4.0": + version: 0.4.0 + resolution: "asynckit@npm:0.4.0" + checksum: 7b78c451df768adba04e2d02e63e2d0bf3b07adcd6e42b4cf665cb7ce899bedd344c69a1dcbce355b5f972d597b25aaa1c1742b52cffd9caccb22f348114f6be + languageName: node + linkType: hard + +"axios@npm:1.6.5": + version: 1.6.5 + resolution: "axios@npm:1.6.5" + dependencies: + follow-redirects: ^1.15.4 + form-data: ^4.0.0 + proxy-from-env: ^1.1.0 + checksum: e28d67b2d9134cb4608c44d8068b0678cfdccc652742e619006f27264a30c7aba13b2cd19c6f1f52ae195b5232734925928fb192d5c85feea7edd2f273df206d + languageName: node + linkType: hard + +"axios@npm:^0.26.1": + version: 0.26.1 + resolution: "axios@npm:0.26.1" + dependencies: + follow-redirects: ^1.14.8 + checksum: d9eb58ff4bc0b36a04783fc9ff760e9245c829a5a1052ee7ca6013410d427036b1d10d04e7380c02f3508c5eaf3485b1ae67bd2adbfec3683704745c8d7a6e1a + languageName: node + linkType: hard + +"balanced-match@npm:^1.0.0": + version: 1.0.2 + resolution: "balanced-match@npm:1.0.2" + checksum: 9706c088a283058a8a99e0bf91b0a2f75497f185980d9ffa8b304de1d9e58ebda7c72c07ebf01dadedaac5b2907b2c6f566f660d62bd336c3468e960403b9d65 + languageName: node + linkType: hard + +"base64-js@npm:^1.3.1": + version: 1.5.1 + resolution: "base64-js@npm:1.5.1" + checksum: 669632eb3745404c2f822a18fc3a0122d2f9a7a13f7fb8b5823ee19d1d2ff9ee5b52c53367176ea4ad093c332fd5ab4bd0ebae5a8e27917a4105a4cfc86b1005 + languageName: node + linkType: hard + +"bl@npm:^4.1.0": + version: 4.1.0 + resolution: "bl@npm:4.1.0" + dependencies: + buffer: ^5.5.0 + inherits: ^2.0.4 + readable-stream: ^3.4.0 + checksum: 9e8521fa7e83aa9427c6f8ccdcba6e8167ef30cc9a22df26effcc5ab682ef91d2cbc23a239f945d099289e4bbcfae7a192e9c28c84c6202e710a0dfec3722662 + languageName: node + linkType: hard + +"brace-expansion@npm:^1.1.7": + version: 1.1.11 + resolution: "brace-expansion@npm:1.1.11" + dependencies: + balanced-match: ^1.0.0 + concat-map: 0.0.1 + checksum: faf34a7bb0c3fcf4b59c7808bc5d2a96a40988addf2e7e09dfbb67a2251800e0d14cd2bfc1aa79174f2f5095c54ff27f46fb1289fe2d77dac755b5eb3434cc07 + languageName: node + linkType: hard + +"buffer@npm:^5.5.0": + version: 5.7.1 + resolution: "buffer@npm:5.7.1" + dependencies: + base64-js: ^1.3.1 + ieee754: ^1.1.13 + checksum: e2cf8429e1c4c7b8cbd30834ac09bd61da46ce35f5c22a78e6c2f04497d6d25541b16881e30a019c6fd3154150650ccee27a308eff3e26229d788bbdeb08ab84 + languageName: node + linkType: hard + +"chalk@npm:4.1.2, chalk@npm:^4.1.0, chalk@npm:^4.1.1": + version: 4.1.2 + resolution: "chalk@npm:4.1.2" + dependencies: + ansi-styles: ^4.1.0 + supports-color: ^7.1.0 + checksum: fe75c9d5c76a7a98d45495b91b2172fa3b7a09e0cc9370e5c8feb1c567b85c4288e2b3fded7cfdd7359ac28d6b3844feb8b82b8686842e93d23c827c417e83fc + languageName: node + linkType: hard + +"chardet@npm:^0.7.0": + version: 0.7.0 + resolution: "chardet@npm:0.7.0" + checksum: 6fd5da1f5d18ff5712c1e0aed41da200d7c51c28f11b36ee3c7b483f3696dabc08927fc6b227735eb8f0e1215c9a8abd8154637f3eff8cada5959df7f58b024d + languageName: node + linkType: hard + +"charset@npm:^1.0.0": + version: 1.0.1 + resolution: "charset@npm:1.0.1" + checksum: adf747e7bc76c0e47dbfbb555ef376f5adb2e67cad35718f19a2d02e27589345ccaf3c6170c185d2cc82298241f8478cdcdcab8be8ec429bf56807885f3c5300 + languageName: node + linkType: hard + +"cli-cursor@npm:^3.1.0": + version: 3.1.0 + resolution: "cli-cursor@npm:3.1.0" + dependencies: + restore-cursor: ^3.1.0 + checksum: 2692784c6cd2fd85cfdbd11f53aea73a463a6d64a77c3e098b2b4697a20443f430c220629e1ca3b195ea5ac4a97a74c2ee411f3807abf6df2b66211fec0c0a29 + languageName: node + linkType: hard + +"cli-spinners@npm:^2.5.0": + version: 2.6.1 + resolution: "cli-spinners@npm:2.6.1" + checksum: 423409baaa7a58e5104b46ca1745fbfc5888bbd0b0c5a626e052ae1387060839c8efd512fb127e25769b3dc9562db1dc1b5add6e0b93b7ef64f477feb6416a45 + languageName: node + linkType: hard + +"cli-width@npm:^3.0.0": + version: 3.0.0 + resolution: "cli-width@npm:3.0.0" + checksum: 4c94af3769367a70e11ed69aa6095f1c600c0ff510f3921ab4045af961820d57c0233acfa8b6396037391f31b4c397e1f614d234294f979ff61430a6c166c3f6 + languageName: node + linkType: hard + +"cliui@npm:^7.0.2": + version: 7.0.4 + resolution: "cliui@npm:7.0.4" + dependencies: + string-width: ^4.2.0 + strip-ansi: ^6.0.0 + wrap-ansi: ^7.0.0 + checksum: ce2e8f578a4813806788ac399b9e866297740eecd4ad1823c27fd344d78b22c5f8597d548adbcc46f0573e43e21e751f39446c5a5e804a12aace402b7a315d7f + languageName: node + linkType: hard + +"cliui@npm:^8.0.1": + version: 8.0.1 + resolution: "cliui@npm:8.0.1" + dependencies: + string-width: ^4.2.0 + strip-ansi: ^6.0.1 + wrap-ansi: ^7.0.0 + checksum: 79648b3b0045f2e285b76fb2e24e207c6db44323581e421c3acbd0e86454cba1b37aea976ab50195a49e7384b871e6dfb2247ad7dec53c02454ac6497394cb56 + languageName: node + linkType: hard + +"clone@npm:^1.0.2": + version: 1.0.4 + resolution: "clone@npm:1.0.4" + checksum: d06418b7335897209e77bdd430d04f882189582e67bd1f75a04565f3f07f5b3f119a9d670c943b6697d0afb100f03b866b3b8a1f91d4d02d72c4ecf2bb64b5dd + languageName: node + linkType: hard + +"color-convert@npm:^2.0.1": + version: 2.0.1 + resolution: "color-convert@npm:2.0.1" + dependencies: + color-name: ~1.1.4 + checksum: 79e6bdb9fd479a205c71d89574fccfb22bd9053bd98c6c4d870d65c132e5e904e6034978e55b43d69fcaa7433af2016ee203ce76eeba9cfa554b373e7f7db336 + languageName: node + linkType: hard + +"color-name@npm:~1.1.4": + version: 1.1.4 + resolution: "color-name@npm:1.1.4" + checksum: b0445859521eb4021cd0fb0cc1a75cecf67fceecae89b63f62b201cca8d345baf8b952c966862a9d9a2632987d4f6581f0ec8d957dfacece86f0a7919316f610 + languageName: node + linkType: hard + +"combined-stream@npm:^1.0.8": + version: 1.0.8 + resolution: "combined-stream@npm:1.0.8" + dependencies: + delayed-stream: ~1.0.0 + checksum: 49fa4aeb4916567e33ea81d088f6584749fc90c7abec76fd516bf1c5aa5c79f3584b5ba3de6b86d26ddd64bae5329c4c7479343250cfe71c75bb366eae53bb7c + languageName: node + linkType: hard + +"commander@npm:2.20.3": + version: 2.20.3 + resolution: "commander@npm:2.20.3" + checksum: ab8c07884e42c3a8dbc5dd9592c606176c7eb5c1ca5ff274bcf907039b2c41de3626f684ea75ccf4d361ba004bbaff1f577d5384c155f3871e456bdf27becf9e + languageName: node + linkType: hard + +"commander@npm:8.3.0": + version: 8.3.0 + resolution: "commander@npm:8.3.0" + checksum: 0f82321821fc27b83bd409510bb9deeebcfa799ff0bf5d102128b500b7af22872c0c92cb6a0ebc5a4cf19c6b550fba9cedfa7329d18c6442a625f851377bacf0 + languageName: node + linkType: hard + +"compare-versions@npm:4.1.4": + version: 4.1.4 + resolution: "compare-versions@npm:4.1.4" + checksum: c1617544b79c2f36a1d543c50efd0da1a994040294c8923218080bc0df46da83ca414e3378282e93cab073744995124946417d130d8987e8efb5d1a73c0c4ba6 + languageName: node + linkType: hard + +"compute-gcd@npm:^1.2.1": + version: 1.2.1 + resolution: "compute-gcd@npm:1.2.1" + dependencies: + validate.io-array: ^1.0.3 + validate.io-function: ^1.0.2 + validate.io-integer-array: ^1.0.0 + checksum: 51cf33b75f7c8db5142fcb99a9d84a40260993fed8e02a7ab443834186c3ab99b3fd20b30ad9075a6a9d959d69df6da74dd3be8a59c78d9f2fe780ebda8242e1 + languageName: node + linkType: hard + +"compute-lcm@npm:^1.1.2": + version: 1.1.2 + resolution: "compute-lcm@npm:1.1.2" + dependencies: + compute-gcd: ^1.2.1 + validate.io-array: ^1.0.3 + validate.io-function: ^1.0.2 + validate.io-integer-array: ^1.0.0 + checksum: d499ab57dcb48e8d0fd233b99844a06d1cc56115602c920c586e998ebba60293731f5b6976e8a1e83ae6cbfe86716f62d9432e8d94913fed8bd8352f447dc917 + languageName: node + linkType: hard + +"concat-map@npm:0.0.1": + version: 0.0.1 + resolution: "concat-map@npm:0.0.1" + checksum: 902a9f5d8967a3e2faf138d5cb784b9979bad2e6db5357c5b21c568df4ebe62bcb15108af1b2253744844eb964fc023fbd9afbbbb6ddd0bcc204c6fb5b7bf3af + languageName: node + linkType: hard + +"concurrently@npm:6.5.1": + version: 6.5.1 + resolution: "concurrently@npm:6.5.1" + dependencies: + chalk: ^4.1.0 + date-fns: ^2.16.1 + lodash: ^4.17.21 + rxjs: ^6.6.3 + spawn-command: ^0.0.2-1 + supports-color: ^8.1.0 + tree-kill: ^1.2.2 + yargs: ^16.2.0 + bin: + concurrently: bin/concurrently.js + checksum: 3f4d89b464fa5c9fb6f9489b46594c30ba54eff6ff10ab3cb5f30f64b74c83be664623a0f0cc731a3cb3f057a1f4a3292f7d3470c012a292c44aca31f214a3fa + languageName: node + linkType: hard + +"consola@npm:^2.15.0": + version: 2.15.3 + resolution: "consola@npm:2.15.3" + checksum: 8ef7a09b703ec67ac5c389a372a33b6dc97eda6c9876443a60d76a3076eea0259e7f67a4e54fd5a52f97df73690822d090cf8b7e102b5761348afef7c6d03e28 + languageName: node + linkType: hard + +"console.table@npm:0.10.0": + version: 0.10.0 + resolution: "console.table@npm:0.10.0" + dependencies: + easy-table: 1.1.0 + checksum: 4c1460e3105a5f7df5bfa372844104a20e487fc0fccc5821c169a39def3249759554fc132621074ad6695664a1a8d558dd385c0e7f290acb2eaca51466474bb9 + languageName: node + linkType: hard + +"date-fns@npm:^2.16.1": + version: 2.27.0 + resolution: "date-fns@npm:2.27.0" + checksum: db62036b3816eb0322c9532b353beac7f660a91e1a55dbd21c14893c621ebb8509f21c66ba287844dabd34dee0207edd54a9537bce6bb7cab9383dedc6b8bc90 + languageName: node + linkType: hard + +"defaults@npm:^1.0.3": + version: 1.0.3 + resolution: "defaults@npm:1.0.3" + dependencies: + clone: ^1.0.2 + checksum: 96e2112da6553d376afd5265ea7cbdb2a3b45535965d71ab8bb1da10c8126d168fdd5268799625324b368356d21ba2a7b3d4ec50961f11a47b7feb9de3d4413e + languageName: node + linkType: hard + +"delayed-stream@npm:~1.0.0": + version: 1.0.0 + resolution: "delayed-stream@npm:1.0.0" + checksum: 46fe6e83e2cb1d85ba50bd52803c68be9bd953282fa7096f51fc29edd5d67ff84ff753c51966061e5ba7cb5e47ef6d36a91924eddb7f3f3483b1c560f77a0020 + languageName: node + linkType: hard + +"easy-table@npm:1.1.0": + version: 1.1.0 + resolution: "easy-table@npm:1.1.0" + dependencies: + wcwidth: ">=1.0.1" + dependenciesMeta: + wcwidth: + optional: true + checksum: 49b960fefe5670076773824386f22070dce185ebc0a99542035496700cc39a0b9346f65fd4307f5fe3dbbe7e6d9c4b59966e77e32f915e0fe71de71c3d0efcf7 + languageName: node + linkType: hard + +"emoji-regex@npm:^8.0.0": + version: 8.0.0 + resolution: "emoji-regex@npm:8.0.0" + checksum: d4c5c39d5a9868b5fa152f00cada8a936868fd3367f33f71be515ecee4c803132d11b31a6222b2571b1e5f7e13890156a94880345594d0ce7e3c9895f560f192 + languageName: node + linkType: hard + +"escalade@npm:^3.1.1": + version: 3.1.1 + resolution: "escalade@npm:3.1.1" + checksum: a3e2a99f07acb74b3ad4989c48ca0c3140f69f923e56d0cba0526240ee470b91010f9d39001f2a4a313841d237ede70a729e92125191ba5d21e74b106800b133 + languageName: node + linkType: hard + +"escape-string-regexp@npm:^1.0.5": + version: 1.0.5 + resolution: "escape-string-regexp@npm:1.0.5" + checksum: 6092fda75c63b110c706b6a9bfde8a612ad595b628f0bd2147eea1d3406723020810e591effc7db1da91d80a71a737a313567c5abb3813e8d9c71f4aa595b410 + languageName: node + linkType: hard + +"esprima@npm:^4.0.0": + version: 4.0.1 + resolution: "esprima@npm:4.0.1" + bin: + esparse: ./bin/esparse.js + esvalidate: ./bin/esvalidate.js + checksum: b45bc805a613dbea2835278c306b91aff6173c8d034223fa81498c77dcbce3b2931bf6006db816f62eacd9fd4ea975dfd85a5b7f3c6402cfd050d4ca3c13a628 + languageName: node + linkType: hard + +"external-editor@npm:^3.0.3": + version: 3.1.0 + resolution: "external-editor@npm:3.1.0" + dependencies: + chardet: ^0.7.0 + iconv-lite: ^0.4.24 + tmp: ^0.0.33 + checksum: 1c2a616a73f1b3435ce04030261bed0e22d4737e14b090bb48e58865da92529c9f2b05b893de650738d55e692d071819b45e1669259b2b354bc3154d27a698c7 + languageName: node + linkType: hard + +"faker@npm:5.5.3": + version: 5.5.3 + resolution: "faker@npm:5.5.3" + checksum: 684fd64c8d3897e54248f95b4f6319f75d97691b8500cd13adf4af2c28f9204f766c1d1aaa6b41338f0beaaa87256c3132f8708a1a8f189d122b92f6b98081c3 + languageName: node + linkType: hard + +"fast-deep-equal@npm:^3.1.1": + version: 3.1.3 + resolution: "fast-deep-equal@npm:3.1.3" + checksum: e21a9d8d84f53493b6aa15efc9cfd53dd5b714a1f23f67fb5dc8f574af80df889b3bce25dc081887c6d25457cce704e636395333abad896ccdec03abaf1f3f9d + languageName: node + linkType: hard + +"fast-safe-stringify@npm:2.1.1, fast-safe-stringify@npm:^2.0.7": + version: 2.1.1 + resolution: "fast-safe-stringify@npm:2.1.1" + checksum: a851cbddc451745662f8f00ddb622d6766f9bd97642dabfd9a405fb0d646d69fc0b9a1243cbf67f5f18a39f40f6fa821737651ff1bceeba06c9992ca2dc5bd3d + languageName: node + linkType: hard + +"figures@npm:^3.0.0": + version: 3.2.0 + resolution: "figures@npm:3.2.0" + dependencies: + escape-string-regexp: ^1.0.5 + checksum: 85a6ad29e9aca80b49b817e7c89ecc4716ff14e3779d9835af554db91bac41c0f289c418923519392a1e582b4d10482ad282021330cd045bb7b80c84152f2a2b + languageName: node + linkType: hard + +"file-type@npm:3.9.0": + version: 3.9.0 + resolution: "file-type@npm:3.9.0" + checksum: 1db70b2485ac77c4edb4b8753c1874ee6194123533f43c2651820f96b518f505fa570b093fedd6672eb105ba9fb89c62f84b6492e46788e39c3447aed37afa2d + languageName: node + linkType: hard + +"follow-redirects@npm:^1.14.8": + version: 1.15.4 + resolution: "follow-redirects@npm:1.15.4" + peerDependenciesMeta: + debug: + optional: true + checksum: e178d1deff8b23d5d24ec3f7a94cde6e47d74d0dc649c35fc9857041267c12ec5d44650a0c5597ef83056ada9ea6ca0c30e7c4f97dbf07d035086be9e6a5b7b6 + languageName: node + linkType: hard + +"follow-redirects@npm:^1.15.4": + version: 1.15.5 + resolution: "follow-redirects@npm:1.15.5" + peerDependenciesMeta: + debug: + optional: true + checksum: 5ca49b5ce6f44338cbfc3546823357e7a70813cecc9b7b768158a1d32c1e62e7407c944402a918ea8c38ae2e78266312d617dc68783fac502cbb55e1047b34ec + languageName: node + linkType: hard + +"form-data@npm:^4.0.0": + version: 4.0.0 + resolution: "form-data@npm:4.0.0" + dependencies: + asynckit: ^0.4.0 + combined-stream: ^1.0.8 + mime-types: ^2.1.12 + checksum: 01135bf8675f9d5c61ff18e2e2932f719ca4de964e3be90ef4c36aacfc7b9cb2fceb5eca0b7e0190e3383fe51c5b37f4cb80b62ca06a99aaabfcfd6ac7c9328c + languageName: node + linkType: hard + +"fs-extra@npm:10.1.0": + version: 10.1.0 + resolution: "fs-extra@npm:10.1.0" + dependencies: + graceful-fs: ^4.2.0 + jsonfile: ^6.0.1 + universalify: ^2.0.0 + checksum: dc94ab37096f813cc3ca12f0f1b5ad6744dfed9ed21e953d72530d103cea193c2f81584a39e9dee1bea36de5ee66805678c0dddc048e8af1427ac19c00fffc50 + languageName: node + linkType: hard + +"fs.realpath@npm:^1.0.0": + version: 1.0.0 + resolution: "fs.realpath@npm:1.0.0" + checksum: 99ddea01a7e75aa276c250a04eedeffe5662bce66c65c07164ad6264f9de18fb21be9433ead460e54cff20e31721c811f4fb5d70591799df5f85dce6d6746fd0 + languageName: node + linkType: hard + +"get-caller-file@npm:^2.0.5": + version: 2.0.5 + resolution: "get-caller-file@npm:2.0.5" + checksum: b9769a836d2a98c3ee734a88ba712e62703f1df31b94b784762c433c27a386dd6029ff55c2a920c392e33657d80191edbf18c61487e198844844516f843496b9 + languageName: node + linkType: hard + +"glob@npm:7.2.3": + version: 7.2.3 + resolution: "glob@npm:7.2.3" + dependencies: + fs.realpath: ^1.0.0 + inflight: ^1.0.4 + inherits: 2 + minimatch: ^3.1.1 + once: ^1.3.0 + path-is-absolute: ^1.0.0 + checksum: 29452e97b38fa704dabb1d1045350fb2467cf0277e155aa9ff7077e90ad81d1ea9d53d3ee63bd37c05b09a065e90f16aec4a65f5b8de401d1dac40bc5605d133 + languageName: node + linkType: hard + +"graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0": + version: 4.2.8 + resolution: "graceful-fs@npm:4.2.8" + checksum: 5d224c8969ad0581d551dfabdb06882706b31af2561bd5e2034b4097e67cc27d05232849b8643866585fd0a41c7af152950f8776f4dd5579e9853733f31461c6 + languageName: node + linkType: hard + +"has-flag@npm:^4.0.0": + version: 4.0.0 + resolution: "has-flag@npm:4.0.0" + checksum: 261a1357037ead75e338156b1f9452c016a37dcd3283a972a30d9e4a87441ba372c8b81f818cd0fbcd9c0354b4ae7e18b9e1afa1971164aef6d18c2b6095a8ad + languageName: node + linkType: hard + +"http-reasons@npm:0.1.0": + version: 0.1.0 + resolution: "http-reasons@npm:0.1.0" + checksum: da232d6e958416593989e4078a0fdf0508de19e1efb88fc461e1e214f067c2a8827bb1bb906296b0d7c1108cb6aca8cda964c793d9130c4f1491c98369c7a29c + languageName: node + linkType: hard + +"http2-client@npm:^1.2.5": + version: 1.3.5 + resolution: "http2-client@npm:1.3.5" + checksum: 075970adefeb86538fbef810d46586569a689711d4585f4969e0f167344a8e59857eddc0203b428aea83a278070ffd1b3a3192529e93c47a88c71da9295258eb + languageName: node + linkType: hard + +"iconv-lite@npm:0.6.3": + version: 0.6.3 + resolution: "iconv-lite@npm:0.6.3" + dependencies: + safer-buffer: ">= 2.1.2 < 3.0.0" + checksum: 3f60d47a5c8fc3313317edfd29a00a692cc87a19cac0159e2ce711d0ebc9019064108323b5e493625e25594f11c6236647d8e256fbe7a58f4a3b33b89e6d30bf + languageName: node + linkType: hard + +"iconv-lite@npm:^0.4.24": + version: 0.4.24 + resolution: "iconv-lite@npm:0.4.24" + dependencies: + safer-buffer: ">= 2.1.2 < 3" + checksum: bd9f120f5a5b306f0bc0b9ae1edeb1577161503f5f8252a20f1a9e56ef8775c9959fd01c55f2d3a39d9a8abaf3e30c1abeb1895f367dcbbe0a8fd1c9ca01c4f6 + languageName: node + linkType: hard + +"ieee754@npm:^1.1.13": + version: 1.2.1 + resolution: "ieee754@npm:1.2.1" + checksum: 5144c0c9815e54ada181d80a0b810221a253562422e7c6c3a60b1901154184f49326ec239d618c416c1c5945a2e197107aee8d986a3dd836b53dffefd99b5e7e + languageName: node + linkType: hard + +"inflight@npm:^1.0.4": + version: 1.0.6 + resolution: "inflight@npm:1.0.6" + dependencies: + once: ^1.3.0 + wrappy: 1 + checksum: f4f76aa072ce19fae87ce1ef7d221e709afb59d445e05d47fba710e85470923a75de35bfae47da6de1b18afc3ce83d70facf44cfb0aff89f0a3f45c0a0244dfd + languageName: node + linkType: hard + +"inherits@npm:2, inherits@npm:^2.0.3, inherits@npm:^2.0.4": + version: 2.0.4 + resolution: "inherits@npm:2.0.4" + checksum: 4a48a733847879d6cf6691860a6b1e3f0f4754176e4d71494c41f3475553768b10f84b5ce1d40fbd0e34e6bfbb864ee35858ad4dd2cf31e02fc4a154b724d7f1 + languageName: node + linkType: hard + +"inquirer@npm:8.2.6": + version: 8.2.6 + resolution: "inquirer@npm:8.2.6" + dependencies: + ansi-escapes: ^4.2.1 + chalk: ^4.1.1 + cli-cursor: ^3.1.0 + cli-width: ^3.0.0 + external-editor: ^3.0.3 + figures: ^3.0.0 + lodash: ^4.17.21 + mute-stream: 0.0.8 + ora: ^5.4.1 + run-async: ^2.4.0 + rxjs: ^7.5.5 + string-width: ^4.1.0 + strip-ansi: ^6.0.0 + through: ^2.3.6 + wrap-ansi: ^6.0.1 + checksum: 387ffb0a513559cc7414eb42c57556a60e302f820d6960e89d376d092e257a919961cd485a1b4de693dbb5c0de8bc58320bfd6247dfd827a873aa82a4215a240 + languageName: node + linkType: hard + +"is-fullwidth-code-point@npm:^3.0.0": + version: 3.0.0 + resolution: "is-fullwidth-code-point@npm:3.0.0" + checksum: 44a30c29457c7fb8f00297bce733f0a64cd22eca270f83e58c105e0d015e45c019491a4ab2faef91ab51d4738c670daff901c799f6a700e27f7314029e99e348 + languageName: node + linkType: hard + +"is-interactive@npm:^1.0.0": + version: 1.0.0 + resolution: "is-interactive@npm:1.0.0" + checksum: 824808776e2d468b2916cdd6c16acacebce060d844c35ca6d82267da692e92c3a16fdba624c50b54a63f38bdc4016055b6f443ce57d7147240de4f8cdabaf6f9 + languageName: node + linkType: hard + +"is-unicode-supported@npm:^0.1.0": + version: 0.1.0 + resolution: "is-unicode-supported@npm:0.1.0" + checksum: a2aab86ee7712f5c2f999180daaba5f361bdad1efadc9610ff5b8ab5495b86e4f627839d085c6530363c6d6d4ecbde340fb8e54bdb83da4ba8e0865ed5513c52 + languageName: node + linkType: hard + +"iterare@npm:1.2.1": + version: 1.2.1 + resolution: "iterare@npm:1.2.1" + checksum: 70bc80038e3718aa9072bc63b3a0135166d7120bde46bfcaf80a88d11005dcef1b2d69cd353849f87a3f58ba8f546a8c6e6983408236ff01fa50b52339ee5223 + languageName: node + linkType: hard + +"js-yaml@npm:3.14.1": + version: 3.14.1 + resolution: "js-yaml@npm:3.14.1" + dependencies: + argparse: ^1.0.7 + esprima: ^4.0.0 + bin: + js-yaml: bin/js-yaml.js + checksum: bef146085f472d44dee30ec34e5cf36bf89164f5d585435a3d3da89e52622dff0b188a580e4ad091c3341889e14cb88cac6e4deb16dc5b1e9623bb0601fc255c + languageName: node + linkType: hard + +"json-schema-compare@npm:^0.2.2": + version: 0.2.2 + resolution: "json-schema-compare@npm:0.2.2" + dependencies: + lodash: ^4.17.4 + checksum: dd6f2173857c8e3b77d6ebdfa05bd505bba5b08709ab46b532722f5d1c33b5fee1fc8f3c97d0c0d011db25f9f3b0baf7ab783bb5f55c32abd9f1201760e43c2c + languageName: node + linkType: hard + +"json-schema-merge-allof@npm:0.8.1": + version: 0.8.1 + resolution: "json-schema-merge-allof@npm:0.8.1" + dependencies: + compute-lcm: ^1.1.2 + json-schema-compare: ^0.2.2 + lodash: ^4.17.20 + checksum: 82700f6ac77351959138d6b153d77375a8c29cf48d907241b85c8292dd77aabd8cb816400f2b0d17062c4ccc8893832ec4f664ab9c814927ef502e7a595ea873 + languageName: node + linkType: hard + +"json-schema-traverse@npm:^1.0.0": + version: 1.0.0 + resolution: "json-schema-traverse@npm:1.0.0" + checksum: 02f2f466cdb0362558b2f1fd5e15cce82ef55d60cd7f8fa828cf35ba74330f8d767fcae5c5c2adb7851fa811766c694b9405810879bc4e1ddd78a7c0e03658ad + languageName: node + linkType: hard + +"jsonfile@npm:^6.0.1": + version: 6.1.0 + resolution: "jsonfile@npm:6.1.0" + dependencies: + graceful-fs: ^4.1.6 + universalify: ^2.0.0 + dependenciesMeta: + graceful-fs: + optional: true + checksum: 7af3b8e1ac8fe7f1eccc6263c6ca14e1966fcbc74b618d3c78a0a2075579487547b94f72b7a1114e844a1e15bb00d440e5d1720bfc4612d790a6f285d5ea8354 + languageName: node + linkType: hard + +"liquid-json@npm:0.3.1": + version: 0.3.1 + resolution: "liquid-json@npm:0.3.1" + checksum: b215fb17e7c9409e69a207a0ae275710311c274156862f34a78401dde363f97f15b863462fcc487f2fc3fb1d778d7d9f1d537bf00925a272b506a36e90826e2c + languageName: node + linkType: hard + +"lodash@npm:4.17.21, lodash@npm:^4.17.20, lodash@npm:^4.17.21, lodash@npm:^4.17.4": + version: 4.17.21 + resolution: "lodash@npm:4.17.21" + checksum: eb835a2e51d381e561e508ce932ea50a8e5a68f4ebdd771ea240d3048244a8d13658acbd502cd4829768c56f2e16bdd4340b9ea141297d472517b83868e677f7 + languageName: node + linkType: hard + +"log-symbols@npm:^4.1.0": + version: 4.1.0 + resolution: "log-symbols@npm:4.1.0" + dependencies: + chalk: ^4.1.0 + is-unicode-supported: ^0.1.0 + checksum: fce1497b3135a0198803f9f07464165e9eb83ed02ceb2273930a6f8a508951178d8cf4f0378e9d28300a2ed2bc49050995d2bd5f53ab716bb15ac84d58c6ef74 + languageName: node + linkType: hard + +"lru-cache@npm:^6.0.0": + version: 6.0.0 + resolution: "lru-cache@npm:6.0.0" + dependencies: + yallist: ^4.0.0 + checksum: f97f499f898f23e4585742138a22f22526254fdba6d75d41a1c2526b3b6cc5747ef59c5612ba7375f42aca4f8461950e925ba08c991ead0651b4918b7c978297 + languageName: node + linkType: hard + +"mime-db@npm:1.48.0": + version: 1.48.0 + resolution: "mime-db@npm:1.48.0" + checksum: d778392e474a5e78c24eef5a2894261f0ed168d2762c1ac2a115aa34c2274c9426178b92a6cc55e9edb8f13e7e9b8116380b0e61db9ff6d763e62876a65eea57 + languageName: node + linkType: hard + +"mime-db@npm:1.52.0": + version: 1.52.0 + resolution: "mime-db@npm:1.52.0" + checksum: 0d99a03585f8b39d68182803b12ac601d9c01abfa28ec56204fa330bc9f3d1c5e14beb049bafadb3dbdf646dfb94b87e24d4ec7b31b7279ef906a8ea9b6a513f + languageName: node + linkType: hard + +"mime-format@npm:2.0.1": + version: 2.0.1 + resolution: "mime-format@npm:2.0.1" + dependencies: + charset: ^1.0.0 + checksum: 294a29035e8d430bba2cb5985a1bf31d9f97effe53bcaf269a816ed054c10b7883fa838f30aabaaccdd44d553dce40f32c39ec0efe21b58fa26a9dbfb02015cd + languageName: node + linkType: hard + +"mime-types@npm:2.1.31": + version: 2.1.31 + resolution: "mime-types@npm:2.1.31" + dependencies: + mime-db: 1.48.0 + checksum: eb1612aa96403823c7a2ccb1a39d58ce11477e685560186e7d369d8164260fd6fc1eeb56fa23acb6a4050583f417b2a685b69c23eb2bd8ed169fb0c6e323740a + languageName: node + linkType: hard + +"mime-types@npm:^2.1.12": + version: 2.1.35 + resolution: "mime-types@npm:2.1.35" + dependencies: + mime-db: 1.52.0 + checksum: 89a5b7f1def9f3af5dad6496c5ed50191ae4331cc5389d7c521c8ad28d5fdad2d06fd81baf38fed813dc4e46bb55c8145bb0ff406330818c9cf712fb2e9b3836 + languageName: node + linkType: hard + +"mimic-fn@npm:^2.1.0": + version: 2.1.0 + resolution: "mimic-fn@npm:2.1.0" + checksum: d2421a3444848ce7f84bd49115ddacff29c15745db73f54041edc906c14b131a38d05298dae3081667627a59b2eb1ca4b436ff2e1b80f69679522410418b478a + languageName: node + linkType: hard + +"minimatch@npm:^3.1.1": + version: 3.1.2 + resolution: "minimatch@npm:3.1.2" + dependencies: + brace-expansion: ^1.1.7 + checksum: c154e566406683e7bcb746e000b84d74465b3a832c45d59912b9b55cd50dee66e5c4b1e5566dba26154040e51672f9aa450a9aef0c97cfc7336b78b7afb9540a + languageName: node + linkType: hard + +"mute-stream@npm:0.0.8": + version: 0.0.8 + resolution: "mute-stream@npm:0.0.8" + checksum: ff48d251fc3f827e5b1206cda0ffdaec885e56057ee86a3155e1951bc940fd5f33531774b1cc8414d7668c10a8907f863f6561875ee6e8768931a62121a531a1 + languageName: node + linkType: hard + +"node-fetch-h2@npm:^2.3.0": + version: 2.3.0 + resolution: "node-fetch-h2@npm:2.3.0" + dependencies: + http2-client: ^1.2.5 + checksum: c836d6dc019ba399514e14502e6a36e16838cd5633c1525dff915f9d4ee86b7a73ef30d72327451699bd2eabe59cbf362b2185d11eff10026cd9094655ef7ed8 + languageName: node + linkType: hard + +"node-fetch@npm:^2.6.1": + version: 2.6.7 + resolution: "node-fetch@npm:2.6.7" + dependencies: + whatwg-url: ^5.0.0 + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + checksum: 8d816ffd1ee22cab8301c7756ef04f3437f18dace86a1dae22cf81db8ef29c0bf6655f3215cb0cdb22b420b6fe141e64b26905e7f33f9377a7fa59135ea3e10b + languageName: node + linkType: hard + +"oas-kit-common@npm:^1.0.8": + version: 1.0.8 + resolution: "oas-kit-common@npm:1.0.8" + dependencies: + fast-safe-stringify: ^2.0.7 + checksum: 576ab5f7c7fde551a9c780fde9392cb9dec5159b62c3ad4499e334bffdb12e089e97dccf2a9d0d1ac5be208f9d6f0e72da5ac3744d878134ef0177eed135cc52 + languageName: node + linkType: hard + +"oas-resolver-browser@npm:2.5.6": + version: 2.5.6 + resolution: "oas-resolver-browser@npm:2.5.6" + dependencies: + node-fetch-h2: ^2.3.0 + oas-kit-common: ^1.0.8 + path-browserify: ^1.0.1 + reftools: ^1.1.9 + yaml: ^1.10.0 + yargs: ^17.0.1 + bin: + resolve: resolve.js + checksum: f4db0c9a09af45e25c90aac486164c6414faf4dc0b1bcc13906f02569e175536f61d86aab7600795897c311c1e5fdace3aa537a91c21c4d818596772a9127a4a + languageName: node + linkType: hard + +"once@npm:^1.3.0": + version: 1.4.0 + resolution: "once@npm:1.4.0" + dependencies: + wrappy: 1 + checksum: cd0a88501333edd640d95f0d2700fbde6bff20b3d4d9bdc521bdd31af0656b5706570d6c6afe532045a20bb8dc0849f8332d6f2a416e0ba6d3d3b98806c7db68 + languageName: node + linkType: hard + +"onetime@npm:^5.1.0": + version: 5.1.2 + resolution: "onetime@npm:5.1.2" + dependencies: + mimic-fn: ^2.1.0 + checksum: 2478859ef817fc5d4e9c2f9e5728512ddd1dbc9fb7829ad263765bb6d3b91ce699d6e2332eef6b7dff183c2f490bd3349f1666427eaba4469fba0ac38dfd0d34 + languageName: node + linkType: hard + +"openapi-to-postmanv2@npm:^3.1.0": + version: 3.2.1 + resolution: "openapi-to-postmanv2@npm:3.2.1" + dependencies: + ajv: 8.1.0 + ajv-formats: 2.1.1 + async: 3.2.3 + commander: 2.20.3 + js-yaml: 3.14.1 + json-schema-merge-allof: 0.8.1 + lodash: 4.17.21 + oas-resolver-browser: 2.5.6 + path-browserify: 1.0.1 + postman-collection: 4.0.0 + yaml: 1.10.2 + bin: + openapi2postmanv2: bin/openapi2postmanv2.js + checksum: a2b5242412752ffc7d66e60f462cb1a76d0d54402622f2dbd1c7c9de707539a6e092964496e91ee880503a510d41ee8bd623fbd5fabcbc6ab5b594f15516f2c4 + languageName: node + linkType: hard + +"ora@npm:^5.4.1": + version: 5.4.1 + resolution: "ora@npm:5.4.1" + dependencies: + bl: ^4.1.0 + chalk: ^4.1.0 + cli-cursor: ^3.1.0 + cli-spinners: ^2.5.0 + is-interactive: ^1.0.0 + is-unicode-supported: ^0.1.0 + log-symbols: ^4.1.0 + strip-ansi: ^6.0.0 + wcwidth: ^1.0.1 + checksum: 28d476ee6c1049d68368c0dc922e7225e3b5600c3ede88fade8052837f9ed342625fdaa84a6209302587c8ddd9b664f71f0759833cbdb3a4cf81344057e63c63 + languageName: node + linkType: hard + +"os-tmpdir@npm:~1.0.2": + version: 1.0.2 + resolution: "os-tmpdir@npm:1.0.2" + checksum: 5666560f7b9f10182548bf7013883265be33620b1c1b4a4d405c25be2636f970c5488ff3e6c48de75b55d02bde037249fe5dbfbb4c0fb7714953d56aed062e6d + languageName: node + linkType: hard + +"path-browserify@npm:1.0.1, path-browserify@npm:^1.0.1": + version: 1.0.1 + resolution: "path-browserify@npm:1.0.1" + checksum: c6d7fa376423fe35b95b2d67990060c3ee304fc815ff0a2dc1c6c3cfaff2bd0d572ee67e18f19d0ea3bbe32e8add2a05021132ac40509416459fffee35200699 + languageName: node + linkType: hard + +"path-is-absolute@npm:^1.0.0": + version: 1.0.1 + resolution: "path-is-absolute@npm:1.0.1" + checksum: 060840f92cf8effa293bcc1bea81281bd7d363731d214cbe5c227df207c34cd727430f70c6037b5159c8a870b9157cba65e775446b0ab06fd5ecc7e54615a3b8 + languageName: node + linkType: hard + +"path-to-regexp@npm:3.2.0": + version: 3.2.0 + resolution: "path-to-regexp@npm:3.2.0" + checksum: c3d35cda3b26d9e604d789b9a1764bb9845f53ca8009d5809356b4677a3c064b0f01117a05a5b4b77bafd5ae002a82592e3f3495e885c22961f8b1dab8bd6ae7 + languageName: node + linkType: hard + +"postman-collection@npm:4.0.0": + version: 4.0.0 + resolution: "postman-collection@npm:4.0.0" + dependencies: + faker: 5.5.3 + file-type: 3.9.0 + http-reasons: 0.1.0 + iconv-lite: 0.6.3 + liquid-json: 0.3.1 + lodash: 4.17.21 + mime-format: 2.0.1 + mime-types: 2.1.31 + postman-url-encoder: 3.0.1 + semver: 7.3.5 + uuid: 8.3.2 + checksum: 5eb1165fb53051250d6ad62cc2ef5ebd60b30fe56c0e837f121902776dd146607bfec16e47cb4858e2f408e6c7d52d9e6d05c27d87ddc73e24505c24cba61285 + languageName: node + linkType: hard + +"postman-url-encoder@npm:3.0.1": + version: 3.0.1 + resolution: "postman-url-encoder@npm:3.0.1" + dependencies: + punycode: ^2.1.1 + checksum: 46184b5273569bbca1fa279547d46ae770d1956d2e3345edad5278089aadba2bc5d235041ab65230226187a0cce0fe4933382015a55fb6348ce642860a60565c + languageName: node + linkType: hard + +"proxy-from-env@npm:^1.1.0": + version: 1.1.0 + resolution: "proxy-from-env@npm:1.1.0" + checksum: ed7fcc2ba0a33404958e34d95d18638249a68c430e30fcb6c478497d72739ba64ce9810a24f53a7d921d0c065e5b78e3822759800698167256b04659366ca4d4 + languageName: node + linkType: hard + +"punycode@npm:^2.1.0, punycode@npm:^2.1.1": + version: 2.3.0 + resolution: "punycode@npm:2.3.0" + checksum: 39f760e09a2a3bbfe8f5287cf733ecdad69d6af2fe6f97ca95f24b8921858b91e9ea3c9eeec6e08cede96181b3bb33f95c6ffd8c77e63986508aa2e8159fa200 + languageName: node + linkType: hard + +"readable-stream@npm:^3.4.0": + version: 3.6.0 + resolution: "readable-stream@npm:3.6.0" + dependencies: + inherits: ^2.0.3 + string_decoder: ^1.1.1 + util-deprecate: ^1.0.1 + checksum: d4ea81502d3799439bb955a3a5d1d808592cf3133350ed352aeaa499647858b27b1c4013984900238b0873ec8d0d8defce72469fb7a83e61d53f5ad61cb80dc8 + languageName: node + linkType: hard + +"reflect-metadata@npm:0.1.13": + version: 0.1.13 + resolution: "reflect-metadata@npm:0.1.13" + checksum: 798d379a7b6f6455501145419505c97dd11cbc23857a386add2b9ef15963ccf15a48d9d15507afe01d4cd74116df8a213247200bac00320bd7c11ddeaa5e8fb4 + languageName: node + linkType: hard + +"reftools@npm:^1.1.9": + version: 1.1.9 + resolution: "reftools@npm:1.1.9" + checksum: 3b096e6a75ca3003f0642f69784d4eaad0caad75f0ae3b99f04f6b49380f34dbdeb21d8bf97f184d6ca5aef570bbeb1ef10ee2144494a50fc056c6b2e1422043 + languageName: node + linkType: hard + +"require-directory@npm:^2.1.1": + version: 2.1.1 + resolution: "require-directory@npm:2.1.1" + checksum: fb47e70bf0001fdeabdc0429d431863e9475e7e43ea5f94ad86503d918423c1543361cc5166d713eaa7029dd7a3d34775af04764bebff99ef413111a5af18c80 + languageName: node + linkType: hard + +"require-from-string@npm:^2.0.2": + version: 2.0.2 + resolution: "require-from-string@npm:2.0.2" + checksum: a03ef6895445f33a4015300c426699bc66b2b044ba7b670aa238610381b56d3f07c686251740d575e22f4c87531ba662d06937508f0f3c0f1ddc04db3130560b + languageName: node + linkType: hard + +"restore-cursor@npm:^3.1.0": + version: 3.1.0 + resolution: "restore-cursor@npm:3.1.0" + dependencies: + onetime: ^5.1.0 + signal-exit: ^3.0.2 + checksum: f877dd8741796b909f2a82454ec111afb84eb45890eb49ac947d87991379406b3b83ff9673a46012fca0d7844bb989f45cc5b788254cf1a39b6b5a9659de0630 + languageName: node + linkType: hard + +"root-workspace-0b6124@workspace:.": + version: 0.0.0-use.local + resolution: "root-workspace-0b6124@workspace:." + dependencies: + "@openapitools/openapi-generator-cli": ^2.9.0 + axios: ^0.26.1 + openapi-to-postmanv2: ^3.1.0 + semver: ^7.5.2 + languageName: unknown + linkType: soft + +"run-async@npm:^2.4.0": + version: 2.4.1 + resolution: "run-async@npm:2.4.1" + checksum: a2c88aa15df176f091a2878eb840e68d0bdee319d8d97bbb89112223259cebecb94bc0defd735662b83c2f7a30bed8cddb7d1674eb48ae7322dc602b22d03797 + languageName: node + linkType: hard + +"rxjs@npm:7.8.1, rxjs@npm:^7.5.5": + version: 7.8.1 + resolution: "rxjs@npm:7.8.1" + dependencies: + tslib: ^2.1.0 + checksum: de4b53db1063e618ec2eca0f7965d9137cabe98cf6be9272efe6c86b47c17b987383df8574861bcced18ebd590764125a901d5506082be84a8b8e364bf05f119 + languageName: node + linkType: hard + +"rxjs@npm:^6.6.3": + version: 6.6.7 + resolution: "rxjs@npm:6.6.7" + dependencies: + tslib: ^1.9.0 + checksum: bc334edef1bb8bbf56590b0b25734ba0deaf8825b703256a93714308ea36dff8a11d25533671adf8e104e5e8f256aa6fdfe39b2e248cdbd7a5f90c260acbbd1b + languageName: node + linkType: hard + +"safe-buffer@npm:~5.2.0": + version: 5.2.1 + resolution: "safe-buffer@npm:5.2.1" + checksum: b99c4b41fdd67a6aaf280fcd05e9ffb0813654894223afb78a31f14a19ad220bba8aba1cb14eddce1fcfb037155fe6de4e861784eb434f7d11ed58d1e70dd491 + languageName: node + linkType: hard + +"safer-buffer@npm:>= 2.1.2 < 3, safer-buffer@npm:>= 2.1.2 < 3.0.0": + version: 2.1.2 + resolution: "safer-buffer@npm:2.1.2" + checksum: cab8f25ae6f1434abee8d80023d7e72b598cf1327164ddab31003c51215526801e40b66c5e65d658a0af1e9d6478cadcb4c745f4bd6751f97d8644786c0978b0 + languageName: node + linkType: hard + +"semver@npm:7.3.5": + version: 7.3.5 + resolution: "semver@npm:7.3.5" + dependencies: + lru-cache: ^6.0.0 + bin: + semver: bin/semver.js + checksum: 5eafe6102bea2a7439897c1856362e31cc348ccf96efd455c8b5bc2c61e6f7e7b8250dc26b8828c1d76a56f818a7ee907a36ae9fb37a599d3d24609207001d60 + languageName: node + linkType: hard + +"semver@npm:^7.5.2": + version: 7.5.2 + resolution: "semver@npm:7.5.2" + dependencies: + lru-cache: ^6.0.0 + bin: + semver: bin/semver.js + checksum: 3fdf5d1e6f170fe8bcc41669e31787649af91af7f54f05c71d0865bb7aa27e8b92f68b3e6b582483e2c1c648008bc84249d2cd86301771fe5cbf7621d1fe5375 + languageName: node + linkType: hard + +"signal-exit@npm:^3.0.2": + version: 3.0.6 + resolution: "signal-exit@npm:3.0.6" + checksum: b819ac81ba757af559dad0804233ae31bf6f054591cd8a671e9cbcf09f21c72ec3076fe87d1e04861f5b33b47d63f0694b568de99c99cd733ee2060515beb6d5 + languageName: node + linkType: hard + +"spawn-command@npm:^0.0.2-1": + version: 0.0.2-1 + resolution: "spawn-command@npm:0.0.2-1" + checksum: 2cac8519332193d1ed37d57298c4a1f73095e9edd20440fbab4aa47f531da83831734f2b51c44bb42b2747bf3485dec3fa2b0a1003f74c67561f2636622e328b + languageName: node + linkType: hard + +"sprintf-js@npm:~1.0.2": + version: 1.0.3 + resolution: "sprintf-js@npm:1.0.3" + checksum: 19d79aec211f09b99ec3099b5b2ae2f6e9cdefe50bc91ac4c69144b6d3928a640bb6ae5b3def70c2e85a2c3d9f5ec2719921e3a59d3ca3ef4b2fd1a4656a0df3 + languageName: node + linkType: hard + +"string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.3": + version: 4.2.3 + resolution: "string-width@npm:4.2.3" + dependencies: + emoji-regex: ^8.0.0 + is-fullwidth-code-point: ^3.0.0 + strip-ansi: ^6.0.1 + checksum: e52c10dc3fbfcd6c3a15f159f54a90024241d0f149cf8aed2982a2d801d2e64df0bf1dc351cf8e95c3319323f9f220c16e740b06faecd53e2462df1d2b5443fb + languageName: node + linkType: hard + +"string_decoder@npm:^1.1.1": + version: 1.3.0 + resolution: "string_decoder@npm:1.3.0" + dependencies: + safe-buffer: ~5.2.0 + checksum: 8417646695a66e73aefc4420eb3b84cc9ffd89572861fe004e6aeb13c7bc00e2f616247505d2dbbef24247c372f70268f594af7126f43548565c68c117bdeb56 + languageName: node + linkType: hard + +"strip-ansi@npm:^6.0.0, strip-ansi@npm:^6.0.1": + version: 6.0.1 + resolution: "strip-ansi@npm:6.0.1" + dependencies: + ansi-regex: ^5.0.1 + checksum: f3cd25890aef3ba6e1a74e20896c21a46f482e93df4a06567cebf2b57edabb15133f1f94e57434e0a958d61186087b1008e89c94875d019910a213181a14fc8c + languageName: node + linkType: hard + +"supports-color@npm:^7.1.0": + version: 7.2.0 + resolution: "supports-color@npm:7.2.0" + dependencies: + has-flag: ^4.0.0 + checksum: 3dda818de06ebbe5b9653e07842d9479f3555ebc77e9a0280caf5a14fb877ffee9ed57007c3b78f5a6324b8dbeec648d9e97a24e2ed9fdb81ddc69ea07100f4a + languageName: node + linkType: hard + +"supports-color@npm:^8.1.0": + version: 8.1.1 + resolution: "supports-color@npm:8.1.1" + dependencies: + has-flag: ^4.0.0 + checksum: c052193a7e43c6cdc741eb7f378df605636e01ad434badf7324f17fb60c69a880d8d8fcdcb562cf94c2350e57b937d7425ab5b8326c67c2adc48f7c87c1db406 + languageName: node + linkType: hard + +"through@npm:^2.3.6": + version: 2.3.8 + resolution: "through@npm:2.3.8" + checksum: a38c3e059853c494af95d50c072b83f8b676a9ba2818dcc5b108ef252230735c54e0185437618596c790bbba8fcdaef5b290405981ffa09dce67b1f1bf190cbd + languageName: node + linkType: hard + +"tmp@npm:^0.0.33": + version: 0.0.33 + resolution: "tmp@npm:0.0.33" + dependencies: + os-tmpdir: ~1.0.2 + checksum: 902d7aceb74453ea02abbf58c203f4a8fc1cead89b60b31e354f74ed5b3fb09ea817f94fb310f884a5d16987dd9fa5a735412a7c2dd088dd3d415aa819ae3a28 + languageName: node + linkType: hard + +"tr46@npm:~0.0.3": + version: 0.0.3 + resolution: "tr46@npm:0.0.3" + checksum: 726321c5eaf41b5002e17ffbd1fb7245999a073e8979085dacd47c4b4e8068ff5777142fc6726d6ca1fd2ff16921b48788b87225cbc57c72636f6efa8efbffe3 + languageName: node + linkType: hard + +"tree-kill@npm:^1.2.2": + version: 1.2.2 + resolution: "tree-kill@npm:1.2.2" + bin: + tree-kill: cli.js + checksum: 49117f5f410d19c84b0464d29afb9642c863bc5ba40fcb9a245d474c6d5cc64d1b177a6e6713129eb346b40aebb9d4631d967517f9fbe8251c35b21b13cd96c7 + languageName: node + linkType: hard + +"tslib@npm:2.6.2": + version: 2.6.2 + resolution: "tslib@npm:2.6.2" + checksum: 329ea56123005922f39642318e3d1f0f8265d1e7fcb92c633e0809521da75eeaca28d2cf96d7248229deb40e5c19adf408259f4b9640afd20d13aecc1430f3ad + languageName: node + linkType: hard + +"tslib@npm:^1.9.0": + version: 1.14.1 + resolution: "tslib@npm:1.14.1" + checksum: dbe628ef87f66691d5d2959b3e41b9ca0045c3ee3c7c7b906cc1e328b39f199bb1ad9e671c39025bd56122ac57dfbf7385a94843b1cc07c60a4db74795829acd + languageName: node + linkType: hard + +"tslib@npm:^2.1.0": + version: 2.5.2 + resolution: "tslib@npm:2.5.2" + checksum: 4d3c1e238b94127ed0e88aa0380db3c2ddae581dc0f4bae5a982345e9f50ee5eda90835b8bfba99b02df10a5734470be197158c36f9129ac49fdc14a6a9da222 + languageName: node + linkType: hard + +"type-fest@npm:^0.21.3": + version: 0.21.3 + resolution: "type-fest@npm:0.21.3" + checksum: e6b32a3b3877f04339bae01c193b273c62ba7bfc9e325b8703c4ee1b32dc8fe4ef5dfa54bf78265e069f7667d058e360ae0f37be5af9f153b22382cd55a9afe0 + languageName: node + linkType: hard + +"uid@npm:2.0.2": + version: 2.0.2 + resolution: "uid@npm:2.0.2" + dependencies: + "@lukeed/csprng": ^1.0.0 + checksum: 98aabddcd6fe46f9b331b0378a93ee9cc51474348ada02006df9d10b4abc783ed596748ed9f20d7f6c5ff395dbcd1e764a65a68db6f39a31c95ae85ef13fe979 + languageName: node + linkType: hard + +"universalify@npm:^2.0.0": + version: 2.0.0 + resolution: "universalify@npm:2.0.0" + checksum: 2406a4edf4a8830aa6813278bab1f953a8e40f2f63a37873ffa9a3bc8f9745d06cc8e88f3572cb899b7e509013f7f6fcc3e37e8a6d914167a5381d8440518c44 + languageName: node + linkType: hard + +"uri-js@npm:^4.2.2": + version: 4.4.1 + resolution: "uri-js@npm:4.4.1" + dependencies: + punycode: ^2.1.0 + checksum: 7167432de6817fe8e9e0c9684f1d2de2bb688c94388f7569f7dbdb1587c9f4ca2a77962f134ec90be0cc4d004c939ff0d05acc9f34a0db39a3c797dada262633 + languageName: node + linkType: hard + +"util-deprecate@npm:^1.0.1": + version: 1.0.2 + resolution: "util-deprecate@npm:1.0.2" + checksum: 474acf1146cb2701fe3b074892217553dfcf9a031280919ba1b8d651a068c9b15d863b7303cb15bd00a862b498e6cf4ad7b4a08fb134edd5a6f7641681cb54a2 + languageName: node + linkType: hard + +"uuid@npm:8.3.2": + version: 8.3.2 + resolution: "uuid@npm:8.3.2" + bin: + uuid: dist/bin/uuid + checksum: 5575a8a75c13120e2f10e6ddc801b2c7ed7d8f3c8ac22c7ed0c7b2ba6383ec0abda88c905085d630e251719e0777045ae3236f04c812184b7c765f63a70e58df + languageName: node + linkType: hard + +"validate.io-array@npm:^1.0.3": + version: 1.0.6 + resolution: "validate.io-array@npm:1.0.6" + checksum: 54eca83ebc702e3e46499f9d9e77287a95ae25c4e727cd2fafee29c7333b3a36cca0c5d8f090b9406262786de80750fba85e7e7ef41e20bf8cc67d5570de449b + languageName: node + linkType: hard + +"validate.io-function@npm:^1.0.2": + version: 1.0.2 + resolution: "validate.io-function@npm:1.0.2" + checksum: e4cce2479a20cb7c42e8630c777fb107059c27bc32925f769e3a73ca5fd62b4892d897b3c80227e14d5fcd1c5b7d05544e0579d63e59f14034c0052cda7f7c44 + languageName: node + linkType: hard + +"validate.io-integer-array@npm:^1.0.0": + version: 1.0.0 + resolution: "validate.io-integer-array@npm:1.0.0" + dependencies: + validate.io-array: ^1.0.3 + validate.io-integer: ^1.0.4 + checksum: 5f6d7fab8df7d2bf546a05e830201768464605539c75a2c2417b632b4411a00df84b462f81eac75e1be95303e7e0ac92f244c137424739f4e15cd21c2eb52c7f + languageName: node + linkType: hard + +"validate.io-integer@npm:^1.0.4": + version: 1.0.5 + resolution: "validate.io-integer@npm:1.0.5" + dependencies: + validate.io-number: ^1.0.3 + checksum: 88b3f8bb5a5277a95305d64abbfc437079220ce4f57a148cc6113e7ccec03dd86b10a69d413982602aa90a62b8d516148a78716f550dcd3aff863ac1c2a7a5e6 + languageName: node + linkType: hard + +"validate.io-number@npm:^1.0.3": + version: 1.0.3 + resolution: "validate.io-number@npm:1.0.3" + checksum: 42418aeb6c969efa745475154fe576809b02eccd0961aad0421b090d6e7a12d23a3e28b0d5dddd2c6347c1a6bdccb82bba5048c716131cd20207244d50e07282 + languageName: node + linkType: hard + +"wcwidth@npm:>=1.0.1, wcwidth@npm:^1.0.1": + version: 1.0.1 + resolution: "wcwidth@npm:1.0.1" + dependencies: + defaults: ^1.0.3 + checksum: 814e9d1ddcc9798f7377ffa448a5a3892232b9275ebb30a41b529607691c0491de47cba426e917a4d08ded3ee7e9ba2f3fe32e62ee3cd9c7d3bafb7754bd553c + languageName: node + linkType: hard + +"webidl-conversions@npm:^3.0.0": + version: 3.0.1 + resolution: "webidl-conversions@npm:3.0.1" + checksum: c92a0a6ab95314bde9c32e1d0a6dfac83b578f8fa5f21e675bc2706ed6981bc26b7eb7e6a1fab158e5ce4adf9caa4a0aee49a52505d4d13c7be545f15021b17c + languageName: node + linkType: hard + +"whatwg-url@npm:^5.0.0": + version: 5.0.0 + resolution: "whatwg-url@npm:5.0.0" + dependencies: + tr46: ~0.0.3 + webidl-conversions: ^3.0.0 + checksum: b8daed4ad3356cc4899048a15b2c143a9aed0dfae1f611ebd55073310c7b910f522ad75d727346ad64203d7e6c79ef25eafd465f4d12775ca44b90fa82ed9e2c + languageName: node + linkType: hard + +"wrap-ansi@npm:^6.0.1": + version: 6.2.0 + resolution: "wrap-ansi@npm:6.2.0" + dependencies: + ansi-styles: ^4.0.0 + string-width: ^4.1.0 + strip-ansi: ^6.0.0 + checksum: 6cd96a410161ff617b63581a08376f0cb9162375adeb7956e10c8cd397821f7eb2a6de24eb22a0b28401300bf228c86e50617cd568209b5f6775b93c97d2fe3a + languageName: node + linkType: hard + +"wrap-ansi@npm:^7.0.0": + version: 7.0.0 + resolution: "wrap-ansi@npm:7.0.0" + dependencies: + ansi-styles: ^4.0.0 + string-width: ^4.1.0 + strip-ansi: ^6.0.0 + checksum: a790b846fd4505de962ba728a21aaeda189b8ee1c7568ca5e817d85930e06ef8d1689d49dbf0e881e8ef84436af3a88bc49115c2e2788d841ff1b8b5b51a608b + languageName: node + linkType: hard + +"wrappy@npm:1": + version: 1.0.2 + resolution: "wrappy@npm:1.0.2" + checksum: 159da4805f7e84a3d003d8841557196034155008f817172d4e986bd591f74aa82aa7db55929a54222309e01079a65a92a9e6414da5a6aa4b01ee44a511ac3ee5 + languageName: node + linkType: hard + +"y18n@npm:^5.0.5": + version: 5.0.8 + resolution: "y18n@npm:5.0.8" + checksum: 54f0fb95621ee60898a38c572c515659e51cc9d9f787fb109cef6fde4befbe1c4602dc999d30110feee37456ad0f1660fa2edcfde6a9a740f86a290999550d30 + languageName: node + linkType: hard + +"yallist@npm:^4.0.0": + version: 4.0.0 + resolution: "yallist@npm:4.0.0" + checksum: 343617202af32df2a15a3be36a5a8c0c8545208f3d3dfbc6bb7c3e3b7e8c6f8e7485432e4f3b88da3031a6e20afa7c711eded32ddfb122896ac5d914e75848d5 + languageName: node + linkType: hard + +"yaml@npm:1.10.2, yaml@npm:^1.10.0": + version: 1.10.2 + resolution: "yaml@npm:1.10.2" + checksum: ce4ada136e8a78a0b08dc10b4b900936912d15de59905b2bf415b4d33c63df1d555d23acb2a41b23cf9fb5da41c256441afca3d6509de7247daa062fd2c5ea5f + languageName: node + linkType: hard + +"yargs-parser@npm:^20.2.2": + version: 20.2.9 + resolution: "yargs-parser@npm:20.2.9" + checksum: 8bb69015f2b0ff9e17b2c8e6bfe224ab463dd00ca211eece72a4cd8a906224d2703fb8a326d36fdd0e68701e201b2a60ed7cf81ce0fd9b3799f9fe7745977ae3 + languageName: node + linkType: hard + +"yargs-parser@npm:^21.1.1": + version: 21.1.1 + resolution: "yargs-parser@npm:21.1.1" + checksum: ed2d96a616a9e3e1cc7d204c62ecc61f7aaab633dcbfab2c6df50f7f87b393993fe6640d017759fe112d0cb1e0119f2b4150a87305cc873fd90831c6a58ccf1c + languageName: node + linkType: hard + +"yargs@npm:^16.2.0": + version: 16.2.0 + resolution: "yargs@npm:16.2.0" + dependencies: + cliui: ^7.0.2 + escalade: ^3.1.1 + get-caller-file: ^2.0.5 + require-directory: ^2.1.1 + string-width: ^4.2.0 + y18n: ^5.0.5 + yargs-parser: ^20.2.2 + checksum: b14afbb51e3251a204d81937c86a7e9d4bdbf9a2bcee38226c900d00f522969ab675703bee2a6f99f8e20103f608382936034e64d921b74df82b63c07c5e8f59 + languageName: node + linkType: hard + +"yargs@npm:^17.0.1": + version: 17.7.2 + resolution: "yargs@npm:17.7.2" + dependencies: + cliui: ^8.0.1 + escalade: ^3.1.1 + get-caller-file: ^2.0.5 + require-directory: ^2.1.1 + string-width: ^4.2.3 + y18n: ^5.0.5 + yargs-parser: ^21.1.1 + checksum: 73b572e863aa4a8cbef323dd911d79d193b772defd5a51aab0aca2d446655216f5002c42c5306033968193bdbf892a7a4c110b0d77954a7fdf563e653967b56a + languageName: node + linkType: hard