-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3386101
commit a9e4caf
Showing
95 changed files
with
1,283 additions
and
1,138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
|
||
/* | ||
* ConfigCat Public Management API | ||
* | ||
* **Base API URL**: https://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://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: [email protected] | ||
|
@@ -12,11 +11,12 @@ package configcatpublicapi | |
|
||
import ( | ||
"context" | ||
"fmt" | ||
"io/ioutil" | ||
"net/http" | ||
"net/url" | ||
"strings" | ||
"fmt" | ||
|
||
"github.com/antihax/optional" | ||
) | ||
|
||
|
@@ -26,6 +26,7 @@ var ( | |
) | ||
|
||
type AuditLogsApiService service | ||
|
||
/* | ||
AuditLogsApiService List Audit log items for Product | ||
This endpoint returns the list of Audit log items for a given Product and the result can be optionally filtered by Config and/or Environment. | ||
|
@@ -41,19 +42,19 @@ This endpoint returns the list of Audit log items for a given Product and the r | |
*/ | ||
|
||
type AuditLogsApiGetAuditlogsOpts struct { | ||
ConfigId optional.Interface | ||
EnvironmentId optional.Interface | ||
AuditLogType optional.Interface | ||
FromUtcDateTime optional.Time | ||
ToUtcDateTime optional.Time | ||
ConfigId optional.Interface | ||
EnvironmentId optional.Interface | ||
AuditLogType optional.Interface | ||
FromUtcDateTime optional.Time | ||
ToUtcDateTime optional.Time | ||
} | ||
|
||
func (a *AuditLogsApiService) GetAuditlogs(ctx context.Context, productId string, localVarOptionals *AuditLogsApiGetAuditlogsOpts) ([]AuditLogItemModel, *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 []AuditLogItemModel | ||
) | ||
|
||
|
@@ -115,32 +116,33 @@ func (a *AuditLogsApiService) GetAuditlogs(ctx context.Context, productId string | |
|
||
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 []AuditLogItemModel | ||
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 | ||
} | ||
|
||
/* | ||
AuditLogsApiService List Deleted Settings | ||
This endpoint returns the list of Feature Flags and Settings that were deleted from the given Config. | ||
|
@@ -150,10 +152,10 @@ This endpoint returns the list of Feature Flags and Settings that were deleted f | |
*/ | ||
func (a *AuditLogsApiService) GetDeletedSettings(ctx context.Context, configId string) ([]SettingModel, *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 []SettingModel | ||
) | ||
|
||
|
@@ -200,32 +202,33 @@ func (a *AuditLogsApiService) GetDeletedSettings(ctx context.Context, configId s | |
|
||
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 []SettingModel | ||
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 | ||
} | ||
|
||
/* | ||
AuditLogsApiService List Audit log items for Organization | ||
This endpoint returns the list of Audit log items for a given Organization and the result can be optionally filtered by Product and/or Config and/or Environment. | ||
|
@@ -242,20 +245,20 @@ This endpoint returns the list of Audit log items for a given Organization and | |
*/ | ||
|
||
type AuditLogsApiGetOrganizationAuditlogsOpts struct { | ||
ProductId optional.Interface | ||
ConfigId optional.Interface | ||
EnvironmentId optional.Interface | ||
AuditLogType optional.Interface | ||
FromUtcDateTime optional.Time | ||
ToUtcDateTime optional.Time | ||
ProductId optional.Interface | ||
ConfigId optional.Interface | ||
EnvironmentId optional.Interface | ||
AuditLogType optional.Interface | ||
FromUtcDateTime optional.Time | ||
ToUtcDateTime optional.Time | ||
} | ||
|
||
func (a *AuditLogsApiService) GetOrganizationAuditlogs(ctx context.Context, organizationId string, localVarOptionals *AuditLogsApiGetOrganizationAuditlogsOpts) ([]AuditLogItemModel, *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 []AuditLogItemModel | ||
) | ||
|
||
|
@@ -320,26 +323,26 @@ func (a *AuditLogsApiService) GetOrganizationAuditlogs(ctx context.Context, orga | |
|
||
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 []AuditLogItemModel | ||
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 | ||
} | ||
|
Oops, something went wrong.