diff --git a/go/internal/openapi/api_endpoint.go b/go/internal/openapi/api_endpoint.go index 99c711544..ca55aea94 100644 --- a/go/internal/openapi/api_endpoint.go +++ b/go/internal/openapi/api_endpoint.go @@ -409,7 +409,7 @@ func (a *EndpointApiService) V1EndpointDeleteExecute(r ApiV1EndpointDeleteReques return localVarHTTPResponse, nil } -type ApiV1EndpointGetRequest struct { +type ApiV1EndpointDeleteMtlsConfigRequest struct { ctx _context.Context ApiService *EndpointApiService appId string @@ -417,20 +417,20 @@ type ApiV1EndpointGetRequest struct { } -func (r ApiV1EndpointGetRequest) Execute() (EndpointOut, *_nethttp.Response, error) { - return r.ApiService.V1EndpointGetExecute(r) +func (r ApiV1EndpointDeleteMtlsConfigRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.V1EndpointDeleteMtlsConfigExecute(r) } /* - * V1EndpointGet Get Endpoint - * Get an endpoint. + * V1EndpointDeleteMtlsConfig Delete Endpoint Mtls Config + * Delete endpoint mTLS configuration * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param appId The app's ID or UID * @param endpointId The ep's ID or UID - * @return ApiV1EndpointGetRequest + * @return ApiV1EndpointDeleteMtlsConfigRequest */ -func (a *EndpointApiService) V1EndpointGet(ctx _context.Context, appId string, endpointId string) ApiV1EndpointGetRequest { - return ApiV1EndpointGetRequest{ +func (a *EndpointApiService) V1EndpointDeleteMtlsConfig(ctx _context.Context, appId string, endpointId string) ApiV1EndpointDeleteMtlsConfigRequest { + return ApiV1EndpointDeleteMtlsConfigRequest{ ApiService: a, ctx: ctx, appId: appId, @@ -440,24 +440,22 @@ 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) { +func (a *EndpointApiService) V1EndpointDeleteMtlsConfigExecute(r ApiV1EndpointDeleteMtlsConfigRequest) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue EndpointOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointDeleteMtlsConfig") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}" + localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/mtls" localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) @@ -465,16 +463,16 @@ func (a *EndpointApiService) V1EndpointGetExecute(r ApiV1EndpointGetRequest) (En localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if strlen(r.appId) < 1 { - return localVarReturnValue, nil, reportError("appId must have at least 1 elements") + return 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") + return nil, reportError("appId must have less than 256 elements") } if strlen(r.endpointId) < 1 { - return localVarReturnValue, nil, reportError("endpointId must have at least 1 elements") + return nil, reportError("endpointId must have at least 1 elements") } if strlen(r.endpointId) > 256 { - return localVarReturnValue, nil, reportError("endpointId must have less than 256 elements") + return nil, reportError("endpointId must have less than 256 elements") } // to determine the Content-Type header @@ -496,19 +494,19 @@ func (a *EndpointApiService) V1EndpointGetExecute(r ApiV1EndpointGetRequest) (En } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -521,86 +519,77 @@ func (a *EndpointApiService) V1EndpointGetExecute(r ApiV1EndpointGetRequest) (En err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { var v HTTPValidationError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarHTTPResponse, nil } -type ApiV1EndpointGetHeadersRequest struct { +type ApiV1EndpointDeleteOauthConfigRequest struct { ctx _context.Context ApiService *EndpointApiService appId string @@ -608,20 +597,20 @@ type ApiV1EndpointGetHeadersRequest struct { } -func (r ApiV1EndpointGetHeadersRequest) Execute() (EndpointHeadersOut, *_nethttp.Response, error) { - return r.ApiService.V1EndpointGetHeadersExecute(r) +func (r ApiV1EndpointDeleteOauthConfigRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.V1EndpointDeleteOauthConfigExecute(r) } /* - * V1EndpointGetHeaders Get Endpoint Headers - * Get the additional headers to be sent with the webhook + * V1EndpointDeleteOauthConfig Delete Endpoint Oauth Config + * Delete endpoint OAuth configuration * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param appId The app's ID or UID * @param endpointId The ep's ID or UID - * @return ApiV1EndpointGetHeadersRequest + * @return ApiV1EndpointDeleteOauthConfigRequest */ -func (a *EndpointApiService) V1EndpointGetHeaders(ctx _context.Context, appId string, endpointId string) ApiV1EndpointGetHeadersRequest { - return ApiV1EndpointGetHeadersRequest{ +func (a *EndpointApiService) V1EndpointDeleteOauthConfig(ctx _context.Context, appId string, endpointId string) ApiV1EndpointDeleteOauthConfigRequest { + return ApiV1EndpointDeleteOauthConfigRequest{ ApiService: a, ctx: ctx, appId: appId, @@ -631,24 +620,22 @@ 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) { +func (a *EndpointApiService) V1EndpointDeleteOauthConfigExecute(r ApiV1EndpointDeleteOauthConfigRequest) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue EndpointHeadersOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointGetHeaders") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointDeleteOauthConfig") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers" + localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/oauth" localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) @@ -656,16 +643,16 @@ func (a *EndpointApiService) V1EndpointGetHeadersExecute(r ApiV1EndpointGetHeade localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if strlen(r.appId) < 1 { - return localVarReturnValue, nil, reportError("appId must have at least 1 elements") + return 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") + return nil, reportError("appId must have less than 256 elements") } if strlen(r.endpointId) < 1 { - return localVarReturnValue, nil, reportError("endpointId must have at least 1 elements") + return nil, reportError("endpointId must have at least 1 elements") } if strlen(r.endpointId) > 256 { - return localVarReturnValue, nil, reportError("endpointId must have less than 256 elements") + return nil, reportError("endpointId must have less than 256 elements") } // to determine the Content-Type header @@ -687,19 +674,19 @@ func (a *EndpointApiService) V1EndpointGetHeadersExecute(r ApiV1EndpointGetHeade } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -712,86 +699,77 @@ func (a *EndpointApiService) V1EndpointGetHeadersExecute(r ApiV1EndpointGetHeade err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { var v HTTPValidationError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarHTTPResponse, nil } -type ApiV1EndpointGetSecretRequest struct { +type ApiV1EndpointGetRequest struct { ctx _context.Context ApiService *EndpointApiService appId string @@ -799,23 +777,20 @@ type ApiV1EndpointGetSecretRequest struct { } -func (r ApiV1EndpointGetSecretRequest) Execute() (EndpointSecretOut, *_nethttp.Response, error) { - return r.ApiService.V1EndpointGetSecretExecute(r) +func (r ApiV1EndpointGetRequest) Execute() (EndpointOut, *_nethttp.Response, error) { + return r.ApiService.V1EndpointGetExecute(r) } /* - * 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/). + * 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 ApiV1EndpointGetSecretRequest + * @return ApiV1EndpointGetRequest */ -func (a *EndpointApiService) V1EndpointGetSecret(ctx _context.Context, appId string, endpointId string) ApiV1EndpointGetSecretRequest { - return ApiV1EndpointGetSecretRequest{ +func (a *EndpointApiService) V1EndpointGet(ctx _context.Context, appId string, endpointId string) ApiV1EndpointGetRequest { + return ApiV1EndpointGetRequest{ ApiService: a, ctx: ctx, appId: appId, @@ -825,24 +800,24 @@ func (a *EndpointApiService) V1EndpointGetSecret(ctx _context.Context, appId str /* * Execute executes the request - * @return EndpointSecretOut + * @return EndpointOut */ -func (a *EndpointApiService) V1EndpointGetSecretExecute(r ApiV1EndpointGetSecretRequest) (EndpointSecretOut, *_nethttp.Response, error) { +func (a *EndpointApiService) V1EndpointGetExecute(r ApiV1EndpointGetRequest) (EndpointOut, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue EndpointSecretOut + localVarReturnValue EndpointOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointGetSecret") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret" + 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) @@ -985,38 +960,28 @@ func (a *EndpointApiService) V1EndpointGetSecretExecute(r ApiV1EndpointGetSecret return localVarReturnValue, localVarHTTPResponse, nil } -type ApiV1EndpointGetStatsRequest struct { +type ApiV1EndpointGetHeadersRequest struct { ctx _context.Context ApiService *EndpointApiService appId string endpointId string - since *time.Time - until *time.Time } -func (r ApiV1EndpointGetStatsRequest) Since(since time.Time) ApiV1EndpointGetStatsRequest { - r.since = &since - return r -} -func (r ApiV1EndpointGetStatsRequest) Until(until time.Time) ApiV1EndpointGetStatsRequest { - r.until = &until - return r -} -func (r ApiV1EndpointGetStatsRequest) Execute() (EndpointStats, *_nethttp.Response, error) { - return r.ApiService.V1EndpointGetStatsExecute(r) +func (r ApiV1EndpointGetHeadersRequest) Execute() (EndpointHeadersOut, *_nethttp.Response, error) { + return r.ApiService.V1EndpointGetHeadersExecute(r) } /* - * V1EndpointGetStats Endpoint Stats - * Get basic statistics for the endpoint. + * 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 ApiV1EndpointGetStatsRequest + * @return ApiV1EndpointGetHeadersRequest */ -func (a *EndpointApiService) V1EndpointGetStats(ctx _context.Context, appId string, endpointId string) ApiV1EndpointGetStatsRequest { - return ApiV1EndpointGetStatsRequest{ +func (a *EndpointApiService) V1EndpointGetHeaders(ctx _context.Context, appId string, endpointId string) ApiV1EndpointGetHeadersRequest { + return ApiV1EndpointGetHeadersRequest{ ApiService: a, ctx: ctx, appId: appId, @@ -1026,24 +991,24 @@ func (a *EndpointApiService) V1EndpointGetStats(ctx _context.Context, appId stri /* * Execute executes the request - * @return EndpointStats + * @return EndpointHeadersOut */ -func (a *EndpointApiService) V1EndpointGetStatsExecute(r ApiV1EndpointGetStatsRequest) (EndpointStats, *_nethttp.Response, error) { +func (a *EndpointApiService) V1EndpointGetHeadersExecute(r ApiV1EndpointGetHeadersRequest) (EndpointHeadersOut, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue EndpointStats + localVarReturnValue EndpointHeadersOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointGetStats") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointGetHeaders") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/stats" + 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) @@ -1063,12 +1028,6 @@ func (a *EndpointApiService) V1EndpointGetStatsExecute(r ApiV1EndpointGetStatsRe return localVarReturnValue, nil, reportError("endpointId must have less than 256 elements") } - if r.since != nil { - localVarQueryParams.Add("since", parameterToString(*r.since, "")) - } - if r.until != nil { - localVarQueryParams.Add("until", parameterToString(*r.until, "")) - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1192,68 +1151,60 @@ func (a *EndpointApiService) V1EndpointGetStatsExecute(r ApiV1EndpointGetStatsRe return localVarReturnValue, localVarHTTPResponse, nil } -type ApiV1EndpointListRequest struct { +type ApiV1EndpointGetSecretRequest struct { ctx _context.Context ApiService *EndpointApiService appId string - limit *int32 - iterator *string - order *Ordering + endpointId string } -func (r ApiV1EndpointListRequest) Limit(limit int32) ApiV1EndpointListRequest { - r.limit = &limit - return r -} -func (r ApiV1EndpointListRequest) Iterator(iterator string) ApiV1EndpointListRequest { - r.iterator = &iterator - return r -} -func (r ApiV1EndpointListRequest) Order(order Ordering) ApiV1EndpointListRequest { - r.order = &order - return r -} -func (r ApiV1EndpointListRequest) Execute() (ListResponseEndpointOut, *_nethttp.Response, error) { - return r.ApiService.V1EndpointListExecute(r) +func (r ApiV1EndpointGetSecretRequest) Execute() (EndpointSecretOut, *_nethttp.Response, error) { + return r.ApiService.V1EndpointGetSecretExecute(r) } /* - * V1EndpointList List Endpoints - * List the application's endpoints. + * 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 - * @return ApiV1EndpointListRequest + * @param endpointId The ep's ID or UID + * @return ApiV1EndpointGetSecretRequest */ -func (a *EndpointApiService) V1EndpointList(ctx _context.Context, appId string) ApiV1EndpointListRequest { - return ApiV1EndpointListRequest{ +func (a *EndpointApiService) V1EndpointGetSecret(ctx _context.Context, appId string, endpointId string) ApiV1EndpointGetSecretRequest { + return ApiV1EndpointGetSecretRequest{ ApiService: a, ctx: ctx, appId: appId, + endpointId: endpointId, } } /* * Execute executes the request - * @return ListResponseEndpointOut + * @return EndpointSecretOut */ -func (a *EndpointApiService) V1EndpointListExecute(r ApiV1EndpointListRequest) (ListResponseEndpointOut, *_nethttp.Response, error) { +func (a *EndpointApiService) V1EndpointGetSecretExecute(r ApiV1EndpointGetSecretRequest) (EndpointSecretOut, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue ListResponseEndpointOut + localVarReturnValue EndpointSecretOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointList") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointGetSecret") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint" + 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) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1264,16 +1215,13 @@ func (a *EndpointApiService) V1EndpointListExecute(r ApiV1EndpointListRequest) ( if strlen(r.appId) > 256 { return localVarReturnValue, nil, reportError("appId must have less than 256 elements") } - - if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) - } - if r.iterator != nil { - localVarQueryParams.Add("iterator", parameterToString(*r.iterator, "")) + if strlen(r.endpointId) < 1 { + return localVarReturnValue, nil, reportError("endpointId must have at least 1 elements") } - if r.order != nil { - localVarQueryParams.Add("order", parameterToString(*r.order, "")) + if strlen(r.endpointId) > 256 { + return localVarReturnValue, nil, reportError("endpointId must have less than 256 elements") } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1397,33 +1345,38 @@ func (a *EndpointApiService) V1EndpointListExecute(r ApiV1EndpointListRequest) ( return localVarReturnValue, localVarHTTPResponse, nil } -type ApiV1EndpointPatchRequest struct { +type ApiV1EndpointGetStatsRequest struct { ctx _context.Context ApiService *EndpointApiService appId string endpointId string - endpointPatch *EndpointPatch + since *time.Time + until *time.Time } -func (r ApiV1EndpointPatchRequest) EndpointPatch(endpointPatch EndpointPatch) ApiV1EndpointPatchRequest { - r.endpointPatch = &endpointPatch +func (r ApiV1EndpointGetStatsRequest) Since(since time.Time) ApiV1EndpointGetStatsRequest { + r.since = &since + return r +} +func (r ApiV1EndpointGetStatsRequest) Until(until time.Time) ApiV1EndpointGetStatsRequest { + r.until = &until return r } -func (r ApiV1EndpointPatchRequest) Execute() (EndpointOut, *_nethttp.Response, error) { - return r.ApiService.V1EndpointPatchExecute(r) +func (r ApiV1EndpointGetStatsRequest) Execute() (EndpointStats, *_nethttp.Response, error) { + return r.ApiService.V1EndpointGetStatsExecute(r) } /* - * V1EndpointPatch Patch Endpoint - * Partially update an endpoint. + * 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 ApiV1EndpointPatchRequest + * @return ApiV1EndpointGetStatsRequest */ -func (a *EndpointApiService) V1EndpointPatch(ctx _context.Context, appId string, endpointId string) ApiV1EndpointPatchRequest { - return ApiV1EndpointPatchRequest{ +func (a *EndpointApiService) V1EndpointGetStats(ctx _context.Context, appId string, endpointId string) ApiV1EndpointGetStatsRequest { + return ApiV1EndpointGetStatsRequest{ ApiService: a, ctx: ctx, appId: appId, @@ -1433,24 +1386,24 @@ func (a *EndpointApiService) V1EndpointPatch(ctx _context.Context, appId string, /* * Execute executes the request - * @return EndpointOut + * @return EndpointStats */ -func (a *EndpointApiService) V1EndpointPatchExecute(r ApiV1EndpointPatchRequest) (EndpointOut, *_nethttp.Response, error) { +func (a *EndpointApiService) V1EndpointGetStatsExecute(r ApiV1EndpointGetStatsRequest) (EndpointStats, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue EndpointOut + localVarReturnValue EndpointStats ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointPatch") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointGetStats") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}" + 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) @@ -1469,12 +1422,15 @@ func (a *EndpointApiService) V1EndpointPatchExecute(r ApiV1EndpointPatchRequest) if strlen(r.endpointId) > 256 { return localVarReturnValue, nil, reportError("endpointId must have less than 256 elements") } - if r.endpointPatch == nil { - return localVarReturnValue, nil, reportError("endpointPatch is required and must be specified") - } + if r.since != nil { + localVarQueryParams.Add("since", parameterToString(*r.since, "")) + } + if r.until != nil { + localVarQueryParams.Add("until", parameterToString(*r.until, "")) + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -1490,8 +1446,6 @@ func (a *EndpointApiService) V1EndpointPatchExecute(r ApiV1EndpointPatchRequest) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.endpointPatch req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err @@ -1598,82 +1552,90 @@ func (a *EndpointApiService) V1EndpointPatchExecute(r ApiV1EndpointPatchRequest) return localVarReturnValue, localVarHTTPResponse, nil } -type ApiV1EndpointPatchHeadersRequest struct { +type ApiV1EndpointListRequest struct { ctx _context.Context ApiService *EndpointApiService appId string - endpointId string - endpointHeadersPatchIn *EndpointHeadersPatchIn + limit *int32 + iterator *string + order *Ordering } -func (r ApiV1EndpointPatchHeadersRequest) EndpointHeadersPatchIn(endpointHeadersPatchIn EndpointHeadersPatchIn) ApiV1EndpointPatchHeadersRequest { - r.endpointHeadersPatchIn = &endpointHeadersPatchIn +func (r ApiV1EndpointListRequest) Limit(limit int32) ApiV1EndpointListRequest { + r.limit = &limit + return r +} +func (r ApiV1EndpointListRequest) Iterator(iterator string) ApiV1EndpointListRequest { + r.iterator = &iterator + return r +} +func (r ApiV1EndpointListRequest) Order(order Ordering) ApiV1EndpointListRequest { + r.order = &order return r } -func (r ApiV1EndpointPatchHeadersRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.V1EndpointPatchHeadersExecute(r) +func (r ApiV1EndpointListRequest) Execute() (ListResponseEndpointOut, *_nethttp.Response, error) { + return r.ApiService.V1EndpointListExecute(r) } /* - * V1EndpointPatchHeaders Patch Endpoint Headers - * Partially set the additional headers to be sent with the webhook + * 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 - * @param endpointId The ep's ID or UID - * @return ApiV1EndpointPatchHeadersRequest + * @return ApiV1EndpointListRequest */ -func (a *EndpointApiService) V1EndpointPatchHeaders(ctx _context.Context, appId string, endpointId string) ApiV1EndpointPatchHeadersRequest { - return ApiV1EndpointPatchHeadersRequest{ +func (a *EndpointApiService) V1EndpointList(ctx _context.Context, appId string) ApiV1EndpointListRequest { + return ApiV1EndpointListRequest{ ApiService: a, ctx: ctx, appId: appId, - endpointId: endpointId, } } /* * Execute executes the request + * @return ListResponseEndpointOut */ -func (a *EndpointApiService) V1EndpointPatchHeadersExecute(r ApiV1EndpointPatchHeadersRequest) (*_nethttp.Response, error) { +func (a *EndpointApiService) V1EndpointListExecute(r ApiV1EndpointListRequest) (ListResponseEndpointOut, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + localVarReturnValue ListResponseEndpointOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointPatchHeaders") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointList") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers" + localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint" localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if strlen(r.appId) < 1 { - return nil, reportError("appId must have at least 1 elements") + return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } if strlen(r.appId) > 256 { - return nil, reportError("appId must have less than 256 elements") + return localVarReturnValue, nil, reportError("appId must have less than 256 elements") } - if strlen(r.endpointId) < 1 { - return nil, reportError("endpointId must have at least 1 elements") + + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) } - if strlen(r.endpointId) > 256 { - return nil, reportError("endpointId must have less than 256 elements") + if r.iterator != nil { + localVarQueryParams.Add("iterator", parameterToString(*r.iterator, "")) } - if r.endpointHeadersPatchIn == nil { - return nil, reportError("endpointHeadersPatchIn is required and must be specified") + if r.order != nil { + localVarQueryParams.Add("order", parameterToString(*r.order, "")) } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -1689,23 +1651,21 @@ func (a *EndpointApiService) V1EndpointPatchHeadersExecute(r ApiV1EndpointPatchH if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.endpointHeadersPatchIn req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -1718,108 +1678,112 @@ func (a *EndpointApiService) V1EndpointPatchHeadersExecute(r ApiV1EndpointPatchH err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { var v HTTPValidationError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v } - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil } -type ApiV1EndpointRecoverRequest struct { +type ApiV1EndpointPatchRequest struct { ctx _context.Context ApiService *EndpointApiService appId string endpointId string - recoverIn *RecoverIn - idempotencyKey *string + endpointPatch *EndpointPatch } -func (r ApiV1EndpointRecoverRequest) RecoverIn(recoverIn RecoverIn) ApiV1EndpointRecoverRequest { - r.recoverIn = &recoverIn - return r -} -func (r ApiV1EndpointRecoverRequest) IdempotencyKey(idempotencyKey string) ApiV1EndpointRecoverRequest { - r.idempotencyKey = &idempotencyKey +func (r ApiV1EndpointPatchRequest) EndpointPatch(endpointPatch EndpointPatch) ApiV1EndpointPatchRequest { + r.endpointPatch = &endpointPatch return r } -func (r ApiV1EndpointRecoverRequest) Execute() (RecoverOut, *_nethttp.Response, error) { - return r.ApiService.V1EndpointRecoverExecute(r) +func (r ApiV1EndpointPatchRequest) Execute() (EndpointOut, *_nethttp.Response, error) { + return r.ApiService.V1EndpointPatchExecute(r) } /* - * V1EndpointRecover Recover Failed Webhooks - * Resend all failed messages since a given time. + * 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 ApiV1EndpointRecoverRequest + * @return ApiV1EndpointPatchRequest */ -func (a *EndpointApiService) V1EndpointRecover(ctx _context.Context, appId string, endpointId string) ApiV1EndpointRecoverRequest { - return ApiV1EndpointRecoverRequest{ +func (a *EndpointApiService) V1EndpointPatch(ctx _context.Context, appId string, endpointId string) ApiV1EndpointPatchRequest { + return ApiV1EndpointPatchRequest{ ApiService: a, ctx: ctx, appId: appId, @@ -1829,24 +1793,24 @@ func (a *EndpointApiService) V1EndpointRecover(ctx _context.Context, appId strin /* * Execute executes the request - * @return RecoverOut + * @return EndpointOut */ -func (a *EndpointApiService) V1EndpointRecoverExecute(r ApiV1EndpointRecoverRequest) (RecoverOut, *_nethttp.Response, error) { +func (a *EndpointApiService) V1EndpointPatchExecute(r ApiV1EndpointPatchRequest) (EndpointOut, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue RecoverOut + localVarReturnValue EndpointOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointRecover") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointPatch") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover" + 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) @@ -1865,8 +1829,8 @@ func (a *EndpointApiService) V1EndpointRecoverExecute(r ApiV1EndpointRecoverRequ if strlen(r.endpointId) > 256 { return localVarReturnValue, nil, reportError("endpointId must have less than 256 elements") } - if r.recoverIn == nil { - return localVarReturnValue, nil, reportError("recoverIn is required and must be specified") + if r.endpointPatch == nil { + return localVarReturnValue, nil, reportError("endpointPatch is required and must be specified") } // to determine the Content-Type header @@ -1886,11 +1850,8 @@ func (a *EndpointApiService) V1EndpointRecoverExecute(r ApiV1EndpointRecoverRequ if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") - } // body params - localVarPostBody = r.recoverIn + localVarPostBody = r.endpointPatch req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err @@ -1997,38 +1958,33 @@ func (a *EndpointApiService) V1EndpointRecoverExecute(r ApiV1EndpointRecoverRequ return localVarReturnValue, localVarHTTPResponse, nil } -type ApiV1EndpointReplayRequest struct { +type ApiV1EndpointPatchHeadersRequest struct { ctx _context.Context ApiService *EndpointApiService appId string endpointId string - replayIn *ReplayIn - idempotencyKey *string + endpointHeadersPatchIn *EndpointHeadersPatchIn } -func (r ApiV1EndpointReplayRequest) ReplayIn(replayIn ReplayIn) ApiV1EndpointReplayRequest { - r.replayIn = &replayIn - return r -} -func (r ApiV1EndpointReplayRequest) IdempotencyKey(idempotencyKey string) ApiV1EndpointReplayRequest { - r.idempotencyKey = &idempotencyKey +func (r ApiV1EndpointPatchHeadersRequest) EndpointHeadersPatchIn(endpointHeadersPatchIn EndpointHeadersPatchIn) ApiV1EndpointPatchHeadersRequest { + r.endpointHeadersPatchIn = &endpointHeadersPatchIn return r } -func (r ApiV1EndpointReplayRequest) Execute() (ReplayOut, *_nethttp.Response, error) { - return r.ApiService.V1EndpointReplayExecute(r) +func (r ApiV1EndpointPatchHeadersRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.V1EndpointPatchHeadersExecute(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. + * 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 ApiV1EndpointReplayRequest + * @return ApiV1EndpointPatchHeadersRequest */ -func (a *EndpointApiService) V1EndpointReplay(ctx _context.Context, appId string, endpointId string) ApiV1EndpointReplayRequest { - return ApiV1EndpointReplayRequest{ +func (a *EndpointApiService) V1EndpointPatchHeaders(ctx _context.Context, appId string, endpointId string) ApiV1EndpointPatchHeadersRequest { + return ApiV1EndpointPatchHeadersRequest{ ApiService: a, ctx: ctx, appId: appId, @@ -2038,24 +1994,22 @@ 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) { +func (a *EndpointApiService) V1EndpointPatchHeadersExecute(r ApiV1EndpointPatchHeadersRequest) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue ReplayOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointReplay") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointPatchHeaders") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing" + 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) @@ -2063,19 +2017,19 @@ func (a *EndpointApiService) V1EndpointReplayExecute(r ApiV1EndpointReplayReques localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if strlen(r.appId) < 1 { - return localVarReturnValue, nil, reportError("appId must have at least 1 elements") + return 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") + return nil, reportError("appId must have less than 256 elements") } if strlen(r.endpointId) < 1 { - return localVarReturnValue, nil, reportError("endpointId must have at least 1 elements") + return nil, reportError("endpointId must have at least 1 elements") } if strlen(r.endpointId) > 256 { - return localVarReturnValue, nil, reportError("endpointId must have less than 256 elements") + return nil, reportError("endpointId must have less than 256 elements") } - if r.replayIn == nil { - return localVarReturnValue, nil, reportError("replayIn is required and must be specified") + if r.endpointHeadersPatchIn == nil { + return nil, reportError("endpointHeadersPatchIn is required and must be specified") } // to determine the Content-Type header @@ -2095,26 +2049,23 @@ func (a *EndpointApiService) V1EndpointReplayExecute(r ApiV1EndpointReplayReques if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") - } // body params - localVarPostBody = r.replayIn + localVarPostBody = r.endpointHeadersPatchIn req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -2127,117 +2078,108 @@ func (a *EndpointApiService) V1EndpointReplayExecute(r ApiV1EndpointReplayReques err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { var v HTTPValidationError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarHTTPResponse, nil } -type ApiV1EndpointRotateSecretRequest struct { +type ApiV1EndpointRecoverRequest struct { ctx _context.Context ApiService *EndpointApiService appId string endpointId string - endpointSecretRotateIn *EndpointSecretRotateIn + recoverIn *RecoverIn idempotencyKey *string } -func (r ApiV1EndpointRotateSecretRequest) EndpointSecretRotateIn(endpointSecretRotateIn EndpointSecretRotateIn) ApiV1EndpointRotateSecretRequest { - r.endpointSecretRotateIn = &endpointSecretRotateIn +func (r ApiV1EndpointRecoverRequest) RecoverIn(recoverIn RecoverIn) ApiV1EndpointRecoverRequest { + r.recoverIn = &recoverIn return r } -func (r ApiV1EndpointRotateSecretRequest) IdempotencyKey(idempotencyKey string) ApiV1EndpointRotateSecretRequest { +func (r ApiV1EndpointRecoverRequest) IdempotencyKey(idempotencyKey string) ApiV1EndpointRecoverRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1EndpointRotateSecretRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.V1EndpointRotateSecretExecute(r) +func (r ApiV1EndpointRecoverRequest) Execute() (RecoverOut, *_nethttp.Response, error) { + return r.ApiService.V1EndpointRecoverExecute(r) } /* - * V1EndpointRotateSecret Rotate Endpoint Secret - * Rotates the endpoint's signing secret. The previous secret will be valid for the next 24 hours. + * 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 ApiV1EndpointRotateSecretRequest + * @return ApiV1EndpointRecoverRequest */ -func (a *EndpointApiService) V1EndpointRotateSecret(ctx _context.Context, appId string, endpointId string) ApiV1EndpointRotateSecretRequest { - return ApiV1EndpointRotateSecretRequest{ +func (a *EndpointApiService) V1EndpointRecover(ctx _context.Context, appId string, endpointId string) ApiV1EndpointRecoverRequest { + return ApiV1EndpointRecoverRequest{ ApiService: a, ctx: ctx, appId: appId, @@ -2247,22 +2189,24 @@ func (a *EndpointApiService) V1EndpointRotateSecret(ctx _context.Context, appId /* * Execute executes the request + * @return RecoverOut */ -func (a *EndpointApiService) V1EndpointRotateSecretExecute(r ApiV1EndpointRotateSecretRequest) (*_nethttp.Response, error) { +func (a *EndpointApiService) V1EndpointRecoverExecute(r ApiV1EndpointRecoverRequest) (RecoverOut, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + localVarReturnValue RecoverOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointRotateSecret") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointRecover") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate" + 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) @@ -2270,19 +2214,19 @@ func (a *EndpointApiService) V1EndpointRotateSecretExecute(r ApiV1EndpointRotate localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if strlen(r.appId) < 1 { - return nil, reportError("appId must have at least 1 elements") + return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } if strlen(r.appId) > 256 { - return nil, reportError("appId must have less than 256 elements") + return localVarReturnValue, nil, reportError("appId must have less than 256 elements") } if strlen(r.endpointId) < 1 { - return nil, reportError("endpointId must have at least 1 elements") + return localVarReturnValue, nil, reportError("endpointId must have at least 1 elements") } if strlen(r.endpointId) > 256 { - return nil, reportError("endpointId must have less than 256 elements") + return localVarReturnValue, nil, reportError("endpointId must have less than 256 elements") } - if r.endpointSecretRotateIn == nil { - return nil, reportError("endpointSecretRotateIn is required and must be specified") + if r.recoverIn == nil { + return localVarReturnValue, nil, reportError("recoverIn is required and must be specified") } // to determine the Content-Type header @@ -2306,22 +2250,22 @@ func (a *EndpointApiService) V1EndpointRotateSecretExecute(r ApiV1EndpointRotate localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") } // body params - localVarPostBody = r.endpointSecretRotateIn + localVarPostBody = r.recoverIn req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -2334,108 +2278,117 @@ func (a *EndpointApiService) V1EndpointRotateSecretExecute(r ApiV1EndpointRotate err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { var v HTTPValidationError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v } - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil } -type ApiV1EndpointSendExampleRequest struct { +type ApiV1EndpointReplayRequest struct { ctx _context.Context ApiService *EndpointApiService appId string endpointId string - eventExampleIn *EventExampleIn + replayIn *ReplayIn idempotencyKey *string } -func (r ApiV1EndpointSendExampleRequest) EventExampleIn(eventExampleIn EventExampleIn) ApiV1EndpointSendExampleRequest { - r.eventExampleIn = &eventExampleIn +func (r ApiV1EndpointReplayRequest) ReplayIn(replayIn ReplayIn) ApiV1EndpointReplayRequest { + r.replayIn = &replayIn return r } -func (r ApiV1EndpointSendExampleRequest) IdempotencyKey(idempotencyKey string) ApiV1EndpointSendExampleRequest { +func (r ApiV1EndpointReplayRequest) IdempotencyKey(idempotencyKey string) ApiV1EndpointReplayRequest { r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1EndpointSendExampleRequest) Execute() (MessageOut, *_nethttp.Response, error) { - return r.ApiService.V1EndpointSendExampleExecute(r) +func (r ApiV1EndpointReplayRequest) Execute() (ReplayOut, *_nethttp.Response, error) { + return r.ApiService.V1EndpointReplayExecute(r) } /* - * V1EndpointSendExample Send Event Type Example Message - * Send an example message for event + * 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 ApiV1EndpointSendExampleRequest + * @return ApiV1EndpointReplayRequest */ -func (a *EndpointApiService) V1EndpointSendExample(ctx _context.Context, appId string, endpointId string) ApiV1EndpointSendExampleRequest { - return ApiV1EndpointSendExampleRequest{ +func (a *EndpointApiService) V1EndpointReplay(ctx _context.Context, appId string, endpointId string) ApiV1EndpointReplayRequest { + return ApiV1EndpointReplayRequest{ ApiService: a, ctx: ctx, appId: appId, @@ -2445,24 +2398,24 @@ func (a *EndpointApiService) V1EndpointSendExample(ctx _context.Context, appId s /* * Execute executes the request - * @return MessageOut + * @return ReplayOut */ -func (a *EndpointApiService) V1EndpointSendExampleExecute(r ApiV1EndpointSendExampleRequest) (MessageOut, *_nethttp.Response, error) { +func (a *EndpointApiService) V1EndpointReplayExecute(r ApiV1EndpointReplayRequest) (ReplayOut, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue MessageOut + localVarReturnValue ReplayOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointSendExample") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointReplay") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example" + 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) @@ -2481,8 +2434,8 @@ func (a *EndpointApiService) V1EndpointSendExampleExecute(r ApiV1EndpointSendExa if strlen(r.endpointId) > 256 { return localVarReturnValue, nil, reportError("endpointId must have less than 256 elements") } - if r.eventExampleIn == nil { - return localVarReturnValue, nil, reportError("eventExampleIn is required and must be specified") + if r.replayIn == nil { + return localVarReturnValue, nil, reportError("replayIn is required and must be specified") } // to determine the Content-Type header @@ -2506,7 +2459,7 @@ func (a *EndpointApiService) V1EndpointSendExampleExecute(r ApiV1EndpointSendExa localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") } // body params - localVarPostBody = r.eventExampleIn + localVarPostBody = r.replayIn req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err @@ -2613,28 +2566,38 @@ func (a *EndpointApiService) V1EndpointSendExampleExecute(r ApiV1EndpointSendExa return localVarReturnValue, localVarHTTPResponse, nil } -type ApiV1EndpointTransformationGetRequest struct { +type ApiV1EndpointRotateSecretRequest struct { ctx _context.Context ApiService *EndpointApiService appId string endpointId string + endpointSecretRotateIn *EndpointSecretRotateIn + idempotencyKey *string } +func (r ApiV1EndpointRotateSecretRequest) EndpointSecretRotateIn(endpointSecretRotateIn EndpointSecretRotateIn) ApiV1EndpointRotateSecretRequest { + r.endpointSecretRotateIn = &endpointSecretRotateIn + return r +} +func (r ApiV1EndpointRotateSecretRequest) IdempotencyKey(idempotencyKey string) ApiV1EndpointRotateSecretRequest { + r.idempotencyKey = &idempotencyKey + return r +} -func (r ApiV1EndpointTransformationGetRequest) Execute() (EndpointTransformationOut, *_nethttp.Response, error) { - return r.ApiService.V1EndpointTransformationGetExecute(r) +func (r ApiV1EndpointRotateSecretRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.V1EndpointRotateSecretExecute(r) } /* - * V1EndpointTransformationGet Get Endpoint Transformation - * Get the transformation code associated with this endpoint + * 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 ApiV1EndpointTransformationGetRequest + * @return ApiV1EndpointRotateSecretRequest */ -func (a *EndpointApiService) V1EndpointTransformationGet(ctx _context.Context, appId string, endpointId string) ApiV1EndpointTransformationGetRequest { - return ApiV1EndpointTransformationGetRequest{ +func (a *EndpointApiService) V1EndpointRotateSecret(ctx _context.Context, appId string, endpointId string) ApiV1EndpointRotateSecretRequest { + return ApiV1EndpointRotateSecretRequest{ ApiService: a, ctx: ctx, appId: appId, @@ -2644,24 +2607,22 @@ func (a *EndpointApiService) V1EndpointTransformationGet(ctx _context.Context, a /* * Execute executes the request - * @return EndpointTransformationOut */ -func (a *EndpointApiService) V1EndpointTransformationGetExecute(r ApiV1EndpointTransformationGetRequest) (EndpointTransformationOut, *_nethttp.Response, error) { +func (a *EndpointApiService) V1EndpointRotateSecretExecute(r ApiV1EndpointRotateSecretRequest) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue EndpointTransformationOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointTransformationGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointRotateSecret") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation" + 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) @@ -2669,20 +2630,23 @@ func (a *EndpointApiService) V1EndpointTransformationGetExecute(r ApiV1EndpointT localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if strlen(r.appId) < 1 { - return localVarReturnValue, nil, reportError("appId must have at least 1 elements") + return 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") + return nil, reportError("appId must have less than 256 elements") } if strlen(r.endpointId) < 1 { - return localVarReturnValue, nil, reportError("endpointId must have at least 1 elements") + return nil, reportError("endpointId must have at least 1 elements") } if strlen(r.endpointId) > 256 { - return localVarReturnValue, nil, reportError("endpointId must have less than 256 elements") + return nil, reportError("endpointId must have less than 256 elements") } - + if r.endpointSecretRotateIn == nil { + return nil, reportError("endpointSecretRotateIn is required and must be specified") + } + // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -2698,21 +2662,26 @@ func (a *EndpointApiService) V1EndpointTransformationGetExecute(r ApiV1EndpointT if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.idempotencyKey != nil { + localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + } + // body params + localVarPostBody = r.endpointSecretRotateIn req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -2725,112 +2694,108 @@ func (a *EndpointApiService) V1EndpointTransformationGetExecute(r ApiV1EndpointT err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { var v HTTPValidationError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.model = v } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarHTTPResponse, nil } -type ApiV1EndpointTransformationPartialUpdateRequest struct { +type ApiV1EndpointSendExampleRequest struct { ctx _context.Context ApiService *EndpointApiService appId string endpointId string - endpointTransformationIn *EndpointTransformationIn + eventExampleIn *EventExampleIn + idempotencyKey *string } -func (r ApiV1EndpointTransformationPartialUpdateRequest) EndpointTransformationIn(endpointTransformationIn EndpointTransformationIn) ApiV1EndpointTransformationPartialUpdateRequest { - r.endpointTransformationIn = &endpointTransformationIn +func (r ApiV1EndpointSendExampleRequest) EventExampleIn(eventExampleIn EventExampleIn) ApiV1EndpointSendExampleRequest { + r.eventExampleIn = &eventExampleIn + return r +} +func (r ApiV1EndpointSendExampleRequest) IdempotencyKey(idempotencyKey string) ApiV1EndpointSendExampleRequest { + r.idempotencyKey = &idempotencyKey return r } -func (r ApiV1EndpointTransformationPartialUpdateRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.V1EndpointTransformationPartialUpdateExecute(r) +func (r ApiV1EndpointSendExampleRequest) Execute() (MessageOut, *_nethttp.Response, error) { + return r.ApiService.V1EndpointSendExampleExecute(r) } /* - * V1EndpointTransformationPartialUpdate Set Endpoint Transformation - * Set or unset the transformation code associated with this endpoint + * 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 ApiV1EndpointTransformationPartialUpdateRequest + * @return ApiV1EndpointSendExampleRequest */ -func (a *EndpointApiService) V1EndpointTransformationPartialUpdate(ctx _context.Context, appId string, endpointId string) ApiV1EndpointTransformationPartialUpdateRequest { - return ApiV1EndpointTransformationPartialUpdateRequest{ +func (a *EndpointApiService) V1EndpointSendExample(ctx _context.Context, appId string, endpointId string) ApiV1EndpointSendExampleRequest { + return ApiV1EndpointSendExampleRequest{ ApiService: a, ctx: ctx, appId: appId, @@ -2840,22 +2805,24 @@ func (a *EndpointApiService) V1EndpointTransformationPartialUpdate(ctx _context. /* * Execute executes the request + * @return MessageOut */ -func (a *EndpointApiService) V1EndpointTransformationPartialUpdateExecute(r ApiV1EndpointTransformationPartialUpdateRequest) (*_nethttp.Response, error) { +func (a *EndpointApiService) V1EndpointSendExampleExecute(r ApiV1EndpointSendExampleRequest) (MessageOut, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + localVarReturnValue MessageOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointTransformationPartialUpdate") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointSendExample") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation" + 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) @@ -2863,19 +2830,19 @@ func (a *EndpointApiService) V1EndpointTransformationPartialUpdateExecute(r ApiV localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if strlen(r.appId) < 1 { - return nil, reportError("appId must have at least 1 elements") + return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } if strlen(r.appId) > 256 { - return nil, reportError("appId must have less than 256 elements") + return localVarReturnValue, nil, reportError("appId must have less than 256 elements") } if strlen(r.endpointId) < 1 { - return nil, reportError("endpointId must have at least 1 elements") + return localVarReturnValue, nil, reportError("endpointId must have at least 1 elements") } if strlen(r.endpointId) > 256 { - return nil, reportError("endpointId must have less than 256 elements") + return localVarReturnValue, nil, reportError("endpointId must have less than 256 elements") } - if r.endpointTransformationIn == nil { - return nil, reportError("endpointTransformationIn is required and must be specified") + if r.eventExampleIn == nil { + return localVarReturnValue, nil, reportError("eventExampleIn is required and must be specified") } // to determine the Content-Type header @@ -2895,23 +2862,26 @@ func (a *EndpointApiService) V1EndpointTransformationPartialUpdateExecute(r ApiV if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.idempotencyKey != nil { + localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + } // body params - localVarPostBody = r.endpointTransformationIn + localVarPostBody = r.eventExampleIn req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return nil, err + return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -2924,108 +2894,107 @@ func (a *EndpointApiService) V1EndpointTransformationPartialUpdateExecute(r ApiV err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 422 { var v HTTPValidationError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 429 { var v HttpErrorOut err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.model = v } - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil } -type ApiV1EndpointTransformationSimulateRequest struct { +type ApiV1EndpointTransformationGetRequest struct { ctx _context.Context ApiService *EndpointApiService appId string endpointId string - endpointTransformationSimulateIn *EndpointTransformationSimulateIn - idempotencyKey *string } -func (r ApiV1EndpointTransformationSimulateRequest) EndpointTransformationSimulateIn(endpointTransformationSimulateIn EndpointTransformationSimulateIn) ApiV1EndpointTransformationSimulateRequest { - r.endpointTransformationSimulateIn = &endpointTransformationSimulateIn - return r -} -func (r ApiV1EndpointTransformationSimulateRequest) IdempotencyKey(idempotencyKey string) ApiV1EndpointTransformationSimulateRequest { - r.idempotencyKey = &idempotencyKey - return r -} -func (r ApiV1EndpointTransformationSimulateRequest) Execute() (EndpointTransformationSimulateOut, *_nethttp.Response, error) { - return r.ApiService.V1EndpointTransformationSimulateExecute(r) +func (r ApiV1EndpointTransformationGetRequest) Execute() (EndpointTransformationOut, *_nethttp.Response, error) { + return r.ApiService.V1EndpointTransformationGetExecute(r) } /* - * V1EndpointTransformationSimulate Simulate - * Simulate running the transformation on the payload and code + * 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 ApiV1EndpointTransformationSimulateRequest + * @return ApiV1EndpointTransformationGetRequest */ -func (a *EndpointApiService) V1EndpointTransformationSimulate(ctx _context.Context, appId string, endpointId string) ApiV1EndpointTransformationSimulateRequest { - return ApiV1EndpointTransformationSimulateRequest{ +func (a *EndpointApiService) V1EndpointTransformationGet(ctx _context.Context, appId string, endpointId string) ApiV1EndpointTransformationGetRequest { + return ApiV1EndpointTransformationGetRequest{ ApiService: a, ctx: ctx, appId: appId, @@ -3035,24 +3004,24 @@ func (a *EndpointApiService) V1EndpointTransformationSimulate(ctx _context.Conte /* * Execute executes the request - * @return EndpointTransformationSimulateOut + * @return EndpointTransformationOut */ -func (a *EndpointApiService) V1EndpointTransformationSimulateExecute(r ApiV1EndpointTransformationSimulateRequest) (EndpointTransformationSimulateOut, *_nethttp.Response, error) { +func (a *EndpointApiService) V1EndpointTransformationGetExecute(r ApiV1EndpointTransformationGetRequest) (EndpointTransformationOut, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue EndpointTransformationSimulateOut + localVarReturnValue EndpointTransformationOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointTransformationSimulate") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointTransformationGet") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation/simulate" + 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) @@ -3071,12 +3040,9 @@ func (a *EndpointApiService) V1EndpointTransformationSimulateExecute(r ApiV1Endp if strlen(r.endpointId) > 256 { return localVarReturnValue, nil, reportError("endpointId must have less than 256 elements") } - if r.endpointTransformationSimulateIn == nil { - return localVarReturnValue, nil, reportError("endpointTransformationSimulateIn is required and must be specified") - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -3092,11 +3058,6 @@ func (a *EndpointApiService) V1EndpointTransformationSimulateExecute(r ApiV1Endp if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if r.idempotencyKey != nil { - localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") - } - // body params - localVarPostBody = r.endpointTransformationSimulateIn req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err @@ -3203,33 +3164,33 @@ func (a *EndpointApiService) V1EndpointTransformationSimulateExecute(r ApiV1Endp return localVarReturnValue, localVarHTTPResponse, nil } -type ApiV1EndpointUpdateRequest struct { +type ApiV1EndpointTransformationPartialUpdateRequest struct { ctx _context.Context ApiService *EndpointApiService appId string endpointId string - endpointUpdate *EndpointUpdate + endpointTransformationIn *EndpointTransformationIn } -func (r ApiV1EndpointUpdateRequest) EndpointUpdate(endpointUpdate EndpointUpdate) ApiV1EndpointUpdateRequest { - r.endpointUpdate = &endpointUpdate +func (r ApiV1EndpointTransformationPartialUpdateRequest) EndpointTransformationIn(endpointTransformationIn EndpointTransformationIn) ApiV1EndpointTransformationPartialUpdateRequest { + r.endpointTransformationIn = &endpointTransformationIn return r } -func (r ApiV1EndpointUpdateRequest) Execute() (EndpointOut, *_nethttp.Response, error) { - return r.ApiService.V1EndpointUpdateExecute(r) +func (r ApiV1EndpointTransformationPartialUpdateRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.V1EndpointTransformationPartialUpdateExecute(r) } /* - * V1EndpointUpdate Update Endpoint - * Update an endpoint. + * 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 ApiV1EndpointUpdateRequest + * @return ApiV1EndpointTransformationPartialUpdateRequest */ -func (a *EndpointApiService) V1EndpointUpdate(ctx _context.Context, appId string, endpointId string) ApiV1EndpointUpdateRequest { - return ApiV1EndpointUpdateRequest{ +func (a *EndpointApiService) V1EndpointTransformationPartialUpdate(ctx _context.Context, appId string, endpointId string) ApiV1EndpointTransformationPartialUpdateRequest { + return ApiV1EndpointTransformationPartialUpdateRequest{ ApiService: a, ctx: ctx, appId: appId, @@ -3239,24 +3200,22 @@ 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) { +func (a *EndpointApiService) V1EndpointTransformationPartialUpdateExecute(r ApiV1EndpointTransformationPartialUpdateRequest) (*_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue EndpointOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointUpdate") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointTransformationPartialUpdate") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}" + 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) @@ -3264,19 +3223,19 @@ func (a *EndpointApiService) V1EndpointUpdateExecute(r ApiV1EndpointUpdateReques localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if strlen(r.appId) < 1 { - return localVarReturnValue, nil, reportError("appId must have at least 1 elements") + return 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") + return nil, reportError("appId must have less than 256 elements") } if strlen(r.endpointId) < 1 { - return localVarReturnValue, nil, reportError("endpointId must have at least 1 elements") + return nil, reportError("endpointId must have at least 1 elements") } if strlen(r.endpointId) > 256 { - return localVarReturnValue, nil, reportError("endpointId must have less than 256 elements") + return nil, reportError("endpointId must have less than 256 elements") } - if r.endpointUpdate == nil { - return localVarReturnValue, nil, reportError("endpointUpdate is required and must be specified") + if r.endpointTransformationIn == nil { + return nil, reportError("endpointTransformationIn is required and must be specified") } // to determine the Content-Type header @@ -3297,15 +3256,215 @@ func (a *EndpointApiService) V1EndpointUpdateExecute(r ApiV1EndpointUpdateReques localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.endpointUpdate + localVarPostBody = r.endpointTransformationIn req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { - return localVarReturnValue, nil, err + return nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v HTTPValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiV1EndpointTransformationSimulateRequest struct { + ctx _context.Context + ApiService *EndpointApiService + appId string + endpointId string + endpointTransformationSimulateIn *EndpointTransformationSimulateIn + idempotencyKey *string +} + +func (r ApiV1EndpointTransformationSimulateRequest) EndpointTransformationSimulateIn(endpointTransformationSimulateIn EndpointTransformationSimulateIn) ApiV1EndpointTransformationSimulateRequest { + r.endpointTransformationSimulateIn = &endpointTransformationSimulateIn + return r +} +func (r ApiV1EndpointTransformationSimulateRequest) IdempotencyKey(idempotencyKey string) ApiV1EndpointTransformationSimulateRequest { + r.idempotencyKey = &idempotencyKey + return r +} + +func (r ApiV1EndpointTransformationSimulateRequest) Execute() (EndpointTransformationSimulateOut, *_nethttp.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 { + return ApiV1EndpointTransformationSimulateRequest{ + ApiService: a, + ctx: ctx, + appId: appId, + endpointId: endpointId, + } +} + +/* + * Execute executes the request + * @return EndpointTransformationSimulateOut + */ +func (a *EndpointApiService) V1EndpointTransformationSimulateExecute(r ApiV1EndpointTransformationSimulateRequest) (EndpointTransformationSimulateOut, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue EndpointTransformationSimulateOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointTransformationSimulate") + if err != nil { + 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) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if strlen(r.appId) < 1 { + return localVarReturnValue, nil, reportError("appId must have at least 1 elements") + } + if strlen(r.appId) > 256 { + return localVarReturnValue, nil, reportError("appId must have less than 256 elements") + } + if strlen(r.endpointId) < 1 { + return localVarReturnValue, nil, reportError("endpointId must have at least 1 elements") + } + if strlen(r.endpointId) > 256 { + return localVarReturnValue, nil, reportError("endpointId must have less than 256 elements") + } + if r.endpointTransformationSimulateIn == nil { + return localVarReturnValue, nil, reportError("endpointTransformationSimulateIn is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.idempotencyKey != nil { + localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + } + // body params + localVarPostBody = r.endpointTransformationSimulateIn + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) @@ -3404,33 +3563,33 @@ func (a *EndpointApiService) V1EndpointUpdateExecute(r ApiV1EndpointUpdateReques return localVarReturnValue, localVarHTTPResponse, nil } -type ApiV1EndpointUpdateHeadersRequest struct { +type ApiV1EndpointUpdateRequest struct { ctx _context.Context ApiService *EndpointApiService appId string endpointId string - endpointHeadersIn *EndpointHeadersIn + endpointUpdate *EndpointUpdate } -func (r ApiV1EndpointUpdateHeadersRequest) EndpointHeadersIn(endpointHeadersIn EndpointHeadersIn) ApiV1EndpointUpdateHeadersRequest { - r.endpointHeadersIn = &endpointHeadersIn +func (r ApiV1EndpointUpdateRequest) EndpointUpdate(endpointUpdate EndpointUpdate) ApiV1EndpointUpdateRequest { + r.endpointUpdate = &endpointUpdate return r } -func (r ApiV1EndpointUpdateHeadersRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.V1EndpointUpdateHeadersExecute(r) +func (r ApiV1EndpointUpdateRequest) Execute() (EndpointOut, *_nethttp.Response, error) { + return r.ApiService.V1EndpointUpdateExecute(r) } /* - * V1EndpointUpdateHeaders Update Endpoint Headers - * Set the additional headers to be sent with the webhook + * 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 ApiV1EndpointUpdateHeadersRequest + * @return ApiV1EndpointUpdateRequest */ -func (a *EndpointApiService) V1EndpointUpdateHeaders(ctx _context.Context, appId string, endpointId string) ApiV1EndpointUpdateHeadersRequest { - return ApiV1EndpointUpdateHeadersRequest{ +func (a *EndpointApiService) V1EndpointUpdate(ctx _context.Context, appId string, endpointId string) ApiV1EndpointUpdateRequest { + return ApiV1EndpointUpdateRequest{ ApiService: a, ctx: ctx, appId: appId, @@ -3440,22 +3599,24 @@ func (a *EndpointApiService) V1EndpointUpdateHeaders(ctx _context.Context, appId /* * Execute executes the request + * @return EndpointOut */ -func (a *EndpointApiService) V1EndpointUpdateHeadersExecute(r ApiV1EndpointUpdateHeadersRequest) (*_nethttp.Response, error) { +func (a *EndpointApiService) V1EndpointUpdateExecute(r ApiV1EndpointUpdateRequest) (EndpointOut, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte + localVarReturnValue EndpointOut ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointUpdateHeaders") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointUpdate") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers" + 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) @@ -3463,19 +3624,19 @@ func (a *EndpointApiService) V1EndpointUpdateHeadersExecute(r ApiV1EndpointUpdat localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} if strlen(r.appId) < 1 { - return nil, reportError("appId must have at least 1 elements") + return localVarReturnValue, nil, reportError("appId must have at least 1 elements") } if strlen(r.appId) > 256 { - return nil, reportError("appId must have less than 256 elements") + return localVarReturnValue, nil, reportError("appId must have less than 256 elements") } if strlen(r.endpointId) < 1 { - return nil, reportError("endpointId must have at least 1 elements") + return localVarReturnValue, nil, reportError("endpointId must have at least 1 elements") } if strlen(r.endpointId) > 256 { - return nil, reportError("endpointId must have less than 256 elements") + return localVarReturnValue, nil, reportError("endpointId must have less than 256 elements") } - if r.endpointHeadersIn == nil { - return nil, reportError("endpointHeadersIn is required and must be specified") + if r.endpointUpdate == nil { + return localVarReturnValue, nil, reportError("endpointUpdate is required and must be specified") } // to determine the Content-Type header @@ -3496,7 +3657,586 @@ func (a *EndpointApiService) V1EndpointUpdateHeadersExecute(r ApiV1EndpointUpdat localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.endpointHeadersIn + localVarPostBody = r.endpointUpdate + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v HTTPValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiV1EndpointUpdateHeadersRequest struct { + ctx _context.Context + ApiService *EndpointApiService + appId string + endpointId string + endpointHeadersIn *EndpointHeadersIn +} + +func (r ApiV1EndpointUpdateHeadersRequest) EndpointHeadersIn(endpointHeadersIn EndpointHeadersIn) ApiV1EndpointUpdateHeadersRequest { + r.endpointHeadersIn = &endpointHeadersIn + return r +} + +func (r ApiV1EndpointUpdateHeadersRequest) Execute() (*_nethttp.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 { + return ApiV1EndpointUpdateHeadersRequest{ + ApiService: a, + ctx: ctx, + appId: appId, + endpointId: endpointId, + } +} + +/* + * Execute executes the request + */ +func (a *EndpointApiService) V1EndpointUpdateHeadersExecute(r ApiV1EndpointUpdateHeadersRequest) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointUpdateHeaders") + if err != nil { + 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) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if strlen(r.appId) < 1 { + return nil, reportError("appId must have at least 1 elements") + } + if strlen(r.appId) > 256 { + return nil, reportError("appId must have less than 256 elements") + } + if strlen(r.endpointId) < 1 { + return nil, reportError("endpointId must have at least 1 elements") + } + if strlen(r.endpointId) > 256 { + return nil, reportError("endpointId must have less than 256 elements") + } + if r.endpointHeadersIn == nil { + return nil, reportError("endpointHeadersIn 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.endpointHeadersIn + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v HTTPValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiV1EndpointUpdateMtlsConfigRequest struct { + ctx _context.Context + ApiService *EndpointApiService + appId string + endpointId string + endpointMtlsConfigIn *EndpointMtlsConfigIn +} + +func (r ApiV1EndpointUpdateMtlsConfigRequest) EndpointMtlsConfigIn(endpointMtlsConfigIn EndpointMtlsConfigIn) ApiV1EndpointUpdateMtlsConfigRequest { + r.endpointMtlsConfigIn = &endpointMtlsConfigIn + return r +} + +func (r ApiV1EndpointUpdateMtlsConfigRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.V1EndpointUpdateMtlsConfigExecute(r) +} + +/* + * V1EndpointUpdateMtlsConfig Update Endpoint Mtls Config + * Create/update endpoint mTLS configuration + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param appId The app's ID or UID + * @param endpointId The ep's ID or UID + * @return ApiV1EndpointUpdateMtlsConfigRequest + */ +func (a *EndpointApiService) V1EndpointUpdateMtlsConfig(ctx _context.Context, appId string, endpointId string) ApiV1EndpointUpdateMtlsConfigRequest { + return ApiV1EndpointUpdateMtlsConfigRequest{ + ApiService: a, + ctx: ctx, + appId: appId, + endpointId: endpointId, + } +} + +/* + * Execute executes the request + */ +func (a *EndpointApiService) V1EndpointUpdateMtlsConfigExecute(r ApiV1EndpointUpdateMtlsConfigRequest) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointUpdateMtlsConfig") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/mtls" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if strlen(r.appId) < 1 { + return nil, reportError("appId must have at least 1 elements") + } + if strlen(r.appId) > 256 { + return nil, reportError("appId must have less than 256 elements") + } + if strlen(r.endpointId) < 1 { + return nil, reportError("endpointId must have at least 1 elements") + } + if strlen(r.endpointId) > 256 { + return nil, reportError("endpointId must have less than 256 elements") + } + if r.endpointMtlsConfigIn == nil { + return nil, reportError("endpointMtlsConfigIn 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.endpointMtlsConfigIn + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v HTTPValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiV1EndpointUpdateOauthConfigRequest struct { + ctx _context.Context + ApiService *EndpointApiService + appId string + endpointId string + endpointOauthConfigIn *EndpointOauthConfigIn +} + +func (r ApiV1EndpointUpdateOauthConfigRequest) EndpointOauthConfigIn(endpointOauthConfigIn EndpointOauthConfigIn) ApiV1EndpointUpdateOauthConfigRequest { + r.endpointOauthConfigIn = &endpointOauthConfigIn + return r +} + +func (r ApiV1EndpointUpdateOauthConfigRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.V1EndpointUpdateOauthConfigExecute(r) +} + +/* + * V1EndpointUpdateOauthConfig Update Endpoint Oauth Config + * Create/update endpoint OAuth configuration + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param appId The app's ID or UID + * @param endpointId The ep's ID or UID + * @return ApiV1EndpointUpdateOauthConfigRequest + */ +func (a *EndpointApiService) V1EndpointUpdateOauthConfig(ctx _context.Context, appId string, endpointId string) ApiV1EndpointUpdateOauthConfigRequest { + return ApiV1EndpointUpdateOauthConfigRequest{ + ApiService: a, + ctx: ctx, + appId: appId, + endpointId: endpointId, + } +} + +/* + * Execute executes the request + */ +func (a *EndpointApiService) V1EndpointUpdateOauthConfigExecute(r ApiV1EndpointUpdateOauthConfigRequest) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointApiService.V1EndpointUpdateOauthConfig") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/oauth" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if strlen(r.appId) < 1 { + return nil, reportError("appId must have at least 1 elements") + } + if strlen(r.appId) > 256 { + return nil, reportError("appId must have less than 256 elements") + } + if strlen(r.endpointId) < 1 { + return nil, reportError("endpointId must have at least 1 elements") + } + if strlen(r.endpointId) > 256 { + return nil, reportError("endpointId must have less than 256 elements") + } + if r.endpointOauthConfigIn == nil { + return nil, reportError("endpointOauthConfigIn 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.endpointOauthConfigIn req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err diff --git a/go/internal/openapi/api_events.go b/go/internal/openapi/api_events.go index 75af19104..0750ac007 100644 --- a/go/internal/openapi/api_events.go +++ b/go/internal/openapi/api_events.go @@ -17,6 +17,7 @@ import ( _nethttp "net/http" _neturl "net/url" "reflect" + "time" ) // Linger please @@ -34,6 +35,7 @@ type ApiV1EventsRequest struct { iterator *string eventTypes *[]string channels *[]string + after *time.Time } func (r ApiV1EventsRequest) Limit(limit int32) ApiV1EventsRequest { @@ -52,6 +54,10 @@ func (r ApiV1EventsRequest) Channels(channels []string) ApiV1EventsRequest { r.channels = &channels return r } +func (r ApiV1EventsRequest) After(after time.Time) ApiV1EventsRequest { + r.after = &after + return r +} func (r ApiV1EventsRequest) Execute() (MessageStreamOut, *_nethttp.Response, error) { return r.ApiService.V1EventsExecute(r) @@ -123,6 +129,9 @@ func (a *EventsApiService) V1EventsExecute(r ApiV1EventsRequest) (MessageStreamO localVarQueryParams.Add("channels", parameterToString(t, "multi")) } } + if r.after != nil { + localVarQueryParams.Add("after", parameterToString(*r.after, "")) + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} diff --git a/go/internal/openapi/api_message.go b/go/internal/openapi/api_message.go index c81f603a8..61794b4cc 100644 --- a/go/internal/openapi/api_message.go +++ b/go/internal/openapi/api_message.go @@ -1306,6 +1306,7 @@ type ApiV1MessageStreamRequest struct { iterator *string eventTypes *[]string channels *[]string + after *time.Time } func (r ApiV1MessageStreamRequest) Limit(limit int32) ApiV1MessageStreamRequest { @@ -1324,6 +1325,10 @@ func (r ApiV1MessageStreamRequest) Channels(channels []string) ApiV1MessageStrea r.channels = &channels return r } +func (r ApiV1MessageStreamRequest) After(after time.Time) ApiV1MessageStreamRequest { + r.after = &after + return r +} func (r ApiV1MessageStreamRequest) Execute() (MessageStreamOut, *_nethttp.Response, error) { return r.ApiService.V1MessageStreamExecute(r) @@ -1404,6 +1409,9 @@ func (a *MessageApiService) V1MessageStreamExecute(r ApiV1MessageStreamRequest) localVarQueryParams.Add("channels", parameterToString(t, "multi")) } } + if r.after != nil { + localVarQueryParams.Add("after", parameterToString(*r.after, "")) + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} diff --git a/go/internal/openapi/api_transformation_template.go b/go/internal/openapi/api_transformation_template.go index 78814eead..b05cf0ad6 100644 --- a/go/internal/openapi/api_transformation_template.go +++ b/go/internal/openapi/api_transformation_template.go @@ -27,6 +27,197 @@ var ( // TransformationTemplateApiService TransformationTemplateApi service type TransformationTemplateApiService service +type ApiV1EndpointUpdateHubspotOauthConfigRequest struct { + ctx _context.Context + ApiService *TransformationTemplateApiService + appId string + endpointId string + hubspotOauthConfigIn *HubspotOauthConfigIn +} + +func (r ApiV1EndpointUpdateHubspotOauthConfigRequest) HubspotOauthConfigIn(hubspotOauthConfigIn HubspotOauthConfigIn) ApiV1EndpointUpdateHubspotOauthConfigRequest { + r.hubspotOauthConfigIn = &hubspotOauthConfigIn + return r +} + +func (r ApiV1EndpointUpdateHubspotOauthConfigRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.V1EndpointUpdateHubspotOauthConfigExecute(r) +} + +/* + * V1EndpointUpdateHubspotOauthConfig Update Hubspot Oauth Config + * Create/update endpoint Hubsport OAuth configuration +Specific private endpoint just for us, to avoid exposing the Hubspot secret to the client. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param appId The app's ID or UID + * @param endpointId The ep's ID or UID + * @return ApiV1EndpointUpdateHubspotOauthConfigRequest + */ +func (a *TransformationTemplateApiService) V1EndpointUpdateHubspotOauthConfig(ctx _context.Context, appId string, endpointId string) ApiV1EndpointUpdateHubspotOauthConfigRequest { + return ApiV1EndpointUpdateHubspotOauthConfigRequest{ + ApiService: a, + ctx: ctx, + appId: appId, + endpointId: endpointId, + } +} + +/* + * Execute executes the request + */ +func (a *TransformationTemplateApiService) V1EndpointUpdateHubspotOauthConfigExecute(r ApiV1EndpointUpdateHubspotOauthConfigRequest) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransformationTemplateApiService.V1EndpointUpdateHubspotOauthConfig") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation-template/oauth/hubspot" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(parameterToString(r.appId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", _neturl.PathEscape(parameterToString(r.endpointId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if strlen(r.appId) < 1 { + return nil, reportError("appId must have at least 1 elements") + } + if strlen(r.appId) > 256 { + return nil, reportError("appId must have less than 256 elements") + } + if strlen(r.endpointId) < 1 { + return nil, reportError("endpointId must have at least 1 elements") + } + if strlen(r.endpointId) > 256 { + return nil, reportError("endpointId must have less than 256 elements") + } + if r.hubspotOauthConfigIn == nil { + return nil, reportError("hubspotOauthConfigIn 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.hubspotOauthConfigIn + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v HTTPValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + type ApiV1TransformationTemplateCreateRequest struct { ctx _context.Context ApiService *TransformationTemplateApiService @@ -942,12 +1133,12 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateListExecute(r type ApiV1TransformationTemplateOauthDiscordRequest struct { ctx _context.Context ApiService *TransformationTemplateApiService - oauthPayloadIn *OauthPayloadIn + oAuthPayloadIn *OAuthPayloadIn idempotencyKey *string } -func (r ApiV1TransformationTemplateOauthDiscordRequest) OauthPayloadIn(oauthPayloadIn OauthPayloadIn) ApiV1TransformationTemplateOauthDiscordRequest { - r.oauthPayloadIn = &oauthPayloadIn +func (r ApiV1TransformationTemplateOauthDiscordRequest) OAuthPayloadIn(oAuthPayloadIn OAuthPayloadIn) ApiV1TransformationTemplateOauthDiscordRequest { + r.oAuthPayloadIn = &oAuthPayloadIn return r } func (r ApiV1TransformationTemplateOauthDiscordRequest) IdempotencyKey(idempotencyKey string) ApiV1TransformationTemplateOauthDiscordRequest { @@ -955,7 +1146,7 @@ func (r ApiV1TransformationTemplateOauthDiscordRequest) IdempotencyKey(idempoten return r } -func (r ApiV1TransformationTemplateOauthDiscordRequest) Execute() (OauthPayloadOut, *_nethttp.Response, error) { +func (r ApiV1TransformationTemplateOauthDiscordRequest) Execute() (IncomingWebhookPayloadOut, *_nethttp.Response, error) { return r.ApiService.V1TransformationTemplateOauthDiscordExecute(r) } @@ -974,16 +1165,16 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthDiscord( /* * Execute executes the request - * @return OauthPayloadOut + * @return IncomingWebhookPayloadOut */ -func (a *TransformationTemplateApiService) V1TransformationTemplateOauthDiscordExecute(r ApiV1TransformationTemplateOauthDiscordRequest) (OauthPayloadOut, *_nethttp.Response, error) { +func (a *TransformationTemplateApiService) V1TransformationTemplateOauthDiscordExecute(r ApiV1TransformationTemplateOauthDiscordRequest) (IncomingWebhookPayloadOut, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue OauthPayloadOut + localVarReturnValue IncomingWebhookPayloadOut ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransformationTemplateApiService.V1TransformationTemplateOauthDiscord") @@ -996,8 +1187,197 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthDiscordE localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.oauthPayloadIn == nil { - return localVarReturnValue, nil, reportError("oauthPayloadIn is required and must be specified") + if r.oAuthPayloadIn == nil { + return localVarReturnValue, nil, reportError("oAuthPayloadIn is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.idempotencyKey != nil { + localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") + } + // body params + localVarPostBody = r.oAuthPayloadIn + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v HTTPValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiV1TransformationTemplateOauthHubspotRequest struct { + ctx _context.Context + ApiService *TransformationTemplateApiService + oAuthPayloadIn *OAuthPayloadIn + idempotencyKey *string +} + +func (r ApiV1TransformationTemplateOauthHubspotRequest) OAuthPayloadIn(oAuthPayloadIn OAuthPayloadIn) ApiV1TransformationTemplateOauthHubspotRequest { + r.oAuthPayloadIn = &oAuthPayloadIn + return r +} +func (r ApiV1TransformationTemplateOauthHubspotRequest) IdempotencyKey(idempotencyKey string) ApiV1TransformationTemplateOauthHubspotRequest { + r.idempotencyKey = &idempotencyKey + return r +} + +func (r ApiV1TransformationTemplateOauthHubspotRequest) Execute() (OAuthPayloadOut, *_nethttp.Response, error) { + return r.ApiService.V1TransformationTemplateOauthHubspotExecute(r) +} + +/* + * V1TransformationTemplateOauthHubspot Authorize Hubspot + * Get Hubspot access token using authorization code + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiV1TransformationTemplateOauthHubspotRequest + */ +func (a *TransformationTemplateApiService) V1TransformationTemplateOauthHubspot(ctx _context.Context) ApiV1TransformationTemplateOauthHubspotRequest { + return ApiV1TransformationTemplateOauthHubspotRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return OAuthPayloadOut + */ +func (a *TransformationTemplateApiService) V1TransformationTemplateOauthHubspotExecute(r ApiV1TransformationTemplateOauthHubspotRequest) (OAuthPayloadOut, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue OAuthPayloadOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransformationTemplateApiService.V1TransformationTemplateOauthHubspot") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/transformation-template/oauth/hubspot" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.oAuthPayloadIn == nil { + return localVarReturnValue, nil, reportError("oAuthPayloadIn is required and must be specified") } // to determine the Content-Type header @@ -1021,7 +1401,7 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthDiscordE localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") } // body params - localVarPostBody = r.oauthPayloadIn + localVarPostBody = r.oAuthPayloadIn req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err @@ -1131,12 +1511,12 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthDiscordE type ApiV1TransformationTemplateOauthSlackRequest struct { ctx _context.Context ApiService *TransformationTemplateApiService - oauthPayloadIn *OauthPayloadIn + oAuthPayloadIn *OAuthPayloadIn idempotencyKey *string } -func (r ApiV1TransformationTemplateOauthSlackRequest) OauthPayloadIn(oauthPayloadIn OauthPayloadIn) ApiV1TransformationTemplateOauthSlackRequest { - r.oauthPayloadIn = &oauthPayloadIn +func (r ApiV1TransformationTemplateOauthSlackRequest) OAuthPayloadIn(oAuthPayloadIn OAuthPayloadIn) ApiV1TransformationTemplateOauthSlackRequest { + r.oAuthPayloadIn = &oAuthPayloadIn return r } func (r ApiV1TransformationTemplateOauthSlackRequest) IdempotencyKey(idempotencyKey string) ApiV1TransformationTemplateOauthSlackRequest { @@ -1144,7 +1524,7 @@ func (r ApiV1TransformationTemplateOauthSlackRequest) IdempotencyKey(idempotency return r } -func (r ApiV1TransformationTemplateOauthSlackRequest) Execute() (OauthPayloadOut, *_nethttp.Response, error) { +func (r ApiV1TransformationTemplateOauthSlackRequest) Execute() (IncomingWebhookPayloadOut, *_nethttp.Response, error) { return r.ApiService.V1TransformationTemplateOauthSlackExecute(r) } @@ -1163,16 +1543,16 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthSlack(ct /* * Execute executes the request - * @return OauthPayloadOut + * @return IncomingWebhookPayloadOut */ -func (a *TransformationTemplateApiService) V1TransformationTemplateOauthSlackExecute(r ApiV1TransformationTemplateOauthSlackRequest) (OauthPayloadOut, *_nethttp.Response, error) { +func (a *TransformationTemplateApiService) V1TransformationTemplateOauthSlackExecute(r ApiV1TransformationTemplateOauthSlackRequest) (IncomingWebhookPayloadOut, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue OauthPayloadOut + localVarReturnValue IncomingWebhookPayloadOut ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransformationTemplateApiService.V1TransformationTemplateOauthSlack") @@ -1185,8 +1565,8 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthSlackExe localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.oauthPayloadIn == nil { - return localVarReturnValue, nil, reportError("oauthPayloadIn is required and must be specified") + if r.oAuthPayloadIn == nil { + return localVarReturnValue, nil, reportError("oAuthPayloadIn is required and must be specified") } // to determine the Content-Type header @@ -1210,7 +1590,7 @@ func (a *TransformationTemplateApiService) V1TransformationTemplateOauthSlackExe localVarHeaderParams["idempotency-key"] = parameterToString(*r.idempotencyKey, "") } // body params - localVarPostBody = r.oauthPayloadIn + localVarPostBody = r.oAuthPayloadIn req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err diff --git a/go/internal/openapi/model_client_secret_jwt_params_in.go b/go/internal/openapi/model_client_secret_jwt_params_in.go index e0bea0859..3360b958d 100644 --- a/go/internal/openapi/model_client_secret_jwt_params_in.go +++ b/go/internal/openapi/model_client_secret_jwt_params_in.go @@ -16,9 +16,12 @@ import ( // ClientSecretJwtParamsIn struct for ClientSecretJwtParamsIn type ClientSecretJwtParamsIn struct { + // The base64-encoded secret used for signing the JWT. SecretBase64 string `json:"secretBase64"` + // Optional secret identifier. If supplied, this will be populated in the JWT header in the `kid` field. SecretId NullableString `json:"secretId,omitempty"` SigningAlgorithm OauthJwsSigningAlgorithm `json:"signingAlgorithm"` + // Optional number of seconds after which the JWT should expire. Defaults to 300 seconds. TokenExpirySecs NullableInt32 `json:"tokenExpirySecs,omitempty"` } diff --git a/go/internal/openapi/model_endpoint_mtls_config_in.go b/go/internal/openapi/model_endpoint_mtls_config_in.go new file mode 100644 index 000000000..0767379ff --- /dev/null +++ b/go/internal/openapi/model_endpoint_mtls_config_in.go @@ -0,0 +1,139 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// EndpointMtlsConfigIn struct for EndpointMtlsConfigIn +type EndpointMtlsConfigIn struct { + // A PEM encoded X509 certificate used to verify the webhook receiver's certificate. + CaCert string `json:"caCert"` + // A PEM encoded private key and X509 certificate to identify the webhook sender. + Identity string `json:"identity"` +} + +// NewEndpointMtlsConfigIn instantiates a new EndpointMtlsConfigIn object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEndpointMtlsConfigIn(caCert string, identity string) *EndpointMtlsConfigIn { + this := EndpointMtlsConfigIn{} + this.CaCert = caCert + this.Identity = identity + return &this +} + +// NewEndpointMtlsConfigInWithDefaults instantiates a new EndpointMtlsConfigIn object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEndpointMtlsConfigInWithDefaults() *EndpointMtlsConfigIn { + this := EndpointMtlsConfigIn{} + return &this +} + +// GetCaCert returns the CaCert field value +func (o *EndpointMtlsConfigIn) GetCaCert() string { + if o == nil { + var ret string + return ret + } + + return o.CaCert +} + +// GetCaCertOk returns a tuple with the CaCert field value +// and a boolean to check if the value has been set. +func (o *EndpointMtlsConfigIn) GetCaCertOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CaCert, true +} + +// SetCaCert sets field value +func (o *EndpointMtlsConfigIn) SetCaCert(v string) { + o.CaCert = v +} + +// GetIdentity returns the Identity field value +func (o *EndpointMtlsConfigIn) GetIdentity() string { + if o == nil { + var ret string + return ret + } + + return o.Identity +} + +// GetIdentityOk returns a tuple with the Identity field value +// and a boolean to check if the value has been set. +func (o *EndpointMtlsConfigIn) GetIdentityOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identity, true +} + +// SetIdentity sets field value +func (o *EndpointMtlsConfigIn) SetIdentity(v string) { + o.Identity = v +} + +func (o EndpointMtlsConfigIn) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["caCert"] = o.CaCert + } + if true { + toSerialize["identity"] = o.Identity + } + return json.Marshal(toSerialize) +} + +type NullableEndpointMtlsConfigIn struct { + value *EndpointMtlsConfigIn + isSet bool +} + +func (v NullableEndpointMtlsConfigIn) Get() *EndpointMtlsConfigIn { + return v.value +} + +func (v *NullableEndpointMtlsConfigIn) Set(val *EndpointMtlsConfigIn) { + v.value = val + v.isSet = true +} + +func (v NullableEndpointMtlsConfigIn) IsSet() bool { + return v.isSet +} + +func (v *NullableEndpointMtlsConfigIn) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEndpointMtlsConfigIn(val *EndpointMtlsConfigIn) *NullableEndpointMtlsConfigIn { + return &NullableEndpointMtlsConfigIn{value: val, isSet: true} +} + +func (v NullableEndpointMtlsConfigIn) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEndpointMtlsConfigIn) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_endpoint_oauth_config_in.go b/go/internal/openapi/model_endpoint_oauth_config_in.go index f448158ce..1b6b47690 100644 --- a/go/internal/openapi/model_endpoint_oauth_config_in.go +++ b/go/internal/openapi/model_endpoint_oauth_config_in.go @@ -17,10 +17,19 @@ import ( // EndpointOauthConfigIn struct for EndpointOauthConfigIn type EndpointOauthConfigIn struct { AuthMethod Oauth2AuthMethodIn `json:"authMethod"` + // The client ID. Required for all authentication types. ClientId string `json:"clientId"` + // Optional client secret. This is only used for `clientSecretBasic` and `clientSecretPost`. For `clientSecretBasic`, the secret will be appended to the `Authorization` header. For `clientSecretPost`, this will be added to the body in a `client_secret` parameter. ClientSecret NullableString `json:"clientSecret,omitempty"` - GrantType Oauth2GrantType `json:"grantType"` + // Extra parameters added to the request body as key-value pairs. + ExtraParams map[string]string `json:"extraParams,omitempty"` + GrantType Oauth2GrantTypeIn `json:"grantType"` JwtParams *ClientSecretJwtParamsIn `json:"jwtParams,omitempty"` + // For `refreshToken` grant type + RefreshToken NullableString `json:"refreshToken,omitempty"` + // Optional OAuth scopes added to the request body. + Scopes []string `json:"scopes,omitempty"` + // The URL of the authorization server. TokenUrl string `json:"tokenUrl"` } @@ -28,7 +37,7 @@ type EndpointOauthConfigIn struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewEndpointOauthConfigIn(authMethod Oauth2AuthMethodIn, clientId string, grantType Oauth2GrantType, tokenUrl string) *EndpointOauthConfigIn { +func NewEndpointOauthConfigIn(authMethod Oauth2AuthMethodIn, clientId string, grantType Oauth2GrantTypeIn, tokenUrl string) *EndpointOauthConfigIn { this := EndpointOauthConfigIn{} this.AuthMethod = authMethod this.ClientId = clientId @@ -135,10 +144,43 @@ func (o *EndpointOauthConfigIn) UnsetClientSecret() { o.ClientSecret.Unset() } +// GetExtraParams returns the ExtraParams field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EndpointOauthConfigIn) GetExtraParams() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + return o.ExtraParams +} + +// GetExtraParamsOk returns a tuple with the ExtraParams 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 *EndpointOauthConfigIn) GetExtraParamsOk() (*map[string]string, bool) { + if o == nil || o.ExtraParams == nil { + return nil, false + } + return &o.ExtraParams, true +} + +// HasExtraParams returns a boolean if a field has been set. +func (o *EndpointOauthConfigIn) HasExtraParams() bool { + if o != nil && o.ExtraParams != nil { + return true + } + + return false +} + +// SetExtraParams gets a reference to the given map[string]string and assigns it to the ExtraParams field. +func (o *EndpointOauthConfigIn) SetExtraParams(v map[string]string) { + o.ExtraParams = v +} + // GetGrantType returns the GrantType field value -func (o *EndpointOauthConfigIn) GetGrantType() Oauth2GrantType { +func (o *EndpointOauthConfigIn) GetGrantType() Oauth2GrantTypeIn { if o == nil { - var ret Oauth2GrantType + var ret Oauth2GrantTypeIn return ret } @@ -147,7 +189,7 @@ func (o *EndpointOauthConfigIn) GetGrantType() Oauth2GrantType { // GetGrantTypeOk returns a tuple with the GrantType field value // and a boolean to check if the value has been set. -func (o *EndpointOauthConfigIn) GetGrantTypeOk() (*Oauth2GrantType, bool) { +func (o *EndpointOauthConfigIn) GetGrantTypeOk() (*Oauth2GrantTypeIn, bool) { if o == nil { return nil, false } @@ -155,7 +197,7 @@ func (o *EndpointOauthConfigIn) GetGrantTypeOk() (*Oauth2GrantType, bool) { } // SetGrantType sets field value -func (o *EndpointOauthConfigIn) SetGrantType(v Oauth2GrantType) { +func (o *EndpointOauthConfigIn) SetGrantType(v Oauth2GrantTypeIn) { o.GrantType = v } @@ -191,6 +233,81 @@ func (o *EndpointOauthConfigIn) SetJwtParams(v ClientSecretJwtParamsIn) { o.JwtParams = &v } +// GetRefreshToken returns the RefreshToken field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EndpointOauthConfigIn) GetRefreshToken() string { + if o == nil || o.RefreshToken.Get() == nil { + var ret string + return ret + } + return *o.RefreshToken.Get() +} + +// GetRefreshTokenOk returns a tuple with the RefreshToken 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 *EndpointOauthConfigIn) GetRefreshTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RefreshToken.Get(), o.RefreshToken.IsSet() +} + +// HasRefreshToken returns a boolean if a field has been set. +func (o *EndpointOauthConfigIn) HasRefreshToken() bool { + if o != nil && o.RefreshToken.IsSet() { + return true + } + + return false +} + +// SetRefreshToken gets a reference to the given NullableString and assigns it to the RefreshToken field. +func (o *EndpointOauthConfigIn) SetRefreshToken(v string) { + o.RefreshToken.Set(&v) +} +// SetRefreshTokenNil sets the value for RefreshToken to be an explicit nil +func (o *EndpointOauthConfigIn) SetRefreshTokenNil() { + o.RefreshToken.Set(nil) +} + +// UnsetRefreshToken ensures that no value is present for RefreshToken, not even an explicit nil +func (o *EndpointOauthConfigIn) UnsetRefreshToken() { + o.RefreshToken.Unset() +} + +// GetScopes returns the Scopes field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EndpointOauthConfigIn) GetScopes() []string { + if o == nil { + var ret []string + return ret + } + return o.Scopes +} + +// GetScopesOk returns a tuple with the Scopes 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 *EndpointOauthConfigIn) GetScopesOk() (*[]string, bool) { + if o == nil || o.Scopes == nil { + return nil, false + } + return &o.Scopes, true +} + +// HasScopes returns a boolean if a field has been set. +func (o *EndpointOauthConfigIn) HasScopes() bool { + if o != nil && o.Scopes != nil { + return true + } + + return false +} + +// SetScopes gets a reference to the given []string and assigns it to the Scopes field. +func (o *EndpointOauthConfigIn) SetScopes(v []string) { + o.Scopes = v +} + // GetTokenUrl returns the TokenUrl field value func (o *EndpointOauthConfigIn) GetTokenUrl() string { if o == nil { @@ -226,12 +343,21 @@ func (o EndpointOauthConfigIn) MarshalJSON() ([]byte, error) { if o.ClientSecret.IsSet() { toSerialize["clientSecret"] = o.ClientSecret.Get() } + if o.ExtraParams != nil { + toSerialize["extraParams"] = o.ExtraParams + } if true { toSerialize["grantType"] = o.GrantType } if o.JwtParams != nil { toSerialize["jwtParams"] = o.JwtParams } + if o.RefreshToken.IsSet() { + toSerialize["refreshToken"] = o.RefreshToken.Get() + } + if o.Scopes != nil { + toSerialize["scopes"] = o.Scopes + } if true { toSerialize["tokenUrl"] = o.TokenUrl } diff --git a/go/internal/openapi/model_endpoint_secret_rotate_in.go b/go/internal/openapi/model_endpoint_secret_rotate_in.go index b51d042a1..109d81bbb 100644 --- a/go/internal/openapi/model_endpoint_secret_rotate_in.go +++ b/go/internal/openapi/model_endpoint_secret_rotate_in.go @@ -26,8 +26,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,8 +34,6 @@ 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 } diff --git a/go/internal/openapi/model_event_type_from_open_api.go b/go/internal/openapi/model_event_type_from_open_api.go new file mode 100644 index 000000000..358e5948f --- /dev/null +++ b/go/internal/openapi/model_event_type_from_open_api.go @@ -0,0 +1,175 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// EventTypeFromOpenApi struct for EventTypeFromOpenApi +type EventTypeFromOpenApi struct { + Description string `json:"description"` + // The event type's name + Name string `json:"name"` + Schemas map[string]map[string]interface{} `json:"schemas,omitempty"` +} + +// NewEventTypeFromOpenApi instantiates a new EventTypeFromOpenApi object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEventTypeFromOpenApi(description string, name string) *EventTypeFromOpenApi { + this := EventTypeFromOpenApi{} + this.Description = description + this.Name = name + return &this +} + +// NewEventTypeFromOpenApiWithDefaults instantiates a new EventTypeFromOpenApi object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEventTypeFromOpenApiWithDefaults() *EventTypeFromOpenApi { + this := EventTypeFromOpenApi{} + return &this +} + +// GetDescription returns the Description field value +func (o *EventTypeFromOpenApi) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *EventTypeFromOpenApi) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *EventTypeFromOpenApi) SetDescription(v string) { + o.Description = v +} + +// GetName returns the Name field value +func (o *EventTypeFromOpenApi) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *EventTypeFromOpenApi) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *EventTypeFromOpenApi) SetName(v string) { + o.Name = v +} + +// GetSchemas returns the Schemas field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EventTypeFromOpenApi) GetSchemas() map[string]map[string]interface{} { + if o == nil { + var ret map[string]map[string]interface{} + return ret + } + return o.Schemas +} + +// 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 *EventTypeFromOpenApi) GetSchemasOk() (*map[string]map[string]interface{}, bool) { + if o == nil || o.Schemas == nil { + return nil, false + } + return &o.Schemas, true +} + +// HasSchemas returns a boolean if a field has been set. +func (o *EventTypeFromOpenApi) HasSchemas() bool { + if o != nil && o.Schemas != nil { + return true + } + + return false +} + +// SetSchemas gets a reference to the given map[string]map[string]interface{} and assigns it to the Schemas field. +func (o *EventTypeFromOpenApi) SetSchemas(v map[string]map[string]interface{}) { + o.Schemas = v +} + +func (o EventTypeFromOpenApi) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["description"] = o.Description + } + if true { + toSerialize["name"] = o.Name + } + if o.Schemas != nil { + toSerialize["schemas"] = o.Schemas + } + return json.Marshal(toSerialize) +} + +type NullableEventTypeFromOpenApi struct { + value *EventTypeFromOpenApi + isSet bool +} + +func (v NullableEventTypeFromOpenApi) Get() *EventTypeFromOpenApi { + return v.value +} + +func (v *NullableEventTypeFromOpenApi) Set(val *EventTypeFromOpenApi) { + v.value = val + v.isSet = true +} + +func (v NullableEventTypeFromOpenApi) IsSet() bool { + return v.isSet +} + +func (v *NullableEventTypeFromOpenApi) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEventTypeFromOpenApi(val *EventTypeFromOpenApi) *NullableEventTypeFromOpenApi { + return &NullableEventTypeFromOpenApi{value: val, isSet: true} +} + +func (v NullableEventTypeFromOpenApi) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEventTypeFromOpenApi) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + 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..d0935c2a4 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 @@ -16,6 +16,8 @@ import ( // EventTypeImportOpenApiIn Import a list of event types from webhooks defined in an OpenAPI spec. The OpenAPI spec can be specified as either `spec` given the spec as a JSON object, or as `specRaw` (a `string`) which will be parsed as YAML or JSON by the server. Sending neither or both is invalid, resulting in a `400` **Bad Request**. type EventTypeImportOpenApiIn struct { + // If `true`, return the event types that would be modified without actually modifying them. + DryRun *bool `json:"dry_run,omitempty"` // A pre-parsed JSON spec. Spec map[string]map[string]interface{} `json:"spec,omitempty"` // A string, parsed by the server as YAML or JSON. @@ -28,6 +30,8 @@ type EventTypeImportOpenApiIn struct { // will change when the set of required properties is changed func NewEventTypeImportOpenApiIn() *EventTypeImportOpenApiIn { this := EventTypeImportOpenApiIn{} + var dryRun bool = false + this.DryRun = &dryRun return &this } @@ -36,9 +40,43 @@ func NewEventTypeImportOpenApiIn() *EventTypeImportOpenApiIn { // but it doesn't guarantee that properties required by API are set func NewEventTypeImportOpenApiInWithDefaults() *EventTypeImportOpenApiIn { this := EventTypeImportOpenApiIn{} + var dryRun bool = false + this.DryRun = &dryRun return &this } +// GetDryRun returns the DryRun field value if set, zero value otherwise. +func (o *EventTypeImportOpenApiIn) GetDryRun() bool { + if o == nil || o.DryRun == nil { + var ret bool + return ret + } + return *o.DryRun +} + +// GetDryRunOk returns a tuple with the DryRun field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventTypeImportOpenApiIn) GetDryRunOk() (*bool, bool) { + if o == nil || o.DryRun == nil { + return nil, false + } + return o.DryRun, true +} + +// HasDryRun returns a boolean if a field has been set. +func (o *EventTypeImportOpenApiIn) HasDryRun() bool { + if o != nil && o.DryRun != nil { + return true + } + + return false +} + +// SetDryRun gets a reference to the given bool and assigns it to the DryRun field. +func (o *EventTypeImportOpenApiIn) SetDryRun(v bool) { + o.DryRun = &v +} + // 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 { @@ -116,6 +154,9 @@ func (o *EventTypeImportOpenApiIn) UnsetSpecRaw() { func (o EventTypeImportOpenApiIn) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} + if o.DryRun != nil { + toSerialize["dry_run"] = o.DryRun + } if o.Spec != nil { toSerialize["spec"] = o.Spec } 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..5fdb8d1c7 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 @@ -17,6 +17,7 @@ import ( // EventTypeImportOpenApiOutData struct for EventTypeImportOpenApiOutData type EventTypeImportOpenApiOutData struct { Modified []string `json:"modified"` + ToModify []EventTypeFromOpenApi `json:"to_modify,omitempty"` } // NewEventTypeImportOpenApiOutData instantiates a new EventTypeImportOpenApiOutData object @@ -61,11 +62,47 @@ func (o *EventTypeImportOpenApiOutData) SetModified(v []string) { o.Modified = v } +// GetToModify returns the ToModify field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EventTypeImportOpenApiOutData) GetToModify() []EventTypeFromOpenApi { + if o == nil { + var ret []EventTypeFromOpenApi + return ret + } + return o.ToModify +} + +// GetToModifyOk returns a tuple with the ToModify 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 *EventTypeImportOpenApiOutData) GetToModifyOk() (*[]EventTypeFromOpenApi, bool) { + if o == nil || o.ToModify == nil { + return nil, false + } + return &o.ToModify, true +} + +// HasToModify returns a boolean if a field has been set. +func (o *EventTypeImportOpenApiOutData) HasToModify() bool { + if o != nil && o.ToModify != nil { + return true + } + + return false +} + +// SetToModify gets a reference to the given []EventTypeFromOpenApi and assigns it to the ToModify field. +func (o *EventTypeImportOpenApiOutData) SetToModify(v []EventTypeFromOpenApi) { + o.ToModify = v +} + func (o EventTypeImportOpenApiOutData) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if true { toSerialize["modified"] = o.Modified } + if o.ToModify != nil { + toSerialize["to_modify"] = o.ToModify + } return json.Marshal(toSerialize) } diff --git a/go/internal/openapi/model_hubspot_oauth_config_in.go b/go/internal/openapi/model_hubspot_oauth_config_in.go new file mode 100644 index 000000000..df3252838 --- /dev/null +++ b/go/internal/openapi/model_hubspot_oauth_config_in.go @@ -0,0 +1,108 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// HubspotOauthConfigIn struct for HubspotOauthConfigIn +type HubspotOauthConfigIn struct { + RefreshToken string `json:"refresh_token"` +} + +// NewHubspotOauthConfigIn instantiates a new HubspotOauthConfigIn object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHubspotOauthConfigIn(refreshToken string) *HubspotOauthConfigIn { + this := HubspotOauthConfigIn{} + this.RefreshToken = refreshToken + return &this +} + +// NewHubspotOauthConfigInWithDefaults instantiates a new HubspotOauthConfigIn object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHubspotOauthConfigInWithDefaults() *HubspotOauthConfigIn { + this := HubspotOauthConfigIn{} + return &this +} + +// GetRefreshToken returns the RefreshToken field value +func (o *HubspotOauthConfigIn) GetRefreshToken() string { + if o == nil { + var ret string + return ret + } + + return o.RefreshToken +} + +// GetRefreshTokenOk returns a tuple with the RefreshToken field value +// and a boolean to check if the value has been set. +func (o *HubspotOauthConfigIn) GetRefreshTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RefreshToken, true +} + +// SetRefreshToken sets field value +func (o *HubspotOauthConfigIn) SetRefreshToken(v string) { + o.RefreshToken = v +} + +func (o HubspotOauthConfigIn) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["refresh_token"] = o.RefreshToken + } + return json.Marshal(toSerialize) +} + +type NullableHubspotOauthConfigIn struct { + value *HubspotOauthConfigIn + isSet bool +} + +func (v NullableHubspotOauthConfigIn) Get() *HubspotOauthConfigIn { + return v.value +} + +func (v *NullableHubspotOauthConfigIn) Set(val *HubspotOauthConfigIn) { + v.value = val + v.isSet = true +} + +func (v NullableHubspotOauthConfigIn) IsSet() bool { + return v.isSet +} + +func (v *NullableHubspotOauthConfigIn) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHubspotOauthConfigIn(val *HubspotOauthConfigIn) *NullableHubspotOauthConfigIn { + return &NullableHubspotOauthConfigIn{value: val, isSet: true} +} + +func (v NullableHubspotOauthConfigIn) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHubspotOauthConfigIn) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_incoming_webhook_payload_out.go b/go/internal/openapi/model_incoming_webhook_payload_out.go new file mode 100644 index 000000000..05cb57c69 --- /dev/null +++ b/go/internal/openapi/model_incoming_webhook_payload_out.go @@ -0,0 +1,217 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// IncomingWebhookPayloadOut struct for IncomingWebhookPayloadOut +type IncomingWebhookPayloadOut struct { + Channel NullableString `json:"channel,omitempty"` + Error NullableString `json:"error,omitempty"` + IncomingWebhookUrl NullableString `json:"incomingWebhookUrl,omitempty"` +} + +// NewIncomingWebhookPayloadOut instantiates a new IncomingWebhookPayloadOut object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIncomingWebhookPayloadOut() *IncomingWebhookPayloadOut { + this := IncomingWebhookPayloadOut{} + return &this +} + +// NewIncomingWebhookPayloadOutWithDefaults instantiates a new IncomingWebhookPayloadOut object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIncomingWebhookPayloadOutWithDefaults() *IncomingWebhookPayloadOut { + this := IncomingWebhookPayloadOut{} + return &this +} + +// GetChannel returns the Channel field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IncomingWebhookPayloadOut) GetChannel() string { + if o == nil || o.Channel.Get() == nil { + var ret string + return ret + } + return *o.Channel.Get() +} + +// GetChannelOk returns a tuple with the Channel 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 *IncomingWebhookPayloadOut) GetChannelOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Channel.Get(), o.Channel.IsSet() +} + +// HasChannel returns a boolean if a field has been set. +func (o *IncomingWebhookPayloadOut) HasChannel() bool { + if o != nil && o.Channel.IsSet() { + return true + } + + return false +} + +// SetChannel gets a reference to the given NullableString and assigns it to the Channel field. +func (o *IncomingWebhookPayloadOut) SetChannel(v string) { + o.Channel.Set(&v) +} +// SetChannelNil sets the value for Channel to be an explicit nil +func (o *IncomingWebhookPayloadOut) SetChannelNil() { + o.Channel.Set(nil) +} + +// UnsetChannel ensures that no value is present for Channel, not even an explicit nil +func (o *IncomingWebhookPayloadOut) UnsetChannel() { + o.Channel.Unset() +} + +// GetError returns the Error field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IncomingWebhookPayloadOut) GetError() string { + if o == nil || o.Error.Get() == nil { + var ret string + return ret + } + return *o.Error.Get() +} + +// GetErrorOk returns a tuple with the Error 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 *IncomingWebhookPayloadOut) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Error.Get(), o.Error.IsSet() +} + +// HasError returns a boolean if a field has been set. +func (o *IncomingWebhookPayloadOut) HasError() bool { + if o != nil && o.Error.IsSet() { + return true + } + + return false +} + +// SetError gets a reference to the given NullableString and assigns it to the Error field. +func (o *IncomingWebhookPayloadOut) SetError(v string) { + o.Error.Set(&v) +} +// SetErrorNil sets the value for Error to be an explicit nil +func (o *IncomingWebhookPayloadOut) SetErrorNil() { + o.Error.Set(nil) +} + +// UnsetError ensures that no value is present for Error, not even an explicit nil +func (o *IncomingWebhookPayloadOut) UnsetError() { + o.Error.Unset() +} + +// GetIncomingWebhookUrl returns the IncomingWebhookUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IncomingWebhookPayloadOut) GetIncomingWebhookUrl() string { + if o == nil || o.IncomingWebhookUrl.Get() == nil { + var ret string + return ret + } + return *o.IncomingWebhookUrl.Get() +} + +// GetIncomingWebhookUrlOk returns a tuple with the IncomingWebhookUrl 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 *IncomingWebhookPayloadOut) GetIncomingWebhookUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.IncomingWebhookUrl.Get(), o.IncomingWebhookUrl.IsSet() +} + +// HasIncomingWebhookUrl returns a boolean if a field has been set. +func (o *IncomingWebhookPayloadOut) HasIncomingWebhookUrl() bool { + if o != nil && o.IncomingWebhookUrl.IsSet() { + return true + } + + return false +} + +// SetIncomingWebhookUrl gets a reference to the given NullableString and assigns it to the IncomingWebhookUrl field. +func (o *IncomingWebhookPayloadOut) SetIncomingWebhookUrl(v string) { + o.IncomingWebhookUrl.Set(&v) +} +// SetIncomingWebhookUrlNil sets the value for IncomingWebhookUrl to be an explicit nil +func (o *IncomingWebhookPayloadOut) SetIncomingWebhookUrlNil() { + o.IncomingWebhookUrl.Set(nil) +} + +// UnsetIncomingWebhookUrl ensures that no value is present for IncomingWebhookUrl, not even an explicit nil +func (o *IncomingWebhookPayloadOut) UnsetIncomingWebhookUrl() { + o.IncomingWebhookUrl.Unset() +} + +func (o IncomingWebhookPayloadOut) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Channel.IsSet() { + toSerialize["channel"] = o.Channel.Get() + } + if o.Error.IsSet() { + toSerialize["error"] = o.Error.Get() + } + if o.IncomingWebhookUrl.IsSet() { + toSerialize["incomingWebhookUrl"] = o.IncomingWebhookUrl.Get() + } + return json.Marshal(toSerialize) +} + +type NullableIncomingWebhookPayloadOut struct { + value *IncomingWebhookPayloadOut + isSet bool +} + +func (v NullableIncomingWebhookPayloadOut) Get() *IncomingWebhookPayloadOut { + return v.value +} + +func (v *NullableIncomingWebhookPayloadOut) Set(val *IncomingWebhookPayloadOut) { + v.value = val + v.isSet = true +} + +func (v NullableIncomingWebhookPayloadOut) IsSet() bool { + return v.isSet +} + +func (v *NullableIncomingWebhookPayloadOut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIncomingWebhookPayloadOut(val *IncomingWebhookPayloadOut) *NullableIncomingWebhookPayloadOut { + return &NullableIncomingWebhookPayloadOut{value: val, isSet: true} +} + +func (v NullableIncomingWebhookPayloadOut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIncomingWebhookPayloadOut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_o_auth_payload_in.go b/go/internal/openapi/model_o_auth_payload_in.go new file mode 100644 index 000000000..822dde656 --- /dev/null +++ b/go/internal/openapi/model_o_auth_payload_in.go @@ -0,0 +1,137 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// OAuthPayloadIn struct for OAuthPayloadIn +type OAuthPayloadIn struct { + Code string `json:"code"` + RedirectUri string `json:"redirectUri"` +} + +// 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 +// will change when the set of required properties is changed +func NewOAuthPayloadIn(code string, redirectUri string) *OAuthPayloadIn { + this := OAuthPayloadIn{} + this.Code = code + this.RedirectUri = redirectUri + return &this +} + +// NewOAuthPayloadInWithDefaults instantiates a new OAuthPayloadIn object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOAuthPayloadInWithDefaults() *OAuthPayloadIn { + this := OAuthPayloadIn{} + return &this +} + +// GetCode returns the Code field value +func (o *OAuthPayloadIn) GetCode() string { + if o == nil { + var ret string + return ret + } + + return o.Code +} + +// 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 { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value +func (o *OAuthPayloadIn) SetCode(v string) { + o.Code = v +} + +// GetRedirectUri returns the RedirectUri field value +func (o *OAuthPayloadIn) GetRedirectUri() string { + if o == nil { + var ret string + return ret + } + + return o.RedirectUri +} + +// 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 { + return nil, false + } + return &o.RedirectUri, true +} + +// SetRedirectUri sets field value +func (o *OAuthPayloadIn) SetRedirectUri(v string) { + o.RedirectUri = v +} + +func (o OAuthPayloadIn) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["code"] = o.Code + } + if true { + toSerialize["redirectUri"] = o.RedirectUri + } + return json.Marshal(toSerialize) +} + +type NullableOAuthPayloadIn struct { + value *OAuthPayloadIn + isSet bool +} + +func (v NullableOAuthPayloadIn) Get() *OAuthPayloadIn { + return v.value +} + +func (v *NullableOAuthPayloadIn) Set(val *OAuthPayloadIn) { + v.value = val + v.isSet = true +} + +func (v NullableOAuthPayloadIn) IsSet() bool { + return v.isSet +} + +func (v *NullableOAuthPayloadIn) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOAuthPayloadIn(val *OAuthPayloadIn) *NullableOAuthPayloadIn { + return &NullableOAuthPayloadIn{value: val, isSet: true} +} + +func (v NullableOAuthPayloadIn) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOAuthPayloadIn) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_o_auth_payload_out.go b/go/internal/openapi/model_o_auth_payload_out.go new file mode 100644 index 000000000..049b70687 --- /dev/null +++ b/go/internal/openapi/model_o_auth_payload_out.go @@ -0,0 +1,217 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// OAuthPayloadOut struct for OAuthPayloadOut +type OAuthPayloadOut struct { + AccessToken NullableString `json:"accessToken,omitempty"` + Error NullableString `json:"error,omitempty"` + RefreshToken NullableString `json:"refreshToken,omitempty"` +} + +// NewOAuthPayloadOut instantiates a new OAuthPayloadOut object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOAuthPayloadOut() *OAuthPayloadOut { + this := OAuthPayloadOut{} + return &this +} + +// NewOAuthPayloadOutWithDefaults instantiates a new OAuthPayloadOut object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOAuthPayloadOutWithDefaults() *OAuthPayloadOut { + this := OAuthPayloadOut{} + return &this +} + +// GetAccessToken returns the AccessToken field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuthPayloadOut) GetAccessToken() string { + if o == nil || o.AccessToken.Get() == nil { + var ret string + return ret + } + return *o.AccessToken.Get() +} + +// GetAccessTokenOk returns a tuple with the AccessToken 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 *OAuthPayloadOut) GetAccessTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AccessToken.Get(), o.AccessToken.IsSet() +} + +// HasAccessToken returns a boolean if a field has been set. +func (o *OAuthPayloadOut) HasAccessToken() bool { + if o != nil && o.AccessToken.IsSet() { + return true + } + + return false +} + +// SetAccessToken gets a reference to the given NullableString and assigns it to the AccessToken field. +func (o *OAuthPayloadOut) SetAccessToken(v string) { + o.AccessToken.Set(&v) +} +// SetAccessTokenNil sets the value for AccessToken to be an explicit nil +func (o *OAuthPayloadOut) SetAccessTokenNil() { + o.AccessToken.Set(nil) +} + +// UnsetAccessToken ensures that no value is present for AccessToken, not even an explicit nil +func (o *OAuthPayloadOut) UnsetAccessToken() { + o.AccessToken.Unset() +} + +// 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 { + var ret string + return ret + } + return *o.Error.Get() +} + +// GetErrorOk returns a tuple with the Error 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 *OAuthPayloadOut) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Error.Get(), o.Error.IsSet() +} + +// HasError returns a boolean if a field has been set. +func (o *OAuthPayloadOut) HasError() bool { + if o != nil && o.Error.IsSet() { + return true + } + + return false +} + +// SetError gets a reference to the given NullableString and assigns it to the Error field. +func (o *OAuthPayloadOut) SetError(v string) { + o.Error.Set(&v) +} +// SetErrorNil sets the value for Error to be an explicit nil +func (o *OAuthPayloadOut) SetErrorNil() { + o.Error.Set(nil) +} + +// UnsetError ensures that no value is present for Error, not even an explicit nil +func (o *OAuthPayloadOut) UnsetError() { + o.Error.Unset() +} + +// GetRefreshToken returns the RefreshToken field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuthPayloadOut) GetRefreshToken() string { + if o == nil || o.RefreshToken.Get() == nil { + var ret string + return ret + } + return *o.RefreshToken.Get() +} + +// GetRefreshTokenOk returns a tuple with the RefreshToken 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 *OAuthPayloadOut) GetRefreshTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RefreshToken.Get(), o.RefreshToken.IsSet() +} + +// HasRefreshToken returns a boolean if a field has been set. +func (o *OAuthPayloadOut) HasRefreshToken() bool { + if o != nil && o.RefreshToken.IsSet() { + return true + } + + return false +} + +// SetRefreshToken gets a reference to the given NullableString and assigns it to the RefreshToken field. +func (o *OAuthPayloadOut) SetRefreshToken(v string) { + o.RefreshToken.Set(&v) +} +// SetRefreshTokenNil sets the value for RefreshToken to be an explicit nil +func (o *OAuthPayloadOut) SetRefreshTokenNil() { + o.RefreshToken.Set(nil) +} + +// UnsetRefreshToken ensures that no value is present for RefreshToken, not even an explicit nil +func (o *OAuthPayloadOut) UnsetRefreshToken() { + o.RefreshToken.Unset() +} + +func (o OAuthPayloadOut) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.AccessToken.IsSet() { + toSerialize["accessToken"] = o.AccessToken.Get() + } + if o.Error.IsSet() { + toSerialize["error"] = o.Error.Get() + } + if o.RefreshToken.IsSet() { + toSerialize["refreshToken"] = o.RefreshToken.Get() + } + return json.Marshal(toSerialize) +} + +type NullableOAuthPayloadOut struct { + value *OAuthPayloadOut + isSet bool +} + +func (v NullableOAuthPayloadOut) Get() *OAuthPayloadOut { + return v.value +} + +func (v *NullableOAuthPayloadOut) Set(val *OAuthPayloadOut) { + v.value = val + v.isSet = true +} + +func (v NullableOAuthPayloadOut) IsSet() bool { + return v.isSet +} + +func (v *NullableOAuthPayloadOut) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOAuthPayloadOut(val *OAuthPayloadOut) *NullableOAuthPayloadOut { + return &NullableOAuthPayloadOut{value: val, isSet: true} +} + +func (v NullableOAuthPayloadOut) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOAuthPayloadOut) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/go/internal/openapi/model_oauth2_auth_method_in.go b/go/internal/openapi/model_oauth2_auth_method_in.go index ea2f7297d..ebc9cfd5b 100644 --- a/go/internal/openapi/model_oauth2_auth_method_in.go +++ b/go/internal/openapi/model_oauth2_auth_method_in.go @@ -15,7 +15,7 @@ import ( "fmt" ) -// Oauth2AuthMethodIn the model 'Oauth2AuthMethodIn' +// Oauth2AuthMethodIn The method used for authenticating to the OAuth authorization server. `clientSecretJwt` will construct a JWT used for authentication with the oauth authorization server. This method is less commonly used and may not be supported by all oauth providers. `clientSecretBasic` will authenticate to the oauth authorization server using an `Authorization` header with the client secret as the value. This is the most common means of authentication. `clientSecretPost` will authenticate to the oauth authorization server by passing the client secret in a `client_secret` field in the request body. This method may not be supported by all oauth providers, and in general `clientSecretBasic` should be preferred. type Oauth2AuthMethodIn string // List of Oauth2AuthMethodIn diff --git a/go/internal/openapi/model_oauth2_grant_type_in.go b/go/internal/openapi/model_oauth2_grant_type_in.go new file mode 100644 index 000000000..c8b5da648 --- /dev/null +++ b/go/internal/openapi/model_oauth2_grant_type_in.go @@ -0,0 +1,110 @@ +/* + * Svix API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.1.1 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "fmt" +) + +// Oauth2GrantTypeIn the model 'Oauth2GrantTypeIn' +type Oauth2GrantTypeIn string + +// List of Oauth2GrantTypeIn +const ( + OAUTH2GRANTTYPEIN_CLIENT_CREDENTIALS Oauth2GrantTypeIn = "clientCredentials" + OAUTH2GRANTTYPEIN_REFRESH_TOKEN Oauth2GrantTypeIn = "refreshToken" +) + +var allowedOauth2GrantTypeInEnumValues = []Oauth2GrantTypeIn{ + "clientCredentials", + "refreshToken", +} + +func (v *Oauth2GrantTypeIn) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Oauth2GrantTypeIn(value) + for _, existing := range allowedOauth2GrantTypeInEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Oauth2GrantTypeIn", value) +} + +// NewOauth2GrantTypeInFromValue returns a pointer to a valid Oauth2GrantTypeIn +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewOauth2GrantTypeInFromValue(v string) (*Oauth2GrantTypeIn, error) { + ev := Oauth2GrantTypeIn(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Oauth2GrantTypeIn: valid values are %v", v, allowedOauth2GrantTypeInEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Oauth2GrantTypeIn) IsValid() bool { + for _, existing := range allowedOauth2GrantTypeInEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Oauth2GrantTypeIn value +func (v Oauth2GrantTypeIn) Ptr() *Oauth2GrantTypeIn { + return &v +} + +type NullableOauth2GrantTypeIn struct { + value *Oauth2GrantTypeIn + isSet bool +} + +func (v NullableOauth2GrantTypeIn) Get() *Oauth2GrantTypeIn { + return v.value +} + +func (v *NullableOauth2GrantTypeIn) Set(val *Oauth2GrantTypeIn) { + v.value = val + v.isSet = true +} + +func (v NullableOauth2GrantTypeIn) IsSet() bool { + return v.isSet +} + +func (v *NullableOauth2GrantTypeIn) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOauth2GrantTypeIn(val *Oauth2GrantTypeIn) *NullableOauth2GrantTypeIn { + return &NullableOauth2GrantTypeIn{value: val, isSet: true} +} + +func (v NullableOauth2GrantTypeIn) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOauth2GrantTypeIn) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/go/internal/openapi/model_template_in.go b/go/internal/openapi/model_template_in.go index a2005eae8..4682d649c 100644 --- a/go/internal/openapi/model_template_in.go +++ b/go/internal/openapi/model_template_in.go @@ -37,8 +37,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,8 +52,6 @@ func NewTemplateInWithDefaults() *TemplateIn { this.Description = &description var instructions string = "" this.Instructions = &instructions - var instructionsLink string = "null" - this.InstructionsLink = *NewNullableString(&instructionsLink) return &this } diff --git a/openapi.json b/openapi.json index 92ded240d..1401777b3 100644 --- a/openapi.json +++ b/openapi.json @@ -1024,14 +1024,19 @@ "type": "object" }, "grantType": { - "$ref": "#/components/schemas/Oauth2GrantType", - "description": "The OAuth grant type. Currently only `clientCredentials` is supported." + "$ref": "#/components/schemas/Oauth2GrantTypeIn", + "description": "The OAuth grant type." }, "jwtParams": { "$ref": "#/components/schemas/ClientSecretJwtParamsIn", "description": "Optional JWT parameters. Only required for `clientSecretJwt`", "nullable": true }, + "refreshToken": { + "description": "For `refreshToken` grant type", + "nullable": true, + "type": "string" + }, "scopes": { "description": "Optional OAuth scopes added to the request body.", "items": { @@ -1250,7 +1255,6 @@ "EndpointSecretRotateIn": { "properties": { "key": { - "default": null, "description": "The endpoint's verification secret. If `null` is passed, a secret is automatically generated. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24.", "example": "whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD", "nullable": true, @@ -1680,9 +1684,59 @@ ], "type": "object" }, + "EventTypeFromOpenApi": { + "properties": { + "description": { + "type": "string" + }, + "name": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "schemas": { + "additionalProperties": { + "type": "object" + }, + "example": { + "description": "An invoice was paid by a user", + "properties": { + "invoiceId": { + "description": "The invoice id", + "type": "string" + }, + "userId": { + "description": "The user id", + "type": "string" + } + }, + "required": [ + "invoiceId", + "userId" + ], + "title": "Invoice Paid Event", + "type": "object" + }, + "nullable": true, + "type": "object" + } + }, + "required": [ + "description", + "name" + ], + "type": "object" + }, "EventTypeImportOpenApiIn": { "description": "Import a list of event types from webhooks defined in an OpenAPI spec.\n\nThe OpenAPI spec can be specified as either `spec` given the spec as a JSON object, or as `specRaw` (a `string`) which will be parsed as YAML or JSON by the server. Sending neither or both is invalid, resulting in a `400` **Bad Request**.", "properties": { + "dry_run": { + "default": false, + "description": "If `true`, return the event types that would be modified without actually modifying them.", + "type": "boolean" + }, "spec": { "additionalProperties": { "type": "object" @@ -1807,6 +1861,13 @@ "type": "string" }, "type": "array" + }, + "to_modify": { + "items": { + "$ref": "#/components/schemas/EventTypeFromOpenApi" + }, + "nullable": true, + "type": "array" } }, "required": [ @@ -2175,6 +2236,17 @@ "title": "HttpError", "type": "object" }, + "HubspotOauthConfigIn": { + "properties": { + "refresh_token": { + "type": "string" + } + }, + "required": [ + "refresh_token" + ], + "type": "object" + }, "InboundPathParams": { "properties": { "app_id": { @@ -2195,6 +2267,24 @@ ], "type": "object" }, + "IncomingWebhookPayloadOut": { + "properties": { + "channel": { + "nullable": true, + "type": "string" + }, + "error": { + "nullable": true, + "type": "string" + }, + "incomingWebhookUrl": { + "format": "uri", + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, "IntegrationIn": { "properties": { "name": { @@ -3388,28 +3478,7 @@ ], "type": "object" }, - "Oauth2AuthMethodIn": { - "description": "The method used for authenticating to the OAuth authorization server. `clientSecretJwt` will construct a JWT used for authentication with the oauth authorization server. This method is less commonly used and may not be supported by all oauth providers. `clientSecretBasic` will authenticate to the oauth authorization server using an `Authorization` header with the client secret as the value. This is the most common means of authentication. `clientSecretPost` will authenticate to the oauth authorization server by passing the client secret in a `client_secret` field in the request body. This method may not be supported by all oauth providers, and in general `clientSecretBasic` should be preferred.", - "enum": [ - "clientSecretJwt", - "clientSecretBasic", - "clientSecretPost" - ], - "type": "string" - }, - "Oauth2GrantType": { - "enum": [ - "clientCredentials" - ], - "type": "string" - }, - "OauthJwsSigningAlgorithm": { - "enum": [ - "RS256" - ], - "type": "string" - }, - "OauthPayloadIn": { + "OAuthPayloadIn": { "properties": { "code": { "type": "string" @@ -3424,9 +3493,9 @@ ], "type": "object" }, - "OauthPayloadOut": { + "OAuthPayloadOut": { "properties": { - "channel": { + "accessToken": { "nullable": true, "type": "string" }, @@ -3434,14 +3503,35 @@ "nullable": true, "type": "string" }, - "incomingWebhookUrl": { - "format": "uri", + "refreshToken": { "nullable": true, "type": "string" } }, "type": "object" }, + "Oauth2AuthMethodIn": { + "description": "The method used for authenticating to the OAuth authorization server. `clientSecretJwt` will construct a JWT used for authentication with the oauth authorization server. This method is less commonly used and may not be supported by all oauth providers. `clientSecretBasic` will authenticate to the oauth authorization server using an `Authorization` header with the client secret as the value. This is the most common means of authentication. `clientSecretPost` will authenticate to the oauth authorization server by passing the client secret in a `client_secret` field in the request body. This method may not be supported by all oauth providers, and in general `clientSecretBasic` should be preferred.", + "enum": [ + "clientSecretJwt", + "clientSecretBasic", + "clientSecretPost" + ], + "type": "string" + }, + "Oauth2GrantTypeIn": { + "enum": [ + "clientCredentials", + "refreshToken" + ], + "type": "string" + }, + "OauthJwsSigningAlgorithm": { + "enum": [ + "RS256" + ], + "type": "string" + }, "OneTimeTokenIn": { "properties": { "oneTimeToken": { @@ -3800,7 +3890,6 @@ "type": "string" }, "instructionsLink": { - "default": null, "format": "uri", "nullable": true, "type": "string" @@ -9059,62 +9148,62 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "await svix.endpoint.updateOauthConfig(\"app_id\", \"endpoint_id\", {\n jwtParams: null,\n clientSecret: null,\n scopes: null,\n extraParams: null\n});" + "source": "await svix.endpoint.updateOauthConfig(\"app_id\", \"endpoint_id\", {\n jwtParams: null,\n clientSecret: null,\n scopes: null,\n extraParams: null,\n refreshToken: null\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "await svix.endpoint.updateOauthConfig(\"app_id\", \"endpoint_id\", {\n jwtParams: null,\n clientSecret: null,\n scopes: null,\n extraParams: null\n});" + "source": "await svix.endpoint.updateOauthConfig(\"app_id\", \"endpoint_id\", {\n jwtParams: null,\n clientSecret: null,\n scopes: null,\n extraParams: null,\n refreshToken: null\n});" }, { "label": "Python", "lang": "Python", - "source": "svix.endpoint.update_oauth_config(\"app_id\", \"endpoint_id\", EndpointOauthConfigIn(\n jwt_params=None,\n client_secret=None,\n scopes=None,\n extra_params=None\n))" + "source": "svix.endpoint.update_oauth_config(\"app_id\", \"endpoint_id\", EndpointOauthConfigIn(\n jwt_params=None,\n client_secret=None,\n scopes=None,\n extra_params=None,\n refresh_token=None\n))" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.endpoint.update_oauth_config(\"app_id\", \"endpoint_id\", EndpointOauthConfigIn(\n jwt_params=None,\n client_secret=None,\n scopes=None,\n extra_params=None\n))" + "source": "await svix.endpoint.update_oauth_config(\"app_id\", \"endpoint_id\", EndpointOauthConfigIn(\n jwt_params=None,\n client_secret=None,\n scopes=None,\n extra_params=None,\n refresh_token=None\n))" }, { "label": "Go", "lang": "Go", - "source": "err := svixClient.Endpoint.UpdateOauthConfig(ctx, \"app_id\", \"endpoint_id\", &EndpointOauthConfigIn{\n JwtParams: nil,\n ClientSecret: nil,\n Scopes: nil,\n ExtraParams: nil,\n})" + "source": "err := svixClient.Endpoint.UpdateOauthConfig(ctx, \"app_id\", \"endpoint_id\", &EndpointOauthConfigIn{\n JwtParams: nil,\n ClientSecret: nil,\n Scopes: nil,\n ExtraParams: nil,\n RefreshToken: nil,\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "svix.endpoint.updateOauthConfig(\"app_id\", \"endpoint_id\", EndpointOauthConfigIn()\n .jwtParams(null)\n .clientSecret(null)\n .scopes(null)\n .extraParams(null)\n)" + "source": "svix.endpoint.updateOauthConfig(\"app_id\", \"endpoint_id\", EndpointOauthConfigIn()\n .jwtParams(null)\n .clientSecret(null)\n .scopes(null)\n .extraParams(null)\n .refreshToken(null)\n)" }, { "label": "Java", "lang": "Java", - "source": "svix.getEndpoint().updateOauthConfig(\"app_id\", \"endpoint_id\", new EndpointOauthConfigIn()\n .jwtParams(null)\n .clientSecret(null)\n .scopes(null)\n .extraParams(null)\n)" + "source": "svix.getEndpoint().updateOauthConfig(\"app_id\", \"endpoint_id\", new EndpointOauthConfigIn()\n .jwtParams(null)\n .clientSecret(null)\n .scopes(null)\n .extraParams(null)\n .refreshToken(null)\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "svix.endpoint.update_oauth_config(\"app_id\", \"endpoint_id\", Svix::EndpointOauthConfigIn.new({\n \"jwt_params\": nil,\n \"client_secret\": nil,\n \"scopes\": nil,\n \"extra_params\": nil\n}))" + "source": "svix.endpoint.update_oauth_config(\"app_id\", \"endpoint_id\", Svix::EndpointOauthConfigIn.new({\n \"jwt_params\": nil,\n \"client_secret\": nil,\n \"scopes\": nil,\n \"extra_params\": nil,\n \"refresh_token\": nil\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "svix.endpoint().update_oauth_config(\"app_id\", \"endpoint_id\", EndpointOauthConfigIn {\n jwt_params: None,\n client_secret: None,\n scopes: None,\n extra_params: None,\n}).await?;" + "source": "svix.endpoint().update_oauth_config(\"app_id\", \"endpoint_id\", EndpointOauthConfigIn {\n jwt_params: None,\n client_secret: None,\n scopes: None,\n extra_params: None,\n refresh_token: None,\n}).await?;" }, { "label": "C#", "lang": "C#", - "source": "await svix.Endpoint.UpdateOauthConfigAsync(\"app_id\", \"endpoint_id\", new EndpointOauthConfigIn{\n jwtParams: null,\n clientSecret: null,\n scopes: null,\n extraParams: null\n})" + "source": "await svix.Endpoint.UpdateOauthConfigAsync(\"app_id\", \"endpoint_id\", new EndpointOauthConfigIn{\n jwtParams: null,\n clientSecret: null,\n scopes: null,\n extraParams: null,\n refreshToken: null\n})" }, { "label": "CLI", "lang": "Shell", - "source": "svix endpoint update-oauth-config \"app_id\" \"endpoint_id\" '{\n \"jwtParams\": null,\n \"clientSecret\": null,\n \"scopes\": null,\n \"extraParams\": null\n}'" + "source": "svix endpoint update-oauth-config \"app_id\" \"endpoint_id\" '{\n \"jwtParams\": null,\n \"clientSecret\": null,\n \"scopes\": null,\n \"extraParams\": null,\n \"refreshToken\": null\n}'" }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/oauth' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"jwtParams\": null,\n \"clientSecret\": null,\n \"scopes\": null,\n \"extraParams\": null\n }'" + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/oauth' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"jwtParams\": null,\n \"clientSecret\": null,\n \"scopes\": null,\n \"extraParams\": null,\n \"refreshToken\": null\n }'" } ] } @@ -10741,6 +10830,200 @@ ] } }, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation-template/oauth/hubspot": { + "put": { + "description": "Create/update endpoint Hubsport OAuth configuration\nSpecific private endpoint just for us, to avoid exposing the Hubspot secret to the client.", + "operationId": "v1.endpoint.update-hubspot-oauth-config", + "parameters": [ + { + "description": "The app's ID or UID", + "in": "path", + "name": "app_id", + "required": true, + "schema": { + "description": "The app's ID or UID", + "example": "unique-app-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + }, + { + "description": "The ep's ID or UID", + "in": "path", + "name": "endpoint_id", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HubspotOauthConfigIn" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "no content" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Update Hubspot Oauth Config", + "tags": [ + "Transformation Template" + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "await svix.endpoint.updateHubspotOauthConfig(\"app_id\", \"endpoint_id\", \n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "await svix.endpoint.updateHubspotOauthConfig(\"app_id\", \"endpoint_id\", \n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "svix.endpoint.update_hubspot_oauth_config(\"app_id\", \"endpoint_id\", HubspotOauthConfigIn\n))" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "await svix.endpoint.update_hubspot_oauth_config(\"app_id\", \"endpoint_id\", HubspotOauthConfigIn\n))" + }, + { + "label": "Go", + "lang": "Go", + "source": "err := svixClient.Endpoint.UpdateHubspotOauthConfig(ctx, \"app_id\", \"endpoint_id\", &HubspotOauthConfigIn{\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "svix.endpoint.updateHubspotOauthConfig(\"app_id\", \"endpoint_id\", HubspotOauthConfigIn()\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "svix.getEndpoint().updateHubspotOauthConfig(\"app_id\", \"endpoint_id\", new HubspotOauthConfigIn()\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "svix.endpoint.update_hubspot_oauth_config(\"app_id\", \"endpoint_id\", Svix::HubspotOauthConfigIn.new(\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "svix.endpoint().update_hubspot_oauth_config(\"app_id\", \"endpoint_id\", HubspotOauthConfigIn {\n}).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "await svix.Endpoint.UpdateHubspotOauthConfigAsync(\"app_id\", \"endpoint_id\", new HubspotOauthConfigIn\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix endpoint update-hubspot-oauth-config \"app_id\" \"endpoint_id\" '\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation-template/oauth/hubspot' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '\n }'" + } + ] + } + }, "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation/simulate": { "post": { "description": "Simulate running the transformation on the payload and code", @@ -21514,7 +21797,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OauthPayloadIn" + "$ref": "#/components/schemas/OAuthPayloadIn" } } }, @@ -21525,7 +21808,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OauthPayloadOut" + "$ref": "#/components/schemas/IncomingWebhookPayloadOut" } } }, @@ -21615,52 +21898,52 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const oauthPayloadOut = await svix.transformationTemplate.oauth(\n});" + "source": "const incomingWebhookPayloadOut = await svix.transformationTemplate.oauth(\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const oauthPayloadOut = await svix.transformationTemplate.oauth(\n});" + "source": "const incomingWebhookPayloadOut = await svix.transformationTemplate.oauth(\n});" }, { "label": "Python", "lang": "Python", - "source": "oauth_payload_out = svix.transformation_template.oauth(OauthPayloadIn\n), None)" + "source": "incoming_webhook_payload_out = svix.transformation_template.oauth(OAuthPayloadIn\n), None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "oauth_payload_out = await svix.transformation_template.oauth(OauthPayloadIn\n), None)" + "source": "incoming_webhook_payload_out = await svix.transformation_template.oauth(OAuthPayloadIn\n), None)" }, { "label": "Go", "lang": "Go", - "source": "oauthPayloadOut, err := svixClient.TransformationTemplate.Oauth(ctx, &OauthPayloadIn{\n})" + "source": "incomingWebhookPayloadOut, err := svixClient.TransformationTemplate.Oauth(ctx, &OAuthPayloadIn{\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val oauthPayloadOut = svix.transformationTemplate.oauth(OauthPayloadIn()\n)" + "source": "val incomingWebhookPayloadOut = svix.transformationTemplate.oauth(OAuthPayloadIn()\n)" }, { "label": "Java", "lang": "Java", - "source": "OauthPayloadOut oauthPayloadOut = svix.getTransformationTemplate().oauth(new OauthPayloadIn()\n)" + "source": "IncomingWebhookPayloadOut incomingWebhookPayloadOut = svix.getTransformationTemplate().oauth(new OAuthPayloadIn()\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "oauth_payload_out = svix.transformation_template.oauth(Svix::OauthPayloadIn.new(\n}))" + "source": "incoming_webhook_payload_out = svix.transformation_template.oauth(Svix::OAuthPayloadIn.new(\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let oauth_payload_out = svix.transformation_template().oauth(OauthPayloadIn {\n}, None).await?;" + "source": "let incoming_webhook_payload_out = svix.transformation_template().oauth(OAuthPayloadIn {\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var oauthPayloadOut = await svix.TransformationTemplate.OauthAsync(new OauthPayloadIn\n})" + "source": "var incomingWebhookPayloadOut = await svix.TransformationTemplate.OauthAsync(new OAuthPayloadIn\n})" }, { "label": "CLI", @@ -21675,6 +21958,186 @@ ] } }, + "/api/v1/transformation-template/oauth/hubspot": { + "post": { + "description": "Get Hubspot access token using authorization code", + "operationId": "v1.transformation-template.oauth.hubspot", + "parameters": [ + { + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuthPayloadIn" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuthPayloadOut" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Authorize Hubspot", + "tags": [ + "Transformation Template" + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const oAuthPayloadOut = await svix.transformationTemplate.oauth(\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const oAuthPayloadOut = await svix.transformationTemplate.oauth(\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "o_auth_payload_out = svix.transformation_template.oauth(OAuthPayloadIn\n), None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "o_auth_payload_out = await svix.transformation_template.oauth(OAuthPayloadIn\n), None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "oAuthPayloadOut, err := svixClient.TransformationTemplate.Oauth(ctx, &OAuthPayloadIn{\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val oAuthPayloadOut = svix.transformationTemplate.oauth(OAuthPayloadIn()\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "OAuthPayloadOut oAuthPayloadOut = svix.getTransformationTemplate().oauth(new OAuthPayloadIn()\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "o_auth_payload_out = svix.transformation_template.oauth(Svix::OAuthPayloadIn.new(\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let o_auth_payload_out = svix.transformation_template().oauth(OAuthPayloadIn {\n}, None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var oAuthPayloadOut = await svix.TransformationTemplate.OauthAsync(new OAuthPayloadIn\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix transformation-template oauth '\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/transformation-template/oauth/hubspot' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '\n }'" + } + ] + } + }, "/api/v1/transformation-template/oauth/slack": { "post": { "description": "Get Slack Incoming webhook URL", @@ -21694,7 +22157,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OauthPayloadIn" + "$ref": "#/components/schemas/OAuthPayloadIn" } } }, @@ -21705,7 +22168,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OauthPayloadOut" + "$ref": "#/components/schemas/IncomingWebhookPayloadOut" } } }, @@ -21795,52 +22258,52 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const oauthPayloadOut = await svix.transformationTemplate.oauth(\n});" + "source": "const incomingWebhookPayloadOut = await svix.transformationTemplate.oauth(\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const oauthPayloadOut = await svix.transformationTemplate.oauth(\n});" + "source": "const incomingWebhookPayloadOut = await svix.transformationTemplate.oauth(\n});" }, { "label": "Python", "lang": "Python", - "source": "oauth_payload_out = svix.transformation_template.oauth(OauthPayloadIn\n), None)" + "source": "incoming_webhook_payload_out = svix.transformation_template.oauth(OAuthPayloadIn\n), None)" }, { "label": "Python (Async)", "lang": "Python", - "source": "oauth_payload_out = await svix.transformation_template.oauth(OauthPayloadIn\n), None)" + "source": "incoming_webhook_payload_out = await svix.transformation_template.oauth(OAuthPayloadIn\n), None)" }, { "label": "Go", "lang": "Go", - "source": "oauthPayloadOut, err := svixClient.TransformationTemplate.Oauth(ctx, &OauthPayloadIn{\n})" + "source": "incomingWebhookPayloadOut, err := svixClient.TransformationTemplate.Oauth(ctx, &OAuthPayloadIn{\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val oauthPayloadOut = svix.transformationTemplate.oauth(OauthPayloadIn()\n)" + "source": "val incomingWebhookPayloadOut = svix.transformationTemplate.oauth(OAuthPayloadIn()\n)" }, { "label": "Java", "lang": "Java", - "source": "OauthPayloadOut oauthPayloadOut = svix.getTransformationTemplate().oauth(new OauthPayloadIn()\n)" + "source": "IncomingWebhookPayloadOut incomingWebhookPayloadOut = svix.getTransformationTemplate().oauth(new OAuthPayloadIn()\n)" }, { "label": "Ruby", "lang": "Ruby", - "source": "oauth_payload_out = svix.transformation_template.oauth(Svix::OauthPayloadIn.new(\n}))" + "source": "incoming_webhook_payload_out = svix.transformation_template.oauth(Svix::OAuthPayloadIn.new(\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let oauth_payload_out = svix.transformation_template().oauth(OauthPayloadIn {\n}, None).await?;" + "source": "let incoming_webhook_payload_out = svix.transformation_template().oauth(OAuthPayloadIn {\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var oauthPayloadOut = await svix.TransformationTemplate.OauthAsync(new OauthPayloadIn\n})" + "source": "var incomingWebhookPayloadOut = await svix.TransformationTemplate.OauthAsync(new OAuthPayloadIn\n})" }, { "label": "CLI",