diff --git a/CHANGELOG.md b/CHANGELOG.md index ebaf56f..4df0eaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [v4.2.0](https://github.com/fastly/fastly-py/releases/tag/release/v4.2.0) (2023-10-24) + +**Enhancements:** + +- feat(stats): add historical DDoS metrics. +- feat(stats): add bot challenges. + +**Bug fixes:** + +- fix(snippets): ensure POST response's dynamic field is numerical. + ## [v4.1.1](https://github.com/fastly/fastly-py/releases/tag/release/v4.1.1) (2023-09-01) **Enhancements:** diff --git a/README.md b/README.md index 3b3285c..414e18e 100644 --- a/README.md +++ b/README.md @@ -224,10 +224,10 @@ Class | Method | HTTP request | Description *InvitationsApi* | [**create_invitation**](docs/InvitationsApi.md#create_invitation) | **POST** /invitations | Create an invitation *InvitationsApi* | [**delete_invitation**](docs/InvitationsApi.md#delete_invitation) | **DELETE** /invitations/{invitation_id} | Delete an invitation *InvitationsApi* | [**list_invitations**](docs/InvitationsApi.md#list_invitations) | **GET** /invitations | List invitations -*KvStoreApi* | [**create_store**](docs/KvStoreApi.md#create_store) | **POST** /resources/stores/kv | Create an kv store. -*KvStoreApi* | [**delete_store**](docs/KvStoreApi.md#delete_store) | **DELETE** /resources/stores/kv/{store_id} | Delete an kv store. -*KvStoreApi* | [**get_store**](docs/KvStoreApi.md#get_store) | **GET** /resources/stores/kv/{store_id} | Describe an kv store. -*KvStoreApi* | [**get_stores**](docs/KvStoreApi.md#get_stores) | **GET** /resources/stores/kv | List kv stores. +*KvStoreApi* | [**create_store**](docs/KvStoreApi.md#create_store) | **POST** /resources/stores/kv | Create a KV store. +*KvStoreApi* | [**delete_store**](docs/KvStoreApi.md#delete_store) | **DELETE** /resources/stores/kv/{store_id} | Delete a KV store. +*KvStoreApi* | [**get_store**](docs/KvStoreApi.md#get_store) | **GET** /resources/stores/kv/{store_id} | Describe a KV store. +*KvStoreApi* | [**get_stores**](docs/KvStoreApi.md#get_stores) | **GET** /resources/stores/kv | List KV stores. *KvStoreItemApi* | [**delete_key_from_store**](docs/KvStoreItemApi.md#delete_key_from_store) | **DELETE** /resources/stores/kv/{store_id}/keys/{key_name} | Delete kv store item. *KvStoreItemApi* | [**get_keys**](docs/KvStoreItemApi.md#get_keys) | **GET** /resources/stores/kv/{store_id}/keys | List kv store keys. *KvStoreItemApi* | [**get_value_for_key**](docs/KvStoreItemApi.md#get_value_for_key) | **GET** /resources/stores/kv/{store_id}/keys/{key_name} | Get the value of an kv store item @@ -585,6 +585,7 @@ Class | Method | HTTP request | Description *WafRulesApi* | [**get_waf_rule**](docs/WafRulesApi.md#get_waf_rule) | **GET** /waf/rules/{waf_rule_id} | Get a rule *WafRulesApi* | [**list_waf_rules**](docs/WafRulesApi.md#list_waf_rules) | **GET** /waf/rules | List available WAF rules *WafTagsApi* | [**list_waf_tags**](docs/WafTagsApi.md#list_waf_tags) | **GET** /waf/tags | List tags +*WholePlatformDdosHistoricalApi* | [**get_platform_ddos_historical**](docs/WholePlatformDdosHistoricalApi.md#get_platform_ddos_historical) | **GET** /metrics/platform/ddos | Get historical DDoS metrics for the entire Fastly platform ## Issues diff --git a/docs/HistoricalDdos.md b/docs/HistoricalDdos.md new file mode 100644 index 0000000..e409fe9 --- /dev/null +++ b/docs/HistoricalDdos.md @@ -0,0 +1,15 @@ +# HistoricalDdos + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | Whether or not we were able to successfully execute the query. | [optional] +**meta** | [**HistoricalDdosMeta**](HistoricalDdosMeta.md) | | [optional] +**msg** | **str, none_type** | If the query was not successful, this will provide a string that explains why. | [optional] +**data** | [**[PlatformDdosDataItems]**](PlatformDdosDataItems.md) | A list of [entries](#entry-data-model). | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/HistoricalDdosMeta.md b/docs/HistoricalDdosMeta.md new file mode 100644 index 0000000..c4c256a --- /dev/null +++ b/docs/HistoricalDdosMeta.md @@ -0,0 +1,16 @@ +# HistoricalDdosMeta + +Meta information about the scope of the query in a human readable format. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start** | **str** | Start time that was used to perform the query as an ISO-8601-formatted date and time. | [optional] +**end** | **str** | End time that was used to perform the query as an ISO-8601-formatted date and time. | [optional] +**downsample** | **str** | Downsample that was used to perform the query. One of `hour` or `day`. | [optional] +**metric** | **str** | A comma-separated list of the metrics that were requested. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[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 fae88d5..14c1034 100644 --- a/docs/HistoricalFieldResultsAttributes.md +++ b/docs/HistoricalFieldResultsAttributes.md @@ -220,6 +220,15 @@ Name | Type | Description | Notes **ddos_action_tarpit** | **int** | The number of times the tarpit action was taken. The tarpit action delays writing the response to the client. | [optional] **ddos_action_close** | **int** | 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] **ddos_action_blackhole** | **int** | 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] +**bot_challenge_starts** | **int** | The number of challenge-start tokens created. | [optional] +**bot_challenge_complete_tokens_passed** | **int** | The number of challenge-complete tokens that passed validation. | [optional] +**bot_challenge_complete_tokens_failed** | **int** | The number of challenge-complete tokens that failed validation. | [optional] +**bot_challenge_complete_tokens_checked** | **int** | The number of challenge-complete tokens checked. | [optional] +**bot_challenge_complete_tokens_disabled** | **int** | The number of challenge-complete tokens not checked because the feature was disabled. | [optional] +**bot_challenge_complete_tokens_issued** | **int** | The number of challenge-complete tokens issued. For example, issuing a challenge-complete token after a series of CAPTCHA challenges ending in success. | [optional] +**bot_challenges_issued** | **int** | The number of challenges issued. For example, the issuance of a CAPTCHA challenge. | [optional] +**bot_challenges_succeeded** | **int** | The number of successful challenge solutions processed. For example, a correct CAPTCHA solution. | [optional] +**bot_challenges_failed** | **int** | The number of failed challenge solutions processed. For example, an incorrect CAPTCHA solution. | [optional] **service_id** | [**ReadOnlyIdService**](ReadOnlyIdService.md) | | [optional] **start_time** | **int** | | [optional] **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] diff --git a/docs/KvStoreApi.md b/docs/KvStoreApi.md index 003b781..940f509 100644 --- a/docs/KvStoreApi.md +++ b/docs/KvStoreApi.md @@ -4,18 +4,18 @@ All URIs are relative to *https://api.fastly.com* Method | HTTP request | Description ------------- | ------------- | ------------- -[**create_store**](KvStoreApi.md#create_store) | **POST** /resources/stores/kv | Create an kv store. -[**delete_store**](KvStoreApi.md#delete_store) | **DELETE** /resources/stores/kv/{store_id} | Delete an kv store. -[**get_store**](KvStoreApi.md#get_store) | **GET** /resources/stores/kv/{store_id} | Describe an kv store. -[**get_stores**](KvStoreApi.md#get_stores) | **GET** /resources/stores/kv | List kv stores. +[**create_store**](KvStoreApi.md#create_store) | **POST** /resources/stores/kv | Create a KV store. +[**delete_store**](KvStoreApi.md#delete_store) | **DELETE** /resources/stores/kv/{store_id} | Delete a KV store. +[**get_store**](KvStoreApi.md#get_store) | **GET** /resources/stores/kv/{store_id} | Describe a KV store. +[**get_stores**](KvStoreApi.md#get_stores) | **GET** /resources/stores/kv | List KV stores. # **create_store** > StoreResponse create_store() -Create an kv store. +Create a KV store. -Create a new kv store. +Create a new KV store. ### Example @@ -57,7 +57,7 @@ with fastly.ApiClient(configuration) as api_client: # example passing only required values which don't have defaults set # and optional values try: - # Create an kv store. + # Create a KV store. api_response = api_instance.create_store(location=location, store=store) pprint(api_response) except fastly.ApiException as e: @@ -97,9 +97,9 @@ Name | Type | Description | Notes # **delete_store** > delete_store(store_id) -Delete an kv store. +Delete a KV store. -An kv store must be empty before it can be deleted. Deleting an kv store that still contains keys will result in a `409` (Conflict). +A KV store must be empty before it can be deleted. Deleting a KV store that still contains keys will result in a `409` (Conflict). ### Example @@ -135,7 +135,7 @@ with fastly.ApiClient(configuration) as api_client: # example passing only required values which don't have defaults set try: - # Delete an kv store. + # Delete a KV store. api_instance.delete_store(store_id) except fastly.ApiException as e: print("Exception when calling KvStoreApi->delete_store: %s\n" % e) @@ -173,9 +173,9 @@ void (empty response body) # **get_store** > StoreResponse get_store(store_id) -Describe an kv store. +Describe a KV store. -Get an kv store by ID. +Get a KV store by ID. ### Example @@ -212,7 +212,7 @@ with fastly.ApiClient(configuration) as api_client: # example passing only required values which don't have defaults set try: - # Describe an kv store. + # Describe a KV store. api_response = api_instance.get_store(store_id) pprint(api_response) except fastly.ApiException as e: @@ -251,7 +251,7 @@ Name | Type | Description | Notes # **get_stores** > InlineResponse2003 get_stores() -List kv stores. +List KV stores. Get all stores for a given customer. @@ -292,7 +292,7 @@ with fastly.ApiClient(configuration) as api_client: # example passing only required values which don't have defaults set # and optional values try: - # List kv stores. + # List KV stores. api_response = api_instance.get_stores(cursor=cursor, limit=limit) pprint(api_response) except fastly.ApiException as e: diff --git a/docs/LoggingLogentriesAdditional.md b/docs/LoggingLogentriesAdditional.md index cddb422..79207d4 100644 --- a/docs/LoggingLogentriesAdditional.md +++ b/docs/LoggingLogentriesAdditional.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **port** | **int** | The port number. | [optional] if omitted the server will use the default value of 20000 -**token** | **str** | Use token based authentication ([https://logentries.com/doc/input-token/](https://logentries.com/doc/input-token/)). | [optional] +**token** | **str** | Use token based authentication. | [optional] **use_tls** | [**LoggingUseTls**](LoggingUseTls.md) | | [optional] **region** | **str** | The region to which to stream logs. | [optional] **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] diff --git a/docs/LoggingLogentriesApi.md b/docs/LoggingLogentriesApi.md index dd3cea8..1e09709 100644 --- a/docs/LoggingLogentriesApi.md +++ b/docs/LoggingLogentriesApi.md @@ -58,7 +58,7 @@ with fastly.ApiClient(configuration) as api_client: format = "%h %l %u %t "%r" %>s %b" # str | A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). (optional) if omitted the server will use the default value of "%h %l %u %t "%r" %>s %b" format_version = 2 # int | The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. (optional) if omitted the server will use the default value of 2 port = 20000 # int | The port number. (optional) if omitted the server will use the default value of 20000 - token = "token_example" # str | Use token based authentication ([https://logentries.com/doc/input-token/](https://logentries.com/doc/input-token/)). (optional) + token = "token_example" # str | Use token based authentication. (optional) use_tls = LoggingUseTls(0) # LoggingUseTls | (optional) region = "US" # str | The region to which to stream logs. (optional) @@ -93,7 +93,7 @@ Name | Type | Description | Notes **format** | **str**| A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). | [optional] if omitted the server will use the default value of "%h %l %u %t "%r" %>s %b" **format_version** | **int**| The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. | [optional] if omitted the server will use the default value of 2 **port** | **int**| The port number. | [optional] if omitted the server will use the default value of 20000 - **token** | **str**| Use token based authentication ([https://logentries.com/doc/input-token/](https://logentries.com/doc/input-token/)). | [optional] + **token** | **str**| Use token based authentication. | [optional] **use_tls** | [**LoggingUseTls**](LoggingUseTls.md)| | [optional] **region** | **str**| The region to which to stream logs. | [optional] @@ -411,7 +411,7 @@ with fastly.ApiClient(configuration) as api_client: format = "%h %l %u %t "%r" %>s %b" # str | A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). (optional) if omitted the server will use the default value of "%h %l %u %t "%r" %>s %b" format_version = 2 # int | The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. (optional) if omitted the server will use the default value of 2 port = 20000 # int | The port number. (optional) if omitted the server will use the default value of 20000 - token = "token_example" # str | Use token based authentication ([https://logentries.com/doc/input-token/](https://logentries.com/doc/input-token/)). (optional) + token = "token_example" # str | Use token based authentication. (optional) use_tls = LoggingUseTls(0) # LoggingUseTls | (optional) region = "US" # str | The region to which to stream logs. (optional) @@ -447,7 +447,7 @@ Name | Type | Description | Notes **format** | **str**| A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). | [optional] if omitted the server will use the default value of "%h %l %u %t "%r" %>s %b" **format_version** | **int**| The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. | [optional] if omitted the server will use the default value of 2 **port** | **int**| The port number. | [optional] if omitted the server will use the default value of 20000 - **token** | **str**| Use token based authentication ([https://logentries.com/doc/input-token/](https://logentries.com/doc/input-token/)). | [optional] + **token** | **str**| Use token based authentication. | [optional] **use_tls** | [**LoggingUseTls**](LoggingUseTls.md)| | [optional] **region** | **str**| The region to which to stream logs. | [optional] diff --git a/docs/LoggingLogentriesResponse.md b/docs/LoggingLogentriesResponse.md index 65ed803..f0ae26e 100644 --- a/docs/LoggingLogentriesResponse.md +++ b/docs/LoggingLogentriesResponse.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **format** | **str** | A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). | [optional] if omitted the server will use the default value of "%h %l %u %t "%r" %>s %b" **format_version** | **str** | The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. | [optional] if omitted the server will use the default value of "2" **port** | **int** | The port number. | [optional] if omitted the server will use the default value of 20000 -**token** | **str** | Use token based authentication ([https://logentries.com/doc/input-token/](https://logentries.com/doc/input-token/)). | [optional] +**token** | **str** | Use token based authentication. | [optional] **use_tls** | [**LoggingUseTls**](LoggingUseTls.md) | | [optional] **region** | **str** | The region to which to stream logs. | [optional] **created_at** | **datetime, none_type** | Date and time in ISO 8601 format. | [optional] [readonly] diff --git a/docs/PlatformDdosDataItems.md b/docs/PlatformDdosDataItems.md new file mode 100644 index 0000000..06f9814 --- /dev/null +++ b/docs/PlatformDdosDataItems.md @@ -0,0 +1,12 @@ +# PlatformDdosDataItems + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**values** | [**Values**](Values.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PlatformDdosEntry.md b/docs/PlatformDdosEntry.md new file mode 100644 index 0000000..4170498 --- /dev/null +++ b/docs/PlatformDdosEntry.md @@ -0,0 +1,12 @@ +# PlatformDdosEntry + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**values** | [**[ValuesDdos]**](ValuesDdos.md) | An array of values representing the metric values at each point in time. Note that this dataset is sparse: only the keys with non-zero values will be included in the record. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PlatformDdosResponse.md b/docs/PlatformDdosResponse.md new file mode 100644 index 0000000..bf55596 --- /dev/null +++ b/docs/PlatformDdosResponse.md @@ -0,0 +1,15 @@ +# PlatformDdosResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | Whether or not we were able to successfully execute the query. | [optional] +**meta** | [**HistoricalDdosMeta**](HistoricalDdosMeta.md) | | [optional] +**msg** | **str, none_type** | If the query was not successful, this will provide a string that explains why. | [optional] +**data** | [**PlatformDdosResponseData**](PlatformDdosResponseData.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PlatformDdosResponseAllOf.md b/docs/PlatformDdosResponseAllOf.md new file mode 100644 index 0000000..2140a4c --- /dev/null +++ b/docs/PlatformDdosResponseAllOf.md @@ -0,0 +1,12 @@ +# PlatformDdosResponseAllOf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**PlatformDdosResponseData**](PlatformDdosResponseData.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PlatformDdosResponseData.md b/docs/PlatformDdosResponseData.md new file mode 100644 index 0000000..af3ee9d --- /dev/null +++ b/docs/PlatformDdosResponseData.md @@ -0,0 +1,12 @@ +# PlatformDdosResponseData + +A list of timeseries. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | [**[PlatformDdosEntry]**](PlatformDdosEntry.md) | A list of timeseries. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RealtimeEntryAggregated.md b/docs/RealtimeEntryAggregated.md index dc7c0c3..a0d7725 100644 --- a/docs/RealtimeEntryAggregated.md +++ b/docs/RealtimeEntryAggregated.md @@ -223,6 +223,15 @@ Name | Type | Description | Notes **ddos_action_tarpit** | **int** | The number of times the tarpit action was taken. The tarpit action delays writing the response to the client. | [optional] **ddos_action_close** | **int** | 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] **ddos_action_blackhole** | **int** | 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] +**bot_challenge_starts** | **int** | The number of challenge-start tokens created. | [optional] +**bot_challenge_complete_tokens_passed** | **int** | The number of challenge-complete tokens that passed validation. | [optional] +**bot_challenge_complete_tokens_failed** | **int** | The number of challenge-complete tokens that failed validation. | [optional] +**bot_challenge_complete_tokens_checked** | **int** | The number of challenge-complete tokens checked. | [optional] +**bot_challenge_complete_tokens_disabled** | **int** | The number of challenge-complete tokens not checked because the feature was disabled. | [optional] +**bot_challenges_issued** | **int** | The number of challenges issued. For example, the issuance of a CAPTCHA challenge. | [optional] +**bot_challenges_succeeded** | **int** | The number of successful challenge solutions processed. For example, a correct CAPTCHA solution. | [optional] +**bot_challenges_failed** | **int** | The number of failed challenge solutions processed. For example, an incorrect CAPTCHA solution. | [optional] +**bot_challenge_complete_tokens_issued** | **int** | The number of challenge-complete tokens issued. For example, issuing a challenge-complete token after a series of CAPTCHA challenges ending in success. | [optional] **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/RealtimeMeasurements.md b/docs/RealtimeMeasurements.md index b1a1a1f..9e9ac37 100644 --- a/docs/RealtimeMeasurements.md +++ b/docs/RealtimeMeasurements.md @@ -223,6 +223,15 @@ Name | Type | Description | Notes **ddos_action_tarpit** | **int** | The number of times the tarpit action was taken. The tarpit action delays writing the response to the client. | [optional] **ddos_action_close** | **int** | 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] **ddos_action_blackhole** | **int** | 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] +**bot_challenge_starts** | **int** | The number of challenge-start tokens created. | [optional] +**bot_challenge_complete_tokens_passed** | **int** | The number of challenge-complete tokens that passed validation. | [optional] +**bot_challenge_complete_tokens_failed** | **int** | The number of challenge-complete tokens that failed validation. | [optional] +**bot_challenge_complete_tokens_checked** | **int** | The number of challenge-complete tokens checked. | [optional] +**bot_challenge_complete_tokens_disabled** | **int** | The number of challenge-complete tokens not checked because the feature was disabled. | [optional] +**bot_challenges_issued** | **int** | The number of challenges issued. For example, the issuance of a CAPTCHA challenge. | [optional] +**bot_challenges_succeeded** | **int** | The number of successful challenge solutions processed. For example, a correct CAPTCHA solution. | [optional] +**bot_challenges_failed** | **int** | The number of failed challenge solutions processed. For example, an incorrect CAPTCHA solution. | [optional] +**bot_challenge_complete_tokens_issued** | **int** | The number of challenge-complete tokens issued. For example, issuing a challenge-complete token after a series of CAPTCHA challenges ending in success. | [optional] **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Results.md b/docs/Results.md index b2ac49f..3826aa2 100644 --- a/docs/Results.md +++ b/docs/Results.md @@ -221,6 +221,15 @@ Name | Type | Description | Notes **ddos_action_tarpit** | **int** | The number of times the tarpit action was taken. The tarpit action delays writing the response to the client. | [optional] **ddos_action_close** | **int** | 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] **ddos_action_blackhole** | **int** | 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] +**bot_challenge_starts** | **int** | The number of challenge-start tokens created. | [optional] +**bot_challenge_complete_tokens_passed** | **int** | The number of challenge-complete tokens that passed validation. | [optional] +**bot_challenge_complete_tokens_failed** | **int** | The number of challenge-complete tokens that failed validation. | [optional] +**bot_challenge_complete_tokens_checked** | **int** | The number of challenge-complete tokens checked. | [optional] +**bot_challenge_complete_tokens_disabled** | **int** | The number of challenge-complete tokens not checked because the feature was disabled. | [optional] +**bot_challenge_complete_tokens_issued** | **int** | The number of challenge-complete tokens issued. For example, issuing a challenge-complete token after a series of CAPTCHA challenges ending in success. | [optional] +**bot_challenges_issued** | **int** | The number of challenges issued. For example, the issuance of a CAPTCHA challenge. | [optional] +**bot_challenges_succeeded** | **int** | The number of successful challenge solutions processed. For example, a correct CAPTCHA solution. | [optional] +**bot_challenges_failed** | **int** | The number of failed challenge solutions processed. For example, an incorrect CAPTCHA solution. | [optional] **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SchemasSnippetResponse.md b/docs/SchemasSnippetResponse.md index a096a06..38e0b99 100644 --- a/docs/SchemasSnippetResponse.md +++ b/docs/SchemasSnippetResponse.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | The name for the snippet. | [optional] -**dynamic** | **str** | Sets the snippet version. | [optional] **type** | **str** | The location in generated VCL where the snippet should be placed. | [optional] **content** | **str** | The VCL code that specifies exactly what the snippet does. | [optional] **priority** | **str** | Priority determines execution order. Lower numbers execute first. | [optional] if omitted the server will use the default value of "100" +**dynamic** | **str** | Sets the snippet version. | [optional] **created_at** | **datetime, none_type** | Date and time in ISO 8601 format. | [optional] [readonly] **deleted_at** | **datetime, none_type** | Date and time in ISO 8601 format. | [optional] [readonly] **updated_at** | **datetime, none_type** | Date and time in ISO 8601 format. | [optional] [readonly] diff --git a/docs/SchemasSnippetResponseCommon.md b/docs/SchemasSnippetResponseCommon.md new file mode 100644 index 0000000..5e60ae7 --- /dev/null +++ b/docs/SchemasSnippetResponseCommon.md @@ -0,0 +1,17 @@ +# SchemasSnippetResponseCommon + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime, none_type** | Date and time in ISO 8601 format. | [optional] [readonly] +**deleted_at** | **datetime, none_type** | Date and time in ISO 8601 format. | [optional] [readonly] +**updated_at** | **datetime, none_type** | Date and time in ISO 8601 format. | [optional] [readonly] +**service_id** | **str** | | [optional] [readonly] +**version** | **str** | String representing the number identifying a version of the service. | [optional] [readonly] +**id** | **str** | | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Snippet.md b/docs/Snippet.md index 8205580..93de1f9 100644 --- a/docs/Snippet.md +++ b/docs/Snippet.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | The name for the snippet. | [optional] -**dynamic** | **str** | Sets the snippet version. | [optional] **type** | **str** | The location in generated VCL where the snippet should be placed. | [optional] **content** | **str** | The VCL code that specifies exactly what the snippet does. | [optional] **priority** | **str** | Priority determines execution order. Lower numbers execute first. | [optional] if omitted the server will use the default value of "100" +**dynamic** | **str** | Sets the snippet version. | [optional] **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SnippetAllOf.md b/docs/SnippetAllOf.md new file mode 100644 index 0000000..6542308 --- /dev/null +++ b/docs/SnippetAllOf.md @@ -0,0 +1,12 @@ +# SnippetAllOf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dynamic** | **str** | Sets the snippet version. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SnippetApi.md b/docs/SnippetApi.md index 5870596..69503bb 100644 --- a/docs/SnippetApi.md +++ b/docs/SnippetApi.md @@ -14,7 +14,7 @@ Method | HTTP request | Description # **create_snippet** -> SnippetResponse create_snippet(service_id, version_id) +> SnippetResponsePost create_snippet(service_id, version_id) Create a snippet @@ -28,7 +28,7 @@ Create a snippet for a particular service and version. import time import fastly from fastly.api import snippet_api -from fastly.model.snippet_response import SnippetResponse +from fastly.model.snippet_response_post import SnippetResponsePost from pprint import pprint # Defining the host is optional and defaults to https://api.fastly.com # See configuration.py for a list of all supported configuration parameters. @@ -54,10 +54,10 @@ with fastly.ApiClient(configuration) as api_client: service_id = "SU1Z0isxPaozGVKXdv0eY" # str | Alphanumeric string identifying the service. version_id = 1 # int | Integer identifying a service version. name = "test-snippet" # str | The name for the snippet. (optional) - dynamic = "0" # str | Sets the snippet version. (optional) type = "init" # str | The location in generated VCL where the snippet should be placed. (optional) content = "content_example" # str | The VCL code that specifies exactly what the snippet does. (optional) priority = "10" # str | Priority determines execution order. Lower numbers execute first. (optional) if omitted the server will use the default value of "100" + dynamic = "0" # str | Sets the snippet version. (optional) # example passing only required values which don't have defaults set try: @@ -71,7 +71,7 @@ with fastly.ApiClient(configuration) as api_client: # and optional values try: # Create a snippet - api_response = api_instance.create_snippet(service_id, version_id, name=name, dynamic=dynamic, type=type, content=content, priority=priority) + api_response = api_instance.create_snippet(service_id, version_id, name=name, type=type, content=content, priority=priority, dynamic=dynamic) pprint(api_response) except fastly.ApiException as e: print("Exception when calling SnippetApi->create_snippet: %s\n" % e) @@ -85,14 +85,14 @@ Name | Type | Description | Notes **service_id** | **str**| Alphanumeric string identifying the service. | **version_id** | **int**| Integer identifying a service version. | **name** | **str**| The name for the snippet. | [optional] - **dynamic** | **str**| Sets the snippet version. | [optional] **type** | **str**| The location in generated VCL where the snippet should be placed. | [optional] **content** | **str**| The VCL code that specifies exactly what the snippet does. | [optional] **priority** | **str**| Priority determines execution order. Lower numbers execute first. | [optional] if omitted the server will use the default value of "100" + **dynamic** | **str**| Sets the snippet version. | [optional] ### Return type -[**SnippetResponse**](SnippetResponse.md) +[**SnippetResponsePost**](SnippetResponsePost.md) ### Authorization @@ -559,10 +559,10 @@ with fastly.ApiClient(configuration) as api_client: service_id = "SU1Z0isxPaozGVKXdv0eY" # str | Alphanumeric string identifying the service. snippet_id = "62Yd1WfiCBPENLloXfXmlO" # str | Alphanumeric string identifying a VCL Snippet. name = "test-snippet" # str | The name for the snippet. (optional) - dynamic = "0" # str | Sets the snippet version. (optional) type = "init" # str | The location in generated VCL where the snippet should be placed. (optional) content = "content_example" # str | The VCL code that specifies exactly what the snippet does. (optional) priority = "10" # str | Priority determines execution order. Lower numbers execute first. (optional) if omitted the server will use the default value of "100" + dynamic = "0" # str | Sets the snippet version. (optional) # example passing only required values which don't have defaults set try: @@ -576,7 +576,7 @@ with fastly.ApiClient(configuration) as api_client: # and optional values try: # Update a dynamic snippet - api_response = api_instance.update_snippet_dynamic(service_id, snippet_id, name=name, dynamic=dynamic, type=type, content=content, priority=priority) + api_response = api_instance.update_snippet_dynamic(service_id, snippet_id, name=name, type=type, content=content, priority=priority, dynamic=dynamic) pprint(api_response) except fastly.ApiException as e: print("Exception when calling SnippetApi->update_snippet_dynamic: %s\n" % e) @@ -590,10 +590,10 @@ Name | Type | Description | Notes **service_id** | **str**| Alphanumeric string identifying the service. | **snippet_id** | **str**| Alphanumeric string identifying a VCL Snippet. | **name** | **str**| The name for the snippet. | [optional] - **dynamic** | **str**| Sets the snippet version. | [optional] **type** | **str**| The location in generated VCL where the snippet should be placed. | [optional] **content** | **str**| The VCL code that specifies exactly what the snippet does. | [optional] **priority** | **str**| Priority determines execution order. Lower numbers execute first. | [optional] if omitted the server will use the default value of "100" + **dynamic** | **str**| Sets the snippet version. | [optional] ### Return type diff --git a/docs/SnippetCommon.md b/docs/SnippetCommon.md new file mode 100644 index 0000000..04aed90 --- /dev/null +++ b/docs/SnippetCommon.md @@ -0,0 +1,15 @@ +# SnippetCommon + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The name for the snippet. | [optional] +**type** | **str** | The location in generated VCL where the snippet should be placed. | [optional] +**content** | **str** | The VCL code that specifies exactly what the snippet does. | [optional] +**priority** | **str** | Priority determines execution order. Lower numbers execute first. | [optional] if omitted the server will use the default value of "100" +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SnippetResponse.md b/docs/SnippetResponse.md index ed1537d..4c9a57a 100644 --- a/docs/SnippetResponse.md +++ b/docs/SnippetResponse.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | The name for the snippet. | [optional] -**dynamic** | **str** | Sets the snippet version. | [optional] **type** | **str** | The location in generated VCL where the snippet should be placed. | [optional] **content** | **str** | The VCL code that specifies exactly what the snippet does. | [optional] **priority** | **str** | Priority determines execution order. Lower numbers execute first. | [optional] if omitted the server will use the default value of "100" +**dynamic** | **str** | Sets the snippet version. | [optional] **created_at** | **datetime, none_type** | Date and time in ISO 8601 format. | [optional] [readonly] **deleted_at** | **datetime, none_type** | Date and time in ISO 8601 format. | [optional] [readonly] **updated_at** | **datetime, none_type** | Date and time in ISO 8601 format. | [optional] [readonly] diff --git a/docs/SnippetResponseCommon.md b/docs/SnippetResponseCommon.md new file mode 100644 index 0000000..bfc6288 --- /dev/null +++ b/docs/SnippetResponseCommon.md @@ -0,0 +1,17 @@ +# SnippetResponseCommon + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime, none_type** | Date and time in ISO 8601 format. | [optional] [readonly] +**deleted_at** | **datetime, none_type** | Date and time in ISO 8601 format. | [optional] [readonly] +**updated_at** | **datetime, none_type** | Date and time in ISO 8601 format. | [optional] [readonly] +**service_id** | **str** | | [optional] [readonly] +**version** | **str** | String representing the number identifying a version of the service. | [optional] [readonly] +**id** | **str** | | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SnippetResponseAllOf.md b/docs/SnippetResponseCommonAllOf.md similarity index 95% rename from docs/SnippetResponseAllOf.md rename to docs/SnippetResponseCommonAllOf.md index 0f07143..68ed8ac 100644 --- a/docs/SnippetResponseAllOf.md +++ b/docs/SnippetResponseCommonAllOf.md @@ -1,4 +1,4 @@ -# SnippetResponseAllOf +# SnippetResponseCommonAllOf ## Properties diff --git a/docs/SnippetResponsePost.md b/docs/SnippetResponsePost.md new file mode 100644 index 0000000..6729cfe --- /dev/null +++ b/docs/SnippetResponsePost.md @@ -0,0 +1,22 @@ +# SnippetResponsePost + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The name for the snippet. | [optional] +**type** | **str** | The location in generated VCL where the snippet should be placed. | [optional] +**content** | **str** | The VCL code that specifies exactly what the snippet does. | [optional] +**priority** | **str** | Priority determines execution order. Lower numbers execute first. | [optional] if omitted the server will use the default value of "100" +**dynamic** | **float** | Sets the snippet version. | [optional] +**created_at** | **datetime, none_type** | Date and time in ISO 8601 format. | [optional] [readonly] +**deleted_at** | **datetime, none_type** | Date and time in ISO 8601 format. | [optional] [readonly] +**updated_at** | **datetime, none_type** | Date and time in ISO 8601 format. | [optional] [readonly] +**service_id** | **str** | | [optional] [readonly] +**version** | **str** | String representing the number identifying a version of the service. | [optional] [readonly] +**id** | **str** | | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SnippetWithDynamicNumber.md b/docs/SnippetWithDynamicNumber.md new file mode 100644 index 0000000..a016104 --- /dev/null +++ b/docs/SnippetWithDynamicNumber.md @@ -0,0 +1,16 @@ +# SnippetWithDynamicNumber + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The name for the snippet. | [optional] +**type** | **str** | The location in generated VCL where the snippet should be placed. | [optional] +**content** | **str** | The VCL code that specifies exactly what the snippet does. | [optional] +**priority** | **str** | Priority determines execution order. Lower numbers execute first. | [optional] if omitted the server will use the default value of "100" +**dynamic** | **float** | Sets the snippet version. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SnippetWithDynamicNumberAllOf.md b/docs/SnippetWithDynamicNumberAllOf.md new file mode 100644 index 0000000..45f646c --- /dev/null +++ b/docs/SnippetWithDynamicNumberAllOf.md @@ -0,0 +1,12 @@ +# SnippetWithDynamicNumberAllOf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dynamic** | **float** | Sets the snippet version. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ValuesDdos.md b/docs/ValuesDdos.md new file mode 100644 index 0000000..cda4c14 --- /dev/null +++ b/docs/ValuesDdos.md @@ -0,0 +1,18 @@ +# ValuesDdos + +The results of the query, optionally filtered and grouped over the requested timespan. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ddos_action_limit_streams_connections** | **int** | For HTTP/2, the number of connections the limit-streams action was applied to. The limit-streams action caps the allowed number of concurrent streams in a connection. | [optional] +**ddos_action_limit_streams_requests** | **int** | For HTTP/2, the number of requests made on a connection for which the limit-streams action was taken. The limit-streams action caps the allowed number of concurrent streams in a connection. | [optional] +**ddos_action_tarpit_accept** | **int** | The number of times the tarpit-accept action was taken. The tarpit-accept action adds a delay when accepting future connections. | [optional] +**ddos_action_tarpit** | **int** | The number of times the tarpit action was taken. The tarpit action delays writing the response to the client. | [optional] +**ddos_action_close** | **int** | 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] +**ddos_action_blackhole** | **int** | 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] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/WholePlatformDdosHistoricalApi.md b/docs/WholePlatformDdosHistoricalApi.md new file mode 100644 index 0000000..6e3e70a --- /dev/null +++ b/docs/WholePlatformDdosHistoricalApi.md @@ -0,0 +1,92 @@ +# fastly.WholePlatformDdosHistoricalApi + +All URIs are relative to *https://api.fastly.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_platform_ddos_historical**](WholePlatformDdosHistoricalApi.md#get_platform_ddos_historical) | **GET** /metrics/platform/ddos | Get historical DDoS metrics for the entire Fastly platform + + +# **get_platform_ddos_historical** +> PlatformDdosResponse get_platform_ddos_historical() + +Get historical DDoS metrics for the entire Fastly platform + +Fetches historical DDoS metrics for the entire Fastly platform. + +### Example + +* Api Key Authentication (token): + +```python +import time +import fastly +from fastly.api import whole_platform_ddos_historical_api +from fastly.model.platform_ddos_response import PlatformDdosResponse +from pprint import pprint +# Defining the host is optional and defaults to https://api.fastly.com +# See configuration.py for a list of all supported configuration parameters. +configuration = fastly.Configuration( + host = "https://api.fastly.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: token +configuration.api_key['token'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['token'] = 'Bearer' + +# Enter a context with an instance of the API client +with fastly.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = whole_platform_ddos_historical_api.WholePlatformDdosHistoricalApi(api_client) + start = "2021-08-01T00:00:00.000Z" # str | A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the inclusive start of the query time range. If not provided, a default is chosen based on the provided `downsample` value. (optional) + end = "2020-08-02T00:00:00.000Z" # str | A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the exclusive end of the query time range. If not provided, a default is chosen based on the provided `downsample` value. (optional) + downsample = "hour" # str | Duration of sample windows. (optional) if omitted the server will use the default value of "hour" + + # example passing only required values which don't have defaults set + # and optional values + try: + # Get historical DDoS metrics for the entire Fastly platform + api_response = api_instance.get_platform_ddos_historical(start=start, end=end, downsample=downsample) + pprint(api_response) + except fastly.ApiException as e: + print("Exception when calling WholePlatformDdosHistoricalApi->get_platform_ddos_historical: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **start** | **str**| A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the inclusive start of the query time range. If not provided, a default is chosen based on the provided `downsample` value. | [optional] + **end** | **str**| A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the exclusive end of the query time range. If not provided, a default is chosen based on the provided `downsample` value. | [optional] + **downsample** | **str**| Duration of sample windows. | [optional] if omitted the server will use the default value of "hour" + +### Return type + +[**PlatformDdosResponse**](PlatformDdosResponse.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/fastly/__init__.py b/fastly/__init__.py index 8d7aa96..457a558 100644 --- a/fastly/__init__.py +++ b/fastly/__init__.py @@ -10,7 +10,7 @@ """ -__version__ = "4.1.1" +__version__ = "4.2.0" # import ApiClient from fastly.api_client import ApiClient diff --git a/fastly/api/kv_store_api.py b/fastly/api/kv_store_api.py index 226c277..fdc373f 100644 --- a/fastly/api/kv_store_api.py +++ b/fastly/api/kv_store_api.py @@ -277,9 +277,9 @@ def create_store( self, **kwargs ): - """Create an kv store. # noqa: E501 + """Create a KV store. # noqa: E501 - Create a new kv store. # noqa: E501 + Create a new KV store. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -353,9 +353,9 @@ def delete_store( store_id, **kwargs ): - """Delete an kv store. # noqa: E501 + """Delete a KV store. # noqa: E501 - An kv store must be empty before it can be deleted. Deleting an kv store that still contains keys will result in a `409` (Conflict). # noqa: E501 + A KV store must be empty before it can be deleted. Deleting a KV store that still contains keys will result in a `409` (Conflict). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -431,9 +431,9 @@ def get_store( store_id, **kwargs ): - """Describe an kv store. # noqa: E501 + """Describe a KV store. # noqa: E501 - Get an kv store by ID. # noqa: E501 + Get a KV store by ID. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -508,7 +508,7 @@ def get_stores( self, **kwargs ): - """List kv stores. # noqa: E501 + """List KV stores. # noqa: E501 Get all stores for a given customer. # noqa: E501 This method makes a synchronous HTTP request by default. To make an diff --git a/fastly/api/logging_logentries_api.py b/fastly/api/logging_logentries_api.py index 8d78290..660597d 100644 --- a/fastly/api/logging_logentries_api.py +++ b/fastly/api/logging_logentries_api.py @@ -546,7 +546,7 @@ def create_log_logentries( format (str): A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats).. [optional] if omitted the server will use the default value of "%h %l %u %t "%r" %>s %b" format_version (int): The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. . [optional] if omitted the server will use the default value of 2 port (int): The port number.. [optional] if omitted the server will use the default value of 20000 - token (str): Use token based authentication ([https://logentries.com/doc/input-token/](https://logentries.com/doc/input-token/)).. [optional] + token (str): Use token based authentication.. [optional] use_tls (LoggingUseTls): [optional] region (str): The region to which to stream logs.. [optional] _return_http_data_only (bool): response data without head status @@ -893,7 +893,7 @@ def update_log_logentries( format (str): A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats).. [optional] if omitted the server will use the default value of "%h %l %u %t "%r" %>s %b" format_version (int): The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. . [optional] if omitted the server will use the default value of 2 port (int): The port number.. [optional] if omitted the server will use the default value of 20000 - token (str): Use token based authentication ([https://logentries.com/doc/input-token/](https://logentries.com/doc/input-token/)).. [optional] + token (str): Use token based authentication.. [optional] use_tls (LoggingUseTls): [optional] region (str): The region to which to stream logs.. [optional] _return_http_data_only (bool): response data without head status diff --git a/fastly/api/snippet_api.py b/fastly/api/snippet_api.py index 3074338..1c9aa11 100644 --- a/fastly/api/snippet_api.py +++ b/fastly/api/snippet_api.py @@ -23,6 +23,7 @@ ) from fastly.model.inline_response200 import InlineResponse200 from fastly.model.snippet_response import SnippetResponse +from fastly.model.snippet_response_post import SnippetResponsePost class SnippetApi(object): @@ -36,7 +37,7 @@ def __init__(self, api_client=None): self.api_client = api_client self.create_snippet_endpoint = _Endpoint( settings={ - 'response_type': (SnippetResponse,), + 'response_type': (SnippetResponsePost,), 'auth': [ 'token' ], @@ -55,10 +56,10 @@ def __init__(self, api_client=None): 'service_id', 'version_id', 'name', - 'dynamic', 'type', 'content', 'priority', + 'dynamic', ], 'required': [ 'service_id', @@ -67,8 +68,8 @@ def __init__(self, api_client=None): 'nullable': [ ], 'enum': [ - 'dynamic', 'type', + 'dynamic', ], 'validation': [ ] @@ -77,11 +78,6 @@ def __init__(self, api_client=None): 'validations': { }, 'allowed_values': { - ('dynamic',): { - - "regular": "0", - "dynamic": "1" - }, ('type',): { "INIT": "init", @@ -96,6 +92,11 @@ def __init__(self, api_client=None): "LOG": "log", "NONE": "none" }, + ('dynamic',): { + + "regular": "0", + "dynamic": "1" + }, }, 'openapi_types': { 'service_id': @@ -104,32 +105,32 @@ def __init__(self, api_client=None): (int,), 'name': (str,), - 'dynamic': - (str,), 'type': (str,), 'content': (str,), 'priority': (str,), + 'dynamic': + (str,), }, 'attribute_map': { 'service_id': 'service_id', 'version_id': 'version_id', 'name': 'name', - 'dynamic': 'dynamic', 'type': 'type', 'content': 'content', 'priority': 'priority', + 'dynamic': 'dynamic', }, 'location_map': { 'service_id': 'path', 'version_id': 'path', 'name': 'form', - 'dynamic': 'form', 'type': 'form', 'content': 'form', 'priority': 'form', + 'dynamic': 'form', }, 'path_params_allow_reserved_map': { }, @@ -507,10 +508,10 @@ def __init__(self, api_client=None): 'service_id', 'snippet_id', 'name', - 'dynamic', 'type', 'content', 'priority', + 'dynamic', ], 'required': [ 'service_id', @@ -519,8 +520,8 @@ def __init__(self, api_client=None): 'nullable': [ ], 'enum': [ - 'dynamic', 'type', + 'dynamic', ], 'validation': [ ] @@ -529,11 +530,6 @@ def __init__(self, api_client=None): 'validations': { }, 'allowed_values': { - ('dynamic',): { - - "regular": "0", - "dynamic": "1" - }, ('type',): { "INIT": "init", @@ -548,6 +544,11 @@ def __init__(self, api_client=None): "LOG": "log", "NONE": "none" }, + ('dynamic',): { + + "regular": "0", + "dynamic": "1" + }, }, 'openapi_types': { 'service_id': @@ -556,32 +557,32 @@ def __init__(self, api_client=None): (str,), 'name': (str,), - 'dynamic': - (str,), 'type': (str,), 'content': (str,), 'priority': (str,), + 'dynamic': + (str,), }, 'attribute_map': { 'service_id': 'service_id', 'snippet_id': 'snippet_id', 'name': 'name', - 'dynamic': 'dynamic', 'type': 'type', 'content': 'content', 'priority': 'priority', + 'dynamic': 'dynamic', }, 'location_map': { 'service_id': 'path', 'snippet_id': 'path', 'name': 'form', - 'dynamic': 'form', 'type': 'form', 'content': 'form', 'priority': 'form', + 'dynamic': 'form', }, 'path_params_allow_reserved_map': { }, @@ -620,10 +621,10 @@ def create_snippet( Keyword Args: name (str): The name for the snippet.. [optional] - dynamic (str): Sets the snippet version.. [optional] type (str): The location in generated VCL where the snippet should be placed.. [optional] content (str): The VCL code that specifies exactly what the snippet does.. [optional] priority (str): Priority determines execution order. Lower numbers execute first.. [optional] if omitted the server will use the default value of "100" + dynamic (str): Sets the snippet version.. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -652,7 +653,7 @@ def create_snippet( async_req (bool): execute request asynchronously Returns: - SnippetResponse + SnippetResponsePost If the method is called asynchronously, returns the request thread. """ @@ -1129,10 +1130,10 @@ def update_snippet_dynamic( Keyword Args: name (str): The name for the snippet.. [optional] - dynamic (str): Sets the snippet version.. [optional] type (str): The location in generated VCL where the snippet should be placed.. [optional] content (str): The VCL code that specifies exactly what the snippet does.. [optional] priority (str): Priority determines execution order. Lower numbers execute first.. [optional] if omitted the server will use the default value of "100" + dynamic (str): Sets the snippet version.. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object diff --git a/fastly/api/whole_platform_ddos_historical_api.py b/fastly/api/whole_platform_ddos_historical_api.py new file mode 100644 index 0000000..96932c2 --- /dev/null +++ b/fastly/api/whole_platform_ddos_historical_api.py @@ -0,0 +1,184 @@ +""" + 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/) # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: oss@fastly.com +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from fastly.api_client import ApiClient, Endpoint as _Endpoint +from fastly.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) +from fastly.model.platform_ddos_response import PlatformDdosResponse + + +class WholePlatformDdosHistoricalApi(object): + """NOTE: This class is auto generated. + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + self.get_platform_ddos_historical_endpoint = _Endpoint( + settings={ + 'response_type': (PlatformDdosResponse,), + 'auth': [ + 'token' + ], + 'endpoint_path': '/metrics/platform/ddos', + 'operation_id': 'get_platform_ddos_historical', + 'http_method': 'GET', + 'servers': [ + { + 'url': "https://api.fastly.com", + 'description': "No description provided", + }, + ] + }, + params_map={ + 'all': [ + 'start', + 'end', + 'downsample', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + 'downsample', + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + ('downsample',): { + + "HOUR": "hour", + "DAY": "day" + }, + }, + 'openapi_types': { + 'start': + (str,), + 'end': + (str,), + 'downsample': + (str,), + }, + 'attribute_map': { + 'start': 'start', + 'end': 'end', + 'downsample': 'downsample', + }, + 'location_map': { + 'start': 'query', + 'end': 'query', + 'downsample': 'query', + }, + 'path_params_allow_reserved_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + + def get_platform_ddos_historical( + self, + **kwargs + ): + """Get historical DDoS metrics for the entire Fastly platform # noqa: E501 + + Fetches historical DDoS metrics for the entire Fastly platform. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_platform_ddos_historical(async_req=True) + >>> result = thread.get() + + + Keyword Args: + start (str): A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the inclusive start of the query time range. If not provided, a default is chosen based on the provided `downsample` value.. [optional] + end (str): A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the exclusive end of the query time range. If not provided, a default is chosen based on the provided `downsample` value.. [optional] + downsample (str): Duration of sample windows.. [optional] if omitted the server will use the default value of "hour" + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + PlatformDdosResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + return self.get_platform_ddos_historical_endpoint.call_with_http_info(**kwargs) + diff --git a/fastly/api_client.py b/fastly/api_client.py index 123ebb3..aa2edd2 100644 --- a/fastly/api_client.py +++ b/fastly/api_client.py @@ -79,7 +79,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'fastly-py/4.1.1' + self.user_agent = 'fastly-py/4.2.0' # The last observed value of http header Fastly-RateLimit-Remaining self.rate_limit_remaining = DEFAULT_RATELIMIT diff --git a/fastly/apis/__init__.py b/fastly/apis/__init__.py index b00ce01..9a2160d 100644 --- a/fastly/apis/__init__.py +++ b/fastly/apis/__init__.py @@ -130,3 +130,4 @@ from fastly.api.waf_rule_revisions_api import WafRuleRevisionsApi from fastly.api.waf_rules_api import WafRulesApi from fastly.api.waf_tags_api import WafTagsApi +from fastly.api.whole_platform_ddos_historical_api import WholePlatformDdosHistoricalApi diff --git a/fastly/configuration.py b/fastly/configuration.py index 7f09c46..b59a650 100644 --- a/fastly/configuration.py +++ b/fastly/configuration.py @@ -446,7 +446,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 1.0.0\n"\ - "SDK Package Version: 4.1.1".\ + "SDK Package Version: 4.2.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/fastly/model/historical_ddos.py b/fastly/model/historical_ddos.py new file mode 100644 index 0000000..bc0600b --- /dev/null +++ b/fastly/model/historical_ddos.py @@ -0,0 +1,273 @@ +""" + 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/) # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: oss@fastly.com +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from fastly.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from fastly.exceptions import ApiAttributeError + + +def lazy_import(): + from fastly.model.historical_ddos_meta import HistoricalDdosMeta + from fastly.model.platform_ddos_data_items import PlatformDdosDataItems + globals()['HistoricalDdosMeta'] = HistoricalDdosMeta + globals()['PlatformDdosDataItems'] = PlatformDdosDataItems + + +class HistoricalDdos(ModelNormal): + """NOTE: This class is auto generated. + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'status': (str,), # noqa: E501 + 'meta': (HistoricalDdosMeta,), # noqa: E501 + 'msg': (str, none_type,), # noqa: E501 + 'data': ([PlatformDdosDataItems],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'status': 'status', # noqa: E501 + 'meta': 'meta', # noqa: E501 + 'msg': 'msg', # noqa: E501 + 'data': 'data', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """HistoricalDdos - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + status (str): Whether or not we were able to successfully execute the query.. [optional] # noqa: E501 + meta (HistoricalDdosMeta): [optional] # noqa: E501 + msg (str, none_type): If the query was not successful, this will provide a string that explains why.. [optional] # noqa: E501 + data ([PlatformDdosDataItems]): A list of [entries](#entry-data-model).. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """HistoricalDdos - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + status (str): Whether or not we were able to successfully execute the query.. [optional] # noqa: E501 + meta (HistoricalDdosMeta): [optional] # noqa: E501 + msg (str, none_type): If the query was not successful, this will provide a string that explains why.. [optional] # noqa: E501 + data ([PlatformDdosDataItems]): A list of [entries](#entry-data-model).. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/fastly/model/historical_ddos_meta.py b/fastly/model/historical_ddos_meta.py new file mode 100644 index 0000000..e6064fe --- /dev/null +++ b/fastly/model/historical_ddos_meta.py @@ -0,0 +1,265 @@ +""" + 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/) # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: oss@fastly.com +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from fastly.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from fastly.exceptions import ApiAttributeError + + + +class HistoricalDdosMeta(ModelNormal): + """NOTE: This class is auto generated. + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'start': (str,), # noqa: E501 + 'end': (str,), # noqa: E501 + 'downsample': (str,), # noqa: E501 + 'metric': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'start': 'start', # noqa: E501 + 'end': 'end', # noqa: E501 + 'downsample': 'downsample', # noqa: E501 + 'metric': 'metric', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """HistoricalDdosMeta - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + start (str): Start time that was used to perform the query as an ISO-8601-formatted date and time.. [optional] # noqa: E501 + end (str): End time that was used to perform the query as an ISO-8601-formatted date and time.. [optional] # noqa: E501 + downsample (str): Downsample that was used to perform the query. One of `hour` or `day`.. [optional] # noqa: E501 + metric (str): A comma-separated list of the metrics that were requested.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """HistoricalDdosMeta - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + start (str): Start time that was used to perform the query as an ISO-8601-formatted date and time.. [optional] # noqa: E501 + end (str): End time that was used to perform the query as an ISO-8601-formatted date and time.. [optional] # noqa: E501 + downsample (str): Downsample that was used to perform the query. One of `hour` or `day`.. [optional] # noqa: E501 + metric (str): A comma-separated list of the metrics that were requested.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/fastly/model/historical_field_results_attributes.py b/fastly/model/historical_field_results_attributes.py index 80b1354..baf16ab 100644 --- a/fastly/model/historical_field_results_attributes.py +++ b/fastly/model/historical_field_results_attributes.py @@ -305,6 +305,15 @@ def openapi_types(): 'ddos_action_tarpit': (int,), # noqa: E501 'ddos_action_close': (int,), # noqa: E501 'ddos_action_blackhole': (int,), # noqa: E501 + 'bot_challenge_starts': (int,), # noqa: E501 + 'bot_challenge_complete_tokens_passed': (int,), # noqa: E501 + 'bot_challenge_complete_tokens_failed': (int,), # noqa: E501 + 'bot_challenge_complete_tokens_checked': (int,), # noqa: E501 + 'bot_challenge_complete_tokens_disabled': (int,), # noqa: E501 + 'bot_challenge_complete_tokens_issued': (int,), # noqa: E501 + 'bot_challenges_issued': (int,), # noqa: E501 + 'bot_challenges_succeeded': (int,), # noqa: E501 + 'bot_challenges_failed': (int,), # noqa: E501 'service_id': (ReadOnlyIdService,), # noqa: E501 'start_time': (int,), # noqa: E501 } @@ -531,6 +540,15 @@ def discriminator(): 'ddos_action_tarpit': 'ddos_action_tarpit', # noqa: E501 'ddos_action_close': 'ddos_action_close', # noqa: E501 'ddos_action_blackhole': 'ddos_action_blackhole', # noqa: E501 + 'bot_challenge_starts': 'bot_challenge_starts', # noqa: E501 + 'bot_challenge_complete_tokens_passed': 'bot_challenge_complete_tokens_passed', # noqa: E501 + 'bot_challenge_complete_tokens_failed': 'bot_challenge_complete_tokens_failed', # noqa: E501 + 'bot_challenge_complete_tokens_checked': 'bot_challenge_complete_tokens_checked', # noqa: E501 + 'bot_challenge_complete_tokens_disabled': 'bot_challenge_complete_tokens_disabled', # noqa: E501 + 'bot_challenge_complete_tokens_issued': 'bot_challenge_complete_tokens_issued', # noqa: E501 + 'bot_challenges_issued': 'bot_challenges_issued', # noqa: E501 + 'bot_challenges_succeeded': 'bot_challenges_succeeded', # noqa: E501 + 'bot_challenges_failed': 'bot_challenges_failed', # noqa: E501 'service_id': 'service_id', # noqa: E501 'start_time': 'start_time', # noqa: E501 } @@ -790,6 +808,15 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 ddos_action_tarpit (int): The number of times the tarpit action was taken. The tarpit action delays writing the response to the client.. [optional] # noqa: E501 ddos_action_close (int): 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] # noqa: E501 ddos_action_blackhole (int): 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] # noqa: E501 + bot_challenge_starts (int): The number of challenge-start tokens created.. [optional] # noqa: E501 + bot_challenge_complete_tokens_passed (int): The number of challenge-complete tokens that passed validation.. [optional] # noqa: E501 + bot_challenge_complete_tokens_failed (int): The number of challenge-complete tokens that failed validation.. [optional] # noqa: E501 + bot_challenge_complete_tokens_checked (int): The number of challenge-complete tokens checked.. [optional] # noqa: E501 + bot_challenge_complete_tokens_disabled (int): The number of challenge-complete tokens not checked because the feature was disabled.. [optional] # noqa: E501 + bot_challenge_complete_tokens_issued (int): The number of challenge-complete tokens issued. For example, issuing a challenge-complete token after a series of CAPTCHA challenges ending in success.. [optional] # noqa: E501 + bot_challenges_issued (int): The number of challenges issued. For example, the issuance of a CAPTCHA challenge.. [optional] # noqa: E501 + bot_challenges_succeeded (int): The number of successful challenge solutions processed. For example, a correct CAPTCHA solution.. [optional] # noqa: E501 + bot_challenges_failed (int): The number of failed challenge solutions processed. For example, an incorrect CAPTCHA solution.. [optional] # noqa: E501 service_id (ReadOnlyIdService): [optional] # noqa: E501 start_time (int): [optional] # noqa: E501 """ @@ -1107,6 +1134,15 @@ def __init__(self, *args, **kwargs): # noqa: E501 ddos_action_tarpit (int): The number of times the tarpit action was taken. The tarpit action delays writing the response to the client.. [optional] # noqa: E501 ddos_action_close (int): 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] # noqa: E501 ddos_action_blackhole (int): 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] # noqa: E501 + bot_challenge_starts (int): The number of challenge-start tokens created.. [optional] # noqa: E501 + bot_challenge_complete_tokens_passed (int): The number of challenge-complete tokens that passed validation.. [optional] # noqa: E501 + bot_challenge_complete_tokens_failed (int): The number of challenge-complete tokens that failed validation.. [optional] # noqa: E501 + bot_challenge_complete_tokens_checked (int): The number of challenge-complete tokens checked.. [optional] # noqa: E501 + bot_challenge_complete_tokens_disabled (int): The number of challenge-complete tokens not checked because the feature was disabled.. [optional] # noqa: E501 + bot_challenge_complete_tokens_issued (int): The number of challenge-complete tokens issued. For example, issuing a challenge-complete token after a series of CAPTCHA challenges ending in success.. [optional] # noqa: E501 + bot_challenges_issued (int): The number of challenges issued. For example, the issuance of a CAPTCHA challenge.. [optional] # noqa: E501 + bot_challenges_succeeded (int): The number of successful challenge solutions processed. For example, a correct CAPTCHA solution.. [optional] # noqa: E501 + bot_challenges_failed (int): The number of failed challenge solutions processed. For example, an incorrect CAPTCHA solution.. [optional] # noqa: E501 service_id (ReadOnlyIdService): [optional] # noqa: E501 start_time (int): [optional] # noqa: E501 """ diff --git a/fastly/model/logging_logentries_additional.py b/fastly/model/logging_logentries_additional.py index 6459a44..04c4a51 100644 --- a/fastly/model/logging_logentries_additional.py +++ b/fastly/model/logging_logentries_additional.py @@ -154,7 +154,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) port (int): The port number.. [optional] if omitted the server will use the default value of 20000 # noqa: E501 - token (str): Use token based authentication ([https://logentries.com/doc/input-token/](https://logentries.com/doc/input-token/)).. [optional] # noqa: E501 + token (str): Use token based authentication.. [optional] # noqa: E501 use_tls (LoggingUseTls): [optional] # noqa: E501 region (str): The region to which to stream logs.. [optional] # noqa: E501 """ @@ -239,7 +239,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) port (int): The port number.. [optional] if omitted the server will use the default value of 20000 # noqa: E501 - token (str): Use token based authentication ([https://logentries.com/doc/input-token/](https://logentries.com/doc/input-token/)).. [optional] # noqa: E501 + token (str): Use token based authentication.. [optional] # noqa: E501 use_tls (LoggingUseTls): [optional] # noqa: E501 region (str): The region to which to stream logs.. [optional] # noqa: E501 """ diff --git a/fastly/model/logging_logentries_response.py b/fastly/model/logging_logentries_response.py index 2e46e4d..5c985ca 100644 --- a/fastly/model/logging_logentries_response.py +++ b/fastly/model/logging_logentries_response.py @@ -200,7 +200,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 format (str): A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats).. [optional] if omitted the server will use the default value of "%h %l %u %t "%r" %>s %b" # noqa: E501 format_version (str): The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. . [optional] if omitted the server will use the default value of "2" # noqa: E501 port (int): The port number.. [optional] if omitted the server will use the default value of 20000 # noqa: E501 - token (str): Use token based authentication ([https://logentries.com/doc/input-token/](https://logentries.com/doc/input-token/)).. [optional] # noqa: E501 + token (str): Use token based authentication.. [optional] # noqa: E501 use_tls (LoggingUseTls): [optional] # noqa: E501 region (str): The region to which to stream logs.. [optional] # noqa: E501 created_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 @@ -313,7 +313,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 format (str): A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats).. [optional] if omitted the server will use the default value of "%h %l %u %t "%r" %>s %b" # noqa: E501 format_version (str): The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. . [optional] if omitted the server will use the default value of "2" # noqa: E501 port (int): The port number.. [optional] if omitted the server will use the default value of 20000 # noqa: E501 - token (str): Use token based authentication ([https://logentries.com/doc/input-token/](https://logentries.com/doc/input-token/)).. [optional] # noqa: E501 + token (str): Use token based authentication.. [optional] # noqa: E501 use_tls (LoggingUseTls): [optional] # noqa: E501 region (str): The region to which to stream logs.. [optional] # noqa: E501 created_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 diff --git a/fastly/model/platform_ddos_data_items.py b/fastly/model/platform_ddos_data_items.py new file mode 100644 index 0000000..ccb6455 --- /dev/null +++ b/fastly/model/platform_ddos_data_items.py @@ -0,0 +1,259 @@ +""" + 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/) # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: oss@fastly.com +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from fastly.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from fastly.exceptions import ApiAttributeError + + +def lazy_import(): + from fastly.model.values import Values + globals()['Values'] = Values + + +class PlatformDdosDataItems(ModelNormal): + """NOTE: This class is auto generated. + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'values': (Values,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'values': 'values', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PlatformDdosDataItems - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + values (Values): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """PlatformDdosDataItems - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + values (Values): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/fastly/model/platform_ddos_entry.py b/fastly/model/platform_ddos_entry.py new file mode 100644 index 0000000..36c9168 --- /dev/null +++ b/fastly/model/platform_ddos_entry.py @@ -0,0 +1,259 @@ +""" + 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/) # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: oss@fastly.com +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from fastly.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from fastly.exceptions import ApiAttributeError + + +def lazy_import(): + from fastly.model.values_ddos import ValuesDdos + globals()['ValuesDdos'] = ValuesDdos + + +class PlatformDdosEntry(ModelNormal): + """NOTE: This class is auto generated. + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'values': ([ValuesDdos],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'values': 'values', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PlatformDdosEntry - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + values ([ValuesDdos]): An array of values representing the metric values at each point in time. Note that this dataset is sparse: only the keys with non-zero values will be included in the record. . [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """PlatformDdosEntry - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + values ([ValuesDdos]): An array of values representing the metric values at each point in time. Note that this dataset is sparse: only the keys with non-zero values will be included in the record. . [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/fastly/model/platform_ddos_response.py b/fastly/model/platform_ddos_response.py new file mode 100644 index 0000000..485720e --- /dev/null +++ b/fastly/model/platform_ddos_response.py @@ -0,0 +1,328 @@ +""" + 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/) # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: oss@fastly.com +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from fastly.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from fastly.exceptions import ApiAttributeError + + +def lazy_import(): + from fastly.model.historical_ddos import HistoricalDdos + from fastly.model.historical_ddos_meta import HistoricalDdosMeta + from fastly.model.platform_ddos_response_all_of import PlatformDdosResponseAllOf + from fastly.model.platform_ddos_response_data import PlatformDdosResponseData + globals()['HistoricalDdos'] = HistoricalDdos + globals()['HistoricalDdosMeta'] = HistoricalDdosMeta + globals()['PlatformDdosResponseAllOf'] = PlatformDdosResponseAllOf + globals()['PlatformDdosResponseData'] = PlatformDdosResponseData + + +class PlatformDdosResponse(ModelComposed): + """NOTE: This class is auto generated. + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'status': (str,), # noqa: E501 + 'meta': (HistoricalDdosMeta,), # noqa: E501 + 'msg': (str, none_type,), # noqa: E501 + 'data': (PlatformDdosResponseData,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'status': 'status', # noqa: E501 + 'meta': 'meta', # noqa: E501 + 'msg': 'msg', # noqa: E501 + 'data': 'data', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PlatformDdosResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + status (str): Whether or not we were able to successfully execute the query.. [optional] # noqa: E501 + meta (HistoricalDdosMeta): [optional] # noqa: E501 + msg (str, none_type): If the query was not successful, this will provide a string that explains why.. [optional] # noqa: E501 + data (PlatformDdosResponseData): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """PlatformDdosResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + status (str): Whether or not we were able to successfully execute the query.. [optional] # noqa: E501 + meta (HistoricalDdosMeta): [optional] # noqa: E501 + msg (str, none_type): If the query was not successful, this will provide a string that explains why.. [optional] # noqa: E501 + data (PlatformDdosResponseData): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + HistoricalDdos, + PlatformDdosResponseAllOf, + ], + 'oneOf': [ + ], + } diff --git a/fastly/model/platform_ddos_response_all_of.py b/fastly/model/platform_ddos_response_all_of.py new file mode 100644 index 0000000..9ae47c5 --- /dev/null +++ b/fastly/model/platform_ddos_response_all_of.py @@ -0,0 +1,259 @@ +""" + 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/) # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: oss@fastly.com +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from fastly.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from fastly.exceptions import ApiAttributeError + + +def lazy_import(): + from fastly.model.platform_ddos_response_data import PlatformDdosResponseData + globals()['PlatformDdosResponseData'] = PlatformDdosResponseData + + +class PlatformDdosResponseAllOf(ModelNormal): + """NOTE: This class is auto generated. + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'data': (PlatformDdosResponseData,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'data': 'data', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PlatformDdosResponseAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (PlatformDdosResponseData): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """PlatformDdosResponseAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (PlatformDdosResponseData): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/fastly/model/platform_ddos_response_data.py b/fastly/model/platform_ddos_response_data.py new file mode 100644 index 0000000..a2bd7e5 --- /dev/null +++ b/fastly/model/platform_ddos_response_data.py @@ -0,0 +1,281 @@ +""" + 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/) # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: oss@fastly.com +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from fastly.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from fastly.exceptions import ApiAttributeError + + +def lazy_import(): + from fastly.model.platform_ddos_entry import PlatformDdosEntry + globals()['PlatformDdosEntry'] = PlatformDdosEntry + + +class PlatformDdosResponseData(ModelSimple): + """NOTE: This class is auto generated. + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'value': ([PlatformDdosEntry],), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """PlatformDdosResponseData - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([PlatformDdosEntry]): A list of timeseries.. # noqa: E501 + + Keyword Args: + value ([PlatformDdosEntry]): A list of timeseries.. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """PlatformDdosResponseData - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([PlatformDdosEntry]): A list of timeseries.. # noqa: E501 + + Keyword Args: + value ([PlatformDdosEntry]): A list of timeseries.. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/fastly/model/realtime_entry_aggregated.py b/fastly/model/realtime_entry_aggregated.py index 4325143..0871d2e 100644 --- a/fastly/model/realtime_entry_aggregated.py +++ b/fastly/model/realtime_entry_aggregated.py @@ -303,6 +303,15 @@ def openapi_types(): 'ddos_action_tarpit': (int,), # noqa: E501 'ddos_action_close': (int,), # noqa: E501 'ddos_action_blackhole': (int,), # noqa: E501 + 'bot_challenge_starts': (int,), # noqa: E501 + 'bot_challenge_complete_tokens_passed': (int,), # noqa: E501 + 'bot_challenge_complete_tokens_failed': (int,), # noqa: E501 + 'bot_challenge_complete_tokens_checked': (int,), # noqa: E501 + 'bot_challenge_complete_tokens_disabled': (int,), # noqa: E501 + 'bot_challenges_issued': (int,), # noqa: E501 + 'bot_challenges_succeeded': (int,), # noqa: E501 + 'bot_challenges_failed': (int,), # noqa: E501 + 'bot_challenge_complete_tokens_issued': (int,), # noqa: E501 } @cached_property @@ -529,6 +538,15 @@ def discriminator(): 'ddos_action_tarpit': 'ddos_action_tarpit', # noqa: E501 'ddos_action_close': 'ddos_action_close', # noqa: E501 'ddos_action_blackhole': 'ddos_action_blackhole', # noqa: E501 + 'bot_challenge_starts': 'bot_challenge_starts', # noqa: E501 + 'bot_challenge_complete_tokens_passed': 'bot_challenge_complete_tokens_passed', # noqa: E501 + 'bot_challenge_complete_tokens_failed': 'bot_challenge_complete_tokens_failed', # noqa: E501 + 'bot_challenge_complete_tokens_checked': 'bot_challenge_complete_tokens_checked', # noqa: E501 + 'bot_challenge_complete_tokens_disabled': 'bot_challenge_complete_tokens_disabled', # noqa: E501 + 'bot_challenges_issued': 'bot_challenges_issued', # noqa: E501 + 'bot_challenges_succeeded': 'bot_challenges_succeeded', # noqa: E501 + 'bot_challenges_failed': 'bot_challenges_failed', # noqa: E501 + 'bot_challenge_complete_tokens_issued': 'bot_challenge_complete_tokens_issued', # noqa: E501 } read_only_vars = { @@ -788,6 +806,15 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 ddos_action_tarpit (int): The number of times the tarpit action was taken. The tarpit action delays writing the response to the client.. [optional] # noqa: E501 ddos_action_close (int): 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] # noqa: E501 ddos_action_blackhole (int): 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] # noqa: E501 + bot_challenge_starts (int): The number of challenge-start tokens created.. [optional] # noqa: E501 + bot_challenge_complete_tokens_passed (int): The number of challenge-complete tokens that passed validation.. [optional] # noqa: E501 + bot_challenge_complete_tokens_failed (int): The number of challenge-complete tokens that failed validation.. [optional] # noqa: E501 + bot_challenge_complete_tokens_checked (int): The number of challenge-complete tokens checked.. [optional] # noqa: E501 + bot_challenge_complete_tokens_disabled (int): The number of challenge-complete tokens not checked because the feature was disabled.. [optional] # noqa: E501 + bot_challenges_issued (int): The number of challenges issued. For example, the issuance of a CAPTCHA challenge.. [optional] # noqa: E501 + bot_challenges_succeeded (int): The number of successful challenge solutions processed. For example, a correct CAPTCHA solution.. [optional] # noqa: E501 + bot_challenges_failed (int): The number of failed challenge solutions processed. For example, an incorrect CAPTCHA solution.. [optional] # noqa: E501 + bot_challenge_complete_tokens_issued (int): The number of challenge-complete tokens issued. For example, issuing a challenge-complete token after a series of CAPTCHA challenges ending in success.. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) @@ -1105,6 +1132,15 @@ def __init__(self, *args, **kwargs): # noqa: E501 ddos_action_tarpit (int): The number of times the tarpit action was taken. The tarpit action delays writing the response to the client.. [optional] # noqa: E501 ddos_action_close (int): 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] # noqa: E501 ddos_action_blackhole (int): 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] # noqa: E501 + bot_challenge_starts (int): The number of challenge-start tokens created.. [optional] # noqa: E501 + bot_challenge_complete_tokens_passed (int): The number of challenge-complete tokens that passed validation.. [optional] # noqa: E501 + bot_challenge_complete_tokens_failed (int): The number of challenge-complete tokens that failed validation.. [optional] # noqa: E501 + bot_challenge_complete_tokens_checked (int): The number of challenge-complete tokens checked.. [optional] # noqa: E501 + bot_challenge_complete_tokens_disabled (int): The number of challenge-complete tokens not checked because the feature was disabled.. [optional] # noqa: E501 + bot_challenges_issued (int): The number of challenges issued. For example, the issuance of a CAPTCHA challenge.. [optional] # noqa: E501 + bot_challenges_succeeded (int): The number of successful challenge solutions processed. For example, a correct CAPTCHA solution.. [optional] # noqa: E501 + bot_challenges_failed (int): The number of failed challenge solutions processed. For example, an incorrect CAPTCHA solution.. [optional] # noqa: E501 + bot_challenge_complete_tokens_issued (int): The number of challenge-complete tokens issued. For example, issuing a challenge-complete token after a series of CAPTCHA challenges ending in success.. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/fastly/model/realtime_measurements.py b/fastly/model/realtime_measurements.py index 8954910..36af69d 100644 --- a/fastly/model/realtime_measurements.py +++ b/fastly/model/realtime_measurements.py @@ -297,6 +297,15 @@ def openapi_types(): 'ddos_action_tarpit': (int,), # noqa: E501 'ddos_action_close': (int,), # noqa: E501 'ddos_action_blackhole': (int,), # noqa: E501 + 'bot_challenge_starts': (int,), # noqa: E501 + 'bot_challenge_complete_tokens_passed': (int,), # noqa: E501 + 'bot_challenge_complete_tokens_failed': (int,), # noqa: E501 + 'bot_challenge_complete_tokens_checked': (int,), # noqa: E501 + 'bot_challenge_complete_tokens_disabled': (int,), # noqa: E501 + 'bot_challenges_issued': (int,), # noqa: E501 + 'bot_challenges_succeeded': (int,), # noqa: E501 + 'bot_challenges_failed': (int,), # noqa: E501 + 'bot_challenge_complete_tokens_issued': (int,), # noqa: E501 } @cached_property @@ -523,6 +532,15 @@ def discriminator(): 'ddos_action_tarpit': 'ddos_action_tarpit', # noqa: E501 'ddos_action_close': 'ddos_action_close', # noqa: E501 'ddos_action_blackhole': 'ddos_action_blackhole', # noqa: E501 + 'bot_challenge_starts': 'bot_challenge_starts', # noqa: E501 + 'bot_challenge_complete_tokens_passed': 'bot_challenge_complete_tokens_passed', # noqa: E501 + 'bot_challenge_complete_tokens_failed': 'bot_challenge_complete_tokens_failed', # noqa: E501 + 'bot_challenge_complete_tokens_checked': 'bot_challenge_complete_tokens_checked', # noqa: E501 + 'bot_challenge_complete_tokens_disabled': 'bot_challenge_complete_tokens_disabled', # noqa: E501 + 'bot_challenges_issued': 'bot_challenges_issued', # noqa: E501 + 'bot_challenges_succeeded': 'bot_challenges_succeeded', # noqa: E501 + 'bot_challenges_failed': 'bot_challenges_failed', # noqa: E501 + 'bot_challenge_complete_tokens_issued': 'bot_challenge_complete_tokens_issued', # noqa: E501 } read_only_vars = { @@ -784,6 +802,15 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 ddos_action_tarpit (int): The number of times the tarpit action was taken. The tarpit action delays writing the response to the client.. [optional] # noqa: E501 ddos_action_close (int): 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] # noqa: E501 ddos_action_blackhole (int): 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] # noqa: E501 + bot_challenge_starts (int): The number of challenge-start tokens created.. [optional] # noqa: E501 + bot_challenge_complete_tokens_passed (int): The number of challenge-complete tokens that passed validation.. [optional] # noqa: E501 + bot_challenge_complete_tokens_failed (int): The number of challenge-complete tokens that failed validation.. [optional] # noqa: E501 + bot_challenge_complete_tokens_checked (int): The number of challenge-complete tokens checked.. [optional] # noqa: E501 + bot_challenge_complete_tokens_disabled (int): The number of challenge-complete tokens not checked because the feature was disabled.. [optional] # noqa: E501 + bot_challenges_issued (int): The number of challenges issued. For example, the issuance of a CAPTCHA challenge.. [optional] # noqa: E501 + bot_challenges_succeeded (int): The number of successful challenge solutions processed. For example, a correct CAPTCHA solution.. [optional] # noqa: E501 + bot_challenges_failed (int): The number of failed challenge solutions processed. For example, an incorrect CAPTCHA solution.. [optional] # noqa: E501 + bot_challenge_complete_tokens_issued (int): The number of challenge-complete tokens issued. For example, issuing a challenge-complete token after a series of CAPTCHA challenges ending in success.. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) @@ -1083,6 +1110,15 @@ def __init__(self, *args, **kwargs): # noqa: E501 ddos_action_tarpit (int): The number of times the tarpit action was taken. The tarpit action delays writing the response to the client.. [optional] # noqa: E501 ddos_action_close (int): 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] # noqa: E501 ddos_action_blackhole (int): 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] # noqa: E501 + bot_challenge_starts (int): The number of challenge-start tokens created.. [optional] # noqa: E501 + bot_challenge_complete_tokens_passed (int): The number of challenge-complete tokens that passed validation.. [optional] # noqa: E501 + bot_challenge_complete_tokens_failed (int): The number of challenge-complete tokens that failed validation.. [optional] # noqa: E501 + bot_challenge_complete_tokens_checked (int): The number of challenge-complete tokens checked.. [optional] # noqa: E501 + bot_challenge_complete_tokens_disabled (int): The number of challenge-complete tokens not checked because the feature was disabled.. [optional] # noqa: E501 + bot_challenges_issued (int): The number of challenges issued. For example, the issuance of a CAPTCHA challenge.. [optional] # noqa: E501 + bot_challenges_succeeded (int): The number of successful challenge solutions processed. For example, a correct CAPTCHA solution.. [optional] # noqa: E501 + bot_challenges_failed (int): The number of failed challenge solutions processed. For example, an incorrect CAPTCHA solution.. [optional] # noqa: E501 + bot_challenge_complete_tokens_issued (int): The number of challenge-complete tokens issued. For example, issuing a challenge-complete token after a series of CAPTCHA challenges ending in success.. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/fastly/model/results.py b/fastly/model/results.py index bf50106..f74c89f 100644 --- a/fastly/model/results.py +++ b/fastly/model/results.py @@ -295,6 +295,15 @@ def openapi_types(): 'ddos_action_tarpit': (int,), # noqa: E501 'ddos_action_close': (int,), # noqa: E501 'ddos_action_blackhole': (int,), # noqa: E501 + 'bot_challenge_starts': (int,), # noqa: E501 + 'bot_challenge_complete_tokens_passed': (int,), # noqa: E501 + 'bot_challenge_complete_tokens_failed': (int,), # noqa: E501 + 'bot_challenge_complete_tokens_checked': (int,), # noqa: E501 + 'bot_challenge_complete_tokens_disabled': (int,), # noqa: E501 + 'bot_challenge_complete_tokens_issued': (int,), # noqa: E501 + 'bot_challenges_issued': (int,), # noqa: E501 + 'bot_challenges_succeeded': (int,), # noqa: E501 + 'bot_challenges_failed': (int,), # noqa: E501 } @cached_property @@ -519,6 +528,15 @@ def discriminator(): 'ddos_action_tarpit': 'ddos_action_tarpit', # noqa: E501 'ddos_action_close': 'ddos_action_close', # noqa: E501 'ddos_action_blackhole': 'ddos_action_blackhole', # noqa: E501 + 'bot_challenge_starts': 'bot_challenge_starts', # noqa: E501 + 'bot_challenge_complete_tokens_passed': 'bot_challenge_complete_tokens_passed', # noqa: E501 + 'bot_challenge_complete_tokens_failed': 'bot_challenge_complete_tokens_failed', # noqa: E501 + 'bot_challenge_complete_tokens_checked': 'bot_challenge_complete_tokens_checked', # noqa: E501 + 'bot_challenge_complete_tokens_disabled': 'bot_challenge_complete_tokens_disabled', # noqa: E501 + 'bot_challenge_complete_tokens_issued': 'bot_challenge_complete_tokens_issued', # noqa: E501 + 'bot_challenges_issued': 'bot_challenges_issued', # noqa: E501 + 'bot_challenges_succeeded': 'bot_challenges_succeeded', # noqa: E501 + 'bot_challenges_failed': 'bot_challenges_failed', # noqa: E501 } read_only_vars = { @@ -778,6 +796,15 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 ddos_action_tarpit (int): The number of times the tarpit action was taken. The tarpit action delays writing the response to the client.. [optional] # noqa: E501 ddos_action_close (int): 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] # noqa: E501 ddos_action_blackhole (int): 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] # noqa: E501 + bot_challenge_starts (int): The number of challenge-start tokens created.. [optional] # noqa: E501 + bot_challenge_complete_tokens_passed (int): The number of challenge-complete tokens that passed validation.. [optional] # noqa: E501 + bot_challenge_complete_tokens_failed (int): The number of challenge-complete tokens that failed validation.. [optional] # noqa: E501 + bot_challenge_complete_tokens_checked (int): The number of challenge-complete tokens checked.. [optional] # noqa: E501 + bot_challenge_complete_tokens_disabled (int): The number of challenge-complete tokens not checked because the feature was disabled.. [optional] # noqa: E501 + bot_challenge_complete_tokens_issued (int): The number of challenge-complete tokens issued. For example, issuing a challenge-complete token after a series of CAPTCHA challenges ending in success.. [optional] # noqa: E501 + bot_challenges_issued (int): The number of challenges issued. For example, the issuance of a CAPTCHA challenge.. [optional] # noqa: E501 + bot_challenges_succeeded (int): The number of successful challenge solutions processed. For example, a correct CAPTCHA solution.. [optional] # noqa: E501 + bot_challenges_failed (int): The number of failed challenge solutions processed. For example, an incorrect CAPTCHA solution.. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) @@ -1075,6 +1102,15 @@ def __init__(self, *args, **kwargs): # noqa: E501 ddos_action_tarpit (int): The number of times the tarpit action was taken. The tarpit action delays writing the response to the client.. [optional] # noqa: E501 ddos_action_close (int): 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] # noqa: E501 ddos_action_blackhole (int): 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] # noqa: E501 + bot_challenge_starts (int): The number of challenge-start tokens created.. [optional] # noqa: E501 + bot_challenge_complete_tokens_passed (int): The number of challenge-complete tokens that passed validation.. [optional] # noqa: E501 + bot_challenge_complete_tokens_failed (int): The number of challenge-complete tokens that failed validation.. [optional] # noqa: E501 + bot_challenge_complete_tokens_checked (int): The number of challenge-complete tokens checked.. [optional] # noqa: E501 + bot_challenge_complete_tokens_disabled (int): The number of challenge-complete tokens not checked because the feature was disabled.. [optional] # noqa: E501 + bot_challenge_complete_tokens_issued (int): The number of challenge-complete tokens issued. For example, issuing a challenge-complete token after a series of CAPTCHA challenges ending in success.. [optional] # noqa: E501 + bot_challenges_issued (int): The number of challenges issued. For example, the issuance of a CAPTCHA challenge.. [optional] # noqa: E501 + bot_challenges_succeeded (int): The number of successful challenge solutions processed. For example, a correct CAPTCHA solution.. [optional] # noqa: E501 + bot_challenges_failed (int): The number of failed challenge solutions processed. For example, an incorrect CAPTCHA solution.. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/fastly/model/schemas_snippet_response.py b/fastly/model/schemas_snippet_response.py index ba705d7..c806fc8 100644 --- a/fastly/model/schemas_snippet_response.py +++ b/fastly/model/schemas_snippet_response.py @@ -30,12 +30,10 @@ def lazy_import(): + from fastly.model.schemas_snippet_response_common import SchemasSnippetResponseCommon from fastly.model.snippet import Snippet - from fastly.model.snippet_response_all_of import SnippetResponseAllOf - from fastly.model.timestamps import Timestamps + globals()['SchemasSnippetResponseCommon'] = SchemasSnippetResponseCommon globals()['Snippet'] = Snippet - globals()['SnippetResponseAllOf'] = SnippetResponseAllOf - globals()['Timestamps'] = Timestamps class SchemasSnippetResponse(ModelComposed): @@ -61,10 +59,6 @@ class SchemasSnippetResponse(ModelComposed): """ allowed_values = { - ('dynamic',): { - 'regular': "0", - 'dynamic': "1", - }, ('type',): { 'INIT': "init", 'RECV': "recv", @@ -78,6 +72,10 @@ class SchemasSnippetResponse(ModelComposed): 'LOG': "log", 'NONE': "none", }, + ('dynamic',): { + 'regular': "0", + 'dynamic': "1", + }, } validations = { @@ -107,10 +105,10 @@ def openapi_types(): lazy_import() return { 'name': (str,), # noqa: E501 - 'dynamic': (str,), # noqa: E501 'type': (str,), # noqa: E501 'content': (str,), # noqa: E501 'priority': (str,), # noqa: E501 + 'dynamic': (str,), # noqa: E501 'created_at': (datetime, none_type,), # noqa: E501 'deleted_at': (datetime, none_type,), # noqa: E501 'updated_at': (datetime, none_type,), # noqa: E501 @@ -126,10 +124,10 @@ def discriminator(): attribute_map = { 'name': 'name', # noqa: E501 - 'dynamic': 'dynamic', # noqa: E501 'type': 'type', # noqa: E501 'content': 'content', # noqa: E501 'priority': 'priority', # noqa: E501 + 'dynamic': 'dynamic', # noqa: E501 'created_at': 'created_at', # noqa: E501 'deleted_at': 'deleted_at', # noqa: E501 'updated_at': 'updated_at', # noqa: E501 @@ -184,10 +182,10 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) name (str): The name for the snippet.. [optional] # noqa: E501 - dynamic (str): Sets the snippet version.. [optional] # noqa: E501 type (str): The location in generated VCL where the snippet should be placed.. [optional] # noqa: E501 content (str): The VCL code that specifies exactly what the snippet does.. [optional] # noqa: E501 priority (str): Priority determines execution order. Lower numbers execute first.. [optional] if omitted the server will use the default value of "100" # noqa: E501 + dynamic (str): Sets the snippet version.. [optional] # noqa: E501 created_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 deleted_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 updated_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 @@ -294,10 +292,10 @@ def __init__(self, *args, **kwargs): # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) name (str): The name for the snippet.. [optional] # noqa: E501 - dynamic (str): Sets the snippet version.. [optional] # noqa: E501 type (str): The location in generated VCL where the snippet should be placed.. [optional] # noqa: E501 content (str): The VCL code that specifies exactly what the snippet does.. [optional] # noqa: E501 priority (str): Priority determines execution order. Lower numbers execute first.. [optional] if omitted the server will use the default value of "100" # noqa: E501 + dynamic (str): Sets the snippet version.. [optional] # noqa: E501 created_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 deleted_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 updated_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 @@ -369,9 +367,8 @@ def _composed_schemas(): 'anyOf': [ ], 'allOf': [ + SchemasSnippetResponseCommon, Snippet, - SnippetResponseAllOf, - Timestamps, ], 'oneOf': [ ], diff --git a/fastly/model/schemas_snippet_response_common.py b/fastly/model/schemas_snippet_response_common.py new file mode 100644 index 0000000..a4ccc95 --- /dev/null +++ b/fastly/model/schemas_snippet_response_common.py @@ -0,0 +1,338 @@ +""" + 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/) # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: oss@fastly.com +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from fastly.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from fastly.exceptions import ApiAttributeError + + +def lazy_import(): + from fastly.model.snippet_response_common_all_of import SnippetResponseCommonAllOf + from fastly.model.timestamps import Timestamps + globals()['SnippetResponseCommonAllOf'] = SnippetResponseCommonAllOf + globals()['Timestamps'] = Timestamps + + +class SchemasSnippetResponseCommon(ModelComposed): + """NOTE: This class is auto generated. + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'created_at': (datetime, none_type,), # noqa: E501 + 'deleted_at': (datetime, none_type,), # noqa: E501 + 'updated_at': (datetime, none_type,), # noqa: E501 + 'service_id': (str,), # noqa: E501 + 'version': (str,), # noqa: E501 + 'id': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'created_at': 'created_at', # noqa: E501 + 'deleted_at': 'deleted_at', # noqa: E501 + 'updated_at': 'updated_at', # noqa: E501 + 'service_id': 'service_id', # noqa: E501 + 'version': 'version', # noqa: E501 + 'id': 'id', # noqa: E501 + } + + read_only_vars = { + 'created_at', # noqa: E501 + 'deleted_at', # noqa: E501 + 'updated_at', # noqa: E501 + 'service_id', # noqa: E501 + 'version', # noqa: E501 + 'id', # noqa: E501 + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SchemasSnippetResponseCommon - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 + deleted_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 + updated_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 + service_id (str): [optional] # noqa: E501 + version (str): String representing the number identifying a version of the service.. [optional] # noqa: E501 + id (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """SchemasSnippetResponseCommon - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 + deleted_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 + updated_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 + service_id (str): [optional] # noqa: E501 + version (str): String representing the number identifying a version of the service.. [optional] # noqa: E501 + id (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + SnippetResponseCommonAllOf, + Timestamps, + ], + 'oneOf': [ + ], + } diff --git a/fastly/model/snippet.py b/fastly/model/snippet.py index 5190ffc..f04f38f 100644 --- a/fastly/model/snippet.py +++ b/fastly/model/snippet.py @@ -29,8 +29,14 @@ from fastly.exceptions import ApiAttributeError +def lazy_import(): + from fastly.model.snippet_all_of import SnippetAllOf + from fastly.model.snippet_common import SnippetCommon + globals()['SnippetAllOf'] = SnippetAllOf + globals()['SnippetCommon'] = SnippetCommon -class Snippet(ModelNormal): + +class Snippet(ModelComposed): """NOTE: This class is auto generated. Do not edit the class manually. @@ -53,10 +59,6 @@ class Snippet(ModelNormal): """ allowed_values = { - ('dynamic',): { - 'regular': "0", - 'dynamic': "1", - }, ('type',): { 'INIT': "init", 'RECV': "recv", @@ -70,6 +72,10 @@ class Snippet(ModelNormal): 'LOG': "log", 'NONE': "none", }, + ('dynamic',): { + 'regular': "0", + 'dynamic': "1", + }, } validations = { @@ -81,6 +87,7 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ + lazy_import() return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -95,12 +102,13 @@ def openapi_types(): openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'name': (str,), # noqa: E501 - 'dynamic': (str,), # noqa: E501 'type': (str,), # noqa: E501 'content': (str,), # noqa: E501 'priority': (str,), # noqa: E501 + 'dynamic': (str,), # noqa: E501 } @cached_property @@ -110,17 +118,15 @@ def discriminator(): attribute_map = { 'name': 'name', # noqa: E501 - 'dynamic': 'dynamic', # noqa: E501 'type': 'type', # noqa: E501 'content': 'content', # noqa: E501 'priority': 'priority', # noqa: E501 + 'dynamic': 'dynamic', # noqa: E501 } read_only_vars = { } - _composed_schemas = {} - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 @@ -158,10 +164,10 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) name (str): The name for the snippet.. [optional] # noqa: E501 - dynamic (str): Sets the snippet version.. [optional] # noqa: E501 type (str): The location in generated VCL where the snippet should be placed.. [optional] # noqa: E501 content (str): The VCL code that specifies exactly what the snippet does.. [optional] # noqa: E501 priority (str): Priority determines execution order. Lower numbers execute first.. [optional] if omitted the server will use the default value of "100" # noqa: E501 + dynamic (str): Sets the snippet version.. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) @@ -189,14 +195,29 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) + return self required_properties = set([ @@ -206,6 +227,9 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 '_path_to_item', '_configuration', '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', ]) @convert_js_args_to_python_args @@ -244,10 +268,10 @@ def __init__(self, *args, **kwargs): # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) name (str): The name for the snippet.. [optional] # noqa: E501 - dynamic (str): Sets the snippet version.. [optional] # noqa: E501 type (str): The location in generated VCL where the snippet should be placed.. [optional] # noqa: E501 content (str): The VCL code that specifies exactly what the snippet does.. [optional] # noqa: E501 priority (str): Priority determines execution order. Lower numbers execute first.. [optional] if omitted the server will use the default value of "100" # noqa: E501 + dynamic (str): Sets the snippet version.. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) @@ -273,14 +297,49 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + SnippetAllOf, + SnippetCommon, + ], + 'oneOf': [ + ], + } diff --git a/fastly/model/snippet_all_of.py b/fastly/model/snippet_all_of.py new file mode 100644 index 0000000..19a64d9 --- /dev/null +++ b/fastly/model/snippet_all_of.py @@ -0,0 +1,257 @@ +""" + 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/) # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: oss@fastly.com +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from fastly.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from fastly.exceptions import ApiAttributeError + + + +class SnippetAllOf(ModelNormal): + """NOTE: This class is auto generated. + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('dynamic',): { + 'regular': "0", + 'dynamic': "1", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'dynamic': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'dynamic': 'dynamic', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SnippetAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + dynamic (str): Sets the snippet version.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """SnippetAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + dynamic (str): Sets the snippet version.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/fastly/model/snippet_common.py b/fastly/model/snippet_common.py new file mode 100644 index 0000000..d7faa75 --- /dev/null +++ b/fastly/model/snippet_common.py @@ -0,0 +1,278 @@ +""" + 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/) # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: oss@fastly.com +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from fastly.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from fastly.exceptions import ApiAttributeError + + + +class SnippetCommon(ModelNormal): + """NOTE: This class is auto generated. + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('type',): { + 'INIT': "init", + 'RECV': "recv", + 'HASH': "hash", + 'HIT': "hit", + 'MISS': "miss", + 'PASS': "pass", + 'FETCH': "fetch", + 'ERROR': "error", + 'DELIVER': "deliver", + 'LOG': "log", + 'NONE': "none", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + 'type': (str,), # noqa: E501 + 'content': (str,), # noqa: E501 + 'priority': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'type': 'type', # noqa: E501 + 'content': 'content', # noqa: E501 + 'priority': 'priority', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SnippetCommon - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The name for the snippet.. [optional] # noqa: E501 + type (str): The location in generated VCL where the snippet should be placed.. [optional] # noqa: E501 + content (str): The VCL code that specifies exactly what the snippet does.. [optional] # noqa: E501 + priority (str): Priority determines execution order. Lower numbers execute first.. [optional] if omitted the server will use the default value of "100" # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """SnippetCommon - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The name for the snippet.. [optional] # noqa: E501 + type (str): The location in generated VCL where the snippet should be placed.. [optional] # noqa: E501 + content (str): The VCL code that specifies exactly what the snippet does.. [optional] # noqa: E501 + priority (str): Priority determines execution order. Lower numbers execute first.. [optional] if omitted the server will use the default value of "100" # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/fastly/model/snippet_response.py b/fastly/model/snippet_response.py index 4db37b2..2ec4096 100644 --- a/fastly/model/snippet_response.py +++ b/fastly/model/snippet_response.py @@ -31,11 +31,9 @@ def lazy_import(): from fastly.model.snippet import Snippet - from fastly.model.snippet_response_all_of import SnippetResponseAllOf - from fastly.model.timestamps import Timestamps + from fastly.model.snippet_response_common import SnippetResponseCommon globals()['Snippet'] = Snippet - globals()['SnippetResponseAllOf'] = SnippetResponseAllOf - globals()['Timestamps'] = Timestamps + globals()['SnippetResponseCommon'] = SnippetResponseCommon class SnippetResponse(ModelComposed): @@ -61,10 +59,6 @@ class SnippetResponse(ModelComposed): """ allowed_values = { - ('dynamic',): { - 'regular': "0", - 'dynamic': "1", - }, ('type',): { 'INIT': "init", 'RECV': "recv", @@ -78,6 +72,10 @@ class SnippetResponse(ModelComposed): 'LOG': "log", 'NONE': "none", }, + ('dynamic',): { + 'regular': "0", + 'dynamic': "1", + }, } validations = { @@ -107,10 +105,10 @@ def openapi_types(): lazy_import() return { 'name': (str,), # noqa: E501 - 'dynamic': (str,), # noqa: E501 'type': (str,), # noqa: E501 'content': (str,), # noqa: E501 'priority': (str,), # noqa: E501 + 'dynamic': (str,), # noqa: E501 'created_at': (datetime, none_type,), # noqa: E501 'deleted_at': (datetime, none_type,), # noqa: E501 'updated_at': (datetime, none_type,), # noqa: E501 @@ -126,10 +124,10 @@ def discriminator(): attribute_map = { 'name': 'name', # noqa: E501 - 'dynamic': 'dynamic', # noqa: E501 'type': 'type', # noqa: E501 'content': 'content', # noqa: E501 'priority': 'priority', # noqa: E501 + 'dynamic': 'dynamic', # noqa: E501 'created_at': 'created_at', # noqa: E501 'deleted_at': 'deleted_at', # noqa: E501 'updated_at': 'updated_at', # noqa: E501 @@ -184,10 +182,10 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) name (str): The name for the snippet.. [optional] # noqa: E501 - dynamic (str): Sets the snippet version.. [optional] # noqa: E501 type (str): The location in generated VCL where the snippet should be placed.. [optional] # noqa: E501 content (str): The VCL code that specifies exactly what the snippet does.. [optional] # noqa: E501 priority (str): Priority determines execution order. Lower numbers execute first.. [optional] if omitted the server will use the default value of "100" # noqa: E501 + dynamic (str): Sets the snippet version.. [optional] # noqa: E501 created_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 deleted_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 updated_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 @@ -294,10 +292,10 @@ def __init__(self, *args, **kwargs): # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) name (str): The name for the snippet.. [optional] # noqa: E501 - dynamic (str): Sets the snippet version.. [optional] # noqa: E501 type (str): The location in generated VCL where the snippet should be placed.. [optional] # noqa: E501 content (str): The VCL code that specifies exactly what the snippet does.. [optional] # noqa: E501 priority (str): Priority determines execution order. Lower numbers execute first.. [optional] if omitted the server will use the default value of "100" # noqa: E501 + dynamic (str): Sets the snippet version.. [optional] # noqa: E501 created_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 deleted_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 updated_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 @@ -370,8 +368,7 @@ def _composed_schemas(): ], 'allOf': [ Snippet, - SnippetResponseAllOf, - Timestamps, + SnippetResponseCommon, ], 'oneOf': [ ], diff --git a/fastly/model/snippet_response_common.py b/fastly/model/snippet_response_common.py new file mode 100644 index 0000000..0189528 --- /dev/null +++ b/fastly/model/snippet_response_common.py @@ -0,0 +1,338 @@ +""" + 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/) # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: oss@fastly.com +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from fastly.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from fastly.exceptions import ApiAttributeError + + +def lazy_import(): + from fastly.model.snippet_response_common_all_of import SnippetResponseCommonAllOf + from fastly.model.timestamps import Timestamps + globals()['SnippetResponseCommonAllOf'] = SnippetResponseCommonAllOf + globals()['Timestamps'] = Timestamps + + +class SnippetResponseCommon(ModelComposed): + """NOTE: This class is auto generated. + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'created_at': (datetime, none_type,), # noqa: E501 + 'deleted_at': (datetime, none_type,), # noqa: E501 + 'updated_at': (datetime, none_type,), # noqa: E501 + 'service_id': (str,), # noqa: E501 + 'version': (str,), # noqa: E501 + 'id': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'created_at': 'created_at', # noqa: E501 + 'deleted_at': 'deleted_at', # noqa: E501 + 'updated_at': 'updated_at', # noqa: E501 + 'service_id': 'service_id', # noqa: E501 + 'version': 'version', # noqa: E501 + 'id': 'id', # noqa: E501 + } + + read_only_vars = { + 'created_at', # noqa: E501 + 'deleted_at', # noqa: E501 + 'updated_at', # noqa: E501 + 'service_id', # noqa: E501 + 'version', # noqa: E501 + 'id', # noqa: E501 + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SnippetResponseCommon - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 + deleted_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 + updated_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 + service_id (str): [optional] # noqa: E501 + version (str): String representing the number identifying a version of the service.. [optional] # noqa: E501 + id (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """SnippetResponseCommon - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 + deleted_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 + updated_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 + service_id (str): [optional] # noqa: E501 + version (str): String representing the number identifying a version of the service.. [optional] # noqa: E501 + id (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + SnippetResponseCommonAllOf, + Timestamps, + ], + 'oneOf': [ + ], + } diff --git a/fastly/model/snippet_response_all_of.py b/fastly/model/snippet_response_common_all_of.py similarity index 98% rename from fastly/model/snippet_response_all_of.py rename to fastly/model/snippet_response_common_all_of.py index 1002fc6..f2a3857 100644 --- a/fastly/model/snippet_response_all_of.py +++ b/fastly/model/snippet_response_common_all_of.py @@ -30,7 +30,7 @@ -class SnippetResponseAllOf(ModelNormal): +class SnippetResponseCommonAllOf(ModelNormal): """NOTE: This class is auto generated. Do not edit the class manually. @@ -106,7 +106,7 @@ def discriminator(): @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SnippetResponseAllOf - a model defined in OpenAPI + """SnippetResponseCommonAllOf - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -190,7 +190,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """SnippetResponseAllOf - a model defined in OpenAPI + """SnippetResponseCommonAllOf - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/fastly/model/snippet_response_post.py b/fastly/model/snippet_response_post.py new file mode 100644 index 0000000..c5ff92d --- /dev/null +++ b/fastly/model/snippet_response_post.py @@ -0,0 +1,375 @@ +""" + 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/) # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: oss@fastly.com +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from fastly.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from fastly.exceptions import ApiAttributeError + + +def lazy_import(): + from fastly.model.snippet_response_common import SnippetResponseCommon + from fastly.model.snippet_with_dynamic_number import SnippetWithDynamicNumber + globals()['SnippetResponseCommon'] = SnippetResponseCommon + globals()['SnippetWithDynamicNumber'] = SnippetWithDynamicNumber + + +class SnippetResponsePost(ModelComposed): + """NOTE: This class is auto generated. + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('type',): { + 'INIT': "init", + 'RECV': "recv", + 'HASH': "hash", + 'HIT': "hit", + 'MISS': "miss", + 'PASS': "pass", + 'FETCH': "fetch", + 'ERROR': "error", + 'DELIVER': "deliver", + 'LOG': "log", + 'NONE': "none", + }, + ('dynamic',): { + 'regular': 0, + 'dynamic': 1, + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'name': (str,), # noqa: E501 + 'type': (str,), # noqa: E501 + 'content': (str,), # noqa: E501 + 'priority': (str,), # noqa: E501 + 'dynamic': (float,), # noqa: E501 + 'created_at': (datetime, none_type,), # noqa: E501 + 'deleted_at': (datetime, none_type,), # noqa: E501 + 'updated_at': (datetime, none_type,), # noqa: E501 + 'service_id': (str,), # noqa: E501 + 'version': (str,), # noqa: E501 + 'id': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'type': 'type', # noqa: E501 + 'content': 'content', # noqa: E501 + 'priority': 'priority', # noqa: E501 + 'dynamic': 'dynamic', # noqa: E501 + 'created_at': 'created_at', # noqa: E501 + 'deleted_at': 'deleted_at', # noqa: E501 + 'updated_at': 'updated_at', # noqa: E501 + 'service_id': 'service_id', # noqa: E501 + 'version': 'version', # noqa: E501 + 'id': 'id', # noqa: E501 + } + + read_only_vars = { + 'created_at', # noqa: E501 + 'deleted_at', # noqa: E501 + 'updated_at', # noqa: E501 + 'service_id', # noqa: E501 + 'version', # noqa: E501 + 'id', # noqa: E501 + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SnippetResponsePost - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The name for the snippet.. [optional] # noqa: E501 + type (str): The location in generated VCL where the snippet should be placed.. [optional] # noqa: E501 + content (str): The VCL code that specifies exactly what the snippet does.. [optional] # noqa: E501 + priority (str): Priority determines execution order. Lower numbers execute first.. [optional] if omitted the server will use the default value of "100" # noqa: E501 + dynamic (float): Sets the snippet version.. [optional] # noqa: E501 + created_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 + deleted_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 + updated_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 + service_id (str): [optional] # noqa: E501 + version (str): String representing the number identifying a version of the service.. [optional] # noqa: E501 + id (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """SnippetResponsePost - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The name for the snippet.. [optional] # noqa: E501 + type (str): The location in generated VCL where the snippet should be placed.. [optional] # noqa: E501 + content (str): The VCL code that specifies exactly what the snippet does.. [optional] # noqa: E501 + priority (str): Priority determines execution order. Lower numbers execute first.. [optional] if omitted the server will use the default value of "100" # noqa: E501 + dynamic (float): Sets the snippet version.. [optional] # noqa: E501 + created_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 + deleted_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 + updated_at (datetime, none_type): Date and time in ISO 8601 format.. [optional] # noqa: E501 + service_id (str): [optional] # noqa: E501 + version (str): String representing the number identifying a version of the service.. [optional] # noqa: E501 + id (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + SnippetResponseCommon, + SnippetWithDynamicNumber, + ], + 'oneOf': [ + ], + } diff --git a/fastly/model/snippet_with_dynamic_number.py b/fastly/model/snippet_with_dynamic_number.py new file mode 100644 index 0000000..59e72f9 --- /dev/null +++ b/fastly/model/snippet_with_dynamic_number.py @@ -0,0 +1,345 @@ +""" + 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/) # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: oss@fastly.com +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from fastly.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from fastly.exceptions import ApiAttributeError + + +def lazy_import(): + from fastly.model.snippet_common import SnippetCommon + from fastly.model.snippet_with_dynamic_number_all_of import SnippetWithDynamicNumberAllOf + globals()['SnippetCommon'] = SnippetCommon + globals()['SnippetWithDynamicNumberAllOf'] = SnippetWithDynamicNumberAllOf + + +class SnippetWithDynamicNumber(ModelComposed): + """NOTE: This class is auto generated. + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('type',): { + 'INIT': "init", + 'RECV': "recv", + 'HASH': "hash", + 'HIT': "hit", + 'MISS': "miss", + 'PASS': "pass", + 'FETCH': "fetch", + 'ERROR': "error", + 'DELIVER': "deliver", + 'LOG': "log", + 'NONE': "none", + }, + ('dynamic',): { + 'regular': 0, + 'dynamic': 1, + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'name': (str,), # noqa: E501 + 'type': (str,), # noqa: E501 + 'content': (str,), # noqa: E501 + 'priority': (str,), # noqa: E501 + 'dynamic': (float,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'type': 'type', # noqa: E501 + 'content': 'content', # noqa: E501 + 'priority': 'priority', # noqa: E501 + 'dynamic': 'dynamic', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SnippetWithDynamicNumber - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The name for the snippet.. [optional] # noqa: E501 + type (str): The location in generated VCL where the snippet should be placed.. [optional] # noqa: E501 + content (str): The VCL code that specifies exactly what the snippet does.. [optional] # noqa: E501 + priority (str): Priority determines execution order. Lower numbers execute first.. [optional] if omitted the server will use the default value of "100" # noqa: E501 + dynamic (float): Sets the snippet version.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """SnippetWithDynamicNumber - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The name for the snippet.. [optional] # noqa: E501 + type (str): The location in generated VCL where the snippet should be placed.. [optional] # noqa: E501 + content (str): The VCL code that specifies exactly what the snippet does.. [optional] # noqa: E501 + priority (str): Priority determines execution order. Lower numbers execute first.. [optional] if omitted the server will use the default value of "100" # noqa: E501 + dynamic (float): Sets the snippet version.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + SnippetCommon, + SnippetWithDynamicNumberAllOf, + ], + 'oneOf': [ + ], + } diff --git a/fastly/model/snippet_with_dynamic_number_all_of.py b/fastly/model/snippet_with_dynamic_number_all_of.py new file mode 100644 index 0000000..fb1b2b1 --- /dev/null +++ b/fastly/model/snippet_with_dynamic_number_all_of.py @@ -0,0 +1,257 @@ +""" + 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/) # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: oss@fastly.com +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from fastly.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from fastly.exceptions import ApiAttributeError + + + +class SnippetWithDynamicNumberAllOf(ModelNormal): + """NOTE: This class is auto generated. + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('dynamic',): { + 'regular': 0, + 'dynamic': 1, + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'dynamic': (float,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'dynamic': 'dynamic', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SnippetWithDynamicNumberAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + dynamic (float): Sets the snippet version.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """SnippetWithDynamicNumberAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + dynamic (float): Sets the snippet version.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/fastly/model/values_ddos.py b/fastly/model/values_ddos.py new file mode 100644 index 0000000..dabf1ff --- /dev/null +++ b/fastly/model/values_ddos.py @@ -0,0 +1,273 @@ +""" + 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/) # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Contact: oss@fastly.com +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from fastly.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from fastly.exceptions import ApiAttributeError + + + +class ValuesDdos(ModelNormal): + """NOTE: This class is auto generated. + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'ddos_action_limit_streams_connections': (int,), # noqa: E501 + 'ddos_action_limit_streams_requests': (int,), # noqa: E501 + 'ddos_action_tarpit_accept': (int,), # noqa: E501 + 'ddos_action_tarpit': (int,), # noqa: E501 + 'ddos_action_close': (int,), # noqa: E501 + 'ddos_action_blackhole': (int,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'ddos_action_limit_streams_connections': 'ddos_action_limit_streams_connections', # noqa: E501 + 'ddos_action_limit_streams_requests': 'ddos_action_limit_streams_requests', # noqa: E501 + 'ddos_action_tarpit_accept': 'ddos_action_tarpit_accept', # noqa: E501 + 'ddos_action_tarpit': 'ddos_action_tarpit', # noqa: E501 + 'ddos_action_close': 'ddos_action_close', # noqa: E501 + 'ddos_action_blackhole': 'ddos_action_blackhole', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ValuesDdos - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + ddos_action_limit_streams_connections (int): For HTTP/2, the number of connections the limit-streams action was applied to. The limit-streams action caps the allowed number of concurrent streams in a connection.. [optional] # noqa: E501 + ddos_action_limit_streams_requests (int): For HTTP/2, the number of requests made on a connection for which the limit-streams action was taken. The limit-streams action caps the allowed number of concurrent streams in a connection.. [optional] # noqa: E501 + ddos_action_tarpit_accept (int): The number of times the tarpit-accept action was taken. The tarpit-accept action adds a delay when accepting future connections.. [optional] # noqa: E501 + ddos_action_tarpit (int): The number of times the tarpit action was taken. The tarpit action delays writing the response to the client.. [optional] # noqa: E501 + ddos_action_close (int): 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] # noqa: E501 + ddos_action_blackhole (int): 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] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ValuesDdos - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + ddos_action_limit_streams_connections (int): For HTTP/2, the number of connections the limit-streams action was applied to. The limit-streams action caps the allowed number of concurrent streams in a connection.. [optional] # noqa: E501 + ddos_action_limit_streams_requests (int): For HTTP/2, the number of requests made on a connection for which the limit-streams action was taken. The limit-streams action caps the allowed number of concurrent streams in a connection.. [optional] # noqa: E501 + ddos_action_tarpit_accept (int): The number of times the tarpit-accept action was taken. The tarpit-accept action adds a delay when accepting future connections.. [optional] # noqa: E501 + ddos_action_tarpit (int): The number of times the tarpit action was taken. The tarpit action delays writing the response to the client.. [optional] # noqa: E501 + ddos_action_close (int): 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] # noqa: E501 + ddos_action_blackhole (int): 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] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/fastly/models/__init__.py b/fastly/models/__init__.py index f2d387f..2b00fde 100644 --- a/fastly/models/__init__.py +++ b/fastly/models/__init__.py @@ -123,6 +123,8 @@ from fastly.model.historical import Historical from fastly.model.historical_aggregate_response import HistoricalAggregateResponse from fastly.model.historical_aggregate_response_all_of import HistoricalAggregateResponseAllOf +from fastly.model.historical_ddos import HistoricalDdos +from fastly.model.historical_ddos_meta import HistoricalDdosMeta from fastly.model.historical_domains import HistoricalDomains from fastly.model.historical_domains_data import HistoricalDomainsData from fastly.model.historical_domains_meta import HistoricalDomainsMeta @@ -312,6 +314,11 @@ from fastly.model.pagination_links import PaginationLinks from fastly.model.pagination_meta import PaginationMeta from fastly.model.permission import Permission +from fastly.model.platform_ddos_data_items import PlatformDdosDataItems +from fastly.model.platform_ddos_entry import PlatformDdosEntry +from fastly.model.platform_ddos_response import PlatformDdosResponse +from fastly.model.platform_ddos_response_all_of import PlatformDdosResponseAllOf +from fastly.model.platform_ddos_response_data import PlatformDdosResponseData from fastly.model.pool_additional import PoolAdditional from fastly.model.pool_response import PoolResponse from fastly.model.pool_response_all_of import PoolResponseAllOf @@ -446,6 +453,7 @@ from fastly.model.role_user import RoleUser from fastly.model.schemas_contact_response import SchemasContactResponse from fastly.model.schemas_snippet_response import SchemasSnippetResponse +from fastly.model.schemas_snippet_response_common import SchemasSnippetResponseCommon from fastly.model.schemas_user_response import SchemasUserResponse from fastly.model.schemas_user_response_read_only import SchemasUserResponseReadOnly from fastly.model.schemas_vcl_response import SchemasVclResponse @@ -495,8 +503,14 @@ from fastly.model.settings_response import SettingsResponse from fastly.model.signing_key import SigningKey from fastly.model.snippet import Snippet +from fastly.model.snippet_all_of import SnippetAllOf +from fastly.model.snippet_common import SnippetCommon from fastly.model.snippet_response import SnippetResponse -from fastly.model.snippet_response_all_of import SnippetResponseAllOf +from fastly.model.snippet_response_common import SnippetResponseCommon +from fastly.model.snippet_response_common_all_of import SnippetResponseCommonAllOf +from fastly.model.snippet_response_post import SnippetResponsePost +from fastly.model.snippet_with_dynamic_number import SnippetWithDynamicNumber +from fastly.model.snippet_with_dynamic_number_all_of import SnippetWithDynamicNumberAllOf from fastly.model.star import Star from fastly.model.star_data import StarData from fastly.model.star_response import StarResponse @@ -616,6 +630,7 @@ from fastly.model.validator_result_data_attributes import ValidatorResultDataAttributes from fastly.model.validator_result_data_attributes_messages import ValidatorResultDataAttributesMessages from fastly.model.values import Values +from fastly.model.values_ddos import ValuesDdos from fastly.model.vcl import Vcl from fastly.model.vcl_diff import VclDiff from fastly.model.vcl_response import VclResponse diff --git a/setup.py b/setup.py index c0f3643..b3c5282 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ from pathlib import Path NAME = "fastly" -VERSION = "4.1.1" +VERSION = "4.2.0" # To install the library, run the following # # python setup.py install diff --git a/sig.json b/sig.json index 8d0afc0..92d418f 100644 --- a/sig.json +++ b/sig.json @@ -1 +1 @@ -{"G": "95706192", "D": "691cfbf5"} +{"G": "ecaca45c", "D": "ffdeb163"}