From 8762cde95cc3a992cb2a2aa90b208527b3dfdc4b Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 5 Jul 2023 16:53:48 +0000 Subject: [PATCH] Generated v2.5.0 --- CHANGELOG.md | 10 + Cargo.toml | 2 +- README.md | 26 +- docs/Batch.md | 13 + docs/BatchErrors.md | 14 + docs/InlineObject.md | 11 + docs/InlineObject1.md | 11 + docs/SchemasSnippetResponse.md | 2 +- docs/SchemasVclResponse.md | 18 + docs/ServiceVersionDetail.md | 2 +- docs/ServiceVersionDetailOrNull.md | 2 +- docs/Snippet.md | 2 +- docs/SnippetApi.md | 4 +- docs/SnippetResponse.md | 2 +- docs/TokensAdditionalProps.md | 10 + docs/ValidatorResult.md | 11 + docs/ValidatorResultData.md | 13 + docs/ValidatorResultDataAttributes.md | 15 + docs/ValidatorResultDataAttributesMessages.md | 14 + docs/VclApi.md | 501 +++++++++ docs/VclSyntaxHighlightingResponse.md | 11 + docs/VersionDetail.md | 2 +- sig.json | 2 +- src/apis/configuration.rs | 2 +- src/apis/mod.rs | 1 + src/apis/snippet_api.rs | 4 +- src/apis/vcl_api.rs | 973 ++++++++++++++++++ src/models/batch.rs | 34 + src/models/batch_errors.rs | 38 + src/models/inline_object.rs | 25 + src/models/inline_object_1.rs | 25 + src/models/mod.rs | 22 + src/models/schemas_snippet_response.rs | 6 +- src/models/schemas_vcl_response.rs | 52 + src/models/service_version_detail.rs | 2 +- src/models/service_version_detail_or_null.rs | 2 +- src/models/snippet.rs | 6 +- src/models/snippet_response.rs | 6 +- src/models/tokens_additional_props.rs | 22 + src/models/validator_result.rs | 27 + src/models/validator_result_data.rs | 31 + .../validator_result_data_attributes.rs | 51 + ...lidator_result_data_attributes_messages.rs | 34 + .../vcl_syntax_highlighting_response.rs | 26 + src/models/version_detail.rs | 2 +- 45 files changed, 2053 insertions(+), 36 deletions(-) create mode 100644 docs/Batch.md create mode 100644 docs/BatchErrors.md create mode 100644 docs/InlineObject.md create mode 100644 docs/InlineObject1.md create mode 100644 docs/SchemasVclResponse.md create mode 100644 docs/TokensAdditionalProps.md create mode 100644 docs/ValidatorResult.md create mode 100644 docs/ValidatorResultData.md create mode 100644 docs/ValidatorResultDataAttributes.md create mode 100644 docs/ValidatorResultDataAttributesMessages.md create mode 100644 docs/VclApi.md create mode 100644 docs/VclSyntaxHighlightingResponse.md create mode 100644 src/apis/vcl_api.rs create mode 100644 src/models/batch.rs create mode 100644 src/models/batch_errors.rs create mode 100644 src/models/inline_object.rs create mode 100644 src/models/inline_object_1.rs create mode 100644 src/models/schemas_vcl_response.rs create mode 100644 src/models/tokens_additional_props.rs create mode 100644 src/models/validator_result.rs create mode 100644 src/models/validator_result_data.rs create mode 100644 src/models/validator_result_data_attributes.rs create mode 100644 src/models/validator_result_data_attributes_messages.rs create mode 100644 src/models/vcl_syntax_highlighting_response.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index e01b83f..ed416ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [v2.5.0](https://github.com/fastly/fastly-rust/releases/tag/release/v2.5.0) (2023-07-05) + +**Enhancements:** + +- feat(vcl): support all vcl endpoints. + +**Bug fixes:** + +- fix(snippet): dynamic field switched from int to string. + ## [v2.4.0](https://github.com/fastly/fastly-rust/releases/tag/release/v2.4.0) (2023-06-27) **Enhancements:** diff --git a/Cargo.toml b/Cargo.toml index 72a07ca..4ad2059 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fastly-api" -version = "2.4.0" +version = "2.5.0" authors = ["Fastly "] edition = "2021" description = "Fastly API client" diff --git a/README.md b/README.md index 9f37a6c..0bdbdef 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Rust 2021 Edition Add the following to `Cargo.toml` under `[dependencies]`: ```toml -fastly-api = "2.4.0" +fastly-api = "2.5.0" ``` ## Usage @@ -446,6 +446,19 @@ Class | Method | HTTP request | Description *UserApi* | [**request_password_reset**](docs/UserApi.md#request_password_reset) | **POST** /user/{user_login}/password/request_reset | Request a password reset *UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{user_id} | Update a user *UserApi* | [**update_user_password**](docs/UserApi.md#update_user_password) | **POST** /current_user/password | Update the user's password +*VclApi* | [**create_custom_vcl**](docs/VclApi.md#create_custom_vcl) | **POST** /service/{service_id}/version/{version_id}/vcl | Create a custom VCL file +*VclApi* | [**delete_custom_vcl**](docs/VclApi.md#delete_custom_vcl) | **DELETE** /service/{service_id}/version/{version_id}/vcl/{vcl_name} | Delete a custom VCL file +*VclApi* | [**get_custom_vcl**](docs/VclApi.md#get_custom_vcl) | **GET** /service/{service_id}/version/{version_id}/vcl/{vcl_name} | Get a custom VCL file +*VclApi* | [**get_custom_vcl_boilerplate**](docs/VclApi.md#get_custom_vcl_boilerplate) | **GET** /service/{service_id}/version/{version_id}/boilerplate | Get boilerplate VCL +*VclApi* | [**get_custom_vcl_generated**](docs/VclApi.md#get_custom_vcl_generated) | **GET** /service/{service_id}/version/{version_id}/generated_vcl | Get the generated VCL for a service +*VclApi* | [**get_custom_vcl_generated_highlighted**](docs/VclApi.md#get_custom_vcl_generated_highlighted) | **GET** /service/{service_id}/version/{version_id}/generated_vcl/content | Get the generated VCL with syntax highlighting +*VclApi* | [**get_custom_vcl_highlighted**](docs/VclApi.md#get_custom_vcl_highlighted) | **GET** /service/{service_id}/version/{version_id}/vcl/{vcl_name}/content | Get a custom VCL file with syntax highlighting +*VclApi* | [**get_custom_vcl_raw**](docs/VclApi.md#get_custom_vcl_raw) | **GET** /service/{service_id}/version/{version_id}/vcl/{vcl_name}/download | Download a custom VCL file +*VclApi* | [**lint_vcl_default**](docs/VclApi.md#lint_vcl_default) | **POST** /vcl_lint | Lint (validate) VCL using a default set of flags. +*VclApi* | [**lint_vcl_for_service**](docs/VclApi.md#lint_vcl_for_service) | **POST** /service/{service_id}/lint | Lint (validate) VCL using flags set for the service. +*VclApi* | [**list_custom_vcl**](docs/VclApi.md#list_custom_vcl) | **GET** /service/{service_id}/version/{version_id}/vcl | List custom VCL files +*VclApi* | [**set_custom_vcl_main**](docs/VclApi.md#set_custom_vcl_main) | **PUT** /service/{service_id}/version/{version_id}/vcl/{vcl_name}/main | Set a custom VCL file as main +*VclApi* | [**update_custom_vcl**](docs/VclApi.md#update_custom_vcl) | **PUT** /service/{service_id}/version/{version_id}/vcl/{vcl_name} | Update a custom VCL file *VclDiffApi* | [**vcl_diff_service_versions**](docs/VclDiffApi.md#vcl_diff_service_versions) | **GET** /service/{service_id}/vcl/diff/from/{from_version_id}/to/{to_version_id} | Get a comparison of the VCL changes between two service versions *VersionApi* | [**activate_service_version**](docs/VersionApi.md#activate_service_version) | **PUT** /service/{service_id}/version/{version_id}/activate | Activate a service version *VersionApi* | [**clone_service_version**](docs/VersionApi.md#clone_service_version) | **PUT** /service/{service_id}/version/{version_id}/clone | Clone a service version @@ -496,6 +509,7 @@ The fastly-rust API client currently does not support the following endpoints: - [`/events`](https://developer.fastly.com/reference/api/account/events) (GET) - [`/metrics/domains/services/{service_id}`](https://developer.fastly.com/reference/api/metrics-stats/domain-inspector/historical) (GET) - [`/metrics/origins/services/{service_id}`](https://developer.fastly.com/reference/api/metrics-stats/origin-inspector/historical) (GET) +- [`/resources/stores/kv/{store_id}/batch`](https://developer.fastly.com/reference/api/services/resources/kv-store-item) (PUT) - [`/resources/stores/secret/client-key`](https://developer.fastly.com/reference/api/services/resources/secret-store) (POST) - [`/resources/stores/secret/signing-key`](https://developer.fastly.com/reference/api/services/resources/secret-store) (GET) - [`/resources/stores/secret/{store_id}/secrets/{secret_name}`](https://developer.fastly.com/reference/api/services/resources/secret) (DELETE, GET) @@ -509,13 +523,9 @@ The fastly-rust API client currently does not support the following endpoints: - [`/service-groups/{service_group_id}/services`](https://developer.fastly.com/reference/api/account/service-groups) (DELETE, POST) - [`/service-groups/{service_group_id}`](https://developer.fastly.com/reference/api/account/service-groups) (PATCH) - [`/service-groups`](https://developer.fastly.com/reference/api/account/service-groups) (POST) -- [`/service/{service_id}/lint`](https://developer.fastly.com/reference/api/vcl-services/vcl) (POST) - [`/service/{service_id}/version/{version_id}/apex-redirects`](https://developer.fastly.com/reference/api/vcl-services/apex-redirect) (POST) -- [`/service/{service_id}/version/{version_id}/boilerplate`](https://developer.fastly.com/reference/api/vcl-services/vcl) (GET) - [`/service/{service_id}/version/{version_id}/director/{director_name}`](https://developer.fastly.com/reference/api/load-balancing/directors/director) (PUT) - [`/service/{service_id}/version/{version_id}/director`](https://developer.fastly.com/reference/api/load-balancing/directors/director) (POST) -- [`/service/{service_id}/version/{version_id}/generated_vcl/content`](https://developer.fastly.com/reference/api/vcl-services/vcl) (GET) -- [`/service/{service_id}/version/{version_id}/generated_vcl`](https://developer.fastly.com/reference/api/vcl-services/vcl) (GET) - [`/service/{service_id}/version/{version_id}/logging/kafka/{logging_kafka_name}`](https://developer.fastly.com/reference/api/logging/kafka) (PUT) - [`/service/{service_id}/version/{version_id}/logging/kinesis/{logging_kinesis_name}`](https://developer.fastly.com/reference/api/logging/kinesis) (PUT) - [`/service/{service_id}/version/{version_id}/package`](https://developer.fastly.com/reference/api/services/package) (PUT) @@ -523,11 +533,6 @@ The fastly-rust API client currently does not support the following endpoints: - [`/service/{service_id}/version/{version_id}/response_object/{response_object_name}`](https://developer.fastly.com/reference/api/vcl-services/response-object) (PUT) - [`/service/{service_id}/version/{version_id}/response_object`](https://developer.fastly.com/reference/api/vcl-services/response-object) (POST) - [`/service/{service_id}/version/{version_id}/snippet/{snippet_name}`](https://developer.fastly.com/reference/api/vcl-services/snippet) (PUT) -- [`/service/{service_id}/version/{version_id}/vcl/{vcl_name}/content`](https://developer.fastly.com/reference/api/vcl-services/vcl) (GET) -- [`/service/{service_id}/version/{version_id}/vcl/{vcl_name}/download`](https://developer.fastly.com/reference/api/vcl-services/vcl) (GET) -- [`/service/{service_id}/version/{version_id}/vcl/{vcl_name}/main`](https://developer.fastly.com/reference/api/vcl-services/vcl) (PUT) -- [`/service/{service_id}/version/{version_id}/vcl/{vcl_name}`](https://developer.fastly.com/reference/api/vcl-services/vcl) (DELETE, GET, PUT) -- [`/service/{service_id}/version/{version_id}/vcl`](https://developer.fastly.com/reference/api/vcl-services/vcl) (GET, POST) - [`/service/{service_id}/version/{version_id}/wafs/{firewall_id}`](https://developer.fastly.com/reference/api/legacy-waf/firewall) (GET, PATCH) - [`/service/{service_id}/version/{version_id}/wafs`](https://developer.fastly.com/reference/api/legacy-waf/firewall) (GET, POST) - [`/service/{service_id}/wafs/{firewall_id}/owasp`](https://developer.fastly.com/reference/api/legacy-waf/owasp) (GET, PATCH, POST) @@ -567,7 +572,6 @@ The fastly-rust API client currently does not support the following endpoints: - [`/v1/origins/{service_id}/ts/h/limit/{max_entries}`](https://developer.fastly.com/reference/api/metrics-stats/origin-inspector/real-time) (GET) - [`/v1/origins/{service_id}/ts/h`](https://developer.fastly.com/reference/api/metrics-stats/origin-inspector/real-time) (GET) - [`/v1/origins/{service_id}/ts/{start_timestamp}`](https://developer.fastly.com/reference/api/metrics-stats/origin-inspector/real-time) (GET) -- [`/vcl_lint`](https://developer.fastly.com/reference/api/vcl-services/vcl) (POST) - [`/waf/firewalls/{firewall_id}/versions/{version_id}/active-rules`](https://developer.fastly.com/reference/api/waf/rules/active) (DELETE) - [`/wafs/configuration_sets/{configuration_set_id}/relationships/wafs`](https://developer.fastly.com/reference/api/legacy-waf/configuration-set) (GET, PATCH) - [`/wafs/configuration_sets`](https://developer.fastly.com/reference/api/legacy-waf/configuration-set) (GET) diff --git a/docs/Batch.md b/docs/Batch.md new file mode 100644 index 0000000..88666b6 --- /dev/null +++ b/docs/Batch.md @@ -0,0 +1,13 @@ +# Batch + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | Option<**String**> | A descriptor for the response of the entire batch | +**_type** | Option<**String**> | If an error is present in any of the requests, this field will describe that error | +**errors** | Option<[**Vec<crate::models::BatchErrors>**](BatchErrors.md)> | Per-key errors which failed to parse, validate, or otherwise transmit | + +[[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BatchErrors.md b/docs/BatchErrors.md new file mode 100644 index 0000000..2ad6b1e --- /dev/null +++ b/docs/BatchErrors.md @@ -0,0 +1,14 @@ +# BatchErrors + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | Option<**String**> | The key that the error corresponds to. This field will be empty if the object or one of its fields was unable to be parsed. | +**index** | Option<**i32**> | The line number of the payload on which the error occurred (starting from 0 for the first line). | +**code** | Option<**String**> | The HTTP response code for the request, or a 400 if the request was not able to be completed. | +**reason** | Option<**String**> | A descriptor of this particular item's error. | + +[[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/InlineObject.md b/docs/InlineObject.md new file mode 100644 index 0000000..9d30cc7 --- /dev/null +++ b/docs/InlineObject.md @@ -0,0 +1,11 @@ +# InlineObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**vcl** | **String** | | + +[[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/InlineObject1.md b/docs/InlineObject1.md new file mode 100644 index 0000000..deeab92 --- /dev/null +++ b/docs/InlineObject1.md @@ -0,0 +1,11 @@ +# InlineObject1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**vcl** | **String** | | + +[[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 6a1715a..87036d7 100644 --- a/docs/SchemasSnippetResponse.md +++ b/docs/SchemasSnippetResponse.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | Option<**String**> | The name for the snippet. | -**dynamic** | Option<**i32**> | Sets the snippet version. | +**dynamic** | Option<**String**> | Sets the snippet version. | **_type** | Option<**String**> | The location in generated VCL where the snippet should be placed. | **content** | Option<**String**> | The VCL code that specifies exactly what the snippet does. | **priority** | Option<**String**> | Priority determines execution order. Lower numbers execute first. | [default to 100] diff --git a/docs/SchemasVclResponse.md b/docs/SchemasVclResponse.md new file mode 100644 index 0000000..4702f0b --- /dev/null +++ b/docs/SchemasVclResponse.md @@ -0,0 +1,18 @@ +# SchemasVclResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | Option<**String**> | The VCL code to be included. | +**main** | Option<**bool**> | Set to `true` when this is the main VCL, otherwise `false`. | +**name** | Option<**String**> | The name of this VCL. | +**service_id** | Option<**String**> | | [readonly] +**version** | Option<**i32**> | | [readonly] +**created_at** | Option<**String**> | Date and time in ISO 8601 format. | [readonly] +**deleted_at** | Option<**String**> | Date and time in ISO 8601 format. | [readonly] +**updated_at** | Option<**String**> | Date and time in ISO 8601 format. | [readonly] + +[[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ServiceVersionDetail.md b/docs/ServiceVersionDetail.md index 5901b70..5255c0e 100644 --- a/docs/ServiceVersionDetail.md +++ b/docs/ServiceVersionDetail.md @@ -27,7 +27,7 @@ Name | Type | Description | Notes **response_objects** | Option<[**Vec<crate::models::ResponseObjectResponse>**](ResponseObjectResponse.md)> | List of response objects for this service. | **settings** | Option<[**crate::models::VersionDetailSettings**](VersionDetailSettings.md)> | | **snippets** | Option<[**Vec<crate::models::SchemasSnippetResponse>**](SchemasSnippetResponse.md)> | List of VCL snippets for this service. | -**vcls** | Option<[**Vec<crate::models::VclResponse>**](VclResponse.md)> | List of VCL files for this service. | +**vcls** | Option<[**Vec<crate::models::SchemasVclResponse>**](SchemasVclResponse.md)> | List of VCL files for this service. | **wordpress** | Option<[**Vec<serde_json::Value>**](SerdeJsonValue.md)> | A list of Wordpress rules with this service. | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ServiceVersionDetailOrNull.md b/docs/ServiceVersionDetailOrNull.md index 045ccbf..db585c7 100644 --- a/docs/ServiceVersionDetailOrNull.md +++ b/docs/ServiceVersionDetailOrNull.md @@ -27,7 +27,7 @@ Name | Type | Description | Notes **response_objects** | Option<[**Vec<crate::models::ResponseObjectResponse>**](ResponseObjectResponse.md)> | List of response objects for this service. | **settings** | Option<[**crate::models::VersionDetailSettings**](VersionDetailSettings.md)> | | **snippets** | Option<[**Vec<crate::models::SchemasSnippetResponse>**](SchemasSnippetResponse.md)> | List of VCL snippets for this service. | -**vcls** | Option<[**Vec<crate::models::VclResponse>**](VclResponse.md)> | List of VCL files for this service. | +**vcls** | Option<[**Vec<crate::models::SchemasVclResponse>**](SchemasVclResponse.md)> | List of VCL files for this service. | **wordpress** | Option<[**Vec<serde_json::Value>**](SerdeJsonValue.md)> | A list of Wordpress rules with this service. | [[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 813318f..c5f58eb 100644 --- a/docs/Snippet.md +++ b/docs/Snippet.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | Option<**String**> | The name for the snippet. | -**dynamic** | Option<**i32**> | Sets the snippet version. | +**dynamic** | Option<**String**> | Sets the snippet version. | **_type** | Option<**String**> | The location in generated VCL where the snippet should be placed. | **content** | Option<**String**> | The VCL code that specifies exactly what the snippet does. | **priority** | Option<**String**> | Priority determines execution order. Lower numbers execute first. | [default to 100] diff --git a/docs/SnippetApi.md b/docs/SnippetApi.md index 3f74313..b60bb4d 100644 --- a/docs/SnippetApi.md +++ b/docs/SnippetApi.md @@ -33,7 +33,7 @@ Name | Type | Description | Required | Notes **service_id** | **String** | Alphanumeric string identifying the service. | [required] | **version_id** | **i32** | Integer identifying a service version. | [required] | **name** | Option\<**String**> | The name for the snippet. | | -**dynamic** | Option\<**i32**> | Sets the snippet version. | | +**dynamic** | Option\<**String**> | Sets the snippet version. | | **_type** | Option\<**String**> | The location in generated VCL where the snippet should be placed. | | **content** | Option\<**String**> | The VCL code that specifies exactly what the snippet does. | | **priority** | Option\<**String**> | Priority determines execution order. Lower numbers execute first. | |[default to 100] @@ -220,7 +220,7 @@ Name | Type | Description | Required | Notes **service_id** | **String** | Alphanumeric string identifying the service. | [required] | **snippet_id** | **String** | Alphanumeric string identifying a VCL Snippet. | [required] | **name** | Option\<**String**> | The name for the snippet. | | -**dynamic** | Option\<**i32**> | Sets the snippet version. | | +**dynamic** | Option\<**String**> | Sets the snippet version. | | **_type** | Option\<**String**> | The location in generated VCL where the snippet should be placed. | | **content** | Option\<**String**> | The VCL code that specifies exactly what the snippet does. | | **priority** | Option\<**String**> | Priority determines execution order. Lower numbers execute first. | |[default to 100] diff --git a/docs/SnippetResponse.md b/docs/SnippetResponse.md index d92175f..5e4fae3 100644 --- a/docs/SnippetResponse.md +++ b/docs/SnippetResponse.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | Option<**String**> | The name for the snippet. | -**dynamic** | Option<**i32**> | Sets the snippet version. | +**dynamic** | Option<**String**> | Sets the snippet version. | **_type** | Option<**String**> | The location in generated VCL where the snippet should be placed. | **content** | Option<**String**> | The VCL code that specifies exactly what the snippet does. | **priority** | Option<**String**> | Priority determines execution order. Lower numbers execute first. | [default to 100] diff --git a/docs/TokensAdditionalProps.md b/docs/TokensAdditionalProps.md new file mode 100644 index 0000000..ef32b18 --- /dev/null +++ b/docs/TokensAdditionalProps.md @@ -0,0 +1,10 @@ +# TokensAdditionalProps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ValidatorResult.md b/docs/ValidatorResult.md new file mode 100644 index 0000000..8e5369f --- /dev/null +++ b/docs/ValidatorResult.md @@ -0,0 +1,11 @@ +# ValidatorResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | Option<[**crate::models::ValidatorResultData**](ValidatorResultData.md)> | | + +[[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ValidatorResultData.md b/docs/ValidatorResultData.md new file mode 100644 index 0000000..e63fd6e --- /dev/null +++ b/docs/ValidatorResultData.md @@ -0,0 +1,13 @@ +# ValidatorResultData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<**String**> | | +**_type** | Option<**String**> | | +**attributes** | Option<[**crate::models::ValidatorResultDataAttributes**](ValidatorResultDataAttributes.md)> | | + +[[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ValidatorResultDataAttributes.md b/docs/ValidatorResultDataAttributes.md new file mode 100644 index 0000000..1ad903d --- /dev/null +++ b/docs/ValidatorResultDataAttributes.md @@ -0,0 +1,15 @@ +# ValidatorResultDataAttributes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**msg** | Option<**String**> | | +**status** | Option<**String**> | | +**errors** | Option<**Vec**> | | +**warnings** | Option<**Vec**> | | +**messages** | Option<[**Vec<crate::models::ValidatorResultDataAttributesMessages>**](ValidatorResultDataAttributesMessages.md)> | | + +[[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ValidatorResultDataAttributesMessages.md b/docs/ValidatorResultDataAttributesMessages.md new file mode 100644 index 0000000..c610f31 --- /dev/null +++ b/docs/ValidatorResultDataAttributesMessages.md @@ -0,0 +1,14 @@ +# ValidatorResultDataAttributesMessages + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_type** | **String** | | +**warning** | **bool** | | +**message** | **String** | | +**tokens** | [**Vec<::std::collections::HashMap<String, crate::models::TokensAdditionalProps>>**](Map.md) | | + +[[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/VclApi.md b/docs/VclApi.md new file mode 100644 index 0000000..2015e5b --- /dev/null +++ b/docs/VclApi.md @@ -0,0 +1,501 @@ +# VclApi + +All URIs are relative to *https://api.fastly.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_custom_vcl**](VclApi.md#create_custom_vcl) | **POST** /service/{service_id}/version/{version_id}/vcl | Create a custom VCL file +[**delete_custom_vcl**](VclApi.md#delete_custom_vcl) | **DELETE** /service/{service_id}/version/{version_id}/vcl/{vcl_name} | Delete a custom VCL file +[**get_custom_vcl**](VclApi.md#get_custom_vcl) | **GET** /service/{service_id}/version/{version_id}/vcl/{vcl_name} | Get a custom VCL file +[**get_custom_vcl_boilerplate**](VclApi.md#get_custom_vcl_boilerplate) | **GET** /service/{service_id}/version/{version_id}/boilerplate | Get boilerplate VCL +[**get_custom_vcl_generated**](VclApi.md#get_custom_vcl_generated) | **GET** /service/{service_id}/version/{version_id}/generated_vcl | Get the generated VCL for a service +[**get_custom_vcl_generated_highlighted**](VclApi.md#get_custom_vcl_generated_highlighted) | **GET** /service/{service_id}/version/{version_id}/generated_vcl/content | Get the generated VCL with syntax highlighting +[**get_custom_vcl_highlighted**](VclApi.md#get_custom_vcl_highlighted) | **GET** /service/{service_id}/version/{version_id}/vcl/{vcl_name}/content | Get a custom VCL file with syntax highlighting +[**get_custom_vcl_raw**](VclApi.md#get_custom_vcl_raw) | **GET** /service/{service_id}/version/{version_id}/vcl/{vcl_name}/download | Download a custom VCL file +[**lint_vcl_default**](VclApi.md#lint_vcl_default) | **POST** /vcl_lint | Lint (validate) VCL using a default set of flags. +[**lint_vcl_for_service**](VclApi.md#lint_vcl_for_service) | **POST** /service/{service_id}/lint | Lint (validate) VCL using flags set for the service. +[**list_custom_vcl**](VclApi.md#list_custom_vcl) | **GET** /service/{service_id}/version/{version_id}/vcl | List custom VCL files +[**set_custom_vcl_main**](VclApi.md#set_custom_vcl_main) | **PUT** /service/{service_id}/version/{version_id}/vcl/{vcl_name}/main | Set a custom VCL file as main +[**update_custom_vcl**](VclApi.md#update_custom_vcl) | **PUT** /service/{service_id}/version/{version_id}/vcl/{vcl_name} | Update a custom VCL file + + + +## create_custom_vcl + +Upload a VCL for a particular service and version. + +```rust +let cfg = &Configuration::default(); +let params = CreateCustomVclParams { + // parameters +}; +create_custom_vcl(cfg, params) +``` + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**service_id** | **String** | Alphanumeric string identifying the service. | [required] | +**version_id** | **i32** | Integer identifying a service version. | [required] | +**content** | Option\<**String**> | The VCL code to be included. | | +**main** | Option\<**bool**> | Set to `true` when this is the main VCL, otherwise `false`. | | +**name** | Option\<**String**> | The name of this VCL. | | + +### Return type + +[**crate::models::VclResponse**](VclResponse.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + +## delete_custom_vcl + +Delete the uploaded VCL for a particular service and version. + +```rust +let cfg = &Configuration::default(); +let params = DeleteCustomVclParams { + // parameters +}; +delete_custom_vcl(cfg, params) +``` + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**service_id** | **String** | Alphanumeric string identifying the service. | [required] | +**version_id** | **i32** | Integer identifying a service version. | [required] | +**vcl_name** | **String** | The name of this VCL. | [required] | + +### Return type + +[**crate::models::InlineResponse200**](InlineResponse200.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + +## get_custom_vcl + +Get the uploaded VCL for a particular service and version. + +```rust +let cfg = &Configuration::default(); +let params = GetCustomVclParams { + // parameters +}; +get_custom_vcl(cfg, params) +``` + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**service_id** | **String** | Alphanumeric string identifying the service. | [required] | +**version_id** | **i32** | Integer identifying a service version. | [required] | +**vcl_name** | **String** | The name of this VCL. | [required] | +**no_content** | Option\<**String**> | Omit VCL content. | |[default to 0] + +### Return type + +[**crate::models::VclResponse**](VclResponse.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + +## get_custom_vcl_boilerplate + +Return boilerplate VCL with the service's TTL from the [settings](/reference/api/vcl-services/settings/). + +```rust +let cfg = &Configuration::default(); +let params = GetCustomVclBoilerplateParams { + // parameters +}; +get_custom_vcl_boilerplate(cfg, params) +``` + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**service_id** | **String** | Alphanumeric string identifying the service. | [required] | +**version_id** | **i32** | Integer identifying a service version. | [required] | + +### Return type + +**String** + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + +## get_custom_vcl_generated + +Display the generated VCL for a particular service and version. + +```rust +let cfg = &Configuration::default(); +let params = GetCustomVclGeneratedParams { + // parameters +}; +get_custom_vcl_generated(cfg, params) +``` + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**service_id** | **String** | Alphanumeric string identifying the service. | [required] | +**version_id** | **i32** | Integer identifying a service version. | [required] | + +### Return type + +[**crate::models::VclResponse**](VclResponse.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + +## get_custom_vcl_generated_highlighted + +Display the content of generated VCL with HTML syntax highlighting. Include line numbers by sending `lineno=true` as a request parameter. + +```rust +let cfg = &Configuration::default(); +let params = GetCustomVclGeneratedHighlightedParams { + // parameters +}; +get_custom_vcl_generated_highlighted(cfg, params) +``` + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**service_id** | **String** | Alphanumeric string identifying the service. | [required] | +**version_id** | **i32** | Integer identifying a service version. | [required] | + +### Return type + +[**crate::models::VclSyntaxHighlightingResponse**](VclSyntaxHighlightingResponse.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + +## get_custom_vcl_highlighted + +Get the uploaded VCL for a particular service and version with HTML syntax highlighting. Include line numbers by sending `lineno=true` as a request parameter. + +```rust +let cfg = &Configuration::default(); +let params = GetCustomVclHighlightedParams { + // parameters +}; +get_custom_vcl_highlighted(cfg, params) +``` + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**service_id** | **String** | Alphanumeric string identifying the service. | [required] | +**version_id** | **i32** | Integer identifying a service version. | [required] | +**vcl_name** | **String** | The name of this VCL. | [required] | + +### Return type + +[**crate::models::VclSyntaxHighlightingResponse**](VclSyntaxHighlightingResponse.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + +## get_custom_vcl_raw + +Download the specified VCL. + +```rust +let cfg = &Configuration::default(); +let params = GetCustomVclRawParams { + // parameters +}; +get_custom_vcl_raw(cfg, params) +``` + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**service_id** | **String** | Alphanumeric string identifying the service. | [required] | +**version_id** | **i32** | Integer identifying a service version. | [required] | +**vcl_name** | **String** | The name of this VCL. | [required] | + +### Return type + +**String** + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + +## lint_vcl_default + +This endpoint validates the submitted VCL against a default set of enabled flags. Consider using the `/service/{service_id}/lint` operation to validate VCL in the context of a specific service. + +```rust +let cfg = &Configuration::default(); +let params = LintVclDefaultParams { + // parameters +}; +lint_vcl_default(cfg, params) +``` + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**inline_object1** | [**InlineObject1**](InlineObject1.md) | | [required] | + +### Return type + +[**crate::models::ValidatorResult**](ValidatorResult.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + +## lint_vcl_for_service + +Services may have flags set by a Fastly employee or by the purchase of products as addons to the service, which modify the way VCL is interpreted by that service. This endpoint validates the submitted VCL in the context of the specified service. + +```rust +let cfg = &Configuration::default(); +let params = LintVclForServiceParams { + // parameters +}; +lint_vcl_for_service(cfg, params) +``` + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**service_id** | **String** | Alphanumeric string identifying the service. | [required] | +**inline_object** | [**InlineObject**](InlineObject.md) | | [required] | + +### Return type + +[**crate::models::ValidatorResult**](ValidatorResult.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + +## list_custom_vcl + +List the uploaded VCLs for a particular service and version. + +```rust +let cfg = &Configuration::default(); +let params = ListCustomVclParams { + // parameters +}; +list_custom_vcl(cfg, params) +``` + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**service_id** | **String** | Alphanumeric string identifying the service. | [required] | +**version_id** | **i32** | Integer identifying a service version. | [required] | + +### Return type + +[**Vec<crate::models::VclResponse>**](VclResponse.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + +## set_custom_vcl_main + +Set the specified VCL as the main. + +```rust +let cfg = &Configuration::default(); +let params = SetCustomVclMainParams { + // parameters +}; +set_custom_vcl_main(cfg, params) +``` + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**service_id** | **String** | Alphanumeric string identifying the service. | [required] | +**version_id** | **i32** | Integer identifying a service version. | [required] | +**vcl_name** | **String** | The name of this VCL. | [required] | + +### Return type + +[**crate::models::VclResponse**](VclResponse.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + +## update_custom_vcl + +Update the uploaded VCL for a particular service and version. + +```rust +let cfg = &Configuration::default(); +let params = UpdateCustomVclParams { + // parameters +}; +update_custom_vcl(cfg, params) +``` + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**service_id** | **String** | Alphanumeric string identifying the service. | [required] | +**version_id** | **i32** | Integer identifying a service version. | [required] | +**vcl_name** | **String** | The name of this VCL. | [required] | +**content** | Option\<**String**> | The VCL code to be included. | | +**main** | Option\<**bool**> | Set to `true` when this is the main VCL, otherwise `false`. | | +**name** | Option\<**String**> | The name of this VCL. | | + +### Return type + +[**crate::models::VclResponse**](VclResponse.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/VclSyntaxHighlightingResponse.md b/docs/VclSyntaxHighlightingResponse.md new file mode 100644 index 0000000..65fa360 --- /dev/null +++ b/docs/VclSyntaxHighlightingResponse.md @@ -0,0 +1,11 @@ +# VclSyntaxHighlightingResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | Option<**String**> | VCL with HTML syntax highlighting. | + +[[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/VersionDetail.md b/docs/VersionDetail.md index 2790c9c..4eb1309 100644 --- a/docs/VersionDetail.md +++ b/docs/VersionDetail.md @@ -16,7 +16,7 @@ Name | Type | Description | Notes **response_objects** | Option<[**Vec<crate::models::ResponseObjectResponse>**](ResponseObjectResponse.md)> | List of response objects for this service. | **settings** | Option<[**crate::models::VersionDetailSettings**](VersionDetailSettings.md)> | | **snippets** | Option<[**Vec<crate::models::SchemasSnippetResponse>**](SchemasSnippetResponse.md)> | List of VCL snippets for this service. | -**vcls** | Option<[**Vec<crate::models::VclResponse>**](VclResponse.md)> | List of VCL files for this service. | +**vcls** | Option<[**Vec<crate::models::SchemasVclResponse>**](SchemasVclResponse.md)> | List of VCL files for this service. | **wordpress** | Option<[**Vec<serde_json::Value>**](SerdeJsonValue.md)> | A list of Wordpress rules with this service. | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sig.json b/sig.json index 9248d1c..452166f 100644 --- a/sig.json +++ b/sig.json @@ -1 +1 @@ -{"G": "4f949974", "D": "92c7d13f"} +{"G": "1737d053", "D": "d944a1e9"} diff --git a/src/apis/configuration.rs b/src/apis/configuration.rs index d9a70ca..51dbfe2 100644 --- a/src/apis/configuration.rs +++ b/src/apis/configuration.rs @@ -49,7 +49,7 @@ impl Default for Configuration { Configuration { base_path: "https://api.fastly.com".to_owned(), - user_agent: Some("fastly-api/2.4.0/rust".to_owned()), + user_agent: Some("fastly-api/2.5.0/rust".to_owned()), client: reqwest::Client::new(), basic_auth: None, oauth_access_token: None, diff --git a/src/apis/mod.rs b/src/apis/mod.rs index 399013a..37563fa 100644 --- a/src/apis/mod.rs +++ b/src/apis/mod.rs @@ -147,6 +147,7 @@ pub mod tls_private_keys_api; pub mod tls_subscriptions_api; pub mod tokens_api; pub mod user_api; +pub mod vcl_api; pub mod vcl_diff_api; pub mod version_api; pub mod waf_active_rules_api; diff --git a/src/apis/snippet_api.rs b/src/apis/snippet_api.rs index c32df14..87c3728 100644 --- a/src/apis/snippet_api.rs +++ b/src/apis/snippet_api.rs @@ -21,7 +21,7 @@ pub struct CreateSnippetParams { /// The name for the snippet. pub name: Option, /// Sets the snippet version. - pub dynamic: Option, + pub dynamic: Option, /// The location in generated VCL where the snippet should be placed. pub _type: Option, /// The VCL code that specifies exactly what the snippet does. @@ -80,7 +80,7 @@ pub struct UpdateSnippetDynamicParams { /// The name for the snippet. pub name: Option, /// Sets the snippet version. - pub dynamic: Option, + pub dynamic: Option, /// The location in generated VCL where the snippet should be placed. pub _type: Option, /// The VCL code that specifies exactly what the snippet does. diff --git a/src/apis/vcl_api.rs b/src/apis/vcl_api.rs new file mode 100644 index 0000000..603c3b5 --- /dev/null +++ b/src/apis/vcl_api.rs @@ -0,0 +1,973 @@ +/* + * 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/) + * + */ + + +use reqwest; + +use crate::apis::ResponseContent; +use super::{Error, configuration}; + +/// struct for passing parameters to the method [`create_custom_vcl`] +#[derive(Clone, Debug, Default)] +pub struct CreateCustomVclParams { + /// Alphanumeric string identifying the service. + pub service_id: String, + /// Integer identifying a service version. + pub version_id: i32, + /// The VCL code to be included. + pub content: Option, + /// Set to `true` when this is the main VCL, otherwise `false`. + pub main: Option, + /// The name of this VCL. + pub name: Option +} + +/// struct for passing parameters to the method [`delete_custom_vcl`] +#[derive(Clone, Debug, Default)] +pub struct DeleteCustomVclParams { + /// Alphanumeric string identifying the service. + pub service_id: String, + /// Integer identifying a service version. + pub version_id: i32, + /// The name of this VCL. + pub vcl_name: String +} + +/// struct for passing parameters to the method [`get_custom_vcl`] +#[derive(Clone, Debug, Default)] +pub struct GetCustomVclParams { + /// Alphanumeric string identifying the service. + pub service_id: String, + /// Integer identifying a service version. + pub version_id: i32, + /// The name of this VCL. + pub vcl_name: String, + /// Omit VCL content. + pub no_content: Option +} + +/// struct for passing parameters to the method [`get_custom_vcl_boilerplate`] +#[derive(Clone, Debug, Default)] +pub struct GetCustomVclBoilerplateParams { + /// Alphanumeric string identifying the service. + pub service_id: String, + /// Integer identifying a service version. + pub version_id: i32 +} + +/// struct for passing parameters to the method [`get_custom_vcl_generated`] +#[derive(Clone, Debug, Default)] +pub struct GetCustomVclGeneratedParams { + /// Alphanumeric string identifying the service. + pub service_id: String, + /// Integer identifying a service version. + pub version_id: i32 +} + +/// struct for passing parameters to the method [`get_custom_vcl_generated_highlighted`] +#[derive(Clone, Debug, Default)] +pub struct GetCustomVclGeneratedHighlightedParams { + /// Alphanumeric string identifying the service. + pub service_id: String, + /// Integer identifying a service version. + pub version_id: i32 +} + +/// struct for passing parameters to the method [`get_custom_vcl_highlighted`] +#[derive(Clone, Debug, Default)] +pub struct GetCustomVclHighlightedParams { + /// Alphanumeric string identifying the service. + pub service_id: String, + /// Integer identifying a service version. + pub version_id: i32, + /// The name of this VCL. + pub vcl_name: String +} + +/// struct for passing parameters to the method [`get_custom_vcl_raw`] +#[derive(Clone, Debug, Default)] +pub struct GetCustomVclRawParams { + /// Alphanumeric string identifying the service. + pub service_id: String, + /// Integer identifying a service version. + pub version_id: i32, + /// The name of this VCL. + pub vcl_name: String +} + +/// struct for passing parameters to the method [`lint_vcl_default`] +#[derive(Clone, Debug, Default)] +pub struct LintVclDefaultParams { + pub inline_object1: crate::models::InlineObject1 +} + +/// struct for passing parameters to the method [`lint_vcl_for_service`] +#[derive(Clone, Debug, Default)] +pub struct LintVclForServiceParams { + /// Alphanumeric string identifying the service. + pub service_id: String, + pub inline_object: crate::models::InlineObject +} + +/// struct for passing parameters to the method [`list_custom_vcl`] +#[derive(Clone, Debug, Default)] +pub struct ListCustomVclParams { + /// Alphanumeric string identifying the service. + pub service_id: String, + /// Integer identifying a service version. + pub version_id: i32 +} + +/// struct for passing parameters to the method [`set_custom_vcl_main`] +#[derive(Clone, Debug, Default)] +pub struct SetCustomVclMainParams { + /// Alphanumeric string identifying the service. + pub service_id: String, + /// Integer identifying a service version. + pub version_id: i32, + /// The name of this VCL. + pub vcl_name: String +} + +/// struct for passing parameters to the method [`update_custom_vcl`] +#[derive(Clone, Debug, Default)] +pub struct UpdateCustomVclParams { + /// Alphanumeric string identifying the service. + pub service_id: String, + /// Integer identifying a service version. + pub version_id: i32, + /// The name of this VCL. + pub vcl_name: String, + /// The VCL code to be included. + pub content: Option, + /// Set to `true` when this is the main VCL, otherwise `false`. + pub main: Option, + /// The name of this VCL. + pub name: Option +} + + +/// struct for typed errors of method [`create_custom_vcl`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateCustomVclError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_custom_vcl`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteCustomVclError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_custom_vcl`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetCustomVclError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_custom_vcl_boilerplate`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetCustomVclBoilerplateError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_custom_vcl_generated`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetCustomVclGeneratedError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_custom_vcl_generated_highlighted`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetCustomVclGeneratedHighlightedError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_custom_vcl_highlighted`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetCustomVclHighlightedError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_custom_vcl_raw`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetCustomVclRawError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`lint_vcl_default`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum LintVclDefaultError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`lint_vcl_for_service`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum LintVclForServiceError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_custom_vcl`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListCustomVclError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`set_custom_vcl_main`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SetCustomVclMainError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_custom_vcl`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateCustomVclError { + UnknownValue(serde_json::Value), +} + + +/// Upload a VCL for a particular service and version. +pub async fn create_custom_vcl(configuration: &mut configuration::Configuration, params: CreateCustomVclParams) -> Result> { + let local_var_configuration = configuration; + + // unbox the parameters + let service_id = params.service_id; + let version_id = params.version_id; + let content = params.content; + let main = params.main; + let name = params.name; + + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/service/{service_id}/version/{version_id}/vcl", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value); + }; + let mut local_var_form_params = std::collections::HashMap::new(); + if let Some(local_var_param_value) = content { + local_var_form_params.insert("content", local_var_param_value.to_string()); + } + if let Some(local_var_param_value) = main { + local_var_form_params.insert("main", local_var_param_value.to_string()); + } + if let Some(local_var_param_value) = name { + local_var_form_params.insert("name", local_var_param_value.to_string()); + } + local_var_req_builder = local_var_req_builder.form(&local_var_form_params); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + if "POST" != "GET" && "POST" != "HEAD" { + let headers = local_var_resp.headers(); + local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => configuration::DEFAULT_RATELIMIT, + }; + local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => 0, + }; + } + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Delete the uploaded VCL for a particular service and version. +pub async fn delete_custom_vcl(configuration: &mut configuration::Configuration, params: DeleteCustomVclParams) -> Result> { + let local_var_configuration = configuration; + + // unbox the parameters + let service_id = params.service_id; + let version_id = params.version_id; + let vcl_name = params.vcl_name; + + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/service/{service_id}/version/{version_id}/vcl/{vcl_name}", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id, vcl_name=crate::apis::urlencode(vcl_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + if "DELETE" != "GET" && "DELETE" != "HEAD" { + let headers = local_var_resp.headers(); + local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => configuration::DEFAULT_RATELIMIT, + }; + local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => 0, + }; + } + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get the uploaded VCL for a particular service and version. +pub async fn get_custom_vcl(configuration: &mut configuration::Configuration, params: GetCustomVclParams) -> Result> { + let local_var_configuration = configuration; + + // unbox the parameters + let service_id = params.service_id; + let version_id = params.version_id; + let vcl_name = params.vcl_name; + let no_content = params.no_content; + + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/service/{service_id}/version/{version_id}/vcl/{vcl_name}", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id, vcl_name=crate::apis::urlencode(vcl_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = no_content { + local_var_req_builder = local_var_req_builder.query(&[("no_content", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + if "GET" != "GET" && "GET" != "HEAD" { + let headers = local_var_resp.headers(); + local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => configuration::DEFAULT_RATELIMIT, + }; + local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => 0, + }; + } + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Return boilerplate VCL with the service's TTL from the [settings](/reference/api/vcl-services/settings/). +pub async fn get_custom_vcl_boilerplate(configuration: &mut configuration::Configuration, params: GetCustomVclBoilerplateParams) -> Result> { + let local_var_configuration = configuration; + + // unbox the parameters + let service_id = params.service_id; + let version_id = params.version_id; + + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/service/{service_id}/version/{version_id}/boilerplate", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + if "GET" != "GET" && "GET" != "HEAD" { + let headers = local_var_resp.headers(); + local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => configuration::DEFAULT_RATELIMIT, + }; + local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => 0, + }; + } + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Display the generated VCL for a particular service and version. +pub async fn get_custom_vcl_generated(configuration: &mut configuration::Configuration, params: GetCustomVclGeneratedParams) -> Result> { + let local_var_configuration = configuration; + + // unbox the parameters + let service_id = params.service_id; + let version_id = params.version_id; + + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/service/{service_id}/version/{version_id}/generated_vcl", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + if "GET" != "GET" && "GET" != "HEAD" { + let headers = local_var_resp.headers(); + local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => configuration::DEFAULT_RATELIMIT, + }; + local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => 0, + }; + } + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Display the content of generated VCL with HTML syntax highlighting. Include line numbers by sending `lineno=true` as a request parameter. +pub async fn get_custom_vcl_generated_highlighted(configuration: &mut configuration::Configuration, params: GetCustomVclGeneratedHighlightedParams) -> Result> { + let local_var_configuration = configuration; + + // unbox the parameters + let service_id = params.service_id; + let version_id = params.version_id; + + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/service/{service_id}/version/{version_id}/generated_vcl/content", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + if "GET" != "GET" && "GET" != "HEAD" { + let headers = local_var_resp.headers(); + local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => configuration::DEFAULT_RATELIMIT, + }; + local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => 0, + }; + } + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get the uploaded VCL for a particular service and version with HTML syntax highlighting. Include line numbers by sending `lineno=true` as a request parameter. +pub async fn get_custom_vcl_highlighted(configuration: &mut configuration::Configuration, params: GetCustomVclHighlightedParams) -> Result> { + let local_var_configuration = configuration; + + // unbox the parameters + let service_id = params.service_id; + let version_id = params.version_id; + let vcl_name = params.vcl_name; + + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/service/{service_id}/version/{version_id}/vcl/{vcl_name}/content", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id, vcl_name=crate::apis::urlencode(vcl_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + if "GET" != "GET" && "GET" != "HEAD" { + let headers = local_var_resp.headers(); + local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => configuration::DEFAULT_RATELIMIT, + }; + local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => 0, + }; + } + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Download the specified VCL. +pub async fn get_custom_vcl_raw(configuration: &mut configuration::Configuration, params: GetCustomVclRawParams) -> Result> { + let local_var_configuration = configuration; + + // unbox the parameters + let service_id = params.service_id; + let version_id = params.version_id; + let vcl_name = params.vcl_name; + + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/service/{service_id}/version/{version_id}/vcl/{vcl_name}/download", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id, vcl_name=crate::apis::urlencode(vcl_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + if "GET" != "GET" && "GET" != "HEAD" { + let headers = local_var_resp.headers(); + local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => configuration::DEFAULT_RATELIMIT, + }; + local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => 0, + }; + } + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint validates the submitted VCL against a default set of enabled flags. Consider using the `/service/{service_id}/lint` operation to validate VCL in the context of a specific service. +pub async fn lint_vcl_default(configuration: &mut configuration::Configuration, params: LintVclDefaultParams) -> Result> { + let local_var_configuration = configuration; + + // unbox the parameters + let inline_object1 = params.inline_object1; + + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/vcl_lint", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&inline_object1); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + if "POST" != "GET" && "POST" != "HEAD" { + let headers = local_var_resp.headers(); + local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => configuration::DEFAULT_RATELIMIT, + }; + local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => 0, + }; + } + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Services may have flags set by a Fastly employee or by the purchase of products as addons to the service, which modify the way VCL is interpreted by that service. This endpoint validates the submitted VCL in the context of the specified service. +pub async fn lint_vcl_for_service(configuration: &mut configuration::Configuration, params: LintVclForServiceParams) -> Result> { + let local_var_configuration = configuration; + + // unbox the parameters + let service_id = params.service_id; + let inline_object = params.inline_object; + + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/service/{service_id}/lint", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&inline_object); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + if "POST" != "GET" && "POST" != "HEAD" { + let headers = local_var_resp.headers(); + local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => configuration::DEFAULT_RATELIMIT, + }; + local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => 0, + }; + } + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List the uploaded VCLs for a particular service and version. +pub async fn list_custom_vcl(configuration: &mut configuration::Configuration, params: ListCustomVclParams) -> Result, Error> { + let local_var_configuration = configuration; + + // unbox the parameters + let service_id = params.service_id; + let version_id = params.version_id; + + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/service/{service_id}/version/{version_id}/vcl", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + if "GET" != "GET" && "GET" != "HEAD" { + let headers = local_var_resp.headers(); + local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => configuration::DEFAULT_RATELIMIT, + }; + local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => 0, + }; + } + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Set the specified VCL as the main. +pub async fn set_custom_vcl_main(configuration: &mut configuration::Configuration, params: SetCustomVclMainParams) -> Result> { + let local_var_configuration = configuration; + + // unbox the parameters + let service_id = params.service_id; + let version_id = params.version_id; + let vcl_name = params.vcl_name; + + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/service/{service_id}/version/{version_id}/vcl/{vcl_name}/main", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id, vcl_name=crate::apis::urlencode(vcl_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + if "PUT" != "GET" && "PUT" != "HEAD" { + let headers = local_var_resp.headers(); + local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => configuration::DEFAULT_RATELIMIT, + }; + local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => 0, + }; + } + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update the uploaded VCL for a particular service and version. +pub async fn update_custom_vcl(configuration: &mut configuration::Configuration, params: UpdateCustomVclParams) -> Result> { + let local_var_configuration = configuration; + + // unbox the parameters + let service_id = params.service_id; + let version_id = params.version_id; + let vcl_name = params.vcl_name; + let content = params.content; + let main = params.main; + let name = params.name; + + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/service/{service_id}/version/{version_id}/vcl/{vcl_name}", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id, vcl_name=crate::apis::urlencode(vcl_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value); + }; + let mut local_var_form_params = std::collections::HashMap::new(); + if let Some(local_var_param_value) = content { + local_var_form_params.insert("content", local_var_param_value.to_string()); + } + if let Some(local_var_param_value) = main { + local_var_form_params.insert("main", local_var_param_value.to_string()); + } + if let Some(local_var_param_value) = name { + local_var_form_params.insert("name", local_var_param_value.to_string()); + } + local_var_req_builder = local_var_req_builder.form(&local_var_form_params); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + if "PUT" != "GET" && "PUT" != "HEAD" { + let headers = local_var_resp.headers(); + local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => configuration::DEFAULT_RATELIMIT, + }; + local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => 0, + }; + } + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/src/models/batch.rs b/src/models/batch.rs new file mode 100644 index 0000000..91c71b5 --- /dev/null +++ b/src/models/batch.rs @@ -0,0 +1,34 @@ +/* + * 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/) + * + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Batch { + /// A descriptor for the response of the entire batch + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, + /// If an error is present in any of the requests, this field will describe that error + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub _type: Option, + /// Per-key errors which failed to parse, validate, or otherwise transmit + #[serde(rename = "errors", skip_serializing_if = "Option::is_none")] + pub errors: Option>, +} + +impl Batch { + pub fn new() -> Batch { + Batch { + title: None, + _type: None, + errors: None, + } + } +} + + diff --git a/src/models/batch_errors.rs b/src/models/batch_errors.rs new file mode 100644 index 0000000..2a120c7 --- /dev/null +++ b/src/models/batch_errors.rs @@ -0,0 +1,38 @@ +/* + * 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/) + * + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct BatchErrors { + /// The key that the error corresponds to. This field will be empty if the object or one of its fields was unable to be parsed. + #[serde(rename = "key", skip_serializing_if = "Option::is_none")] + pub key: Option, + /// The line number of the payload on which the error occurred (starting from 0 for the first line). + #[serde(rename = "index", skip_serializing_if = "Option::is_none")] + pub index: Option, + /// The HTTP response code for the request, or a 400 if the request was not able to be completed. + #[serde(rename = "code", skip_serializing_if = "Option::is_none")] + pub code: Option, + /// A descriptor of this particular item's error. + #[serde(rename = "reason", skip_serializing_if = "Option::is_none")] + pub reason: Option, +} + +impl BatchErrors { + pub fn new() -> BatchErrors { + BatchErrors { + key: None, + index: None, + code: None, + reason: None, + } + } +} + + diff --git a/src/models/inline_object.rs b/src/models/inline_object.rs new file mode 100644 index 0000000..176876d --- /dev/null +++ b/src/models/inline_object.rs @@ -0,0 +1,25 @@ +/* + * 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/) + * + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct InlineObject { + #[serde(rename = "vcl")] + pub vcl: String, +} + +impl InlineObject { + pub fn new(vcl: String) -> InlineObject { + InlineObject { + vcl, + } + } +} + + diff --git a/src/models/inline_object_1.rs b/src/models/inline_object_1.rs new file mode 100644 index 0000000..832b5a6 --- /dev/null +++ b/src/models/inline_object_1.rs @@ -0,0 +1,25 @@ +/* + * 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/) + * + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct InlineObject1 { + #[serde(rename = "vcl")] + pub vcl: String, +} + +impl InlineObject1 { + pub fn new(vcl: String) -> InlineObject1 { + InlineObject1 { + vcl, + } + } +} + + diff --git a/src/models/mod.rs b/src/models/mod.rs index c574f69..6a64124 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -36,6 +36,10 @@ pub mod backend_response; pub use self::backend_response::BackendResponse; pub mod backend_response_all_of; pub use self::backend_response_all_of::BackendResponseAllOf; +pub mod batch; +pub use self::batch::Batch; +pub mod batch_errors; +pub use self::batch_errors::BatchErrors; pub mod billing; pub use self::billing::Billing; pub mod billing_address_attributes; @@ -210,6 +214,10 @@ pub mod included_with_waf_firewall_version_item; pub use self::included_with_waf_firewall_version_item::IncludedWithWafFirewallVersionItem; pub mod included_with_waf_rule_item; pub use self::included_with_waf_rule_item::IncludedWithWafRuleItem; +pub mod inline_object; +pub use self::inline_object::InlineObject; +pub mod inline_object_1; +pub use self::inline_object_1::InlineObject1; pub mod inline_response_200; pub use self::inline_response_200::InlineResponse200; pub mod inline_response_200_1; @@ -694,6 +702,8 @@ pub mod schemas_snippet_response; pub use self::schemas_snippet_response::SchemasSnippetResponse; pub mod schemas_user_response; pub use self::schemas_user_response::SchemasUserResponse; +pub mod schemas_vcl_response; +pub use self::schemas_vcl_response::SchemasVclResponse; pub mod schemas_version; pub use self::schemas_version::SchemasVersion; pub mod schemas_version_response; @@ -928,6 +938,8 @@ pub mod token_response; pub use self::token_response::TokenResponse; pub mod token_response_all_of; pub use self::token_response_all_of::TokenResponseAllOf; +pub mod tokens_additional_props; +pub use self::tokens_additional_props::TokensAdditionalProps; pub mod type_billing_address; pub use self::type_billing_address::TypeBillingAddress; pub mod type_contact; @@ -990,12 +1002,22 @@ pub mod user_response; pub use self::user_response::UserResponse; pub mod user_response_all_of; pub use self::user_response_all_of::UserResponseAllOf; +pub mod validator_result; +pub use self::validator_result::ValidatorResult; +pub mod validator_result_data; +pub use self::validator_result_data::ValidatorResultData; +pub mod validator_result_data_attributes; +pub use self::validator_result_data_attributes::ValidatorResultDataAttributes; +pub mod validator_result_data_attributes_messages; +pub use self::validator_result_data_attributes_messages::ValidatorResultDataAttributesMessages; pub mod vcl; pub use self::vcl::Vcl; pub mod vcl_diff; pub use self::vcl_diff::VclDiff; pub mod vcl_response; pub use self::vcl_response::VclResponse; +pub mod vcl_syntax_highlighting_response; +pub use self::vcl_syntax_highlighting_response::VclSyntaxHighlightingResponse; pub mod version; pub use self::version::Version; pub mod version_create_response; diff --git a/src/models/schemas_snippet_response.rs b/src/models/schemas_snippet_response.rs index 523107f..f5117ef 100644 --- a/src/models/schemas_snippet_response.rs +++ b/src/models/schemas_snippet_response.rs @@ -65,14 +65,14 @@ impl SchemasSnippetResponse { #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Dynamic { #[serde(rename = "0")] - Dynamic0, + Regular, #[serde(rename = "1")] - Dynamic1, + Dynamic, } impl Default for Dynamic { fn default() -> Dynamic { - Self::Dynamic0 + Self::Regular } } /// The location in generated VCL where the snippet should be placed. diff --git a/src/models/schemas_vcl_response.rs b/src/models/schemas_vcl_response.rs new file mode 100644 index 0000000..934f2a2 --- /dev/null +++ b/src/models/schemas_vcl_response.rs @@ -0,0 +1,52 @@ +/* + * 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/) + * + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct SchemasVclResponse { + /// The VCL code to be included. + #[serde(rename = "content", skip_serializing_if = "Option::is_none")] + pub content: Option, + /// Set to `true` when this is the main VCL, otherwise `false`. + #[serde(rename = "main", skip_serializing_if = "Option::is_none")] + pub main: Option, + /// The name of this VCL. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "service_id", skip_serializing_if = "Option::is_none")] + pub service_id: Option>, + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option>, + /// Date and time in ISO 8601 format. + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + /// Date and time in ISO 8601 format. + #[serde(rename = "deleted_at", skip_serializing_if = "Option::is_none")] + pub deleted_at: Option, + /// Date and time in ISO 8601 format. + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, +} + +impl SchemasVclResponse { + pub fn new() -> SchemasVclResponse { + SchemasVclResponse { + content: None, + main: None, + name: None, + service_id: None, + version: None, + created_at: None, + deleted_at: None, + updated_at: None, + } + } +} + + diff --git a/src/models/service_version_detail.rs b/src/models/service_version_detail.rs index 0186ed7..dddc389 100644 --- a/src/models/service_version_detail.rs +++ b/src/models/service_version_detail.rs @@ -79,7 +79,7 @@ pub struct ServiceVersionDetail { pub snippets: Option>, /// List of VCL files for this service. #[serde(rename = "vcls", skip_serializing_if = "Option::is_none")] - pub vcls: Option>, + pub vcls: Option>, /// A list of Wordpress rules with this service. #[serde(rename = "wordpress", skip_serializing_if = "Option::is_none")] pub wordpress: Option>, diff --git a/src/models/service_version_detail_or_null.rs b/src/models/service_version_detail_or_null.rs index fe162d6..f229737 100644 --- a/src/models/service_version_detail_or_null.rs +++ b/src/models/service_version_detail_or_null.rs @@ -79,7 +79,7 @@ pub struct ServiceVersionDetailOrNull { pub snippets: Option>, /// List of VCL files for this service. #[serde(rename = "vcls", skip_serializing_if = "Option::is_none")] - pub vcls: Option>, + pub vcls: Option>, /// A list of Wordpress rules with this service. #[serde(rename = "wordpress", skip_serializing_if = "Option::is_none")] pub wordpress: Option>, diff --git a/src/models/snippet.rs b/src/models/snippet.rs index 0a63752..fd44907 100644 --- a/src/models/snippet.rs +++ b/src/models/snippet.rs @@ -43,14 +43,14 @@ impl Snippet { #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Dynamic { #[serde(rename = "0")] - Dynamic0, + Regular, #[serde(rename = "1")] - Dynamic1, + Dynamic, } impl Default for Dynamic { fn default() -> Dynamic { - Self::Dynamic0 + Self::Regular } } /// The location in generated VCL where the snippet should be placed. diff --git a/src/models/snippet_response.rs b/src/models/snippet_response.rs index 604dbc8..4b0ccf0 100644 --- a/src/models/snippet_response.rs +++ b/src/models/snippet_response.rs @@ -65,14 +65,14 @@ impl SnippetResponse { #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Dynamic { #[serde(rename = "0")] - Dynamic0, + Regular, #[serde(rename = "1")] - Dynamic1, + Dynamic, } impl Default for Dynamic { fn default() -> Dynamic { - Self::Dynamic0 + Self::Regular } } /// The location in generated VCL where the snippet should be placed. diff --git a/src/models/tokens_additional_props.rs b/src/models/tokens_additional_props.rs new file mode 100644 index 0000000..0461b0b --- /dev/null +++ b/src/models/tokens_additional_props.rs @@ -0,0 +1,22 @@ +/* + * 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/) + * + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct TokensAdditionalProps { +} + +impl TokensAdditionalProps { + pub fn new() -> TokensAdditionalProps { + TokensAdditionalProps { + } + } +} + + diff --git a/src/models/validator_result.rs b/src/models/validator_result.rs new file mode 100644 index 0000000..2e8b3be --- /dev/null +++ b/src/models/validator_result.rs @@ -0,0 +1,27 @@ +/* + * 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/) + * + */ + +/// ValidatorResult : Results from VCL linting + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct ValidatorResult { + #[serde(rename = "data", skip_serializing_if = "Option::is_none")] + pub data: Option>, +} + +impl ValidatorResult { + /// Results from VCL linting + pub fn new() -> ValidatorResult { + ValidatorResult { + data: None, + } + } +} + + diff --git a/src/models/validator_result_data.rs b/src/models/validator_result_data.rs new file mode 100644 index 0000000..dfc6ee8 --- /dev/null +++ b/src/models/validator_result_data.rs @@ -0,0 +1,31 @@ +/* + * 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/) + * + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct ValidatorResultData { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub _type: Option, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, +} + +impl ValidatorResultData { + pub fn new() -> ValidatorResultData { + ValidatorResultData { + id: None, + _type: None, + attributes: None, + } + } +} + + diff --git a/src/models/validator_result_data_attributes.rs b/src/models/validator_result_data_attributes.rs new file mode 100644 index 0000000..3dc676b --- /dev/null +++ b/src/models/validator_result_data_attributes.rs @@ -0,0 +1,51 @@ +/* + * 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/) + * + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct ValidatorResultDataAttributes { + #[serde(rename = "msg", skip_serializing_if = "Option::is_none")] + pub msg: Option, + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + #[serde(rename = "errors", skip_serializing_if = "Option::is_none")] + pub errors: Option>, + #[serde(rename = "warnings", skip_serializing_if = "Option::is_none")] + pub warnings: Option>, + #[serde(rename = "messages", skip_serializing_if = "Option::is_none")] + pub messages: Option>, +} + +impl ValidatorResultDataAttributes { + pub fn new() -> ValidatorResultDataAttributes { + ValidatorResultDataAttributes { + msg: None, + status: None, + errors: None, + warnings: None, + messages: None, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "error")] + Error, + #[serde(rename = "ok")] + Ok, +} + +impl Default for Status { + fn default() -> Status { + Self::Error + } +} + diff --git a/src/models/validator_result_data_attributes_messages.rs b/src/models/validator_result_data_attributes_messages.rs new file mode 100644 index 0000000..16f962d --- /dev/null +++ b/src/models/validator_result_data_attributes_messages.rs @@ -0,0 +1,34 @@ +/* + * 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/) + * + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct ValidatorResultDataAttributesMessages { + #[serde(rename = "type")] + pub _type: String, + #[serde(rename = "warning")] + pub warning: bool, + #[serde(rename = "message")] + pub message: String, + #[serde(rename = "tokens")] + pub tokens: Vec<::std::collections::HashMap>, +} + +impl ValidatorResultDataAttributesMessages { + pub fn new(_type: String, warning: bool, message: String, tokens: Vec<::std::collections::HashMap>) -> ValidatorResultDataAttributesMessages { + ValidatorResultDataAttributesMessages { + _type, + warning, + message, + tokens, + } + } +} + + diff --git a/src/models/vcl_syntax_highlighting_response.rs b/src/models/vcl_syntax_highlighting_response.rs new file mode 100644 index 0000000..f352c21 --- /dev/null +++ b/src/models/vcl_syntax_highlighting_response.rs @@ -0,0 +1,26 @@ +/* + * 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/) + * + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct VclSyntaxHighlightingResponse { + /// VCL with HTML syntax highlighting. + #[serde(rename = "content", skip_serializing_if = "Option::is_none")] + pub content: Option, +} + +impl VclSyntaxHighlightingResponse { + pub fn new() -> VclSyntaxHighlightingResponse { + VclSyntaxHighlightingResponse { + content: None, + } + } +} + + diff --git a/src/models/version_detail.rs b/src/models/version_detail.rs index fc29aff..f31698f 100644 --- a/src/models/version_detail.rs +++ b/src/models/version_detail.rs @@ -47,7 +47,7 @@ pub struct VersionDetail { pub snippets: Option>, /// List of VCL files for this service. #[serde(rename = "vcls", skip_serializing_if = "Option::is_none")] - pub vcls: Option>, + pub vcls: Option>, /// A list of Wordpress rules with this service. #[serde(rename = "wordpress", skip_serializing_if = "Option::is_none")] pub wordpress: Option>,