diff --git a/CHANGELOG.md b/CHANGELOG.md index 36c7d6bd..8ee9b6e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +# Release (Unreleased) + +* `github.com/patrickcping/pingone-go-sdk-v2` : v0.6.3 + * **Note** Add retry logic for retryable HTTP status codes. [#147](https://github.com/patrickcping/pingone-go-sdk-v2/pull/147) +* `github.com/patrickcping/pingone-go-sdk-v2/agreementmanagement` : [v0.1.2](./agreementmanagement/CHANGELOG.md) + * **Note** Add retry logic for retryable HTTP status codes. [#147](https://github.com/patrickcping/pingone-go-sdk-v2/pull/147) +* `github.com/patrickcping/pingone-go-sdk-v2/authorize` : [v0.1.5](./authorize/CHANGELOG.md) + * **Note** Add retry logic for retryable HTTP status codes. [#147](https://github.com/patrickcping/pingone-go-sdk-v2/pull/147) +* `github.com/patrickcping/pingone-go-sdk-v2/management` : [v0.18.1](./management/CHANGELOG.md) + * **Note** Add retry logic for retryable HTTP status codes. [#147](https://github.com/patrickcping/pingone-go-sdk-v2/pull/147) +* `github.com/patrickcping/pingone-go-sdk-v2/mfa` : [v0.9.2](./mfa/CHANGELOG.md) + * **Note** Add retry logic for retryable HTTP status codes. [#147](https://github.com/patrickcping/pingone-go-sdk-v2/pull/147) +* `github.com/patrickcping/pingone-go-sdk-v2/risk` : [v0.4.1](./risk/CHANGELOG.md) + * **Note** Add retry logic for retryable HTTP status codes. [#147](https://github.com/patrickcping/pingone-go-sdk-v2/pull/147) + # Release (2023-04-18) * `github.com/patrickcping/pingone-go-sdk-v2` : v0.6.2 diff --git a/agreementmanagement/.version b/agreementmanagement/.version index 6da28dde..8294c184 100644 --- a/agreementmanagement/.version +++ b/agreementmanagement/.version @@ -1 +1 @@ -0.1.1 \ No newline at end of file +0.1.2 \ No newline at end of file diff --git a/agreementmanagement/CHANGELOG.md b/agreementmanagement/CHANGELOG.md index e076f908..7565b8cb 100644 --- a/agreementmanagement/CHANGELOG.md +++ b/agreementmanagement/CHANGELOG.md @@ -1,3 +1,7 @@ +# v0.1.2 (Unreleased) + +* **Note** Add retry logic for retryable HTTP status codes. [#147](https://github.com/patrickcping/pingone-go-sdk-v2/pull/147) + # v0.1.1 (2023-03-20) * **Note** Adjust client request/response debug and fix linting issues. [#133](https://github.com/patrickcping/pingone-go-sdk-v2/pull/133) diff --git a/agreementmanagement/README.md b/agreementmanagement/README.md index 4b72dacd..dfa2743a 100644 --- a/agreementmanagement/README.md +++ b/agreementmanagement/README.md @@ -6,7 +6,7 @@ The PingOne Platform API covering the PingOne Agreement Management service This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. - API version: 2022-09-23 -- Package version: 0.1.1 +- Package version: 0.1.2 - Build package: org.openapitools.codegen.languages.GoClientCodegen ## Installation diff --git a/agreementmanagement/api_agreement_revisions_resources.go b/agreementmanagement/api_agreement_revisions_resources.go index 5d7e1e85..05ebd8b7 100644 --- a/agreementmanagement/api_agreement_revisions_resources.go +++ b/agreementmanagement/api_agreement_revisions_resources.go @@ -60,6 +60,15 @@ func (a *AgreementRevisionsResourcesApiService) ReadOneAgreementLanguageRevision // Execute executes the request // @return AgreementRevisionText func (a *AgreementRevisionsResourcesApiService) ReadOneAgreementLanguageRevisionExecute(r ApiReadOneAgreementLanguageRevisionRequest) (*AgreementRevisionText, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneAgreementLanguageRevisionExecute(r) + }, + ) + return obj.(*AgreementRevisionText), response, error +} + +func (a *AgreementRevisionsResourcesApiService) internalReadOneAgreementLanguageRevisionExecute(r ApiReadOneAgreementLanguageRevisionRequest) (*AgreementRevisionText, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} diff --git a/agreementmanagement/client_ext.go b/agreementmanagement/client_ext.go new file mode 100644 index 00000000..e6daa4e2 --- /dev/null +++ b/agreementmanagement/client_ext.go @@ -0,0 +1,119 @@ +package agreementmanagement + + +import ( + "fmt" + "log" + "net/http" + "strconv" + "time" + + "golang.org/x/exp/slices" +) + +type SDKInterfaceFunc func() (interface{}, *http.Response, error) + +var ( + maxRetries = 5 + maximumRetryAfterBackoff = 30 +) + +func processResponse(f SDKInterfaceFunc) (interface{}, *http.Response, error) { + obj, response, error := exponentialBackOffRetry(f) + return obj, response, reformError(error) +} + +func reformError(err error) error { + return err +} + +func exponentialBackOffRetry(f SDKInterfaceFunc) (interface{}, *http.Response, error) { + var obj interface{} + var resp *http.Response + var err error + backOffTime := time.Second + var isRetryable bool + + for i := 0; i < maxRetries; i++ { + obj, resp, err = f() + + backOffTime, isRetryable = testForRetryable(resp, err, backOffTime) + + if isRetryable { + log.Printf("Attempt %d failed: %v, backing off by %s.", i+1, err, backOffTime.String()) + time.Sleep(backOffTime) + continue + } + + return obj, resp, err + } + + log.Printf("Request failed after %d attempts", maxRetries) + + return obj, resp, err // output the final error +} + +func testForRetryable(r *http.Response, err error, currentBackoff time.Duration) (time.Duration, bool) { + + backoff := currentBackoff + + if r != nil { + if r.StatusCode == 501 || r.StatusCode == 503 || r.StatusCode == 429 { + retryAfter, err := parseRetryAfterHeader(r) + if err != nil { + log.Printf("Cannot parse the expected \"Retry-After\" header: %s", err) + backoff = currentBackoff * 2 + } + + if retryAfter <= time.Duration(maximumRetryAfterBackoff) { + backoff += time.Duration(maximumRetryAfterBackoff) + } else { + backoff += retryAfter + } + } else { + backoff = currentBackoff * 2 + } + + retryAbleCodes := []int{ + 429, + 500, + 501, + 502, + 503, + 504, + } + + if slices.Contains(retryAbleCodes, r.StatusCode) { + log.Printf("HTTP status code %d detected, available for retry", r.StatusCode) + return backoff, true + } + } + + if err != nil { + log.Printf("Error found but not retried: %s", err) + } + + return backoff, false +} + +func parseRetryAfterHeader(resp *http.Response) (time.Duration, error) { + retryAfterHeader := resp.Header.Get("Retry-After") + + if retryAfterHeader == "" { + return 0, fmt.Errorf("Retry-After header not found") + } + + retryAfterSeconds, err := strconv.Atoi(retryAfterHeader) + + if err == nil { + return time.Duration(retryAfterSeconds) * time.Second, nil + } + + retryAfterTime, err := http.ParseTime(retryAfterHeader) + + if err != nil { + return 0, fmt.Errorf("Unable to parse Retry-After header value: %v", err) + } + + return time.Until(retryAfterTime), nil +} diff --git a/agreementmanagement/configuration.go b/agreementmanagement/configuration.go index a0e81a33..5da46a90 100644 --- a/agreementmanagement/configuration.go +++ b/agreementmanagement/configuration.go @@ -89,7 +89,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/0.1.1/go", + UserAgent: "OpenAPI-Generator/0.1.2/go", Debug: false, Servers: ServerConfigurations{ { diff --git a/agreementmanagement/go.mod b/agreementmanagement/go.mod index 690be80d..ee8d5bfb 100644 --- a/agreementmanagement/go.mod +++ b/agreementmanagement/go.mod @@ -1,3 +1,5 @@ module github.com/patrickcping/pingone-go-sdk-v2/agreementmanagement go 1.18 + +require golang.org/x/exp v0.0.0-20230321023759-10a507213a29 diff --git a/agreementmanagement/go.sum b/agreementmanagement/go.sum index e69de29b..45553005 100644 --- a/agreementmanagement/go.sum +++ b/agreementmanagement/go.sum @@ -0,0 +1,2 @@ +golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug= +golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= diff --git a/authorize/.version b/authorize/.version index 446ba66e..def9a015 100644 --- a/authorize/.version +++ b/authorize/.version @@ -1 +1 @@ -0.1.4 \ No newline at end of file +0.1.5 \ No newline at end of file diff --git a/authorize/CHANGELOG.md b/authorize/CHANGELOG.md index 4efbf3d2..3b27737a 100644 --- a/authorize/CHANGELOG.md +++ b/authorize/CHANGELOG.md @@ -1,3 +1,7 @@ +# v0.1.5 (Unreleased) + +* **Note** Add retry logic for retryable HTTP status codes. [#147](https://github.com/patrickcping/pingone-go-sdk-v2/pull/147) + # v0.1.4 (2023-03-20) * **Note** Adjust client request/response debug and fix linting issues. [#133](https://github.com/patrickcping/pingone-go-sdk-v2/pull/133) diff --git a/authorize/README.md b/authorize/README.md index 14c462ad..f6ff222d 100644 --- a/authorize/README.md +++ b/authorize/README.md @@ -6,7 +6,7 @@ The PingOne Platform API covering the PingOne Authorize service This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. - API version: 2022-09-23 -- Package version: 0.1.4 +- Package version: 0.1.5 - Build package: org.openapitools.codegen.languages.GoClientCodegen ## Installation diff --git a/authorize/api_api_servers.go b/authorize/api_api_servers.go index cb0a32b6..c77bcd33 100644 --- a/authorize/api_api_servers.go +++ b/authorize/api_api_servers.go @@ -57,6 +57,15 @@ func (a *APIServersApiService) CreateAPIServer(ctx context.Context, environmentI // Execute executes the request // @return APIServer func (a *APIServersApiService) CreateAPIServerExecute(r ApiCreateAPIServerRequest) (*APIServer, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateAPIServerExecute(r) + }, + ) + return obj.(*APIServer), response, error +} + +func (a *APIServersApiService) internalCreateAPIServerExecute(r ApiCreateAPIServerRequest) (*APIServer, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -239,6 +248,16 @@ func (a *APIServersApiService) DeleteAPIServer(ctx context.Context, environmentI // Execute executes the request func (a *APIServersApiService) DeleteAPIServerExecute(r ApiDeleteAPIServerRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteAPIServerExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *APIServersApiService) internalDeleteAPIServerExecute(r ApiDeleteAPIServerRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -397,6 +416,15 @@ func (a *APIServersApiService) ReadAllAPIServers(ctx context.Context, environmen // Execute executes the request // @return EntityArray func (a *APIServersApiService) ReadAllAPIServersExecute(r ApiReadAllAPIServersRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllAPIServersExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *APIServersApiService) internalReadAllAPIServersExecute(r ApiReadAllAPIServersRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -567,6 +595,15 @@ func (a *APIServersApiService) ReadOneAPIServer(ctx context.Context, environment // Execute executes the request // @return APIServer func (a *APIServersApiService) ReadOneAPIServerExecute(r ApiReadOneAPIServerRequest) (*APIServer, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneAPIServerExecute(r) + }, + ) + return obj.(*APIServer), response, error +} + +func (a *APIServersApiService) internalReadOneAPIServerExecute(r ApiReadOneAPIServerRequest) (*APIServer, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -744,6 +781,15 @@ func (a *APIServersApiService) UpdateAPIServer(ctx context.Context, environmentI // Execute executes the request // @return APIServer func (a *APIServersApiService) UpdateAPIServerExecute(r ApiUpdateAPIServerRequest) (*APIServer, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateAPIServerExecute(r) + }, + ) + return obj.(*APIServer), response, error +} + +func (a *APIServersApiService) internalUpdateAPIServerExecute(r ApiUpdateAPIServerRequest) (*APIServer, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/authorize/api_policy_decision_management.go b/authorize/api_policy_decision_management.go index 77a2df1f..fa3e6aad 100644 --- a/authorize/api_policy_decision_management.go +++ b/authorize/api_policy_decision_management.go @@ -57,6 +57,15 @@ func (a *PolicyDecisionManagementApiService) CreateDecisionEndpoint(ctx context. // Execute executes the request // @return DecisionEndpoint func (a *PolicyDecisionManagementApiService) CreateDecisionEndpointExecute(r ApiCreateDecisionEndpointRequest) (*DecisionEndpoint, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateDecisionEndpointExecute(r) + }, + ) + return obj.(*DecisionEndpoint), response, error +} + +func (a *PolicyDecisionManagementApiService) internalCreateDecisionEndpointExecute(r ApiCreateDecisionEndpointRequest) (*DecisionEndpoint, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -239,6 +248,16 @@ func (a *PolicyDecisionManagementApiService) DeleteDecisionEndpoint(ctx context. // Execute executes the request func (a *PolicyDecisionManagementApiService) DeleteDecisionEndpointExecute(r ApiDeleteDecisionEndpointRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteDecisionEndpointExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *PolicyDecisionManagementApiService) internalDeleteDecisionEndpointExecute(r ApiDeleteDecisionEndpointRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -397,6 +416,15 @@ func (a *PolicyDecisionManagementApiService) ReadAllDecisionEndpoints(ctx contex // Execute executes the request // @return EntityArray func (a *PolicyDecisionManagementApiService) ReadAllDecisionEndpointsExecute(r ApiReadAllDecisionEndpointsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllDecisionEndpointsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *PolicyDecisionManagementApiService) internalReadAllDecisionEndpointsExecute(r ApiReadAllDecisionEndpointsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -567,6 +595,15 @@ func (a *PolicyDecisionManagementApiService) ReadOneDecisionEndpoint(ctx context // Execute executes the request // @return DecisionEndpoint func (a *PolicyDecisionManagementApiService) ReadOneDecisionEndpointExecute(r ApiReadOneDecisionEndpointRequest) (*DecisionEndpoint, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneDecisionEndpointExecute(r) + }, + ) + return obj.(*DecisionEndpoint), response, error +} + +func (a *PolicyDecisionManagementApiService) internalReadOneDecisionEndpointExecute(r ApiReadOneDecisionEndpointRequest) (*DecisionEndpoint, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -744,6 +781,15 @@ func (a *PolicyDecisionManagementApiService) UpdateDecisionEndpoint(ctx context. // Execute executes the request // @return DecisionEndpoint func (a *PolicyDecisionManagementApiService) UpdateDecisionEndpointExecute(r ApiUpdateDecisionEndpointRequest) (*DecisionEndpoint, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateDecisionEndpointExecute(r) + }, + ) + return obj.(*DecisionEndpoint), response, error +} + +func (a *PolicyDecisionManagementApiService) internalUpdateDecisionEndpointExecute(r ApiUpdateDecisionEndpointRequest) (*DecisionEndpoint, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/authorize/client_ext.go b/authorize/client_ext.go new file mode 100644 index 00000000..9563f617 --- /dev/null +++ b/authorize/client_ext.go @@ -0,0 +1,119 @@ +package authorize + + +import ( + "fmt" + "log" + "net/http" + "strconv" + "time" + + "golang.org/x/exp/slices" +) + +type SDKInterfaceFunc func() (interface{}, *http.Response, error) + +var ( + maxRetries = 5 + maximumRetryAfterBackoff = 30 +) + +func processResponse(f SDKInterfaceFunc) (interface{}, *http.Response, error) { + obj, response, error := exponentialBackOffRetry(f) + return obj, response, reformError(error) +} + +func reformError(err error) error { + return err +} + +func exponentialBackOffRetry(f SDKInterfaceFunc) (interface{}, *http.Response, error) { + var obj interface{} + var resp *http.Response + var err error + backOffTime := time.Second + var isRetryable bool + + for i := 0; i < maxRetries; i++ { + obj, resp, err = f() + + backOffTime, isRetryable = testForRetryable(resp, err, backOffTime) + + if isRetryable { + log.Printf("Attempt %d failed: %v, backing off by %s.", i+1, err, backOffTime.String()) + time.Sleep(backOffTime) + continue + } + + return obj, resp, err + } + + log.Printf("Request failed after %d attempts", maxRetries) + + return obj, resp, err // output the final error +} + +func testForRetryable(r *http.Response, err error, currentBackoff time.Duration) (time.Duration, bool) { + + backoff := currentBackoff + + if r != nil { + if r.StatusCode == 501 || r.StatusCode == 503 || r.StatusCode == 429 { + retryAfter, err := parseRetryAfterHeader(r) + if err != nil { + log.Printf("Cannot parse the expected \"Retry-After\" header: %s", err) + backoff = currentBackoff * 2 + } + + if retryAfter <= time.Duration(maximumRetryAfterBackoff) { + backoff += time.Duration(maximumRetryAfterBackoff) + } else { + backoff += retryAfter + } + } else { + backoff = currentBackoff * 2 + } + + retryAbleCodes := []int{ + 429, + 500, + 501, + 502, + 503, + 504, + } + + if slices.Contains(retryAbleCodes, r.StatusCode) { + log.Printf("HTTP status code %d detected, available for retry", r.StatusCode) + return backoff, true + } + } + + if err != nil { + log.Printf("Error found but not retried: %s", err) + } + + return backoff, false +} + +func parseRetryAfterHeader(resp *http.Response) (time.Duration, error) { + retryAfterHeader := resp.Header.Get("Retry-After") + + if retryAfterHeader == "" { + return 0, fmt.Errorf("Retry-After header not found") + } + + retryAfterSeconds, err := strconv.Atoi(retryAfterHeader) + + if err == nil { + return time.Duration(retryAfterSeconds) * time.Second, nil + } + + retryAfterTime, err := http.ParseTime(retryAfterHeader) + + if err != nil { + return 0, fmt.Errorf("Unable to parse Retry-After header value: %v", err) + } + + return time.Until(retryAfterTime), nil +} diff --git a/authorize/configuration.go b/authorize/configuration.go index 95a97dbe..f1c78cd6 100644 --- a/authorize/configuration.go +++ b/authorize/configuration.go @@ -89,7 +89,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/0.1.4/go", + UserAgent: "OpenAPI-Generator/0.1.5/go", Debug: false, Servers: ServerConfigurations{ { diff --git a/authorize/go.mod b/authorize/go.mod index f2bd1a8d..e4701a87 100644 --- a/authorize/go.mod +++ b/authorize/go.mod @@ -1,3 +1,5 @@ module github.com/patrickcping/pingone-go-sdk-v2/authorize go 1.18 + +require golang.org/x/exp v0.0.0-20230321023759-10a507213a29 diff --git a/authorize/go.sum b/authorize/go.sum index e69de29b..45553005 100644 --- a/authorize/go.sum +++ b/authorize/go.sum @@ -0,0 +1,2 @@ +golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug= +golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= diff --git a/go.work.sum b/go.work.sum index c0be9644..6b3aa9f0 100644 --- a/go.work.sum +++ b/go.work.sum @@ -342,10 +342,8 @@ github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144T github.com/patrickcping/pingone-go-sdk-v2/authorize v0.1.1/go.mod h1:IMQjhejQfTfZkQNhbFq6VxRshTzJIpOEQO5x5w+n/nA= github.com/patrickcping/pingone-go-sdk-v2/management v0.14.0/go.mod h1:JK1xIupfpiOONjRMuoc9e7uBEodx6ciYhhc0iF3azI0= github.com/patrickcping/pingone-go-sdk-v2/management v0.17.0/go.mod h1:icHZVY/j9s2wl4oSdAy/JDJKrd5BYZ1io+XDhoI7sR4= -github.com/patrickcping/pingone-go-sdk-v2/management v0.18.0/go.mod h1:icHZVY/j9s2wl4oSdAy/JDJKrd5BYZ1io+XDhoI7sR4= github.com/patrickcping/pingone-go-sdk-v2/mfa v0.7.2/go.mod h1:XvlVDdfz69zPFi549g2OZaUC8/wnRUMgrra9MDQ8Hhg= github.com/patrickcping/pingone-go-sdk-v2/risk v0.3.1/go.mod h1:v6ANb988xfh9wvXs6WOAAosUwtogYpKmrrH88AW8Clo= -github.com/patrickcping/pingone-go-sdk-v2/risk v0.4.0/go.mod h1:FaUNtpFvX0RbW6X4xBJNlNhqDGU9YnyV+/n+4MMCCns= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.0.2/go.mod h1:MovirKjgVRESsAvNZlAjtFwV867yGuwRkXbG66OzopI= @@ -502,6 +500,7 @@ golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220809184613-07c6da5e1ced/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= @@ -558,6 +557,7 @@ golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw= @@ -568,6 +568,7 @@ golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ= +golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/management/.version b/management/.version index 47d04a52..6b2d58c8 100644 --- a/management/.version +++ b/management/.version @@ -1 +1 @@ -0.18.0 \ No newline at end of file +0.18.1 \ No newline at end of file diff --git a/management/CHANGELOG.md b/management/CHANGELOG.md index 3d171b9e..8c5e988e 100644 --- a/management/CHANGELOG.md +++ b/management/CHANGELOG.md @@ -1,3 +1,7 @@ +# v0.18.1 (Unreleased) + +* **Note** Add retry logic for retryable HTTP status codes. [#147](https://github.com/patrickcping/pingone-go-sdk-v2/pull/147) + # v0.18.0 (2023-04-18) * **Enhancement** Add `CustomCRL` to the `Certificate` data model [#136](https://github.com/patrickcping/pingone-go-sdk-v2/pull/136) diff --git a/management/README.md b/management/README.md index 4ec1b7b1..09fd4274 100644 --- a/management/README.md +++ b/management/README.md @@ -6,7 +6,7 @@ The PingOne Platform API covering the base and SSO services (otherwise known as This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. - API version: 2022-08-02 -- Package version: 0.18.0 +- Package version: 0.18.1 - Build package: org.openapitools.codegen.languages.GoClientCodegen ## Installation diff --git a/management/api_active_identity_counts.go b/management/api_active_identity_counts.go index 754d5979..81034dcc 100644 --- a/management/api_active_identity_counts.go +++ b/management/api_active_identity_counts.go @@ -71,6 +71,16 @@ func (a *ActiveIdentityCountsApiService) ReadActiveIdentityCount(ctx context.Con // Execute executes the request func (a *ActiveIdentityCountsApiService) ReadActiveIdentityCountExecute(r ApiReadActiveIdentityCountRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalReadActiveIdentityCountExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *ActiveIdentityCountsApiService) internalReadActiveIdentityCountExecute(r ApiReadActiveIdentityCountRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} diff --git a/management/api_agreement_languages_resources.go b/management/api_agreement_languages_resources.go index 122bb435..5cf392a7 100644 --- a/management/api_agreement_languages_resources.go +++ b/management/api_agreement_languages_resources.go @@ -60,6 +60,15 @@ func (a *AgreementLanguagesResourcesApiService) CreateAgreementLanguage(ctx cont // Execute executes the request // @return AgreementLanguage func (a *AgreementLanguagesResourcesApiService) CreateAgreementLanguageExecute(r ApiCreateAgreementLanguageRequest) (*AgreementLanguage, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateAgreementLanguageExecute(r) + }, + ) + return obj.(*AgreementLanguage), response, error +} + +func (a *AgreementLanguagesResourcesApiService) internalCreateAgreementLanguageExecute(r ApiCreateAgreementLanguageRequest) (*AgreementLanguage, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -246,6 +255,16 @@ func (a *AgreementLanguagesResourcesApiService) DeleteAgreementLanguage(ctx cont // Execute executes the request func (a *AgreementLanguagesResourcesApiService) DeleteAgreementLanguageExecute(r ApiDeleteAgreementLanguageRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteAgreementLanguageExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *AgreementLanguagesResourcesApiService) internalDeleteAgreementLanguageExecute(r ApiDeleteAgreementLanguageRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -408,6 +427,15 @@ func (a *AgreementLanguagesResourcesApiService) ReadAllAgreementLanguages(ctx co // Execute executes the request // @return EntityArray func (a *AgreementLanguagesResourcesApiService) ReadAllAgreementLanguagesExecute(r ApiReadAllAgreementLanguagesRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllAgreementLanguagesExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *AgreementLanguagesResourcesApiService) internalReadAllAgreementLanguagesExecute(r ApiReadAllAgreementLanguagesRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -582,6 +610,15 @@ func (a *AgreementLanguagesResourcesApiService) ReadOneAgreementLanguage(ctx con // Execute executes the request // @return AgreementLanguage func (a *AgreementLanguagesResourcesApiService) ReadOneAgreementLanguageExecute(r ApiReadOneAgreementLanguageRequest) (*AgreementLanguage, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneAgreementLanguageExecute(r) + }, + ) + return obj.(*AgreementLanguage), response, error +} + +func (a *AgreementLanguagesResourcesApiService) internalReadOneAgreementLanguageExecute(r ApiReadOneAgreementLanguageRequest) (*AgreementLanguage, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -763,6 +800,15 @@ func (a *AgreementLanguagesResourcesApiService) UpdateAgreementLanguage(ctx cont // Execute executes the request // @return AgreementLanguage func (a *AgreementLanguagesResourcesApiService) UpdateAgreementLanguageExecute(r ApiUpdateAgreementLanguageRequest) (*AgreementLanguage, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateAgreementLanguageExecute(r) + }, + ) + return obj.(*AgreementLanguage), response, error +} + +func (a *AgreementLanguagesResourcesApiService) internalUpdateAgreementLanguageExecute(r ApiUpdateAgreementLanguageRequest) (*AgreementLanguage, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_agreement_revisions_resources.go b/management/api_agreement_revisions_resources.go index 7090a7cc..3f918624 100644 --- a/management/api_agreement_revisions_resources.go +++ b/management/api_agreement_revisions_resources.go @@ -63,6 +63,15 @@ func (a *AgreementRevisionsResourcesApiService) CreateAgreementLanguageRevision( // Execute executes the request // @return AgreementLanguageRevision func (a *AgreementRevisionsResourcesApiService) CreateAgreementLanguageRevisionExecute(r ApiCreateAgreementLanguageRevisionRequest) (*AgreementLanguageRevision, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateAgreementLanguageRevisionExecute(r) + }, + ) + return obj.(*AgreementLanguageRevision), response, error +} + +func (a *AgreementRevisionsResourcesApiService) internalCreateAgreementLanguageRevisionExecute(r ApiCreateAgreementLanguageRevisionRequest) (*AgreementLanguageRevision, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -253,6 +262,16 @@ func (a *AgreementRevisionsResourcesApiService) DeleteAgreementLanguageRevision( // Execute executes the request func (a *AgreementRevisionsResourcesApiService) DeleteAgreementLanguageRevisionExecute(r ApiDeleteAgreementLanguageRevisionRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteAgreementLanguageRevisionExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *AgreementRevisionsResourcesApiService) internalDeleteAgreementLanguageRevisionExecute(r ApiDeleteAgreementLanguageRevisionRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -419,6 +438,15 @@ func (a *AgreementRevisionsResourcesApiService) ReadAllAgreementLanguageRevision // Execute executes the request // @return EntityArray func (a *AgreementRevisionsResourcesApiService) ReadAllAgreementLanguageRevisionsExecute(r ApiReadAllAgreementLanguageRevisionsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllAgreementLanguageRevisionsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *AgreementRevisionsResourcesApiService) internalReadAllAgreementLanguageRevisionsExecute(r ApiReadAllAgreementLanguageRevisionsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -597,6 +625,15 @@ func (a *AgreementRevisionsResourcesApiService) ReadOneAgreementLanguageRevision // Execute executes the request // @return AgreementLanguageRevision func (a *AgreementRevisionsResourcesApiService) ReadOneAgreementLanguageRevisionExecute(r ApiReadOneAgreementLanguageRevisionRequest) (*AgreementLanguageRevision, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneAgreementLanguageRevisionExecute(r) + }, + ) + return obj.(*AgreementLanguageRevision), response, error +} + +func (a *AgreementRevisionsResourcesApiService) internalReadOneAgreementLanguageRevisionExecute(r ApiReadOneAgreementLanguageRevisionRequest) (*AgreementLanguageRevision, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} diff --git a/management/api_agreements_resources.go b/management/api_agreements_resources.go index fc7e9163..3a6ed8f9 100644 --- a/management/api_agreements_resources.go +++ b/management/api_agreements_resources.go @@ -57,6 +57,15 @@ func (a *AgreementsResourcesApiService) CreateAgreement(ctx context.Context, env // Execute executes the request // @return Agreement func (a *AgreementsResourcesApiService) CreateAgreementExecute(r ApiCreateAgreementRequest) (*Agreement, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateAgreementExecute(r) + }, + ) + return obj.(*Agreement), response, error +} + +func (a *AgreementsResourcesApiService) internalCreateAgreementExecute(r ApiCreateAgreementRequest) (*Agreement, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -239,6 +248,16 @@ func (a *AgreementsResourcesApiService) DeleteAgreement(ctx context.Context, env // Execute executes the request func (a *AgreementsResourcesApiService) DeleteAgreementExecute(r ApiDeleteAgreementRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteAgreementExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *AgreementsResourcesApiService) internalDeleteAgreementExecute(r ApiDeleteAgreementRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -397,6 +416,15 @@ func (a *AgreementsResourcesApiService) ReadAllAgreements(ctx context.Context, e // Execute executes the request // @return EntityArray func (a *AgreementsResourcesApiService) ReadAllAgreementsExecute(r ApiReadAllAgreementsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllAgreementsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *AgreementsResourcesApiService) internalReadAllAgreementsExecute(r ApiReadAllAgreementsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -567,6 +595,15 @@ func (a *AgreementsResourcesApiService) ReadOneAgreement(ctx context.Context, en // Execute executes the request // @return Agreement func (a *AgreementsResourcesApiService) ReadOneAgreementExecute(r ApiReadOneAgreementRequest) (*Agreement, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneAgreementExecute(r) + }, + ) + return obj.(*Agreement), response, error +} + +func (a *AgreementsResourcesApiService) internalReadOneAgreementExecute(r ApiReadOneAgreementRequest) (*Agreement, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -744,6 +781,15 @@ func (a *AgreementsResourcesApiService) UpdateAgreement(ctx context.Context, env // Execute executes the request // @return Agreement func (a *AgreementsResourcesApiService) UpdateAgreementExecute(r ApiUpdateAgreementRequest) (*Agreement, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateAgreementExecute(r) + }, + ) + return obj.(*Agreement), response, error +} + +func (a *AgreementsResourcesApiService) internalUpdateAgreementExecute(r ApiUpdateAgreementRequest) (*Agreement, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_alerting.go b/management/api_alerting.go index 4c265408..2f2d3cef 100644 --- a/management/api_alerting.go +++ b/management/api_alerting.go @@ -57,6 +57,15 @@ func (a *AlertingApiService) CreateAlertChannel(ctx context.Context, environment // Execute executes the request // @return AlertChannel func (a *AlertingApiService) CreateAlertChannelExecute(r ApiCreateAlertChannelRequest) (*AlertChannel, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateAlertChannelExecute(r) + }, + ) + return obj.(*AlertChannel), response, error +} + +func (a *AlertingApiService) internalCreateAlertChannelExecute(r ApiCreateAlertChannelRequest) (*AlertChannel, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -239,6 +248,16 @@ func (a *AlertingApiService) DeleteAlertChannel(ctx context.Context, environment // Execute executes the request func (a *AlertingApiService) DeleteAlertChannelExecute(r ApiDeleteAlertChannelRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteAlertChannelExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *AlertingApiService) internalDeleteAlertChannelExecute(r ApiDeleteAlertChannelRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -397,6 +416,15 @@ func (a *AlertingApiService) ReadAllAlertChannels(ctx context.Context, environme // Execute executes the request // @return EntityArray func (a *AlertingApiService) ReadAllAlertChannelsExecute(r ApiReadAllAlertChannelsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllAlertChannelsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *AlertingApiService) internalReadAllAlertChannelsExecute(r ApiReadAllAlertChannelsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -567,6 +595,15 @@ func (a *AlertingApiService) ReadOneAlertChannel(ctx context.Context, environmen // Execute executes the request // @return AlertChannel func (a *AlertingApiService) ReadOneAlertChannelExecute(r ApiReadOneAlertChannelRequest) (*AlertChannel, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneAlertChannelExecute(r) + }, + ) + return obj.(*AlertChannel), response, error +} + +func (a *AlertingApiService) internalReadOneAlertChannelExecute(r ApiReadOneAlertChannelRequest) (*AlertChannel, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -744,6 +781,15 @@ func (a *AlertingApiService) UpdateAlertChannel(ctx context.Context, environment // Execute executes the request // @return AlertChannel func (a *AlertingApiService) UpdateAlertChannelExecute(r ApiUpdateAlertChannelRequest) (*AlertChannel, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateAlertChannelExecute(r) + }, + ) + return obj.(*AlertChannel), response, error +} + +func (a *AlertingApiService) internalUpdateAlertChannelExecute(r ApiUpdateAlertChannelRequest) (*AlertChannel, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_application_attribute_mapping.go b/management/api_application_attribute_mapping.go index 6adb3096..2fe5bd8f 100644 --- a/management/api_application_attribute_mapping.go +++ b/management/api_application_attribute_mapping.go @@ -60,6 +60,15 @@ func (a *ApplicationAttributeMappingApiService) CreateApplicationAttributeMappin // Execute executes the request // @return ApplicationAttributeMapping func (a *ApplicationAttributeMappingApiService) CreateApplicationAttributeMappingExecute(r ApiCreateApplicationAttributeMappingRequest) (*ApplicationAttributeMapping, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateApplicationAttributeMappingExecute(r) + }, + ) + return obj.(*ApplicationAttributeMapping), response, error +} + +func (a *ApplicationAttributeMappingApiService) internalCreateApplicationAttributeMappingExecute(r ApiCreateApplicationAttributeMappingRequest) (*ApplicationAttributeMapping, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -246,6 +255,16 @@ func (a *ApplicationAttributeMappingApiService) DeleteApplicationAttributeMappin // Execute executes the request func (a *ApplicationAttributeMappingApiService) DeleteApplicationAttributeMappingExecute(r ApiDeleteApplicationAttributeMappingRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteApplicationAttributeMappingExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *ApplicationAttributeMappingApiService) internalDeleteApplicationAttributeMappingExecute(r ApiDeleteApplicationAttributeMappingRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -408,6 +427,15 @@ func (a *ApplicationAttributeMappingApiService) ReadAllApplicationAttributeMappi // Execute executes the request // @return EntityArray func (a *ApplicationAttributeMappingApiService) ReadAllApplicationAttributeMappingsExecute(r ApiReadAllApplicationAttributeMappingsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllApplicationAttributeMappingsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *ApplicationAttributeMappingApiService) internalReadAllApplicationAttributeMappingsExecute(r ApiReadAllApplicationAttributeMappingsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -582,6 +610,15 @@ func (a *ApplicationAttributeMappingApiService) ReadOneApplicationAttributeMappi // Execute executes the request // @return ApplicationAttributeMapping func (a *ApplicationAttributeMappingApiService) ReadOneApplicationAttributeMappingExecute(r ApiReadOneApplicationAttributeMappingRequest) (*ApplicationAttributeMapping, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneApplicationAttributeMappingExecute(r) + }, + ) + return obj.(*ApplicationAttributeMapping), response, error +} + +func (a *ApplicationAttributeMappingApiService) internalReadOneApplicationAttributeMappingExecute(r ApiReadOneApplicationAttributeMappingRequest) (*ApplicationAttributeMapping, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -763,6 +800,15 @@ func (a *ApplicationAttributeMappingApiService) UpdateApplicationAttributeMappin // Execute executes the request // @return ApplicationAttributeMapping func (a *ApplicationAttributeMappingApiService) UpdateApplicationAttributeMappingExecute(r ApiUpdateApplicationAttributeMappingRequest) (*ApplicationAttributeMapping, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateApplicationAttributeMappingExecute(r) + }, + ) + return obj.(*ApplicationAttributeMapping), response, error +} + +func (a *ApplicationAttributeMappingApiService) internalUpdateApplicationAttributeMappingExecute(r ApiUpdateApplicationAttributeMappingRequest) (*ApplicationAttributeMapping, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_application_flow_policy_assignments.go b/management/api_application_flow_policy_assignments.go index 28701d4d..ce20981c 100644 --- a/management/api_application_flow_policy_assignments.go +++ b/management/api_application_flow_policy_assignments.go @@ -60,6 +60,15 @@ func (a *ApplicationFlowPolicyAssignmentsApiService) CreateFlowPolicyAssignment( // Execute executes the request // @return FlowPolicyAssignment func (a *ApplicationFlowPolicyAssignmentsApiService) CreateFlowPolicyAssignmentExecute(r ApiCreateFlowPolicyAssignmentRequest) (*FlowPolicyAssignment, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateFlowPolicyAssignmentExecute(r) + }, + ) + return obj.(*FlowPolicyAssignment), response, error +} + +func (a *ApplicationFlowPolicyAssignmentsApiService) internalCreateFlowPolicyAssignmentExecute(r ApiCreateFlowPolicyAssignmentRequest) (*FlowPolicyAssignment, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -246,6 +255,16 @@ func (a *ApplicationFlowPolicyAssignmentsApiService) DeleteFlowPolicyAssignment( // Execute executes the request func (a *ApplicationFlowPolicyAssignmentsApiService) DeleteFlowPolicyAssignmentExecute(r ApiDeleteFlowPolicyAssignmentRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteFlowPolicyAssignmentExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *ApplicationFlowPolicyAssignmentsApiService) internalDeleteFlowPolicyAssignmentExecute(r ApiDeleteFlowPolicyAssignmentRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -408,6 +427,15 @@ func (a *ApplicationFlowPolicyAssignmentsApiService) ReadAllFlowPolicyAssignment // Execute executes the request // @return EntityArray func (a *ApplicationFlowPolicyAssignmentsApiService) ReadAllFlowPolicyAssignmentsExecute(r ApiReadAllFlowPolicyAssignmentsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllFlowPolicyAssignmentsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *ApplicationFlowPolicyAssignmentsApiService) internalReadAllFlowPolicyAssignmentsExecute(r ApiReadAllFlowPolicyAssignmentsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -582,6 +610,15 @@ func (a *ApplicationFlowPolicyAssignmentsApiService) ReadOneFlowPolicyAssignment // Execute executes the request // @return FlowPolicyAssignment func (a *ApplicationFlowPolicyAssignmentsApiService) ReadOneFlowPolicyAssignmentExecute(r ApiReadOneFlowPolicyAssignmentRequest) (*FlowPolicyAssignment, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneFlowPolicyAssignmentExecute(r) + }, + ) + return obj.(*FlowPolicyAssignment), response, error +} + +func (a *ApplicationFlowPolicyAssignmentsApiService) internalReadOneFlowPolicyAssignmentExecute(r ApiReadOneFlowPolicyAssignmentRequest) (*FlowPolicyAssignment, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -763,6 +800,15 @@ func (a *ApplicationFlowPolicyAssignmentsApiService) UpdateFlowPolicyAssignment( // Execute executes the request // @return FlowPolicyAssignment func (a *ApplicationFlowPolicyAssignmentsApiService) UpdateFlowPolicyAssignmentExecute(r ApiUpdateFlowPolicyAssignmentRequest) (*FlowPolicyAssignment, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateFlowPolicyAssignmentExecute(r) + }, + ) + return obj.(*FlowPolicyAssignment), response, error +} + +func (a *ApplicationFlowPolicyAssignmentsApiService) internalUpdateFlowPolicyAssignmentExecute(r ApiUpdateFlowPolicyAssignmentRequest) (*FlowPolicyAssignment, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_application_resource_grants.go b/management/api_application_resource_grants.go index d4371eaa..a29991b0 100644 --- a/management/api_application_resource_grants.go +++ b/management/api_application_resource_grants.go @@ -60,6 +60,15 @@ func (a *ApplicationResourceGrantsApiService) CreateApplicationGrant(ctx context // Execute executes the request // @return ApplicationResourceGrant func (a *ApplicationResourceGrantsApiService) CreateApplicationGrantExecute(r ApiCreateApplicationGrantRequest) (*ApplicationResourceGrant, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateApplicationGrantExecute(r) + }, + ) + return obj.(*ApplicationResourceGrant), response, error +} + +func (a *ApplicationResourceGrantsApiService) internalCreateApplicationGrantExecute(r ApiCreateApplicationGrantRequest) (*ApplicationResourceGrant, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -246,6 +255,16 @@ func (a *ApplicationResourceGrantsApiService) DeleteApplicationGrant(ctx context // Execute executes the request func (a *ApplicationResourceGrantsApiService) DeleteApplicationGrantExecute(r ApiDeleteApplicationGrantRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteApplicationGrantExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *ApplicationResourceGrantsApiService) internalDeleteApplicationGrantExecute(r ApiDeleteApplicationGrantRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -408,6 +427,15 @@ func (a *ApplicationResourceGrantsApiService) ReadAllApplicationGrants(ctx conte // Execute executes the request // @return EntityArray func (a *ApplicationResourceGrantsApiService) ReadAllApplicationGrantsExecute(r ApiReadAllApplicationGrantsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllApplicationGrantsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *ApplicationResourceGrantsApiService) internalReadAllApplicationGrantsExecute(r ApiReadAllApplicationGrantsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -582,6 +610,15 @@ func (a *ApplicationResourceGrantsApiService) ReadOneApplicationGrant(ctx contex // Execute executes the request // @return ApplicationResourceGrant func (a *ApplicationResourceGrantsApiService) ReadOneApplicationGrantExecute(r ApiReadOneApplicationGrantRequest) (*ApplicationResourceGrant, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneApplicationGrantExecute(r) + }, + ) + return obj.(*ApplicationResourceGrant), response, error +} + +func (a *ApplicationResourceGrantsApiService) internalReadOneApplicationGrantExecute(r ApiReadOneApplicationGrantRequest) (*ApplicationResourceGrant, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -763,6 +800,15 @@ func (a *ApplicationResourceGrantsApiService) UpdateApplicationGrant(ctx context // Execute executes the request // @return ApplicationResourceGrant func (a *ApplicationResourceGrantsApiService) UpdateApplicationGrantExecute(r ApiUpdateApplicationGrantRequest) (*ApplicationResourceGrant, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateApplicationGrantExecute(r) + }, + ) + return obj.(*ApplicationResourceGrant), response, error +} + +func (a *ApplicationResourceGrantsApiService) internalUpdateApplicationGrantExecute(r ApiUpdateApplicationGrantRequest) (*ApplicationResourceGrant, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_application_role_assignments.go b/management/api_application_role_assignments.go index 3a919461..f781f3b7 100644 --- a/management/api_application_role_assignments.go +++ b/management/api_application_role_assignments.go @@ -60,6 +60,15 @@ func (a *ApplicationRoleAssignmentsApiService) CreateApplicationRoleAssignment(c // Execute executes the request // @return RoleAssignment func (a *ApplicationRoleAssignmentsApiService) CreateApplicationRoleAssignmentExecute(r ApiCreateApplicationRoleAssignmentRequest) (*RoleAssignment, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateApplicationRoleAssignmentExecute(r) + }, + ) + return obj.(*RoleAssignment), response, error +} + +func (a *ApplicationRoleAssignmentsApiService) internalCreateApplicationRoleAssignmentExecute(r ApiCreateApplicationRoleAssignmentRequest) (*RoleAssignment, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -246,6 +255,16 @@ func (a *ApplicationRoleAssignmentsApiService) DeleteApplicationRoleAssignment(c // Execute executes the request func (a *ApplicationRoleAssignmentsApiService) DeleteApplicationRoleAssignmentExecute(r ApiDeleteApplicationRoleAssignmentRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteApplicationRoleAssignmentExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *ApplicationRoleAssignmentsApiService) internalDeleteApplicationRoleAssignmentExecute(r ApiDeleteApplicationRoleAssignmentRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -408,6 +427,15 @@ func (a *ApplicationRoleAssignmentsApiService) ReadApplicationRoleAssignments(ct // Execute executes the request // @return EntityArray func (a *ApplicationRoleAssignmentsApiService) ReadApplicationRoleAssignmentsExecute(r ApiReadApplicationRoleAssignmentsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadApplicationRoleAssignmentsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *ApplicationRoleAssignmentsApiService) internalReadApplicationRoleAssignmentsExecute(r ApiReadApplicationRoleAssignmentsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -582,6 +610,15 @@ func (a *ApplicationRoleAssignmentsApiService) ReadOneApplicationRoleAssignment( // Execute executes the request // @return RoleAssignment func (a *ApplicationRoleAssignmentsApiService) ReadOneApplicationRoleAssignmentExecute(r ApiReadOneApplicationRoleAssignmentRequest) (*RoleAssignment, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneApplicationRoleAssignmentExecute(r) + }, + ) + return obj.(*RoleAssignment), response, error +} + +func (a *ApplicationRoleAssignmentsApiService) internalReadOneApplicationRoleAssignmentExecute(r ApiReadOneApplicationRoleAssignmentRequest) (*RoleAssignment, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} diff --git a/management/api_application_secret.go b/management/api_application_secret.go index c0acd3fc..f5cde8d1 100644 --- a/management/api_application_secret.go +++ b/management/api_application_secret.go @@ -54,6 +54,15 @@ func (a *ApplicationSecretApiService) ReadApplicationSecret(ctx context.Context, // Execute executes the request // @return ApplicationSecret func (a *ApplicationSecretApiService) ReadApplicationSecretExecute(r ApiReadApplicationSecretRequest) (*ApplicationSecret, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadApplicationSecretExecute(r) + }, + ) + return obj.(*ApplicationSecret), response, error +} + +func (a *ApplicationSecretApiService) internalReadApplicationSecretExecute(r ApiReadApplicationSecretRequest) (*ApplicationSecret, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -224,6 +233,16 @@ func (a *ApplicationSecretApiService) UpdateApplicationSecret(ctx context.Contex // Execute executes the request func (a *ApplicationSecretApiService) UpdateApplicationSecretExecute(r ApiUpdateApplicationSecretRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalUpdateApplicationSecretExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *ApplicationSecretApiService) internalUpdateApplicationSecretExecute(r ApiUpdateApplicationSecretRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} diff --git a/management/api_application_sign_on_policy_assignments.go b/management/api_application_sign_on_policy_assignments.go index f771b8c1..448d7720 100644 --- a/management/api_application_sign_on_policy_assignments.go +++ b/management/api_application_sign_on_policy_assignments.go @@ -60,6 +60,15 @@ func (a *ApplicationSignOnPolicyAssignmentsApiService) CreateSignOnPolicyAssignm // Execute executes the request // @return SignOnPolicyAssignment func (a *ApplicationSignOnPolicyAssignmentsApiService) CreateSignOnPolicyAssignmentExecute(r ApiCreateSignOnPolicyAssignmentRequest) (*SignOnPolicyAssignment, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateSignOnPolicyAssignmentExecute(r) + }, + ) + return obj.(*SignOnPolicyAssignment), response, error +} + +func (a *ApplicationSignOnPolicyAssignmentsApiService) internalCreateSignOnPolicyAssignmentExecute(r ApiCreateSignOnPolicyAssignmentRequest) (*SignOnPolicyAssignment, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -246,6 +255,16 @@ func (a *ApplicationSignOnPolicyAssignmentsApiService) DeleteSignOnPolicyAssignm // Execute executes the request func (a *ApplicationSignOnPolicyAssignmentsApiService) DeleteSignOnPolicyAssignmentExecute(r ApiDeleteSignOnPolicyAssignmentRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteSignOnPolicyAssignmentExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *ApplicationSignOnPolicyAssignmentsApiService) internalDeleteSignOnPolicyAssignmentExecute(r ApiDeleteSignOnPolicyAssignmentRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -408,6 +427,15 @@ func (a *ApplicationSignOnPolicyAssignmentsApiService) ReadAllSignOnPolicyAssign // Execute executes the request // @return EntityArray func (a *ApplicationSignOnPolicyAssignmentsApiService) ReadAllSignOnPolicyAssignmentsExecute(r ApiReadAllSignOnPolicyAssignmentsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllSignOnPolicyAssignmentsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *ApplicationSignOnPolicyAssignmentsApiService) internalReadAllSignOnPolicyAssignmentsExecute(r ApiReadAllSignOnPolicyAssignmentsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -582,6 +610,15 @@ func (a *ApplicationSignOnPolicyAssignmentsApiService) ReadOneSignOnPolicyAssign // Execute executes the request // @return SignOnPolicyAssignment func (a *ApplicationSignOnPolicyAssignmentsApiService) ReadOneSignOnPolicyAssignmentExecute(r ApiReadOneSignOnPolicyAssignmentRequest) (*SignOnPolicyAssignment, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneSignOnPolicyAssignmentExecute(r) + }, + ) + return obj.(*SignOnPolicyAssignment), response, error +} + +func (a *ApplicationSignOnPolicyAssignmentsApiService) internalReadOneSignOnPolicyAssignmentExecute(r ApiReadOneSignOnPolicyAssignmentRequest) (*SignOnPolicyAssignment, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -763,6 +800,15 @@ func (a *ApplicationSignOnPolicyAssignmentsApiService) UpdateSignOnPolicyAssignm // Execute executes the request // @return SignOnPolicyAssignment func (a *ApplicationSignOnPolicyAssignmentsApiService) UpdateSignOnPolicyAssignmentExecute(r ApiUpdateSignOnPolicyAssignmentRequest) (*SignOnPolicyAssignment, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateSignOnPolicyAssignmentExecute(r) + }, + ) + return obj.(*SignOnPolicyAssignment), response, error +} + +func (a *ApplicationSignOnPolicyAssignmentsApiService) internalUpdateSignOnPolicyAssignmentExecute(r ApiUpdateSignOnPolicyAssignmentRequest) (*SignOnPolicyAssignment, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_applications.go b/management/api_applications.go index 1802a30c..19dee65d 100644 --- a/management/api_applications.go +++ b/management/api_applications.go @@ -239,6 +239,16 @@ func (a *ApplicationsApiService) DeleteApplication(ctx context.Context, environm // Execute executes the request func (a *ApplicationsApiService) DeleteApplicationExecute(r ApiDeleteApplicationRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteApplicationExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *ApplicationsApiService) internalDeleteApplicationExecute(r ApiDeleteApplicationRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -397,6 +407,15 @@ func (a *ApplicationsApiService) ReadAllApplications(ctx context.Context, enviro // Execute executes the request // @return EntityArray func (a *ApplicationsApiService) ReadAllApplicationsExecute(r ApiReadAllApplicationsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllApplicationsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *ApplicationsApiService) internalReadAllApplicationsExecute(r ApiReadAllApplicationsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} diff --git a/management/api_bill_of_materials_bom.go b/management/api_bill_of_materials_bom.go index 850d5f7c..2fb89a38 100644 --- a/management/api_bill_of_materials_bom.go +++ b/management/api_bill_of_materials_bom.go @@ -51,6 +51,15 @@ func (a *BillOfMaterialsBOMApiService) ReadOneBillOfMaterials(ctx context.Contex // Execute executes the request // @return BillOfMaterials func (a *BillOfMaterialsBOMApiService) ReadOneBillOfMaterialsExecute(r ApiReadOneBillOfMaterialsRequest) (*BillOfMaterials, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneBillOfMaterialsExecute(r) + }, + ) + return obj.(*BillOfMaterials), response, error +} + +func (a *BillOfMaterialsBOMApiService) internalReadOneBillOfMaterialsExecute(r ApiReadOneBillOfMaterialsRequest) (*BillOfMaterials, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -224,6 +233,15 @@ func (a *BillOfMaterialsBOMApiService) UpdateBillOfMaterials(ctx context.Context // Execute executes the request // @return BillOfMaterials func (a *BillOfMaterialsBOMApiService) UpdateBillOfMaterialsExecute(r ApiUpdateBillOfMaterialsRequest) (*BillOfMaterials, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateBillOfMaterialsExecute(r) + }, + ) + return obj.(*BillOfMaterials), response, error +} + +func (a *BillOfMaterialsBOMApiService) internalUpdateBillOfMaterialsExecute(r ApiUpdateBillOfMaterialsRequest) (*BillOfMaterials, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_branding_settings.go b/management/api_branding_settings.go index cd3766d7..e80bc514 100644 --- a/management/api_branding_settings.go +++ b/management/api_branding_settings.go @@ -51,6 +51,15 @@ func (a *BrandingSettingsApiService) ReadBrandingSettings(ctx context.Context, e // Execute executes the request // @return BrandingSettings func (a *BrandingSettingsApiService) ReadBrandingSettingsExecute(r ApiReadBrandingSettingsRequest) (*BrandingSettings, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadBrandingSettingsExecute(r) + }, + ) + return obj.(*BrandingSettings), response, error +} + +func (a *BrandingSettingsApiService) internalReadBrandingSettingsExecute(r ApiReadBrandingSettingsRequest) (*BrandingSettings, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -224,6 +233,15 @@ func (a *BrandingSettingsApiService) UpdateBrandingSettings(ctx context.Context, // Execute executes the request // @return BrandingSettings func (a *BrandingSettingsApiService) UpdateBrandingSettingsExecute(r ApiUpdateBrandingSettingsRequest) (*BrandingSettings, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateBrandingSettingsExecute(r) + }, + ) + return obj.(*BrandingSettings), response, error +} + +func (a *BrandingSettingsApiService) internalUpdateBrandingSettingsExecute(r ApiUpdateBrandingSettingsRequest) (*BrandingSettings, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_branding_themes.go b/management/api_branding_themes.go index bb3423aa..1e1aa016 100644 --- a/management/api_branding_themes.go +++ b/management/api_branding_themes.go @@ -57,6 +57,15 @@ func (a *BrandingThemesApiService) CreateBrandingTheme(ctx context.Context, envi // Execute executes the request // @return BrandingTheme func (a *BrandingThemesApiService) CreateBrandingThemeExecute(r ApiCreateBrandingThemeRequest) (*BrandingTheme, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateBrandingThemeExecute(r) + }, + ) + return obj.(*BrandingTheme), response, error +} + +func (a *BrandingThemesApiService) internalCreateBrandingThemeExecute(r ApiCreateBrandingThemeRequest) (*BrandingTheme, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -239,6 +248,16 @@ func (a *BrandingThemesApiService) DeleteBrandingTheme(ctx context.Context, envi // Execute executes the request func (a *BrandingThemesApiService) DeleteBrandingThemeExecute(r ApiDeleteBrandingThemeRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteBrandingThemeExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *BrandingThemesApiService) internalDeleteBrandingThemeExecute(r ApiDeleteBrandingThemeRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -400,6 +419,15 @@ func (a *BrandingThemesApiService) ReadBrandingThemeDefault(ctx context.Context, // Execute executes the request // @return BrandingThemeDefault func (a *BrandingThemesApiService) ReadBrandingThemeDefaultExecute(r ApiReadBrandingThemeDefaultRequest) (*BrandingThemeDefault, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadBrandingThemeDefaultExecute(r) + }, + ) + return obj.(*BrandingThemeDefault), response, error +} + +func (a *BrandingThemesApiService) internalReadBrandingThemeDefaultExecute(r ApiReadBrandingThemeDefaultRequest) (*BrandingThemeDefault, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -568,6 +596,15 @@ func (a *BrandingThemesApiService) ReadBrandingThemes(ctx context.Context, envir // Execute executes the request // @return EntityArray func (a *BrandingThemesApiService) ReadBrandingThemesExecute(r ApiReadBrandingThemesRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadBrandingThemesExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *BrandingThemesApiService) internalReadBrandingThemesExecute(r ApiReadBrandingThemesRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -738,6 +775,15 @@ func (a *BrandingThemesApiService) ReadOneBrandingTheme(ctx context.Context, env // Execute executes the request // @return BrandingTheme func (a *BrandingThemesApiService) ReadOneBrandingThemeExecute(r ApiReadOneBrandingThemeRequest) (*BrandingTheme, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneBrandingThemeExecute(r) + }, + ) + return obj.(*BrandingTheme), response, error +} + +func (a *BrandingThemesApiService) internalReadOneBrandingThemeExecute(r ApiReadOneBrandingThemeRequest) (*BrandingTheme, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -915,6 +961,15 @@ func (a *BrandingThemesApiService) UpdateBrandingTheme(ctx context.Context, envi // Execute executes the request // @return BrandingTheme func (a *BrandingThemesApiService) UpdateBrandingThemeExecute(r ApiUpdateBrandingThemeRequest) (*BrandingTheme, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateBrandingThemeExecute(r) + }, + ) + return obj.(*BrandingTheme), response, error +} + +func (a *BrandingThemesApiService) internalUpdateBrandingThemeExecute(r ApiUpdateBrandingThemeRequest) (*BrandingTheme, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} @@ -1094,6 +1149,15 @@ func (a *BrandingThemesApiService) UpdateBrandingThemeDefault(ctx context.Contex // Execute executes the request // @return BrandingThemeDefault func (a *BrandingThemesApiService) UpdateBrandingThemeDefaultExecute(r ApiUpdateBrandingThemeDefaultRequest) (*BrandingThemeDefault, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateBrandingThemeDefaultExecute(r) + }, + ) + return obj.(*BrandingThemeDefault), response, error +} + +func (a *BrandingThemesApiService) internalUpdateBrandingThemeDefaultExecute(r ApiUpdateBrandingThemeDefaultRequest) (*BrandingThemeDefault, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_certificate_management.go b/management/api_certificate_management.go index c1a4a3b7..d7dfee93 100644 --- a/management/api_certificate_management.go +++ b/management/api_certificate_management.go @@ -67,6 +67,15 @@ func (a *CertificateManagementApiService) CreateCertificateFromFile(ctx context. // // @return Certificate func (a *CertificateManagementApiService) CreateCertificateFromFileExecute(r ApiCreateCertificateFromFileRequest) (*Certificate, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateCertificateFromFileExecute(r) + }, + ) + return obj.(*Certificate), response, error +} + +func (a *CertificateManagementApiService) internalCreateCertificateFromFileExecute(r ApiCreateCertificateFromFileRequest) (*Certificate, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -289,6 +298,15 @@ func (a *CertificateManagementApiService) CreateKey(ctx context.Context, environ // // @return Certificate func (a *CertificateManagementApiService) CreateKeyExecute(r ApiCreateKeyRequest) (*Certificate, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateKeyExecute(r) + }, + ) + return obj.(*Certificate), response, error +} + +func (a *CertificateManagementApiService) internalCreateKeyExecute(r ApiCreateKeyRequest) (*Certificate, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -507,6 +525,16 @@ func (a *CertificateManagementApiService) DeleteCertificate(ctx context.Context, // Execute executes the request func (a *CertificateManagementApiService) DeleteCertificateExecute(r ApiDeleteCertificateRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteCertificateExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *CertificateManagementApiService) internalDeleteCertificateExecute(r ApiDeleteCertificateRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -667,6 +695,16 @@ func (a *CertificateManagementApiService) DeleteKey(ctx context.Context, environ // Execute executes the request func (a *CertificateManagementApiService) DeleteKeyExecute(r ApiDeleteKeyRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteKeyExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *CertificateManagementApiService) internalDeleteKeyExecute(r ApiDeleteKeyRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -835,6 +873,15 @@ func (a *CertificateManagementApiService) ExportCSR(ctx context.Context, environ // // @return string func (a *CertificateManagementApiService) ExportCSRExecute(r ApiExportCSRRequest) (string, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalExportCSRExecute(r) + }, + ) + return obj.(string), response, error +} + +func (a *CertificateManagementApiService) internalExportCSRExecute(r ApiExportCSRRequest) (string, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -1010,6 +1057,15 @@ func (a *CertificateManagementApiService) GetCertificate(ctx context.Context, en // // @return Certificate func (a *CertificateManagementApiService) GetCertificateExecute(r ApiGetCertificateRequest) (*Certificate, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalGetCertificateExecute(r) + }, + ) + return obj.(*Certificate), response, error +} + +func (a *CertificateManagementApiService) internalGetCertificateExecute(r ApiGetCertificateRequest) (*Certificate, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -1182,6 +1238,15 @@ func (a *CertificateManagementApiService) GetCertificateApplications(ctx context // // @return EntityArray func (a *CertificateManagementApiService) GetCertificateApplicationsExecute(r ApiGetCertificateApplicationsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalGetCertificateApplicationsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *CertificateManagementApiService) internalGetCertificateApplicationsExecute(r ApiGetCertificateApplicationsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -1351,6 +1416,15 @@ func (a *CertificateManagementApiService) GetCertificates(ctx context.Context, e // // @return EntityArray func (a *CertificateManagementApiService) GetCertificatesExecute(r ApiGetCertificatesRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalGetCertificatesExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *CertificateManagementApiService) internalGetCertificatesExecute(r ApiGetCertificatesRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -1711,6 +1785,15 @@ func (a *CertificateManagementApiService) GetKeyApplications(ctx context.Context // // @return EntityArray func (a *CertificateManagementApiService) GetKeyApplicationsExecute(r ApiGetKeyApplicationsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalGetKeyApplicationsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *CertificateManagementApiService) internalGetKeyApplicationsExecute(r ApiGetKeyApplicationsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -1880,6 +1963,15 @@ func (a *CertificateManagementApiService) GetKeys(ctx context.Context, environme // // @return EntityArray func (a *CertificateManagementApiService) GetKeysExecute(r ApiGetKeysRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalGetKeysExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *CertificateManagementApiService) internalGetKeysExecute(r ApiGetKeysRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -2057,6 +2149,15 @@ func (a *CertificateManagementApiService) ImportCSRResponse(ctx context.Context, // // @return Certificate func (a *CertificateManagementApiService) ImportCSRResponseExecute(r ApiImportCSRResponseRequest) (*Certificate, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalImportCSRResponseExecute(r) + }, + ) + return obj.(*Certificate), response, error +} + +func (a *CertificateManagementApiService) internalImportCSRResponseExecute(r ApiImportCSRResponseRequest) (*Certificate, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -2246,6 +2347,15 @@ func (a *CertificateManagementApiService) UpdateKey(ctx context.Context, environ // // @return Certificate func (a *CertificateManagementApiService) UpdateKeyExecute(r ApiUpdateKeyRequest) (*Certificate, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateKeyExecute(r) + }, + ) + return obj.(*Certificate), response, error +} + +func (a *CertificateManagementApiService) internalUpdateKeyExecute(r ApiUpdateKeyRequest) (*Certificate, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_custom_domains.go b/management/api_custom_domains.go index a43a167e..9eec1891 100644 --- a/management/api_custom_domains.go +++ b/management/api_custom_domains.go @@ -57,6 +57,15 @@ func (a *CustomDomainsApiService) CreateDomain(ctx context.Context, environmentI // Execute executes the request // @return CustomDomain func (a *CustomDomainsApiService) CreateDomainExecute(r ApiCreateDomainRequest) (*CustomDomain, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateDomainExecute(r) + }, + ) + return obj.(*CustomDomain), response, error +} + +func (a *CustomDomainsApiService) internalCreateDomainExecute(r ApiCreateDomainRequest) (*CustomDomain, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -239,6 +248,16 @@ func (a *CustomDomainsApiService) DeleteDomain(ctx context.Context, environmentI // Execute executes the request func (a *CustomDomainsApiService) DeleteDomainExecute(r ApiDeleteDomainRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteDomainExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *CustomDomainsApiService) internalDeleteDomainExecute(r ApiDeleteDomainRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -397,6 +416,15 @@ func (a *CustomDomainsApiService) ReadAllDomains(ctx context.Context, environmen // Execute executes the request // @return EntityArray func (a *CustomDomainsApiService) ReadAllDomainsExecute(r ApiReadAllDomainsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllDomainsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *CustomDomainsApiService) internalReadAllDomainsExecute(r ApiReadAllDomainsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -567,6 +595,15 @@ func (a *CustomDomainsApiService) ReadOneDomain(ctx context.Context, environment // Execute executes the request // @return CustomDomain func (a *CustomDomainsApiService) ReadOneDomainExecute(r ApiReadOneDomainRequest) (*CustomDomain, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneDomainExecute(r) + }, + ) + return obj.(*CustomDomain), response, error +} + +func (a *CustomDomainsApiService) internalReadOneDomainExecute(r ApiReadOneDomainRequest) (*CustomDomain, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -750,6 +787,15 @@ func (a *CustomDomainsApiService) UpdateDomain(ctx context.Context, environmentI // Execute executes the request // @return CustomDomain func (a *CustomDomainsApiService) UpdateDomainExecute(r ApiUpdateDomainRequest) (*CustomDomain, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateDomainExecute(r) + }, + ) + return obj.(*CustomDomain), response, error +} + +func (a *CustomDomainsApiService) internalUpdateDomainExecute(r ApiUpdateDomainRequest) (*CustomDomain, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} diff --git a/management/api_enable_users.go b/management/api_enable_users.go index a4e1b10b..bad5b7d2 100644 --- a/management/api_enable_users.go +++ b/management/api_enable_users.go @@ -54,6 +54,15 @@ func (a *EnableUsersApiService) ReadUserEnabled(ctx context.Context, environment // Execute executes the request // @return UserEnabled func (a *EnableUsersApiService) ReadUserEnabledExecute(r ApiReadUserEnabledRequest) (*UserEnabled, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadUserEnabledExecute(r) + }, + ) + return obj.(*UserEnabled), response, error +} + +func (a *EnableUsersApiService) internalReadUserEnabledExecute(r ApiReadUserEnabledRequest) (*UserEnabled, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -231,6 +240,15 @@ func (a *EnableUsersApiService) UpdateUserEnabled(ctx context.Context, environme // Execute executes the request // @return UserEnabled func (a *EnableUsersApiService) UpdateUserEnabledExecute(r ApiUpdateUserEnabledRequest) (*UserEnabled, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateUserEnabledExecute(r) + }, + ) + return obj.(*UserEnabled), response, error +} + +func (a *EnableUsersApiService) internalUpdateUserEnabledExecute(r ApiUpdateUserEnabledRequest) (*UserEnabled, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_environments.go b/management/api_environments.go index 275853a7..5c717e20 100644 --- a/management/api_environments.go +++ b/management/api_environments.go @@ -54,6 +54,15 @@ func (a *EnvironmentsApiService) CreateEnvironmentActiveLicense(ctx context.Cont // Execute executes the request // @return Environment func (a *EnvironmentsApiService) CreateEnvironmentActiveLicenseExecute(r ApiCreateEnvironmentActiveLicenseRequest) (*Environment, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateEnvironmentActiveLicenseExecute(r) + }, + ) + return obj.(*Environment), response, error +} + +func (a *EnvironmentsApiService) internalCreateEnvironmentActiveLicenseExecute(r ApiCreateEnvironmentActiveLicenseRequest) (*Environment, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -232,6 +241,16 @@ func (a *EnvironmentsApiService) DeleteEnvironment(ctx context.Context, environm // Execute executes the request func (a *EnvironmentsApiService) DeleteEnvironmentExecute(r ApiDeleteEnvironmentRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteEnvironmentExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *EnvironmentsApiService) internalDeleteEnvironmentExecute(r ApiDeleteEnvironmentRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -400,6 +419,15 @@ func (a *EnvironmentsApiService) ReadAllEnvironments(ctx context.Context) ApiRea // Execute executes the request // @return EntityArray func (a *EnvironmentsApiService) ReadAllEnvironmentsExecute(r ApiReadAllEnvironmentsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllEnvironmentsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *EnvironmentsApiService) internalReadAllEnvironmentsExecute(r ApiReadAllEnvironmentsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -572,6 +600,15 @@ func (a *EnvironmentsApiService) ReadOneEnvironment(ctx context.Context, environ // Execute executes the request // @return Environment func (a *EnvironmentsApiService) ReadOneEnvironmentExecute(r ApiReadOneEnvironmentRequest) (*Environment, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneEnvironmentExecute(r) + }, + ) + return obj.(*Environment), response, error +} + +func (a *EnvironmentsApiService) internalReadOneEnvironmentExecute(r ApiReadOneEnvironmentRequest) (*Environment, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -745,6 +782,15 @@ func (a *EnvironmentsApiService) UpdateEnvironment(ctx context.Context, environm // Execute executes the request // @return Environment func (a *EnvironmentsApiService) UpdateEnvironmentExecute(r ApiUpdateEnvironmentRequest) (*Environment, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateEnvironmentExecute(r) + }, + ) + return obj.(*Environment), response, error +} + +func (a *EnvironmentsApiService) internalUpdateEnvironmentExecute(r ApiUpdateEnvironmentRequest) (*Environment, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} @@ -920,6 +966,15 @@ func (a *EnvironmentsApiService) UpdateEnvironmentType(ctx context.Context, envi // Execute executes the request // @return Environment func (a *EnvironmentsApiService) UpdateEnvironmentTypeExecute(r ApiUpdateEnvironmentTypeRequest) (*Environment, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateEnvironmentTypeExecute(r) + }, + ) + return obj.(*Environment), response, error +} + +func (a *EnvironmentsApiService) internalUpdateEnvironmentTypeExecute(r ApiUpdateEnvironmentTypeRequest) (*Environment, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_flow_policies.go b/management/api_flow_policies.go index 795d1c68..1a92ed62 100644 --- a/management/api_flow_policies.go +++ b/management/api_flow_policies.go @@ -57,6 +57,15 @@ func (a *FlowPoliciesApiService) ReadAllFlowPolicies(ctx context.Context, enviro // Execute executes the request // @return EntityArray func (a *FlowPoliciesApiService) ReadAllFlowPoliciesExecute(r ApiReadAllFlowPoliciesRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllFlowPoliciesExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *FlowPoliciesApiService) internalReadAllFlowPoliciesExecute(r ApiReadAllFlowPoliciesRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -230,6 +239,15 @@ func (a *FlowPoliciesApiService) ReadOneFlowPolicy(ctx context.Context, environm // Execute executes the request // @return FlowPolicy func (a *FlowPoliciesApiService) ReadOneFlowPolicyExecute(r ApiReadOneFlowPolicyRequest) (*FlowPolicy, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneFlowPolicyExecute(r) + }, + ) + return obj.(*FlowPolicy), response, error +} + +func (a *FlowPoliciesApiService) internalReadOneFlowPolicyExecute(r ApiReadOneFlowPolicyRequest) (*FlowPolicy, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} diff --git a/management/api_gateway_credentials.go b/management/api_gateway_credentials.go index 4d442a03..052536a2 100644 --- a/management/api_gateway_credentials.go +++ b/management/api_gateway_credentials.go @@ -54,6 +54,15 @@ func (a *GatewayCredentialsApiService) CreateGatewayCredential(ctx context.Conte // Execute executes the request // @return GatewayCredential func (a *GatewayCredentialsApiService) CreateGatewayCredentialExecute(r ApiCreateGatewayCredentialRequest) (*GatewayCredential, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateGatewayCredentialExecute(r) + }, + ) + return obj.(*GatewayCredential), response, error +} + +func (a *GatewayCredentialsApiService) internalCreateGatewayCredentialExecute(r ApiCreateGatewayCredentialRequest) (*GatewayCredential, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -238,6 +247,16 @@ func (a *GatewayCredentialsApiService) DeleteGatewayCredential(ctx context.Conte // Execute executes the request func (a *GatewayCredentialsApiService) DeleteGatewayCredentialExecute(r ApiDeleteGatewayCredentialRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteGatewayCredentialExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *GatewayCredentialsApiService) internalDeleteGatewayCredentialExecute(r ApiDeleteGatewayCredentialRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -400,6 +419,15 @@ func (a *GatewayCredentialsApiService) ReadAllGatewayCredentials(ctx context.Con // Execute executes the request // @return EntityArray func (a *GatewayCredentialsApiService) ReadAllGatewayCredentialsExecute(r ApiReadAllGatewayCredentialsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllGatewayCredentialsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *GatewayCredentialsApiService) internalReadAllGatewayCredentialsExecute(r ApiReadAllGatewayCredentialsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -574,6 +602,15 @@ func (a *GatewayCredentialsApiService) ReadOneGatewayCredential(ctx context.Cont // Execute executes the request // @return GatewayCredential func (a *GatewayCredentialsApiService) ReadOneGatewayCredentialExecute(r ApiReadOneGatewayCredentialRequest) (*GatewayCredential, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneGatewayCredentialExecute(r) + }, + ) + return obj.(*GatewayCredential), response, error +} + +func (a *GatewayCredentialsApiService) internalReadOneGatewayCredentialExecute(r ApiReadOneGatewayCredentialRequest) (*GatewayCredential, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} diff --git a/management/api_gateway_instances.go b/management/api_gateway_instances.go index 0075f597..9db216c6 100644 --- a/management/api_gateway_instances.go +++ b/management/api_gateway_instances.go @@ -54,6 +54,15 @@ func (a *GatewayInstancesApiService) ReadAllGatewayInstances(ctx context.Context // Execute executes the request // @return EntityArray func (a *GatewayInstancesApiService) ReadAllGatewayInstancesExecute(r ApiReadAllGatewayInstancesRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllGatewayInstancesExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *GatewayInstancesApiService) internalReadAllGatewayInstancesExecute(r ApiReadAllGatewayInstancesRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -228,6 +237,15 @@ func (a *GatewayInstancesApiService) ReadOneGatewayInstance(ctx context.Context, // Execute executes the request // @return GatewayInstance func (a *GatewayInstancesApiService) ReadOneGatewayInstanceExecute(r ApiReadOneGatewayInstanceRequest) (*GatewayInstance, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneGatewayInstanceExecute(r) + }, + ) + return obj.(*GatewayInstance), response, error +} + +func (a *GatewayInstancesApiService) internalReadOneGatewayInstanceExecute(r ApiReadOneGatewayInstanceRequest) (*GatewayInstance, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} diff --git a/management/api_gateway_role_assignments.go b/management/api_gateway_role_assignments.go index 97bbecab..6c1bccd1 100644 --- a/management/api_gateway_role_assignments.go +++ b/management/api_gateway_role_assignments.go @@ -60,6 +60,15 @@ func (a *GatewayRoleAssignmentsApiService) CreateGatewayRoleAssignment(ctx conte // Execute executes the request // @return RoleAssignment func (a *GatewayRoleAssignmentsApiService) CreateGatewayRoleAssignmentExecute(r ApiCreateGatewayRoleAssignmentRequest) (*RoleAssignment, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateGatewayRoleAssignmentExecute(r) + }, + ) + return obj.(*RoleAssignment), response, error +} + +func (a *GatewayRoleAssignmentsApiService) internalCreateGatewayRoleAssignmentExecute(r ApiCreateGatewayRoleAssignmentRequest) (*RoleAssignment, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -246,6 +255,16 @@ func (a *GatewayRoleAssignmentsApiService) DeleteGatewayRoleAssignment(ctx conte // Execute executes the request func (a *GatewayRoleAssignmentsApiService) DeleteGatewayRoleAssignmentExecute(r ApiDeleteGatewayRoleAssignmentRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteGatewayRoleAssignmentExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *GatewayRoleAssignmentsApiService) internalDeleteGatewayRoleAssignmentExecute(r ApiDeleteGatewayRoleAssignmentRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -408,6 +427,15 @@ func (a *GatewayRoleAssignmentsApiService) ReadGatewayRoleAssignments(ctx contex // Execute executes the request // @return EntityArray func (a *GatewayRoleAssignmentsApiService) ReadGatewayRoleAssignmentsExecute(r ApiReadGatewayRoleAssignmentsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadGatewayRoleAssignmentsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *GatewayRoleAssignmentsApiService) internalReadGatewayRoleAssignmentsExecute(r ApiReadGatewayRoleAssignmentsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -582,6 +610,15 @@ func (a *GatewayRoleAssignmentsApiService) ReadOneGatewayRoleAssignment(ctx cont // Execute executes the request // @return RoleAssignment func (a *GatewayRoleAssignmentsApiService) ReadOneGatewayRoleAssignmentExecute(r ApiReadOneGatewayRoleAssignmentRequest) (*RoleAssignment, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneGatewayRoleAssignmentExecute(r) + }, + ) + return obj.(*RoleAssignment), response, error +} + +func (a *GatewayRoleAssignmentsApiService) internalReadOneGatewayRoleAssignmentExecute(r ApiReadOneGatewayRoleAssignmentRequest) (*RoleAssignment, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -763,6 +800,15 @@ func (a *GatewayRoleAssignmentsApiService) UpdateGatewayRoleAssignment(ctx conte // Execute executes the request // @return RoleAssignment func (a *GatewayRoleAssignmentsApiService) UpdateGatewayRoleAssignmentExecute(r ApiUpdateGatewayRoleAssignmentRequest) (*RoleAssignment, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateGatewayRoleAssignmentExecute(r) + }, + ) + return obj.(*RoleAssignment), response, error +} + +func (a *GatewayRoleAssignmentsApiService) internalUpdateGatewayRoleAssignmentExecute(r ApiUpdateGatewayRoleAssignmentRequest) (*RoleAssignment, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_gateways.go b/management/api_gateways.go index 4bab1dde..93568c5a 100644 --- a/management/api_gateways.go +++ b/management/api_gateways.go @@ -239,6 +239,16 @@ func (a *GatewaysApiService) DeleteGateway(ctx context.Context, environmentID st // Execute executes the request func (a *GatewaysApiService) DeleteGatewayExecute(r ApiDeleteGatewayRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteGatewayExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *GatewaysApiService) internalDeleteGatewayExecute(r ApiDeleteGatewayRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -397,6 +407,15 @@ func (a *GatewaysApiService) ReadAllGateways(ctx context.Context, environmentID // Execute executes the request // @return EntityArray func (a *GatewaysApiService) ReadAllGatewaysExecute(r ApiReadAllGatewaysRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllGatewaysExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *GatewaysApiService) internalReadAllGatewaysExecute(r ApiReadAllGatewaysRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} diff --git a/management/api_group_membership.go b/management/api_group_membership.go index f810a946..496b357d 100644 --- a/management/api_group_membership.go +++ b/management/api_group_membership.go @@ -60,6 +60,15 @@ func (a *GroupMembershipApiService) AddUserToGroup(ctx context.Context, environm // Execute executes the request // @return Group func (a *GroupMembershipApiService) AddUserToGroupExecute(r ApiAddUserToGroupRequest) (*Group, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalAddUserToGroupExecute(r) + }, + ) + return obj.(*Group), response, error +} + +func (a *GroupMembershipApiService) internalAddUserToGroupExecute(r ApiAddUserToGroupRequest) (*Group, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -262,6 +271,15 @@ func (a *GroupMembershipApiService) ReadAllGroupMembershipsForUser(ctx context.C // Execute executes the request // @return EntityArray func (a *GroupMembershipApiService) ReadAllGroupMembershipsForUserExecute(r ApiReadAllGroupMembershipsForUserRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllGroupMembershipsForUserExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *GroupMembershipApiService) internalReadAllGroupMembershipsForUserExecute(r ApiReadAllGroupMembershipsForUserRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -451,6 +469,15 @@ func (a *GroupMembershipApiService) ReadOneGroupMembershipForUser(ctx context.Co // Execute executes the request // @return Group func (a *GroupMembershipApiService) ReadOneGroupMembershipForUserExecute(r ApiReadOneGroupMembershipForUserRequest) (*Group, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneGroupMembershipForUserExecute(r) + }, + ) + return obj.(*Group), response, error +} + +func (a *GroupMembershipApiService) internalReadOneGroupMembershipForUserExecute(r ApiReadOneGroupMembershipForUserRequest) (*Group, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -628,6 +655,16 @@ func (a *GroupMembershipApiService) RemoveUserFromGroup(ctx context.Context, env // Execute executes the request func (a *GroupMembershipApiService) RemoveUserFromGroupExecute(r ApiRemoveUserFromGroupRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalRemoveUserFromGroupExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *GroupMembershipApiService) internalRemoveUserFromGroupExecute(r ApiRemoveUserFromGroupRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} diff --git a/management/api_groups.go b/management/api_groups.go index 82f1d12b..3da7258f 100644 --- a/management/api_groups.go +++ b/management/api_groups.go @@ -57,6 +57,15 @@ func (a *GroupsApiService) CreateGroup(ctx context.Context, environmentID string // Execute executes the request // @return Group func (a *GroupsApiService) CreateGroupExecute(r ApiCreateGroupRequest) (*Group, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateGroupExecute(r) + }, + ) + return obj.(*Group), response, error +} + +func (a *GroupsApiService) internalCreateGroupExecute(r ApiCreateGroupRequest) (*Group, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -246,6 +255,15 @@ func (a *GroupsApiService) CreateGroupNesting(ctx context.Context, environmentID // Execute executes the request // @return GroupNesting func (a *GroupsApiService) CreateGroupNestingExecute(r ApiCreateGroupNestingRequest) (*GroupNesting, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateGroupNestingExecute(r) + }, + ) + return obj.(*GroupNesting), response, error +} + +func (a *GroupsApiService) internalCreateGroupNestingExecute(r ApiCreateGroupNestingRequest) (*GroupNesting, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -429,6 +447,16 @@ func (a *GroupsApiService) DeleteGroup(ctx context.Context, environmentID string // Execute executes the request func (a *GroupsApiService) DeleteGroupExecute(r ApiDeleteGroupRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteGroupExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *GroupsApiService) internalDeleteGroupExecute(r ApiDeleteGroupRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -592,6 +620,16 @@ func (a *GroupsApiService) DeleteGroupNesting(ctx context.Context, environmentID // Execute executes the request func (a *GroupsApiService) DeleteGroupNestingExecute(r ApiDeleteGroupNestingRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteGroupNestingExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *GroupsApiService) internalDeleteGroupNestingExecute(r ApiDeleteGroupNestingRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -763,6 +801,15 @@ func (a *GroupsApiService) ReadAllGroups(ctx context.Context, environmentID stri // Execute executes the request // @return EntityArray func (a *GroupsApiService) ReadAllGroupsExecute(r ApiReadAllGroupsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllGroupsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *GroupsApiService) internalReadAllGroupsExecute(r ApiReadAllGroupsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -939,6 +986,15 @@ func (a *GroupsApiService) ReadGroupNesting(ctx context.Context, environmentID s // Execute executes the request // @return EntityArray func (a *GroupsApiService) ReadGroupNestingExecute(r ApiReadGroupNestingRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadGroupNestingExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *GroupsApiService) internalReadGroupNestingExecute(r ApiReadGroupNestingRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -1116,6 +1172,15 @@ func (a *GroupsApiService) ReadOneGroup(ctx context.Context, environmentID strin // Execute executes the request // @return Group func (a *GroupsApiService) ReadOneGroupExecute(r ApiReadOneGroupRequest) (*Group, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneGroupExecute(r) + }, + ) + return obj.(*Group), response, error +} + +func (a *GroupsApiService) internalReadOneGroupExecute(r ApiReadOneGroupRequest) (*Group, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -1293,6 +1358,15 @@ func (a *GroupsApiService) ReadOneGroupNesting(ctx context.Context, environmentI // Execute executes the request // @return GroupNesting func (a *GroupsApiService) ReadOneGroupNestingExecute(r ApiReadOneGroupNestingRequest) (*GroupNesting, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneGroupNestingExecute(r) + }, + ) + return obj.(*GroupNesting), response, error +} + +func (a *GroupsApiService) internalReadOneGroupNestingExecute(r ApiReadOneGroupNestingRequest) (*GroupNesting, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -1471,6 +1545,15 @@ func (a *GroupsApiService) UpdateGroup(ctx context.Context, environmentID string // Execute executes the request // @return Group func (a *GroupsApiService) UpdateGroupExecute(r ApiUpdateGroupRequest) (*Group, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateGroupExecute(r) + }, + ) + return obj.(*Group), response, error +} + +func (a *GroupsApiService) internalUpdateGroupExecute(r ApiUpdateGroupRequest) (*Group, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_identity_provider_attributes.go b/management/api_identity_provider_attributes.go index 7acfda0e..f0e07c46 100644 --- a/management/api_identity_provider_attributes.go +++ b/management/api_identity_provider_attributes.go @@ -60,6 +60,15 @@ func (a *IdentityProviderAttributesApiService) CreateIdentityProviderAttribute(c // Execute executes the request // @return IdentityProviderAttribute func (a *IdentityProviderAttributesApiService) CreateIdentityProviderAttributeExecute(r ApiCreateIdentityProviderAttributeRequest) (*IdentityProviderAttribute, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateIdentityProviderAttributeExecute(r) + }, + ) + return obj.(*IdentityProviderAttribute), response, error +} + +func (a *IdentityProviderAttributesApiService) internalCreateIdentityProviderAttributeExecute(r ApiCreateIdentityProviderAttributeRequest) (*IdentityProviderAttribute, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -246,6 +255,16 @@ func (a *IdentityProviderAttributesApiService) DeleteIdentityProviderAttribute(c // Execute executes the request func (a *IdentityProviderAttributesApiService) DeleteIdentityProviderAttributeExecute(r ApiDeleteIdentityProviderAttributeRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteIdentityProviderAttributeExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *IdentityProviderAttributesApiService) internalDeleteIdentityProviderAttributeExecute(r ApiDeleteIdentityProviderAttributeRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -408,6 +427,15 @@ func (a *IdentityProviderAttributesApiService) ReadAllIdentityProviderAttributes // Execute executes the request // @return EntityArray func (a *IdentityProviderAttributesApiService) ReadAllIdentityProviderAttributesExecute(r ApiReadAllIdentityProviderAttributesRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllIdentityProviderAttributesExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *IdentityProviderAttributesApiService) internalReadAllIdentityProviderAttributesExecute(r ApiReadAllIdentityProviderAttributesRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -582,6 +610,15 @@ func (a *IdentityProviderAttributesApiService) ReadOneIdentityProviderAttribute( // Execute executes the request // @return IdentityProviderAttribute func (a *IdentityProviderAttributesApiService) ReadOneIdentityProviderAttributeExecute(r ApiReadOneIdentityProviderAttributeRequest) (*IdentityProviderAttribute, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneIdentityProviderAttributeExecute(r) + }, + ) + return obj.(*IdentityProviderAttribute), response, error +} + +func (a *IdentityProviderAttributesApiService) internalReadOneIdentityProviderAttributeExecute(r ApiReadOneIdentityProviderAttributeRequest) (*IdentityProviderAttribute, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -763,6 +800,15 @@ func (a *IdentityProviderAttributesApiService) UpdateIdentityProviderAttribute(c // Execute executes the request // @return IdentityProviderAttribute func (a *IdentityProviderAttributesApiService) UpdateIdentityProviderAttributeExecute(r ApiUpdateIdentityProviderAttributeRequest) (*IdentityProviderAttribute, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateIdentityProviderAttributeExecute(r) + }, + ) + return obj.(*IdentityProviderAttribute), response, error +} + +func (a *IdentityProviderAttributesApiService) internalUpdateIdentityProviderAttributeExecute(r ApiUpdateIdentityProviderAttributeRequest) (*IdentityProviderAttribute, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_identity_providers.go b/management/api_identity_providers.go index ed4d3245..d22d79ea 100644 --- a/management/api_identity_providers.go +++ b/management/api_identity_providers.go @@ -57,6 +57,15 @@ func (a *IdentityProvidersApiService) CreateIdentityProvider(ctx context.Context // Execute executes the request // @return IdentityProvider func (a *IdentityProvidersApiService) CreateIdentityProviderExecute(r ApiCreateIdentityProviderRequest) (*IdentityProvider, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateIdentityProviderExecute(r) + }, + ) + return obj.(*IdentityProvider), response, error +} + +func (a *IdentityProvidersApiService) internalCreateIdentityProviderExecute(r ApiCreateIdentityProviderRequest) (*IdentityProvider, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -239,6 +248,16 @@ func (a *IdentityProvidersApiService) DeleteIdentityProvider(ctx context.Context // Execute executes the request func (a *IdentityProvidersApiService) DeleteIdentityProviderExecute(r ApiDeleteIdentityProviderRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteIdentityProviderExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *IdentityProvidersApiService) internalDeleteIdentityProviderExecute(r ApiDeleteIdentityProviderRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -397,6 +416,15 @@ func (a *IdentityProvidersApiService) ReadAllIdentityProviders(ctx context.Conte // Execute executes the request // @return EntityArray func (a *IdentityProvidersApiService) ReadAllIdentityProvidersExecute(r ApiReadAllIdentityProvidersRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllIdentityProvidersExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *IdentityProvidersApiService) internalReadAllIdentityProvidersExecute(r ApiReadAllIdentityProvidersRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -567,6 +595,15 @@ func (a *IdentityProvidersApiService) ReadOneIdentityProvider(ctx context.Contex // Execute executes the request // @return IdentityProvider func (a *IdentityProvidersApiService) ReadOneIdentityProviderExecute(r ApiReadOneIdentityProviderRequest) (*IdentityProvider, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneIdentityProviderExecute(r) + }, + ) + return obj.(*IdentityProvider), response, error +} + +func (a *IdentityProvidersApiService) internalReadOneIdentityProviderExecute(r ApiReadOneIdentityProviderRequest) (*IdentityProvider, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -744,6 +781,15 @@ func (a *IdentityProvidersApiService) UpdateIdentityProvider(ctx context.Context // Execute executes the request // @return IdentityProvider func (a *IdentityProvidersApiService) UpdateIdentityProviderExecute(r ApiUpdateIdentityProviderRequest) (*IdentityProvider, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateIdentityProviderExecute(r) + }, + ) + return obj.(*IdentityProvider), response, error +} + +func (a *IdentityProvidersApiService) internalUpdateIdentityProviderExecute(r ApiUpdateIdentityProviderRequest) (*IdentityProvider, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_images.go b/management/api_images.go index fece4f2d..abf01828 100644 --- a/management/api_images.go +++ b/management/api_images.go @@ -67,6 +67,15 @@ func (a *ImagesApiService) CreateImage(ctx context.Context, environmentID string // // @return Image func (a *ImagesApiService) CreateImageExecute(r ApiCreateImageRequest) (*Image, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateImageExecute(r) + }, + ) + return obj.(*Image), response, error +} + +func (a *ImagesApiService) internalCreateImageExecute(r ApiCreateImageRequest) (*Image, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -256,6 +265,16 @@ func (a *ImagesApiService) DeleteImage(ctx context.Context, environmentID string // Execute executes the request func (a *ImagesApiService) DeleteImageExecute(r ApiDeleteImageRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteImageExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *ImagesApiService) internalDeleteImageExecute(r ApiDeleteImageRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -418,6 +437,15 @@ func (a *ImagesApiService) ReadImage(ctx context.Context, environmentID string, // // @return Image func (a *ImagesApiService) ReadImageExecute(r ApiReadImageRequest) (*Image, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadImageExecute(r) + }, + ) + return obj.(*Image), response, error +} + +func (a *ImagesApiService) internalReadImageExecute(r ApiReadImageRequest) (*Image, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} diff --git a/management/api_key_rotation_policies.go b/management/api_key_rotation_policies.go index 6aca25ff..526b329b 100644 --- a/management/api_key_rotation_policies.go +++ b/management/api_key_rotation_policies.go @@ -57,6 +57,15 @@ func (a *KeyRotationPoliciesApiService) CreateKeyRotationPolicy(ctx context.Cont // Execute executes the request // @return KeyRotationPolicy func (a *KeyRotationPoliciesApiService) CreateKeyRotationPolicyExecute(r ApiCreateKeyRotationPolicyRequest) (*KeyRotationPolicy, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateKeyRotationPolicyExecute(r) + }, + ) + return obj.(*KeyRotationPolicy), response, error +} + +func (a *KeyRotationPoliciesApiService) internalCreateKeyRotationPolicyExecute(r ApiCreateKeyRotationPolicyRequest) (*KeyRotationPolicy, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -239,6 +248,16 @@ func (a *KeyRotationPoliciesApiService) DeleteKeyRotationPolicy(ctx context.Cont // Execute executes the request func (a *KeyRotationPoliciesApiService) DeleteKeyRotationPolicyExecute(r ApiDeleteKeyRotationPolicyRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteKeyRotationPolicyExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *KeyRotationPoliciesApiService) internalDeleteKeyRotationPolicyExecute(r ApiDeleteKeyRotationPolicyRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -397,6 +416,15 @@ func (a *KeyRotationPoliciesApiService) GetKeyRotationPolicies(ctx context.Conte // Execute executes the request // @return EntityArray func (a *KeyRotationPoliciesApiService) GetKeyRotationPoliciesExecute(r ApiGetKeyRotationPoliciesRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalGetKeyRotationPoliciesExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *KeyRotationPoliciesApiService) internalGetKeyRotationPoliciesExecute(r ApiGetKeyRotationPoliciesRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -567,6 +595,15 @@ func (a *KeyRotationPoliciesApiService) GetKeyRotationPolicy(ctx context.Context // Execute executes the request // @return KeyRotationPolicy func (a *KeyRotationPoliciesApiService) GetKeyRotationPolicyExecute(r ApiGetKeyRotationPolicyRequest) (*KeyRotationPolicy, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalGetKeyRotationPolicyExecute(r) + }, + ) + return obj.(*KeyRotationPolicy), response, error +} + +func (a *KeyRotationPoliciesApiService) internalGetKeyRotationPolicyExecute(r ApiGetKeyRotationPolicyRequest) (*KeyRotationPolicy, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -744,6 +781,15 @@ func (a *KeyRotationPoliciesApiService) UpdateKeyRotationPolicy(ctx context.Cont // Execute executes the request // @return KeyRotationPolicy func (a *KeyRotationPoliciesApiService) UpdateKeyRotationPolicyExecute(r ApiUpdateKeyRotationPolicyRequest) (*KeyRotationPolicy, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateKeyRotationPolicyExecute(r) + }, + ) + return obj.(*KeyRotationPolicy), response, error +} + +func (a *KeyRotationPoliciesApiService) internalUpdateKeyRotationPolicyExecute(r ApiUpdateKeyRotationPolicyRequest) (*KeyRotationPolicy, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_language_localization_status.go b/management/api_language_localization_status.go index edc40122..09fd7227 100644 --- a/management/api_language_localization_status.go +++ b/management/api_language_localization_status.go @@ -60,6 +60,15 @@ func (a *LanguageLocalizationStatusApiService) CreateLanguageLocalizationStatus( // Execute executes the request // @return LanguageLocalizationStatus func (a *LanguageLocalizationStatusApiService) CreateLanguageLocalizationStatusExecute(r ApiCreateLanguageLocalizationStatusRequest) (*LanguageLocalizationStatus, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateLanguageLocalizationStatusExecute(r) + }, + ) + return obj.(*LanguageLocalizationStatus), response, error +} + +func (a *LanguageLocalizationStatusApiService) internalCreateLanguageLocalizationStatusExecute(r ApiCreateLanguageLocalizationStatusRequest) (*LanguageLocalizationStatus, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -246,6 +255,16 @@ func (a *LanguageLocalizationStatusApiService) DeleteLanguageLocalizationStatus( // Execute executes the request func (a *LanguageLocalizationStatusApiService) DeleteLanguageLocalizationStatusExecute(r ApiDeleteLanguageLocalizationStatusRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteLanguageLocalizationStatusExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *LanguageLocalizationStatusApiService) internalDeleteLanguageLocalizationStatusExecute(r ApiDeleteLanguageLocalizationStatusRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -408,6 +427,15 @@ func (a *LanguageLocalizationStatusApiService) ReadLanguageLocalizationStatus(ct // Execute executes the request // @return LanguageLocalizationStatus func (a *LanguageLocalizationStatusApiService) ReadLanguageLocalizationStatusExecute(r ApiReadLanguageLocalizationStatusRequest) (*LanguageLocalizationStatus, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadLanguageLocalizationStatusExecute(r) + }, + ) + return obj.(*LanguageLocalizationStatus), response, error +} + +func (a *LanguageLocalizationStatusApiService) internalReadLanguageLocalizationStatusExecute(r ApiReadLanguageLocalizationStatusRequest) (*LanguageLocalizationStatus, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -582,6 +610,15 @@ func (a *LanguageLocalizationStatusApiService) ReadOneLanguageLocalizationStatus // Execute executes the request // @return LanguageLocalizationStatus func (a *LanguageLocalizationStatusApiService) ReadOneLanguageLocalizationStatusExecute(r ApiReadOneLanguageLocalizationStatusRequest) (*LanguageLocalizationStatus, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneLanguageLocalizationStatusExecute(r) + }, + ) + return obj.(*LanguageLocalizationStatus), response, error +} + +func (a *LanguageLocalizationStatusApiService) internalReadOneLanguageLocalizationStatusExecute(r ApiReadOneLanguageLocalizationStatusRequest) (*LanguageLocalizationStatus, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -763,6 +800,15 @@ func (a *LanguageLocalizationStatusApiService) UpdateLanguageLocalizationStatus( // Execute executes the request // @return LanguageLocalizationStatus func (a *LanguageLocalizationStatusApiService) UpdateLanguageLocalizationStatusExecute(r ApiUpdateLanguageLocalizationStatusRequest) (*LanguageLocalizationStatus, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateLanguageLocalizationStatusExecute(r) + }, + ) + return obj.(*LanguageLocalizationStatus), response, error +} + +func (a *LanguageLocalizationStatusApiService) internalUpdateLanguageLocalizationStatusExecute(r ApiUpdateLanguageLocalizationStatusRequest) (*LanguageLocalizationStatus, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_languages.go b/management/api_languages.go index 1b9573f3..16f49a1a 100644 --- a/management/api_languages.go +++ b/management/api_languages.go @@ -57,6 +57,15 @@ func (a *LanguagesApiService) CreateLanguage(ctx context.Context, environmentID // Execute executes the request // @return Language func (a *LanguagesApiService) CreateLanguageExecute(r ApiCreateLanguageRequest) (*Language, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateLanguageExecute(r) + }, + ) + return obj.(*Language), response, error +} + +func (a *LanguagesApiService) internalCreateLanguageExecute(r ApiCreateLanguageRequest) (*Language, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -239,6 +248,16 @@ func (a *LanguagesApiService) DeleteLanguage(ctx context.Context, environmentID // Execute executes the request func (a *LanguagesApiService) DeleteLanguageExecute(r ApiDeleteLanguageRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteLanguageExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *LanguagesApiService) internalDeleteLanguageExecute(r ApiDeleteLanguageRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -397,6 +416,15 @@ func (a *LanguagesApiService) ReadLanguages(ctx context.Context, environmentID s // Execute executes the request // @return EntityArray func (a *LanguagesApiService) ReadLanguagesExecute(r ApiReadLanguagesRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadLanguagesExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *LanguagesApiService) internalReadLanguagesExecute(r ApiReadLanguagesRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -567,6 +595,15 @@ func (a *LanguagesApiService) ReadOneLanguage(ctx context.Context, environmentID // Execute executes the request // @return Language func (a *LanguagesApiService) ReadOneLanguageExecute(r ApiReadOneLanguageRequest) (*Language, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneLanguageExecute(r) + }, + ) + return obj.(*Language), response, error +} + +func (a *LanguagesApiService) internalReadOneLanguageExecute(r ApiReadOneLanguageRequest) (*Language, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -744,6 +781,15 @@ func (a *LanguagesApiService) UpdateLanguage(ctx context.Context, environmentID // Execute executes the request // @return Language func (a *LanguagesApiService) UpdateLanguageExecute(r ApiUpdateLanguageRequest) (*Language, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateLanguageExecute(r) + }, + ) + return obj.(*Language), response, error +} + +func (a *LanguagesApiService) internalUpdateLanguageExecute(r ApiUpdateLanguageRequest) (*Language, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_licenses.go b/management/api_licenses.go index c7639822..785f6816 100644 --- a/management/api_licenses.go +++ b/management/api_licenses.go @@ -64,6 +64,15 @@ func (a *LicensesApiService) ReadAllLicenses(ctx context.Context, organizationID // Execute executes the request // @return EntityArray func (a *LicensesApiService) ReadAllLicensesExecute(r ApiReadAllLicensesRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllLicensesExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *LicensesApiService) internalReadAllLicensesExecute(r ApiReadAllLicensesRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -240,6 +249,15 @@ func (a *LicensesApiService) ReadOneLicense(ctx context.Context, organizationID // Execute executes the request // @return License func (a *LicensesApiService) ReadOneLicenseExecute(r ApiReadOneLicenseRequest) (*License, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneLicenseExecute(r) + }, + ) + return obj.(*License), response, error +} + +func (a *LicensesApiService) internalReadOneLicenseExecute(r ApiReadOneLicenseRequest) (*License, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -411,6 +429,15 @@ func (a *LicensesApiService) ReadOneLicenseName(ctx context.Context, organizatio // Execute executes the request // @return LicenseName func (a *LicensesApiService) ReadOneLicenseNameExecute(r ApiReadOneLicenseNameRequest) (*LicenseName, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneLicenseNameExecute(r) + }, + ) + return obj.(*LicenseName), response, error +} + +func (a *LicensesApiService) internalReadOneLicenseNameExecute(r ApiReadOneLicenseNameRequest) (*LicenseName, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -588,6 +615,15 @@ func (a *LicensesApiService) UpdateOneLicenseName(ctx context.Context, organizat // Execute executes the request // @return LicenseName func (a *LicensesApiService) UpdateOneLicenseNameExecute(r ApiUpdateOneLicenseNameRequest) (*LicenseName, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateOneLicenseNameExecute(r) + }, + ) + return obj.(*LicenseName), response, error +} + +func (a *LicensesApiService) internalUpdateOneLicenseNameExecute(r ApiUpdateOneLicenseNameRequest) (*LicenseName, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_notifications_policies.go b/management/api_notifications_policies.go index b00f9f5c..66f1dd59 100644 --- a/management/api_notifications_policies.go +++ b/management/api_notifications_policies.go @@ -57,6 +57,15 @@ func (a *NotificationsPoliciesApiService) CreateNotificationsPolicy(ctx context. // Execute executes the request // @return NotificationsPolicy func (a *NotificationsPoliciesApiService) CreateNotificationsPolicyExecute(r ApiCreateNotificationsPolicyRequest) (*NotificationsPolicy, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateNotificationsPolicyExecute(r) + }, + ) + return obj.(*NotificationsPolicy), response, error +} + +func (a *NotificationsPoliciesApiService) internalCreateNotificationsPolicyExecute(r ApiCreateNotificationsPolicyRequest) (*NotificationsPolicy, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -228,6 +237,16 @@ func (a *NotificationsPoliciesApiService) DeleteNotificationsPolicy(ctx context. // Execute executes the request func (a *NotificationsPoliciesApiService) DeleteNotificationsPolicyExecute(r ApiDeleteNotificationsPolicyRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteNotificationsPolicyExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *NotificationsPoliciesApiService) internalDeleteNotificationsPolicyExecute(r ApiDeleteNotificationsPolicyRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -386,6 +405,15 @@ func (a *NotificationsPoliciesApiService) ReadAllNotificationsPolicies(ctx conte // Execute executes the request // @return EntityArray func (a *NotificationsPoliciesApiService) ReadAllNotificationsPoliciesExecute(r ApiReadAllNotificationsPoliciesRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllNotificationsPoliciesExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *NotificationsPoliciesApiService) internalReadAllNotificationsPoliciesExecute(r ApiReadAllNotificationsPoliciesRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -556,6 +584,15 @@ func (a *NotificationsPoliciesApiService) ReadOneNotificationsPolicy(ctx context // Execute executes the request // @return NotificationsPolicy func (a *NotificationsPoliciesApiService) ReadOneNotificationsPolicyExecute(r ApiReadOneNotificationsPolicyRequest) (*NotificationsPolicy, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneNotificationsPolicyExecute(r) + }, + ) + return obj.(*NotificationsPolicy), response, error +} + +func (a *NotificationsPoliciesApiService) internalReadOneNotificationsPolicyExecute(r ApiReadOneNotificationsPolicyRequest) (*NotificationsPolicy, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -733,6 +770,15 @@ func (a *NotificationsPoliciesApiService) UpdateNotificationsPolicy(ctx context. // Execute executes the request // @return NotificationsPolicy func (a *NotificationsPoliciesApiService) UpdateNotificationsPolicyExecute(r ApiUpdateNotificationsPolicyRequest) (*NotificationsPolicy, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateNotificationsPolicyExecute(r) + }, + ) + return obj.(*NotificationsPolicy), response, error +} + +func (a *NotificationsPoliciesApiService) internalUpdateNotificationsPolicyExecute(r ApiUpdateNotificationsPolicyRequest) (*NotificationsPolicy, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_notifications_settings.go b/management/api_notifications_settings.go index d2c11e57..f61a9253 100644 --- a/management/api_notifications_settings.go +++ b/management/api_notifications_settings.go @@ -50,6 +50,16 @@ func (a *NotificationsSettingsApiService) DeleteNotificationsSettings(ctx contex // Execute executes the request func (a *NotificationsSettingsApiService) DeleteNotificationsSettingsExecute(r ApiDeleteNotificationsSettingsRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteNotificationsSettingsExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *NotificationsSettingsApiService) internalDeleteNotificationsSettingsExecute(r ApiDeleteNotificationsSettingsRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -207,6 +217,15 @@ func (a *NotificationsSettingsApiService) ReadNotificationsSettings(ctx context. // Execute executes the request // @return NotificationsSettings func (a *NotificationsSettingsApiService) ReadNotificationsSettingsExecute(r ApiReadNotificationsSettingsRequest) (*NotificationsSettings, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadNotificationsSettingsExecute(r) + }, + ) + return obj.(*NotificationsSettings), response, error +} + +func (a *NotificationsSettingsApiService) internalReadNotificationsSettingsExecute(r ApiReadNotificationsSettingsRequest) (*NotificationsSettings, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -374,6 +393,15 @@ func (a *NotificationsSettingsApiService) UpdateNotificationsSettings(ctx contex // Execute executes the request // @return NotificationsSettings func (a *NotificationsSettingsApiService) UpdateNotificationsSettingsExecute(r ApiUpdateNotificationsSettingsRequest) (*NotificationsSettings, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateNotificationsSettingsExecute(r) + }, + ) + return obj.(*NotificationsSettings), response, error +} + +func (a *NotificationsSettingsApiService) internalUpdateNotificationsSettingsExecute(r ApiUpdateNotificationsSettingsRequest) (*NotificationsSettings, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_notifications_settings_smtp.go b/management/api_notifications_settings_smtp.go index 2a1b6101..48e05c6e 100644 --- a/management/api_notifications_settings_smtp.go +++ b/management/api_notifications_settings_smtp.go @@ -50,6 +50,16 @@ func (a *NotificationsSettingsSMTPApiService) DeleteEmailDeliverySettings(ctx co // Execute executes the request func (a *NotificationsSettingsSMTPApiService) DeleteEmailDeliverySettingsExecute(r ApiDeleteEmailDeliverySettingsRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteEmailDeliverySettingsExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *NotificationsSettingsSMTPApiService) internalDeleteEmailDeliverySettingsExecute(r ApiDeleteEmailDeliverySettingsRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -207,6 +217,15 @@ func (a *NotificationsSettingsSMTPApiService) ReadEmailNotificationsSettings(ctx // Execute executes the request // @return NotificationsSettingsEmailDeliverySettings func (a *NotificationsSettingsSMTPApiService) ReadEmailNotificationsSettingsExecute(r ApiReadEmailNotificationsSettingsRequest) (*NotificationsSettingsEmailDeliverySettings, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadEmailNotificationsSettingsExecute(r) + }, + ) + return obj.(*NotificationsSettingsEmailDeliverySettings), response, error +} + +func (a *NotificationsSettingsSMTPApiService) internalReadEmailNotificationsSettingsExecute(r ApiReadEmailNotificationsSettingsRequest) (*NotificationsSettingsEmailDeliverySettings, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -380,6 +399,15 @@ func (a *NotificationsSettingsSMTPApiService) UpdateEmailNotificationsSettings(c // Execute executes the request // @return NotificationsSettingsEmailDeliverySettings func (a *NotificationsSettingsSMTPApiService) UpdateEmailNotificationsSettingsExecute(r ApiUpdateEmailNotificationsSettingsRequest) (*NotificationsSettingsEmailDeliverySettings, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateEmailNotificationsSettingsExecute(r) + }, + ) + return obj.(*NotificationsSettingsEmailDeliverySettings), response, error +} + +func (a *NotificationsSettingsSMTPApiService) internalUpdateEmailNotificationsSettingsExecute(r ApiUpdateEmailNotificationsSettingsRequest) (*NotificationsSettingsEmailDeliverySettings, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_notifications_templates.go b/management/api_notifications_templates.go index 72543a89..807321d5 100644 --- a/management/api_notifications_templates.go +++ b/management/api_notifications_templates.go @@ -60,6 +60,15 @@ func (a *NotificationsTemplatesApiService) CreateContent(ctx context.Context, en // Execute executes the request // @return TemplateContent func (a *NotificationsTemplatesApiService) CreateContentExecute(r ApiCreateContentRequest) (*TemplateContent, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateContentExecute(r) + }, + ) + return obj.(*TemplateContent), response, error +} + +func (a *NotificationsTemplatesApiService) internalCreateContentExecute(r ApiCreateContentRequest) (*TemplateContent, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -249,6 +258,16 @@ func (a *NotificationsTemplatesApiService) DeleteBulkVariantContents(ctx context // Execute executes the request func (a *NotificationsTemplatesApiService) DeleteBulkVariantContentsExecute(r ApiDeleteBulkVariantContentsRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteBulkVariantContentsExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *NotificationsTemplatesApiService) internalDeleteBulkVariantContentsExecute(r ApiDeleteBulkVariantContentsRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -415,6 +434,16 @@ func (a *NotificationsTemplatesApiService) DeleteContent(ctx context.Context, en // Execute executes the request func (a *NotificationsTemplatesApiService) DeleteContentExecute(r ApiDeleteContentRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteContentExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *NotificationsTemplatesApiService) internalDeleteContentExecute(r ApiDeleteContentRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -589,6 +618,15 @@ func (a *NotificationsTemplatesApiService) PatchBulkVariantContents(ctx context. // Execute executes the request // @return EntityArray func (a *NotificationsTemplatesApiService) PatchBulkVariantContentsExecute(r ApiPatchBulkVariantContentsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalPatchBulkVariantContentsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *NotificationsTemplatesApiService) internalPatchBulkVariantContentsExecute(r ApiPatchBulkVariantContentsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} @@ -765,6 +803,15 @@ func (a *NotificationsTemplatesApiService) ReadAllTemplateContents(ctx context.C // Execute executes the request // @return EntityArray func (a *NotificationsTemplatesApiService) ReadAllTemplateContentsExecute(r ApiReadAllTemplateContentsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllTemplateContentsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *NotificationsTemplatesApiService) internalReadAllTemplateContentsExecute(r ApiReadAllTemplateContentsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -945,6 +992,15 @@ func (a *NotificationsTemplatesApiService) ReadAllTemplates(ctx context.Context, // Execute executes the request // @return EntityArray func (a *NotificationsTemplatesApiService) ReadAllTemplatesExecute(r ApiReadAllTemplatesRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllTemplatesExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *NotificationsTemplatesApiService) internalReadAllTemplatesExecute(r ApiReadAllTemplatesRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -1124,6 +1180,15 @@ func (a *NotificationsTemplatesApiService) ReadOneContent(ctx context.Context, e // Execute executes the request // @return TemplateContent func (a *NotificationsTemplatesApiService) ReadOneContentExecute(r ApiReadOneContentRequest) (*TemplateContent, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneContentExecute(r) + }, + ) + return obj.(*TemplateContent), response, error +} + +func (a *NotificationsTemplatesApiService) internalReadOneContentExecute(r ApiReadOneContentRequest) (*TemplateContent, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -1296,6 +1361,15 @@ func (a *NotificationsTemplatesApiService) ReadOneTemplate(ctx context.Context, // Execute executes the request // @return Template func (a *NotificationsTemplatesApiService) ReadOneTemplateExecute(r ApiReadOneTemplateRequest) (*Template, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneTemplateExecute(r) + }, + ) + return obj.(*Template), response, error +} + +func (a *NotificationsTemplatesApiService) internalReadOneTemplateExecute(r ApiReadOneTemplateRequest) (*Template, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -1476,6 +1550,15 @@ func (a *NotificationsTemplatesApiService) UpdateContent(ctx context.Context, en // Execute executes the request // @return TemplateContent func (a *NotificationsTemplatesApiService) UpdateContentExecute(r ApiUpdateContentRequest) (*TemplateContent, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateContentExecute(r) + }, + ) + return obj.(*TemplateContent), response, error +} + +func (a *NotificationsTemplatesApiService) internalUpdateContentExecute(r ApiUpdateContentRequest) (*TemplateContent, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_organizations.go b/management/api_organizations.go index 5545c8ec..1839b446 100644 --- a/management/api_organizations.go +++ b/management/api_organizations.go @@ -54,6 +54,15 @@ func (a *OrganizationsApiService) ReadAllOrganizations(ctx context.Context) ApiR // Execute executes the request // @return EntityArray func (a *OrganizationsApiService) ReadAllOrganizationsExecute(r ApiReadAllOrganizationsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllOrganizationsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *OrganizationsApiService) internalReadAllOrganizationsExecute(r ApiReadAllOrganizationsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -223,6 +232,15 @@ func (a *OrganizationsApiService) ReadOneOrganization(ctx context.Context, organ // Execute executes the request // @return Organization func (a *OrganizationsApiService) ReadOneOrganizationExecute(r ApiReadOneOrganizationRequest) (*Organization, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneOrganizationExecute(r) + }, + ) + return obj.(*Organization), response, error +} + +func (a *OrganizationsApiService) internalReadOneOrganizationExecute(r ApiReadOneOrganizationRequest) (*Organization, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} diff --git a/management/api_password_policies.go b/management/api_password_policies.go index 78452af1..c61ad001 100644 --- a/management/api_password_policies.go +++ b/management/api_password_policies.go @@ -57,6 +57,15 @@ func (a *PasswordPoliciesApiService) CreatePasswordPolicy(ctx context.Context, e // // @return PasswordPolicy func (a *PasswordPoliciesApiService) CreatePasswordPolicyExecute(r ApiCreatePasswordPolicyRequest) (*PasswordPolicy, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreatePasswordPolicyExecute(r) + }, + ) + return obj.(*PasswordPolicy), response, error +} + +func (a *PasswordPoliciesApiService) internalCreatePasswordPolicyExecute(r ApiCreatePasswordPolicyRequest) (*PasswordPolicy, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -257,6 +266,16 @@ func (a *PasswordPoliciesApiService) DeletePasswordPolicy(ctx context.Context, e // Execute executes the request func (a *PasswordPoliciesApiService) DeletePasswordPolicyExecute(r ApiDeletePasswordPolicyRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeletePasswordPolicyExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *PasswordPoliciesApiService) internalDeletePasswordPolicyExecute(r ApiDeletePasswordPolicyRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -416,6 +435,15 @@ func (a *PasswordPoliciesApiService) ReadAllPasswordPolicies(ctx context.Context // // @return EntityArray func (a *PasswordPoliciesApiService) ReadAllPasswordPoliciesExecute(r ApiReadAllPasswordPoliciesRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllPasswordPoliciesExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *PasswordPoliciesApiService) internalReadAllPasswordPoliciesExecute(r ApiReadAllPasswordPoliciesRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -587,6 +615,15 @@ func (a *PasswordPoliciesApiService) ReadOnePasswordPolicy(ctx context.Context, // // @return PasswordPolicy func (a *PasswordPoliciesApiService) ReadOnePasswordPolicyExecute(r ApiReadOnePasswordPolicyRequest) (*PasswordPolicy, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOnePasswordPolicyExecute(r) + }, + ) + return obj.(*PasswordPolicy), response, error +} + +func (a *PasswordPoliciesApiService) internalReadOnePasswordPolicyExecute(r ApiReadOnePasswordPolicyRequest) (*PasswordPolicy, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -765,6 +802,15 @@ func (a *PasswordPoliciesApiService) UpdatePasswordPolicy(ctx context.Context, e // // @return PasswordPolicy func (a *PasswordPoliciesApiService) UpdatePasswordPolicyExecute(r ApiUpdatePasswordPolicyRequest) (*PasswordPolicy, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdatePasswordPolicyExecute(r) + }, + ) + return obj.(*PasswordPolicy), response, error +} + +func (a *PasswordPoliciesApiService) internalUpdatePasswordPolicyExecute(r ApiUpdatePasswordPolicyRequest) (*PasswordPolicy, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_phone_delivery_settings.go b/management/api_phone_delivery_settings.go index 8d05042d..1d4c7c1d 100644 --- a/management/api_phone_delivery_settings.go +++ b/management/api_phone_delivery_settings.go @@ -57,6 +57,15 @@ func (a *PhoneDeliverySettingsApiService) CreatePhoneDeliverySettings(ctx contex // Execute executes the request // @return NotificationsSettingsPhoneDeliverySettings func (a *PhoneDeliverySettingsApiService) CreatePhoneDeliverySettingsExecute(r ApiCreatePhoneDeliverySettingsRequest) (*NotificationsSettingsPhoneDeliverySettings, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreatePhoneDeliverySettingsExecute(r) + }, + ) + return obj.(*NotificationsSettingsPhoneDeliverySettings), response, error +} + +func (a *PhoneDeliverySettingsApiService) internalCreatePhoneDeliverySettingsExecute(r ApiCreatePhoneDeliverySettingsRequest) (*NotificationsSettingsPhoneDeliverySettings, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -239,6 +248,16 @@ func (a *PhoneDeliverySettingsApiService) DeletePhoneDeliverySettings(ctx contex // Execute executes the request func (a *PhoneDeliverySettingsApiService) DeletePhoneDeliverySettingsExecute(r ApiDeletePhoneDeliverySettingsRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeletePhoneDeliverySettingsExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *PhoneDeliverySettingsApiService) internalDeletePhoneDeliverySettingsExecute(r ApiDeletePhoneDeliverySettingsRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -397,6 +416,15 @@ func (a *PhoneDeliverySettingsApiService) ReadAllPhoneDeliverySettings(ctx conte // Execute executes the request // @return EntityArray func (a *PhoneDeliverySettingsApiService) ReadAllPhoneDeliverySettingsExecute(r ApiReadAllPhoneDeliverySettingsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllPhoneDeliverySettingsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *PhoneDeliverySettingsApiService) internalReadAllPhoneDeliverySettingsExecute(r ApiReadAllPhoneDeliverySettingsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -567,6 +595,15 @@ func (a *PhoneDeliverySettingsApiService) ReadOnePhoneDeliverySettings(ctx conte // Execute executes the request // @return NotificationsSettingsPhoneDeliverySettings func (a *PhoneDeliverySettingsApiService) ReadOnePhoneDeliverySettingsExecute(r ApiReadOnePhoneDeliverySettingsRequest) (*NotificationsSettingsPhoneDeliverySettings, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOnePhoneDeliverySettingsExecute(r) + }, + ) + return obj.(*NotificationsSettingsPhoneDeliverySettings), response, error +} + +func (a *PhoneDeliverySettingsApiService) internalReadOnePhoneDeliverySettingsExecute(r ApiReadOnePhoneDeliverySettingsRequest) (*NotificationsSettingsPhoneDeliverySettings, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -744,6 +781,15 @@ func (a *PhoneDeliverySettingsApiService) UpdatePhoneDeliverySettings(ctx contex // Execute executes the request // @return NotificationsSettingsPhoneDeliverySettings func (a *PhoneDeliverySettingsApiService) UpdatePhoneDeliverySettingsExecute(r ApiUpdatePhoneDeliverySettingsRequest) (*NotificationsSettingsPhoneDeliverySettings, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdatePhoneDeliverySettingsExecute(r) + }, + ) + return obj.(*NotificationsSettingsPhoneDeliverySettings), response, error +} + +func (a *PhoneDeliverySettingsApiService) internalUpdatePhoneDeliverySettingsExecute(r ApiUpdatePhoneDeliverySettingsRequest) (*NotificationsSettingsPhoneDeliverySettings, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_populations.go b/management/api_populations.go index 8b914be7..f9a718a7 100644 --- a/management/api_populations.go +++ b/management/api_populations.go @@ -57,6 +57,15 @@ func (a *PopulationsApiService) CreatePopulation(ctx context.Context, environmen // Execute executes the request // @return Population func (a *PopulationsApiService) CreatePopulationExecute(r ApiCreatePopulationRequest) (*Population, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreatePopulationExecute(r) + }, + ) + return obj.(*Population), response, error +} + +func (a *PopulationsApiService) internalCreatePopulationExecute(r ApiCreatePopulationRequest) (*Population, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -242,6 +251,16 @@ func (a *PopulationsApiService) DeletePopulation(ctx context.Context, environmen // Execute executes the request func (a *PopulationsApiService) DeletePopulationExecute(r ApiDeletePopulationRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeletePopulationExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *PopulationsApiService) internalDeletePopulationExecute(r ApiDeletePopulationRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -414,6 +433,15 @@ func (a *PopulationsApiService) ReadAllPopulations(ctx context.Context, environm // Execute executes the request // @return EntityArray func (a *PopulationsApiService) ReadAllPopulationsExecute(r ApiReadAllPopulationsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllPopulationsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *PopulationsApiService) internalReadAllPopulationsExecute(r ApiReadAllPopulationsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -590,6 +618,15 @@ func (a *PopulationsApiService) ReadOnePopulation(ctx context.Context, environme // Execute executes the request // @return Population func (a *PopulationsApiService) ReadOnePopulationExecute(r ApiReadOnePopulationRequest) (*Population, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOnePopulationExecute(r) + }, + ) + return obj.(*Population), response, error +} + +func (a *PopulationsApiService) internalReadOnePopulationExecute(r ApiReadOnePopulationRequest) (*Population, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -767,6 +804,15 @@ func (a *PopulationsApiService) UpdatePopulation(ctx context.Context, environmen // Execute executes the request // @return Population func (a *PopulationsApiService) UpdatePopulationExecute(r ApiUpdatePopulationRequest) (*Population, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdatePopulationExecute(r) + }, + ) + return obj.(*Population), response, error +} + +func (a *PopulationsApiService) internalUpdatePopulationExecute(r ApiUpdatePopulationRequest) (*Population, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_resource_attributes.go b/management/api_resource_attributes.go index 7d9fa6be..154d99cf 100644 --- a/management/api_resource_attributes.go +++ b/management/api_resource_attributes.go @@ -60,6 +60,15 @@ func (a *ResourceAttributesApiService) CreateResourceAttribute(ctx context.Conte // Execute executes the request // @return ResourceAttribute func (a *ResourceAttributesApiService) CreateResourceAttributeExecute(r ApiCreateResourceAttributeRequest) (*ResourceAttribute, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateResourceAttributeExecute(r) + }, + ) + return obj.(*ResourceAttribute), response, error +} + +func (a *ResourceAttributesApiService) internalCreateResourceAttributeExecute(r ApiCreateResourceAttributeRequest) (*ResourceAttribute, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -246,6 +255,16 @@ func (a *ResourceAttributesApiService) DeleteResourceAttribute(ctx context.Conte // Execute executes the request func (a *ResourceAttributesApiService) DeleteResourceAttributeExecute(r ApiDeleteResourceAttributeRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteResourceAttributeExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *ResourceAttributesApiService) internalDeleteResourceAttributeExecute(r ApiDeleteResourceAttributeRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -408,6 +427,15 @@ func (a *ResourceAttributesApiService) ReadAllResourceAttributes(ctx context.Con // Execute executes the request // @return EntityArray func (a *ResourceAttributesApiService) ReadAllResourceAttributesExecute(r ApiReadAllResourceAttributesRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllResourceAttributesExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *ResourceAttributesApiService) internalReadAllResourceAttributesExecute(r ApiReadAllResourceAttributesRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -582,6 +610,15 @@ func (a *ResourceAttributesApiService) ReadOneResourceAttribute(ctx context.Cont // Execute executes the request // @return ResourceAttribute func (a *ResourceAttributesApiService) ReadOneResourceAttributeExecute(r ApiReadOneResourceAttributeRequest) (*ResourceAttribute, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneResourceAttributeExecute(r) + }, + ) + return obj.(*ResourceAttribute), response, error +} + +func (a *ResourceAttributesApiService) internalReadOneResourceAttributeExecute(r ApiReadOneResourceAttributeRequest) (*ResourceAttribute, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -763,6 +800,15 @@ func (a *ResourceAttributesApiService) UpdateResourceAttribute(ctx context.Conte // Execute executes the request // @return ResourceAttribute func (a *ResourceAttributesApiService) UpdateResourceAttributeExecute(r ApiUpdateResourceAttributeRequest) (*ResourceAttribute, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateResourceAttributeExecute(r) + }, + ) + return obj.(*ResourceAttribute), response, error +} + +func (a *ResourceAttributesApiService) internalUpdateResourceAttributeExecute(r ApiUpdateResourceAttributeRequest) (*ResourceAttribute, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_resource_client_secret.go b/management/api_resource_client_secret.go index f31283d2..7a080b39 100644 --- a/management/api_resource_client_secret.go +++ b/management/api_resource_client_secret.go @@ -54,6 +54,15 @@ func (a *ResourceClientSecretApiService) CreateResourceSecret(ctx context.Contex // Execute executes the request // @return ResourceSecret func (a *ResourceClientSecretApiService) CreateResourceSecretExecute(r ApiCreateResourceSecretRequest) (*ResourceSecret, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateResourceSecretExecute(r) + }, + ) + return obj.(*ResourceSecret), response, error +} + +func (a *ResourceClientSecretApiService) internalCreateResourceSecretExecute(r ApiCreateResourceSecretRequest) (*ResourceSecret, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -236,6 +245,15 @@ func (a *ResourceClientSecretApiService) ReadResourceSecret(ctx context.Context, // Execute executes the request // @return ResourceSecret func (a *ResourceClientSecretApiService) ReadResourceSecretExecute(r ApiReadResourceSecretRequest) (*ResourceSecret, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadResourceSecretExecute(r) + }, + ) + return obj.(*ResourceSecret), response, error +} + +func (a *ResourceClientSecretApiService) internalReadResourceSecretExecute(r ApiReadResourceSecretRequest) (*ResourceSecret, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} diff --git a/management/api_resource_scopes.go b/management/api_resource_scopes.go index b8dc9752..ef4ec508 100644 --- a/management/api_resource_scopes.go +++ b/management/api_resource_scopes.go @@ -60,6 +60,15 @@ func (a *ResourceScopesApiService) CreateResourceScope(ctx context.Context, envi // Execute executes the request // @return ResourceScope func (a *ResourceScopesApiService) CreateResourceScopeExecute(r ApiCreateResourceScopeRequest) (*ResourceScope, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateResourceScopeExecute(r) + }, + ) + return obj.(*ResourceScope), response, error +} + +func (a *ResourceScopesApiService) internalCreateResourceScopeExecute(r ApiCreateResourceScopeRequest) (*ResourceScope, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -246,6 +255,16 @@ func (a *ResourceScopesApiService) DeleteResourceScope(ctx context.Context, envi // Execute executes the request func (a *ResourceScopesApiService) DeleteResourceScopeExecute(r ApiDeleteResourceScopeRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteResourceScopeExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *ResourceScopesApiService) internalDeleteResourceScopeExecute(r ApiDeleteResourceScopeRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -408,6 +427,15 @@ func (a *ResourceScopesApiService) ReadAllResourceScopes(ctx context.Context, en // Execute executes the request // @return EntityArray func (a *ResourceScopesApiService) ReadAllResourceScopesExecute(r ApiReadAllResourceScopesRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllResourceScopesExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *ResourceScopesApiService) internalReadAllResourceScopesExecute(r ApiReadAllResourceScopesRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -582,6 +610,15 @@ func (a *ResourceScopesApiService) ReadOneResourceScope(ctx context.Context, env // Execute executes the request // @return ResourceScope func (a *ResourceScopesApiService) ReadOneResourceScopeExecute(r ApiReadOneResourceScopeRequest) (*ResourceScope, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneResourceScopeExecute(r) + }, + ) + return obj.(*ResourceScope), response, error +} + +func (a *ResourceScopesApiService) internalReadOneResourceScopeExecute(r ApiReadOneResourceScopeRequest) (*ResourceScope, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -763,6 +800,15 @@ func (a *ResourceScopesApiService) UpdateResourceScope(ctx context.Context, envi // Execute executes the request // @return ResourceScope func (a *ResourceScopesApiService) UpdateResourceScopeExecute(r ApiUpdateResourceScopeRequest) (*ResourceScope, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateResourceScopeExecute(r) + }, + ) + return obj.(*ResourceScope), response, error +} + +func (a *ResourceScopesApiService) internalUpdateResourceScopeExecute(r ApiUpdateResourceScopeRequest) (*ResourceScope, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_resources.go b/management/api_resources.go index 9a69c7c6..817070fb 100644 --- a/management/api_resources.go +++ b/management/api_resources.go @@ -57,6 +57,15 @@ func (a *ResourcesApiService) CreateResource(ctx context.Context, environmentID // Execute executes the request // @return Resource func (a *ResourcesApiService) CreateResourceExecute(r ApiCreateResourceRequest) (*Resource, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateResourceExecute(r) + }, + ) + return obj.(*Resource), response, error +} + +func (a *ResourcesApiService) internalCreateResourceExecute(r ApiCreateResourceRequest) (*Resource, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -239,6 +248,16 @@ func (a *ResourcesApiService) DeleteResource(ctx context.Context, environmentID // Execute executes the request func (a *ResourcesApiService) DeleteResourceExecute(r ApiDeleteResourceRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteResourceExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *ResourcesApiService) internalDeleteResourceExecute(r ApiDeleteResourceRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -397,6 +416,15 @@ func (a *ResourcesApiService) ReadAllResources(ctx context.Context, environmentI // Execute executes the request // @return EntityArray func (a *ResourcesApiService) ReadAllResourcesExecute(r ApiReadAllResourcesRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllResourcesExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *ResourcesApiService) internalReadAllResourcesExecute(r ApiReadAllResourcesRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -567,6 +595,15 @@ func (a *ResourcesApiService) ReadOneResource(ctx context.Context, environmentID // Execute executes the request // @return Resource func (a *ResourcesApiService) ReadOneResourceExecute(r ApiReadOneResourceRequest) (*Resource, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneResourceExecute(r) + }, + ) + return obj.(*Resource), response, error +} + +func (a *ResourcesApiService) internalReadOneResourceExecute(r ApiReadOneResourceRequest) (*Resource, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -744,6 +781,15 @@ func (a *ResourcesApiService) UpdateResource(ctx context.Context, environmentID // Execute executes the request // @return Resource func (a *ResourcesApiService) UpdateResourceExecute(r ApiUpdateResourceRequest) (*Resource, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateResourceExecute(r) + }, + ) + return obj.(*Resource), response, error +} + +func (a *ResourcesApiService) internalUpdateResourceExecute(r ApiUpdateResourceRequest) (*Resource, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_roles.go b/management/api_roles.go index 94ad2dec..2b276182 100644 --- a/management/api_roles.go +++ b/management/api_roles.go @@ -48,6 +48,15 @@ func (a *RolesApiService) ReadAllRoles(ctx context.Context) ApiReadAllRolesReque // Execute executes the request // @return EntityArray func (a *RolesApiService) ReadAllRolesExecute(r ApiReadAllRolesRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllRolesExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *RolesApiService) internalReadAllRolesExecute(r ApiReadAllRolesRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -214,6 +223,15 @@ func (a *RolesApiService) ReadOneRole(ctx context.Context, roleID string) ApiRea // Execute executes the request // @return Role func (a *RolesApiService) ReadOneRoleExecute(r ApiReadOneRoleRequest) (*Role, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneRoleExecute(r) + }, + ) + return obj.(*Role), response, error +} + +func (a *RolesApiService) internalReadOneRoleExecute(r ApiReadOneRoleRequest) (*Role, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} diff --git a/management/api_schemas.go b/management/api_schemas.go index ca30f96a..68b345e5 100644 --- a/management/api_schemas.go +++ b/management/api_schemas.go @@ -60,6 +60,15 @@ func (a *SchemasApiService) CreateAttribute(ctx context.Context, environmentID s // Execute executes the request // @return SchemaAttribute func (a *SchemasApiService) CreateAttributeExecute(r ApiCreateAttributeRequest) (*SchemaAttribute, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateAttributeExecute(r) + }, + ) + return obj.(*SchemaAttribute), response, error +} + +func (a *SchemasApiService) internalCreateAttributeExecute(r ApiCreateAttributeRequest) (*SchemaAttribute, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -246,6 +255,16 @@ func (a *SchemasApiService) DeleteAttribute(ctx context.Context, environmentID s // Execute executes the request func (a *SchemasApiService) DeleteAttributeExecute(r ApiDeleteAttributeRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteAttributeExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *SchemasApiService) internalDeleteAttributeExecute(r ApiDeleteAttributeRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -408,6 +427,15 @@ func (a *SchemasApiService) ReadAllSchemaAttributes(ctx context.Context, environ // Execute executes the request // @return EntityArray func (a *SchemasApiService) ReadAllSchemaAttributesExecute(r ApiReadAllSchemaAttributesRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllSchemaAttributesExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *SchemasApiService) internalReadAllSchemaAttributesExecute(r ApiReadAllSchemaAttributesRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -576,6 +604,15 @@ func (a *SchemasApiService) ReadAllSchemas(ctx context.Context, environmentID st // Execute executes the request // @return EntityArray func (a *SchemasApiService) ReadAllSchemasExecute(r ApiReadAllSchemasRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllSchemasExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *SchemasApiService) internalReadAllSchemasExecute(r ApiReadAllSchemasRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -749,6 +786,15 @@ func (a *SchemasApiService) ReadOneAttribute(ctx context.Context, environmentID // Execute executes the request // @return SchemaAttribute func (a *SchemasApiService) ReadOneAttributeExecute(r ApiReadOneAttributeRequest) (*SchemaAttribute, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneAttributeExecute(r) + }, + ) + return obj.(*SchemaAttribute), response, error +} + +func (a *SchemasApiService) internalReadOneAttributeExecute(r ApiReadOneAttributeRequest) (*SchemaAttribute, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -921,6 +967,15 @@ func (a *SchemasApiService) ReadOneSchema(ctx context.Context, environmentID str // Execute executes the request // @return Schema func (a *SchemasApiService) ReadOneSchemaExecute(r ApiReadOneSchemaRequest) (*Schema, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneSchemaExecute(r) + }, + ) + return obj.(*Schema), response, error +} + +func (a *SchemasApiService) internalReadOneSchemaExecute(r ApiReadOneSchemaRequest) (*Schema, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -1101,6 +1156,15 @@ func (a *SchemasApiService) UpdateAttributePatch(ctx context.Context, environmen // Execute executes the request // @return SchemaAttribute func (a *SchemasApiService) UpdateAttributePatchExecute(r ApiUpdateAttributePatchRequest) (*SchemaAttribute, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateAttributePatchExecute(r) + }, + ) + return obj.(*SchemaAttribute), response, error +} + +func (a *SchemasApiService) internalUpdateAttributePatchExecute(r ApiUpdateAttributePatchRequest) (*SchemaAttribute, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} @@ -1284,6 +1348,15 @@ func (a *SchemasApiService) UpdateAttributePut(ctx context.Context, environmentI // Execute executes the request // @return SchemaAttribute func (a *SchemasApiService) UpdateAttributePutExecute(r ApiUpdateAttributePutRequest) (*SchemaAttribute, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateAttributePutExecute(r) + }, + ) + return obj.(*SchemaAttribute), response, error +} + +func (a *SchemasApiService) internalUpdateAttributePutExecute(r ApiUpdateAttributePutRequest) (*SchemaAttribute, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_sign_on_policies.go b/management/api_sign_on_policies.go index 59211ed9..9e45c46f 100644 --- a/management/api_sign_on_policies.go +++ b/management/api_sign_on_policies.go @@ -57,6 +57,15 @@ func (a *SignOnPoliciesApiService) CreateSignOnPolicy(ctx context.Context, envir // Execute executes the request // @return SignOnPolicy func (a *SignOnPoliciesApiService) CreateSignOnPolicyExecute(r ApiCreateSignOnPolicyRequest) (*SignOnPolicy, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateSignOnPolicyExecute(r) + }, + ) + return obj.(*SignOnPolicy), response, error +} + +func (a *SignOnPoliciesApiService) internalCreateSignOnPolicyExecute(r ApiCreateSignOnPolicyRequest) (*SignOnPolicy, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -239,6 +248,16 @@ func (a *SignOnPoliciesApiService) DeleteSignOnPolicy(ctx context.Context, envir // Execute executes the request func (a *SignOnPoliciesApiService) DeleteSignOnPolicyExecute(r ApiDeleteSignOnPolicyRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteSignOnPolicyExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *SignOnPoliciesApiService) internalDeleteSignOnPolicyExecute(r ApiDeleteSignOnPolicyRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -397,6 +416,15 @@ func (a *SignOnPoliciesApiService) ReadAllSignOnPolicies(ctx context.Context, en // Execute executes the request // @return EntityArray func (a *SignOnPoliciesApiService) ReadAllSignOnPoliciesExecute(r ApiReadAllSignOnPoliciesRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllSignOnPoliciesExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *SignOnPoliciesApiService) internalReadAllSignOnPoliciesExecute(r ApiReadAllSignOnPoliciesRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -567,6 +595,15 @@ func (a *SignOnPoliciesApiService) ReadOneSignOnPolicy(ctx context.Context, envi // Execute executes the request // @return SignOnPolicy func (a *SignOnPoliciesApiService) ReadOneSignOnPolicyExecute(r ApiReadOneSignOnPolicyRequest) (*SignOnPolicy, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneSignOnPolicyExecute(r) + }, + ) + return obj.(*SignOnPolicy), response, error +} + +func (a *SignOnPoliciesApiService) internalReadOneSignOnPolicyExecute(r ApiReadOneSignOnPolicyRequest) (*SignOnPolicy, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -744,6 +781,15 @@ func (a *SignOnPoliciesApiService) UpdateSignOnPolicy(ctx context.Context, envir // Execute executes the request // @return SignOnPolicy func (a *SignOnPoliciesApiService) UpdateSignOnPolicyExecute(r ApiUpdateSignOnPolicyRequest) (*SignOnPolicy, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateSignOnPolicyExecute(r) + }, + ) + return obj.(*SignOnPolicy), response, error +} + +func (a *SignOnPoliciesApiService) internalUpdateSignOnPolicyExecute(r ApiUpdateSignOnPolicyRequest) (*SignOnPolicy, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_sign_on_policy_actions.go b/management/api_sign_on_policy_actions.go index 7a47fd1c..a0a66655 100644 --- a/management/api_sign_on_policy_actions.go +++ b/management/api_sign_on_policy_actions.go @@ -60,6 +60,15 @@ func (a *SignOnPolicyActionsApiService) CreateSignOnPolicyAction(ctx context.Con // Execute executes the request // @return SignOnPolicyAction func (a *SignOnPolicyActionsApiService) CreateSignOnPolicyActionExecute(r ApiCreateSignOnPolicyActionRequest) (*SignOnPolicyAction, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateSignOnPolicyActionExecute(r) + }, + ) + return obj.(*SignOnPolicyAction), response, error +} + +func (a *SignOnPolicyActionsApiService) internalCreateSignOnPolicyActionExecute(r ApiCreateSignOnPolicyActionRequest) (*SignOnPolicyAction, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -246,6 +255,16 @@ func (a *SignOnPolicyActionsApiService) DeleteSignOnPolicyAction(ctx context.Con // Execute executes the request func (a *SignOnPolicyActionsApiService) DeleteSignOnPolicyActionExecute(r ApiDeleteSignOnPolicyActionRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteSignOnPolicyActionExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *SignOnPolicyActionsApiService) internalDeleteSignOnPolicyActionExecute(r ApiDeleteSignOnPolicyActionRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -408,6 +427,15 @@ func (a *SignOnPolicyActionsApiService) ReadAllSignOnPolicyActions(ctx context.C // Execute executes the request // @return EntityArray func (a *SignOnPolicyActionsApiService) ReadAllSignOnPolicyActionsExecute(r ApiReadAllSignOnPolicyActionsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllSignOnPolicyActionsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *SignOnPolicyActionsApiService) internalReadAllSignOnPolicyActionsExecute(r ApiReadAllSignOnPolicyActionsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -582,6 +610,15 @@ func (a *SignOnPolicyActionsApiService) ReadOneSignOnPolicyAction(ctx context.Co // Execute executes the request // @return SignOnPolicyAction func (a *SignOnPolicyActionsApiService) ReadOneSignOnPolicyActionExecute(r ApiReadOneSignOnPolicyActionRequest) (*SignOnPolicyAction, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneSignOnPolicyActionExecute(r) + }, + ) + return obj.(*SignOnPolicyAction), response, error +} + +func (a *SignOnPolicyActionsApiService) internalReadOneSignOnPolicyActionExecute(r ApiReadOneSignOnPolicyActionRequest) (*SignOnPolicyAction, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -763,6 +800,15 @@ func (a *SignOnPolicyActionsApiService) UpdateSignOnPolicyAction(ctx context.Con // Execute executes the request // @return SignOnPolicyAction func (a *SignOnPolicyActionsApiService) UpdateSignOnPolicyActionExecute(r ApiUpdateSignOnPolicyActionRequest) (*SignOnPolicyAction, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateSignOnPolicyActionExecute(r) + }, + ) + return obj.(*SignOnPolicyAction), response, error +} + +func (a *SignOnPolicyActionsApiService) internalUpdateSignOnPolicyActionExecute(r ApiUpdateSignOnPolicyActionRequest) (*SignOnPolicyAction, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_subscriptions_webhooks.go b/management/api_subscriptions_webhooks.go index eb23af5a..e10e0eb9 100644 --- a/management/api_subscriptions_webhooks.go +++ b/management/api_subscriptions_webhooks.go @@ -57,6 +57,15 @@ func (a *SubscriptionsWebhooksApiService) CreateSubscription(ctx context.Context // Execute executes the request // @return Subscription func (a *SubscriptionsWebhooksApiService) CreateSubscriptionExecute(r ApiCreateSubscriptionRequest) (*Subscription, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateSubscriptionExecute(r) + }, + ) + return obj.(*Subscription), response, error +} + +func (a *SubscriptionsWebhooksApiService) internalCreateSubscriptionExecute(r ApiCreateSubscriptionRequest) (*Subscription, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -239,6 +248,16 @@ func (a *SubscriptionsWebhooksApiService) DeleteSubscription(ctx context.Context // Execute executes the request func (a *SubscriptionsWebhooksApiService) DeleteSubscriptionExecute(r ApiDeleteSubscriptionRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteSubscriptionExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *SubscriptionsWebhooksApiService) internalDeleteSubscriptionExecute(r ApiDeleteSubscriptionRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -397,6 +416,15 @@ func (a *SubscriptionsWebhooksApiService) ReadAllSubscriptions(ctx context.Conte // Execute executes the request // @return EntityArray func (a *SubscriptionsWebhooksApiService) ReadAllSubscriptionsExecute(r ApiReadAllSubscriptionsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllSubscriptionsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *SubscriptionsWebhooksApiService) internalReadAllSubscriptionsExecute(r ApiReadAllSubscriptionsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -567,6 +595,15 @@ func (a *SubscriptionsWebhooksApiService) ReadOneSubscription(ctx context.Contex // Execute executes the request // @return Subscription func (a *SubscriptionsWebhooksApiService) ReadOneSubscriptionExecute(r ApiReadOneSubscriptionRequest) (*Subscription, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneSubscriptionExecute(r) + }, + ) + return obj.(*Subscription), response, error +} + +func (a *SubscriptionsWebhooksApiService) internalReadOneSubscriptionExecute(r ApiReadOneSubscriptionRequest) (*Subscription, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -744,6 +781,15 @@ func (a *SubscriptionsWebhooksApiService) UpdateSubscription(ctx context.Context // Execute executes the request // @return Subscription func (a *SubscriptionsWebhooksApiService) UpdateSubscriptionExecute(r ApiUpdateSubscriptionRequest) (*Subscription, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateSubscriptionExecute(r) + }, + ) + return obj.(*Subscription), response, error +} + +func (a *SubscriptionsWebhooksApiService) internalUpdateSubscriptionExecute(r ApiUpdateSubscriptionRequest) (*Subscription, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_trusted_email_addresses.go b/management/api_trusted_email_addresses.go index 1bd40657..0b1e7110 100644 --- a/management/api_trusted_email_addresses.go +++ b/management/api_trusted_email_addresses.go @@ -60,6 +60,15 @@ func (a *TrustedEmailAddressesApiService) CreateTrustedEmailAddress(ctx context. // Execute executes the request // @return EmailDomainTrustedEmail func (a *TrustedEmailAddressesApiService) CreateTrustedEmailAddressExecute(r ApiCreateTrustedEmailAddressRequest) (*EmailDomainTrustedEmail, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateTrustedEmailAddressExecute(r) + }, + ) + return obj.(*EmailDomainTrustedEmail), response, error +} + +func (a *TrustedEmailAddressesApiService) internalCreateTrustedEmailAddressExecute(r ApiCreateTrustedEmailAddressRequest) (*EmailDomainTrustedEmail, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -246,6 +255,16 @@ func (a *TrustedEmailAddressesApiService) DeleteTrustedEmailAddress(ctx context. // Execute executes the request func (a *TrustedEmailAddressesApiService) DeleteTrustedEmailAddressExecute(r ApiDeleteTrustedEmailAddressRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteTrustedEmailAddressExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *TrustedEmailAddressesApiService) internalDeleteTrustedEmailAddressExecute(r ApiDeleteTrustedEmailAddressRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -408,6 +427,15 @@ func (a *TrustedEmailAddressesApiService) ReadAllTrustedEmailAddresses(ctx conte // Execute executes the request // @return EntityArray func (a *TrustedEmailAddressesApiService) ReadAllTrustedEmailAddressesExecute(r ApiReadAllTrustedEmailAddressesRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllTrustedEmailAddressesExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *TrustedEmailAddressesApiService) internalReadAllTrustedEmailAddressesExecute(r ApiReadAllTrustedEmailAddressesRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -582,6 +610,15 @@ func (a *TrustedEmailAddressesApiService) ReadOneTrustedEmailAddress(ctx context // Execute executes the request // @return EmailDomainTrustedEmail func (a *TrustedEmailAddressesApiService) ReadOneTrustedEmailAddressExecute(r ApiReadOneTrustedEmailAddressRequest) (*EmailDomainTrustedEmail, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneTrustedEmailAddressExecute(r) + }, + ) + return obj.(*EmailDomainTrustedEmail), response, error +} + +func (a *TrustedEmailAddressesApiService) internalReadOneTrustedEmailAddressExecute(r ApiReadOneTrustedEmailAddressRequest) (*EmailDomainTrustedEmail, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -763,6 +800,15 @@ func (a *TrustedEmailAddressesApiService) ResendVerificationCodeToEmail(ctx cont // Execute executes the request // @return EmailDomainTrustedEmail func (a *TrustedEmailAddressesApiService) ResendVerificationCodeToEmailExecute(r ApiResendVerificationCodeToEmailRequest) (*EmailDomainTrustedEmail, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalResendVerificationCodeToEmailExecute(r) + }, + ) + return obj.(*EmailDomainTrustedEmail), response, error +} + +func (a *TrustedEmailAddressesApiService) internalResendVerificationCodeToEmailExecute(r ApiResendVerificationCodeToEmailRequest) (*EmailDomainTrustedEmail, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} diff --git a/management/api_trusted_email_domains.go b/management/api_trusted_email_domains.go index 8f74f2cc..a919c312 100644 --- a/management/api_trusted_email_domains.go +++ b/management/api_trusted_email_domains.go @@ -57,6 +57,15 @@ func (a *TrustedEmailDomainsApiService) CreateTrustedEmailDomain(ctx context.Con // Execute executes the request // @return EmailDomain func (a *TrustedEmailDomainsApiService) CreateTrustedEmailDomainExecute(r ApiCreateTrustedEmailDomainRequest) (*EmailDomain, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateTrustedEmailDomainExecute(r) + }, + ) + return obj.(*EmailDomain), response, error +} + +func (a *TrustedEmailDomainsApiService) internalCreateTrustedEmailDomainExecute(r ApiCreateTrustedEmailDomainRequest) (*EmailDomain, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -239,6 +248,16 @@ func (a *TrustedEmailDomainsApiService) DeleteTrustedEmailDomain(ctx context.Con // Execute executes the request func (a *TrustedEmailDomainsApiService) DeleteTrustedEmailDomainExecute(r ApiDeleteTrustedEmailDomainRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteTrustedEmailDomainExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *TrustedEmailDomainsApiService) internalDeleteTrustedEmailDomainExecute(r ApiDeleteTrustedEmailDomainRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -397,6 +416,15 @@ func (a *TrustedEmailDomainsApiService) ReadAllTrustedEmailDomains(ctx context.C // Execute executes the request // @return EntityArray func (a *TrustedEmailDomainsApiService) ReadAllTrustedEmailDomainsExecute(r ApiReadAllTrustedEmailDomainsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllTrustedEmailDomainsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *TrustedEmailDomainsApiService) internalReadAllTrustedEmailDomainsExecute(r ApiReadAllTrustedEmailDomainsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -567,6 +595,15 @@ func (a *TrustedEmailDomainsApiService) ReadOneTrustedEmailDomain(ctx context.Co // Execute executes the request // @return EmailDomain func (a *TrustedEmailDomainsApiService) ReadOneTrustedEmailDomainExecute(r ApiReadOneTrustedEmailDomainRequest) (*EmailDomain, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneTrustedEmailDomainExecute(r) + }, + ) + return obj.(*EmailDomain), response, error +} + +func (a *TrustedEmailDomainsApiService) internalReadOneTrustedEmailDomainExecute(r ApiReadOneTrustedEmailDomainRequest) (*EmailDomain, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -738,6 +775,15 @@ func (a *TrustedEmailDomainsApiService) ReadTrustedEmailDomainDKIMStatus(ctx con // Execute executes the request // @return EmailDomainDKIMStatus func (a *TrustedEmailDomainsApiService) ReadTrustedEmailDomainDKIMStatusExecute(r ApiReadTrustedEmailDomainDKIMStatusRequest) (*EmailDomainDKIMStatus, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadTrustedEmailDomainDKIMStatusExecute(r) + }, + ) + return obj.(*EmailDomainDKIMStatus), response, error +} + +func (a *TrustedEmailDomainsApiService) internalReadTrustedEmailDomainDKIMStatusExecute(r ApiReadTrustedEmailDomainDKIMStatusRequest) (*EmailDomainDKIMStatus, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -909,6 +955,15 @@ func (a *TrustedEmailDomainsApiService) ReadTrustedEmailDomainOwnershipStatus(ct // Execute executes the request // @return EmailDomainOwnershipStatus func (a *TrustedEmailDomainsApiService) ReadTrustedEmailDomainOwnershipStatusExecute(r ApiReadTrustedEmailDomainOwnershipStatusRequest) (*EmailDomainOwnershipStatus, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadTrustedEmailDomainOwnershipStatusExecute(r) + }, + ) + return obj.(*EmailDomainOwnershipStatus), response, error +} + +func (a *TrustedEmailDomainsApiService) internalReadTrustedEmailDomainOwnershipStatusExecute(r ApiReadTrustedEmailDomainOwnershipStatusRequest) (*EmailDomainOwnershipStatus, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -1080,6 +1135,15 @@ func (a *TrustedEmailDomainsApiService) ReadTrustedEmailDomainSPFStatus(ctx cont // Execute executes the request // @return EmailDomainSPFStatus func (a *TrustedEmailDomainsApiService) ReadTrustedEmailDomainSPFStatusExecute(r ApiReadTrustedEmailDomainSPFStatusRequest) (*EmailDomainSPFStatus, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadTrustedEmailDomainSPFStatusExecute(r) + }, + ) + return obj.(*EmailDomainSPFStatus), response, error +} + +func (a *TrustedEmailDomainsApiService) internalReadTrustedEmailDomainSPFStatusExecute(r ApiReadTrustedEmailDomainSPFStatusRequest) (*EmailDomainSPFStatus, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} diff --git a/management/api_user_populations.go b/management/api_user_populations.go index e2cc19b2..6940d7f4 100644 --- a/management/api_user_populations.go +++ b/management/api_user_populations.go @@ -54,6 +54,15 @@ func (a *UserPopulationsApiService) ReadUserPopulation(ctx context.Context, envi // Execute executes the request // @return UserPopulation func (a *UserPopulationsApiService) ReadUserPopulationExecute(r ApiReadUserPopulationRequest) (*UserPopulation, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadUserPopulationExecute(r) + }, + ) + return obj.(*UserPopulation), response, error +} + +func (a *UserPopulationsApiService) internalReadUserPopulationExecute(r ApiReadUserPopulationRequest) (*UserPopulation, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -231,6 +240,15 @@ func (a *UserPopulationsApiService) UpdateUserPopulation(ctx context.Context, en // Execute executes the request // @return UserPopulation func (a *UserPopulationsApiService) UpdateUserPopulationExecute(r ApiUpdateUserPopulationRequest) (*UserPopulation, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateUserPopulationExecute(r) + }, + ) + return obj.(*UserPopulation), response, error +} + +func (a *UserPopulationsApiService) internalUpdateUserPopulationExecute(r ApiUpdateUserPopulationRequest) (*UserPopulation, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/api_user_role_assignments.go b/management/api_user_role_assignments.go index 5f0f863f..78f83529 100644 --- a/management/api_user_role_assignments.go +++ b/management/api_user_role_assignments.go @@ -60,6 +60,15 @@ func (a *UserRoleAssignmentsApiService) CreateUserRoleAssignment(ctx context.Con // Execute executes the request // @return RoleAssignment func (a *UserRoleAssignmentsApiService) CreateUserRoleAssignmentExecute(r ApiCreateUserRoleAssignmentRequest) (*RoleAssignment, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateUserRoleAssignmentExecute(r) + }, + ) + return obj.(*RoleAssignment), response, error +} + +func (a *UserRoleAssignmentsApiService) internalCreateUserRoleAssignmentExecute(r ApiCreateUserRoleAssignmentRequest) (*RoleAssignment, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -246,6 +255,16 @@ func (a *UserRoleAssignmentsApiService) DeleteUserRoleAssignment(ctx context.Con // Execute executes the request func (a *UserRoleAssignmentsApiService) DeleteUserRoleAssignmentExecute(r ApiDeleteUserRoleAssignmentRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteUserRoleAssignmentExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *UserRoleAssignmentsApiService) internalDeleteUserRoleAssignmentExecute(r ApiDeleteUserRoleAssignmentRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -411,6 +430,15 @@ func (a *UserRoleAssignmentsApiService) ReadOneUserRoleAssignment(ctx context.Co // Execute executes the request // @return RoleAssignment func (a *UserRoleAssignmentsApiService) ReadOneUserRoleAssignmentExecute(r ApiReadOneUserRoleAssignmentRequest) (*RoleAssignment, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneUserRoleAssignmentExecute(r) + }, + ) + return obj.(*RoleAssignment), response, error +} + +func (a *UserRoleAssignmentsApiService) internalReadOneUserRoleAssignmentExecute(r ApiReadOneUserRoleAssignmentRequest) (*RoleAssignment, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -583,6 +611,15 @@ func (a *UserRoleAssignmentsApiService) ReadUserRoleAssignments(ctx context.Cont // Execute executes the request // @return EntityArray func (a *UserRoleAssignmentsApiService) ReadUserRoleAssignmentsExecute(r ApiReadUserRoleAssignmentsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadUserRoleAssignmentsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *UserRoleAssignmentsApiService) internalReadUserRoleAssignmentsExecute(r ApiReadUserRoleAssignmentsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} diff --git a/management/api_users.go b/management/api_users.go index 49e9e603..fdc7621e 100644 --- a/management/api_users.go +++ b/management/api_users.go @@ -63,6 +63,15 @@ func (a *UsersApiService) CreateUser(ctx context.Context, environmentID string) // Execute executes the request // @return User func (a *UsersApiService) CreateUserExecute(r ApiCreateUserRequest) (*User, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateUserExecute(r) + }, + ) + return obj.(*User), response, error +} + +func (a *UsersApiService) internalCreateUserExecute(r ApiCreateUserRequest) (*User, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -248,6 +257,16 @@ func (a *UsersApiService) DeleteUser(ctx context.Context, environmentID string, // Execute executes the request func (a *UsersApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteUserExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *UsersApiService) internalDeleteUserExecute(r ApiDeleteUserRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -418,6 +437,15 @@ func (a *UsersApiService) ReadAllUsers(ctx context.Context, environmentID string // Execute executes the request // @return EntityArray func (a *UsersApiService) ReadAllUsersExecute(r ApiReadAllUsersRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllUsersExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *UsersApiService) internalReadAllUsersExecute(r ApiReadAllUsersRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -600,6 +628,15 @@ func (a *UsersApiService) ReadUser(ctx context.Context, environmentID string, us // Execute executes the request // @return User func (a *UsersApiService) ReadUserExecute(r ApiReadUserRequest) (*User, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadUserExecute(r) + }, + ) + return obj.(*User), response, error +} + +func (a *UsersApiService) internalReadUserExecute(r ApiReadUserRequest) (*User, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -780,6 +817,15 @@ func (a *UsersApiService) UpdateUserPatch(ctx context.Context, environmentID str // Execute executes the request // @return User func (a *UsersApiService) UpdateUserPatchExecute(r ApiUpdateUserPatchRequest) (*User, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateUserPatchExecute(r) + }, + ) + return obj.(*User), response, error +} + +func (a *UsersApiService) internalUpdateUserPatchExecute(r ApiUpdateUserPatchRequest) (*User, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} @@ -959,6 +1005,15 @@ func (a *UsersApiService) UpdateUserPut(ctx context.Context, environmentID strin // Execute executes the request // @return User func (a *UsersApiService) UpdateUserPutExecute(r ApiUpdateUserPutRequest) (*User, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateUserPutExecute(r) + }, + ) + return obj.(*User), response, error +} + +func (a *UsersApiService) internalUpdateUserPutExecute(r ApiUpdateUserPutRequest) (*User, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/management/client_ext.go b/management/client_ext.go new file mode 100644 index 00000000..8bff701c --- /dev/null +++ b/management/client_ext.go @@ -0,0 +1,119 @@ +package management + + +import ( + "fmt" + "log" + "net/http" + "strconv" + "time" + + "golang.org/x/exp/slices" +) + +type SDKInterfaceFunc func() (interface{}, *http.Response, error) + +var ( + maxRetries = 5 + maximumRetryAfterBackoff = 30 +) + +func processResponse(f SDKInterfaceFunc) (interface{}, *http.Response, error) { + obj, response, error := exponentialBackOffRetry(f) + return obj, response, reformError(error) +} + +func reformError(err error) error { + return err +} + +func exponentialBackOffRetry(f SDKInterfaceFunc) (interface{}, *http.Response, error) { + var obj interface{} + var resp *http.Response + var err error + backOffTime := time.Second + var isRetryable bool + + for i := 0; i < maxRetries; i++ { + obj, resp, err = f() + + backOffTime, isRetryable = testForRetryable(resp, err, backOffTime) + + if isRetryable { + log.Printf("Attempt %d failed: %v, backing off by %s.", i+1, err, backOffTime.String()) + time.Sleep(backOffTime) + continue + } + + return obj, resp, err + } + + log.Printf("Request failed after %d attempts", maxRetries) + + return obj, resp, err // output the final error +} + +func testForRetryable(r *http.Response, err error, currentBackoff time.Duration) (time.Duration, bool) { + + backoff := currentBackoff + + if r != nil { + if r.StatusCode == 501 || r.StatusCode == 503 || r.StatusCode == 429 { + retryAfter, err := parseRetryAfterHeader(r) + if err != nil { + log.Printf("Cannot parse the expected \"Retry-After\" header: %s", err) + backoff = currentBackoff * 2 + } + + if retryAfter <= time.Duration(maximumRetryAfterBackoff) { + backoff += time.Duration(maximumRetryAfterBackoff) + } else { + backoff += retryAfter + } + } else { + backoff = currentBackoff * 2 + } + + retryAbleCodes := []int{ + 429, + 500, + 501, + 502, + 503, + 504, + } + + if slices.Contains(retryAbleCodes, r.StatusCode) { + log.Printf("HTTP status code %d detected, available for retry", r.StatusCode) + return backoff, true + } + } + + if err != nil { + log.Printf("Error found but not retried: %s", err) + } + + return backoff, false +} + +func parseRetryAfterHeader(resp *http.Response) (time.Duration, error) { + retryAfterHeader := resp.Header.Get("Retry-After") + + if retryAfterHeader == "" { + return 0, fmt.Errorf("Retry-After header not found") + } + + retryAfterSeconds, err := strconv.Atoi(retryAfterHeader) + + if err == nil { + return time.Duration(retryAfterSeconds) * time.Second, nil + } + + retryAfterTime, err := http.ParseTime(retryAfterHeader) + + if err != nil { + return 0, fmt.Errorf("Unable to parse Retry-After header value: %v", err) + } + + return time.Until(retryAfterTime), nil +} diff --git a/management/configuration.go b/management/configuration.go index 6b628945..76f69eb2 100644 --- a/management/configuration.go +++ b/management/configuration.go @@ -89,7 +89,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/0.18.0/go", + UserAgent: "OpenAPI-Generator/0.18.1/go", Debug: false, Servers: ServerConfigurations{ { diff --git a/management/go.mod b/management/go.mod index 93f1896a..7052c714 100644 --- a/management/go.mod +++ b/management/go.mod @@ -1,3 +1,5 @@ module github.com/patrickcping/pingone-go-sdk-v2/management go 1.18 + +require golang.org/x/exp v0.0.0-20230321023759-10a507213a29 diff --git a/management/go.sum b/management/go.sum index e69de29b..45553005 100644 --- a/management/go.sum +++ b/management/go.sum @@ -0,0 +1,2 @@ +golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug= +golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= diff --git a/mfa/.version b/mfa/.version index f514a2f0..f76f9131 100644 --- a/mfa/.version +++ b/mfa/.version @@ -1 +1 @@ -0.9.1 \ No newline at end of file +0.9.2 \ No newline at end of file diff --git a/mfa/CHANGELOG.md b/mfa/CHANGELOG.md index 4aacdbc8..208623e4 100644 --- a/mfa/CHANGELOG.md +++ b/mfa/CHANGELOG.md @@ -1,3 +1,7 @@ +# v0.9.2 (Unreleased) + +* **Note** Add retry logic for retryable HTTP status codes. [#147](https://github.com/patrickcping/pingone-go-sdk-v2/pull/147) + # v0.9.1 (2023-03-20) * **Note** Adjust client request/response debug and fix linting issues. [#133](https://github.com/patrickcping/pingone-go-sdk-v2/pull/133) diff --git a/mfa/README.md b/mfa/README.md index 716df8e6..864dcf7e 100644 --- a/mfa/README.md +++ b/mfa/README.md @@ -6,7 +6,7 @@ The PingOne Platform API covering the PingOne MFA service This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. - API version: 2021-10-17 -- Package version: 0.9.1 +- Package version: 0.9.2 - Build package: org.openapitools.codegen.languages.GoClientCodegen ## Installation diff --git a/mfa/api_applications_application_mfa_push_credentials.go b/mfa/api_applications_application_mfa_push_credentials.go index 832fb554..b0960ca2 100644 --- a/mfa/api_applications_application_mfa_push_credentials.go +++ b/mfa/api_applications_application_mfa_push_credentials.go @@ -60,6 +60,15 @@ func (a *ApplicationsApplicationMFAPushCredentialsApiService) CreateMFAPushCrede // Execute executes the request // @return MFAPushCredentialResponse func (a *ApplicationsApplicationMFAPushCredentialsApiService) CreateMFAPushCredentialExecute(r ApiCreateMFAPushCredentialRequest) (*MFAPushCredentialResponse, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateMFAPushCredentialExecute(r) + }, + ) + return obj.(*MFAPushCredentialResponse), response, error +} + +func (a *ApplicationsApplicationMFAPushCredentialsApiService) internalCreateMFAPushCredentialExecute(r ApiCreateMFAPushCredentialRequest) (*MFAPushCredentialResponse, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -252,6 +261,16 @@ func (a *ApplicationsApplicationMFAPushCredentialsApiService) DeleteMFAPushCrede // Execute executes the request func (a *ApplicationsApplicationMFAPushCredentialsApiService) DeleteMFAPushCredentialExecute(r ApiDeleteMFAPushCredentialRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteMFAPushCredentialExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *ApplicationsApplicationMFAPushCredentialsApiService) internalDeleteMFAPushCredentialExecute(r ApiDeleteMFAPushCredentialRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -417,6 +436,15 @@ func (a *ApplicationsApplicationMFAPushCredentialsApiService) ReadAllMFAPushCred // Execute executes the request // @return EntityArray func (a *ApplicationsApplicationMFAPushCredentialsApiService) ReadAllMFAPushCredentialsExecute(r ApiReadAllMFAPushCredentialsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllMFAPushCredentialsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *ApplicationsApplicationMFAPushCredentialsApiService) internalReadAllMFAPushCredentialsExecute(r ApiReadAllMFAPushCredentialsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -591,6 +619,15 @@ func (a *ApplicationsApplicationMFAPushCredentialsApiService) ReadOneMFAPushCred // Execute executes the request // @return MFAPushCredentialResponse func (a *ApplicationsApplicationMFAPushCredentialsApiService) ReadOneMFAPushCredentialExecute(r ApiReadOneMFAPushCredentialRequest) (*MFAPushCredentialResponse, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneMFAPushCredentialExecute(r) + }, + ) + return obj.(*MFAPushCredentialResponse), response, error +} + +func (a *ApplicationsApplicationMFAPushCredentialsApiService) internalReadOneMFAPushCredentialExecute(r ApiReadOneMFAPushCredentialRequest) (*MFAPushCredentialResponse, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -772,6 +809,15 @@ func (a *ApplicationsApplicationMFAPushCredentialsApiService) UpdateMFAPushCrede // Execute executes the request // @return MFAPushCredentialResponse func (a *ApplicationsApplicationMFAPushCredentialsApiService) UpdateMFAPushCredentialExecute(r ApiUpdateMFAPushCredentialRequest) (*MFAPushCredentialResponse, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateMFAPushCredentialExecute(r) + }, + ) + return obj.(*MFAPushCredentialResponse), response, error +} + +func (a *ApplicationsApplicationMFAPushCredentialsApiService) internalUpdateMFAPushCredentialExecute(r ApiUpdateMFAPushCredentialRequest) (*MFAPushCredentialResponse, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/mfa/api_device_authentication_policy.go b/mfa/api_device_authentication_policy.go index 95063b7a..80f70c2b 100644 --- a/mfa/api_device_authentication_policy.go +++ b/mfa/api_device_authentication_policy.go @@ -57,6 +57,15 @@ func (a *DeviceAuthenticationPolicyApiService) CreateDeviceAuthenticationPolicie // Execute executes the request // @return DeviceAuthenticationPolicy func (a *DeviceAuthenticationPolicyApiService) CreateDeviceAuthenticationPoliciesExecute(r ApiCreateDeviceAuthenticationPoliciesRequest) (*DeviceAuthenticationPolicy, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateDeviceAuthenticationPoliciesExecute(r) + }, + ) + return obj.(*DeviceAuthenticationPolicy), response, error +} + +func (a *DeviceAuthenticationPolicyApiService) internalCreateDeviceAuthenticationPoliciesExecute(r ApiCreateDeviceAuthenticationPoliciesRequest) (*DeviceAuthenticationPolicy, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -239,6 +248,16 @@ func (a *DeviceAuthenticationPolicyApiService) DeleteDeviceAuthenticationPolicy( // Execute executes the request func (a *DeviceAuthenticationPolicyApiService) DeleteDeviceAuthenticationPolicyExecute(r ApiDeleteDeviceAuthenticationPolicyRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteDeviceAuthenticationPolicyExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *DeviceAuthenticationPolicyApiService) internalDeleteDeviceAuthenticationPolicyExecute(r ApiDeleteDeviceAuthenticationPolicyRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -397,6 +416,15 @@ func (a *DeviceAuthenticationPolicyApiService) ReadDeviceAuthenticationPolicies( // Execute executes the request // @return EntityArray func (a *DeviceAuthenticationPolicyApiService) ReadDeviceAuthenticationPoliciesExecute(r ApiReadDeviceAuthenticationPoliciesRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadDeviceAuthenticationPoliciesExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *DeviceAuthenticationPolicyApiService) internalReadDeviceAuthenticationPoliciesExecute(r ApiReadDeviceAuthenticationPoliciesRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -567,6 +595,15 @@ func (a *DeviceAuthenticationPolicyApiService) ReadOneDeviceAuthenticationPolicy // Execute executes the request // @return DeviceAuthenticationPolicy func (a *DeviceAuthenticationPolicyApiService) ReadOneDeviceAuthenticationPolicyExecute(r ApiReadOneDeviceAuthenticationPolicyRequest) (*DeviceAuthenticationPolicy, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneDeviceAuthenticationPolicyExecute(r) + }, + ) + return obj.(*DeviceAuthenticationPolicy), response, error +} + +func (a *DeviceAuthenticationPolicyApiService) internalReadOneDeviceAuthenticationPolicyExecute(r ApiReadOneDeviceAuthenticationPolicyRequest) (*DeviceAuthenticationPolicy, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -744,6 +781,15 @@ func (a *DeviceAuthenticationPolicyApiService) UpdateDeviceAuthenticationPolicy( // Execute executes the request // @return DeviceAuthenticationPolicy func (a *DeviceAuthenticationPolicyApiService) UpdateDeviceAuthenticationPolicyExecute(r ApiUpdateDeviceAuthenticationPolicyRequest) (*DeviceAuthenticationPolicy, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateDeviceAuthenticationPolicyExecute(r) + }, + ) + return obj.(*DeviceAuthenticationPolicy), response, error +} + +func (a *DeviceAuthenticationPolicyApiService) internalUpdateDeviceAuthenticationPolicyExecute(r ApiUpdateDeviceAuthenticationPolicyRequest) (*DeviceAuthenticationPolicy, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/mfa/api_enable_users_mfa.go b/mfa/api_enable_users_mfa.go index c3f41aa6..22d28f28 100644 --- a/mfa/api_enable_users_mfa.go +++ b/mfa/api_enable_users_mfa.go @@ -54,6 +54,15 @@ func (a *EnableUsersMFAApiService) ReadUserMFAEnabled(ctx context.Context, envir // Execute executes the request // @return UserMFAEnabled func (a *EnableUsersMFAApiService) ReadUserMFAEnabledExecute(r ApiReadUserMFAEnabledRequest) (*UserMFAEnabled, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadUserMFAEnabledExecute(r) + }, + ) + return obj.(*UserMFAEnabled), response, error +} + +func (a *EnableUsersMFAApiService) internalReadUserMFAEnabledExecute(r ApiReadUserMFAEnabledRequest) (*UserMFAEnabled, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -231,6 +240,15 @@ func (a *EnableUsersMFAApiService) UpdateUserMFAEnabled(ctx context.Context, env // Execute executes the request // @return UserMFAEnabled func (a *EnableUsersMFAApiService) UpdateUserMFAEnabledExecute(r ApiUpdateUserMFAEnabledRequest) (*UserMFAEnabled, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateUserMFAEnabledExecute(r) + }, + ) + return obj.(*UserMFAEnabled), response, error +} + +func (a *EnableUsersMFAApiService) internalUpdateUserMFAEnabledExecute(r ApiUpdateUserMFAEnabledRequest) (*UserMFAEnabled, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/mfa/api_fido_device.go b/mfa/api_fido_device.go index b585d9b7..4f83d870 100644 --- a/mfa/api_fido_device.go +++ b/mfa/api_fido_device.go @@ -239,6 +239,16 @@ func (a *FIDODeviceApiService) DeleteFidoDevice(ctx context.Context, environment // Execute executes the request func (a *FIDODeviceApiService) DeleteFidoDeviceExecute(r ApiDeleteFidoDeviceRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteFidoDeviceExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *FIDODeviceApiService) internalDeleteFidoDeviceExecute(r ApiDeleteFidoDeviceRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -397,6 +407,15 @@ func (a *FIDODeviceApiService) ReadFidoDevices(ctx context.Context, environmentI // Execute executes the request // @return EntityArray func (a *FIDODeviceApiService) ReadFidoDevicesExecute(r ApiReadFidoDevicesRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadFidoDevicesExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *FIDODeviceApiService) internalReadFidoDevicesExecute(r ApiReadFidoDevicesRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} diff --git a/mfa/api_fido_policy.go b/mfa/api_fido_policy.go index 7fe40627..3b4ee4ed 100644 --- a/mfa/api_fido_policy.go +++ b/mfa/api_fido_policy.go @@ -57,6 +57,15 @@ func (a *FIDOPolicyApiService) CreateFidoPolicy(ctx context.Context, environment // Execute executes the request // @return FIDOPolicy func (a *FIDOPolicyApiService) CreateFidoPolicyExecute(r ApiCreateFidoPolicyRequest) (*FIDOPolicy, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateFidoPolicyExecute(r) + }, + ) + return obj.(*FIDOPolicy), response, error +} + +func (a *FIDOPolicyApiService) internalCreateFidoPolicyExecute(r ApiCreateFidoPolicyRequest) (*FIDOPolicy, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -239,6 +248,16 @@ func (a *FIDOPolicyApiService) DeleteFidoPolicy(ctx context.Context, environment // Execute executes the request func (a *FIDOPolicyApiService) DeleteFidoPolicyExecute(r ApiDeleteFidoPolicyRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteFidoPolicyExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *FIDOPolicyApiService) internalDeleteFidoPolicyExecute(r ApiDeleteFidoPolicyRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -397,6 +416,15 @@ func (a *FIDOPolicyApiService) ReadFidoPolicies(ctx context.Context, environment // Execute executes the request // @return EntityArray func (a *FIDOPolicyApiService) ReadFidoPoliciesExecute(r ApiReadFidoPoliciesRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadFidoPoliciesExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *FIDOPolicyApiService) internalReadFidoPoliciesExecute(r ApiReadFidoPoliciesRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -567,6 +595,15 @@ func (a *FIDOPolicyApiService) ReadOneFidoPolicy(ctx context.Context, environmen // Execute executes the request // @return FIDOPolicy func (a *FIDOPolicyApiService) ReadOneFidoPolicyExecute(r ApiReadOneFidoPolicyRequest) (*FIDOPolicy, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneFidoPolicyExecute(r) + }, + ) + return obj.(*FIDOPolicy), response, error +} + +func (a *FIDOPolicyApiService) internalReadOneFidoPolicyExecute(r ApiReadOneFidoPolicyRequest) (*FIDOPolicy, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -744,6 +781,15 @@ func (a *FIDOPolicyApiService) UpdateFIDOPolicy(ctx context.Context, environment // Execute executes the request // @return FIDOPolicy func (a *FIDOPolicyApiService) UpdateFIDOPolicyExecute(r ApiUpdateFIDOPolicyRequest) (*FIDOPolicy, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateFIDOPolicyExecute(r) + }, + ) + return obj.(*FIDOPolicy), response, error +} + +func (a *FIDOPolicyApiService) internalUpdateFIDOPolicyExecute(r ApiUpdateFIDOPolicyRequest) (*FIDOPolicy, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/mfa/api_mfa_settings.go b/mfa/api_mfa_settings.go index 5c1ea26a..bc8f1ede 100644 --- a/mfa/api_mfa_settings.go +++ b/mfa/api_mfa_settings.go @@ -51,6 +51,15 @@ func (a *MFASettingsApiService) ReadMFASettings(ctx context.Context, environment // Execute executes the request // @return MFASettings func (a *MFASettingsApiService) ReadMFASettingsExecute(r ApiReadMFASettingsRequest) (*MFASettings, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadMFASettingsExecute(r) + }, + ) + return obj.(*MFASettings), response, error +} + +func (a *MFASettingsApiService) internalReadMFASettingsExecute(r ApiReadMFASettingsRequest) (*MFASettings, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -218,6 +227,15 @@ func (a *MFASettingsApiService) ResetMFASettings(ctx context.Context, environmen // Execute executes the request // @return MFASettings func (a *MFASettingsApiService) ResetMFASettingsExecute(r ApiResetMFASettingsRequest) (*MFASettings, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalResetMFASettingsExecute(r) + }, + ) + return obj.(*MFASettings), response, error +} + +func (a *MFASettingsApiService) internalResetMFASettingsExecute(r ApiResetMFASettingsRequest) (*MFASettings, *http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -391,6 +409,15 @@ func (a *MFASettingsApiService) UpdateMFASettings(ctx context.Context, environme // Execute executes the request // @return MFASettings func (a *MFASettingsApiService) UpdateMFASettingsExecute(r ApiUpdateMFASettingsRequest) (*MFASettings, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateMFASettingsExecute(r) + }, + ) + return obj.(*MFASettings), response, error +} + +func (a *MFASettingsApiService) internalUpdateMFASettingsExecute(r ApiUpdateMFASettingsRequest) (*MFASettings, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/mfa/client_ext.go b/mfa/client_ext.go new file mode 100644 index 00000000..6934af45 --- /dev/null +++ b/mfa/client_ext.go @@ -0,0 +1,119 @@ +package mfa + + +import ( + "fmt" + "log" + "net/http" + "strconv" + "time" + + "golang.org/x/exp/slices" +) + +type SDKInterfaceFunc func() (interface{}, *http.Response, error) + +var ( + maxRetries = 5 + maximumRetryAfterBackoff = 30 +) + +func processResponse(f SDKInterfaceFunc) (interface{}, *http.Response, error) { + obj, response, error := exponentialBackOffRetry(f) + return obj, response, reformError(error) +} + +func reformError(err error) error { + return err +} + +func exponentialBackOffRetry(f SDKInterfaceFunc) (interface{}, *http.Response, error) { + var obj interface{} + var resp *http.Response + var err error + backOffTime := time.Second + var isRetryable bool + + for i := 0; i < maxRetries; i++ { + obj, resp, err = f() + + backOffTime, isRetryable = testForRetryable(resp, err, backOffTime) + + if isRetryable { + log.Printf("Attempt %d failed: %v, backing off by %s.", i+1, err, backOffTime.String()) + time.Sleep(backOffTime) + continue + } + + return obj, resp, err + } + + log.Printf("Request failed after %d attempts", maxRetries) + + return obj, resp, err // output the final error +} + +func testForRetryable(r *http.Response, err error, currentBackoff time.Duration) (time.Duration, bool) { + + backoff := currentBackoff + + if r != nil { + if r.StatusCode == 501 || r.StatusCode == 503 || r.StatusCode == 429 { + retryAfter, err := parseRetryAfterHeader(r) + if err != nil { + log.Printf("Cannot parse the expected \"Retry-After\" header: %s", err) + backoff = currentBackoff * 2 + } + + if retryAfter <= time.Duration(maximumRetryAfterBackoff) { + backoff += time.Duration(maximumRetryAfterBackoff) + } else { + backoff += retryAfter + } + } else { + backoff = currentBackoff * 2 + } + + retryAbleCodes := []int{ + 429, + 500, + 501, + 502, + 503, + 504, + } + + if slices.Contains(retryAbleCodes, r.StatusCode) { + log.Printf("HTTP status code %d detected, available for retry", r.StatusCode) + return backoff, true + } + } + + if err != nil { + log.Printf("Error found but not retried: %s", err) + } + + return backoff, false +} + +func parseRetryAfterHeader(resp *http.Response) (time.Duration, error) { + retryAfterHeader := resp.Header.Get("Retry-After") + + if retryAfterHeader == "" { + return 0, fmt.Errorf("Retry-After header not found") + } + + retryAfterSeconds, err := strconv.Atoi(retryAfterHeader) + + if err == nil { + return time.Duration(retryAfterSeconds) * time.Second, nil + } + + retryAfterTime, err := http.ParseTime(retryAfterHeader) + + if err != nil { + return 0, fmt.Errorf("Unable to parse Retry-After header value: %v", err) + } + + return time.Until(retryAfterTime), nil +} diff --git a/mfa/configuration.go b/mfa/configuration.go index e6d910c4..6532116d 100644 --- a/mfa/configuration.go +++ b/mfa/configuration.go @@ -89,7 +89,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/0.9.1/go", + UserAgent: "OpenAPI-Generator/0.9.2/go", Debug: false, Servers: ServerConfigurations{ { diff --git a/mfa/go.mod b/mfa/go.mod index 3e244e1b..dca7876a 100644 --- a/mfa/go.mod +++ b/mfa/go.mod @@ -1,3 +1,5 @@ module github.com/patrickcping/pingone-go-sdk-v2/mfa go 1.18 + +require golang.org/x/exp v0.0.0-20230321023759-10a507213a29 diff --git a/mfa/go.sum b/mfa/go.sum index e69de29b..45553005 100644 --- a/mfa/go.sum +++ b/mfa/go.sum @@ -0,0 +1,2 @@ +golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug= +golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= diff --git a/pingone/client.go b/pingone/client.go index d84420a7..8e6caf34 100644 --- a/pingone/client.go +++ b/pingone/client.go @@ -4,6 +4,8 @@ import ( "context" "fmt" "log" + "regexp" + "time" "github.com/patrickcping/pingone-go-sdk-v2/agreementmanagement" "github.com/patrickcping/pingone-go-sdk-v2/authorize" @@ -172,7 +174,9 @@ func getToken(ctx context.Context, c *Config) (*oauth2.Token, error) { AuthStyle: oauth2.AuthStyleAutoDetect, } - token, err := config.Token(ctx) + token, err := processResponse(func() (*oauth2.Token, error) { + return config.Token(ctx) + }) if err != nil { return nil, err } @@ -188,3 +192,61 @@ func getToken(ctx context.Context, c *Config) (*oauth2.Token, error) { return &token, nil } } + +var ( + maxRetries = 5 +) + +func processResponse(f func() (*oauth2.Token, error)) (*oauth2.Token, error) { + return exponentialBackOffRetry(f) +} + +func exponentialBackOffRetry(f func() (*oauth2.Token, error)) (*oauth2.Token, error) { + var token *oauth2.Token + var err error + backOffTime := time.Second + var isRetryable bool + + for i := 0; i < maxRetries; i++ { + token, err = f() + + if err != nil { + backOffTime, isRetryable = testForRetryable(err, backOffTime) + + if isRetryable { + log.Printf("Attempt %d failed: %v, backing off by %s.", i+1, err, backOffTime.String()) + time.Sleep(backOffTime) + continue + } + } + + return token, err + } + + log.Printf("Request failed after %d attempts", maxRetries) + + return token, err // output the final error +} + +func testForRetryable(err error, currentBackoff time.Duration) (time.Duration, bool) { + + backoff := currentBackoff * 2 + + retryAbleCodes := []int{ + 429, + 500, + 501, + 502, + 503, + 504, + } + + for _, v := range retryAbleCodes { + if m, mErr := regexp.MatchString(fmt.Sprintf("%d ", v), err.Error()); mErr == nil && m { + log.Printf("HTTP status code %d detected, available for retry", v) + return backoff, true + } + } + + return backoff, false +} diff --git a/risk/.version b/risk/.version index 60a2d3e9..44bb5d1f 100644 --- a/risk/.version +++ b/risk/.version @@ -1 +1 @@ -0.4.0 \ No newline at end of file +0.4.1 \ No newline at end of file diff --git a/risk/CHANGELOG.md b/risk/CHANGELOG.md index 8fcc3d8e..8710da86 100644 --- a/risk/CHANGELOG.md +++ b/risk/CHANGELOG.md @@ -1,3 +1,7 @@ +# v0.4.1 (Unreleased) + +* **Note** Add retry logic for retryable HTTP status codes. [#147](https://github.com/patrickcping/pingone-go-sdk-v2/pull/147) + # v0.4.0 (2023-04-18) * **Feature** Full support for risk predictors. [#135](https://github.com/patrickcping/pingone-go-sdk-v2/pull/135) diff --git a/risk/README.md b/risk/README.md index 9a1e3702..d666a365 100644 --- a/risk/README.md +++ b/risk/README.md @@ -6,7 +6,7 @@ The PingOne Platform API covering the PingOne Risk service This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. - API version: 2021-10-17 -- Package version: 0.4.0 +- Package version: 0.4.1 - Build package: org.openapitools.codegen.languages.GoClientCodegen ## Installation diff --git a/risk/api_risk_advanced_predictors.go b/risk/api_risk_advanced_predictors.go index 73f60a7a..7f5782f5 100644 --- a/risk/api_risk_advanced_predictors.go +++ b/risk/api_risk_advanced_predictors.go @@ -57,6 +57,15 @@ func (a *RiskAdvancedPredictorsApiService) CreateRiskPredictor(ctx context.Conte // Execute executes the request // @return RiskPredictor func (a *RiskAdvancedPredictorsApiService) CreateRiskPredictorExecute(r ApiCreateRiskPredictorRequest) (*RiskPredictor, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateRiskPredictorExecute(r) + }, + ) + return obj.(*RiskPredictor), response, error +} + +func (a *RiskAdvancedPredictorsApiService) internalCreateRiskPredictorExecute(r ApiCreateRiskPredictorRequest) (*RiskPredictor, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -239,6 +248,16 @@ func (a *RiskAdvancedPredictorsApiService) DeleteRiskAdvancedPredictor(ctx conte // Execute executes the request func (a *RiskAdvancedPredictorsApiService) DeleteRiskAdvancedPredictorExecute(r ApiDeleteRiskAdvancedPredictorRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteRiskAdvancedPredictorExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *RiskAdvancedPredictorsApiService) internalDeleteRiskAdvancedPredictorExecute(r ApiDeleteRiskAdvancedPredictorRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -397,6 +416,15 @@ func (a *RiskAdvancedPredictorsApiService) ReadAllRiskPredictors(ctx context.Con // Execute executes the request // @return EntityArray func (a *RiskAdvancedPredictorsApiService) ReadAllRiskPredictorsExecute(r ApiReadAllRiskPredictorsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadAllRiskPredictorsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *RiskAdvancedPredictorsApiService) internalReadAllRiskPredictorsExecute(r ApiReadAllRiskPredictorsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -567,6 +595,15 @@ func (a *RiskAdvancedPredictorsApiService) ReadOneRiskPredictor(ctx context.Cont // Execute executes the request // @return RiskPredictor func (a *RiskAdvancedPredictorsApiService) ReadOneRiskPredictorExecute(r ApiReadOneRiskPredictorRequest) (*RiskPredictor, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneRiskPredictorExecute(r) + }, + ) + return obj.(*RiskPredictor), response, error +} + +func (a *RiskAdvancedPredictorsApiService) internalReadOneRiskPredictorExecute(r ApiReadOneRiskPredictorRequest) (*RiskPredictor, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -744,6 +781,15 @@ func (a *RiskAdvancedPredictorsApiService) UpdateRiskPredictor(ctx context.Conte // Execute executes the request // @return RiskPredictor func (a *RiskAdvancedPredictorsApiService) UpdateRiskPredictorExecute(r ApiUpdateRiskPredictorRequest) (*RiskPredictor, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateRiskPredictorExecute(r) + }, + ) + return obj.(*RiskPredictor), response, error +} + +func (a *RiskAdvancedPredictorsApiService) internalUpdateRiskPredictorExecute(r ApiUpdateRiskPredictorRequest) (*RiskPredictor, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/risk/api_risk_evaluations.go b/risk/api_risk_evaluations.go index e97cc47b..9cf54c7b 100644 --- a/risk/api_risk_evaluations.go +++ b/risk/api_risk_evaluations.go @@ -57,6 +57,15 @@ func (a *RiskEvaluationsApiService) CreateRiskEvaluation(ctx context.Context, en // Execute executes the request // @return RiskEvaluation func (a *RiskEvaluationsApiService) CreateRiskEvaluationExecute(r ApiCreateRiskEvaluationRequest) (*RiskEvaluation, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateRiskEvaluationExecute(r) + }, + ) + return obj.(*RiskEvaluation), response, error +} + +func (a *RiskEvaluationsApiService) internalCreateRiskEvaluationExecute(r ApiCreateRiskEvaluationRequest) (*RiskEvaluation, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -240,6 +249,15 @@ func (a *RiskEvaluationsApiService) ReadOneRiskEvaluation(ctx context.Context, e // Execute executes the request // @return RiskEvaluation func (a *RiskEvaluationsApiService) ReadOneRiskEvaluationExecute(r ApiReadOneRiskEvaluationRequest) (*RiskEvaluation, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneRiskEvaluationExecute(r) + }, + ) + return obj.(*RiskEvaluation), response, error +} + +func (a *RiskEvaluationsApiService) internalReadOneRiskEvaluationExecute(r ApiReadOneRiskEvaluationRequest) (*RiskEvaluation, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -417,6 +435,15 @@ func (a *RiskEvaluationsApiService) UpdateRiskEvaluation(ctx context.Context, en // Execute executes the request // @return RiskEvaluation func (a *RiskEvaluationsApiService) UpdateRiskEvaluationExecute(r ApiUpdateRiskEvaluationRequest) (*RiskEvaluation, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateRiskEvaluationExecute(r) + }, + ) + return obj.(*RiskEvaluation), response, error +} + +func (a *RiskEvaluationsApiService) internalUpdateRiskEvaluationExecute(r ApiUpdateRiskEvaluationRequest) (*RiskEvaluation, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/risk/api_risk_policies.go b/risk/api_risk_policies.go index 6252c520..c3ea12da 100644 --- a/risk/api_risk_policies.go +++ b/risk/api_risk_policies.go @@ -57,6 +57,15 @@ func (a *RiskPoliciesApiService) CreateRiskPolicySet(ctx context.Context, enviro // Execute executes the request // @return RiskPolicySet func (a *RiskPoliciesApiService) CreateRiskPolicySetExecute(r ApiCreateRiskPolicySetRequest) (*RiskPolicySet, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalCreateRiskPolicySetExecute(r) + }, + ) + return obj.(*RiskPolicySet), response, error +} + +func (a *RiskPoliciesApiService) internalCreateRiskPolicySetExecute(r ApiCreateRiskPolicySetRequest) (*RiskPolicySet, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} @@ -239,6 +248,16 @@ func (a *RiskPoliciesApiService) DeleteRiskPolicySet(ctx context.Context, enviro // Execute executes the request func (a *RiskPoliciesApiService) DeleteRiskPolicySetExecute(r ApiDeleteRiskPolicySetRequest) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internalDeleteRiskPolicySetExecute(r) + return nil, resp, err + }, + ) + return response, error +} + +func (a *RiskPoliciesApiService) internalDeleteRiskPolicySetExecute(r ApiDeleteRiskPolicySetRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -400,6 +419,15 @@ func (a *RiskPoliciesApiService) ReadOneRiskPolicySet(ctx context.Context, envir // Execute executes the request // @return RiskPolicySet func (a *RiskPoliciesApiService) ReadOneRiskPolicySetExecute(r ApiReadOneRiskPolicySetRequest) (*RiskPolicySet, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadOneRiskPolicySetExecute(r) + }, + ) + return obj.(*RiskPolicySet), response, error +} + +func (a *RiskPoliciesApiService) internalReadOneRiskPolicySetExecute(r ApiReadOneRiskPolicySetRequest) (*RiskPolicySet, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -568,6 +596,15 @@ func (a *RiskPoliciesApiService) ReadRiskPolicySets(ctx context.Context, environ // Execute executes the request // @return EntityArray func (a *RiskPoliciesApiService) ReadRiskPolicySetsExecute(r ApiReadRiskPolicySetsRequest) (*EntityArray, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalReadRiskPolicySetsExecute(r) + }, + ) + return obj.(*EntityArray), response, error +} + +func (a *RiskPoliciesApiService) internalReadRiskPolicySetsExecute(r ApiReadRiskPolicySetsRequest) (*EntityArray, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -744,6 +781,15 @@ func (a *RiskPoliciesApiService) UpdateRiskPolicySet(ctx context.Context, enviro // Execute executes the request // @return RiskPolicySet func (a *RiskPoliciesApiService) UpdateRiskPolicySetExecute(r ApiUpdateRiskPolicySetRequest) (*RiskPolicySet, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internalUpdateRiskPolicySetExecute(r) + }, + ) + return obj.(*RiskPolicySet), response, error +} + +func (a *RiskPoliciesApiService) internalUpdateRiskPolicySetExecute(r ApiUpdateRiskPolicySetRequest) (*RiskPolicySet, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} diff --git a/risk/client_ext.go b/risk/client_ext.go new file mode 100644 index 00000000..90c0cbbc --- /dev/null +++ b/risk/client_ext.go @@ -0,0 +1,119 @@ +package risk + + +import ( + "fmt" + "log" + "net/http" + "strconv" + "time" + + "golang.org/x/exp/slices" +) + +type SDKInterfaceFunc func() (interface{}, *http.Response, error) + +var ( + maxRetries = 5 + maximumRetryAfterBackoff = 30 +) + +func processResponse(f SDKInterfaceFunc) (interface{}, *http.Response, error) { + obj, response, error := exponentialBackOffRetry(f) + return obj, response, reformError(error) +} + +func reformError(err error) error { + return err +} + +func exponentialBackOffRetry(f SDKInterfaceFunc) (interface{}, *http.Response, error) { + var obj interface{} + var resp *http.Response + var err error + backOffTime := time.Second + var isRetryable bool + + for i := 0; i < maxRetries; i++ { + obj, resp, err = f() + + backOffTime, isRetryable = testForRetryable(resp, err, backOffTime) + + if isRetryable { + log.Printf("Attempt %d failed: %v, backing off by %s.", i+1, err, backOffTime.String()) + time.Sleep(backOffTime) + continue + } + + return obj, resp, err + } + + log.Printf("Request failed after %d attempts", maxRetries) + + return obj, resp, err // output the final error +} + +func testForRetryable(r *http.Response, err error, currentBackoff time.Duration) (time.Duration, bool) { + + backoff := currentBackoff + + if r != nil { + if r.StatusCode == 501 || r.StatusCode == 503 || r.StatusCode == 429 { + retryAfter, err := parseRetryAfterHeader(r) + if err != nil { + log.Printf("Cannot parse the expected \"Retry-After\" header: %s", err) + backoff = currentBackoff * 2 + } + + if retryAfter <= time.Duration(maximumRetryAfterBackoff) { + backoff += time.Duration(maximumRetryAfterBackoff) + } else { + backoff += retryAfter + } + } else { + backoff = currentBackoff * 2 + } + + retryAbleCodes := []int{ + 429, + 500, + 501, + 502, + 503, + 504, + } + + if slices.Contains(retryAbleCodes, r.StatusCode) { + log.Printf("HTTP status code %d detected, available for retry", r.StatusCode) + return backoff, true + } + } + + if err != nil { + log.Printf("Error found but not retried: %s", err) + } + + return backoff, false +} + +func parseRetryAfterHeader(resp *http.Response) (time.Duration, error) { + retryAfterHeader := resp.Header.Get("Retry-After") + + if retryAfterHeader == "" { + return 0, fmt.Errorf("Retry-After header not found") + } + + retryAfterSeconds, err := strconv.Atoi(retryAfterHeader) + + if err == nil { + return time.Duration(retryAfterSeconds) * time.Second, nil + } + + retryAfterTime, err := http.ParseTime(retryAfterHeader) + + if err != nil { + return 0, fmt.Errorf("Unable to parse Retry-After header value: %v", err) + } + + return time.Until(retryAfterTime), nil +} diff --git a/risk/configuration.go b/risk/configuration.go index 688cb087..a5e62773 100644 --- a/risk/configuration.go +++ b/risk/configuration.go @@ -89,7 +89,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/0.4.0/go", + UserAgent: "OpenAPI-Generator/0.4.1/go", Debug: false, Servers: ServerConfigurations{ { diff --git a/risk/go.mod b/risk/go.mod index a50c7b62..0b81ca19 100644 --- a/risk/go.mod +++ b/risk/go.mod @@ -1,3 +1,5 @@ module github.com/patrickcping/pingone-go-sdk-v2/risk go 1.18 + +require golang.org/x/exp v0.0.0-20230321023759-10a507213a29 diff --git a/risk/go.sum b/risk/go.sum index e69de29b..45553005 100644 --- a/risk/go.sum +++ b/risk/go.sum @@ -0,0 +1,2 @@ +golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug= +golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= diff --git a/scripts/client_ext.go.tmpl b/scripts/client_ext.go.tmpl new file mode 100644 index 00000000..c4abef53 --- /dev/null +++ b/scripts/client_ext.go.tmpl @@ -0,0 +1,119 @@ +package PACKAGENAME + + +import ( + "fmt" + "log" + "net/http" + "strconv" + "time" + + "golang.org/x/exp/slices" +) + +type SDKInterfaceFunc func() (interface{}, *http.Response, error) + +var ( + maxRetries = 5 + maximumRetryAfterBackoff = 30 +) + +func processResponse(f SDKInterfaceFunc) (interface{}, *http.Response, error) { + obj, response, error := exponentialBackOffRetry(f) + return obj, response, reformError(error) +} + +func reformError(err error) error { + return err +} + +func exponentialBackOffRetry(f SDKInterfaceFunc) (interface{}, *http.Response, error) { + var obj interface{} + var resp *http.Response + var err error + backOffTime := time.Second + var isRetryable bool + + for i := 0; i < maxRetries; i++ { + obj, resp, err = f() + + backOffTime, isRetryable = testForRetryable(resp, err, backOffTime) + + if isRetryable { + log.Printf("Attempt %d failed: %v, backing off by %s.", i+1, err, backOffTime.String()) + time.Sleep(backOffTime) + continue + } + + return obj, resp, err + } + + log.Printf("Request failed after %d attempts", maxRetries) + + return obj, resp, err // output the final error +} + +func testForRetryable(r *http.Response, err error, currentBackoff time.Duration) (time.Duration, bool) { + + backoff := currentBackoff + + if r != nil { + if r.StatusCode == 501 || r.StatusCode == 503 || r.StatusCode == 429 { + retryAfter, err := parseRetryAfterHeader(r) + if err != nil { + log.Printf("Cannot parse the expected \"Retry-After\" header: %s", err) + backoff = currentBackoff * 2 + } + + if retryAfter <= time.Duration(maximumRetryAfterBackoff) { + backoff += time.Duration(maximumRetryAfterBackoff) + } else { + backoff += retryAfter + } + } else { + backoff = currentBackoff * 2 + } + + retryAbleCodes := []int{ + 429, + 500, + 501, + 502, + 503, + 504, + } + + if slices.Contains(retryAbleCodes, r.StatusCode) { + log.Printf("HTTP status code %d detected, available for retry", r.StatusCode) + return backoff, true + } + } + + if err != nil { + log.Printf("Error found but not retried: %s", err) + } + + return backoff, false +} + +func parseRetryAfterHeader(resp *http.Response) (time.Duration, error) { + retryAfterHeader := resp.Header.Get("Retry-After") + + if retryAfterHeader == "" { + return 0, fmt.Errorf("Retry-After header not found") + } + + retryAfterSeconds, err := strconv.Atoi(retryAfterHeader) + + if err == nil { + return time.Duration(retryAfterSeconds) * time.Second, nil + } + + retryAfterTime, err := http.ParseTime(retryAfterHeader) + + if err != nil { + return 0, fmt.Errorf("Unable to parse Retry-After header value: %v", err) + } + + return time.Until(retryAfterTime), nil +} diff --git a/scripts/generate-all.sh b/scripts/generate-all.sh index 61a14960..c71e3612 100755 --- a/scripts/generate-all.sh +++ b/scripts/generate-all.sh @@ -14,6 +14,7 @@ do else echo "Module $i found. Running generate.." + # Generate from OpenAPI pushd $i echo "==> Running codegen-$i..." @@ -24,6 +25,14 @@ do go get -u ./... go mod tidy go mod vendor + + # Generate the retry code + template=$(cat ../scripts/client_ext.go.tmpl) + template=${template//PACKAGENAME/$i} + echo "$template" > "client_ext.go" + + go run ../scripts/generate-replace-regex.go . + else \ echo "pingone-$i.yml missing. Skipping"; \ fi diff --git a/scripts/generate-replace-regex.go b/scripts/generate-replace-regex.go new file mode 100644 index 00000000..11cfa199 --- /dev/null +++ b/scripts/generate-replace-regex.go @@ -0,0 +1,82 @@ +package main + +import ( + "os" + "path/filepath" + "regexp" +) + +func main() { + // Get the target directory from the command line argument + if len(os.Args) < 2 { + println("Usage: go run script.go ") + return + } + dir := os.Args[1] + + // Define the target extension + ext := ".go" + + // Get a list of all files with the given extension in the directory + files, err := filepath.Glob(filepath.Join(dir, "*"+ext)) + if err != nil { + panic(err) + } + + // Iterate over the files and apply the regex replacement rules + for _, file := range files { + // Read the file contents + content, err := os.ReadFile(filepath.Clean(file)) + if err != nil { + panic(err) + } + + // Apply the regex replacement rules + for _, rule := range replaceRules { + re := regexp.MustCompile(rule.pattern) + content = re.ReplaceAll(content, []byte(rule.repl)) + } + + // Write the updated file contents + err = os.WriteFile(file, content, os.ModePerm) + if err != nil { + panic(err) + } + } +} + +var ( + // Define the full list of regex replacement rules + replaceRules = []struct { + pattern string + repl string + }{ + { + `func \(([a-zA-Z\* ]+)\) ([a-zA-Z])([a-zA-Z]+Execute)\(([a-zA-Z ]*)\) \(([\*a-zA-Z]*), \*http\.Response, error\) {`, + `func ($1) $2$3($4) ($5, *http.Response, error) { + obj, response, error := processResponse( + func() (interface{}, *http.Response, error) { + return r.ApiService.internal$2$3(r) + }, + ) + return obj.($5), response, error +} + +func ($1) internal$2$3($4) ($5, *http.Response, error) {`, + }, + { + `func \(([a-zA-Z\* ]+)\) ([a-zA-Z])([a-zA-Z]+Execute)\(([a-zA-Z ]*)\) \(\*http\.Response, error\) {`, + `func ($1) $2$3($4) (*http.Response, error) { + _, response, error := processResponse( + func() (interface{}, *http.Response, error) { + resp, err := r.ApiService.internal$2$3(r) + return nil, resp, err + }, + ) + return response, error +} + +func ($1) internal$2$3($4) (*http.Response, error) {`, + }, + } +)