Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lajos88 committed Oct 14, 2020
1 parent 85cb8f8 commit 5451cc5
Showing 1 changed file with 50 additions and 46 deletions.
96 changes: 50 additions & 46 deletions api_integration_links.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@

/*
* ConfigCat Public Management API
*
* **Base API URL**: https://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON and JSON+HAL format. Do not use this API for accessing and evaluating feature flag values. Use the [SDKs instead](https://configcat.com/docs/sdk-reference/overview). # OpenAPI Specification The complete specification is publicly available here: [swagger.json](v1/swagger.json). You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). <!-- ReDoc-Inject: <security-definitions> --> # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header.
* **Base API URL**: https://test-api.configcat.com If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger). The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat. The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON and JSON+HAL format. Do not use this API for accessing and evaluating feature flag values. Use the [SDKs instead](https://configcat.com/docs/sdk-reference/overview). # OpenAPI Specification The complete specification is publicly available here: [swagger.json](v1/swagger.json). You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API. # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication). <!-- ReDoc-Inject: <security-definitions> --> # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers: | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset | The time when the current rate limit period resets. | When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header.
*
* API version: v1
* Contact: support@configcat.com
Expand All @@ -12,11 +11,13 @@ package configcatpublicapi

import (
"context"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strings"
"fmt"

"github.com/antihax/optional"
)

// Linger please
Expand All @@ -25,6 +26,7 @@ var (
)

type IntegrationLinksApiService service

/*
IntegrationLinksApiService Add or update Integration link
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
Expand All @@ -33,20 +35,20 @@ IntegrationLinksApiService Add or update Integration link
* @param integrationLinkType The integration link&#x27;s type.
* @param key The key of the integration link.
* @param optional nil or *IntegrationLinksApiAddOrUpdateIntegrationLinkOpts - Optional Parameters:
* @param "Body" (optional.Interface of AddOrUpdateIntegrationLinkModel) -
* @param "Body" (optional.Interface of AddOrUpdateIntegrationLinkModel) -
@return IntegrationLinkModel
*/

type IntegrationLinksApiAddOrUpdateIntegrationLinkOpts struct {
Body optional.Interface
Body optional.Interface
}

func (a *IntegrationLinksApiService) AddOrUpdateIntegrationLink(ctx context.Context, environmentId string, settingId int32, integrationLinkType IntegrationLinkType, key string, localVarOptionals *IntegrationLinksApiAddOrUpdateIntegrationLinkOpts) (IntegrationLinkModel, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue IntegrationLinkModel
)

Expand Down Expand Up @@ -80,8 +82,8 @@ func (a *IntegrationLinksApiService) AddOrUpdateIntegrationLink(ctx context.Cont
}
// body params
if localVarOptionals != nil && localVarOptionals.Body.IsSet() {
localVarOptionalBody:= localVarOptionals.Body.Value()

localVarOptionalBody := localVarOptionals.Body.Value()
localVarPostBody = &localVarOptionalBody
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
Expand All @@ -102,32 +104,33 @@ func (a *IntegrationLinksApiService) AddOrUpdateIntegrationLink(ctx context.Cont

if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err == nil {
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}

if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v IntegrationLinkModel
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}

return localVarReturnValue, localVarHttpResponse, nil
}

/*
IntegrationLinksApiService Delete Integration link
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
Expand All @@ -139,10 +142,10 @@ IntegrationLinksApiService Delete Integration link
*/
func (a *IntegrationLinksApiService) DeleteIntegrationLink(ctx context.Context, environmentId string, settingId int32, integrationLinkType IntegrationLinkType, key string) (DeleteIntegrationLinkModel, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue DeleteIntegrationLinkModel
)

Expand Down Expand Up @@ -192,32 +195,33 @@ func (a *IntegrationLinksApiService) DeleteIntegrationLink(ctx context.Context,

if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err == nil {
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}

if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v DeleteIntegrationLinkModel
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}

return localVarReturnValue, localVarHttpResponse, nil
}

/*
IntegrationLinksApiService Get Integration link
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
Expand All @@ -227,10 +231,10 @@ IntegrationLinksApiService Get Integration link
*/
func (a *IntegrationLinksApiService) GetIntegrationLinkDetails(ctx context.Context, integrationLinkType IntegrationLinkType, key string) (IntegrationLinkDetailsModel, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue IntegrationLinkDetailsModel
)

Expand Down Expand Up @@ -278,26 +282,26 @@ func (a *IntegrationLinksApiService) GetIntegrationLinkDetails(ctx context.Conte

if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err == nil {
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}

if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v IntegrationLinkDetailsModel
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
Expand Down

0 comments on commit 5451cc5

Please sign in to comment.