From fa0ef129cd037435ab00863286ec4c1bbaa55d65 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 28 Jun 2023 10:14:32 +0000 Subject: [PATCH] Generated v1.0.0-beta.14 --- CHANGELOG.md | 11 + README.md | 14 +- docs/AutomationToken.md | 158 +++ docs/AutomationTokenCreateRequest.md | 54 ++ .../AutomationTokenCreateRequestAttributes.md | 194 ++++ docs/AutomationTokenCreateResponse.md | 438 +++++++++ docs/AutomationTokenCreateResponseAllOf.md | 236 +++++ docs/AutomationTokenResponse.md | 412 ++++++++ docs/AutomationTokenResponseAllOf.md | 262 +++++ docs/AutomationTokensAPI.md | 342 +++++++ docs/DomainOwnershipsAPI.md | 4 +- docs/ErrorResponse.md | 132 +++ docs/HistoricalFieldResultsAttributes.md | 18 +- docs/HistoricalFieldResultsAttributesAllOf.md | 18 +- docs/InlineResponse2001.md | 26 +- docs/InlineResponse2002.md | 52 +- docs/InlineResponse2003.md | 8 +- docs/InlineResponse2003Meta.md | 4 +- docs/InlineResponse2004.md | 80 ++ ...e2002Meta.md => InlineResponse2004Meta.md} | 34 +- docs/KvStoreAPI.md | 4 +- docs/KvStoreItemAPI.md | 4 +- docs/RateLimiter.md | 8 +- docs/RateLimiterAPI.md | 160 +++ docs/RateLimiterResponse.md | 8 +- docs/RateLimiterResponse1.md | 106 -- docs/ReadOnlyCustomerId.md | 28 + docs/ReadOnlyId.md | 28 + docs/ReadOnlyIdService.md | 28 + docs/ReadOnlyUserId.md | 28 + fastly/api_automation_tokens.go | 911 ++++++++++++++++++ fastly/api_domain_ownerships.go | 12 +- fastly/api_kv_store.go | 12 +- fastly/api_kv_store_item.go | 12 +- fastly/api_rate_limiter.go | 501 ++++++++++ fastly/client.go | 3 + fastly/configuration.go | 44 +- fastly/model_automation_token.go | 312 ++++++ .../model_automation_token_create_request.go | 155 +++ ...omation_token_create_request_attributes.go | 359 +++++++ .../model_automation_token_create_response.go | 708 ++++++++++++++ ...automation_token_create_response_all_of.go | 418 ++++++++ fastly/model_automation_token_response.go | 671 +++++++++++++ .../model_automation_token_response_all_of.go | 457 +++++++++ fastly/model_error_response.go | 266 +++++ ...del_historical_field_results_attributes.go | 23 +- ...torical_field_results_attributes_all_of.go | 23 +- fastly/model_inline_response_200_1.go | 40 +- fastly/model_inline_response_200_2.go | 76 +- fastly/model_inline_response_200_3.go | 12 +- fastly/model_inline_response_200_3_meta.go | 4 +- fastly/model_inline_response_200_4.go | 192 ++++ ...go => model_inline_response_200_4_meta.go} | 70 +- fastly/model_rate_limiter.go | 38 +- fastly/model_rate_limiter_response.go | 38 +- fastly/model_rate_limiter_response_1.go | 232 ----- fastly/model_read_only_customer_id.go | 92 ++ fastly/model_read_only_id.go | 92 ++ fastly/model_read_only_id_service.go | 92 ++ fastly/model_read_only_user_id.go | 92 ++ sig.json | 2 +- 61 files changed, 8188 insertions(+), 670 deletions(-) create mode 100644 docs/AutomationToken.md create mode 100644 docs/AutomationTokenCreateRequest.md create mode 100644 docs/AutomationTokenCreateRequestAttributes.md create mode 100644 docs/AutomationTokenCreateResponse.md create mode 100644 docs/AutomationTokenCreateResponseAllOf.md create mode 100644 docs/AutomationTokenResponse.md create mode 100644 docs/AutomationTokenResponseAllOf.md create mode 100644 docs/AutomationTokensAPI.md create mode 100644 docs/ErrorResponse.md create mode 100644 docs/InlineResponse2004.md rename docs/{InlineResponse2002Meta.md => InlineResponse2004Meta.md} (59%) delete mode 100644 docs/RateLimiterResponse1.md create mode 100644 docs/ReadOnlyCustomerId.md create mode 100644 docs/ReadOnlyId.md create mode 100644 docs/ReadOnlyIdService.md create mode 100644 docs/ReadOnlyUserId.md create mode 100644 fastly/api_automation_tokens.go create mode 100644 fastly/model_automation_token.go create mode 100644 fastly/model_automation_token_create_request.go create mode 100644 fastly/model_automation_token_create_request_attributes.go create mode 100644 fastly/model_automation_token_create_response.go create mode 100644 fastly/model_automation_token_create_response_all_of.go create mode 100644 fastly/model_automation_token_response.go create mode 100644 fastly/model_automation_token_response_all_of.go create mode 100644 fastly/model_error_response.go create mode 100644 fastly/model_inline_response_200_4.go rename fastly/{model_inline_response_200_2_meta.go => model_inline_response_200_4_meta.go} (65%) delete mode 100644 fastly/model_rate_limiter_response_1.go create mode 100644 fastly/model_read_only_customer_id.go create mode 100644 fastly/model_read_only_id.go create mode 100644 fastly/model_read_only_id_service.go create mode 100644 fastly/model_read_only_user_id.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 3179b54c..c73a512c 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [v1.0.0-beta.14](https://github.com/fastly/fastly-go/releases/tag/v1.0.0-beta.14) (2023-06-27) + +**Enhancements:** + +- feat(automation_tokens): implement endpoints. +- feat(rate_limiter): implement POST/PUT endpoints. + +**Bug fixes:** + +- fix(historical_stats): extract primitive into custom type. + ## [v1.0.0-beta.13](https://github.com/fastly/fastly-go/releases/tag/v1.0.0-beta.13) (2023-06-23) **Bug fixes:** diff --git a/README.md b/README.md index 955d60f3..100317eb 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Add the following to your project's `go.mod`: ```go.mod require ( - github.com/fastly/fastly-go v1.0.0-beta.13 + github.com/fastly/fastly-go v1.0.0-beta.14 ) ``` @@ -73,6 +73,11 @@ Class | Method | HTTP request | Description *ApexRedirectAPI* | [**GetApexRedirect**](docs/ApexRedirectAPI.md#getapexredirect) | **GET** `/apex-redirects/{apex_redirect_id}` | Get an apex redirect *ApexRedirectAPI* | [**ListApexRedirects**](docs/ApexRedirectAPI.md#listapexredirects) | **GET** `/service/{service_id}/version/{version_id}/apex-redirects` | List apex redirects *ApexRedirectAPI* | [**UpdateApexRedirect**](docs/ApexRedirectAPI.md#updateapexredirect) | **PUT** `/apex-redirects/{apex_redirect_id}` | Update an apex redirect +*AutomationTokensAPI* | [**CreateAutomationToken**](docs/AutomationTokensAPI.md#createautomationtoken) | **POST** `/automation-tokens` | Create Automation Token +*AutomationTokensAPI* | [**GetAutomationTokenID**](docs/AutomationTokensAPI.md#getautomationtokenid) | **GET** `/automation-tokens/{id}` | Retrieve an Automation Token by ID +*AutomationTokensAPI* | [**GetAutomationTokensIDServices**](docs/AutomationTokensAPI.md#getautomationtokensidservices) | **GET** `/automation-tokens/{id}/services` | List Automation Token Services +*AutomationTokensAPI* | [**ListAutomationTokens**](docs/AutomationTokensAPI.md#listautomationtokens) | **GET** `/automation-tokens` | List Customer Automation Tokens +*AutomationTokensAPI* | [**RevokeAutomationTokenID**](docs/AutomationTokensAPI.md#revokeautomationtokenid) | **DELETE** `/automation-tokens/{id}` | Revoke an Automation Token by ID *BackendAPI* | [**CreateBackend**](docs/BackendAPI.md#createbackend) | **POST** `/service/{service_id}/version/{version_id}/backend` | Create a backend *BackendAPI* | [**DeleteBackend**](docs/BackendAPI.md#deletebackend) | **DELETE** `/service/{service_id}/version/{version_id}/backend/{backend_name}` | Delete a backend *BackendAPI* | [**GetBackend**](docs/BackendAPI.md#getbackend) | **GET** `/service/{service_id}/version/{version_id}/backend/{backend_name}` | Describe a backend @@ -350,9 +355,11 @@ Class | Method | HTTP request | Description *PurgeAPI* | [**PurgeAll**](docs/PurgeAPI.md#purgeall) | **POST** `/service/{service_id}/purge_all` | Purge everything from a service *PurgeAPI* | [**PurgeSingleURL**](docs/PurgeAPI.md#purgesingleurl) | **POST** `/purge/{cached_url}` | Purge a URL *PurgeAPI* | [**PurgeTag**](docs/PurgeAPI.md#purgetag) | **POST** `/service/{service_id}/purge/{surrogate_key}` | Purge by surrogate key tag +*RateLimiterAPI* | [**CreateRateLimiter**](docs/RateLimiterAPI.md#createratelimiter) | **POST** `/service/{service_id}/version/{version_id}/rate-limiters` | Create a rate limiter *RateLimiterAPI* | [**DeleteRateLimiter**](docs/RateLimiterAPI.md#deleteratelimiter) | **DELETE** `/rate-limiters/{rate_limiter_id}` | Delete a rate limiter *RateLimiterAPI* | [**GetRateLimiter**](docs/RateLimiterAPI.md#getratelimiter) | **GET** `/rate-limiters/{rate_limiter_id}` | Get a rate limiter *RateLimiterAPI* | [**ListRateLimiters**](docs/RateLimiterAPI.md#listratelimiters) | **GET** `/service/{service_id}/version/{version_id}/rate-limiters` | List rate limiters +*RateLimiterAPI* | [**UpdateRateLimiter**](docs/RateLimiterAPI.md#updateratelimiter) | **PUT** `/rate-limiters/{rate_limiter_id}` | Update a rate limiter *RealtimeAPI* | [**GetStatsLast120Seconds**](docs/RealtimeAPI.md#getstatslast120seconds) | **GET** `/v1/channel/{service_id}/ts/h` | Get real-time data for the last 120 seconds *RealtimeAPI* | [**GetStatsLast120SecondsLimitEntries**](docs/RealtimeAPI.md#getstatslast120secondslimitentries) | **GET** `/v1/channel/{service_id}/ts/h/limit/{max_entries}` | Get a limited number of real-time data entries *RealtimeAPI* | [**GetStatsLastSecond**](docs/RealtimeAPI.md#getstatslastsecond) | **GET** `/v1/channel/{service_id}/ts/{timestamp_in_seconds}` | Get real-time data from specified time @@ -511,16 +518,12 @@ Each of these functions takes a value of the given basic type and returns a poin The fastly-go API client currently does not support the following endpoints: -- [`/automation-tokens/{id}/services`](https://developer.fastly.com/reference/api/auth-tokens/automation) (GET) -- [`/automation-tokens/{id}`](https://developer.fastly.com/reference/api/auth-tokens/automation) (DELETE, GET) -- [`/automation-tokens`](https://developer.fastly.com/reference/api/auth-tokens/automation) (GET, POST) - [`/customer/{customer_id}/contacts`](https://developer.fastly.com/reference/api/account/contact) (POST) - [`/docs/section/{section}`](https://developer.fastly.com/reference/api/utils/docs) (GET) - [`/docs/subject/{subject}`](https://developer.fastly.com/reference/api/utils/docs) (GET) - [`/docs`](https://developer.fastly.com/reference/api/utils/docs) (GET) - [`/metrics/domains/services/{service_id}`](https://developer.fastly.com/reference/api/metrics-stats/domain-inspector/historical) (GET) - [`/metrics/origins/services/{service_id}`](https://developer.fastly.com/reference/api/metrics-stats/origin-inspector/historical) (GET) -- [`/rate-limiters/{rate_limiter_id}`](https://developer.fastly.com/reference/api/vcl-services/rate-limiter) (PUT) - [`/resources/stores/secret/client-key`](https://developer.fastly.com/reference/api/services/resources/secret-store) (POST) - [`/resources/stores/secret/signing-key`](https://developer.fastly.com/reference/api/services/resources/secret-store) (GET) - [`/resources/stores/secret/{store_id}/secrets/{secret_name}`](https://developer.fastly.com/reference/api/services/resources/secret) (DELETE, GET) @@ -541,7 +544,6 @@ The fastly-go API client currently does not support the following endpoints: - [`/service/{service_id}/version/{version_id}/generated_vcl/content`](https://developer.fastly.com/reference/api/vcl-services/vcl) (GET) - [`/service/{service_id}/version/{version_id}/logging/kafka/{logging_kafka_name}`](https://developer.fastly.com/reference/api/logging/kafka) (PUT) - [`/service/{service_id}/version/{version_id}/logging/kinesis/{logging_kinesis_name}`](https://developer.fastly.com/reference/api/logging/kinesis) (PUT) -- [`/service/{service_id}/version/{version_id}/rate-limiters`](https://developer.fastly.com/reference/api/vcl-services/rate-limiter) (POST) - [`/service/{service_id}/version/{version_id}/request_settings`](https://developer.fastly.com/reference/api/vcl-services/request-settings) (POST) - [`/service/{service_id}/version/{version_id}/response_object/{response_object_name}`](https://developer.fastly.com/reference/api/vcl-services/response-object) (PUT) - [`/service/{service_id}/version/{version_id}/response_object`](https://developer.fastly.com/reference/api/vcl-services/response-object) (POST) diff --git a/docs/AutomationToken.md b/docs/AutomationToken.md new file mode 100644 index 00000000..6c38f3dd --- /dev/null +++ b/docs/AutomationToken.md @@ -0,0 +1,158 @@ +# AutomationToken + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | The name of the token. | [optional] +**Role** | Pointer to **string** | The role on the token. | [optional] +**Services** | Pointer to **[]string** | (Optional) The service IDs of the services the token will have access to. Separate service IDs with a space. If no services are specified, the token will have access to all services on the account. | [optional] +**Scope** | Pointer to **string** | A space-delimited list of authorization scope. | [optional] [default to "global"] +**ExpiresAt** | Pointer to **string** | A UTC time-stamp of when the token expires. | [optional] + +## Methods + +### NewAutomationToken + +`func NewAutomationToken() *AutomationToken` + +NewAutomationToken instantiates a new AutomationToken object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAutomationTokenWithDefaults + +`func NewAutomationTokenWithDefaults() *AutomationToken` + +NewAutomationTokenWithDefaults instantiates a new AutomationToken object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *AutomationToken) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *AutomationToken) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *AutomationToken) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *AutomationToken) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetRole + +`func (o *AutomationToken) GetRole() string` + +GetRole returns the Role field if non-nil, zero value otherwise. + +### GetRoleOk + +`func (o *AutomationToken) GetRoleOk() (*string, bool)` + +GetRoleOk returns a tuple with the Role field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRole + +`func (o *AutomationToken) SetRole(v string)` + +SetRole sets Role field to given value. + +### HasRole + +`func (o *AutomationToken) HasRole() bool` + +HasRole returns a boolean if a field has been set. + +### GetServices + +`func (o *AutomationToken) GetServices() []string` + +GetServices returns the Services field if non-nil, zero value otherwise. + +### GetServicesOk + +`func (o *AutomationToken) GetServicesOk() (*[]string, bool)` + +GetServicesOk returns a tuple with the Services field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServices + +`func (o *AutomationToken) SetServices(v []string)` + +SetServices sets Services field to given value. + +### HasServices + +`func (o *AutomationToken) HasServices() bool` + +HasServices returns a boolean if a field has been set. + +### GetScope + +`func (o *AutomationToken) GetScope() string` + +GetScope returns the Scope field if non-nil, zero value otherwise. + +### GetScopeOk + +`func (o *AutomationToken) GetScopeOk() (*string, bool)` + +GetScopeOk returns a tuple with the Scope field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetScope + +`func (o *AutomationToken) SetScope(v string)` + +SetScope sets Scope field to given value. + +### HasScope + +`func (o *AutomationToken) HasScope() bool` + +HasScope returns a boolean if a field has been set. + +### GetExpiresAt + +`func (o *AutomationToken) GetExpiresAt() string` + +GetExpiresAt returns the ExpiresAt field if non-nil, zero value otherwise. + +### GetExpiresAtOk + +`func (o *AutomationToken) GetExpiresAtOk() (*string, bool)` + +GetExpiresAtOk returns a tuple with the ExpiresAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiresAt + +`func (o *AutomationToken) SetExpiresAt(v string)` + +SetExpiresAt sets ExpiresAt field to given value. + +### HasExpiresAt + +`func (o *AutomationToken) HasExpiresAt() bool` + +HasExpiresAt returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/AutomationTokenCreateRequest.md b/docs/AutomationTokenCreateRequest.md new file mode 100644 index 00000000..1a831822 --- /dev/null +++ b/docs/AutomationTokenCreateRequest.md @@ -0,0 +1,54 @@ +# AutomationTokenCreateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Attributes** | Pointer to [**AutomationTokenCreateRequestAttributes**](AutomationTokenCreateRequestAttributes.md) | | [optional] + +## Methods + +### NewAutomationTokenCreateRequest + +`func NewAutomationTokenCreateRequest() *AutomationTokenCreateRequest` + +NewAutomationTokenCreateRequest instantiates a new AutomationTokenCreateRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAutomationTokenCreateRequestWithDefaults + +`func NewAutomationTokenCreateRequestWithDefaults() *AutomationTokenCreateRequest` + +NewAutomationTokenCreateRequestWithDefaults instantiates a new AutomationTokenCreateRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAttributes + +`func (o *AutomationTokenCreateRequest) GetAttributes() AutomationTokenCreateRequestAttributes` + +GetAttributes returns the Attributes field if non-nil, zero value otherwise. + +### GetAttributesOk + +`func (o *AutomationTokenCreateRequest) GetAttributesOk() (*AutomationTokenCreateRequestAttributes, bool)` + +GetAttributesOk returns a tuple with the Attributes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAttributes + +`func (o *AutomationTokenCreateRequest) SetAttributes(v AutomationTokenCreateRequestAttributes)` + +SetAttributes sets Attributes field to given value. + +### HasAttributes + +`func (o *AutomationTokenCreateRequest) HasAttributes() bool` + +HasAttributes returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/AutomationTokenCreateRequestAttributes.md b/docs/AutomationTokenCreateRequestAttributes.md new file mode 100644 index 00000000..dc7e9ed5 --- /dev/null +++ b/docs/AutomationTokenCreateRequestAttributes.md @@ -0,0 +1,194 @@ +# AutomationTokenCreateRequestAttributes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | name of the token | [optional] +**Role** | Pointer to **string** | | [optional] +**Services** | Pointer to **[]string** | List of service ids to limit the token | [optional] +**Scope** | Pointer to **string** | | [optional] [default to "global"] +**ExpiresAt** | Pointer to **NullableTime** | A UTC time-stamp of when the token will expire. | [optional] +**TLSAccess** | Pointer to **bool** | Indicates whether TLS access is enabled for the token. | [optional] + +## Methods + +### NewAutomationTokenCreateRequestAttributes + +`func NewAutomationTokenCreateRequestAttributes() *AutomationTokenCreateRequestAttributes` + +NewAutomationTokenCreateRequestAttributes instantiates a new AutomationTokenCreateRequestAttributes object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAutomationTokenCreateRequestAttributesWithDefaults + +`func NewAutomationTokenCreateRequestAttributesWithDefaults() *AutomationTokenCreateRequestAttributes` + +NewAutomationTokenCreateRequestAttributesWithDefaults instantiates a new AutomationTokenCreateRequestAttributes object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *AutomationTokenCreateRequestAttributes) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *AutomationTokenCreateRequestAttributes) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *AutomationTokenCreateRequestAttributes) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *AutomationTokenCreateRequestAttributes) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetRole + +`func (o *AutomationTokenCreateRequestAttributes) GetRole() string` + +GetRole returns the Role field if non-nil, zero value otherwise. + +### GetRoleOk + +`func (o *AutomationTokenCreateRequestAttributes) GetRoleOk() (*string, bool)` + +GetRoleOk returns a tuple with the Role field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRole + +`func (o *AutomationTokenCreateRequestAttributes) SetRole(v string)` + +SetRole sets Role field to given value. + +### HasRole + +`func (o *AutomationTokenCreateRequestAttributes) HasRole() bool` + +HasRole returns a boolean if a field has been set. + +### GetServices + +`func (o *AutomationTokenCreateRequestAttributes) GetServices() []string` + +GetServices returns the Services field if non-nil, zero value otherwise. + +### GetServicesOk + +`func (o *AutomationTokenCreateRequestAttributes) GetServicesOk() (*[]string, bool)` + +GetServicesOk returns a tuple with the Services field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServices + +`func (o *AutomationTokenCreateRequestAttributes) SetServices(v []string)` + +SetServices sets Services field to given value. + +### HasServices + +`func (o *AutomationTokenCreateRequestAttributes) HasServices() bool` + +HasServices returns a boolean if a field has been set. + +### GetScope + +`func (o *AutomationTokenCreateRequestAttributes) GetScope() string` + +GetScope returns the Scope field if non-nil, zero value otherwise. + +### GetScopeOk + +`func (o *AutomationTokenCreateRequestAttributes) GetScopeOk() (*string, bool)` + +GetScopeOk returns a tuple with the Scope field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetScope + +`func (o *AutomationTokenCreateRequestAttributes) SetScope(v string)` + +SetScope sets Scope field to given value. + +### HasScope + +`func (o *AutomationTokenCreateRequestAttributes) HasScope() bool` + +HasScope returns a boolean if a field has been set. + +### GetExpiresAt + +`func (o *AutomationTokenCreateRequestAttributes) GetExpiresAt() time.Time` + +GetExpiresAt returns the ExpiresAt field if non-nil, zero value otherwise. + +### GetExpiresAtOk + +`func (o *AutomationTokenCreateRequestAttributes) GetExpiresAtOk() (*time.Time, bool)` + +GetExpiresAtOk returns a tuple with the ExpiresAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiresAt + +`func (o *AutomationTokenCreateRequestAttributes) SetExpiresAt(v time.Time)` + +SetExpiresAt sets ExpiresAt field to given value. + +### HasExpiresAt + +`func (o *AutomationTokenCreateRequestAttributes) HasExpiresAt() bool` + +HasExpiresAt returns a boolean if a field has been set. + +### SetExpiresAtNil + +`func (o *AutomationTokenCreateRequestAttributes) SetExpiresAtNil(b bool)` + + SetExpiresAtNil sets the value for ExpiresAt to be an explicit nil + +### UnsetExpiresAt +`func (o *AutomationTokenCreateRequestAttributes) UnsetExpiresAt()` + +UnsetExpiresAt ensures that no value is present for ExpiresAt, not even an explicit nil +### GetTLSAccess + +`func (o *AutomationTokenCreateRequestAttributes) GetTLSAccess() bool` + +GetTLSAccess returns the TLSAccess field if non-nil, zero value otherwise. + +### GetTLSAccessOk + +`func (o *AutomationTokenCreateRequestAttributes) GetTLSAccessOk() (*bool, bool)` + +GetTLSAccessOk returns a tuple with the TLSAccess field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTLSAccess + +`func (o *AutomationTokenCreateRequestAttributes) SetTLSAccess(v bool)` + +SetTLSAccess sets TLSAccess field to given value. + +### HasTLSAccess + +`func (o *AutomationTokenCreateRequestAttributes) HasTLSAccess() bool` + +HasTLSAccess returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/AutomationTokenCreateResponse.md b/docs/AutomationTokenCreateResponse.md new file mode 100644 index 00000000..27bc635b --- /dev/null +++ b/docs/AutomationTokenCreateResponse.md @@ -0,0 +1,438 @@ +# AutomationTokenCreateResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | The name of the token. | [optional] +**Role** | Pointer to **string** | The role on the token. | [optional] +**Services** | Pointer to **[]string** | (Optional) The service IDs of the services the token will have access to. Separate service IDs with a space. If no services are specified, the token will have access to all services on the account. | [optional] +**Scope** | Pointer to **string** | A space-delimited list of authorization scope. | [optional] [default to "global"] +**ExpiresAt** | Pointer to **string** | A UTC time-stamp of when the token expires. | [optional] +**CreatedAt** | Pointer to **time.Time** | A UTC time-stamp of when the token was created. | [optional] [readonly] +**DeletedAt** | Pointer to **NullableTime** | Date and time in ISO 8601 format. | [optional] [readonly] +**UpdatedAt** | Pointer to **NullableTime** | Date and time in ISO 8601 format. | [optional] [readonly] +**ID** | Pointer to [**ReadOnlyID**](ReadOnlyID.md) | | [optional] +**UserID** | Pointer to [**ReadOnlyUserID**](ReadOnlyUserID.md) | | [optional] +**CustomerID** | Pointer to [**ReadOnlyCustomerID**](ReadOnlyCustomerID.md) | | [optional] +**SudoExpiresAt** | Pointer to **time.Time** | | [optional] [readonly] +**AccessToken** | Pointer to **string** | | [optional] [readonly] +**LastUsedAt** | Pointer to **time.Time** | A UTC time-stamp of when the token was last used. | [optional] [readonly] +**UserAgent** | Pointer to **string** | The User-Agent header of the client that last used the token. | [optional] + +## Methods + +### NewAutomationTokenCreateResponse + +`func NewAutomationTokenCreateResponse() *AutomationTokenCreateResponse` + +NewAutomationTokenCreateResponse instantiates a new AutomationTokenCreateResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAutomationTokenCreateResponseWithDefaults + +`func NewAutomationTokenCreateResponseWithDefaults() *AutomationTokenCreateResponse` + +NewAutomationTokenCreateResponseWithDefaults instantiates a new AutomationTokenCreateResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *AutomationTokenCreateResponse) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *AutomationTokenCreateResponse) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *AutomationTokenCreateResponse) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *AutomationTokenCreateResponse) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetRole + +`func (o *AutomationTokenCreateResponse) GetRole() string` + +GetRole returns the Role field if non-nil, zero value otherwise. + +### GetRoleOk + +`func (o *AutomationTokenCreateResponse) GetRoleOk() (*string, bool)` + +GetRoleOk returns a tuple with the Role field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRole + +`func (o *AutomationTokenCreateResponse) SetRole(v string)` + +SetRole sets Role field to given value. + +### HasRole + +`func (o *AutomationTokenCreateResponse) HasRole() bool` + +HasRole returns a boolean if a field has been set. + +### GetServices + +`func (o *AutomationTokenCreateResponse) GetServices() []string` + +GetServices returns the Services field if non-nil, zero value otherwise. + +### GetServicesOk + +`func (o *AutomationTokenCreateResponse) GetServicesOk() (*[]string, bool)` + +GetServicesOk returns a tuple with the Services field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServices + +`func (o *AutomationTokenCreateResponse) SetServices(v []string)` + +SetServices sets Services field to given value. + +### HasServices + +`func (o *AutomationTokenCreateResponse) HasServices() bool` + +HasServices returns a boolean if a field has been set. + +### GetScope + +`func (o *AutomationTokenCreateResponse) GetScope() string` + +GetScope returns the Scope field if non-nil, zero value otherwise. + +### GetScopeOk + +`func (o *AutomationTokenCreateResponse) GetScopeOk() (*string, bool)` + +GetScopeOk returns a tuple with the Scope field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetScope + +`func (o *AutomationTokenCreateResponse) SetScope(v string)` + +SetScope sets Scope field to given value. + +### HasScope + +`func (o *AutomationTokenCreateResponse) HasScope() bool` + +HasScope returns a boolean if a field has been set. + +### GetExpiresAt + +`func (o *AutomationTokenCreateResponse) GetExpiresAt() string` + +GetExpiresAt returns the ExpiresAt field if non-nil, zero value otherwise. + +### GetExpiresAtOk + +`func (o *AutomationTokenCreateResponse) GetExpiresAtOk() (*string, bool)` + +GetExpiresAtOk returns a tuple with the ExpiresAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiresAt + +`func (o *AutomationTokenCreateResponse) SetExpiresAt(v string)` + +SetExpiresAt sets ExpiresAt field to given value. + +### HasExpiresAt + +`func (o *AutomationTokenCreateResponse) HasExpiresAt() bool` + +HasExpiresAt returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *AutomationTokenCreateResponse) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *AutomationTokenCreateResponse) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *AutomationTokenCreateResponse) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *AutomationTokenCreateResponse) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetDeletedAt + +`func (o *AutomationTokenCreateResponse) GetDeletedAt() time.Time` + +GetDeletedAt returns the DeletedAt field if non-nil, zero value otherwise. + +### GetDeletedAtOk + +`func (o *AutomationTokenCreateResponse) GetDeletedAtOk() (*time.Time, bool)` + +GetDeletedAtOk returns a tuple with the DeletedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeletedAt + +`func (o *AutomationTokenCreateResponse) SetDeletedAt(v time.Time)` + +SetDeletedAt sets DeletedAt field to given value. + +### HasDeletedAt + +`func (o *AutomationTokenCreateResponse) HasDeletedAt() bool` + +HasDeletedAt returns a boolean if a field has been set. + +### SetDeletedAtNil + +`func (o *AutomationTokenCreateResponse) SetDeletedAtNil(b bool)` + + SetDeletedAtNil sets the value for DeletedAt to be an explicit nil + +### UnsetDeletedAt +`func (o *AutomationTokenCreateResponse) UnsetDeletedAt()` + +UnsetDeletedAt ensures that no value is present for DeletedAt, not even an explicit nil +### GetUpdatedAt + +`func (o *AutomationTokenCreateResponse) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *AutomationTokenCreateResponse) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *AutomationTokenCreateResponse) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *AutomationTokenCreateResponse) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### SetUpdatedAtNil + +`func (o *AutomationTokenCreateResponse) SetUpdatedAtNil(b bool)` + + SetUpdatedAtNil sets the value for UpdatedAt to be an explicit nil + +### UnsetUpdatedAt +`func (o *AutomationTokenCreateResponse) UnsetUpdatedAt()` + +UnsetUpdatedAt ensures that no value is present for UpdatedAt, not even an explicit nil +### GetID + +`func (o *AutomationTokenCreateResponse) GetID() ReadOnlyID` + +GetID returns the ID field if non-nil, zero value otherwise. + +### GetIDOk + +`func (o *AutomationTokenCreateResponse) GetIDOk() (*ReadOnlyID, bool)` + +GetIDOk returns a tuple with the ID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetID + +`func (o *AutomationTokenCreateResponse) SetID(v ReadOnlyID)` + +SetID sets ID field to given value. + +### HasID + +`func (o *AutomationTokenCreateResponse) HasID() bool` + +HasID returns a boolean if a field has been set. + +### GetUserID + +`func (o *AutomationTokenCreateResponse) GetUserID() ReadOnlyUserID` + +GetUserID returns the UserID field if non-nil, zero value otherwise. + +### GetUserIDOk + +`func (o *AutomationTokenCreateResponse) GetUserIDOk() (*ReadOnlyUserID, bool)` + +GetUserIDOk returns a tuple with the UserID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserID + +`func (o *AutomationTokenCreateResponse) SetUserID(v ReadOnlyUserID)` + +SetUserID sets UserID field to given value. + +### HasUserID + +`func (o *AutomationTokenCreateResponse) HasUserID() bool` + +HasUserID returns a boolean if a field has been set. + +### GetCustomerID + +`func (o *AutomationTokenCreateResponse) GetCustomerID() ReadOnlyCustomerID` + +GetCustomerID returns the CustomerID field if non-nil, zero value otherwise. + +### GetCustomerIDOk + +`func (o *AutomationTokenCreateResponse) GetCustomerIDOk() (*ReadOnlyCustomerID, bool)` + +GetCustomerIDOk returns a tuple with the CustomerID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerID + +`func (o *AutomationTokenCreateResponse) SetCustomerID(v ReadOnlyCustomerID)` + +SetCustomerID sets CustomerID field to given value. + +### HasCustomerID + +`func (o *AutomationTokenCreateResponse) HasCustomerID() bool` + +HasCustomerID returns a boolean if a field has been set. + +### GetSudoExpiresAt + +`func (o *AutomationTokenCreateResponse) GetSudoExpiresAt() time.Time` + +GetSudoExpiresAt returns the SudoExpiresAt field if non-nil, zero value otherwise. + +### GetSudoExpiresAtOk + +`func (o *AutomationTokenCreateResponse) GetSudoExpiresAtOk() (*time.Time, bool)` + +GetSudoExpiresAtOk returns a tuple with the SudoExpiresAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSudoExpiresAt + +`func (o *AutomationTokenCreateResponse) SetSudoExpiresAt(v time.Time)` + +SetSudoExpiresAt sets SudoExpiresAt field to given value. + +### HasSudoExpiresAt + +`func (o *AutomationTokenCreateResponse) HasSudoExpiresAt() bool` + +HasSudoExpiresAt returns a boolean if a field has been set. + +### GetAccessToken + +`func (o *AutomationTokenCreateResponse) GetAccessToken() string` + +GetAccessToken returns the AccessToken field if non-nil, zero value otherwise. + +### GetAccessTokenOk + +`func (o *AutomationTokenCreateResponse) GetAccessTokenOk() (*string, bool)` + +GetAccessTokenOk returns a tuple with the AccessToken field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccessToken + +`func (o *AutomationTokenCreateResponse) SetAccessToken(v string)` + +SetAccessToken sets AccessToken field to given value. + +### HasAccessToken + +`func (o *AutomationTokenCreateResponse) HasAccessToken() bool` + +HasAccessToken returns a boolean if a field has been set. + +### GetLastUsedAt + +`func (o *AutomationTokenCreateResponse) GetLastUsedAt() time.Time` + +GetLastUsedAt returns the LastUsedAt field if non-nil, zero value otherwise. + +### GetLastUsedAtOk + +`func (o *AutomationTokenCreateResponse) GetLastUsedAtOk() (*time.Time, bool)` + +GetLastUsedAtOk returns a tuple with the LastUsedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastUsedAt + +`func (o *AutomationTokenCreateResponse) SetLastUsedAt(v time.Time)` + +SetLastUsedAt sets LastUsedAt field to given value. + +### HasLastUsedAt + +`func (o *AutomationTokenCreateResponse) HasLastUsedAt() bool` + +HasLastUsedAt returns a boolean if a field has been set. + +### GetUserAgent + +`func (o *AutomationTokenCreateResponse) GetUserAgent() string` + +GetUserAgent returns the UserAgent field if non-nil, zero value otherwise. + +### GetUserAgentOk + +`func (o *AutomationTokenCreateResponse) GetUserAgentOk() (*string, bool)` + +GetUserAgentOk returns a tuple with the UserAgent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserAgent + +`func (o *AutomationTokenCreateResponse) SetUserAgent(v string)` + +SetUserAgent sets UserAgent field to given value. + +### HasUserAgent + +`func (o *AutomationTokenCreateResponse) HasUserAgent() bool` + +HasUserAgent returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/AutomationTokenCreateResponseAllOf.md b/docs/AutomationTokenCreateResponseAllOf.md new file mode 100644 index 00000000..fdf807cd --- /dev/null +++ b/docs/AutomationTokenCreateResponseAllOf.md @@ -0,0 +1,236 @@ +# AutomationTokenCreateResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ID** | Pointer to [**ReadOnlyID**](ReadOnlyID.md) | | [optional] +**UserID** | Pointer to [**ReadOnlyUserID**](ReadOnlyUserID.md) | | [optional] +**CustomerID** | Pointer to [**ReadOnlyCustomerID**](ReadOnlyCustomerID.md) | | [optional] +**SudoExpiresAt** | Pointer to **time.Time** | | [optional] [readonly] +**CreatedAt** | Pointer to **time.Time** | A UTC time-stamp of when the token was created. | [optional] [readonly] +**AccessToken** | Pointer to **string** | | [optional] [readonly] +**LastUsedAt** | Pointer to **time.Time** | A UTC time-stamp of when the token was last used. | [optional] [readonly] +**UserAgent** | Pointer to **string** | The User-Agent header of the client that last used the token. | [optional] + +## Methods + +### NewAutomationTokenCreateResponseAllOf + +`func NewAutomationTokenCreateResponseAllOf() *AutomationTokenCreateResponseAllOf` + +NewAutomationTokenCreateResponseAllOf instantiates a new AutomationTokenCreateResponseAllOf object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAutomationTokenCreateResponseAllOfWithDefaults + +`func NewAutomationTokenCreateResponseAllOfWithDefaults() *AutomationTokenCreateResponseAllOf` + +NewAutomationTokenCreateResponseAllOfWithDefaults instantiates a new AutomationTokenCreateResponseAllOf object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetID + +`func (o *AutomationTokenCreateResponseAllOf) GetID() ReadOnlyID` + +GetID returns the ID field if non-nil, zero value otherwise. + +### GetIDOk + +`func (o *AutomationTokenCreateResponseAllOf) GetIDOk() (*ReadOnlyID, bool)` + +GetIDOk returns a tuple with the ID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetID + +`func (o *AutomationTokenCreateResponseAllOf) SetID(v ReadOnlyID)` + +SetID sets ID field to given value. + +### HasID + +`func (o *AutomationTokenCreateResponseAllOf) HasID() bool` + +HasID returns a boolean if a field has been set. + +### GetUserID + +`func (o *AutomationTokenCreateResponseAllOf) GetUserID() ReadOnlyUserID` + +GetUserID returns the UserID field if non-nil, zero value otherwise. + +### GetUserIDOk + +`func (o *AutomationTokenCreateResponseAllOf) GetUserIDOk() (*ReadOnlyUserID, bool)` + +GetUserIDOk returns a tuple with the UserID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserID + +`func (o *AutomationTokenCreateResponseAllOf) SetUserID(v ReadOnlyUserID)` + +SetUserID sets UserID field to given value. + +### HasUserID + +`func (o *AutomationTokenCreateResponseAllOf) HasUserID() bool` + +HasUserID returns a boolean if a field has been set. + +### GetCustomerID + +`func (o *AutomationTokenCreateResponseAllOf) GetCustomerID() ReadOnlyCustomerID` + +GetCustomerID returns the CustomerID field if non-nil, zero value otherwise. + +### GetCustomerIDOk + +`func (o *AutomationTokenCreateResponseAllOf) GetCustomerIDOk() (*ReadOnlyCustomerID, bool)` + +GetCustomerIDOk returns a tuple with the CustomerID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerID + +`func (o *AutomationTokenCreateResponseAllOf) SetCustomerID(v ReadOnlyCustomerID)` + +SetCustomerID sets CustomerID field to given value. + +### HasCustomerID + +`func (o *AutomationTokenCreateResponseAllOf) HasCustomerID() bool` + +HasCustomerID returns a boolean if a field has been set. + +### GetSudoExpiresAt + +`func (o *AutomationTokenCreateResponseAllOf) GetSudoExpiresAt() time.Time` + +GetSudoExpiresAt returns the SudoExpiresAt field if non-nil, zero value otherwise. + +### GetSudoExpiresAtOk + +`func (o *AutomationTokenCreateResponseAllOf) GetSudoExpiresAtOk() (*time.Time, bool)` + +GetSudoExpiresAtOk returns a tuple with the SudoExpiresAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSudoExpiresAt + +`func (o *AutomationTokenCreateResponseAllOf) SetSudoExpiresAt(v time.Time)` + +SetSudoExpiresAt sets SudoExpiresAt field to given value. + +### HasSudoExpiresAt + +`func (o *AutomationTokenCreateResponseAllOf) HasSudoExpiresAt() bool` + +HasSudoExpiresAt returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *AutomationTokenCreateResponseAllOf) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *AutomationTokenCreateResponseAllOf) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *AutomationTokenCreateResponseAllOf) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *AutomationTokenCreateResponseAllOf) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetAccessToken + +`func (o *AutomationTokenCreateResponseAllOf) GetAccessToken() string` + +GetAccessToken returns the AccessToken field if non-nil, zero value otherwise. + +### GetAccessTokenOk + +`func (o *AutomationTokenCreateResponseAllOf) GetAccessTokenOk() (*string, bool)` + +GetAccessTokenOk returns a tuple with the AccessToken field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccessToken + +`func (o *AutomationTokenCreateResponseAllOf) SetAccessToken(v string)` + +SetAccessToken sets AccessToken field to given value. + +### HasAccessToken + +`func (o *AutomationTokenCreateResponseAllOf) HasAccessToken() bool` + +HasAccessToken returns a boolean if a field has been set. + +### GetLastUsedAt + +`func (o *AutomationTokenCreateResponseAllOf) GetLastUsedAt() time.Time` + +GetLastUsedAt returns the LastUsedAt field if non-nil, zero value otherwise. + +### GetLastUsedAtOk + +`func (o *AutomationTokenCreateResponseAllOf) GetLastUsedAtOk() (*time.Time, bool)` + +GetLastUsedAtOk returns a tuple with the LastUsedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastUsedAt + +`func (o *AutomationTokenCreateResponseAllOf) SetLastUsedAt(v time.Time)` + +SetLastUsedAt sets LastUsedAt field to given value. + +### HasLastUsedAt + +`func (o *AutomationTokenCreateResponseAllOf) HasLastUsedAt() bool` + +HasLastUsedAt returns a boolean if a field has been set. + +### GetUserAgent + +`func (o *AutomationTokenCreateResponseAllOf) GetUserAgent() string` + +GetUserAgent returns the UserAgent field if non-nil, zero value otherwise. + +### GetUserAgentOk + +`func (o *AutomationTokenCreateResponseAllOf) GetUserAgentOk() (*string, bool)` + +GetUserAgentOk returns a tuple with the UserAgent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserAgent + +`func (o *AutomationTokenCreateResponseAllOf) SetUserAgent(v string)` + +SetUserAgent sets UserAgent field to given value. + +### HasUserAgent + +`func (o *AutomationTokenCreateResponseAllOf) HasUserAgent() bool` + +HasUserAgent returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/AutomationTokenResponse.md b/docs/AutomationTokenResponse.md new file mode 100644 index 00000000..9ed4143b --- /dev/null +++ b/docs/AutomationTokenResponse.md @@ -0,0 +1,412 @@ +# AutomationTokenResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | The name of the token. | [optional] +**Role** | Pointer to **string** | | [optional] +**Services** | Pointer to **[]string** | (Optional) The service IDs of the services the token will have access to. Separate service IDs with a space. If no services are specified, the token will have access to all services on the account. | [optional] +**Scope** | Pointer to **string** | A space-delimited list of authorization scope. | [optional] [default to "global"] +**ExpiresAt** | Pointer to **string** | (optional) A UTC time-stamp of when the token will expire. | [optional] +**CreatedAt** | Pointer to **string** | A UTC time-stamp of when the token was created. | [optional] +**DeletedAt** | Pointer to **NullableTime** | Date and time in ISO 8601 format. | [optional] [readonly] +**UpdatedAt** | Pointer to **NullableTime** | Date and time in ISO 8601 format. | [optional] [readonly] +**ID** | Pointer to [**ReadOnlyID**](ReadOnlyID.md) | | [optional] +**CustomerID** | Pointer to [**ReadOnlyCustomerID**](ReadOnlyCustomerID.md) | | [optional] +**IP** | Pointer to **string** | The IP address of the client that last used the token. | [optional] +**UserAgent** | Pointer to **string** | The User-Agent header of the client that last used the token. | [optional] +**SudoExpiresAt** | Pointer to **string** | | [optional] [readonly] +**LastUsedAt** | Pointer to **time.Time** | A UTC time-stamp of when the token was last used. | [optional] [readonly] + +## Methods + +### NewAutomationTokenResponse + +`func NewAutomationTokenResponse() *AutomationTokenResponse` + +NewAutomationTokenResponse instantiates a new AutomationTokenResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAutomationTokenResponseWithDefaults + +`func NewAutomationTokenResponseWithDefaults() *AutomationTokenResponse` + +NewAutomationTokenResponseWithDefaults instantiates a new AutomationTokenResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *AutomationTokenResponse) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *AutomationTokenResponse) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *AutomationTokenResponse) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *AutomationTokenResponse) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetRole + +`func (o *AutomationTokenResponse) GetRole() string` + +GetRole returns the Role field if non-nil, zero value otherwise. + +### GetRoleOk + +`func (o *AutomationTokenResponse) GetRoleOk() (*string, bool)` + +GetRoleOk returns a tuple with the Role field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRole + +`func (o *AutomationTokenResponse) SetRole(v string)` + +SetRole sets Role field to given value. + +### HasRole + +`func (o *AutomationTokenResponse) HasRole() bool` + +HasRole returns a boolean if a field has been set. + +### GetServices + +`func (o *AutomationTokenResponse) GetServices() []string` + +GetServices returns the Services field if non-nil, zero value otherwise. + +### GetServicesOk + +`func (o *AutomationTokenResponse) GetServicesOk() (*[]string, bool)` + +GetServicesOk returns a tuple with the Services field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServices + +`func (o *AutomationTokenResponse) SetServices(v []string)` + +SetServices sets Services field to given value. + +### HasServices + +`func (o *AutomationTokenResponse) HasServices() bool` + +HasServices returns a boolean if a field has been set. + +### GetScope + +`func (o *AutomationTokenResponse) GetScope() string` + +GetScope returns the Scope field if non-nil, zero value otherwise. + +### GetScopeOk + +`func (o *AutomationTokenResponse) GetScopeOk() (*string, bool)` + +GetScopeOk returns a tuple with the Scope field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetScope + +`func (o *AutomationTokenResponse) SetScope(v string)` + +SetScope sets Scope field to given value. + +### HasScope + +`func (o *AutomationTokenResponse) HasScope() bool` + +HasScope returns a boolean if a field has been set. + +### GetExpiresAt + +`func (o *AutomationTokenResponse) GetExpiresAt() string` + +GetExpiresAt returns the ExpiresAt field if non-nil, zero value otherwise. + +### GetExpiresAtOk + +`func (o *AutomationTokenResponse) GetExpiresAtOk() (*string, bool)` + +GetExpiresAtOk returns a tuple with the ExpiresAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiresAt + +`func (o *AutomationTokenResponse) SetExpiresAt(v string)` + +SetExpiresAt sets ExpiresAt field to given value. + +### HasExpiresAt + +`func (o *AutomationTokenResponse) HasExpiresAt() bool` + +HasExpiresAt returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *AutomationTokenResponse) GetCreatedAt() string` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *AutomationTokenResponse) GetCreatedAtOk() (*string, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *AutomationTokenResponse) SetCreatedAt(v string)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *AutomationTokenResponse) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetDeletedAt + +`func (o *AutomationTokenResponse) GetDeletedAt() time.Time` + +GetDeletedAt returns the DeletedAt field if non-nil, zero value otherwise. + +### GetDeletedAtOk + +`func (o *AutomationTokenResponse) GetDeletedAtOk() (*time.Time, bool)` + +GetDeletedAtOk returns a tuple with the DeletedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeletedAt + +`func (o *AutomationTokenResponse) SetDeletedAt(v time.Time)` + +SetDeletedAt sets DeletedAt field to given value. + +### HasDeletedAt + +`func (o *AutomationTokenResponse) HasDeletedAt() bool` + +HasDeletedAt returns a boolean if a field has been set. + +### SetDeletedAtNil + +`func (o *AutomationTokenResponse) SetDeletedAtNil(b bool)` + + SetDeletedAtNil sets the value for DeletedAt to be an explicit nil + +### UnsetDeletedAt +`func (o *AutomationTokenResponse) UnsetDeletedAt()` + +UnsetDeletedAt ensures that no value is present for DeletedAt, not even an explicit nil +### GetUpdatedAt + +`func (o *AutomationTokenResponse) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *AutomationTokenResponse) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *AutomationTokenResponse) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *AutomationTokenResponse) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### SetUpdatedAtNil + +`func (o *AutomationTokenResponse) SetUpdatedAtNil(b bool)` + + SetUpdatedAtNil sets the value for UpdatedAt to be an explicit nil + +### UnsetUpdatedAt +`func (o *AutomationTokenResponse) UnsetUpdatedAt()` + +UnsetUpdatedAt ensures that no value is present for UpdatedAt, not even an explicit nil +### GetID + +`func (o *AutomationTokenResponse) GetID() ReadOnlyID` + +GetID returns the ID field if non-nil, zero value otherwise. + +### GetIDOk + +`func (o *AutomationTokenResponse) GetIDOk() (*ReadOnlyID, bool)` + +GetIDOk returns a tuple with the ID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetID + +`func (o *AutomationTokenResponse) SetID(v ReadOnlyID)` + +SetID sets ID field to given value. + +### HasID + +`func (o *AutomationTokenResponse) HasID() bool` + +HasID returns a boolean if a field has been set. + +### GetCustomerID + +`func (o *AutomationTokenResponse) GetCustomerID() ReadOnlyCustomerID` + +GetCustomerID returns the CustomerID field if non-nil, zero value otherwise. + +### GetCustomerIDOk + +`func (o *AutomationTokenResponse) GetCustomerIDOk() (*ReadOnlyCustomerID, bool)` + +GetCustomerIDOk returns a tuple with the CustomerID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerID + +`func (o *AutomationTokenResponse) SetCustomerID(v ReadOnlyCustomerID)` + +SetCustomerID sets CustomerID field to given value. + +### HasCustomerID + +`func (o *AutomationTokenResponse) HasCustomerID() bool` + +HasCustomerID returns a boolean if a field has been set. + +### GetIP + +`func (o *AutomationTokenResponse) GetIP() string` + +GetIP returns the IP field if non-nil, zero value otherwise. + +### GetIPOk + +`func (o *AutomationTokenResponse) GetIPOk() (*string, bool)` + +GetIPOk returns a tuple with the IP field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIP + +`func (o *AutomationTokenResponse) SetIP(v string)` + +SetIP sets IP field to given value. + +### HasIP + +`func (o *AutomationTokenResponse) HasIP() bool` + +HasIP returns a boolean if a field has been set. + +### GetUserAgent + +`func (o *AutomationTokenResponse) GetUserAgent() string` + +GetUserAgent returns the UserAgent field if non-nil, zero value otherwise. + +### GetUserAgentOk + +`func (o *AutomationTokenResponse) GetUserAgentOk() (*string, bool)` + +GetUserAgentOk returns a tuple with the UserAgent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserAgent + +`func (o *AutomationTokenResponse) SetUserAgent(v string)` + +SetUserAgent sets UserAgent field to given value. + +### HasUserAgent + +`func (o *AutomationTokenResponse) HasUserAgent() bool` + +HasUserAgent returns a boolean if a field has been set. + +### GetSudoExpiresAt + +`func (o *AutomationTokenResponse) GetSudoExpiresAt() string` + +GetSudoExpiresAt returns the SudoExpiresAt field if non-nil, zero value otherwise. + +### GetSudoExpiresAtOk + +`func (o *AutomationTokenResponse) GetSudoExpiresAtOk() (*string, bool)` + +GetSudoExpiresAtOk returns a tuple with the SudoExpiresAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSudoExpiresAt + +`func (o *AutomationTokenResponse) SetSudoExpiresAt(v string)` + +SetSudoExpiresAt sets SudoExpiresAt field to given value. + +### HasSudoExpiresAt + +`func (o *AutomationTokenResponse) HasSudoExpiresAt() bool` + +HasSudoExpiresAt returns a boolean if a field has been set. + +### GetLastUsedAt + +`func (o *AutomationTokenResponse) GetLastUsedAt() time.Time` + +GetLastUsedAt returns the LastUsedAt field if non-nil, zero value otherwise. + +### GetLastUsedAtOk + +`func (o *AutomationTokenResponse) GetLastUsedAtOk() (*time.Time, bool)` + +GetLastUsedAtOk returns a tuple with the LastUsedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastUsedAt + +`func (o *AutomationTokenResponse) SetLastUsedAt(v time.Time)` + +SetLastUsedAt sets LastUsedAt field to given value. + +### HasLastUsedAt + +`func (o *AutomationTokenResponse) HasLastUsedAt() bool` + +HasLastUsedAt returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/AutomationTokenResponseAllOf.md b/docs/AutomationTokenResponseAllOf.md new file mode 100644 index 00000000..2961f76c --- /dev/null +++ b/docs/AutomationTokenResponseAllOf.md @@ -0,0 +1,262 @@ +# AutomationTokenResponseAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ID** | Pointer to [**ReadOnlyID**](ReadOnlyID.md) | | [optional] +**CustomerID** | Pointer to [**ReadOnlyCustomerID**](ReadOnlyCustomerID.md) | | [optional] +**Role** | Pointer to **string** | | [optional] +**IP** | Pointer to **string** | The IP address of the client that last used the token. | [optional] +**UserAgent** | Pointer to **string** | The User-Agent header of the client that last used the token. | [optional] +**SudoExpiresAt** | Pointer to **string** | | [optional] [readonly] +**LastUsedAt** | Pointer to **time.Time** | A UTC time-stamp of when the token was last used. | [optional] [readonly] +**CreatedAt** | Pointer to **string** | A UTC time-stamp of when the token was created. | [optional] +**ExpiresAt** | Pointer to **string** | (optional) A UTC time-stamp of when the token will expire. | [optional] + +## Methods + +### NewAutomationTokenResponseAllOf + +`func NewAutomationTokenResponseAllOf() *AutomationTokenResponseAllOf` + +NewAutomationTokenResponseAllOf instantiates a new AutomationTokenResponseAllOf object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAutomationTokenResponseAllOfWithDefaults + +`func NewAutomationTokenResponseAllOfWithDefaults() *AutomationTokenResponseAllOf` + +NewAutomationTokenResponseAllOfWithDefaults instantiates a new AutomationTokenResponseAllOf object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetID + +`func (o *AutomationTokenResponseAllOf) GetID() ReadOnlyID` + +GetID returns the ID field if non-nil, zero value otherwise. + +### GetIDOk + +`func (o *AutomationTokenResponseAllOf) GetIDOk() (*ReadOnlyID, bool)` + +GetIDOk returns a tuple with the ID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetID + +`func (o *AutomationTokenResponseAllOf) SetID(v ReadOnlyID)` + +SetID sets ID field to given value. + +### HasID + +`func (o *AutomationTokenResponseAllOf) HasID() bool` + +HasID returns a boolean if a field has been set. + +### GetCustomerID + +`func (o *AutomationTokenResponseAllOf) GetCustomerID() ReadOnlyCustomerID` + +GetCustomerID returns the CustomerID field if non-nil, zero value otherwise. + +### GetCustomerIDOk + +`func (o *AutomationTokenResponseAllOf) GetCustomerIDOk() (*ReadOnlyCustomerID, bool)` + +GetCustomerIDOk returns a tuple with the CustomerID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerID + +`func (o *AutomationTokenResponseAllOf) SetCustomerID(v ReadOnlyCustomerID)` + +SetCustomerID sets CustomerID field to given value. + +### HasCustomerID + +`func (o *AutomationTokenResponseAllOf) HasCustomerID() bool` + +HasCustomerID returns a boolean if a field has been set. + +### GetRole + +`func (o *AutomationTokenResponseAllOf) GetRole() string` + +GetRole returns the Role field if non-nil, zero value otherwise. + +### GetRoleOk + +`func (o *AutomationTokenResponseAllOf) GetRoleOk() (*string, bool)` + +GetRoleOk returns a tuple with the Role field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRole + +`func (o *AutomationTokenResponseAllOf) SetRole(v string)` + +SetRole sets Role field to given value. + +### HasRole + +`func (o *AutomationTokenResponseAllOf) HasRole() bool` + +HasRole returns a boolean if a field has been set. + +### GetIP + +`func (o *AutomationTokenResponseAllOf) GetIP() string` + +GetIP returns the IP field if non-nil, zero value otherwise. + +### GetIPOk + +`func (o *AutomationTokenResponseAllOf) GetIPOk() (*string, bool)` + +GetIPOk returns a tuple with the IP field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIP + +`func (o *AutomationTokenResponseAllOf) SetIP(v string)` + +SetIP sets IP field to given value. + +### HasIP + +`func (o *AutomationTokenResponseAllOf) HasIP() bool` + +HasIP returns a boolean if a field has been set. + +### GetUserAgent + +`func (o *AutomationTokenResponseAllOf) GetUserAgent() string` + +GetUserAgent returns the UserAgent field if non-nil, zero value otherwise. + +### GetUserAgentOk + +`func (o *AutomationTokenResponseAllOf) GetUserAgentOk() (*string, bool)` + +GetUserAgentOk returns a tuple with the UserAgent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserAgent + +`func (o *AutomationTokenResponseAllOf) SetUserAgent(v string)` + +SetUserAgent sets UserAgent field to given value. + +### HasUserAgent + +`func (o *AutomationTokenResponseAllOf) HasUserAgent() bool` + +HasUserAgent returns a boolean if a field has been set. + +### GetSudoExpiresAt + +`func (o *AutomationTokenResponseAllOf) GetSudoExpiresAt() string` + +GetSudoExpiresAt returns the SudoExpiresAt field if non-nil, zero value otherwise. + +### GetSudoExpiresAtOk + +`func (o *AutomationTokenResponseAllOf) GetSudoExpiresAtOk() (*string, bool)` + +GetSudoExpiresAtOk returns a tuple with the SudoExpiresAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSudoExpiresAt + +`func (o *AutomationTokenResponseAllOf) SetSudoExpiresAt(v string)` + +SetSudoExpiresAt sets SudoExpiresAt field to given value. + +### HasSudoExpiresAt + +`func (o *AutomationTokenResponseAllOf) HasSudoExpiresAt() bool` + +HasSudoExpiresAt returns a boolean if a field has been set. + +### GetLastUsedAt + +`func (o *AutomationTokenResponseAllOf) GetLastUsedAt() time.Time` + +GetLastUsedAt returns the LastUsedAt field if non-nil, zero value otherwise. + +### GetLastUsedAtOk + +`func (o *AutomationTokenResponseAllOf) GetLastUsedAtOk() (*time.Time, bool)` + +GetLastUsedAtOk returns a tuple with the LastUsedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastUsedAt + +`func (o *AutomationTokenResponseAllOf) SetLastUsedAt(v time.Time)` + +SetLastUsedAt sets LastUsedAt field to given value. + +### HasLastUsedAt + +`func (o *AutomationTokenResponseAllOf) HasLastUsedAt() bool` + +HasLastUsedAt returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *AutomationTokenResponseAllOf) GetCreatedAt() string` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *AutomationTokenResponseAllOf) GetCreatedAtOk() (*string, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *AutomationTokenResponseAllOf) SetCreatedAt(v string)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *AutomationTokenResponseAllOf) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetExpiresAt + +`func (o *AutomationTokenResponseAllOf) GetExpiresAt() string` + +GetExpiresAt returns the ExpiresAt field if non-nil, zero value otherwise. + +### GetExpiresAtOk + +`func (o *AutomationTokenResponseAllOf) GetExpiresAtOk() (*string, bool)` + +GetExpiresAtOk returns a tuple with the ExpiresAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiresAt + +`func (o *AutomationTokenResponseAllOf) SetExpiresAt(v string)` + +SetExpiresAt sets ExpiresAt field to given value. + +### HasExpiresAt + +`func (o *AutomationTokenResponseAllOf) HasExpiresAt() bool` + +HasExpiresAt returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/AutomationTokensAPI.md b/docs/AutomationTokensAPI.md new file mode 100644 index 00000000..cfdbe6b6 --- /dev/null +++ b/docs/AutomationTokensAPI.md @@ -0,0 +1,342 @@ +# AutomationTokensAPI + +All URIs are relative to *https://api.fastly.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateAutomationToken**](AutomationTokensAPI.md#CreateAutomationToken) | **POST** `/automation-tokens` | Create Automation Token +[**GetAutomationTokenID**](AutomationTokensAPI.md#GetAutomationTokenID) | **GET** `/automation-tokens/{id}` | Retrieve an Automation Token by ID +[**GetAutomationTokensIDServices**](AutomationTokensAPI.md#GetAutomationTokensIDServices) | **GET** `/automation-tokens/{id}/services` | List Automation Token Services +[**ListAutomationTokens**](AutomationTokensAPI.md#ListAutomationTokens) | **GET** `/automation-tokens` | List Customer Automation Tokens +[**RevokeAutomationTokenID**](AutomationTokensAPI.md#RevokeAutomationTokenID) | **DELETE** `/automation-tokens/{id}` | Revoke an Automation Token by ID + + + +## CreateAutomationToken + +Create Automation Token + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "github.com/fastly/fastly-go/fastly" +) + +func main() { + automationTokenCreateRequest := *openapiclient.NewAutomationTokenCreateRequest() // AutomationTokenCreateRequest | (optional) + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.AutomationTokensAPI.CreateAutomationToken(ctx).AutomationTokenCreateRequest(automationTokenCreateRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AutomationTokensAPI.CreateAutomationToken`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateAutomationToken`: AutomationTokenCreateResponse + fmt.Fprintf(os.Stdout, "Response from `AutomationTokensAPI.CreateAutomationToken`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateAutomationTokenRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **automationTokenCreateRequest** | [**AutomationTokenCreateRequest**](AutomationTokenCreateRequest.md) | | + +### Return type + +[**AutomationTokenCreateResponse**](AutomationTokenCreateResponse.md) + +### Authorization + +[API Token](https://developer.fastly.com/reference/api/#authentication) + +### HTTP request headers + +- **Content-Type**: application/vnd.api+json +- **Accept**: application/vnd.api+json + +[Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) + + +## GetAutomationTokenID + +Retrieve an Automation Token by ID + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "github.com/fastly/fastly-go/fastly" +) + +func main() { + id := "id_example" // string | + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.AutomationTokensAPI.GetAutomationTokenID(ctx, id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AutomationTokensAPI.GetAutomationTokenID`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetAutomationTokenID`: AutomationTokenResponse + fmt.Fprintf(os.Stdout, "Response from `AutomationTokensAPI.GetAutomationTokenID`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetAutomationTokenIDRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**AutomationTokenResponse**](AutomationTokenResponse.md) + +### Authorization + +[API Token](https://developer.fastly.com/reference/api/#authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/problem+json + +[Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) + + +## GetAutomationTokensIDServices + +List Automation Token Services + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "github.com/fastly/fastly-go/fastly" +) + +func main() { + id := "id_example" // string | + perPage := int32(56) // int32 | (optional) + page := int32(56) // int32 | (optional) + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.AutomationTokensAPI.GetAutomationTokensIDServices(ctx, id).PerPage(perPage).Page(page).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AutomationTokensAPI.GetAutomationTokensIDServices`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetAutomationTokensIDServices`: InlineResponse2001 + fmt.Fprintf(os.Stdout, "Response from `AutomationTokensAPI.GetAutomationTokensIDServices`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetAutomationTokensIDServicesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **perPage** | **int32** | | **page** | **int32** | | + +### Return type + +[**InlineResponse2001**](InlineResponse2001.md) + +### Authorization + +[API Token](https://developer.fastly.com/reference/api/#authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/problem+json + +[Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) + + +## ListAutomationTokens + +List Customer Automation Tokens + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "github.com/fastly/fastly-go/fastly" +) + +func main() { + perPage := int32(56) // int32 | (optional) + page := int32(56) // int32 | (optional) + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.AutomationTokensAPI.ListAutomationTokens(ctx).PerPage(perPage).Page(page).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AutomationTokensAPI.ListAutomationTokens`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ListAutomationTokens`: []AutomationTokenResponse + fmt.Fprintf(os.Stdout, "Response from `AutomationTokensAPI.ListAutomationTokens`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiListAutomationTokensRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **perPage** | **int32** | | **page** | **int32** | | + +### Return type + +[**[]AutomationTokenResponse**](AutomationTokenResponse.md) + +### Authorization + +[API Token](https://developer.fastly.com/reference/api/#authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/problem+json + +[Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) + + +## RevokeAutomationTokenID + +Revoke an Automation Token by ID + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "github.com/fastly/fastly-go/fastly" +) + +func main() { + id := "id_example" // string | + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.AutomationTokensAPI.RevokeAutomationTokenID(ctx, id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AutomationTokensAPI.RevokeAutomationTokenID`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RevokeAutomationTokenID`: ErrorResponse + fmt.Fprintf(os.Stdout, "Response from `AutomationTokensAPI.RevokeAutomationTokenID`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiRevokeAutomationTokenIDRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**ErrorResponse**](ErrorResponse.md) + +### Authorization + +[API Token](https://developer.fastly.com/reference/api/#authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/problem+json + +[Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/DomainOwnershipsAPI.md b/docs/DomainOwnershipsAPI.md index 1b7b0177..8c77ea84 100644 --- a/docs/DomainOwnershipsAPI.md +++ b/docs/DomainOwnershipsAPI.md @@ -36,7 +36,7 @@ func main() { fmt.Fprintf(os.Stderr, "Error when calling `DomainOwnershipsAPI.ListDomainOwnerships`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `ListDomainOwnerships`: InlineResponse2001 + // response from `ListDomainOwnerships`: InlineResponse2002 fmt.Fprintf(os.Stdout, "Response from `DomainOwnershipsAPI.ListDomainOwnerships`: %v\n", resp) } ``` @@ -53,7 +53,7 @@ Other parameters are passed through a pointer to a apiListDomainOwnershipsReques ### Return type -[**InlineResponse2001**](InlineResponse2001.md) +[**InlineResponse2002**](InlineResponse2002.md) ### Authorization diff --git a/docs/ErrorResponse.md b/docs/ErrorResponse.md new file mode 100644 index 00000000..1170788e --- /dev/null +++ b/docs/ErrorResponse.md @@ -0,0 +1,132 @@ +# ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Detail** | Pointer to **string** | | [optional] +**Errors** | Pointer to **[]any** | | [optional] +**Status** | Pointer to **int32** | | [optional] +**Title** | Pointer to **string** | | [optional] + +## Methods + +### NewErrorResponse + +`func NewErrorResponse() *ErrorResponse` + +NewErrorResponse instantiates a new ErrorResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewErrorResponseWithDefaults + +`func NewErrorResponseWithDefaults() *ErrorResponse` + +NewErrorResponseWithDefaults instantiates a new ErrorResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDetail + +`func (o *ErrorResponse) GetDetail() string` + +GetDetail returns the Detail field if non-nil, zero value otherwise. + +### GetDetailOk + +`func (o *ErrorResponse) GetDetailOk() (*string, bool)` + +GetDetailOk returns a tuple with the Detail field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDetail + +`func (o *ErrorResponse) SetDetail(v string)` + +SetDetail sets Detail field to given value. + +### HasDetail + +`func (o *ErrorResponse) HasDetail() bool` + +HasDetail returns a boolean if a field has been set. + +### GetErrors + +`func (o *ErrorResponse) GetErrors() []any` + +GetErrors returns the Errors field if non-nil, zero value otherwise. + +### GetErrorsOk + +`func (o *ErrorResponse) GetErrorsOk() (*[]any, bool)` + +GetErrorsOk returns a tuple with the Errors field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrors + +`func (o *ErrorResponse) SetErrors(v []any)` + +SetErrors sets Errors field to given value. + +### HasErrors + +`func (o *ErrorResponse) HasErrors() bool` + +HasErrors returns a boolean if a field has been set. + +### GetStatus + +`func (o *ErrorResponse) GetStatus() int32` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *ErrorResponse) GetStatusOk() (*int32, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *ErrorResponse) SetStatus(v int32)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *ErrorResponse) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetTitle + +`func (o *ErrorResponse) GetTitle() string` + +GetTitle returns the Title field if non-nil, zero value otherwise. + +### GetTitleOk + +`func (o *ErrorResponse) GetTitleOk() (*string, bool)` + +GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTitle + +`func (o *ErrorResponse) SetTitle(v string)` + +SetTitle sets Title field to given value. + +### HasTitle + +`func (o *ErrorResponse) HasTitle() bool` + +HasTitle returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/HistoricalFieldResultsAttributes.md b/docs/HistoricalFieldResultsAttributes.md index af5f214f..36202d7d 100644 --- a/docs/HistoricalFieldResultsAttributes.md +++ b/docs/HistoricalFieldResultsAttributes.md @@ -220,7 +220,7 @@ Name | Type | Description | Notes **DdosActionTarpit** | Pointer to **int32** | The number of times the tarpit action was taken. The tarpit action delays writing the response to the client. | [optional] **DdosActionClose** | Pointer to **int32** | The number of times the close action was taken. The close action aborts the connection as soon as possible. The close action takes effect either right after accept, right after the client hello, or right after the response was sent. | [optional] **DdosActionBlackhole** | Pointer to **int32** | The number of times the blackhole action was taken. The blackhole action quietly closes a TCP connection without sending a reset. The blackhole action quietly closes a TCP connection without notifying its peer (all TCP state is dropped). | [optional] -**ServiceID** | Pointer to **string** | | [optional] [readonly] +**ServiceID** | Pointer to [**ReadOnlyIDService**](ReadOnlyIDService.md) | | [optional] **StartTime** | Pointer to **int32** | | [optional] ## Methods @@ -5654,20 +5654,20 @@ HasDdosActionBlackhole returns a boolean if a field has been set. ### GetServiceID -`func (o *HistoricalFieldResultsAttributes) GetServiceID() string` +`func (o *HistoricalFieldResultsAttributes) GetServiceID() ReadOnlyIDService` GetServiceID returns the ServiceID field if non-nil, zero value otherwise. ### GetServiceIDOk -`func (o *HistoricalFieldResultsAttributes) GetServiceIDOk() (*string, bool)` +`func (o *HistoricalFieldResultsAttributes) GetServiceIDOk() (*ReadOnlyIDService, bool)` GetServiceIDOk returns a tuple with the ServiceID field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetServiceID -`func (o *HistoricalFieldResultsAttributes) SetServiceID(v string)` +`func (o *HistoricalFieldResultsAttributes) SetServiceID(v ReadOnlyIDService)` SetServiceID sets ServiceID field to given value. @@ -5677,16 +5677,6 @@ SetServiceID sets ServiceID field to given value. HasServiceID returns a boolean if a field has been set. -### SetServiceIDNil - -`func (o *HistoricalFieldResultsAttributes) SetServiceIDNil(b bool)` - - SetServiceIDNil sets the value for ServiceID to be an explicit nil - -### UnsetServiceID -`func (o *HistoricalFieldResultsAttributes) UnsetServiceID()` - -UnsetServiceID ensures that no value is present for ServiceID, not even an explicit nil ### GetStartTime `func (o *HistoricalFieldResultsAttributes) GetStartTime() int32` diff --git a/docs/HistoricalFieldResultsAttributesAllOf.md b/docs/HistoricalFieldResultsAttributesAllOf.md index 158fc0e5..8642f35c 100644 --- a/docs/HistoricalFieldResultsAttributesAllOf.md +++ b/docs/HistoricalFieldResultsAttributesAllOf.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ServiceID** | Pointer to **string** | | [optional] [readonly] +**ServiceID** | Pointer to [**ReadOnlyIDService**](ReadOnlyIDService.md) | | [optional] **StartTime** | Pointer to **int32** | | [optional] ## Methods @@ -28,20 +28,20 @@ but it doesn't guarantee that properties required by API are set ### GetServiceID -`func (o *HistoricalFieldResultsAttributesAllOf) GetServiceID() string` +`func (o *HistoricalFieldResultsAttributesAllOf) GetServiceID() ReadOnlyIDService` GetServiceID returns the ServiceID field if non-nil, zero value otherwise. ### GetServiceIDOk -`func (o *HistoricalFieldResultsAttributesAllOf) GetServiceIDOk() (*string, bool)` +`func (o *HistoricalFieldResultsAttributesAllOf) GetServiceIDOk() (*ReadOnlyIDService, bool)` GetServiceIDOk returns a tuple with the ServiceID field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetServiceID -`func (o *HistoricalFieldResultsAttributesAllOf) SetServiceID(v string)` +`func (o *HistoricalFieldResultsAttributesAllOf) SetServiceID(v ReadOnlyIDService)` SetServiceID sets ServiceID field to given value. @@ -51,16 +51,6 @@ SetServiceID sets ServiceID field to given value. HasServiceID returns a boolean if a field has been set. -### SetServiceIDNil - -`func (o *HistoricalFieldResultsAttributesAllOf) SetServiceIDNil(b bool)` - - SetServiceIDNil sets the value for ServiceID to be an explicit nil - -### UnsetServiceID -`func (o *HistoricalFieldResultsAttributesAllOf) UnsetServiceID()` - -UnsetServiceID ensures that no value is present for ServiceID, not even an explicit nil ### GetStartTime `func (o *HistoricalFieldResultsAttributesAllOf) GetStartTime() int32` diff --git a/docs/InlineResponse2001.md b/docs/InlineResponse2001.md index 2450a2e5..eeafae79 100644 --- a/docs/InlineResponse2001.md +++ b/docs/InlineResponse2001.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ExpiresAt** | Pointer to **string** | Time-stamp (GMT) when the domain_ownership validation will expire. | [optional] [readonly] +**Data** | Pointer to **[]string** | The service IDs of the services the token will have access to. Separate service IDs with a space. | [optional] ## Methods @@ -25,30 +25,30 @@ NewInlineResponse2001WithDefaults instantiates a new InlineResponse2001 object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetExpiresAt +### GetData -`func (o *InlineResponse2001) GetExpiresAt() string` +`func (o *InlineResponse2001) GetData() []string` -GetExpiresAt returns the ExpiresAt field if non-nil, zero value otherwise. +GetData returns the Data field if non-nil, zero value otherwise. -### GetExpiresAtOk +### GetDataOk -`func (o *InlineResponse2001) GetExpiresAtOk() (*string, bool)` +`func (o *InlineResponse2001) GetDataOk() (*[]string, bool)` -GetExpiresAtOk returns a tuple with the ExpiresAt field if it's non-nil, zero value otherwise +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetExpiresAt +### SetData -`func (o *InlineResponse2001) SetExpiresAt(v string)` +`func (o *InlineResponse2001) SetData(v []string)` -SetExpiresAt sets ExpiresAt field to given value. +SetData sets Data field to given value. -### HasExpiresAt +### HasData -`func (o *InlineResponse2001) HasExpiresAt() bool` +`func (o *InlineResponse2001) HasData() bool` -HasExpiresAt returns a boolean if a field has been set. +HasData returns a boolean if a field has been set. [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/InlineResponse2002.md b/docs/InlineResponse2002.md index aa251d17..1a2c9ac8 100644 --- a/docs/InlineResponse2002.md +++ b/docs/InlineResponse2002.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Data** | Pointer to [**[]StoreResponse**](StoreResponse.md) | | [optional] -**Meta** | Pointer to [**InlineResponse2002Meta**](InlineResponse2002Meta.md) | | [optional] +**ExpiresAt** | Pointer to **string** | Time-stamp (GMT) when the domain_ownership validation will expire. | [optional] [readonly] ## Methods @@ -26,55 +25,30 @@ NewInlineResponse2002WithDefaults instantiates a new InlineResponse2002 object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetData +### GetExpiresAt -`func (o *InlineResponse2002) GetData() []StoreResponse` +`func (o *InlineResponse2002) GetExpiresAt() string` -GetData returns the Data field if non-nil, zero value otherwise. +GetExpiresAt returns the ExpiresAt field if non-nil, zero value otherwise. -### GetDataOk +### GetExpiresAtOk -`func (o *InlineResponse2002) GetDataOk() (*[]StoreResponse, bool)` +`func (o *InlineResponse2002) GetExpiresAtOk() (*string, bool)` -GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +GetExpiresAtOk returns a tuple with the ExpiresAt field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetData +### SetExpiresAt -`func (o *InlineResponse2002) SetData(v []StoreResponse)` +`func (o *InlineResponse2002) SetExpiresAt(v string)` -SetData sets Data field to given value. +SetExpiresAt sets ExpiresAt field to given value. -### HasData +### HasExpiresAt -`func (o *InlineResponse2002) HasData() bool` +`func (o *InlineResponse2002) HasExpiresAt() bool` -HasData returns a boolean if a field has been set. - -### GetMeta - -`func (o *InlineResponse2002) GetMeta() InlineResponse2002Meta` - -GetMeta returns the Meta field if non-nil, zero value otherwise. - -### GetMetaOk - -`func (o *InlineResponse2002) GetMetaOk() (*InlineResponse2002Meta, bool)` - -GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMeta - -`func (o *InlineResponse2002) SetMeta(v InlineResponse2002Meta)` - -SetMeta sets Meta field to given value. - -### HasMeta - -`func (o *InlineResponse2002) HasMeta() bool` - -HasMeta returns a boolean if a field has been set. +HasExpiresAt returns a boolean if a field has been set. [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/InlineResponse2003.md b/docs/InlineResponse2003.md index 47bf2207..516a2710 100644 --- a/docs/InlineResponse2003.md +++ b/docs/InlineResponse2003.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Data** | Pointer to **[]string** | | [optional] +**Data** | Pointer to [**[]StoreResponse**](StoreResponse.md) | | [optional] **Meta** | Pointer to [**InlineResponse2003Meta**](InlineResponse2003Meta.md) | | [optional] ## Methods @@ -28,20 +28,20 @@ but it doesn't guarantee that properties required by API are set ### GetData -`func (o *InlineResponse2003) GetData() []string` +`func (o *InlineResponse2003) GetData() []StoreResponse` GetData returns the Data field if non-nil, zero value otherwise. ### GetDataOk -`func (o *InlineResponse2003) GetDataOk() (*[]string, bool)` +`func (o *InlineResponse2003) GetDataOk() (*[]StoreResponse, bool)` GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetData -`func (o *InlineResponse2003) SetData(v []string)` +`func (o *InlineResponse2003) SetData(v []StoreResponse)` SetData sets Data field to given value. diff --git a/docs/InlineResponse2003Meta.md b/docs/InlineResponse2003Meta.md index 899987d5..9ce3b0b9 100644 --- a/docs/InlineResponse2003Meta.md +++ b/docs/InlineResponse2003Meta.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**NextCursor** | Pointer to **string** | | [optional] -**Limit** | Pointer to **int32** | | [optional] +**NextCursor** | Pointer to **string** | Cursor for the next page. | [optional] +**Limit** | Pointer to **int32** | Entries returned. | [optional] ## Methods diff --git a/docs/InlineResponse2004.md b/docs/InlineResponse2004.md new file mode 100644 index 00000000..a28da2dd --- /dev/null +++ b/docs/InlineResponse2004.md @@ -0,0 +1,80 @@ +# InlineResponse2004 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | Pointer to **[]string** | | [optional] +**Meta** | Pointer to [**InlineResponse2004Meta**](InlineResponse2004Meta.md) | | [optional] + +## Methods + +### NewInlineResponse2004 + +`func NewInlineResponse2004() *InlineResponse2004` + +NewInlineResponse2004 instantiates a new InlineResponse2004 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInlineResponse2004WithDefaults + +`func NewInlineResponse2004WithDefaults() *InlineResponse2004` + +NewInlineResponse2004WithDefaults instantiates a new InlineResponse2004 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *InlineResponse2004) GetData() []string` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *InlineResponse2004) GetDataOk() (*[]string, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *InlineResponse2004) SetData(v []string)` + +SetData sets Data field to given value. + +### HasData + +`func (o *InlineResponse2004) HasData() bool` + +HasData returns a boolean if a field has been set. + +### GetMeta + +`func (o *InlineResponse2004) GetMeta() InlineResponse2004Meta` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *InlineResponse2004) GetMetaOk() (*InlineResponse2004Meta, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *InlineResponse2004) SetMeta(v InlineResponse2004Meta)` + +SetMeta sets Meta field to given value. + +### HasMeta + +`func (o *InlineResponse2004) HasMeta() bool` + +HasMeta returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/InlineResponse2002Meta.md b/docs/InlineResponse2004Meta.md similarity index 59% rename from docs/InlineResponse2002Meta.md rename to docs/InlineResponse2004Meta.md index 24b0536f..2ad3873d 100644 --- a/docs/InlineResponse2002Meta.md +++ b/docs/InlineResponse2004Meta.md @@ -1,78 +1,78 @@ -# InlineResponse2002Meta +# InlineResponse2004Meta ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**NextCursor** | Pointer to **string** | Cursor for the next page. | [optional] -**Limit** | Pointer to **int32** | Entries returned. | [optional] +**NextCursor** | Pointer to **string** | | [optional] +**Limit** | Pointer to **int32** | | [optional] ## Methods -### NewInlineResponse2002Meta +### NewInlineResponse2004Meta -`func NewInlineResponse2002Meta() *InlineResponse2002Meta` +`func NewInlineResponse2004Meta() *InlineResponse2004Meta` -NewInlineResponse2002Meta instantiates a new InlineResponse2002Meta object +NewInlineResponse2004Meta instantiates a new InlineResponse2004Meta object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed -### NewInlineResponse2002MetaWithDefaults +### NewInlineResponse2004MetaWithDefaults -`func NewInlineResponse2002MetaWithDefaults() *InlineResponse2002Meta` +`func NewInlineResponse2004MetaWithDefaults() *InlineResponse2004Meta` -NewInlineResponse2002MetaWithDefaults instantiates a new InlineResponse2002Meta object +NewInlineResponse2004MetaWithDefaults instantiates a new InlineResponse2004Meta object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetNextCursor -`func (o *InlineResponse2002Meta) GetNextCursor() string` +`func (o *InlineResponse2004Meta) GetNextCursor() string` GetNextCursor returns the NextCursor field if non-nil, zero value otherwise. ### GetNextCursorOk -`func (o *InlineResponse2002Meta) GetNextCursorOk() (*string, bool)` +`func (o *InlineResponse2004Meta) GetNextCursorOk() (*string, bool)` GetNextCursorOk returns a tuple with the NextCursor field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetNextCursor -`func (o *InlineResponse2002Meta) SetNextCursor(v string)` +`func (o *InlineResponse2004Meta) SetNextCursor(v string)` SetNextCursor sets NextCursor field to given value. ### HasNextCursor -`func (o *InlineResponse2002Meta) HasNextCursor() bool` +`func (o *InlineResponse2004Meta) HasNextCursor() bool` HasNextCursor returns a boolean if a field has been set. ### GetLimit -`func (o *InlineResponse2002Meta) GetLimit() int32` +`func (o *InlineResponse2004Meta) GetLimit() int32` GetLimit returns the Limit field if non-nil, zero value otherwise. ### GetLimitOk -`func (o *InlineResponse2002Meta) GetLimitOk() (*int32, bool)` +`func (o *InlineResponse2004Meta) GetLimitOk() (*int32, bool)` GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetLimit -`func (o *InlineResponse2002Meta) SetLimit(v int32)` +`func (o *InlineResponse2004Meta) SetLimit(v int32)` SetLimit sets Limit field to given value. ### HasLimit -`func (o *InlineResponse2002Meta) HasLimit() bool` +`func (o *InlineResponse2004Meta) HasLimit() bool` HasLimit returns a boolean if a field has been set. diff --git a/docs/KvStoreAPI.md b/docs/KvStoreAPI.md index d708c060..759c629b 100644 --- a/docs/KvStoreAPI.md +++ b/docs/KvStoreAPI.md @@ -237,7 +237,7 @@ func main() { fmt.Fprintf(os.Stderr, "Error when calling `KvStoreAPI.GetStores`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetStores`: InlineResponse2002 + // response from `GetStores`: InlineResponse2003 fmt.Fprintf(os.Stdout, "Response from `KvStoreAPI.GetStores`: %v\n", resp) } ``` @@ -257,7 +257,7 @@ Name | Type | Description | Notes ### Return type -[**InlineResponse2002**](InlineResponse2002.md) +[**InlineResponse2003**](InlineResponse2003.md) ### Authorization diff --git a/docs/KvStoreItemAPI.md b/docs/KvStoreItemAPI.md index d19a1336..996c5751 100644 --- a/docs/KvStoreItemAPI.md +++ b/docs/KvStoreItemAPI.md @@ -110,7 +110,7 @@ func main() { fmt.Fprintf(os.Stderr, "Error when calling `KvStoreItemAPI.GetKeys`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetKeys`: InlineResponse2003 + // response from `GetKeys`: InlineResponse2004 fmt.Fprintf(os.Stdout, "Response from `KvStoreItemAPI.GetKeys`: %v\n", resp) } ``` @@ -134,7 +134,7 @@ Name | Type | Description | Notes ### Return type -[**InlineResponse2003**](InlineResponse2003.md) +[**InlineResponse2004**](InlineResponse2004.md) ### Authorization diff --git a/docs/RateLimiter.md b/docs/RateLimiter.md index ff273833..8f377829 100644 --- a/docs/RateLimiter.md +++ b/docs/RateLimiter.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **ClientKey** | Pointer to **[]string** | Array of VCL variables used to generate a counter key to identify a client. Example variables include `req.http.Fastly-Client-IP`, `req.http.User-Agent`, or a custom header like `req.http.API-Key`. | [optional] **PenaltyBoxDuration** | Pointer to **int32** | Length of time in minutes that the rate limiter is in effect after the initial violation is detected. | [optional] **Action** | Pointer to **string** | The action to take when a rate limiter violation is detected. | [optional] -**Response** | Pointer to [**NullableRateLimiterResponse1**](RateLimiterResponse1.md) | | [optional] +**Response** | Pointer to **map[string]string** | Custom response to be sent when the rate limit is exceeded. Required if `action` is `response`. | [optional] **ResponseObjectName** | Pointer to **NullableString** | Name of existing response object. Required if `action` is `response_object`. Note that the rate limiter response is only updated to reflect the response object content when saving the rate limiter configuration. | [optional] **LoggerType** | Pointer to **string** | Name of the type of logging endpoint to be used when action is `log_only`. The logging endpoint type is used to determine the appropriate log format to use when emitting log entries. | [optional] **FeatureRevision** | Pointer to **int32** | Revision number of the rate limiting feature implementation. Defaults to the most recent revision. | [optional] @@ -248,20 +248,20 @@ HasAction returns a boolean if a field has been set. ### GetResponse -`func (o *RateLimiter) GetResponse() RateLimiterResponse1` +`func (o *RateLimiter) GetResponse() map[string]string` GetResponse returns the Response field if non-nil, zero value otherwise. ### GetResponseOk -`func (o *RateLimiter) GetResponseOk() (*RateLimiterResponse1, bool)` +`func (o *RateLimiter) GetResponseOk() (*map[string]string, bool)` GetResponseOk returns a tuple with the Response field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetResponse -`func (o *RateLimiter) SetResponse(v RateLimiterResponse1)` +`func (o *RateLimiter) SetResponse(v map[string]string)` SetResponse sets Response field to given value. diff --git a/docs/RateLimiterAPI.md b/docs/RateLimiterAPI.md index 45e53d08..40e4ff8a 100644 --- a/docs/RateLimiterAPI.md +++ b/docs/RateLimiterAPI.md @@ -4,12 +4,94 @@ All URIs are relative to *https://api.fastly.com* Method | HTTP request | Description ------------- | ------------- | ------------- +[**CreateRateLimiter**](RateLimiterAPI.md#CreateRateLimiter) | **POST** `/service/{service_id}/version/{version_id}/rate-limiters` | Create a rate limiter [**DeleteRateLimiter**](RateLimiterAPI.md#DeleteRateLimiter) | **DELETE** `/rate-limiters/{rate_limiter_id}` | Delete a rate limiter [**GetRateLimiter**](RateLimiterAPI.md#GetRateLimiter) | **GET** `/rate-limiters/{rate_limiter_id}` | Get a rate limiter [**ListRateLimiters**](RateLimiterAPI.md#ListRateLimiters) | **GET** `/service/{service_id}/version/{version_id}/rate-limiters` | List rate limiters +[**UpdateRateLimiter**](RateLimiterAPI.md#UpdateRateLimiter) | **PUT** `/rate-limiters/{rate_limiter_id}` | Update a rate limiter +## CreateRateLimiter + +Create a rate limiter + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "github.com/fastly/fastly-go/fastly" +) + +func main() { + serviceID := "serviceId_example" // string | Alphanumeric string identifying the service. + versionID := int32(56) // int32 | Integer identifying a service version. + name := "name_example" // string | A human readable name for the rate limiting rule. (optional) + uriDictionaryName := "uriDictionaryName_example" // string | The name of an Edge Dictionary containing URIs as keys. If not defined or `null`, all origin URIs will be rate limited. (optional) + httpMethods := []string{"Inner_example"} // []string | Array of HTTP methods to apply rate limiting to. (optional) + rpsLimit := int32(56) // int32 | Upper limit of requests per second allowed by the rate limiter. (optional) + windowSize := int32(56) // int32 | Number of seconds during which the RPS limit must be exceeded in order to trigger a violation. (optional) + clientKey := []string{"Inner_example"} // []string | Array of VCL variables used to generate a counter key to identify a client. Example variables include `req.http.Fastly-Client-IP`, `req.http.User-Agent`, or a custom header like `req.http.API-Key`. (optional) + penaltyBoxDuration := int32(56) // int32 | Length of time in minutes that the rate limiter is in effect after the initial violation is detected. (optional) + action := "action_example" // string | The action to take when a rate limiter violation is detected. (optional) + responseObjectName := "responseObjectName_example" // string | Name of existing response object. Required if `action` is `response_object`. Note that the rate limiter response is only updated to reflect the response object content when saving the rate limiter configuration. (optional) + loggerType := "loggerType_example" // string | Name of the type of logging endpoint to be used when action is `log_only`. The logging endpoint type is used to determine the appropriate log format to use when emitting log entries. (optional) + featureRevision := int32(56) // int32 | Revision number of the rate limiting feature implementation. Defaults to the most recent revision. (optional) + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.RateLimiterAPI.CreateRateLimiter(ctx, serviceID, versionID).Name(name).URIDictionaryName(uriDictionaryName).HTTPMethods(httpMethods).RpsLimit(rpsLimit).WindowSize(windowSize).ClientKey(clientKey).PenaltyBoxDuration(penaltyBoxDuration).Action(action).ResponseObjectName(responseObjectName).LoggerType(loggerType).FeatureRevision(featureRevision).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RateLimiterAPI.CreateRateLimiter`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateRateLimiter`: RateLimiterResponse + fmt.Fprintf(os.Stdout, "Response from `RateLimiterAPI.CreateRateLimiter`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**serviceID** | **string** | Alphanumeric string identifying the service. | +**versionID** | **int32** | Integer identifying a service version. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateRateLimiterRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **string** | A human readable name for the rate limiting rule. | **uriDictionaryName** | **string** | The name of an Edge Dictionary containing URIs as keys. If not defined or `null`, all origin URIs will be rate limited. | **httpMethods** | **[]string** | Array of HTTP methods to apply rate limiting to. | **rpsLimit** | **int32** | Upper limit of requests per second allowed by the rate limiter. | **windowSize** | **int32** | Number of seconds during which the RPS limit must be exceeded in order to trigger a violation. | **clientKey** | **[]string** | Array of VCL variables used to generate a counter key to identify a client. Example variables include `req.http.Fastly-Client-IP`, `req.http.User-Agent`, or a custom header like `req.http.API-Key`. | **penaltyBoxDuration** | **int32** | Length of time in minutes that the rate limiter is in effect after the initial violation is detected. | **action** | **string** | The action to take when a rate limiter violation is detected. | **responseObjectName** | **string** | Name of existing response object. Required if `action` is `response_object`. Note that the rate limiter response is only updated to reflect the response object content when saving the rate limiter configuration. | **loggerType** | **string** | Name of the type of logging endpoint to be used when action is `log_only`. The logging endpoint type is used to determine the appropriate log format to use when emitting log entries. | **featureRevision** | **int32** | Revision number of the rate limiting feature implementation. Defaults to the most recent revision. | + +### Return type + +[**RateLimiterResponse**](RateLimiterResponse.md) + +### Authorization + +[API Token](https://developer.fastly.com/reference/api/#authentication) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: application/json + +[Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) + + ## DeleteRateLimiter Delete a rate limiter @@ -211,3 +293,81 @@ Name | Type | Description | Notes - **Accept**: application/json [Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) + + +## UpdateRateLimiter + +Update a rate limiter + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "github.com/fastly/fastly-go/fastly" +) + +func main() { + rateLimiterID := "rateLimiterId_example" // string | Alphanumeric string identifying the rate limiter. + name := "name_example" // string | A human readable name for the rate limiting rule. (optional) + uriDictionaryName := "uriDictionaryName_example" // string | The name of an Edge Dictionary containing URIs as keys. If not defined or `null`, all origin URIs will be rate limited. (optional) + httpMethods := []string{"Inner_example"} // []string | Array of HTTP methods to apply rate limiting to. (optional) + rpsLimit := int32(56) // int32 | Upper limit of requests per second allowed by the rate limiter. (optional) + windowSize := int32(56) // int32 | Number of seconds during which the RPS limit must be exceeded in order to trigger a violation. (optional) + clientKey := []string{"Inner_example"} // []string | Array of VCL variables used to generate a counter key to identify a client. Example variables include `req.http.Fastly-Client-IP`, `req.http.User-Agent`, or a custom header like `req.http.API-Key`. (optional) + penaltyBoxDuration := int32(56) // int32 | Length of time in minutes that the rate limiter is in effect after the initial violation is detected. (optional) + action := "action_example" // string | The action to take when a rate limiter violation is detected. (optional) + responseObjectName := "responseObjectName_example" // string | Name of existing response object. Required if `action` is `response_object`. Note that the rate limiter response is only updated to reflect the response object content when saving the rate limiter configuration. (optional) + loggerType := "loggerType_example" // string | Name of the type of logging endpoint to be used when action is `log_only`. The logging endpoint type is used to determine the appropriate log format to use when emitting log entries. (optional) + featureRevision := int32(56) // int32 | Revision number of the rate limiting feature implementation. Defaults to the most recent revision. (optional) + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.RateLimiterAPI.UpdateRateLimiter(ctx, rateLimiterID).Name(name).URIDictionaryName(uriDictionaryName).HTTPMethods(httpMethods).RpsLimit(rpsLimit).WindowSize(windowSize).ClientKey(clientKey).PenaltyBoxDuration(penaltyBoxDuration).Action(action).ResponseObjectName(responseObjectName).LoggerType(loggerType).FeatureRevision(featureRevision).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RateLimiterAPI.UpdateRateLimiter`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateRateLimiter`: RateLimiterResponse + fmt.Fprintf(os.Stdout, "Response from `RateLimiterAPI.UpdateRateLimiter`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**rateLimiterID** | **string** | Alphanumeric string identifying the rate limiter. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateRateLimiterRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **string** | A human readable name for the rate limiting rule. | **uriDictionaryName** | **string** | The name of an Edge Dictionary containing URIs as keys. If not defined or `null`, all origin URIs will be rate limited. | **httpMethods** | **[]string** | Array of HTTP methods to apply rate limiting to. | **rpsLimit** | **int32** | Upper limit of requests per second allowed by the rate limiter. | **windowSize** | **int32** | Number of seconds during which the RPS limit must be exceeded in order to trigger a violation. | **clientKey** | **[]string** | Array of VCL variables used to generate a counter key to identify a client. Example variables include `req.http.Fastly-Client-IP`, `req.http.User-Agent`, or a custom header like `req.http.API-Key`. | **penaltyBoxDuration** | **int32** | Length of time in minutes that the rate limiter is in effect after the initial violation is detected. | **action** | **string** | The action to take when a rate limiter violation is detected. | **responseObjectName** | **string** | Name of existing response object. Required if `action` is `response_object`. Note that the rate limiter response is only updated to reflect the response object content when saving the rate limiter configuration. | **loggerType** | **string** | Name of the type of logging endpoint to be used when action is `log_only`. The logging endpoint type is used to determine the appropriate log format to use when emitting log entries. | **featureRevision** | **int32** | Revision number of the rate limiting feature implementation. Defaults to the most recent revision. | + +### Return type + +[**RateLimiterResponse**](RateLimiterResponse.md) + +### Authorization + +[API Token](https://developer.fastly.com/reference/api/#authentication) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: application/json + +[Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/RateLimiterResponse.md b/docs/RateLimiterResponse.md index 852c7828..bb08c056 100644 --- a/docs/RateLimiterResponse.md +++ b/docs/RateLimiterResponse.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **ClientKey** | Pointer to **[]string** | Array of VCL variables used to generate a counter key to identify a client. Example variables include `req.http.Fastly-Client-IP`, `req.http.User-Agent`, or a custom header like `req.http.API-Key`. | [optional] **PenaltyBoxDuration** | Pointer to **int32** | Length of time in minutes that the rate limiter is in effect after the initial violation is detected. | [optional] **Action** | Pointer to **string** | The action to take when a rate limiter violation is detected. | [optional] -**Response** | Pointer to [**NullableRateLimiterResponse1**](RateLimiterResponse1.md) | | [optional] +**Response** | Pointer to **map[string]string** | Custom response to be sent when the rate limit is exceeded. Required if `action` is `response`. | [optional] **ResponseObjectName** | Pointer to **NullableString** | Name of existing response object. Required if `action` is `response_object`. Note that the rate limiter response is only updated to reflect the response object content when saving the rate limiter configuration. | [optional] **LoggerType** | Pointer to **string** | Name of the type of logging endpoint to be used when action is `log_only`. The logging endpoint type is used to determine the appropriate log format to use when emitting log entries. | [optional] **FeatureRevision** | Pointer to **int32** | Revision number of the rate limiting feature implementation. Defaults to the most recent revision. | [optional] @@ -254,20 +254,20 @@ HasAction returns a boolean if a field has been set. ### GetResponse -`func (o *RateLimiterResponse) GetResponse() RateLimiterResponse1` +`func (o *RateLimiterResponse) GetResponse() map[string]string` GetResponse returns the Response field if non-nil, zero value otherwise. ### GetResponseOk -`func (o *RateLimiterResponse) GetResponseOk() (*RateLimiterResponse1, bool)` +`func (o *RateLimiterResponse) GetResponseOk() (*map[string]string, bool)` GetResponseOk returns a tuple with the Response field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetResponse -`func (o *RateLimiterResponse) SetResponse(v RateLimiterResponse1)` +`func (o *RateLimiterResponse) SetResponse(v map[string]string)` SetResponse sets Response field to given value. diff --git a/docs/RateLimiterResponse1.md b/docs/RateLimiterResponse1.md deleted file mode 100644 index a3ee28e4..00000000 --- a/docs/RateLimiterResponse1.md +++ /dev/null @@ -1,106 +0,0 @@ -# RateLimiterResponse1 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Status** | Pointer to **int32** | HTTP status code for custom limit enforcement response. | [optional] -**ContentType** | Pointer to **string** | MIME type for custom limit enforcement response. | [optional] -**Content** | Pointer to **string** | Response body for custom limit enforcement response. | [optional] - -## Methods - -### NewRateLimiterResponse1 - -`func NewRateLimiterResponse1() *RateLimiterResponse1` - -NewRateLimiterResponse1 instantiates a new RateLimiterResponse1 object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRateLimiterResponse1WithDefaults - -`func NewRateLimiterResponse1WithDefaults() *RateLimiterResponse1` - -NewRateLimiterResponse1WithDefaults instantiates a new RateLimiterResponse1 object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetStatus - -`func (o *RateLimiterResponse1) GetStatus() int32` - -GetStatus returns the Status field if non-nil, zero value otherwise. - -### GetStatusOk - -`func (o *RateLimiterResponse1) GetStatusOk() (*int32, bool)` - -GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStatus - -`func (o *RateLimiterResponse1) SetStatus(v int32)` - -SetStatus sets Status field to given value. - -### HasStatus - -`func (o *RateLimiterResponse1) HasStatus() bool` - -HasStatus returns a boolean if a field has been set. - -### GetContentType - -`func (o *RateLimiterResponse1) GetContentType() string` - -GetContentType returns the ContentType field if non-nil, zero value otherwise. - -### GetContentTypeOk - -`func (o *RateLimiterResponse1) GetContentTypeOk() (*string, bool)` - -GetContentTypeOk returns a tuple with the ContentType field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetContentType - -`func (o *RateLimiterResponse1) SetContentType(v string)` - -SetContentType sets ContentType field to given value. - -### HasContentType - -`func (o *RateLimiterResponse1) HasContentType() bool` - -HasContentType returns a boolean if a field has been set. - -### GetContent - -`func (o *RateLimiterResponse1) GetContent() string` - -GetContent returns the Content field if non-nil, zero value otherwise. - -### GetContentOk - -`func (o *RateLimiterResponse1) GetContentOk() (*string, bool)` - -GetContentOk returns a tuple with the Content field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetContent - -`func (o *RateLimiterResponse1) SetContent(v string)` - -SetContent sets Content field to given value. - -### HasContent - -`func (o *RateLimiterResponse1) HasContent() bool` - -HasContent returns a boolean if a field has been set. - - -[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/ReadOnlyCustomerId.md b/docs/ReadOnlyCustomerId.md new file mode 100644 index 00000000..8016a048 --- /dev/null +++ b/docs/ReadOnlyCustomerId.md @@ -0,0 +1,28 @@ +# ReadOnlyCustomerID + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Methods + +### NewReadOnlyCustomerID + +`func NewReadOnlyCustomerID() *ReadOnlyCustomerID` + +NewReadOnlyCustomerID instantiates a new ReadOnlyCustomerID object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewReadOnlyCustomerIDWithDefaults + +`func NewReadOnlyCustomerIDWithDefaults() *ReadOnlyCustomerID` + +NewReadOnlyCustomerIDWithDefaults instantiates a new ReadOnlyCustomerID object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/ReadOnlyId.md b/docs/ReadOnlyId.md new file mode 100644 index 00000000..350ce789 --- /dev/null +++ b/docs/ReadOnlyId.md @@ -0,0 +1,28 @@ +# ReadOnlyID + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Methods + +### NewReadOnlyID + +`func NewReadOnlyID() *ReadOnlyID` + +NewReadOnlyID instantiates a new ReadOnlyID object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewReadOnlyIDWithDefaults + +`func NewReadOnlyIDWithDefaults() *ReadOnlyID` + +NewReadOnlyIDWithDefaults instantiates a new ReadOnlyID object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/ReadOnlyIdService.md b/docs/ReadOnlyIdService.md new file mode 100644 index 00000000..e6d8e071 --- /dev/null +++ b/docs/ReadOnlyIdService.md @@ -0,0 +1,28 @@ +# ReadOnlyIDService + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Methods + +### NewReadOnlyIDService + +`func NewReadOnlyIDService() *ReadOnlyIDService` + +NewReadOnlyIDService instantiates a new ReadOnlyIDService object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewReadOnlyIDServiceWithDefaults + +`func NewReadOnlyIDServiceWithDefaults() *ReadOnlyIDService` + +NewReadOnlyIDServiceWithDefaults instantiates a new ReadOnlyIDService object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/ReadOnlyUserId.md b/docs/ReadOnlyUserId.md new file mode 100644 index 00000000..72c87da5 --- /dev/null +++ b/docs/ReadOnlyUserId.md @@ -0,0 +1,28 @@ +# ReadOnlyUserID + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Methods + +### NewReadOnlyUserID + +`func NewReadOnlyUserID() *ReadOnlyUserID` + +NewReadOnlyUserID instantiates a new ReadOnlyUserID object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewReadOnlyUserIDWithDefaults + +`func NewReadOnlyUserIDWithDefaults() *ReadOnlyUserID` + +NewReadOnlyUserIDWithDefaults instantiates a new ReadOnlyUserID object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/fastly/api_automation_tokens.go b/fastly/api_automation_tokens.go new file mode 100644 index 00000000..030ff5fc --- /dev/null +++ b/fastly/api_automation_tokens.go @@ -0,0 +1,911 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://developer.fastly.com/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + gourl "net/url" + "strconv" + "strings" +) + +// Linger please +var ( + _ context.Context +) + +// AutomationTokensAPI defines an interface for interacting with the resource. +type AutomationTokensAPI interface { + + /* + CreateAutomationToken Create Automation Token + + Creates a new automation token. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return APICreateAutomationTokenRequest + */ + CreateAutomationToken(ctx context.Context) APICreateAutomationTokenRequest + + // CreateAutomationTokenExecute executes the request + // @return AutomationTokenCreateResponse + CreateAutomationTokenExecute(r APICreateAutomationTokenRequest) (*AutomationTokenCreateResponse, *http.Response, error) + + /* + GetAutomationTokenID Retrieve an Automation Token by ID + + Retrieves an automation token by ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @return APIGetAutomationTokenIDRequest + */ + GetAutomationTokenID(ctx context.Context, id string) APIGetAutomationTokenIDRequest + + // GetAutomationTokenIDExecute executes the request + // @return AutomationTokenResponse + GetAutomationTokenIDExecute(r APIGetAutomationTokenIDRequest) (*AutomationTokenResponse, *http.Response, error) + + /* + GetAutomationTokensIDServices List Automation Token Services + + List of services associated with the automation token. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @return APIGetAutomationTokensIDServicesRequest + */ + GetAutomationTokensIDServices(ctx context.Context, id string) APIGetAutomationTokensIDServicesRequest + + // GetAutomationTokensIDServicesExecute executes the request + // @return InlineResponse2001 + GetAutomationTokensIDServicesExecute(r APIGetAutomationTokensIDServicesRequest) (*InlineResponse2001, *http.Response, error) + + /* + ListAutomationTokens List Customer Automation Tokens + + Lists all automation tokens for a customer. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return APIListAutomationTokensRequest + */ + ListAutomationTokens(ctx context.Context) APIListAutomationTokensRequest + + // ListAutomationTokensExecute executes the request + // @return []AutomationTokenResponse + ListAutomationTokensExecute(r APIListAutomationTokensRequest) ([]AutomationTokenResponse, *http.Response, error) + + /* + RevokeAutomationTokenID Revoke an Automation Token by ID + + Revoke an automation token by ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @return APIRevokeAutomationTokenIDRequest + */ + RevokeAutomationTokenID(ctx context.Context, id string) APIRevokeAutomationTokenIDRequest + + // RevokeAutomationTokenIDExecute executes the request + // @return ErrorResponse + RevokeAutomationTokenIDExecute(r APIRevokeAutomationTokenIDRequest) (*ErrorResponse, *http.Response, error) +} + +// AutomationTokensAPIService AutomationTokensAPI service +type AutomationTokensAPIService service + +// APICreateAutomationTokenRequest represents a request for the resource. +type APICreateAutomationTokenRequest struct { + ctx context.Context + APIService AutomationTokensAPI + automationTokenCreateRequest *AutomationTokenCreateRequest +} + +// AutomationTokenCreateRequest returns a pointer to a request. +func (r *APICreateAutomationTokenRequest) AutomationTokenCreateRequest(automationTokenCreateRequest AutomationTokenCreateRequest) *APICreateAutomationTokenRequest { + r.automationTokenCreateRequest = &automationTokenCreateRequest + return r +} + +// Execute calls the API using the request data configured. +func (r APICreateAutomationTokenRequest) Execute() (*AutomationTokenCreateResponse, *http.Response, error) { + return r.APIService.CreateAutomationTokenExecute(r) +} + +/* +CreateAutomationToken Create Automation Token + +Creates a new automation token. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return APICreateAutomationTokenRequest +*/ +func (a *AutomationTokensAPIService) CreateAutomationToken(ctx context.Context) APICreateAutomationTokenRequest { + return APICreateAutomationTokenRequest{ + APIService: a, + ctx: ctx, + } +} + +// CreateAutomationTokenExecute executes the request +// @return AutomationTokenCreateResponse +func (a *AutomationTokensAPIService) CreateAutomationTokenExecute(r APICreateAutomationTokenRequest) (*AutomationTokenCreateResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody any + formFiles []formFile + localVarReturnValue *AutomationTokenCreateResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AutomationTokensAPIService.CreateAutomationToken") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/automation-tokens" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := gourl.Values{} + localVarFormParams := gourl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/vnd.api+json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.api+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.automationTokenCreateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Fastly-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + _ = localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + + if localVarHTTPResponse.Request.Method != http.MethodGet && localVarHTTPResponse.Request.Method != http.MethodHead { + if remaining := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Remaining"); remaining != "" { + if i, err := strconv.Atoi(remaining); err == nil { + a.client.RateLimitRemaining = i + } + } + if reset := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Reset"); reset != "" { + if i, err := strconv.Atoi(reset); err == nil { + a.client.RateLimitReset = i + } + } + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// APIGetAutomationTokenIDRequest represents a request for the resource. +type APIGetAutomationTokenIDRequest struct { + ctx context.Context + APIService AutomationTokensAPI + id string +} + + +// Execute calls the API using the request data configured. +func (r APIGetAutomationTokenIDRequest) Execute() (*AutomationTokenResponse, *http.Response, error) { + return r.APIService.GetAutomationTokenIDExecute(r) +} + +/* +GetAutomationTokenID Retrieve an Automation Token by ID + +Retrieves an automation token by ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @return APIGetAutomationTokenIDRequest +*/ +func (a *AutomationTokensAPIService) GetAutomationTokenID(ctx context.Context, id string) APIGetAutomationTokenIDRequest { + return APIGetAutomationTokenIDRequest{ + APIService: a, + ctx: ctx, + id: id, + } +} + +// GetAutomationTokenIDExecute executes the request +// @return AutomationTokenResponse +func (a *AutomationTokensAPIService) GetAutomationTokenIDExecute(r APIGetAutomationTokenIDRequest) (*AutomationTokenResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *AutomationTokenResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AutomationTokensAPIService.GetAutomationTokenID") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/automation-tokens/{id}" + localVarPath = strings.ReplaceAll(localVarPath, "{"+"id"+"}", gourl.PathEscape(parameterToString(r.id, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := gourl.Values{} + localVarFormParams := gourl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.api+json", "application/problem+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Fastly-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + _ = localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + + if localVarHTTPResponse.Request.Method != http.MethodGet && localVarHTTPResponse.Request.Method != http.MethodHead { + if remaining := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Remaining"); remaining != "" { + if i, err := strconv.Atoi(remaining); err == nil { + a.client.RateLimitRemaining = i + } + } + if reset := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Reset"); reset != "" { + if i, err := strconv.Atoi(reset); err == nil { + a.client.RateLimitReset = i + } + } + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// APIGetAutomationTokensIDServicesRequest represents a request for the resource. +type APIGetAutomationTokensIDServicesRequest struct { + ctx context.Context + APIService AutomationTokensAPI + id string + perPage *int32 + page *int32 +} + +// PerPage returns a pointer to a request. +func (r *APIGetAutomationTokensIDServicesRequest) PerPage(perPage int32) *APIGetAutomationTokensIDServicesRequest { + r.perPage = &perPage + return r +} +// Page returns a pointer to a request. +func (r *APIGetAutomationTokensIDServicesRequest) Page(page int32) *APIGetAutomationTokensIDServicesRequest { + r.page = &page + return r +} + +// Execute calls the API using the request data configured. +func (r APIGetAutomationTokensIDServicesRequest) Execute() (*InlineResponse2001, *http.Response, error) { + return r.APIService.GetAutomationTokensIDServicesExecute(r) +} + +/* +GetAutomationTokensIDServices List Automation Token Services + +List of services associated with the automation token. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @return APIGetAutomationTokensIDServicesRequest +*/ +func (a *AutomationTokensAPIService) GetAutomationTokensIDServices(ctx context.Context, id string) APIGetAutomationTokensIDServicesRequest { + return APIGetAutomationTokensIDServicesRequest{ + APIService: a, + ctx: ctx, + id: id, + } +} + +// GetAutomationTokensIDServicesExecute executes the request +// @return InlineResponse2001 +func (a *AutomationTokensAPIService) GetAutomationTokensIDServicesExecute(r APIGetAutomationTokensIDServicesRequest) (*InlineResponse2001, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *InlineResponse2001 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AutomationTokensAPIService.GetAutomationTokensIDServices") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/automation-tokens/{id}/services" + localVarPath = strings.ReplaceAll(localVarPath, "{"+"id"+"}", gourl.PathEscape(parameterToString(r.id, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := gourl.Values{} + localVarFormParams := gourl.Values{} + + if r.perPage != nil { + localVarQueryParams.Add("per_page", parameterToString(*r.perPage, "")) + } + if r.page != nil { + localVarQueryParams.Add("page", parameterToString(*r.page, "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.api+json", "application/problem+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Fastly-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + _ = localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + + if localVarHTTPResponse.Request.Method != http.MethodGet && localVarHTTPResponse.Request.Method != http.MethodHead { + if remaining := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Remaining"); remaining != "" { + if i, err := strconv.Atoi(remaining); err == nil { + a.client.RateLimitRemaining = i + } + } + if reset := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Reset"); reset != "" { + if i, err := strconv.Atoi(reset); err == nil { + a.client.RateLimitReset = i + } + } + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// APIListAutomationTokensRequest represents a request for the resource. +type APIListAutomationTokensRequest struct { + ctx context.Context + APIService AutomationTokensAPI + perPage *int32 + page *int32 +} + +// PerPage returns a pointer to a request. +func (r *APIListAutomationTokensRequest) PerPage(perPage int32) *APIListAutomationTokensRequest { + r.perPage = &perPage + return r +} +// Page returns a pointer to a request. +func (r *APIListAutomationTokensRequest) Page(page int32) *APIListAutomationTokensRequest { + r.page = &page + return r +} + +// Execute calls the API using the request data configured. +func (r APIListAutomationTokensRequest) Execute() ([]AutomationTokenResponse, *http.Response, error) { + return r.APIService.ListAutomationTokensExecute(r) +} + +/* +ListAutomationTokens List Customer Automation Tokens + +Lists all automation tokens for a customer. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return APIListAutomationTokensRequest +*/ +func (a *AutomationTokensAPIService) ListAutomationTokens(ctx context.Context) APIListAutomationTokensRequest { + return APIListAutomationTokensRequest{ + APIService: a, + ctx: ctx, + } +} + +// ListAutomationTokensExecute executes the request +// @return []AutomationTokenResponse +func (a *AutomationTokensAPIService) ListAutomationTokensExecute(r APIListAutomationTokensRequest) ([]AutomationTokenResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue []AutomationTokenResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AutomationTokensAPIService.ListAutomationTokens") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/automation-tokens" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := gourl.Values{} + localVarFormParams := gourl.Values{} + + if r.perPage != nil { + localVarQueryParams.Add("per_page", parameterToString(*r.perPage, "")) + } + if r.page != nil { + localVarQueryParams.Add("page", parameterToString(*r.page, "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.api+json", "application/problem+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Fastly-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + _ = localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + + if localVarHTTPResponse.Request.Method != http.MethodGet && localVarHTTPResponse.Request.Method != http.MethodHead { + if remaining := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Remaining"); remaining != "" { + if i, err := strconv.Atoi(remaining); err == nil { + a.client.RateLimitRemaining = i + } + } + if reset := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Reset"); reset != "" { + if i, err := strconv.Atoi(reset); err == nil { + a.client.RateLimitReset = i + } + } + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// APIRevokeAutomationTokenIDRequest represents a request for the resource. +type APIRevokeAutomationTokenIDRequest struct { + ctx context.Context + APIService AutomationTokensAPI + id string +} + + +// Execute calls the API using the request data configured. +func (r APIRevokeAutomationTokenIDRequest) Execute() (*ErrorResponse, *http.Response, error) { + return r.APIService.RevokeAutomationTokenIDExecute(r) +} + +/* +RevokeAutomationTokenID Revoke an Automation Token by ID + +Revoke an automation token by ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @return APIRevokeAutomationTokenIDRequest +*/ +func (a *AutomationTokensAPIService) RevokeAutomationTokenID(ctx context.Context, id string) APIRevokeAutomationTokenIDRequest { + return APIRevokeAutomationTokenIDRequest{ + APIService: a, + ctx: ctx, + id: id, + } +} + +// RevokeAutomationTokenIDExecute executes the request +// @return ErrorResponse +func (a *AutomationTokensAPIService) RevokeAutomationTokenIDExecute(r APIRevokeAutomationTokenIDRequest) (*ErrorResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody any + formFiles []formFile + localVarReturnValue *ErrorResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AutomationTokensAPIService.RevokeAutomationTokenID") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/automation-tokens/{id}" + localVarPath = strings.ReplaceAll(localVarPath, "{"+"id"+"}", gourl.PathEscape(parameterToString(r.id, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := gourl.Values{} + localVarFormParams := gourl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.api+json", "application/problem+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Fastly-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + _ = localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + + if localVarHTTPResponse.Request.Method != http.MethodGet && localVarHTTPResponse.Request.Method != http.MethodHead { + if remaining := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Remaining"); remaining != "" { + if i, err := strconv.Atoi(remaining); err == nil { + a.client.RateLimitRemaining = i + } + } + if reset := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Reset"); reset != "" { + if i, err := strconv.Atoi(reset); err == nil { + a.client.RateLimitReset = i + } + } + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/fastly/api_domain_ownerships.go b/fastly/api_domain_ownerships.go index 81c49607..a2682099 100644 --- a/fastly/api_domain_ownerships.go +++ b/fastly/api_domain_ownerships.go @@ -41,8 +41,8 @@ type DomainOwnershipsAPI interface { ListDomainOwnerships(ctx context.Context) APIListDomainOwnershipsRequest // ListDomainOwnershipsExecute executes the request - // @return InlineResponse2001 - ListDomainOwnershipsExecute(r APIListDomainOwnershipsRequest) (*InlineResponse2001, *http.Response, error) + // @return InlineResponse2002 + ListDomainOwnershipsExecute(r APIListDomainOwnershipsRequest) (*InlineResponse2002, *http.Response, error) } // DomainOwnershipsAPIService DomainOwnershipsAPI service @@ -56,7 +56,7 @@ type APIListDomainOwnershipsRequest struct { // Execute calls the API using the request data configured. -func (r APIListDomainOwnershipsRequest) Execute() (*InlineResponse2001, *http.Response, error) { +func (r APIListDomainOwnershipsRequest) Execute() (*InlineResponse2002, *http.Response, error) { return r.APIService.ListDomainOwnershipsExecute(r) } @@ -76,13 +76,13 @@ func (a *DomainOwnershipsAPIService) ListDomainOwnerships(ctx context.Context) A } // ListDomainOwnershipsExecute executes the request -// @return InlineResponse2001 -func (a *DomainOwnershipsAPIService) ListDomainOwnershipsExecute(r APIListDomainOwnershipsRequest) (*InlineResponse2001, *http.Response, error) { +// @return InlineResponse2002 +func (a *DomainOwnershipsAPIService) ListDomainOwnershipsExecute(r APIListDomainOwnershipsRequest) (*InlineResponse2002, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody any formFiles []formFile - localVarReturnValue *InlineResponse2001 + localVarReturnValue *InlineResponse2002 ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DomainOwnershipsAPIService.ListDomainOwnerships") diff --git a/fastly/api_kv_store.go b/fastly/api_kv_store.go index 9566cbad..96108c8a 100644 --- a/fastly/api_kv_store.go +++ b/fastly/api_kv_store.go @@ -85,8 +85,8 @@ type KvStoreAPI interface { GetStores(ctx context.Context) APIGetStoresRequest // GetStoresExecute executes the request - // @return InlineResponse2002 - GetStoresExecute(r APIGetStoresRequest) (*InlineResponse2002, *http.Response, error) + // @return InlineResponse2003 + GetStoresExecute(r APIGetStoresRequest) (*InlineResponse2003, *http.Response, error) } // KvStoreAPIService KvStoreAPI service @@ -516,7 +516,7 @@ func (r *APIGetStoresRequest) Limit(limit int32) *APIGetStoresRequest { } // Execute calls the API using the request data configured. -func (r APIGetStoresRequest) Execute() (*InlineResponse2002, *http.Response, error) { +func (r APIGetStoresRequest) Execute() (*InlineResponse2003, *http.Response, error) { return r.APIService.GetStoresExecute(r) } @@ -536,13 +536,13 @@ func (a *KvStoreAPIService) GetStores(ctx context.Context) APIGetStoresRequest { } // GetStoresExecute executes the request -// @return InlineResponse2002 -func (a *KvStoreAPIService) GetStoresExecute(r APIGetStoresRequest) (*InlineResponse2002, *http.Response, error) { +// @return InlineResponse2003 +func (a *KvStoreAPIService) GetStoresExecute(r APIGetStoresRequest) (*InlineResponse2003, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody any formFiles []formFile - localVarReturnValue *InlineResponse2002 + localVarReturnValue *InlineResponse2003 ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "KvStoreAPIService.GetStores") diff --git a/fastly/api_kv_store_item.go b/fastly/api_kv_store_item.go index 7f272dae..6e100c8a 100644 --- a/fastly/api_kv_store_item.go +++ b/fastly/api_kv_store_item.go @@ -58,8 +58,8 @@ type KvStoreItemAPI interface { GetKeys(ctx context.Context, storeID string) APIGetKeysRequest // GetKeysExecute executes the request - // @return InlineResponse2003 - GetKeysExecute(r APIGetKeysRequest) (*InlineResponse2003, *http.Response, error) + // @return InlineResponse2004 + GetKeysExecute(r APIGetKeysRequest) (*InlineResponse2004, *http.Response, error) /* GetValueForKey Get the value of an kv store item @@ -251,7 +251,7 @@ func (r *APIGetKeysRequest) Prefix(prefix string) *APIGetKeysRequest { } // Execute calls the API using the request data configured. -func (r APIGetKeysRequest) Execute() (*InlineResponse2003, *http.Response, error) { +func (r APIGetKeysRequest) Execute() (*InlineResponse2004, *http.Response, error) { return r.APIService.GetKeysExecute(r) } @@ -273,13 +273,13 @@ func (a *KvStoreItemAPIService) GetKeys(ctx context.Context, storeID string) API } // GetKeysExecute executes the request -// @return InlineResponse2003 -func (a *KvStoreItemAPIService) GetKeysExecute(r APIGetKeysRequest) (*InlineResponse2003, *http.Response, error) { +// @return InlineResponse2004 +func (a *KvStoreItemAPIService) GetKeysExecute(r APIGetKeysRequest) (*InlineResponse2004, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody any formFiles []formFile - localVarReturnValue *InlineResponse2003 + localVarReturnValue *InlineResponse2004 ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "KvStoreItemAPIService.GetKeys") diff --git a/fastly/api_rate_limiter.go b/fastly/api_rate_limiter.go index 2810f4f8..a72e12c8 100644 --- a/fastly/api_rate_limiter.go +++ b/fastly/api_rate_limiter.go @@ -31,6 +31,22 @@ var ( // RateLimiterAPI defines an interface for interacting with the resource. type RateLimiterAPI interface { + /* + CreateRateLimiter Create a rate limiter + + Create a rate limiter for a particular service and version. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param serviceID Alphanumeric string identifying the service. + @param versionID Integer identifying a service version. + @return APICreateRateLimiterRequest + */ + CreateRateLimiter(ctx context.Context, serviceID string, versionID int32) APICreateRateLimiterRequest + + // CreateRateLimiterExecute executes the request + // @return RateLimiterResponse + CreateRateLimiterExecute(r APICreateRateLimiterRequest) (*RateLimiterResponse, *http.Response, error) + /* DeleteRateLimiter Delete a rate limiter @@ -76,11 +92,263 @@ type RateLimiterAPI interface { // ListRateLimitersExecute executes the request // @return []RateLimiterResponse ListRateLimitersExecute(r APIListRateLimitersRequest) ([]RateLimiterResponse, *http.Response, error) + + /* + UpdateRateLimiter Update a rate limiter + + Update a rate limiter by its ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param rateLimiterID Alphanumeric string identifying the rate limiter. + @return APIUpdateRateLimiterRequest + */ + UpdateRateLimiter(ctx context.Context, rateLimiterID string) APIUpdateRateLimiterRequest + + // UpdateRateLimiterExecute executes the request + // @return RateLimiterResponse + UpdateRateLimiterExecute(r APIUpdateRateLimiterRequest) (*RateLimiterResponse, *http.Response, error) } // RateLimiterAPIService RateLimiterAPI service type RateLimiterAPIService service +// APICreateRateLimiterRequest represents a request for the resource. +type APICreateRateLimiterRequest struct { + ctx context.Context + APIService RateLimiterAPI + serviceID string + versionID int32 + name *string + uriDictionaryName *string + httpMethods *[]string + rpsLimit *int32 + windowSize *int32 + clientKey *[]string + penaltyBoxDuration *int32 + action *string + responseObjectName *string + loggerType *string + featureRevision *int32 +} + +// Name A human readable name for the rate limiting rule. +func (r *APICreateRateLimiterRequest) Name(name string) *APICreateRateLimiterRequest { + r.name = &name + return r +} +// URIDictionaryName The name of an Edge Dictionary containing URIs as keys. If not defined or `null`, all origin URIs will be rate limited. +func (r *APICreateRateLimiterRequest) URIDictionaryName(uriDictionaryName string) *APICreateRateLimiterRequest { + r.uriDictionaryName = &uriDictionaryName + return r +} +// HTTPMethods Array of HTTP methods to apply rate limiting to. +func (r *APICreateRateLimiterRequest) HTTPMethods(httpMethods []string) *APICreateRateLimiterRequest { + r.httpMethods = &httpMethods + return r +} +// RpsLimit Upper limit of requests per second allowed by the rate limiter. +func (r *APICreateRateLimiterRequest) RpsLimit(rpsLimit int32) *APICreateRateLimiterRequest { + r.rpsLimit = &rpsLimit + return r +} +// WindowSize Number of seconds during which the RPS limit must be exceeded in order to trigger a violation. +func (r *APICreateRateLimiterRequest) WindowSize(windowSize int32) *APICreateRateLimiterRequest { + r.windowSize = &windowSize + return r +} +// ClientKey Array of VCL variables used to generate a counter key to identify a client. Example variables include `req.http.Fastly-Client-IP`, `req.http.User-Agent`, or a custom header like `req.http.API-Key`. +func (r *APICreateRateLimiterRequest) ClientKey(clientKey []string) *APICreateRateLimiterRequest { + r.clientKey = &clientKey + return r +} +// PenaltyBoxDuration Length of time in minutes that the rate limiter is in effect after the initial violation is detected. +func (r *APICreateRateLimiterRequest) PenaltyBoxDuration(penaltyBoxDuration int32) *APICreateRateLimiterRequest { + r.penaltyBoxDuration = &penaltyBoxDuration + return r +} +// Action The action to take when a rate limiter violation is detected. +func (r *APICreateRateLimiterRequest) Action(action string) *APICreateRateLimiterRequest { + r.action = &action + return r +} +// ResponseObjectName Name of existing response object. Required if `action` is `response_object`. Note that the rate limiter response is only updated to reflect the response object content when saving the rate limiter configuration. +func (r *APICreateRateLimiterRequest) ResponseObjectName(responseObjectName string) *APICreateRateLimiterRequest { + r.responseObjectName = &responseObjectName + return r +} +// LoggerType Name of the type of logging endpoint to be used when action is `log_only`. The logging endpoint type is used to determine the appropriate log format to use when emitting log entries. +func (r *APICreateRateLimiterRequest) LoggerType(loggerType string) *APICreateRateLimiterRequest { + r.loggerType = &loggerType + return r +} +// FeatureRevision Revision number of the rate limiting feature implementation. Defaults to the most recent revision. +func (r *APICreateRateLimiterRequest) FeatureRevision(featureRevision int32) *APICreateRateLimiterRequest { + r.featureRevision = &featureRevision + return r +} + +// Execute calls the API using the request data configured. +func (r APICreateRateLimiterRequest) Execute() (*RateLimiterResponse, *http.Response, error) { + return r.APIService.CreateRateLimiterExecute(r) +} + +/* +CreateRateLimiter Create a rate limiter + +Create a rate limiter for a particular service and version. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param serviceID Alphanumeric string identifying the service. + @param versionID Integer identifying a service version. + @return APICreateRateLimiterRequest +*/ +func (a *RateLimiterAPIService) CreateRateLimiter(ctx context.Context, serviceID string, versionID int32) APICreateRateLimiterRequest { + return APICreateRateLimiterRequest{ + APIService: a, + ctx: ctx, + serviceID: serviceID, + versionID: versionID, + } +} + +// CreateRateLimiterExecute executes the request +// @return RateLimiterResponse +func (a *RateLimiterAPIService) CreateRateLimiterExecute(r APICreateRateLimiterRequest) (*RateLimiterResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody any + formFiles []formFile + localVarReturnValue *RateLimiterResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RateLimiterAPIService.CreateRateLimiter") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/service/{service_id}/version/{version_id}/rate-limiters" + localVarPath = strings.ReplaceAll(localVarPath, "{"+"service_id"+"}", gourl.PathEscape(parameterToString(r.serviceID, ""))) + localVarPath = strings.ReplaceAll(localVarPath, "{"+"version_id"+"}", gourl.PathEscape(parameterToString(r.versionID, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := gourl.Values{} + localVarFormParams := gourl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.name != nil { + localVarFormParams.Add("name", parameterToString(*r.name, "")) + } + if r.uriDictionaryName != nil { + localVarFormParams.Add("uri_dictionary_name", parameterToString(*r.uriDictionaryName, "")) + } + if r.httpMethods != nil { + localVarFormParams.Add("http_methods", parameterToString(*r.httpMethods, "csv")) + } + if r.rpsLimit != nil { + localVarFormParams.Add("rps_limit", parameterToString(*r.rpsLimit, "")) + } + if r.windowSize != nil { + localVarFormParams.Add("window_size", parameterToString(*r.windowSize, "")) + } + if r.clientKey != nil { + localVarFormParams.Add("client_key", parameterToString(*r.clientKey, "csv")) + } + if r.penaltyBoxDuration != nil { + localVarFormParams.Add("penalty_box_duration", parameterToString(*r.penaltyBoxDuration, "")) + } + if r.action != nil { + localVarFormParams.Add("action", parameterToString(*r.action, "")) + } + if r.responseObjectName != nil { + localVarFormParams.Add("response_object_name", parameterToString(*r.responseObjectName, "")) + } + if r.loggerType != nil { + localVarFormParams.Add("logger_type", parameterToString(*r.loggerType, "")) + } + if r.featureRevision != nil { + localVarFormParams.Add("feature_revision", parameterToString(*r.featureRevision, "")) + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Fastly-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + _ = localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + + if localVarHTTPResponse.Request.Method != http.MethodGet && localVarHTTPResponse.Request.Method != http.MethodHead { + if remaining := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Remaining"); remaining != "" { + if i, err := strconv.Atoi(remaining); err == nil { + a.client.RateLimitRemaining = i + } + } + if reset := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Reset"); reset != "" { + if i, err := strconv.Atoi(reset); err == nil { + a.client.RateLimitReset = i + } + } + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // APIDeleteRateLimiterRequest represents a request for the resource. type APIDeleteRateLimiterRequest struct { ctx context.Context @@ -471,6 +739,239 @@ func (a *RateLimiterAPIService) ListRateLimitersExecute(r APIListRateLimitersReq } + if localVarHTTPResponse.Request.Method != http.MethodGet && localVarHTTPResponse.Request.Method != http.MethodHead { + if remaining := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Remaining"); remaining != "" { + if i, err := strconv.Atoi(remaining); err == nil { + a.client.RateLimitRemaining = i + } + } + if reset := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Reset"); reset != "" { + if i, err := strconv.Atoi(reset); err == nil { + a.client.RateLimitReset = i + } + } + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// APIUpdateRateLimiterRequest represents a request for the resource. +type APIUpdateRateLimiterRequest struct { + ctx context.Context + APIService RateLimiterAPI + rateLimiterID string + name *string + uriDictionaryName *string + httpMethods *[]string + rpsLimit *int32 + windowSize *int32 + clientKey *[]string + penaltyBoxDuration *int32 + action *string + responseObjectName *string + loggerType *string + featureRevision *int32 +} + +// Name A human readable name for the rate limiting rule. +func (r *APIUpdateRateLimiterRequest) Name(name string) *APIUpdateRateLimiterRequest { + r.name = &name + return r +} +// URIDictionaryName The name of an Edge Dictionary containing URIs as keys. If not defined or `null`, all origin URIs will be rate limited. +func (r *APIUpdateRateLimiterRequest) URIDictionaryName(uriDictionaryName string) *APIUpdateRateLimiterRequest { + r.uriDictionaryName = &uriDictionaryName + return r +} +// HTTPMethods Array of HTTP methods to apply rate limiting to. +func (r *APIUpdateRateLimiterRequest) HTTPMethods(httpMethods []string) *APIUpdateRateLimiterRequest { + r.httpMethods = &httpMethods + return r +} +// RpsLimit Upper limit of requests per second allowed by the rate limiter. +func (r *APIUpdateRateLimiterRequest) RpsLimit(rpsLimit int32) *APIUpdateRateLimiterRequest { + r.rpsLimit = &rpsLimit + return r +} +// WindowSize Number of seconds during which the RPS limit must be exceeded in order to trigger a violation. +func (r *APIUpdateRateLimiterRequest) WindowSize(windowSize int32) *APIUpdateRateLimiterRequest { + r.windowSize = &windowSize + return r +} +// ClientKey Array of VCL variables used to generate a counter key to identify a client. Example variables include `req.http.Fastly-Client-IP`, `req.http.User-Agent`, or a custom header like `req.http.API-Key`. +func (r *APIUpdateRateLimiterRequest) ClientKey(clientKey []string) *APIUpdateRateLimiterRequest { + r.clientKey = &clientKey + return r +} +// PenaltyBoxDuration Length of time in minutes that the rate limiter is in effect after the initial violation is detected. +func (r *APIUpdateRateLimiterRequest) PenaltyBoxDuration(penaltyBoxDuration int32) *APIUpdateRateLimiterRequest { + r.penaltyBoxDuration = &penaltyBoxDuration + return r +} +// Action The action to take when a rate limiter violation is detected. +func (r *APIUpdateRateLimiterRequest) Action(action string) *APIUpdateRateLimiterRequest { + r.action = &action + return r +} +// ResponseObjectName Name of existing response object. Required if `action` is `response_object`. Note that the rate limiter response is only updated to reflect the response object content when saving the rate limiter configuration. +func (r *APIUpdateRateLimiterRequest) ResponseObjectName(responseObjectName string) *APIUpdateRateLimiterRequest { + r.responseObjectName = &responseObjectName + return r +} +// LoggerType Name of the type of logging endpoint to be used when action is `log_only`. The logging endpoint type is used to determine the appropriate log format to use when emitting log entries. +func (r *APIUpdateRateLimiterRequest) LoggerType(loggerType string) *APIUpdateRateLimiterRequest { + r.loggerType = &loggerType + return r +} +// FeatureRevision Revision number of the rate limiting feature implementation. Defaults to the most recent revision. +func (r *APIUpdateRateLimiterRequest) FeatureRevision(featureRevision int32) *APIUpdateRateLimiterRequest { + r.featureRevision = &featureRevision + return r +} + +// Execute calls the API using the request data configured. +func (r APIUpdateRateLimiterRequest) Execute() (*RateLimiterResponse, *http.Response, error) { + return r.APIService.UpdateRateLimiterExecute(r) +} + +/* +UpdateRateLimiter Update a rate limiter + +Update a rate limiter by its ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param rateLimiterID Alphanumeric string identifying the rate limiter. + @return APIUpdateRateLimiterRequest +*/ +func (a *RateLimiterAPIService) UpdateRateLimiter(ctx context.Context, rateLimiterID string) APIUpdateRateLimiterRequest { + return APIUpdateRateLimiterRequest{ + APIService: a, + ctx: ctx, + rateLimiterID: rateLimiterID, + } +} + +// UpdateRateLimiterExecute executes the request +// @return RateLimiterResponse +func (a *RateLimiterAPIService) UpdateRateLimiterExecute(r APIUpdateRateLimiterRequest) (*RateLimiterResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody any + formFiles []formFile + localVarReturnValue *RateLimiterResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RateLimiterAPIService.UpdateRateLimiter") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rate-limiters/{rate_limiter_id}" + localVarPath = strings.ReplaceAll(localVarPath, "{"+"rate_limiter_id"+"}", gourl.PathEscape(parameterToString(r.rateLimiterID, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := gourl.Values{} + localVarFormParams := gourl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.name != nil { + localVarFormParams.Add("name", parameterToString(*r.name, "")) + } + if r.uriDictionaryName != nil { + localVarFormParams.Add("uri_dictionary_name", parameterToString(*r.uriDictionaryName, "")) + } + if r.httpMethods != nil { + localVarFormParams.Add("http_methods", parameterToString(*r.httpMethods, "csv")) + } + if r.rpsLimit != nil { + localVarFormParams.Add("rps_limit", parameterToString(*r.rpsLimit, "")) + } + if r.windowSize != nil { + localVarFormParams.Add("window_size", parameterToString(*r.windowSize, "")) + } + if r.clientKey != nil { + localVarFormParams.Add("client_key", parameterToString(*r.clientKey, "csv")) + } + if r.penaltyBoxDuration != nil { + localVarFormParams.Add("penalty_box_duration", parameterToString(*r.penaltyBoxDuration, "")) + } + if r.action != nil { + localVarFormParams.Add("action", parameterToString(*r.action, "")) + } + if r.responseObjectName != nil { + localVarFormParams.Add("response_object_name", parameterToString(*r.responseObjectName, "")) + } + if r.loggerType != nil { + localVarFormParams.Add("logger_type", parameterToString(*r.loggerType, "")) + } + if r.featureRevision != nil { + localVarFormParams.Add("feature_revision", parameterToString(*r.featureRevision, "")) + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Fastly-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + _ = localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + if localVarHTTPResponse.Request.Method != http.MethodGet && localVarHTTPResponse.Request.Method != http.MethodHead { if remaining := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Remaining"); remaining != "" { if i, err := strconv.Atoi(remaining); err == nil { diff --git a/fastly/client.go b/fastly/client.go index 443e00ba..016229c6 100644 --- a/fastly/client.go +++ b/fastly/client.go @@ -70,6 +70,8 @@ type APIClient struct { ApexRedirectAPI ApexRedirectAPI + AutomationTokensAPI AutomationTokensAPI + BackendAPI BackendAPI BillingAPI BillingAPI @@ -283,6 +285,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.ACLAPI = (*ACLAPIService)(&c.common) c.ACLEntryAPI = (*ACLEntryAPIService)(&c.common) c.ApexRedirectAPI = (*ApexRedirectAPIService)(&c.common) + c.AutomationTokensAPI = (*AutomationTokensAPIService)(&c.common) c.BackendAPI = (*BackendAPIService)(&c.common) c.BillingAPI = (*BillingAPIService)(&c.common) c.BillingAddressAPI = (*BillingAddressAPIService)(&c.common) diff --git a/fastly/configuration.go b/fastly/configuration.go index 072451ee..2a1cc471 100644 --- a/fastly/configuration.go +++ b/fastly/configuration.go @@ -105,7 +105,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), - UserAgent: "fastly-go/v1.0.0-beta.13", + UserAgent: "fastly-go/v1.0.0-beta.14", Debug: false, Servers: ServerConfigurations{ { @@ -208,6 +208,36 @@ func NewConfiguration() *Configuration { Description: "No description provided", }, }, + "AutomationTokensAPIService.CreateAutomationToken": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, + "AutomationTokensAPIService.GetAutomationTokenID": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, + "AutomationTokensAPIService.GetAutomationTokensIDServices": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, + "AutomationTokensAPIService.ListAutomationTokens": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, + "AutomationTokensAPIService.RevokeAutomationTokenID": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, "BackendAPIService.CreateBackend": { { URL: "https://api.fastly.com", @@ -1870,6 +1900,12 @@ func NewConfiguration() *Configuration { Description: "No description provided", }, }, + "RateLimiterAPIService.CreateRateLimiter": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, "RateLimiterAPIService.DeleteRateLimiter": { { URL: "https://api.fastly.com", @@ -1888,6 +1924,12 @@ func NewConfiguration() *Configuration { Description: "No description provided", }, }, + "RateLimiterAPIService.UpdateRateLimiter": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, "RealtimeAPIService.GetStatsLast120Seconds": { { URL: "https://rt.fastly.com", diff --git a/fastly/model_automation_token.go b/fastly/model_automation_token.go new file mode 100644 index 00000000..1a33b903 --- /dev/null +++ b/fastly/model_automation_token.go @@ -0,0 +1,312 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://developer.fastly.com/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" +) + +// AutomationToken struct for AutomationToken +type AutomationToken struct { + // The name of the token. + Name *string `json:"name,omitempty"` + // The role on the token. + Role *string `json:"role,omitempty"` + // (Optional) The service IDs of the services the token will have access to. Separate service IDs with a space. If no services are specified, the token will have access to all services on the account. + Services []string `json:"services,omitempty"` + // A space-delimited list of authorization scope. + Scope *string `json:"scope,omitempty"` + // A UTC time-stamp of when the token expires. + ExpiresAt *string `json:"expires_at,omitempty"` + AdditionalProperties map[string]any +} + +type _AutomationToken AutomationToken + +// NewAutomationToken instantiates a new AutomationToken object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAutomationToken() *AutomationToken { + this := AutomationToken{} + var scope string = "global" + this.Scope = &scope + return &this +} + +// NewAutomationTokenWithDefaults instantiates a new AutomationToken object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAutomationTokenWithDefaults() *AutomationToken { + this := AutomationToken{} + var scope string = "global" + this.Scope = &scope + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *AutomationToken) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationToken) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *AutomationToken) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *AutomationToken) SetName(v string) { + o.Name = &v +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *AutomationToken) GetRole() string { + if o == nil || o.Role == nil { + var ret string + return ret + } + return *o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationToken) GetRoleOk() (*string, bool) { + if o == nil || o.Role == nil { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *AutomationToken) HasRole() bool { + if o != nil && o.Role != nil { + return true + } + + return false +} + +// SetRole gets a reference to the given string and assigns it to the Role field. +func (o *AutomationToken) SetRole(v string) { + o.Role = &v +} + +// GetServices returns the Services field value if set, zero value otherwise. +func (o *AutomationToken) GetServices() []string { + if o == nil || o.Services == nil { + var ret []string + return ret + } + return o.Services +} + +// GetServicesOk returns a tuple with the Services field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationToken) GetServicesOk() ([]string, bool) { + if o == nil || o.Services == nil { + return nil, false + } + return o.Services, true +} + +// HasServices returns a boolean if a field has been set. +func (o *AutomationToken) HasServices() bool { + if o != nil && o.Services != nil { + return true + } + + return false +} + +// SetServices gets a reference to the given []string and assigns it to the Services field. +func (o *AutomationToken) SetServices(v []string) { + o.Services = v +} + +// GetScope returns the Scope field value if set, zero value otherwise. +func (o *AutomationToken) GetScope() string { + if o == nil || o.Scope == nil { + var ret string + return ret + } + return *o.Scope +} + +// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationToken) GetScopeOk() (*string, bool) { + if o == nil || o.Scope == nil { + return nil, false + } + return o.Scope, true +} + +// HasScope returns a boolean if a field has been set. +func (o *AutomationToken) HasScope() bool { + if o != nil && o.Scope != nil { + return true + } + + return false +} + +// SetScope gets a reference to the given string and assigns it to the Scope field. +func (o *AutomationToken) SetScope(v string) { + o.Scope = &v +} + +// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise. +func (o *AutomationToken) GetExpiresAt() string { + if o == nil || o.ExpiresAt == nil { + var ret string + return ret + } + return *o.ExpiresAt +} + +// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationToken) GetExpiresAtOk() (*string, bool) { + if o == nil || o.ExpiresAt == nil { + return nil, false + } + return o.ExpiresAt, true +} + +// HasExpiresAt returns a boolean if a field has been set. +func (o *AutomationToken) HasExpiresAt() bool { + if o != nil && o.ExpiresAt != nil { + return true + } + + return false +} + +// SetExpiresAt gets a reference to the given string and assigns it to the ExpiresAt field. +func (o *AutomationToken) SetExpiresAt(v string) { + o.ExpiresAt = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o AutomationToken) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Role != nil { + toSerialize["role"] = o.Role + } + if o.Services != nil { + toSerialize["services"] = o.Services + } + if o.Scope != nil { + toSerialize["scope"] = o.Scope + } + if o.ExpiresAt != nil { + toSerialize["expires_at"] = o.ExpiresAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *AutomationToken) UnmarshalJSON(bytes []byte) (err error) { + varAutomationToken := _AutomationToken{} + + if err = json.Unmarshal(bytes, &varAutomationToken); err == nil { + *o = AutomationToken(varAutomationToken) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "role") + delete(additionalProperties, "services") + delete(additionalProperties, "scope") + delete(additionalProperties, "expires_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableAutomationToken is a helper abstraction for handling nullable automationtoken types. +type NullableAutomationToken struct { + value *AutomationToken + isSet bool +} + +// Get returns the value. +func (v NullableAutomationToken) Get() *AutomationToken { + return v.value +} + +// Set modifies the value. +func (v *NullableAutomationToken) Set(val *AutomationToken) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableAutomationToken) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableAutomationToken) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableAutomationToken returns a pointer to a new instance of NullableAutomationToken. +func NewNullableAutomationToken(val *AutomationToken) *NullableAutomationToken { + return &NullableAutomationToken{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableAutomationToken) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableAutomationToken) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_automation_token_create_request.go b/fastly/model_automation_token_create_request.go new file mode 100644 index 00000000..61e91abc --- /dev/null +++ b/fastly/model_automation_token_create_request.go @@ -0,0 +1,155 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://developer.fastly.com/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" +) + +// AutomationTokenCreateRequest struct for AutomationTokenCreateRequest +type AutomationTokenCreateRequest struct { + Attributes *AutomationTokenCreateRequestAttributes `json:"attributes,omitempty"` + AdditionalProperties map[string]any +} + +type _AutomationTokenCreateRequest AutomationTokenCreateRequest + +// NewAutomationTokenCreateRequest instantiates a new AutomationTokenCreateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAutomationTokenCreateRequest() *AutomationTokenCreateRequest { + this := AutomationTokenCreateRequest{} + return &this +} + +// NewAutomationTokenCreateRequestWithDefaults instantiates a new AutomationTokenCreateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAutomationTokenCreateRequestWithDefaults() *AutomationTokenCreateRequest { + this := AutomationTokenCreateRequest{} + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *AutomationTokenCreateRequest) GetAttributes() AutomationTokenCreateRequestAttributes { + if o == nil || o.Attributes == nil { + var ret AutomationTokenCreateRequestAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateRequest) GetAttributesOk() (*AutomationTokenCreateRequestAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *AutomationTokenCreateRequest) HasAttributes() bool { + if o != nil && o.Attributes != nil { + return true + } + + return false +} + +// SetAttributes gets a reference to the given AutomationTokenCreateRequestAttributes and assigns it to the Attributes field. +func (o *AutomationTokenCreateRequest) SetAttributes(v AutomationTokenCreateRequestAttributes) { + o.Attributes = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o AutomationTokenCreateRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *AutomationTokenCreateRequest) UnmarshalJSON(bytes []byte) (err error) { + varAutomationTokenCreateRequest := _AutomationTokenCreateRequest{} + + if err = json.Unmarshal(bytes, &varAutomationTokenCreateRequest); err == nil { + *o = AutomationTokenCreateRequest(varAutomationTokenCreateRequest) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableAutomationTokenCreateRequest is a helper abstraction for handling nullable automationtokencreaterequest types. +type NullableAutomationTokenCreateRequest struct { + value *AutomationTokenCreateRequest + isSet bool +} + +// Get returns the value. +func (v NullableAutomationTokenCreateRequest) Get() *AutomationTokenCreateRequest { + return v.value +} + +// Set modifies the value. +func (v *NullableAutomationTokenCreateRequest) Set(val *AutomationTokenCreateRequest) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableAutomationTokenCreateRequest) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableAutomationTokenCreateRequest) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableAutomationTokenCreateRequest returns a pointer to a new instance of NullableAutomationTokenCreateRequest. +func NewNullableAutomationTokenCreateRequest(val *AutomationTokenCreateRequest) *NullableAutomationTokenCreateRequest { + return &NullableAutomationTokenCreateRequest{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableAutomationTokenCreateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableAutomationTokenCreateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_automation_token_create_request_attributes.go b/fastly/model_automation_token_create_request_attributes.go new file mode 100644 index 00000000..5391cafc --- /dev/null +++ b/fastly/model_automation_token_create_request_attributes.go @@ -0,0 +1,359 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://developer.fastly.com/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" + "time" +) + +// AutomationTokenCreateRequestAttributes struct for AutomationTokenCreateRequestAttributes +type AutomationTokenCreateRequestAttributes struct { + // name of the token + Name *string `json:"name,omitempty"` + Role *string `json:"role,omitempty"` + // List of service ids to limit the token + Services []string `json:"services,omitempty"` + Scope *string `json:"scope,omitempty"` + // A UTC time-stamp of when the token will expire. + ExpiresAt NullableTime `json:"expires_at,omitempty"` + // Indicates whether TLS access is enabled for the token. + TLSAccess *bool `json:"tls_access,omitempty"` + AdditionalProperties map[string]any +} + +type _AutomationTokenCreateRequestAttributes AutomationTokenCreateRequestAttributes + +// NewAutomationTokenCreateRequestAttributes instantiates a new AutomationTokenCreateRequestAttributes object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAutomationTokenCreateRequestAttributes() *AutomationTokenCreateRequestAttributes { + this := AutomationTokenCreateRequestAttributes{} + var scope string = "global" + this.Scope = &scope + return &this +} + +// NewAutomationTokenCreateRequestAttributesWithDefaults instantiates a new AutomationTokenCreateRequestAttributes object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAutomationTokenCreateRequestAttributesWithDefaults() *AutomationTokenCreateRequestAttributes { + this := AutomationTokenCreateRequestAttributes{} + var scope string = "global" + this.Scope = &scope + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *AutomationTokenCreateRequestAttributes) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateRequestAttributes) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *AutomationTokenCreateRequestAttributes) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *AutomationTokenCreateRequestAttributes) SetName(v string) { + o.Name = &v +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *AutomationTokenCreateRequestAttributes) GetRole() string { + if o == nil || o.Role == nil { + var ret string + return ret + } + return *o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateRequestAttributes) GetRoleOk() (*string, bool) { + if o == nil || o.Role == nil { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *AutomationTokenCreateRequestAttributes) HasRole() bool { + if o != nil && o.Role != nil { + return true + } + + return false +} + +// SetRole gets a reference to the given string and assigns it to the Role field. +func (o *AutomationTokenCreateRequestAttributes) SetRole(v string) { + o.Role = &v +} + +// GetServices returns the Services field value if set, zero value otherwise. +func (o *AutomationTokenCreateRequestAttributes) GetServices() []string { + if o == nil || o.Services == nil { + var ret []string + return ret + } + return o.Services +} + +// GetServicesOk returns a tuple with the Services field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateRequestAttributes) GetServicesOk() ([]string, bool) { + if o == nil || o.Services == nil { + return nil, false + } + return o.Services, true +} + +// HasServices returns a boolean if a field has been set. +func (o *AutomationTokenCreateRequestAttributes) HasServices() bool { + if o != nil && o.Services != nil { + return true + } + + return false +} + +// SetServices gets a reference to the given []string and assigns it to the Services field. +func (o *AutomationTokenCreateRequestAttributes) SetServices(v []string) { + o.Services = v +} + +// GetScope returns the Scope field value if set, zero value otherwise. +func (o *AutomationTokenCreateRequestAttributes) GetScope() string { + if o == nil || o.Scope == nil { + var ret string + return ret + } + return *o.Scope +} + +// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateRequestAttributes) GetScopeOk() (*string, bool) { + if o == nil || o.Scope == nil { + return nil, false + } + return o.Scope, true +} + +// HasScope returns a boolean if a field has been set. +func (o *AutomationTokenCreateRequestAttributes) HasScope() bool { + if o != nil && o.Scope != nil { + return true + } + + return false +} + +// SetScope gets a reference to the given string and assigns it to the Scope field. +func (o *AutomationTokenCreateRequestAttributes) SetScope(v string) { + o.Scope = &v +} + +// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AutomationTokenCreateRequestAttributes) GetExpiresAt() time.Time { + if o == nil || o.ExpiresAt.Get() == nil { + var ret time.Time + return ret + } + return *o.ExpiresAt.Get() +} + +// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AutomationTokenCreateRequestAttributes) GetExpiresAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.ExpiresAt.Get(), o.ExpiresAt.IsSet() +} + +// HasExpiresAt returns a boolean if a field has been set. +func (o *AutomationTokenCreateRequestAttributes) HasExpiresAt() bool { + if o != nil && o.ExpiresAt.IsSet() { + return true + } + + return false +} + +// SetExpiresAt gets a reference to the given NullableTime and assigns it to the ExpiresAt field. +func (o *AutomationTokenCreateRequestAttributes) SetExpiresAt(v time.Time) { + o.ExpiresAt.Set(&v) +} +// SetExpiresAtNil sets the value for ExpiresAt to be an explicit nil +func (o *AutomationTokenCreateRequestAttributes) SetExpiresAtNil() { + o.ExpiresAt.Set(nil) +} + +// UnsetExpiresAt ensures that no value is present for ExpiresAt, not even an explicit nil +func (o *AutomationTokenCreateRequestAttributes) UnsetExpiresAt() { + o.ExpiresAt.Unset() +} + +// GetTLSAccess returns the TLSAccess field value if set, zero value otherwise. +func (o *AutomationTokenCreateRequestAttributes) GetTLSAccess() bool { + if o == nil || o.TLSAccess == nil { + var ret bool + return ret + } + return *o.TLSAccess +} + +// GetTLSAccessOk returns a tuple with the TLSAccess field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateRequestAttributes) GetTLSAccessOk() (*bool, bool) { + if o == nil || o.TLSAccess == nil { + return nil, false + } + return o.TLSAccess, true +} + +// HasTLSAccess returns a boolean if a field has been set. +func (o *AutomationTokenCreateRequestAttributes) HasTLSAccess() bool { + if o != nil && o.TLSAccess != nil { + return true + } + + return false +} + +// SetTLSAccess gets a reference to the given bool and assigns it to the TLSAccess field. +func (o *AutomationTokenCreateRequestAttributes) SetTLSAccess(v bool) { + o.TLSAccess = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o AutomationTokenCreateRequestAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Role != nil { + toSerialize["role"] = o.Role + } + if o.Services != nil { + toSerialize["services"] = o.Services + } + if o.Scope != nil { + toSerialize["scope"] = o.Scope + } + if o.ExpiresAt.IsSet() { + toSerialize["expires_at"] = o.ExpiresAt.Get() + } + if o.TLSAccess != nil { + toSerialize["tls_access"] = o.TLSAccess + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *AutomationTokenCreateRequestAttributes) UnmarshalJSON(bytes []byte) (err error) { + varAutomationTokenCreateRequestAttributes := _AutomationTokenCreateRequestAttributes{} + + if err = json.Unmarshal(bytes, &varAutomationTokenCreateRequestAttributes); err == nil { + *o = AutomationTokenCreateRequestAttributes(varAutomationTokenCreateRequestAttributes) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "role") + delete(additionalProperties, "services") + delete(additionalProperties, "scope") + delete(additionalProperties, "expires_at") + delete(additionalProperties, "tls_access") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableAutomationTokenCreateRequestAttributes is a helper abstraction for handling nullable automationtokencreaterequestattributes types. +type NullableAutomationTokenCreateRequestAttributes struct { + value *AutomationTokenCreateRequestAttributes + isSet bool +} + +// Get returns the value. +func (v NullableAutomationTokenCreateRequestAttributes) Get() *AutomationTokenCreateRequestAttributes { + return v.value +} + +// Set modifies the value. +func (v *NullableAutomationTokenCreateRequestAttributes) Set(val *AutomationTokenCreateRequestAttributes) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableAutomationTokenCreateRequestAttributes) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableAutomationTokenCreateRequestAttributes) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableAutomationTokenCreateRequestAttributes returns a pointer to a new instance of NullableAutomationTokenCreateRequestAttributes. +func NewNullableAutomationTokenCreateRequestAttributes(val *AutomationTokenCreateRequestAttributes) *NullableAutomationTokenCreateRequestAttributes { + return &NullableAutomationTokenCreateRequestAttributes{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableAutomationTokenCreateRequestAttributes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableAutomationTokenCreateRequestAttributes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_automation_token_create_response.go b/fastly/model_automation_token_create_response.go new file mode 100644 index 00000000..a1f7d784 --- /dev/null +++ b/fastly/model_automation_token_create_response.go @@ -0,0 +1,708 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://developer.fastly.com/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" + "time" +) + +// AutomationTokenCreateResponse struct for AutomationTokenCreateResponse +type AutomationTokenCreateResponse struct { + // The name of the token. + Name *string `json:"name,omitempty"` + // The role on the token. + Role *string `json:"role,omitempty"` + // (Optional) The service IDs of the services the token will have access to. Separate service IDs with a space. If no services are specified, the token will have access to all services on the account. + Services []string `json:"services,omitempty"` + // A space-delimited list of authorization scope. + Scope *string `json:"scope,omitempty"` + // A UTC time-stamp of when the token expires. + ExpiresAt *string `json:"expires_at,omitempty"` + // A UTC time-stamp of when the token was created. + CreatedAt *time.Time `json:"created_at,omitempty"` + // Date and time in ISO 8601 format. + DeletedAt NullableTime `json:"deleted_at,omitempty"` + // Date and time in ISO 8601 format. + UpdatedAt NullableTime `json:"updated_at,omitempty"` + ID *ReadOnlyID `json:"id,omitempty"` + UserID *ReadOnlyUserID `json:"user_id,omitempty"` + CustomerID *ReadOnlyCustomerID `json:"customer_id,omitempty"` + SudoExpiresAt *time.Time `json:"sudo_expires_at,omitempty"` + AccessToken *string `json:"access_token,omitempty"` + // A UTC time-stamp of when the token was last used. + LastUsedAt *time.Time `json:"last_used_at,omitempty"` + // The User-Agent header of the client that last used the token. + UserAgent *string `json:"user_agent,omitempty"` + AdditionalProperties map[string]any +} + +type _AutomationTokenCreateResponse AutomationTokenCreateResponse + +// NewAutomationTokenCreateResponse instantiates a new AutomationTokenCreateResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAutomationTokenCreateResponse() *AutomationTokenCreateResponse { + this := AutomationTokenCreateResponse{} + var scope string = "global" + this.Scope = &scope + return &this +} + +// NewAutomationTokenCreateResponseWithDefaults instantiates a new AutomationTokenCreateResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAutomationTokenCreateResponseWithDefaults() *AutomationTokenCreateResponse { + this := AutomationTokenCreateResponse{} + var scope string = "global" + this.Scope = &scope + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *AutomationTokenCreateResponse) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateResponse) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *AutomationTokenCreateResponse) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *AutomationTokenCreateResponse) SetName(v string) { + o.Name = &v +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *AutomationTokenCreateResponse) GetRole() string { + if o == nil || o.Role == nil { + var ret string + return ret + } + return *o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateResponse) GetRoleOk() (*string, bool) { + if o == nil || o.Role == nil { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *AutomationTokenCreateResponse) HasRole() bool { + if o != nil && o.Role != nil { + return true + } + + return false +} + +// SetRole gets a reference to the given string and assigns it to the Role field. +func (o *AutomationTokenCreateResponse) SetRole(v string) { + o.Role = &v +} + +// GetServices returns the Services field value if set, zero value otherwise. +func (o *AutomationTokenCreateResponse) GetServices() []string { + if o == nil || o.Services == nil { + var ret []string + return ret + } + return o.Services +} + +// GetServicesOk returns a tuple with the Services field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateResponse) GetServicesOk() ([]string, bool) { + if o == nil || o.Services == nil { + return nil, false + } + return o.Services, true +} + +// HasServices returns a boolean if a field has been set. +func (o *AutomationTokenCreateResponse) HasServices() bool { + if o != nil && o.Services != nil { + return true + } + + return false +} + +// SetServices gets a reference to the given []string and assigns it to the Services field. +func (o *AutomationTokenCreateResponse) SetServices(v []string) { + o.Services = v +} + +// GetScope returns the Scope field value if set, zero value otherwise. +func (o *AutomationTokenCreateResponse) GetScope() string { + if o == nil || o.Scope == nil { + var ret string + return ret + } + return *o.Scope +} + +// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateResponse) GetScopeOk() (*string, bool) { + if o == nil || o.Scope == nil { + return nil, false + } + return o.Scope, true +} + +// HasScope returns a boolean if a field has been set. +func (o *AutomationTokenCreateResponse) HasScope() bool { + if o != nil && o.Scope != nil { + return true + } + + return false +} + +// SetScope gets a reference to the given string and assigns it to the Scope field. +func (o *AutomationTokenCreateResponse) SetScope(v string) { + o.Scope = &v +} + +// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise. +func (o *AutomationTokenCreateResponse) GetExpiresAt() string { + if o == nil || o.ExpiresAt == nil { + var ret string + return ret + } + return *o.ExpiresAt +} + +// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateResponse) GetExpiresAtOk() (*string, bool) { + if o == nil || o.ExpiresAt == nil { + return nil, false + } + return o.ExpiresAt, true +} + +// HasExpiresAt returns a boolean if a field has been set. +func (o *AutomationTokenCreateResponse) HasExpiresAt() bool { + if o != nil && o.ExpiresAt != nil { + return true + } + + return false +} + +// SetExpiresAt gets a reference to the given string and assigns it to the ExpiresAt field. +func (o *AutomationTokenCreateResponse) SetExpiresAt(v string) { + o.ExpiresAt = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *AutomationTokenCreateResponse) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateResponse) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *AutomationTokenCreateResponse) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *AutomationTokenCreateResponse) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDeletedAt returns the DeletedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AutomationTokenCreateResponse) GetDeletedAt() time.Time { + if o == nil || o.DeletedAt.Get() == nil { + var ret time.Time + return ret + } + return *o.DeletedAt.Get() +} + +// GetDeletedAtOk returns a tuple with the DeletedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AutomationTokenCreateResponse) GetDeletedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.DeletedAt.Get(), o.DeletedAt.IsSet() +} + +// HasDeletedAt returns a boolean if a field has been set. +func (o *AutomationTokenCreateResponse) HasDeletedAt() bool { + if o != nil && o.DeletedAt.IsSet() { + return true + } + + return false +} + +// SetDeletedAt gets a reference to the given NullableTime and assigns it to the DeletedAt field. +func (o *AutomationTokenCreateResponse) SetDeletedAt(v time.Time) { + o.DeletedAt.Set(&v) +} +// SetDeletedAtNil sets the value for DeletedAt to be an explicit nil +func (o *AutomationTokenCreateResponse) SetDeletedAtNil() { + o.DeletedAt.Set(nil) +} + +// UnsetDeletedAt ensures that no value is present for DeletedAt, not even an explicit nil +func (o *AutomationTokenCreateResponse) UnsetDeletedAt() { + o.DeletedAt.Unset() +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AutomationTokenCreateResponse) GetUpdatedAt() time.Time { + if o == nil || o.UpdatedAt.Get() == nil { + var ret time.Time + return ret + } + return *o.UpdatedAt.Get() +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AutomationTokenCreateResponse) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.UpdatedAt.Get(), o.UpdatedAt.IsSet() +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *AutomationTokenCreateResponse) HasUpdatedAt() bool { + if o != nil && o.UpdatedAt.IsSet() { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given NullableTime and assigns it to the UpdatedAt field. +func (o *AutomationTokenCreateResponse) SetUpdatedAt(v time.Time) { + o.UpdatedAt.Set(&v) +} +// SetUpdatedAtNil sets the value for UpdatedAt to be an explicit nil +func (o *AutomationTokenCreateResponse) SetUpdatedAtNil() { + o.UpdatedAt.Set(nil) +} + +// UnsetUpdatedAt ensures that no value is present for UpdatedAt, not even an explicit nil +func (o *AutomationTokenCreateResponse) UnsetUpdatedAt() { + o.UpdatedAt.Unset() +} + +// GetID returns the ID field value if set, zero value otherwise. +func (o *AutomationTokenCreateResponse) GetID() ReadOnlyID { + if o == nil || o.ID == nil { + var ret ReadOnlyID + return ret + } + return *o.ID +} + +// GetIDOk returns a tuple with the ID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateResponse) GetIDOk() (*ReadOnlyID, bool) { + if o == nil || o.ID == nil { + return nil, false + } + return o.ID, true +} + +// HasID returns a boolean if a field has been set. +func (o *AutomationTokenCreateResponse) HasID() bool { + if o != nil && o.ID != nil { + return true + } + + return false +} + +// SetID gets a reference to the given ReadOnlyID and assigns it to the ID field. +func (o *AutomationTokenCreateResponse) SetID(v ReadOnlyID) { + o.ID = &v +} + +// GetUserID returns the UserID field value if set, zero value otherwise. +func (o *AutomationTokenCreateResponse) GetUserID() ReadOnlyUserID { + if o == nil || o.UserID == nil { + var ret ReadOnlyUserID + return ret + } + return *o.UserID +} + +// GetUserIDOk returns a tuple with the UserID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateResponse) GetUserIDOk() (*ReadOnlyUserID, bool) { + if o == nil || o.UserID == nil { + return nil, false + } + return o.UserID, true +} + +// HasUserID returns a boolean if a field has been set. +func (o *AutomationTokenCreateResponse) HasUserID() bool { + if o != nil && o.UserID != nil { + return true + } + + return false +} + +// SetUserID gets a reference to the given ReadOnlyUserID and assigns it to the UserID field. +func (o *AutomationTokenCreateResponse) SetUserID(v ReadOnlyUserID) { + o.UserID = &v +} + +// GetCustomerID returns the CustomerID field value if set, zero value otherwise. +func (o *AutomationTokenCreateResponse) GetCustomerID() ReadOnlyCustomerID { + if o == nil || o.CustomerID == nil { + var ret ReadOnlyCustomerID + return ret + } + return *o.CustomerID +} + +// GetCustomerIDOk returns a tuple with the CustomerID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateResponse) GetCustomerIDOk() (*ReadOnlyCustomerID, bool) { + if o == nil || o.CustomerID == nil { + return nil, false + } + return o.CustomerID, true +} + +// HasCustomerID returns a boolean if a field has been set. +func (o *AutomationTokenCreateResponse) HasCustomerID() bool { + if o != nil && o.CustomerID != nil { + return true + } + + return false +} + +// SetCustomerID gets a reference to the given ReadOnlyCustomerID and assigns it to the CustomerID field. +func (o *AutomationTokenCreateResponse) SetCustomerID(v ReadOnlyCustomerID) { + o.CustomerID = &v +} + +// GetSudoExpiresAt returns the SudoExpiresAt field value if set, zero value otherwise. +func (o *AutomationTokenCreateResponse) GetSudoExpiresAt() time.Time { + if o == nil || o.SudoExpiresAt == nil { + var ret time.Time + return ret + } + return *o.SudoExpiresAt +} + +// GetSudoExpiresAtOk returns a tuple with the SudoExpiresAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateResponse) GetSudoExpiresAtOk() (*time.Time, bool) { + if o == nil || o.SudoExpiresAt == nil { + return nil, false + } + return o.SudoExpiresAt, true +} + +// HasSudoExpiresAt returns a boolean if a field has been set. +func (o *AutomationTokenCreateResponse) HasSudoExpiresAt() bool { + if o != nil && o.SudoExpiresAt != nil { + return true + } + + return false +} + +// SetSudoExpiresAt gets a reference to the given time.Time and assigns it to the SudoExpiresAt field. +func (o *AutomationTokenCreateResponse) SetSudoExpiresAt(v time.Time) { + o.SudoExpiresAt = &v +} + +// GetAccessToken returns the AccessToken field value if set, zero value otherwise. +func (o *AutomationTokenCreateResponse) GetAccessToken() string { + if o == nil || o.AccessToken == nil { + var ret string + return ret + } + return *o.AccessToken +} + +// GetAccessTokenOk returns a tuple with the AccessToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateResponse) GetAccessTokenOk() (*string, bool) { + if o == nil || o.AccessToken == nil { + return nil, false + } + return o.AccessToken, true +} + +// HasAccessToken returns a boolean if a field has been set. +func (o *AutomationTokenCreateResponse) HasAccessToken() bool { + if o != nil && o.AccessToken != nil { + return true + } + + return false +} + +// SetAccessToken gets a reference to the given string and assigns it to the AccessToken field. +func (o *AutomationTokenCreateResponse) SetAccessToken(v string) { + o.AccessToken = &v +} + +// GetLastUsedAt returns the LastUsedAt field value if set, zero value otherwise. +func (o *AutomationTokenCreateResponse) GetLastUsedAt() time.Time { + if o == nil || o.LastUsedAt == nil { + var ret time.Time + return ret + } + return *o.LastUsedAt +} + +// GetLastUsedAtOk returns a tuple with the LastUsedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateResponse) GetLastUsedAtOk() (*time.Time, bool) { + if o == nil || o.LastUsedAt == nil { + return nil, false + } + return o.LastUsedAt, true +} + +// HasLastUsedAt returns a boolean if a field has been set. +func (o *AutomationTokenCreateResponse) HasLastUsedAt() bool { + if o != nil && o.LastUsedAt != nil { + return true + } + + return false +} + +// SetLastUsedAt gets a reference to the given time.Time and assigns it to the LastUsedAt field. +func (o *AutomationTokenCreateResponse) SetLastUsedAt(v time.Time) { + o.LastUsedAt = &v +} + +// GetUserAgent returns the UserAgent field value if set, zero value otherwise. +func (o *AutomationTokenCreateResponse) GetUserAgent() string { + if o == nil || o.UserAgent == nil { + var ret string + return ret + } + return *o.UserAgent +} + +// GetUserAgentOk returns a tuple with the UserAgent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateResponse) GetUserAgentOk() (*string, bool) { + if o == nil || o.UserAgent == nil { + return nil, false + } + return o.UserAgent, true +} + +// HasUserAgent returns a boolean if a field has been set. +func (o *AutomationTokenCreateResponse) HasUserAgent() bool { + if o != nil && o.UserAgent != nil { + return true + } + + return false +} + +// SetUserAgent gets a reference to the given string and assigns it to the UserAgent field. +func (o *AutomationTokenCreateResponse) SetUserAgent(v string) { + o.UserAgent = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o AutomationTokenCreateResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Role != nil { + toSerialize["role"] = o.Role + } + if o.Services != nil { + toSerialize["services"] = o.Services + } + if o.Scope != nil { + toSerialize["scope"] = o.Scope + } + if o.ExpiresAt != nil { + toSerialize["expires_at"] = o.ExpiresAt + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.DeletedAt.IsSet() { + toSerialize["deleted_at"] = o.DeletedAt.Get() + } + if o.UpdatedAt.IsSet() { + toSerialize["updated_at"] = o.UpdatedAt.Get() + } + if o.ID != nil { + toSerialize["id"] = o.ID + } + if o.UserID != nil { + toSerialize["user_id"] = o.UserID + } + if o.CustomerID != nil { + toSerialize["customer_id"] = o.CustomerID + } + if o.SudoExpiresAt != nil { + toSerialize["sudo_expires_at"] = o.SudoExpiresAt + } + if o.AccessToken != nil { + toSerialize["access_token"] = o.AccessToken + } + if o.LastUsedAt != nil { + toSerialize["last_used_at"] = o.LastUsedAt + } + if o.UserAgent != nil { + toSerialize["user_agent"] = o.UserAgent + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *AutomationTokenCreateResponse) UnmarshalJSON(bytes []byte) (err error) { + varAutomationTokenCreateResponse := _AutomationTokenCreateResponse{} + + if err = json.Unmarshal(bytes, &varAutomationTokenCreateResponse); err == nil { + *o = AutomationTokenCreateResponse(varAutomationTokenCreateResponse) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "role") + delete(additionalProperties, "services") + delete(additionalProperties, "scope") + delete(additionalProperties, "expires_at") + delete(additionalProperties, "created_at") + delete(additionalProperties, "deleted_at") + delete(additionalProperties, "updated_at") + delete(additionalProperties, "id") + delete(additionalProperties, "user_id") + delete(additionalProperties, "customer_id") + delete(additionalProperties, "sudo_expires_at") + delete(additionalProperties, "access_token") + delete(additionalProperties, "last_used_at") + delete(additionalProperties, "user_agent") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableAutomationTokenCreateResponse is a helper abstraction for handling nullable automationtokencreateresponse types. +type NullableAutomationTokenCreateResponse struct { + value *AutomationTokenCreateResponse + isSet bool +} + +// Get returns the value. +func (v NullableAutomationTokenCreateResponse) Get() *AutomationTokenCreateResponse { + return v.value +} + +// Set modifies the value. +func (v *NullableAutomationTokenCreateResponse) Set(val *AutomationTokenCreateResponse) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableAutomationTokenCreateResponse) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableAutomationTokenCreateResponse) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableAutomationTokenCreateResponse returns a pointer to a new instance of NullableAutomationTokenCreateResponse. +func NewNullableAutomationTokenCreateResponse(val *AutomationTokenCreateResponse) *NullableAutomationTokenCreateResponse { + return &NullableAutomationTokenCreateResponse{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableAutomationTokenCreateResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableAutomationTokenCreateResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_automation_token_create_response_all_of.go b/fastly/model_automation_token_create_response_all_of.go new file mode 100644 index 00000000..72b4acac --- /dev/null +++ b/fastly/model_automation_token_create_response_all_of.go @@ -0,0 +1,418 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://developer.fastly.com/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" + "time" +) + +// AutomationTokenCreateResponseAllOf struct for AutomationTokenCreateResponseAllOf +type AutomationTokenCreateResponseAllOf struct { + ID *ReadOnlyID `json:"id,omitempty"` + UserID *ReadOnlyUserID `json:"user_id,omitempty"` + CustomerID *ReadOnlyCustomerID `json:"customer_id,omitempty"` + SudoExpiresAt *time.Time `json:"sudo_expires_at,omitempty"` + // A UTC time-stamp of when the token was created. + CreatedAt *time.Time `json:"created_at,omitempty"` + AccessToken *string `json:"access_token,omitempty"` + // A UTC time-stamp of when the token was last used. + LastUsedAt *time.Time `json:"last_used_at,omitempty"` + // The User-Agent header of the client that last used the token. + UserAgent *string `json:"user_agent,omitempty"` + AdditionalProperties map[string]any +} + +type _AutomationTokenCreateResponseAllOf AutomationTokenCreateResponseAllOf + +// NewAutomationTokenCreateResponseAllOf instantiates a new AutomationTokenCreateResponseAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAutomationTokenCreateResponseAllOf() *AutomationTokenCreateResponseAllOf { + this := AutomationTokenCreateResponseAllOf{} + return &this +} + +// NewAutomationTokenCreateResponseAllOfWithDefaults instantiates a new AutomationTokenCreateResponseAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAutomationTokenCreateResponseAllOfWithDefaults() *AutomationTokenCreateResponseAllOf { + this := AutomationTokenCreateResponseAllOf{} + return &this +} + +// GetID returns the ID field value if set, zero value otherwise. +func (o *AutomationTokenCreateResponseAllOf) GetID() ReadOnlyID { + if o == nil || o.ID == nil { + var ret ReadOnlyID + return ret + } + return *o.ID +} + +// GetIDOk returns a tuple with the ID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateResponseAllOf) GetIDOk() (*ReadOnlyID, bool) { + if o == nil || o.ID == nil { + return nil, false + } + return o.ID, true +} + +// HasID returns a boolean if a field has been set. +func (o *AutomationTokenCreateResponseAllOf) HasID() bool { + if o != nil && o.ID != nil { + return true + } + + return false +} + +// SetID gets a reference to the given ReadOnlyID and assigns it to the ID field. +func (o *AutomationTokenCreateResponseAllOf) SetID(v ReadOnlyID) { + o.ID = &v +} + +// GetUserID returns the UserID field value if set, zero value otherwise. +func (o *AutomationTokenCreateResponseAllOf) GetUserID() ReadOnlyUserID { + if o == nil || o.UserID == nil { + var ret ReadOnlyUserID + return ret + } + return *o.UserID +} + +// GetUserIDOk returns a tuple with the UserID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateResponseAllOf) GetUserIDOk() (*ReadOnlyUserID, bool) { + if o == nil || o.UserID == nil { + return nil, false + } + return o.UserID, true +} + +// HasUserID returns a boolean if a field has been set. +func (o *AutomationTokenCreateResponseAllOf) HasUserID() bool { + if o != nil && o.UserID != nil { + return true + } + + return false +} + +// SetUserID gets a reference to the given ReadOnlyUserID and assigns it to the UserID field. +func (o *AutomationTokenCreateResponseAllOf) SetUserID(v ReadOnlyUserID) { + o.UserID = &v +} + +// GetCustomerID returns the CustomerID field value if set, zero value otherwise. +func (o *AutomationTokenCreateResponseAllOf) GetCustomerID() ReadOnlyCustomerID { + if o == nil || o.CustomerID == nil { + var ret ReadOnlyCustomerID + return ret + } + return *o.CustomerID +} + +// GetCustomerIDOk returns a tuple with the CustomerID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateResponseAllOf) GetCustomerIDOk() (*ReadOnlyCustomerID, bool) { + if o == nil || o.CustomerID == nil { + return nil, false + } + return o.CustomerID, true +} + +// HasCustomerID returns a boolean if a field has been set. +func (o *AutomationTokenCreateResponseAllOf) HasCustomerID() bool { + if o != nil && o.CustomerID != nil { + return true + } + + return false +} + +// SetCustomerID gets a reference to the given ReadOnlyCustomerID and assigns it to the CustomerID field. +func (o *AutomationTokenCreateResponseAllOf) SetCustomerID(v ReadOnlyCustomerID) { + o.CustomerID = &v +} + +// GetSudoExpiresAt returns the SudoExpiresAt field value if set, zero value otherwise. +func (o *AutomationTokenCreateResponseAllOf) GetSudoExpiresAt() time.Time { + if o == nil || o.SudoExpiresAt == nil { + var ret time.Time + return ret + } + return *o.SudoExpiresAt +} + +// GetSudoExpiresAtOk returns a tuple with the SudoExpiresAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateResponseAllOf) GetSudoExpiresAtOk() (*time.Time, bool) { + if o == nil || o.SudoExpiresAt == nil { + return nil, false + } + return o.SudoExpiresAt, true +} + +// HasSudoExpiresAt returns a boolean if a field has been set. +func (o *AutomationTokenCreateResponseAllOf) HasSudoExpiresAt() bool { + if o != nil && o.SudoExpiresAt != nil { + return true + } + + return false +} + +// SetSudoExpiresAt gets a reference to the given time.Time and assigns it to the SudoExpiresAt field. +func (o *AutomationTokenCreateResponseAllOf) SetSudoExpiresAt(v time.Time) { + o.SudoExpiresAt = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *AutomationTokenCreateResponseAllOf) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt == nil { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateResponseAllOf) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *AutomationTokenCreateResponseAllOf) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *AutomationTokenCreateResponseAllOf) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetAccessToken returns the AccessToken field value if set, zero value otherwise. +func (o *AutomationTokenCreateResponseAllOf) GetAccessToken() string { + if o == nil || o.AccessToken == nil { + var ret string + return ret + } + return *o.AccessToken +} + +// GetAccessTokenOk returns a tuple with the AccessToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateResponseAllOf) GetAccessTokenOk() (*string, bool) { + if o == nil || o.AccessToken == nil { + return nil, false + } + return o.AccessToken, true +} + +// HasAccessToken returns a boolean if a field has been set. +func (o *AutomationTokenCreateResponseAllOf) HasAccessToken() bool { + if o != nil && o.AccessToken != nil { + return true + } + + return false +} + +// SetAccessToken gets a reference to the given string and assigns it to the AccessToken field. +func (o *AutomationTokenCreateResponseAllOf) SetAccessToken(v string) { + o.AccessToken = &v +} + +// GetLastUsedAt returns the LastUsedAt field value if set, zero value otherwise. +func (o *AutomationTokenCreateResponseAllOf) GetLastUsedAt() time.Time { + if o == nil || o.LastUsedAt == nil { + var ret time.Time + return ret + } + return *o.LastUsedAt +} + +// GetLastUsedAtOk returns a tuple with the LastUsedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateResponseAllOf) GetLastUsedAtOk() (*time.Time, bool) { + if o == nil || o.LastUsedAt == nil { + return nil, false + } + return o.LastUsedAt, true +} + +// HasLastUsedAt returns a boolean if a field has been set. +func (o *AutomationTokenCreateResponseAllOf) HasLastUsedAt() bool { + if o != nil && o.LastUsedAt != nil { + return true + } + + return false +} + +// SetLastUsedAt gets a reference to the given time.Time and assigns it to the LastUsedAt field. +func (o *AutomationTokenCreateResponseAllOf) SetLastUsedAt(v time.Time) { + o.LastUsedAt = &v +} + +// GetUserAgent returns the UserAgent field value if set, zero value otherwise. +func (o *AutomationTokenCreateResponseAllOf) GetUserAgent() string { + if o == nil || o.UserAgent == nil { + var ret string + return ret + } + return *o.UserAgent +} + +// GetUserAgentOk returns a tuple with the UserAgent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenCreateResponseAllOf) GetUserAgentOk() (*string, bool) { + if o == nil || o.UserAgent == nil { + return nil, false + } + return o.UserAgent, true +} + +// HasUserAgent returns a boolean if a field has been set. +func (o *AutomationTokenCreateResponseAllOf) HasUserAgent() bool { + if o != nil && o.UserAgent != nil { + return true + } + + return false +} + +// SetUserAgent gets a reference to the given string and assigns it to the UserAgent field. +func (o *AutomationTokenCreateResponseAllOf) SetUserAgent(v string) { + o.UserAgent = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o AutomationTokenCreateResponseAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.ID != nil { + toSerialize["id"] = o.ID + } + if o.UserID != nil { + toSerialize["user_id"] = o.UserID + } + if o.CustomerID != nil { + toSerialize["customer_id"] = o.CustomerID + } + if o.SudoExpiresAt != nil { + toSerialize["sudo_expires_at"] = o.SudoExpiresAt + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.AccessToken != nil { + toSerialize["access_token"] = o.AccessToken + } + if o.LastUsedAt != nil { + toSerialize["last_used_at"] = o.LastUsedAt + } + if o.UserAgent != nil { + toSerialize["user_agent"] = o.UserAgent + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *AutomationTokenCreateResponseAllOf) UnmarshalJSON(bytes []byte) (err error) { + varAutomationTokenCreateResponseAllOf := _AutomationTokenCreateResponseAllOf{} + + if err = json.Unmarshal(bytes, &varAutomationTokenCreateResponseAllOf); err == nil { + *o = AutomationTokenCreateResponseAllOf(varAutomationTokenCreateResponseAllOf) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "user_id") + delete(additionalProperties, "customer_id") + delete(additionalProperties, "sudo_expires_at") + delete(additionalProperties, "created_at") + delete(additionalProperties, "access_token") + delete(additionalProperties, "last_used_at") + delete(additionalProperties, "user_agent") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableAutomationTokenCreateResponseAllOf is a helper abstraction for handling nullable automationtokencreateresponseallof types. +type NullableAutomationTokenCreateResponseAllOf struct { + value *AutomationTokenCreateResponseAllOf + isSet bool +} + +// Get returns the value. +func (v NullableAutomationTokenCreateResponseAllOf) Get() *AutomationTokenCreateResponseAllOf { + return v.value +} + +// Set modifies the value. +func (v *NullableAutomationTokenCreateResponseAllOf) Set(val *AutomationTokenCreateResponseAllOf) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableAutomationTokenCreateResponseAllOf) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableAutomationTokenCreateResponseAllOf) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableAutomationTokenCreateResponseAllOf returns a pointer to a new instance of NullableAutomationTokenCreateResponseAllOf. +func NewNullableAutomationTokenCreateResponseAllOf(val *AutomationTokenCreateResponseAllOf) *NullableAutomationTokenCreateResponseAllOf { + return &NullableAutomationTokenCreateResponseAllOf{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableAutomationTokenCreateResponseAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableAutomationTokenCreateResponseAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_automation_token_response.go b/fastly/model_automation_token_response.go new file mode 100644 index 00000000..1f6f95e8 --- /dev/null +++ b/fastly/model_automation_token_response.go @@ -0,0 +1,671 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://developer.fastly.com/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" + "time" +) + +// AutomationTokenResponse struct for AutomationTokenResponse +type AutomationTokenResponse struct { + // The name of the token. + Name *string `json:"name,omitempty"` + Role *string `json:"role,omitempty"` + // (Optional) The service IDs of the services the token will have access to. Separate service IDs with a space. If no services are specified, the token will have access to all services on the account. + Services []string `json:"services,omitempty"` + // A space-delimited list of authorization scope. + Scope *string `json:"scope,omitempty"` + // (optional) A UTC time-stamp of when the token will expire. + ExpiresAt *string `json:"expires_at,omitempty"` + // A UTC time-stamp of when the token was created. + CreatedAt *string `json:"created_at,omitempty"` + // Date and time in ISO 8601 format. + DeletedAt NullableTime `json:"deleted_at,omitempty"` + // Date and time in ISO 8601 format. + UpdatedAt NullableTime `json:"updated_at,omitempty"` + ID *ReadOnlyID `json:"id,omitempty"` + CustomerID *ReadOnlyCustomerID `json:"customer_id,omitempty"` + // The IP address of the client that last used the token. + IP *string `json:"ip,omitempty"` + // The User-Agent header of the client that last used the token. + UserAgent *string `json:"user_agent,omitempty"` + SudoExpiresAt *string `json:"sudo_expires_at,omitempty"` + // A UTC time-stamp of when the token was last used. + LastUsedAt *time.Time `json:"last_used_at,omitempty"` + AdditionalProperties map[string]any +} + +type _AutomationTokenResponse AutomationTokenResponse + +// NewAutomationTokenResponse instantiates a new AutomationTokenResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAutomationTokenResponse() *AutomationTokenResponse { + this := AutomationTokenResponse{} + var scope string = "global" + this.Scope = &scope + return &this +} + +// NewAutomationTokenResponseWithDefaults instantiates a new AutomationTokenResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAutomationTokenResponseWithDefaults() *AutomationTokenResponse { + this := AutomationTokenResponse{} + var scope string = "global" + this.Scope = &scope + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *AutomationTokenResponse) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenResponse) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *AutomationTokenResponse) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *AutomationTokenResponse) SetName(v string) { + o.Name = &v +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *AutomationTokenResponse) GetRole() string { + if o == nil || o.Role == nil { + var ret string + return ret + } + return *o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenResponse) GetRoleOk() (*string, bool) { + if o == nil || o.Role == nil { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *AutomationTokenResponse) HasRole() bool { + if o != nil && o.Role != nil { + return true + } + + return false +} + +// SetRole gets a reference to the given string and assigns it to the Role field. +func (o *AutomationTokenResponse) SetRole(v string) { + o.Role = &v +} + +// GetServices returns the Services field value if set, zero value otherwise. +func (o *AutomationTokenResponse) GetServices() []string { + if o == nil || o.Services == nil { + var ret []string + return ret + } + return o.Services +} + +// GetServicesOk returns a tuple with the Services field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenResponse) GetServicesOk() ([]string, bool) { + if o == nil || o.Services == nil { + return nil, false + } + return o.Services, true +} + +// HasServices returns a boolean if a field has been set. +func (o *AutomationTokenResponse) HasServices() bool { + if o != nil && o.Services != nil { + return true + } + + return false +} + +// SetServices gets a reference to the given []string and assigns it to the Services field. +func (o *AutomationTokenResponse) SetServices(v []string) { + o.Services = v +} + +// GetScope returns the Scope field value if set, zero value otherwise. +func (o *AutomationTokenResponse) GetScope() string { + if o == nil || o.Scope == nil { + var ret string + return ret + } + return *o.Scope +} + +// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenResponse) GetScopeOk() (*string, bool) { + if o == nil || o.Scope == nil { + return nil, false + } + return o.Scope, true +} + +// HasScope returns a boolean if a field has been set. +func (o *AutomationTokenResponse) HasScope() bool { + if o != nil && o.Scope != nil { + return true + } + + return false +} + +// SetScope gets a reference to the given string and assigns it to the Scope field. +func (o *AutomationTokenResponse) SetScope(v string) { + o.Scope = &v +} + +// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise. +func (o *AutomationTokenResponse) GetExpiresAt() string { + if o == nil || o.ExpiresAt == nil { + var ret string + return ret + } + return *o.ExpiresAt +} + +// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenResponse) GetExpiresAtOk() (*string, bool) { + if o == nil || o.ExpiresAt == nil { + return nil, false + } + return o.ExpiresAt, true +} + +// HasExpiresAt returns a boolean if a field has been set. +func (o *AutomationTokenResponse) HasExpiresAt() bool { + if o != nil && o.ExpiresAt != nil { + return true + } + + return false +} + +// SetExpiresAt gets a reference to the given string and assigns it to the ExpiresAt field. +func (o *AutomationTokenResponse) SetExpiresAt(v string) { + o.ExpiresAt = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *AutomationTokenResponse) GetCreatedAt() string { + if o == nil || o.CreatedAt == nil { + var ret string + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenResponse) GetCreatedAtOk() (*string, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *AutomationTokenResponse) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field. +func (o *AutomationTokenResponse) SetCreatedAt(v string) { + o.CreatedAt = &v +} + +// GetDeletedAt returns the DeletedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AutomationTokenResponse) GetDeletedAt() time.Time { + if o == nil || o.DeletedAt.Get() == nil { + var ret time.Time + return ret + } + return *o.DeletedAt.Get() +} + +// GetDeletedAtOk returns a tuple with the DeletedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AutomationTokenResponse) GetDeletedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.DeletedAt.Get(), o.DeletedAt.IsSet() +} + +// HasDeletedAt returns a boolean if a field has been set. +func (o *AutomationTokenResponse) HasDeletedAt() bool { + if o != nil && o.DeletedAt.IsSet() { + return true + } + + return false +} + +// SetDeletedAt gets a reference to the given NullableTime and assigns it to the DeletedAt field. +func (o *AutomationTokenResponse) SetDeletedAt(v time.Time) { + o.DeletedAt.Set(&v) +} +// SetDeletedAtNil sets the value for DeletedAt to be an explicit nil +func (o *AutomationTokenResponse) SetDeletedAtNil() { + o.DeletedAt.Set(nil) +} + +// UnsetDeletedAt ensures that no value is present for DeletedAt, not even an explicit nil +func (o *AutomationTokenResponse) UnsetDeletedAt() { + o.DeletedAt.Unset() +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AutomationTokenResponse) GetUpdatedAt() time.Time { + if o == nil || o.UpdatedAt.Get() == nil { + var ret time.Time + return ret + } + return *o.UpdatedAt.Get() +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AutomationTokenResponse) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.UpdatedAt.Get(), o.UpdatedAt.IsSet() +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *AutomationTokenResponse) HasUpdatedAt() bool { + if o != nil && o.UpdatedAt.IsSet() { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given NullableTime and assigns it to the UpdatedAt field. +func (o *AutomationTokenResponse) SetUpdatedAt(v time.Time) { + o.UpdatedAt.Set(&v) +} +// SetUpdatedAtNil sets the value for UpdatedAt to be an explicit nil +func (o *AutomationTokenResponse) SetUpdatedAtNil() { + o.UpdatedAt.Set(nil) +} + +// UnsetUpdatedAt ensures that no value is present for UpdatedAt, not even an explicit nil +func (o *AutomationTokenResponse) UnsetUpdatedAt() { + o.UpdatedAt.Unset() +} + +// GetID returns the ID field value if set, zero value otherwise. +func (o *AutomationTokenResponse) GetID() ReadOnlyID { + if o == nil || o.ID == nil { + var ret ReadOnlyID + return ret + } + return *o.ID +} + +// GetIDOk returns a tuple with the ID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenResponse) GetIDOk() (*ReadOnlyID, bool) { + if o == nil || o.ID == nil { + return nil, false + } + return o.ID, true +} + +// HasID returns a boolean if a field has been set. +func (o *AutomationTokenResponse) HasID() bool { + if o != nil && o.ID != nil { + return true + } + + return false +} + +// SetID gets a reference to the given ReadOnlyID and assigns it to the ID field. +func (o *AutomationTokenResponse) SetID(v ReadOnlyID) { + o.ID = &v +} + +// GetCustomerID returns the CustomerID field value if set, zero value otherwise. +func (o *AutomationTokenResponse) GetCustomerID() ReadOnlyCustomerID { + if o == nil || o.CustomerID == nil { + var ret ReadOnlyCustomerID + return ret + } + return *o.CustomerID +} + +// GetCustomerIDOk returns a tuple with the CustomerID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenResponse) GetCustomerIDOk() (*ReadOnlyCustomerID, bool) { + if o == nil || o.CustomerID == nil { + return nil, false + } + return o.CustomerID, true +} + +// HasCustomerID returns a boolean if a field has been set. +func (o *AutomationTokenResponse) HasCustomerID() bool { + if o != nil && o.CustomerID != nil { + return true + } + + return false +} + +// SetCustomerID gets a reference to the given ReadOnlyCustomerID and assigns it to the CustomerID field. +func (o *AutomationTokenResponse) SetCustomerID(v ReadOnlyCustomerID) { + o.CustomerID = &v +} + +// GetIP returns the IP field value if set, zero value otherwise. +func (o *AutomationTokenResponse) GetIP() string { + if o == nil || o.IP == nil { + var ret string + return ret + } + return *o.IP +} + +// GetIPOk returns a tuple with the IP field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenResponse) GetIPOk() (*string, bool) { + if o == nil || o.IP == nil { + return nil, false + } + return o.IP, true +} + +// HasIP returns a boolean if a field has been set. +func (o *AutomationTokenResponse) HasIP() bool { + if o != nil && o.IP != nil { + return true + } + + return false +} + +// SetIP gets a reference to the given string and assigns it to the IP field. +func (o *AutomationTokenResponse) SetIP(v string) { + o.IP = &v +} + +// GetUserAgent returns the UserAgent field value if set, zero value otherwise. +func (o *AutomationTokenResponse) GetUserAgent() string { + if o == nil || o.UserAgent == nil { + var ret string + return ret + } + return *o.UserAgent +} + +// GetUserAgentOk returns a tuple with the UserAgent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenResponse) GetUserAgentOk() (*string, bool) { + if o == nil || o.UserAgent == nil { + return nil, false + } + return o.UserAgent, true +} + +// HasUserAgent returns a boolean if a field has been set. +func (o *AutomationTokenResponse) HasUserAgent() bool { + if o != nil && o.UserAgent != nil { + return true + } + + return false +} + +// SetUserAgent gets a reference to the given string and assigns it to the UserAgent field. +func (o *AutomationTokenResponse) SetUserAgent(v string) { + o.UserAgent = &v +} + +// GetSudoExpiresAt returns the SudoExpiresAt field value if set, zero value otherwise. +func (o *AutomationTokenResponse) GetSudoExpiresAt() string { + if o == nil || o.SudoExpiresAt == nil { + var ret string + return ret + } + return *o.SudoExpiresAt +} + +// GetSudoExpiresAtOk returns a tuple with the SudoExpiresAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenResponse) GetSudoExpiresAtOk() (*string, bool) { + if o == nil || o.SudoExpiresAt == nil { + return nil, false + } + return o.SudoExpiresAt, true +} + +// HasSudoExpiresAt returns a boolean if a field has been set. +func (o *AutomationTokenResponse) HasSudoExpiresAt() bool { + if o != nil && o.SudoExpiresAt != nil { + return true + } + + return false +} + +// SetSudoExpiresAt gets a reference to the given string and assigns it to the SudoExpiresAt field. +func (o *AutomationTokenResponse) SetSudoExpiresAt(v string) { + o.SudoExpiresAt = &v +} + +// GetLastUsedAt returns the LastUsedAt field value if set, zero value otherwise. +func (o *AutomationTokenResponse) GetLastUsedAt() time.Time { + if o == nil || o.LastUsedAt == nil { + var ret time.Time + return ret + } + return *o.LastUsedAt +} + +// GetLastUsedAtOk returns a tuple with the LastUsedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenResponse) GetLastUsedAtOk() (*time.Time, bool) { + if o == nil || o.LastUsedAt == nil { + return nil, false + } + return o.LastUsedAt, true +} + +// HasLastUsedAt returns a boolean if a field has been set. +func (o *AutomationTokenResponse) HasLastUsedAt() bool { + if o != nil && o.LastUsedAt != nil { + return true + } + + return false +} + +// SetLastUsedAt gets a reference to the given time.Time and assigns it to the LastUsedAt field. +func (o *AutomationTokenResponse) SetLastUsedAt(v time.Time) { + o.LastUsedAt = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o AutomationTokenResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Role != nil { + toSerialize["role"] = o.Role + } + if o.Services != nil { + toSerialize["services"] = o.Services + } + if o.Scope != nil { + toSerialize["scope"] = o.Scope + } + if o.ExpiresAt != nil { + toSerialize["expires_at"] = o.ExpiresAt + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.DeletedAt.IsSet() { + toSerialize["deleted_at"] = o.DeletedAt.Get() + } + if o.UpdatedAt.IsSet() { + toSerialize["updated_at"] = o.UpdatedAt.Get() + } + if o.ID != nil { + toSerialize["id"] = o.ID + } + if o.CustomerID != nil { + toSerialize["customer_id"] = o.CustomerID + } + if o.IP != nil { + toSerialize["ip"] = o.IP + } + if o.UserAgent != nil { + toSerialize["user_agent"] = o.UserAgent + } + if o.SudoExpiresAt != nil { + toSerialize["sudo_expires_at"] = o.SudoExpiresAt + } + if o.LastUsedAt != nil { + toSerialize["last_used_at"] = o.LastUsedAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *AutomationTokenResponse) UnmarshalJSON(bytes []byte) (err error) { + varAutomationTokenResponse := _AutomationTokenResponse{} + + if err = json.Unmarshal(bytes, &varAutomationTokenResponse); err == nil { + *o = AutomationTokenResponse(varAutomationTokenResponse) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "role") + delete(additionalProperties, "services") + delete(additionalProperties, "scope") + delete(additionalProperties, "expires_at") + delete(additionalProperties, "created_at") + delete(additionalProperties, "deleted_at") + delete(additionalProperties, "updated_at") + delete(additionalProperties, "id") + delete(additionalProperties, "customer_id") + delete(additionalProperties, "ip") + delete(additionalProperties, "user_agent") + delete(additionalProperties, "sudo_expires_at") + delete(additionalProperties, "last_used_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableAutomationTokenResponse is a helper abstraction for handling nullable automationtokenresponse types. +type NullableAutomationTokenResponse struct { + value *AutomationTokenResponse + isSet bool +} + +// Get returns the value. +func (v NullableAutomationTokenResponse) Get() *AutomationTokenResponse { + return v.value +} + +// Set modifies the value. +func (v *NullableAutomationTokenResponse) Set(val *AutomationTokenResponse) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableAutomationTokenResponse) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableAutomationTokenResponse) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableAutomationTokenResponse returns a pointer to a new instance of NullableAutomationTokenResponse. +func NewNullableAutomationTokenResponse(val *AutomationTokenResponse) *NullableAutomationTokenResponse { + return &NullableAutomationTokenResponse{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableAutomationTokenResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableAutomationTokenResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_automation_token_response_all_of.go b/fastly/model_automation_token_response_all_of.go new file mode 100644 index 00000000..4da354c1 --- /dev/null +++ b/fastly/model_automation_token_response_all_of.go @@ -0,0 +1,457 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://developer.fastly.com/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" + "time" +) + +// AutomationTokenResponseAllOf struct for AutomationTokenResponseAllOf +type AutomationTokenResponseAllOf struct { + ID *ReadOnlyID `json:"id,omitempty"` + CustomerID *ReadOnlyCustomerID `json:"customer_id,omitempty"` + Role *string `json:"role,omitempty"` + // The IP address of the client that last used the token. + IP *string `json:"ip,omitempty"` + // The User-Agent header of the client that last used the token. + UserAgent *string `json:"user_agent,omitempty"` + SudoExpiresAt *string `json:"sudo_expires_at,omitempty"` + // A UTC time-stamp of when the token was last used. + LastUsedAt *time.Time `json:"last_used_at,omitempty"` + // A UTC time-stamp of when the token was created. + CreatedAt *string `json:"created_at,omitempty"` + // (optional) A UTC time-stamp of when the token will expire. + ExpiresAt *string `json:"expires_at,omitempty"` + AdditionalProperties map[string]any +} + +type _AutomationTokenResponseAllOf AutomationTokenResponseAllOf + +// NewAutomationTokenResponseAllOf instantiates a new AutomationTokenResponseAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAutomationTokenResponseAllOf() *AutomationTokenResponseAllOf { + this := AutomationTokenResponseAllOf{} + return &this +} + +// NewAutomationTokenResponseAllOfWithDefaults instantiates a new AutomationTokenResponseAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAutomationTokenResponseAllOfWithDefaults() *AutomationTokenResponseAllOf { + this := AutomationTokenResponseAllOf{} + return &this +} + +// GetID returns the ID field value if set, zero value otherwise. +func (o *AutomationTokenResponseAllOf) GetID() ReadOnlyID { + if o == nil || o.ID == nil { + var ret ReadOnlyID + return ret + } + return *o.ID +} + +// GetIDOk returns a tuple with the ID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenResponseAllOf) GetIDOk() (*ReadOnlyID, bool) { + if o == nil || o.ID == nil { + return nil, false + } + return o.ID, true +} + +// HasID returns a boolean if a field has been set. +func (o *AutomationTokenResponseAllOf) HasID() bool { + if o != nil && o.ID != nil { + return true + } + + return false +} + +// SetID gets a reference to the given ReadOnlyID and assigns it to the ID field. +func (o *AutomationTokenResponseAllOf) SetID(v ReadOnlyID) { + o.ID = &v +} + +// GetCustomerID returns the CustomerID field value if set, zero value otherwise. +func (o *AutomationTokenResponseAllOf) GetCustomerID() ReadOnlyCustomerID { + if o == nil || o.CustomerID == nil { + var ret ReadOnlyCustomerID + return ret + } + return *o.CustomerID +} + +// GetCustomerIDOk returns a tuple with the CustomerID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenResponseAllOf) GetCustomerIDOk() (*ReadOnlyCustomerID, bool) { + if o == nil || o.CustomerID == nil { + return nil, false + } + return o.CustomerID, true +} + +// HasCustomerID returns a boolean if a field has been set. +func (o *AutomationTokenResponseAllOf) HasCustomerID() bool { + if o != nil && o.CustomerID != nil { + return true + } + + return false +} + +// SetCustomerID gets a reference to the given ReadOnlyCustomerID and assigns it to the CustomerID field. +func (o *AutomationTokenResponseAllOf) SetCustomerID(v ReadOnlyCustomerID) { + o.CustomerID = &v +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *AutomationTokenResponseAllOf) GetRole() string { + if o == nil || o.Role == nil { + var ret string + return ret + } + return *o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenResponseAllOf) GetRoleOk() (*string, bool) { + if o == nil || o.Role == nil { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *AutomationTokenResponseAllOf) HasRole() bool { + if o != nil && o.Role != nil { + return true + } + + return false +} + +// SetRole gets a reference to the given string and assigns it to the Role field. +func (o *AutomationTokenResponseAllOf) SetRole(v string) { + o.Role = &v +} + +// GetIP returns the IP field value if set, zero value otherwise. +func (o *AutomationTokenResponseAllOf) GetIP() string { + if o == nil || o.IP == nil { + var ret string + return ret + } + return *o.IP +} + +// GetIPOk returns a tuple with the IP field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenResponseAllOf) GetIPOk() (*string, bool) { + if o == nil || o.IP == nil { + return nil, false + } + return o.IP, true +} + +// HasIP returns a boolean if a field has been set. +func (o *AutomationTokenResponseAllOf) HasIP() bool { + if o != nil && o.IP != nil { + return true + } + + return false +} + +// SetIP gets a reference to the given string and assigns it to the IP field. +func (o *AutomationTokenResponseAllOf) SetIP(v string) { + o.IP = &v +} + +// GetUserAgent returns the UserAgent field value if set, zero value otherwise. +func (o *AutomationTokenResponseAllOf) GetUserAgent() string { + if o == nil || o.UserAgent == nil { + var ret string + return ret + } + return *o.UserAgent +} + +// GetUserAgentOk returns a tuple with the UserAgent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenResponseAllOf) GetUserAgentOk() (*string, bool) { + if o == nil || o.UserAgent == nil { + return nil, false + } + return o.UserAgent, true +} + +// HasUserAgent returns a boolean if a field has been set. +func (o *AutomationTokenResponseAllOf) HasUserAgent() bool { + if o != nil && o.UserAgent != nil { + return true + } + + return false +} + +// SetUserAgent gets a reference to the given string and assigns it to the UserAgent field. +func (o *AutomationTokenResponseAllOf) SetUserAgent(v string) { + o.UserAgent = &v +} + +// GetSudoExpiresAt returns the SudoExpiresAt field value if set, zero value otherwise. +func (o *AutomationTokenResponseAllOf) GetSudoExpiresAt() string { + if o == nil || o.SudoExpiresAt == nil { + var ret string + return ret + } + return *o.SudoExpiresAt +} + +// GetSudoExpiresAtOk returns a tuple with the SudoExpiresAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenResponseAllOf) GetSudoExpiresAtOk() (*string, bool) { + if o == nil || o.SudoExpiresAt == nil { + return nil, false + } + return o.SudoExpiresAt, true +} + +// HasSudoExpiresAt returns a boolean if a field has been set. +func (o *AutomationTokenResponseAllOf) HasSudoExpiresAt() bool { + if o != nil && o.SudoExpiresAt != nil { + return true + } + + return false +} + +// SetSudoExpiresAt gets a reference to the given string and assigns it to the SudoExpiresAt field. +func (o *AutomationTokenResponseAllOf) SetSudoExpiresAt(v string) { + o.SudoExpiresAt = &v +} + +// GetLastUsedAt returns the LastUsedAt field value if set, zero value otherwise. +func (o *AutomationTokenResponseAllOf) GetLastUsedAt() time.Time { + if o == nil || o.LastUsedAt == nil { + var ret time.Time + return ret + } + return *o.LastUsedAt +} + +// GetLastUsedAtOk returns a tuple with the LastUsedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenResponseAllOf) GetLastUsedAtOk() (*time.Time, bool) { + if o == nil || o.LastUsedAt == nil { + return nil, false + } + return o.LastUsedAt, true +} + +// HasLastUsedAt returns a boolean if a field has been set. +func (o *AutomationTokenResponseAllOf) HasLastUsedAt() bool { + if o != nil && o.LastUsedAt != nil { + return true + } + + return false +} + +// SetLastUsedAt gets a reference to the given time.Time and assigns it to the LastUsedAt field. +func (o *AutomationTokenResponseAllOf) SetLastUsedAt(v time.Time) { + o.LastUsedAt = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *AutomationTokenResponseAllOf) GetCreatedAt() string { + if o == nil || o.CreatedAt == nil { + var ret string + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenResponseAllOf) GetCreatedAtOk() (*string, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *AutomationTokenResponseAllOf) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field. +func (o *AutomationTokenResponseAllOf) SetCreatedAt(v string) { + o.CreatedAt = &v +} + +// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise. +func (o *AutomationTokenResponseAllOf) GetExpiresAt() string { + if o == nil || o.ExpiresAt == nil { + var ret string + return ret + } + return *o.ExpiresAt +} + +// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutomationTokenResponseAllOf) GetExpiresAtOk() (*string, bool) { + if o == nil || o.ExpiresAt == nil { + return nil, false + } + return o.ExpiresAt, true +} + +// HasExpiresAt returns a boolean if a field has been set. +func (o *AutomationTokenResponseAllOf) HasExpiresAt() bool { + if o != nil && o.ExpiresAt != nil { + return true + } + + return false +} + +// SetExpiresAt gets a reference to the given string and assigns it to the ExpiresAt field. +func (o *AutomationTokenResponseAllOf) SetExpiresAt(v string) { + o.ExpiresAt = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o AutomationTokenResponseAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.ID != nil { + toSerialize["id"] = o.ID + } + if o.CustomerID != nil { + toSerialize["customer_id"] = o.CustomerID + } + if o.Role != nil { + toSerialize["role"] = o.Role + } + if o.IP != nil { + toSerialize["ip"] = o.IP + } + if o.UserAgent != nil { + toSerialize["user_agent"] = o.UserAgent + } + if o.SudoExpiresAt != nil { + toSerialize["sudo_expires_at"] = o.SudoExpiresAt + } + if o.LastUsedAt != nil { + toSerialize["last_used_at"] = o.LastUsedAt + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.ExpiresAt != nil { + toSerialize["expires_at"] = o.ExpiresAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *AutomationTokenResponseAllOf) UnmarshalJSON(bytes []byte) (err error) { + varAutomationTokenResponseAllOf := _AutomationTokenResponseAllOf{} + + if err = json.Unmarshal(bytes, &varAutomationTokenResponseAllOf); err == nil { + *o = AutomationTokenResponseAllOf(varAutomationTokenResponseAllOf) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "customer_id") + delete(additionalProperties, "role") + delete(additionalProperties, "ip") + delete(additionalProperties, "user_agent") + delete(additionalProperties, "sudo_expires_at") + delete(additionalProperties, "last_used_at") + delete(additionalProperties, "created_at") + delete(additionalProperties, "expires_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableAutomationTokenResponseAllOf is a helper abstraction for handling nullable automationtokenresponseallof types. +type NullableAutomationTokenResponseAllOf struct { + value *AutomationTokenResponseAllOf + isSet bool +} + +// Get returns the value. +func (v NullableAutomationTokenResponseAllOf) Get() *AutomationTokenResponseAllOf { + return v.value +} + +// Set modifies the value. +func (v *NullableAutomationTokenResponseAllOf) Set(val *AutomationTokenResponseAllOf) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableAutomationTokenResponseAllOf) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableAutomationTokenResponseAllOf) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableAutomationTokenResponseAllOf returns a pointer to a new instance of NullableAutomationTokenResponseAllOf. +func NewNullableAutomationTokenResponseAllOf(val *AutomationTokenResponseAllOf) *NullableAutomationTokenResponseAllOf { + return &NullableAutomationTokenResponseAllOf{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableAutomationTokenResponseAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableAutomationTokenResponseAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_error_response.go b/fastly/model_error_response.go new file mode 100644 index 00000000..667ffc9c --- /dev/null +++ b/fastly/model_error_response.go @@ -0,0 +1,266 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://developer.fastly.com/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" +) + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + Detail *string `json:"detail,omitempty"` + Errors []any `json:"errors,omitempty"` + Status *int32 `json:"status,omitempty"` + Title *string `json:"title,omitempty"` + AdditionalProperties map[string]any +} + +type _ErrorResponse ErrorResponse + +// NewErrorResponse instantiates a new ErrorResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewErrorResponse() *ErrorResponse { + this := ErrorResponse{} + return &this +} + +// NewErrorResponseWithDefaults instantiates a new ErrorResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorResponseWithDefaults() *ErrorResponse { + this := ErrorResponse{} + return &this +} + +// GetDetail returns the Detail field value if set, zero value otherwise. +func (o *ErrorResponse) GetDetail() string { + if o == nil || o.Detail == nil { + var ret string + return ret + } + return *o.Detail +} + +// GetDetailOk returns a tuple with the Detail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorResponse) GetDetailOk() (*string, bool) { + if o == nil || o.Detail == nil { + return nil, false + } + return o.Detail, true +} + +// HasDetail returns a boolean if a field has been set. +func (o *ErrorResponse) HasDetail() bool { + if o != nil && o.Detail != nil { + return true + } + + return false +} + +// SetDetail gets a reference to the given string and assigns it to the Detail field. +func (o *ErrorResponse) SetDetail(v string) { + o.Detail = &v +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *ErrorResponse) GetErrors() []any { + if o == nil || o.Errors == nil { + var ret []any + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorResponse) GetErrorsOk() ([]any, bool) { + if o == nil || o.Errors == nil { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *ErrorResponse) HasErrors() bool { + if o != nil && o.Errors != nil { + return true + } + + return false +} + +// SetErrors gets a reference to the given []any and assigns it to the Errors field. +func (o *ErrorResponse) SetErrors(v []any) { + o.Errors = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *ErrorResponse) GetStatus() int32 { + if o == nil || o.Status == nil { + var ret int32 + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorResponse) GetStatusOk() (*int32, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *ErrorResponse) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given int32 and assigns it to the Status field. +func (o *ErrorResponse) SetStatus(v int32) { + o.Status = &v +} + +// GetTitle returns the Title field value if set, zero value otherwise. +func (o *ErrorResponse) GetTitle() string { + if o == nil || o.Title == nil { + var ret string + return ret + } + return *o.Title +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorResponse) GetTitleOk() (*string, bool) { + if o == nil || o.Title == nil { + return nil, false + } + return o.Title, true +} + +// HasTitle returns a boolean if a field has been set. +func (o *ErrorResponse) HasTitle() bool { + if o != nil && o.Title != nil { + return true + } + + return false +} + +// SetTitle gets a reference to the given string and assigns it to the Title field. +func (o *ErrorResponse) SetTitle(v string) { + o.Title = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ErrorResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Detail != nil { + toSerialize["detail"] = o.Detail + } + if o.Errors != nil { + toSerialize["errors"] = o.Errors + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + if o.Title != nil { + toSerialize["title"] = o.Title + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *ErrorResponse) UnmarshalJSON(bytes []byte) (err error) { + varErrorResponse := _ErrorResponse{} + + if err = json.Unmarshal(bytes, &varErrorResponse); err == nil { + *o = ErrorResponse(varErrorResponse) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "detail") + delete(additionalProperties, "errors") + delete(additionalProperties, "status") + delete(additionalProperties, "title") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableErrorResponse is a helper abstraction for handling nullable errorresponse types. +type NullableErrorResponse struct { + value *ErrorResponse + isSet bool +} + +// Get returns the value. +func (v NullableErrorResponse) Get() *ErrorResponse { + return v.value +} + +// Set modifies the value. +func (v *NullableErrorResponse) Set(val *ErrorResponse) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableErrorResponse) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableErrorResponse) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableErrorResponse returns a pointer to a new instance of NullableErrorResponse. +func NewNullableErrorResponse(val *ErrorResponse) *NullableErrorResponse { + return &NullableErrorResponse{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableErrorResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableErrorResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_historical_field_results_attributes.go b/fastly/model_historical_field_results_attributes.go index c6173535..270548c1 100644 --- a/fastly/model_historical_field_results_attributes.go +++ b/fastly/model_historical_field_results_attributes.go @@ -453,7 +453,7 @@ type HistoricalFieldResultsAttributes struct { DdosActionClose *int32 `json:"ddos_action_close,omitempty"` // The number of times the blackhole action was taken. The blackhole action quietly closes a TCP connection without sending a reset. The blackhole action quietly closes a TCP connection without notifying its peer (all TCP state is dropped). DdosActionBlackhole *int32 `json:"ddos_action_blackhole,omitempty"` - ServiceID string `json:"service_id,omitempty"` + ServiceID *ReadOnlyIDService `json:"service_id,omitempty"` StartTime *int32 `json:"start_time,omitempty"` AdditionalProperties map[string]any } @@ -7405,23 +7405,22 @@ func (o *HistoricalFieldResultsAttributes) SetDdosActionBlackhole(v int32) { o.DdosActionBlackhole = &v } -// GetServiceID returns the ServiceID field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *HistoricalFieldResultsAttributes) GetServiceID() string { - if o == nil { - var ret string +// GetServiceID returns the ServiceID field value if set, zero value otherwise. +func (o *HistoricalFieldResultsAttributes) GetServiceID() ReadOnlyIDService { + if o == nil || o.ServiceID == nil { + var ret ReadOnlyIDService return ret } - return o.ServiceID + return *o.ServiceID } // GetServiceIDOk returns a tuple with the ServiceID field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *HistoricalFieldResultsAttributes) GetServiceIDOk() (*string, bool) { +func (o *HistoricalFieldResultsAttributes) GetServiceIDOk() (*ReadOnlyIDService, bool) { if o == nil || o.ServiceID == nil { return nil, false } - return &o.ServiceID, true + return o.ServiceID, true } // HasServiceID returns a boolean if a field has been set. @@ -7433,9 +7432,9 @@ func (o *HistoricalFieldResultsAttributes) HasServiceID() bool { return false } -// SetServiceID gets a reference to the given string and assigns it to the ServiceID field. -func (o *HistoricalFieldResultsAttributes) SetServiceID(v string) { - o.ServiceID = v +// SetServiceID gets a reference to the given ReadOnlyIDService and assigns it to the ServiceID field. +func (o *HistoricalFieldResultsAttributes) SetServiceID(v ReadOnlyIDService) { + o.ServiceID = &v } // GetStartTime returns the StartTime field value if set, zero value otherwise. diff --git a/fastly/model_historical_field_results_attributes_all_of.go b/fastly/model_historical_field_results_attributes_all_of.go index 1259981f..81ba5650 100644 --- a/fastly/model_historical_field_results_attributes_all_of.go +++ b/fastly/model_historical_field_results_attributes_all_of.go @@ -19,7 +19,7 @@ import ( // HistoricalFieldResultsAttributesAllOf struct for HistoricalFieldResultsAttributesAllOf type HistoricalFieldResultsAttributesAllOf struct { - ServiceID string `json:"service_id,omitempty"` + ServiceID *ReadOnlyIDService `json:"service_id,omitempty"` StartTime *int32 `json:"start_time,omitempty"` AdditionalProperties map[string]any } @@ -43,23 +43,22 @@ func NewHistoricalFieldResultsAttributesAllOfWithDefaults() *HistoricalFieldResu return &this } -// GetServiceID returns the ServiceID field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *HistoricalFieldResultsAttributesAllOf) GetServiceID() string { - if o == nil { - var ret string +// GetServiceID returns the ServiceID field value if set, zero value otherwise. +func (o *HistoricalFieldResultsAttributesAllOf) GetServiceID() ReadOnlyIDService { + if o == nil || o.ServiceID == nil { + var ret ReadOnlyIDService return ret } - return o.ServiceID + return *o.ServiceID } // GetServiceIDOk returns a tuple with the ServiceID field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *HistoricalFieldResultsAttributesAllOf) GetServiceIDOk() (*string, bool) { +func (o *HistoricalFieldResultsAttributesAllOf) GetServiceIDOk() (*ReadOnlyIDService, bool) { if o == nil || o.ServiceID == nil { return nil, false } - return &o.ServiceID, true + return o.ServiceID, true } // HasServiceID returns a boolean if a field has been set. @@ -71,9 +70,9 @@ func (o *HistoricalFieldResultsAttributesAllOf) HasServiceID() bool { return false } -// SetServiceID gets a reference to the given string and assigns it to the ServiceID field. -func (o *HistoricalFieldResultsAttributesAllOf) SetServiceID(v string) { - o.ServiceID = v +// SetServiceID gets a reference to the given ReadOnlyIDService and assigns it to the ServiceID field. +func (o *HistoricalFieldResultsAttributesAllOf) SetServiceID(v ReadOnlyIDService) { + o.ServiceID = &v } // GetStartTime returns the StartTime field value if set, zero value otherwise. diff --git a/fastly/model_inline_response_200_1.go b/fastly/model_inline_response_200_1.go index 01ff5bef..1a05aa2d 100644 --- a/fastly/model_inline_response_200_1.go +++ b/fastly/model_inline_response_200_1.go @@ -19,8 +19,8 @@ import ( // InlineResponse2001 struct for InlineResponse2001 type InlineResponse2001 struct { - // Time-stamp (GMT) when the domain_ownership validation will expire. - ExpiresAt *string `json:"expires_at,omitempty"` + // The service IDs of the services the token will have access to. Separate service IDs with a space. + Data []string `json:"data,omitempty"` AdditionalProperties map[string]any } @@ -43,44 +43,44 @@ func NewInlineResponse2001WithDefaults() *InlineResponse2001 { return &this } -// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise. -func (o *InlineResponse2001) GetExpiresAt() string { - if o == nil || o.ExpiresAt == nil { - var ret string +// GetData returns the Data field value if set, zero value otherwise. +func (o *InlineResponse2001) GetData() []string { + if o == nil || o.Data == nil { + var ret []string return ret } - return *o.ExpiresAt + return o.Data } -// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise +// GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InlineResponse2001) GetExpiresAtOk() (*string, bool) { - if o == nil || o.ExpiresAt == nil { +func (o *InlineResponse2001) GetDataOk() ([]string, bool) { + if o == nil || o.Data == nil { return nil, false } - return o.ExpiresAt, true + return o.Data, true } -// HasExpiresAt returns a boolean if a field has been set. -func (o *InlineResponse2001) HasExpiresAt() bool { - if o != nil && o.ExpiresAt != nil { +// HasData returns a boolean if a field has been set. +func (o *InlineResponse2001) HasData() bool { + if o != nil && o.Data != nil { return true } return false } -// SetExpiresAt gets a reference to the given string and assigns it to the ExpiresAt field. -func (o *InlineResponse2001) SetExpiresAt(v string) { - o.ExpiresAt = &v +// SetData gets a reference to the given []string and assigns it to the Data field. +func (o *InlineResponse2001) SetData(v []string) { + o.Data = v } // MarshalJSON implements the json.Marshaler interface. // Marshaler is the interface implemented by types that can marshal themselves into valid JSON. func (o InlineResponse2001) MarshalJSON() ([]byte, error) { toSerialize := map[string]any{} - if o.ExpiresAt != nil { - toSerialize["expires_at"] = o.ExpiresAt + if o.Data != nil { + toSerialize["data"] = o.Data } for key, value := range o.AdditionalProperties { @@ -102,7 +102,7 @@ func (o *InlineResponse2001) UnmarshalJSON(bytes []byte) (err error) { additionalProperties := make(map[string]any) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "expires_at") + delete(additionalProperties, "data") o.AdditionalProperties = additionalProperties } diff --git a/fastly/model_inline_response_200_2.go b/fastly/model_inline_response_200_2.go index 910092a4..b03e744b 100644 --- a/fastly/model_inline_response_200_2.go +++ b/fastly/model_inline_response_200_2.go @@ -19,8 +19,8 @@ import ( // InlineResponse2002 struct for InlineResponse2002 type InlineResponse2002 struct { - Data []StoreResponse `json:"data,omitempty"` - Meta *InlineResponse2002Meta `json:"meta,omitempty"` + // Time-stamp (GMT) when the domain_ownership validation will expire. + ExpiresAt *string `json:"expires_at,omitempty"` AdditionalProperties map[string]any } @@ -43,79 +43,44 @@ func NewInlineResponse2002WithDefaults() *InlineResponse2002 { return &this } -// GetData returns the Data field value if set, zero value otherwise. -func (o *InlineResponse2002) GetData() []StoreResponse { - if o == nil || o.Data == nil { - var ret []StoreResponse +// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise. +func (o *InlineResponse2002) GetExpiresAt() string { + if o == nil || o.ExpiresAt == nil { + var ret string return ret } - return o.Data + return *o.ExpiresAt } -// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InlineResponse2002) GetDataOk() ([]StoreResponse, bool) { - if o == nil || o.Data == nil { +func (o *InlineResponse2002) GetExpiresAtOk() (*string, bool) { + if o == nil || o.ExpiresAt == nil { return nil, false } - return o.Data, true + return o.ExpiresAt, true } -// HasData returns a boolean if a field has been set. -func (o *InlineResponse2002) HasData() bool { - if o != nil && o.Data != nil { +// HasExpiresAt returns a boolean if a field has been set. +func (o *InlineResponse2002) HasExpiresAt() bool { + if o != nil && o.ExpiresAt != nil { return true } return false } -// SetData gets a reference to the given []StoreResponse and assigns it to the Data field. -func (o *InlineResponse2002) SetData(v []StoreResponse) { - o.Data = v -} - -// GetMeta returns the Meta field value if set, zero value otherwise. -func (o *InlineResponse2002) GetMeta() InlineResponse2002Meta { - if o == nil || o.Meta == nil { - var ret InlineResponse2002Meta - return ret - } - return *o.Meta -} - -// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InlineResponse2002) GetMetaOk() (*InlineResponse2002Meta, bool) { - if o == nil || o.Meta == nil { - return nil, false - } - return o.Meta, true -} - -// HasMeta returns a boolean if a field has been set. -func (o *InlineResponse2002) HasMeta() bool { - if o != nil && o.Meta != nil { - return true - } - - return false -} - -// SetMeta gets a reference to the given InlineResponse2002Meta and assigns it to the Meta field. -func (o *InlineResponse2002) SetMeta(v InlineResponse2002Meta) { - o.Meta = &v +// SetExpiresAt gets a reference to the given string and assigns it to the ExpiresAt field. +func (o *InlineResponse2002) SetExpiresAt(v string) { + o.ExpiresAt = &v } // MarshalJSON implements the json.Marshaler interface. // Marshaler is the interface implemented by types that can marshal themselves into valid JSON. func (o InlineResponse2002) MarshalJSON() ([]byte, error) { toSerialize := map[string]any{} - if o.Data != nil { - toSerialize["data"] = o.Data - } - if o.Meta != nil { - toSerialize["meta"] = o.Meta + if o.ExpiresAt != nil { + toSerialize["expires_at"] = o.ExpiresAt } for key, value := range o.AdditionalProperties { @@ -137,8 +102,7 @@ func (o *InlineResponse2002) UnmarshalJSON(bytes []byte) (err error) { additionalProperties := make(map[string]any) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "data") - delete(additionalProperties, "meta") + delete(additionalProperties, "expires_at") o.AdditionalProperties = additionalProperties } diff --git a/fastly/model_inline_response_200_3.go b/fastly/model_inline_response_200_3.go index da341d31..1318dcf0 100644 --- a/fastly/model_inline_response_200_3.go +++ b/fastly/model_inline_response_200_3.go @@ -19,7 +19,7 @@ import ( // InlineResponse2003 struct for InlineResponse2003 type InlineResponse2003 struct { - Data []string `json:"data,omitempty"` + Data []StoreResponse `json:"data,omitempty"` Meta *InlineResponse2003Meta `json:"meta,omitempty"` AdditionalProperties map[string]any } @@ -44,9 +44,9 @@ func NewInlineResponse2003WithDefaults() *InlineResponse2003 { } // GetData returns the Data field value if set, zero value otherwise. -func (o *InlineResponse2003) GetData() []string { +func (o *InlineResponse2003) GetData() []StoreResponse { if o == nil || o.Data == nil { - var ret []string + var ret []StoreResponse return ret } return o.Data @@ -54,7 +54,7 @@ func (o *InlineResponse2003) GetData() []string { // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InlineResponse2003) GetDataOk() ([]string, bool) { +func (o *InlineResponse2003) GetDataOk() ([]StoreResponse, bool) { if o == nil || o.Data == nil { return nil, false } @@ -70,8 +70,8 @@ func (o *InlineResponse2003) HasData() bool { return false } -// SetData gets a reference to the given []string and assigns it to the Data field. -func (o *InlineResponse2003) SetData(v []string) { +// SetData gets a reference to the given []StoreResponse and assigns it to the Data field. +func (o *InlineResponse2003) SetData(v []StoreResponse) { o.Data = v } diff --git a/fastly/model_inline_response_200_3_meta.go b/fastly/model_inline_response_200_3_meta.go index 7f8fa8fa..7f1e28a9 100644 --- a/fastly/model_inline_response_200_3_meta.go +++ b/fastly/model_inline_response_200_3_meta.go @@ -17,9 +17,11 @@ import ( "encoding/json" ) -// InlineResponse2003Meta struct for InlineResponse2003Meta +// InlineResponse2003Meta Meta for the pagination. type InlineResponse2003Meta struct { + // Cursor for the next page. NextCursor *string `json:"next_cursor,omitempty"` + // Entries returned. Limit *int32 `json:"limit,omitempty"` AdditionalProperties map[string]any } diff --git a/fastly/model_inline_response_200_4.go b/fastly/model_inline_response_200_4.go new file mode 100644 index 00000000..4c76a142 --- /dev/null +++ b/fastly/model_inline_response_200_4.go @@ -0,0 +1,192 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://developer.fastly.com/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" +) + +// InlineResponse2004 struct for InlineResponse2004 +type InlineResponse2004 struct { + Data []string `json:"data,omitempty"` + Meta *InlineResponse2004Meta `json:"meta,omitempty"` + AdditionalProperties map[string]any +} + +type _InlineResponse2004 InlineResponse2004 + +// NewInlineResponse2004 instantiates a new InlineResponse2004 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInlineResponse2004() *InlineResponse2004 { + this := InlineResponse2004{} + return &this +} + +// NewInlineResponse2004WithDefaults instantiates a new InlineResponse2004 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInlineResponse2004WithDefaults() *InlineResponse2004 { + this := InlineResponse2004{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *InlineResponse2004) GetData() []string { + if o == nil || o.Data == nil { + var ret []string + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineResponse2004) GetDataOk() ([]string, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *InlineResponse2004) HasData() bool { + if o != nil && o.Data != nil { + return true + } + + return false +} + +// SetData gets a reference to the given []string and assigns it to the Data field. +func (o *InlineResponse2004) SetData(v []string) { + o.Data = v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *InlineResponse2004) GetMeta() InlineResponse2004Meta { + if o == nil || o.Meta == nil { + var ret InlineResponse2004Meta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineResponse2004) GetMetaOk() (*InlineResponse2004Meta, bool) { + if o == nil || o.Meta == nil { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *InlineResponse2004) HasMeta() bool { + if o != nil && o.Meta != nil { + return true + } + + return false +} + +// SetMeta gets a reference to the given InlineResponse2004Meta and assigns it to the Meta field. +func (o *InlineResponse2004) SetMeta(v InlineResponse2004Meta) { + o.Meta = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o InlineResponse2004) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Data != nil { + toSerialize["data"] = o.Data + } + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *InlineResponse2004) UnmarshalJSON(bytes []byte) (err error) { + varInlineResponse2004 := _InlineResponse2004{} + + if err = json.Unmarshal(bytes, &varInlineResponse2004); err == nil { + *o = InlineResponse2004(varInlineResponse2004) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "data") + delete(additionalProperties, "meta") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableInlineResponse2004 is a helper abstraction for handling nullable inlineresponse2004 types. +type NullableInlineResponse2004 struct { + value *InlineResponse2004 + isSet bool +} + +// Get returns the value. +func (v NullableInlineResponse2004) Get() *InlineResponse2004 { + return v.value +} + +// Set modifies the value. +func (v *NullableInlineResponse2004) Set(val *InlineResponse2004) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableInlineResponse2004) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableInlineResponse2004) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableInlineResponse2004 returns a pointer to a new instance of NullableInlineResponse2004. +func NewNullableInlineResponse2004(val *InlineResponse2004) *NullableInlineResponse2004 { + return &NullableInlineResponse2004{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableInlineResponse2004) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableInlineResponse2004) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_inline_response_200_2_meta.go b/fastly/model_inline_response_200_4_meta.go similarity index 65% rename from fastly/model_inline_response_200_2_meta.go rename to fastly/model_inline_response_200_4_meta.go index b7136ce8..6fa24c7f 100644 --- a/fastly/model_inline_response_200_2_meta.go +++ b/fastly/model_inline_response_200_4_meta.go @@ -17,36 +17,34 @@ import ( "encoding/json" ) -// InlineResponse2002Meta Meta for the pagination. -type InlineResponse2002Meta struct { - // Cursor for the next page. +// InlineResponse2004Meta struct for InlineResponse2004Meta +type InlineResponse2004Meta struct { NextCursor *string `json:"next_cursor,omitempty"` - // Entries returned. Limit *int32 `json:"limit,omitempty"` AdditionalProperties map[string]any } -type _InlineResponse2002Meta InlineResponse2002Meta +type _InlineResponse2004Meta InlineResponse2004Meta -// NewInlineResponse2002Meta instantiates a new InlineResponse2002Meta object +// NewInlineResponse2004Meta instantiates a new InlineResponse2004Meta object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewInlineResponse2002Meta() *InlineResponse2002Meta { - this := InlineResponse2002Meta{} +func NewInlineResponse2004Meta() *InlineResponse2004Meta { + this := InlineResponse2004Meta{} return &this } -// NewInlineResponse2002MetaWithDefaults instantiates a new InlineResponse2002Meta object +// NewInlineResponse2004MetaWithDefaults instantiates a new InlineResponse2004Meta object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set -func NewInlineResponse2002MetaWithDefaults() *InlineResponse2002Meta { - this := InlineResponse2002Meta{} +func NewInlineResponse2004MetaWithDefaults() *InlineResponse2004Meta { + this := InlineResponse2004Meta{} return &this } // GetNextCursor returns the NextCursor field value if set, zero value otherwise. -func (o *InlineResponse2002Meta) GetNextCursor() string { +func (o *InlineResponse2004Meta) GetNextCursor() string { if o == nil || o.NextCursor == nil { var ret string return ret @@ -56,7 +54,7 @@ func (o *InlineResponse2002Meta) GetNextCursor() string { // GetNextCursorOk returns a tuple with the NextCursor field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InlineResponse2002Meta) GetNextCursorOk() (*string, bool) { +func (o *InlineResponse2004Meta) GetNextCursorOk() (*string, bool) { if o == nil || o.NextCursor == nil { return nil, false } @@ -64,7 +62,7 @@ func (o *InlineResponse2002Meta) GetNextCursorOk() (*string, bool) { } // HasNextCursor returns a boolean if a field has been set. -func (o *InlineResponse2002Meta) HasNextCursor() bool { +func (o *InlineResponse2004Meta) HasNextCursor() bool { if o != nil && o.NextCursor != nil { return true } @@ -73,12 +71,12 @@ func (o *InlineResponse2002Meta) HasNextCursor() bool { } // SetNextCursor gets a reference to the given string and assigns it to the NextCursor field. -func (o *InlineResponse2002Meta) SetNextCursor(v string) { +func (o *InlineResponse2004Meta) SetNextCursor(v string) { o.NextCursor = &v } // GetLimit returns the Limit field value if set, zero value otherwise. -func (o *InlineResponse2002Meta) GetLimit() int32 { +func (o *InlineResponse2004Meta) GetLimit() int32 { if o == nil || o.Limit == nil { var ret int32 return ret @@ -88,7 +86,7 @@ func (o *InlineResponse2002Meta) GetLimit() int32 { // GetLimitOk returns a tuple with the Limit field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InlineResponse2002Meta) GetLimitOk() (*int32, bool) { +func (o *InlineResponse2004Meta) GetLimitOk() (*int32, bool) { if o == nil || o.Limit == nil { return nil, false } @@ -96,7 +94,7 @@ func (o *InlineResponse2002Meta) GetLimitOk() (*int32, bool) { } // HasLimit returns a boolean if a field has been set. -func (o *InlineResponse2002Meta) HasLimit() bool { +func (o *InlineResponse2004Meta) HasLimit() bool { if o != nil && o.Limit != nil { return true } @@ -105,13 +103,13 @@ func (o *InlineResponse2002Meta) HasLimit() bool { } // SetLimit gets a reference to the given int32 and assigns it to the Limit field. -func (o *InlineResponse2002Meta) SetLimit(v int32) { +func (o *InlineResponse2004Meta) SetLimit(v int32) { o.Limit = &v } // MarshalJSON implements the json.Marshaler interface. // Marshaler is the interface implemented by types that can marshal themselves into valid JSON. -func (o InlineResponse2002Meta) MarshalJSON() ([]byte, error) { +func (o InlineResponse2004Meta) MarshalJSON() ([]byte, error) { toSerialize := map[string]any{} if o.NextCursor != nil { toSerialize["next_cursor"] = o.NextCursor @@ -129,11 +127,11 @@ func (o InlineResponse2002Meta) MarshalJSON() ([]byte, error) { // UnmarshalJSON implements the Unmarshaler interface. // Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. -func (o *InlineResponse2002Meta) UnmarshalJSON(bytes []byte) (err error) { - varInlineResponse2002Meta := _InlineResponse2002Meta{} +func (o *InlineResponse2004Meta) UnmarshalJSON(bytes []byte) (err error) { + varInlineResponse2004Meta := _InlineResponse2004Meta{} - if err = json.Unmarshal(bytes, &varInlineResponse2002Meta); err == nil { - *o = InlineResponse2002Meta(varInlineResponse2002Meta) + if err = json.Unmarshal(bytes, &varInlineResponse2004Meta); err == nil { + *o = InlineResponse2004Meta(varInlineResponse2004Meta) } additionalProperties := make(map[string]any) @@ -147,48 +145,48 @@ func (o *InlineResponse2002Meta) UnmarshalJSON(bytes []byte) (err error) { return err } -// NullableInlineResponse2002Meta is a helper abstraction for handling nullable inlineresponse2002meta types. -type NullableInlineResponse2002Meta struct { - value *InlineResponse2002Meta +// NullableInlineResponse2004Meta is a helper abstraction for handling nullable inlineresponse2004meta types. +type NullableInlineResponse2004Meta struct { + value *InlineResponse2004Meta isSet bool } // Get returns the value. -func (v NullableInlineResponse2002Meta) Get() *InlineResponse2002Meta { +func (v NullableInlineResponse2004Meta) Get() *InlineResponse2004Meta { return v.value } // Set modifies the value. -func (v *NullableInlineResponse2002Meta) Set(val *InlineResponse2002Meta) { +func (v *NullableInlineResponse2004Meta) Set(val *InlineResponse2004Meta) { v.value = val v.isSet = true } // IsSet indicates if the value was set. -func (v NullableInlineResponse2002Meta) IsSet() bool { +func (v NullableInlineResponse2004Meta) IsSet() bool { return v.isSet } // Unset removes the value. -func (v *NullableInlineResponse2002Meta) Unset() { +func (v *NullableInlineResponse2004Meta) Unset() { v.value = nil v.isSet = false } -// NewNullableInlineResponse2002Meta returns a pointer to a new instance of NullableInlineResponse2002Meta. -func NewNullableInlineResponse2002Meta(val *InlineResponse2002Meta) *NullableInlineResponse2002Meta { - return &NullableInlineResponse2002Meta{value: val, isSet: true} +// NewNullableInlineResponse2004Meta returns a pointer to a new instance of NullableInlineResponse2004Meta. +func NewNullableInlineResponse2004Meta(val *InlineResponse2004Meta) *NullableInlineResponse2004Meta { + return &NullableInlineResponse2004Meta{value: val, isSet: true} } // MarshalJSON implements the json.Marshaler interface. // Marshaler is the interface implemented by types that can marshal themselves into valid JSON. -func (v NullableInlineResponse2002Meta) MarshalJSON() ([]byte, error) { +func (v NullableInlineResponse2004Meta) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // UnmarshalJSON implements the Unmarshaler interface. // Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. -func (v *NullableInlineResponse2002Meta) UnmarshalJSON(src []byte) error { +func (v *NullableInlineResponse2004Meta) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/fastly/model_rate_limiter.go b/fastly/model_rate_limiter.go index 62a709c3..e138c3b1 100644 --- a/fastly/model_rate_limiter.go +++ b/fastly/model_rate_limiter.go @@ -35,7 +35,8 @@ type RateLimiter struct { PenaltyBoxDuration *int32 `json:"penalty_box_duration,omitempty"` // The action to take when a rate limiter violation is detected. Action *string `json:"action,omitempty"` - Response NullableRateLimiterResponse1 `json:"response,omitempty"` + // Custom response to be sent when the rate limit is exceeded. Required if `action` is `response`. + Response map[string]string `json:"response,omitempty"` // Name of existing response object. Required if `action` is `response_object`. Note that the rate limiter response is only updated to reflect the response object content when saving the rate limiter configuration. ResponseObjectName NullableString `json:"response_object_name,omitempty"` // Name of the type of logging endpoint to be used when action is `log_only`. The logging endpoint type is used to determine the appropriate log format to use when emitting log entries. @@ -331,45 +332,36 @@ func (o *RateLimiter) SetAction(v string) { } // GetResponse returns the Response field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RateLimiter) GetResponse() RateLimiterResponse1 { - if o == nil || o.Response.Get() == nil { - var ret RateLimiterResponse1 +func (o *RateLimiter) GetResponse() map[string]string { + if o == nil { + var ret map[string]string return ret } - return *o.Response.Get() + return o.Response } // GetResponseOk returns a tuple with the Response field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RateLimiter) GetResponseOk() (*RateLimiterResponse1, bool) { - if o == nil { +func (o *RateLimiter) GetResponseOk() (*map[string]string, bool) { + if o == nil || o.Response == nil { return nil, false } - return o.Response.Get(), o.Response.IsSet() + return &o.Response, true } // HasResponse returns a boolean if a field has been set. func (o *RateLimiter) HasResponse() bool { - if o != nil && o.Response.IsSet() { + if o != nil && o.Response != nil { return true } return false } -// SetResponse gets a reference to the given NullableRateLimiterResponse1 and assigns it to the Response field. -func (o *RateLimiter) SetResponse(v RateLimiterResponse1) { - o.Response.Set(&v) -} -// SetResponseNil sets the value for Response to be an explicit nil -func (o *RateLimiter) SetResponseNil() { - o.Response.Set(nil) -} - -// UnsetResponse ensures that no value is present for Response, not even an explicit nil -func (o *RateLimiter) UnsetResponse() { - o.Response.Unset() +// SetResponse gets a reference to the given map[string]string and assigns it to the Response field. +func (o *RateLimiter) SetResponse(v map[string]string) { + o.Response = v } // GetResponseObjectName returns the ResponseObjectName field value if set, zero value otherwise (both if not set or set to explicit null). @@ -506,8 +498,8 @@ func (o RateLimiter) MarshalJSON() ([]byte, error) { if o.Action != nil { toSerialize["action"] = o.Action } - if o.Response.IsSet() { - toSerialize["response"] = o.Response.Get() + if o.Response != nil { + toSerialize["response"] = o.Response } if o.ResponseObjectName.IsSet() { toSerialize["response_object_name"] = o.ResponseObjectName.Get() diff --git a/fastly/model_rate_limiter_response.go b/fastly/model_rate_limiter_response.go index 6a9e4084..55e823cc 100644 --- a/fastly/model_rate_limiter_response.go +++ b/fastly/model_rate_limiter_response.go @@ -36,7 +36,8 @@ type RateLimiterResponse struct { PenaltyBoxDuration *int32 `json:"penalty_box_duration,omitempty"` // The action to take when a rate limiter violation is detected. Action *string `json:"action,omitempty"` - Response NullableRateLimiterResponse1 `json:"response,omitempty"` + // Custom response to be sent when the rate limit is exceeded. Required if `action` is `response`. + Response map[string]string `json:"response,omitempty"` // Name of existing response object. Required if `action` is `response_object`. Note that the rate limiter response is only updated to reflect the response object content when saving the rate limiter configuration. ResponseObjectName NullableString `json:"response_object_name,omitempty"` // Name of the type of logging endpoint to be used when action is `log_only`. The logging endpoint type is used to determine the appropriate log format to use when emitting log entries. @@ -342,45 +343,36 @@ func (o *RateLimiterResponse) SetAction(v string) { } // GetResponse returns the Response field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *RateLimiterResponse) GetResponse() RateLimiterResponse1 { - if o == nil || o.Response.Get() == nil { - var ret RateLimiterResponse1 +func (o *RateLimiterResponse) GetResponse() map[string]string { + if o == nil { + var ret map[string]string return ret } - return *o.Response.Get() + return o.Response } // GetResponseOk returns a tuple with the Response field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *RateLimiterResponse) GetResponseOk() (*RateLimiterResponse1, bool) { - if o == nil { +func (o *RateLimiterResponse) GetResponseOk() (*map[string]string, bool) { + if o == nil || o.Response == nil { return nil, false } - return o.Response.Get(), o.Response.IsSet() + return &o.Response, true } // HasResponse returns a boolean if a field has been set. func (o *RateLimiterResponse) HasResponse() bool { - if o != nil && o.Response.IsSet() { + if o != nil && o.Response != nil { return true } return false } -// SetResponse gets a reference to the given NullableRateLimiterResponse1 and assigns it to the Response field. -func (o *RateLimiterResponse) SetResponse(v RateLimiterResponse1) { - o.Response.Set(&v) -} -// SetResponseNil sets the value for Response to be an explicit nil -func (o *RateLimiterResponse) SetResponseNil() { - o.Response.Set(nil) -} - -// UnsetResponse ensures that no value is present for Response, not even an explicit nil -func (o *RateLimiterResponse) UnsetResponse() { - o.Response.Unset() +// SetResponse gets a reference to the given map[string]string and assigns it to the Response field. +func (o *RateLimiterResponse) SetResponse(v map[string]string) { + o.Response = v } // GetResponseObjectName returns the ResponseObjectName field value if set, zero value otherwise (both if not set or set to explicit null). @@ -739,8 +731,8 @@ func (o RateLimiterResponse) MarshalJSON() ([]byte, error) { if o.Action != nil { toSerialize["action"] = o.Action } - if o.Response.IsSet() { - toSerialize["response"] = o.Response.Get() + if o.Response != nil { + toSerialize["response"] = o.Response } if o.ResponseObjectName.IsSet() { toSerialize["response_object_name"] = o.ResponseObjectName.Get() diff --git a/fastly/model_rate_limiter_response_1.go b/fastly/model_rate_limiter_response_1.go deleted file mode 100644 index 5d972d6d..00000000 --- a/fastly/model_rate_limiter_response_1.go +++ /dev/null @@ -1,232 +0,0 @@ -// Package fastly is an API client library for interacting with most facets of the Fastly API. -package fastly - -/* -Fastly API - -Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://developer.fastly.com/reference/api/) - -API version: 1.0.0 -Contact: oss@fastly.com -*/ - -// This code is auto-generated; DO NOT EDIT. - - -import ( - "encoding/json" -) - -// RateLimiterResponse1 Custom response to be sent when the rate limit is exceeded. Required if `action` is `response`. -type RateLimiterResponse1 struct { - // HTTP status code for custom limit enforcement response. - Status *int32 `json:"status,omitempty"` - // MIME type for custom limit enforcement response. - ContentType *string `json:"content_type,omitempty"` - // Response body for custom limit enforcement response. - Content *string `json:"content,omitempty"` - AdditionalProperties map[string]any -} - -type _RateLimiterResponse1 RateLimiterResponse1 - -// NewRateLimiterResponse1 instantiates a new RateLimiterResponse1 object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRateLimiterResponse1() *RateLimiterResponse1 { - this := RateLimiterResponse1{} - return &this -} - -// NewRateLimiterResponse1WithDefaults instantiates a new RateLimiterResponse1 object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRateLimiterResponse1WithDefaults() *RateLimiterResponse1 { - this := RateLimiterResponse1{} - return &this -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *RateLimiterResponse1) GetStatus() int32 { - if o == nil || o.Status == nil { - var ret int32 - return ret - } - return *o.Status -} - -// GetStatusOk returns a tuple with the Status field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RateLimiterResponse1) GetStatusOk() (*int32, bool) { - if o == nil || o.Status == nil { - return nil, false - } - return o.Status, true -} - -// HasStatus returns a boolean if a field has been set. -func (o *RateLimiterResponse1) HasStatus() bool { - if o != nil && o.Status != nil { - return true - } - - return false -} - -// SetStatus gets a reference to the given int32 and assigns it to the Status field. -func (o *RateLimiterResponse1) SetStatus(v int32) { - o.Status = &v -} - -// GetContentType returns the ContentType field value if set, zero value otherwise. -func (o *RateLimiterResponse1) GetContentType() string { - if o == nil || o.ContentType == nil { - var ret string - return ret - } - return *o.ContentType -} - -// GetContentTypeOk returns a tuple with the ContentType field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RateLimiterResponse1) GetContentTypeOk() (*string, bool) { - if o == nil || o.ContentType == nil { - return nil, false - } - return o.ContentType, true -} - -// HasContentType returns a boolean if a field has been set. -func (o *RateLimiterResponse1) HasContentType() bool { - if o != nil && o.ContentType != nil { - return true - } - - return false -} - -// SetContentType gets a reference to the given string and assigns it to the ContentType field. -func (o *RateLimiterResponse1) SetContentType(v string) { - o.ContentType = &v -} - -// GetContent returns the Content field value if set, zero value otherwise. -func (o *RateLimiterResponse1) GetContent() string { - if o == nil || o.Content == nil { - var ret string - return ret - } - return *o.Content -} - -// GetContentOk returns a tuple with the Content field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RateLimiterResponse1) GetContentOk() (*string, bool) { - if o == nil || o.Content == nil { - return nil, false - } - return o.Content, true -} - -// HasContent returns a boolean if a field has been set. -func (o *RateLimiterResponse1) HasContent() bool { - if o != nil && o.Content != nil { - return true - } - - return false -} - -// SetContent gets a reference to the given string and assigns it to the Content field. -func (o *RateLimiterResponse1) SetContent(v string) { - o.Content = &v -} - -// MarshalJSON implements the json.Marshaler interface. -// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. -func (o RateLimiterResponse1) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if o.Status != nil { - toSerialize["status"] = o.Status - } - if o.ContentType != nil { - toSerialize["content_type"] = o.ContentType - } - if o.Content != nil { - toSerialize["content"] = o.Content - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -// UnmarshalJSON implements the Unmarshaler interface. -// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. -func (o *RateLimiterResponse1) UnmarshalJSON(bytes []byte) (err error) { - varRateLimiterResponse1 := _RateLimiterResponse1{} - - if err = json.Unmarshal(bytes, &varRateLimiterResponse1); err == nil { - *o = RateLimiterResponse1(varRateLimiterResponse1) - } - - additionalProperties := make(map[string]any) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "status") - delete(additionalProperties, "content_type") - delete(additionalProperties, "content") - o.AdditionalProperties = additionalProperties - } - - return err -} - -// NullableRateLimiterResponse1 is a helper abstraction for handling nullable ratelimiterresponse1 types. -type NullableRateLimiterResponse1 struct { - value *RateLimiterResponse1 - isSet bool -} - -// Get returns the value. -func (v NullableRateLimiterResponse1) Get() *RateLimiterResponse1 { - return v.value -} - -// Set modifies the value. -func (v *NullableRateLimiterResponse1) Set(val *RateLimiterResponse1) { - v.value = val - v.isSet = true -} - -// IsSet indicates if the value was set. -func (v NullableRateLimiterResponse1) IsSet() bool { - return v.isSet -} - -// Unset removes the value. -func (v *NullableRateLimiterResponse1) Unset() { - v.value = nil - v.isSet = false -} - -// NewNullableRateLimiterResponse1 returns a pointer to a new instance of NullableRateLimiterResponse1. -func NewNullableRateLimiterResponse1(val *RateLimiterResponse1) *NullableRateLimiterResponse1 { - return &NullableRateLimiterResponse1{value: val, isSet: true} -} - -// MarshalJSON implements the json.Marshaler interface. -// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. -func (v NullableRateLimiterResponse1) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// UnmarshalJSON implements the Unmarshaler interface. -// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. -func (v *NullableRateLimiterResponse1) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/fastly/model_read_only_customer_id.go b/fastly/model_read_only_customer_id.go new file mode 100644 index 00000000..54dac2cb --- /dev/null +++ b/fastly/model_read_only_customer_id.go @@ -0,0 +1,92 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://developer.fastly.com/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" +) + +// ReadOnlyCustomerID struct for ReadOnlyCustomerID +type ReadOnlyCustomerID struct { +} + +// NewReadOnlyCustomerID instantiates a new ReadOnlyCustomerID object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewReadOnlyCustomerID() *ReadOnlyCustomerID { + this := ReadOnlyCustomerID{} + return &this +} + +// NewReadOnlyCustomerIDWithDefaults instantiates a new ReadOnlyCustomerID object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewReadOnlyCustomerIDWithDefaults() *ReadOnlyCustomerID { + this := ReadOnlyCustomerID{} + return &this +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ReadOnlyCustomerID) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + return json.Marshal(toSerialize) +} + +// NullableReadOnlyCustomerID is a helper abstraction for handling nullable readonlycustomerid types. +type NullableReadOnlyCustomerID struct { + value *ReadOnlyCustomerID + isSet bool +} + +// Get returns the value. +func (v NullableReadOnlyCustomerID) Get() *ReadOnlyCustomerID { + return v.value +} + +// Set modifies the value. +func (v *NullableReadOnlyCustomerID) Set(val *ReadOnlyCustomerID) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableReadOnlyCustomerID) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableReadOnlyCustomerID) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableReadOnlyCustomerID returns a pointer to a new instance of NullableReadOnlyCustomerID. +func NewNullableReadOnlyCustomerID(val *ReadOnlyCustomerID) *NullableReadOnlyCustomerID { + return &NullableReadOnlyCustomerID{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableReadOnlyCustomerID) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableReadOnlyCustomerID) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_read_only_id.go b/fastly/model_read_only_id.go new file mode 100644 index 00000000..e6cb958f --- /dev/null +++ b/fastly/model_read_only_id.go @@ -0,0 +1,92 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://developer.fastly.com/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" +) + +// ReadOnlyID struct for ReadOnlyID +type ReadOnlyID struct { +} + +// NewReadOnlyID instantiates a new ReadOnlyID object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewReadOnlyID() *ReadOnlyID { + this := ReadOnlyID{} + return &this +} + +// NewReadOnlyIDWithDefaults instantiates a new ReadOnlyID object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewReadOnlyIDWithDefaults() *ReadOnlyID { + this := ReadOnlyID{} + return &this +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ReadOnlyID) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + return json.Marshal(toSerialize) +} + +// NullableReadOnlyID is a helper abstraction for handling nullable readonlyid types. +type NullableReadOnlyID struct { + value *ReadOnlyID + isSet bool +} + +// Get returns the value. +func (v NullableReadOnlyID) Get() *ReadOnlyID { + return v.value +} + +// Set modifies the value. +func (v *NullableReadOnlyID) Set(val *ReadOnlyID) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableReadOnlyID) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableReadOnlyID) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableReadOnlyID returns a pointer to a new instance of NullableReadOnlyID. +func NewNullableReadOnlyID(val *ReadOnlyID) *NullableReadOnlyID { + return &NullableReadOnlyID{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableReadOnlyID) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableReadOnlyID) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_read_only_id_service.go b/fastly/model_read_only_id_service.go new file mode 100644 index 00000000..e193f99c --- /dev/null +++ b/fastly/model_read_only_id_service.go @@ -0,0 +1,92 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://developer.fastly.com/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" +) + +// ReadOnlyIDService struct for ReadOnlyIDService +type ReadOnlyIDService struct { +} + +// NewReadOnlyIDService instantiates a new ReadOnlyIDService object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewReadOnlyIDService() *ReadOnlyIDService { + this := ReadOnlyIDService{} + return &this +} + +// NewReadOnlyIDServiceWithDefaults instantiates a new ReadOnlyIDService object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewReadOnlyIDServiceWithDefaults() *ReadOnlyIDService { + this := ReadOnlyIDService{} + return &this +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ReadOnlyIDService) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + return json.Marshal(toSerialize) +} + +// NullableReadOnlyIDService is a helper abstraction for handling nullable readonlyidservice types. +type NullableReadOnlyIDService struct { + value *ReadOnlyIDService + isSet bool +} + +// Get returns the value. +func (v NullableReadOnlyIDService) Get() *ReadOnlyIDService { + return v.value +} + +// Set modifies the value. +func (v *NullableReadOnlyIDService) Set(val *ReadOnlyIDService) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableReadOnlyIDService) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableReadOnlyIDService) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableReadOnlyIDService returns a pointer to a new instance of NullableReadOnlyIDService. +func NewNullableReadOnlyIDService(val *ReadOnlyIDService) *NullableReadOnlyIDService { + return &NullableReadOnlyIDService{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableReadOnlyIDService) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableReadOnlyIDService) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_read_only_user_id.go b/fastly/model_read_only_user_id.go new file mode 100644 index 00000000..bc8f2017 --- /dev/null +++ b/fastly/model_read_only_user_id.go @@ -0,0 +1,92 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://developer.fastly.com/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" +) + +// ReadOnlyUserID struct for ReadOnlyUserID +type ReadOnlyUserID struct { +} + +// NewReadOnlyUserID instantiates a new ReadOnlyUserID object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewReadOnlyUserID() *ReadOnlyUserID { + this := ReadOnlyUserID{} + return &this +} + +// NewReadOnlyUserIDWithDefaults instantiates a new ReadOnlyUserID object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewReadOnlyUserIDWithDefaults() *ReadOnlyUserID { + this := ReadOnlyUserID{} + return &this +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ReadOnlyUserID) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + return json.Marshal(toSerialize) +} + +// NullableReadOnlyUserID is a helper abstraction for handling nullable readonlyuserid types. +type NullableReadOnlyUserID struct { + value *ReadOnlyUserID + isSet bool +} + +// Get returns the value. +func (v NullableReadOnlyUserID) Get() *ReadOnlyUserID { + return v.value +} + +// Set modifies the value. +func (v *NullableReadOnlyUserID) Set(val *ReadOnlyUserID) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableReadOnlyUserID) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableReadOnlyUserID) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableReadOnlyUserID returns a pointer to a new instance of NullableReadOnlyUserID. +func NewNullableReadOnlyUserID(val *ReadOnlyUserID) *NullableReadOnlyUserID { + return &NullableReadOnlyUserID{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableReadOnlyUserID) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableReadOnlyUserID) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/sig.json b/sig.json index 2d6064ce..4757ab49 100644 --- a/sig.json +++ b/sig.json @@ -1 +1 @@ -{"G": "70bf90be", "D": "bd27032c"} +{"G": "5a5618cc", "D": "92c7d13f"}