fastly 6.0.2 → 7.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +32 -0
- data/Gemfile.lock +1 -1
- data/README.md +7 -2
- data/docs/Backend.md +1 -0
- data/docs/BackendApi.md +4 -0
- data/docs/BackendResponse.md +1 -0
- data/docs/CacheSetting.md +2 -2
- data/docs/CacheSettingResponse.md +3 -3
- data/docs/CacheSettingsApi.md +8 -8
- data/docs/DomainApi.md +2 -2
- data/docs/GzipResponse.md +1 -1
- data/docs/Header.md +0 -2
- data/docs/HeaderApi.md +8 -8
- data/docs/HeaderResponse.md +3 -3
- data/docs/HeaderResponseAdditional.md +11 -0
- data/docs/{LoggingAzureblobAllOf.md → LoggingAzureblobAdditional.md} +1 -1
- data/docs/LoggingAzureblobApi.md +8 -8
- data/docs/LoggingAzureblobResponse.md +8 -8
- data/docs/{LoggingBigqueryAllOf.md → LoggingBigqueryAdditional.md} +1 -1
- data/docs/LoggingBigqueryApi.md +4 -4
- data/docs/LoggingBigqueryResponse.md +2 -2
- data/docs/{LoggingCloudfilesAllOf.md → LoggingCloudfilesAdditional.md} +1 -1
- data/docs/LoggingCloudfilesApi.md +8 -8
- data/docs/LoggingCloudfilesResponse.md +8 -8
- data/docs/LoggingCommon.md +0 -1
- data/docs/{LoggingPapertrail.md → LoggingCommonResponse.md} +2 -4
- data/docs/{LoggingLogshuttle.md → LoggingCommonResponseAllOf.md} +1 -4
- data/docs/LoggingCommonResponseAllOf1.md +10 -0
- data/docs/{LoggingDatadogAllOf.md → LoggingDatadogAdditional.md} +1 -1
- data/docs/LoggingDatadogApi.md +4 -4
- data/docs/LoggingDatadogResponse.md +2 -2
- data/docs/{LoggingDigitaloceanAllOf.md → LoggingDigitaloceanAdditional.md} +1 -1
- data/docs/LoggingDigitaloceanApi.md +8 -8
- data/docs/LoggingDigitaloceanResponse.md +8 -8
- data/docs/{LoggingElasticsearchAllOf.md → LoggingElasticsearchAdditional.md} +1 -1
- data/docs/LoggingElasticsearchApi.md +4 -4
- data/docs/LoggingElasticsearchResponse.md +2 -2
- data/docs/LoggingFormatVersionInteger.md +10 -0
- data/docs/LoggingFormatVersionString.md +10 -0
- data/docs/{LoggingFtpAllOf.md → LoggingFtpAdditional.md} +1 -2
- data/docs/LoggingFtpApi.md +12 -12
- data/docs/LoggingFtpResponse.md +9 -9
- data/docs/{LoggingFormatVersion.md → LoggingFtpResponseAllOf.md} +2 -1
- data/docs/{LoggingGcsAllOf.md → LoggingGcsAdditional.md} +1 -1
- data/docs/LoggingGcsApi.md +8 -8
- data/docs/LoggingGcsResponse.md +8 -8
- data/docs/LoggingGenericCommon.md +0 -2
- data/docs/LoggingGenericCommonResponse.md +14 -0
- data/docs/LoggingGenericCommonResponseAllOf.md +12 -0
- data/docs/LoggingGenericCommonResponseAllOf1.md +11 -0
- data/docs/{LoggingGooglePubsubAllOf.md → LoggingGooglePubsubAdditional.md} +1 -1
- data/docs/LoggingGooglePubsubResponse.md +2 -2
- data/docs/{LoggingHerokuAllOf.md → LoggingHerokuAdditional.md} +1 -1
- data/docs/LoggingHerokuApi.md +4 -4
- data/docs/LoggingHerokuResponse.md +2 -2
- data/docs/{LoggingHoneycombAllOf.md → LoggingHoneycombAdditional.md} +1 -1
- data/docs/LoggingHoneycombApi.md +8 -8
- data/docs/LoggingHoneycombResponse.md +2 -2
- data/docs/{LoggingHttpsAllOf.md → LoggingHttpsAdditional.md} +1 -1
- data/docs/LoggingHttpsApi.md +4 -4
- data/docs/LoggingHttpsResponse.md +2 -2
- data/docs/{LoggingKafkaAllOf.md → LoggingKafkaAdditional.md} +1 -1
- data/docs/LoggingKafkaApi.md +4 -4
- data/docs/LoggingKafkaResponse.md +6 -6
- data/docs/{LoggingKafka.md → LoggingKafkaResponsePost.md} +7 -2
- data/docs/{LoggingKinesis.md → LoggingKinesisAdditional.md} +1 -2
- data/docs/LoggingKinesisApi.md +2 -2
- data/docs/LoggingKinesisResponse.md +2 -2
- data/docs/{LoggingLogentriesAllOf.md → LoggingLogentriesAdditional.md} +1 -1
- data/docs/LoggingLogentriesApi.md +4 -4
- data/docs/LoggingLogentriesResponse.md +2 -2
- data/docs/{LoggingLogglyAllOf.md → LoggingLogglyAdditional.md} +1 -1
- data/docs/LoggingLogglyApi.md +4 -4
- data/docs/LoggingLogglyResponse.md +2 -2
- data/docs/{LoggingLogshuttleAllOf.md → LoggingLogshuttleAdditional.md} +1 -1
- data/docs/LoggingLogshuttleApi.md +4 -4
- data/docs/LoggingLogshuttleResponse.md +2 -2
- data/docs/{LoggingNewrelicAllOf.md → LoggingNewrelicAdditional.md} +1 -1
- data/docs/LoggingNewrelicApi.md +4 -4
- data/docs/LoggingNewrelicResponse.md +2 -2
- data/docs/LoggingNewrelicotlpAdditional.md +13 -0
- data/docs/LoggingNewrelicotlpApi.md +252 -0
- data/docs/LoggingNewrelicotlpResponse.md +22 -0
- data/docs/{LoggingOpenstackAllOf.md → LoggingOpenstackAdditional.md} +1 -1
- data/docs/LoggingOpenstackApi.md +8 -8
- data/docs/LoggingOpenstackResponse.md +8 -8
- data/docs/LoggingPapertrailApi.md +4 -4
- data/docs/LoggingPapertrailResponse.md +2 -2
- data/docs/LoggingPubsubApi.md +4 -4
- data/docs/{LoggingS3AllOf.md → LoggingS3Additional.md} +1 -1
- data/docs/LoggingS3Api.md +8 -8
- data/docs/LoggingS3Response.md +8 -8
- data/docs/{LoggingScalyrAllOf.md → LoggingScalyrAdditional.md} +1 -1
- data/docs/LoggingScalyrApi.md +4 -4
- data/docs/LoggingScalyrResponse.md +2 -2
- data/docs/{LoggingSftpAllOf.md → LoggingSftpAdditional.md} +1 -2
- data/docs/LoggingSftpApi.md +8 -8
- data/docs/LoggingSftpResponse.md +10 -10
- data/docs/LoggingSftpResponseAllOf.md +13 -0
- data/docs/{LoggingSplunkAllOf.md → LoggingSplunkAdditional.md} +1 -1
- data/docs/LoggingSplunkApi.md +4 -4
- data/docs/LoggingSplunkResponse.md +2 -2
- data/docs/{LoggingSumologicAllOf.md → LoggingSumologicAdditional.md} +1 -1
- data/docs/LoggingSumologicApi.md +4 -4
- data/docs/LoggingSumologicResponse.md +2 -2
- data/docs/{LoggingSyslogAllOf.md → LoggingSyslogAdditional.md} +1 -1
- data/docs/LoggingSyslogApi.md +4 -4
- data/docs/LoggingSyslogResponse.md +2 -2
- data/docs/{PoolAllOf.md → PoolAdditional.md} +1 -6
- data/docs/PoolApi.md +46 -22
- data/docs/PoolResponse.md +12 -11
- data/docs/PoolResponseAllOf.md +1 -1
- data/docs/PoolResponseCommon.md +15 -0
- data/docs/{Pool.md → PoolResponsePost.md} +14 -7
- data/docs/PoolResponsePostAllOf.md +10 -0
- data/docs/RequestSettingsAdditional.md +15 -0
- data/docs/RequestSettingsApi.md +10 -10
- data/docs/RequestSettingsResponse.md +11 -11
- data/docs/RequestSettingsResponseAllOf.md +15 -0
- data/docs/ResponseObject.md +1 -1
- data/docs/ResponseObjectResponse.md +2 -2
- data/docs/SecretStoreApi.md +3 -3
- data/docs/ServiceIdAndVersionString.md +11 -0
- data/docs/TlsCommonResponse.md +14 -0
- data/docs/{TlsCommon.md → TlsCommonResponseAllOf.md} +1 -2
- data/docs/TlsCommonResponseAllOf1.md +10 -0
- data/docs/TlsDomainsApi.md +2 -2
- data/docs/TlsSubscriptionsApi.md +4 -4
- data/lib/fastly/api/backend_api.rb +16 -0
- data/lib/fastly/api/cache_settings_api.rb +8 -8
- data/lib/fastly/api/domain_api.rb +3 -3
- data/lib/fastly/api/header_api.rb +12 -12
- data/lib/fastly/api/logging_azureblob_api.rb +12 -12
- data/lib/fastly/api/logging_bigquery_api.rb +6 -6
- data/lib/fastly/api/logging_cloudfiles_api.rb +12 -12
- data/lib/fastly/api/logging_datadog_api.rb +6 -6
- data/lib/fastly/api/logging_digitalocean_api.rb +12 -12
- data/lib/fastly/api/logging_elasticsearch_api.rb +6 -6
- data/lib/fastly/api/logging_ftp_api.rb +18 -18
- data/lib/fastly/api/logging_gcs_api.rb +12 -12
- data/lib/fastly/api/logging_heroku_api.rb +6 -6
- data/lib/fastly/api/logging_honeycomb_api.rb +12 -12
- data/lib/fastly/api/logging_https_api.rb +6 -6
- data/lib/fastly/api/logging_kafka_api.rb +6 -6
- data/lib/fastly/api/logging_kinesis_api.rb +7 -3
- data/lib/fastly/api/logging_logentries_api.rb +6 -6
- data/lib/fastly/api/logging_loggly_api.rb +6 -6
- data/lib/fastly/api/logging_logshuttle_api.rb +6 -6
- data/lib/fastly/api/logging_newrelic_api.rb +6 -6
- data/lib/fastly/api/logging_newrelicotlp_api.rb +473 -0
- data/lib/fastly/api/logging_openstack_api.rb +12 -12
- data/lib/fastly/api/logging_papertrail_api.rb +6 -6
- data/lib/fastly/api/logging_pubsub_api.rb +6 -6
- data/lib/fastly/api/logging_s3_api.rb +12 -12
- data/lib/fastly/api/logging_scalyr_api.rb +6 -6
- data/lib/fastly/api/logging_sftp_api.rb +12 -12
- data/lib/fastly/api/logging_splunk_api.rb +6 -6
- data/lib/fastly/api/logging_sumologic_api.rb +6 -6
- data/lib/fastly/api/logging_syslog_api.rb +6 -6
- data/lib/fastly/api/pool_api.rb +77 -41
- data/lib/fastly/api/rate_limiter_api.rb +2 -2
- data/lib/fastly/api/request_settings_api.rb +15 -15
- data/lib/fastly/api/secret_store_api.rb +2 -2
- data/lib/fastly/api/tls_domains_api.rb +2 -2
- data/lib/fastly/api/tls_subscriptions_api.rb +4 -4
- data/lib/fastly/configuration.rb +30 -0
- data/lib/fastly/models/backend.rb +29 -1
- data/lib/fastly/models/backend_response.rb +29 -1
- data/lib/fastly/models/cache_setting.rb +2 -2
- data/lib/fastly/models/cache_setting_response.rb +4 -4
- data/lib/fastly/models/gzip_response.rb +2 -2
- data/lib/fastly/models/header.rb +1 -23
- data/lib/fastly/models/header_response.rb +26 -25
- data/lib/fastly/models/header_response_additional.rb +229 -0
- data/lib/fastly/models/{logging_azureblob_all_of.rb → logging_azureblob_additional.rb} +3 -3
- data/lib/fastly/models/logging_azureblob_response.rb +82 -80
- data/lib/fastly/models/{logging_bigquery_all_of.rb → logging_bigquery_additional.rb} +3 -3
- data/lib/fastly/models/logging_bigquery_response.rb +20 -18
- data/lib/fastly/models/{logging_cloudfiles_all_of.rb → logging_cloudfiles_additional.rb} +3 -3
- data/lib/fastly/models/logging_cloudfiles_response.rb +83 -81
- data/lib/fastly/models/logging_common.rb +1 -25
- data/lib/fastly/models/{logging_loggly.rb → logging_common_response.rb} +17 -27
- data/lib/fastly/models/{logging_logshuttle.rb → logging_common_response_all_of.rb} +7 -60
- data/lib/fastly/models/logging_common_response_all_of1.rb +253 -0
- data/lib/fastly/models/{logging_datadog_all_of.rb → logging_datadog_additional.rb} +3 -3
- data/lib/fastly/models/logging_datadog_response.rb +19 -18
- data/lib/fastly/models/{logging_digitalocean_all_of.rb → logging_digitalocean_additional.rb} +3 -3
- data/lib/fastly/models/logging_digitalocean_response.rb +82 -80
- data/lib/fastly/models/{logging_elasticsearch_all_of.rb → logging_elasticsearch_additional.rb} +3 -3
- data/lib/fastly/models/logging_elasticsearch_response.rb +21 -18
- data/lib/fastly/models/logging_format_version_integer.rb +253 -0
- data/lib/fastly/models/logging_format_version_string.rb +253 -0
- data/lib/fastly/models/{logging_ftp_all_of.rb → logging_ftp_additional.rb} +4 -16
- data/lib/fastly/models/logging_ftp_response.rb +88 -85
- data/lib/fastly/models/logging_ftp_response_all_of.rb +219 -0
- data/lib/fastly/models/{logging_gcs_all_of.rb → logging_gcs_additional.rb} +3 -3
- data/lib/fastly/models/logging_gcs_response.rb +80 -77
- data/lib/fastly/models/logging_generic_common.rb +1 -25
- data/lib/fastly/models/{logging_sumologic.rb → logging_generic_common_response.rb} +60 -80
- data/lib/fastly/models/logging_generic_common_response_all_of.rb +286 -0
- data/lib/fastly/models/logging_generic_common_response_all_of1.rb +231 -0
- data/lib/fastly/models/{logging_google_pubsub_all_of.rb → logging_google_pubsub_additional.rb} +3 -3
- data/lib/fastly/models/logging_google_pubsub_response.rb +20 -18
- data/lib/fastly/models/{logging_heroku_all_of.rb → logging_heroku_additional.rb} +3 -3
- data/lib/fastly/models/logging_heroku_response.rb +19 -18
- data/lib/fastly/models/{logging_honeycomb_all_of.rb → logging_honeycomb_additional.rb} +3 -3
- data/lib/fastly/models/logging_honeycomb_response.rb +19 -18
- data/lib/fastly/models/{logging_https_all_of.rb → logging_https_additional.rb} +3 -3
- data/lib/fastly/models/logging_https_response.rb +21 -18
- data/lib/fastly/models/{logging_kafka_all_of.rb → logging_kafka_additional.rb} +3 -3
- data/lib/fastly/models/logging_kafka_response.rb +71 -69
- data/lib/fastly/models/{logging_kafka.rb → logging_kafka_response_post.rb} +72 -18
- data/lib/fastly/models/{logging_kinesis.rb → logging_kinesis_additional.rb} +4 -15
- data/lib/fastly/models/logging_kinesis_response.rb +51 -15
- data/lib/fastly/models/{logging_logentries_all_of.rb → logging_logentries_additional.rb} +3 -3
- data/lib/fastly/models/logging_logentries_response.rb +19 -18
- data/lib/fastly/models/{logging_loggly_all_of.rb → logging_loggly_additional.rb} +3 -3
- data/lib/fastly/models/logging_loggly_response.rb +19 -18
- data/lib/fastly/models/{logging_logshuttle_all_of.rb → logging_logshuttle_additional.rb} +3 -3
- data/lib/fastly/models/logging_logshuttle_response.rb +19 -18
- data/lib/fastly/models/{logging_newrelic_all_of.rb → logging_newrelic_additional.rb} +3 -3
- data/lib/fastly/models/logging_newrelic_response.rb +19 -18
- data/lib/fastly/models/logging_newrelicotlp_additional.rb +288 -0
- data/lib/fastly/models/{logging_newrelic.rb → logging_newrelicotlp_response.rb} +90 -24
- data/lib/fastly/models/{logging_openstack_all_of.rb → logging_openstack_additional.rb} +3 -3
- data/lib/fastly/models/logging_openstack_response.rb +82 -80
- data/lib/fastly/models/logging_papertrail_response.rb +19 -18
- data/lib/fastly/models/{logging_s3_all_of.rb → logging_s3_additional.rb} +3 -3
- data/lib/fastly/models/logging_s3_response.rb +84 -82
- data/lib/fastly/models/{logging_scalyr_all_of.rb → logging_scalyr_additional.rb} +3 -3
- data/lib/fastly/models/logging_scalyr_response.rb +19 -18
- data/lib/fastly/models/{logging_sftp_all_of.rb → logging_sftp_additional.rb} +4 -16
- data/lib/fastly/models/logging_sftp_response.rb +97 -94
- data/lib/fastly/models/{domain_check_item.rb → logging_sftp_response_all_of.rb} +44 -40
- data/lib/fastly/models/{logging_splunk_all_of.rb → logging_splunk_additional.rb} +3 -3
- data/lib/fastly/models/logging_splunk_response.rb +21 -18
- data/lib/fastly/models/{logging_sumologic_all_of.rb → logging_sumologic_additional.rb} +3 -3
- data/lib/fastly/models/logging_sumologic_response.rb +19 -18
- data/lib/fastly/models/{logging_syslog_all_of.rb → logging_syslog_additional.rb} +3 -3
- data/lib/fastly/models/logging_syslog_response.rb +21 -18
- data/lib/fastly/models/{pool_all_of.rb → pool_additional.rb} +4 -83
- data/lib/fastly/models/pool_response.rb +113 -125
- data/lib/fastly/models/pool_response_all_of.rb +10 -7
- data/lib/fastly/models/pool_response_common.rb +269 -0
- data/lib/fastly/models/{pool.rb → pool_response_post.rb} +142 -92
- data/lib/fastly/models/pool_response_post_all_of.rb +219 -0
- data/lib/fastly/models/rate_limiter.rb +2 -2
- data/lib/fastly/models/rate_limiter_response.rb +2 -2
- data/lib/fastly/models/{request_settings.rb → request_settings_additional.rb} +4 -64
- data/lib/fastly/models/request_settings_response.rb +96 -95
- data/lib/fastly/models/request_settings_response_all_of.rb +267 -0
- data/lib/fastly/models/response_object.rb +2 -2
- data/lib/fastly/models/response_object_response.rb +4 -4
- data/lib/fastly/models/{tls_subscription_response_data_all_of.rb → service_id_and_version_string.rb} +16 -16
- data/lib/fastly/models/{tls_common.rb → tls_common_response.rb} +15 -7
- data/lib/fastly/models/tls_common_response_all_of.rb +259 -0
- data/lib/fastly/models/tls_common_response_all_of1.rb +253 -0
- data/lib/fastly/models/tls_subscription_response_data.rb +0 -7
- data/lib/fastly/version.rb +1 -1
- data/lib/fastly.rb +50 -57
- data/sig.json +1 -1
- metadata +102 -116
- data/docs/DomainCheckItem.md +0 -11
- data/docs/LoggingAzureblob.md +0 -25
- data/docs/LoggingBigquery.md +0 -21
- data/docs/LoggingCloudfiles.md +0 -25
- data/docs/LoggingDatadog.md +0 -16
- data/docs/LoggingDigitalocean.md +0 -25
- data/docs/LoggingElasticsearch.md +0 -25
- data/docs/LoggingFtp.md +0 -27
- data/docs/LoggingGcs.md +0 -26
- data/docs/LoggingGooglePubsub.md +0 -19
- data/docs/LoggingHeroku.md +0 -16
- data/docs/LoggingHoneycomb.md +0 -16
- data/docs/LoggingHttps.md +0 -27
- data/docs/LoggingLogentries.md +0 -18
- data/docs/LoggingLoggly.md +0 -15
- data/docs/LoggingNewrelic.md +0 -16
- data/docs/LoggingOpenstack.md +0 -25
- data/docs/LoggingS3.md +0 -30
- data/docs/LoggingScalyr.md +0 -17
- data/docs/LoggingSftp.md +0 -27
- data/docs/LoggingSplunk.md +0 -23
- data/docs/LoggingSumologic.md +0 -16
- data/docs/LoggingSyslog.md +0 -25
- data/docs/RequestSettings.md +0 -21
- data/docs/TlsSubscriptionResponseDataAllOf.md +0 -11
- data/lib/fastly/models/logging_azureblob.rb +0 -480
- data/lib/fastly/models/logging_bigquery.rb +0 -387
- data/lib/fastly/models/logging_cloudfiles.rb +0 -478
- data/lib/fastly/models/logging_datadog.rb +0 -351
- data/lib/fastly/models/logging_digitalocean.rb +0 -467
- data/lib/fastly/models/logging_elasticsearch.rb +0 -446
- data/lib/fastly/models/logging_format_version.rb +0 -35
- data/lib/fastly/models/logging_ftp.rb +0 -484
- data/lib/fastly/models/logging_gcs.rb +0 -474
- data/lib/fastly/models/logging_google_pubsub.rb +0 -368
- data/lib/fastly/models/logging_heroku.rb +0 -337
- data/lib/fastly/models/logging_honeycomb.rb +0 -335
- data/lib/fastly/models/logging_https.rb +0 -501
- data/lib/fastly/models/logging_logentries.rb +0 -372
- data/lib/fastly/models/logging_openstack.rb +0 -465
- data/lib/fastly/models/logging_papertrail.rb +0 -339
- data/lib/fastly/models/logging_s3.rb +0 -527
- data/lib/fastly/models/logging_scalyr.rb +0 -363
- data/lib/fastly/models/logging_sftp.rb +0 -491
- data/lib/fastly/models/logging_splunk.rb +0 -426
- data/lib/fastly/models/logging_syslog.rb +0 -449
@@ -1,368 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Fastly API
|
3
|
-
|
4
|
-
#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/)
|
5
|
-
|
6
|
-
The version of the OpenAPI document: 1.0.0
|
7
|
-
Contact: oss@fastly.com
|
8
|
-
|
9
|
-
=end
|
10
|
-
|
11
|
-
require 'date'
|
12
|
-
require 'time'
|
13
|
-
|
14
|
-
module Fastly
|
15
|
-
class LoggingGooglePubsub
|
16
|
-
# The name for the real-time logging configuration.
|
17
|
-
attr_accessor :name
|
18
|
-
|
19
|
-
# Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`.
|
20
|
-
attr_accessor :placement
|
21
|
-
|
22
|
-
# The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`.
|
23
|
-
attr_accessor :format_version
|
24
|
-
|
25
|
-
# The name of an existing condition in the configured endpoint, or leave blank to always execute.
|
26
|
-
attr_accessor :response_condition
|
27
|
-
|
28
|
-
# A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats).
|
29
|
-
attr_accessor :format
|
30
|
-
|
31
|
-
# Your Google Cloud Platform service account email address. The `client_email` field in your service account authentication JSON. Not required if `account_name` is specified.
|
32
|
-
attr_accessor :user
|
33
|
-
|
34
|
-
# Your Google Cloud Platform account secret key. The `private_key` field in your service account authentication JSON. Not required if `account_name` is specified.
|
35
|
-
attr_accessor :secret_key
|
36
|
-
|
37
|
-
# The name of the Google Cloud Platform service account associated with the target log collection service. Not required if `user` and `secret_key` are provided.
|
38
|
-
attr_accessor :account_name
|
39
|
-
|
40
|
-
# The Google Cloud Pub/Sub topic to which logs will be published. Required.
|
41
|
-
attr_accessor :topic
|
42
|
-
|
43
|
-
# Your Google Cloud Platform project ID. Required
|
44
|
-
attr_accessor :project_id
|
45
|
-
|
46
|
-
class EnumAttributeValidator
|
47
|
-
attr_reader :datatype
|
48
|
-
attr_reader :allowable_values
|
49
|
-
|
50
|
-
def initialize(datatype, allowable_values)
|
51
|
-
@allowable_values = allowable_values.map do |value|
|
52
|
-
case datatype.to_s
|
53
|
-
when /Integer/i
|
54
|
-
value.to_i
|
55
|
-
when /Float/i
|
56
|
-
value.to_f
|
57
|
-
else
|
58
|
-
value
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
def valid?(value)
|
64
|
-
!value || allowable_values.include?(value)
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
69
|
-
def self.attribute_map
|
70
|
-
{
|
71
|
-
:'name' => :'name',
|
72
|
-
:'placement' => :'placement',
|
73
|
-
:'format_version' => :'format_version',
|
74
|
-
:'response_condition' => :'response_condition',
|
75
|
-
:'format' => :'format',
|
76
|
-
:'user' => :'user',
|
77
|
-
:'secret_key' => :'secret_key',
|
78
|
-
:'account_name' => :'account_name',
|
79
|
-
:'topic' => :'topic',
|
80
|
-
:'project_id' => :'project_id'
|
81
|
-
}
|
82
|
-
end
|
83
|
-
|
84
|
-
# Returns all the JSON keys this model knows about
|
85
|
-
def self.acceptable_attributes
|
86
|
-
attribute_map.values
|
87
|
-
end
|
88
|
-
|
89
|
-
# Attribute type mapping.
|
90
|
-
def self.fastly_types
|
91
|
-
{
|
92
|
-
:'name' => :'String',
|
93
|
-
:'placement' => :'String',
|
94
|
-
:'format_version' => :'Integer',
|
95
|
-
:'response_condition' => :'String',
|
96
|
-
:'format' => :'String',
|
97
|
-
:'user' => :'String',
|
98
|
-
:'secret_key' => :'String',
|
99
|
-
:'account_name' => :'String',
|
100
|
-
:'topic' => :'String',
|
101
|
-
:'project_id' => :'String'
|
102
|
-
}
|
103
|
-
end
|
104
|
-
|
105
|
-
# List of attributes with nullable: true
|
106
|
-
def self.fastly_nullable
|
107
|
-
Set.new([
|
108
|
-
:'placement',
|
109
|
-
:'response_condition',
|
110
|
-
])
|
111
|
-
end
|
112
|
-
|
113
|
-
# List of class defined in allOf (OpenAPI v3)
|
114
|
-
def self.fastly_all_of
|
115
|
-
[
|
116
|
-
:'LoggingCommon',
|
117
|
-
:'LoggingGcsCommon',
|
118
|
-
:'LoggingGooglePubsubAllOf'
|
119
|
-
]
|
120
|
-
end
|
121
|
-
|
122
|
-
# Initializes the object
|
123
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
124
|
-
def initialize(attributes = {})
|
125
|
-
if (!attributes.is_a?(Hash))
|
126
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::LoggingGooglePubsub` initialize method"
|
127
|
-
end
|
128
|
-
|
129
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
130
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
131
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
132
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::LoggingGooglePubsub`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
133
|
-
end
|
134
|
-
h[k.to_sym] = v
|
135
|
-
}
|
136
|
-
|
137
|
-
if attributes.key?(:'name')
|
138
|
-
self.name = attributes[:'name']
|
139
|
-
end
|
140
|
-
|
141
|
-
if attributes.key?(:'placement')
|
142
|
-
self.placement = attributes[:'placement']
|
143
|
-
end
|
144
|
-
|
145
|
-
if attributes.key?(:'format_version')
|
146
|
-
self.format_version = attributes[:'format_version']
|
147
|
-
else
|
148
|
-
self.format_version = FORMAT_VERSION::v2
|
149
|
-
end
|
150
|
-
|
151
|
-
if attributes.key?(:'response_condition')
|
152
|
-
self.response_condition = attributes[:'response_condition']
|
153
|
-
end
|
154
|
-
|
155
|
-
if attributes.key?(:'format')
|
156
|
-
self.format = attributes[:'format']
|
157
|
-
else
|
158
|
-
self.format = '%h %l %u %t \"%r\" %>s %b'
|
159
|
-
end
|
160
|
-
|
161
|
-
if attributes.key?(:'user')
|
162
|
-
self.user = attributes[:'user']
|
163
|
-
end
|
164
|
-
|
165
|
-
if attributes.key?(:'secret_key')
|
166
|
-
self.secret_key = attributes[:'secret_key']
|
167
|
-
end
|
168
|
-
|
169
|
-
if attributes.key?(:'account_name')
|
170
|
-
self.account_name = attributes[:'account_name']
|
171
|
-
end
|
172
|
-
|
173
|
-
if attributes.key?(:'topic')
|
174
|
-
self.topic = attributes[:'topic']
|
175
|
-
end
|
176
|
-
|
177
|
-
if attributes.key?(:'project_id')
|
178
|
-
self.project_id = attributes[:'project_id']
|
179
|
-
end
|
180
|
-
end
|
181
|
-
|
182
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
183
|
-
# @return Array for valid properties with the reasons
|
184
|
-
def list_invalid_properties
|
185
|
-
invalid_properties = Array.new
|
186
|
-
invalid_properties
|
187
|
-
end
|
188
|
-
|
189
|
-
# Check to see if the all the properties in the model are valid
|
190
|
-
# @return true if the model is valid
|
191
|
-
def valid?
|
192
|
-
placement_validator = EnumAttributeValidator.new('String', ["none", "waf_debug", "null"])
|
193
|
-
return false unless placement_validator.valid?(@placement)
|
194
|
-
format_version_validator = EnumAttributeValidator.new('Integer', [1, 2])
|
195
|
-
return false unless format_version_validator.valid?(@format_version)
|
196
|
-
true
|
197
|
-
end
|
198
|
-
|
199
|
-
# Custom attribute writer method checking allowed values (enum).
|
200
|
-
# @param [Object] placement Object to be assigned
|
201
|
-
def placement=(placement)
|
202
|
-
validator = EnumAttributeValidator.new('String', ["none", "waf_debug", "null"])
|
203
|
-
unless validator.valid?(placement)
|
204
|
-
fail ArgumentError, "invalid value for \"placement\", must be one of #{validator.allowable_values}."
|
205
|
-
end
|
206
|
-
@placement = placement
|
207
|
-
end
|
208
|
-
|
209
|
-
# Custom attribute writer method checking allowed values (enum).
|
210
|
-
# @param [Object] format_version Object to be assigned
|
211
|
-
def format_version=(format_version)
|
212
|
-
validator = EnumAttributeValidator.new('Integer', [1, 2])
|
213
|
-
unless validator.valid?(format_version)
|
214
|
-
fail ArgumentError, "invalid value for \"format_version\", must be one of #{validator.allowable_values}."
|
215
|
-
end
|
216
|
-
@format_version = format_version
|
217
|
-
end
|
218
|
-
|
219
|
-
# Checks equality by comparing each attribute.
|
220
|
-
# @param [Object] Object to be compared
|
221
|
-
def ==(o)
|
222
|
-
return true if self.equal?(o)
|
223
|
-
self.class == o.class &&
|
224
|
-
name == o.name &&
|
225
|
-
placement == o.placement &&
|
226
|
-
format_version == o.format_version &&
|
227
|
-
response_condition == o.response_condition &&
|
228
|
-
format == o.format &&
|
229
|
-
user == o.user &&
|
230
|
-
secret_key == o.secret_key &&
|
231
|
-
account_name == o.account_name &&
|
232
|
-
topic == o.topic &&
|
233
|
-
project_id == o.project_id
|
234
|
-
end
|
235
|
-
|
236
|
-
# @see the `==` method
|
237
|
-
# @param [Object] Object to be compared
|
238
|
-
def eql?(o)
|
239
|
-
self == o
|
240
|
-
end
|
241
|
-
|
242
|
-
# Calculates hash code according to all attributes.
|
243
|
-
# @return [Integer] Hash code
|
244
|
-
def hash
|
245
|
-
[name, placement, format_version, response_condition, format, user, secret_key, account_name, topic, project_id].hash
|
246
|
-
end
|
247
|
-
|
248
|
-
# Builds the object from hash
|
249
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
250
|
-
# @return [Object] Returns the model itself
|
251
|
-
def self.build_from_hash(attributes)
|
252
|
-
new.build_from_hash(attributes)
|
253
|
-
end
|
254
|
-
|
255
|
-
# Builds the object from hash
|
256
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
257
|
-
# @return [Object] Returns the model itself
|
258
|
-
def build_from_hash(attributes)
|
259
|
-
return nil unless attributes.is_a?(Hash)
|
260
|
-
self.class.fastly_types.each_pair do |key, type|
|
261
|
-
if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
|
262
|
-
self.send("#{key}=", nil)
|
263
|
-
elsif type =~ /\AArray<(.*)>/i
|
264
|
-
# check to ensure the input is an array given that the attribute
|
265
|
-
# is documented as an array but the input is not
|
266
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
267
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
268
|
-
end
|
269
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
270
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
271
|
-
end
|
272
|
-
end
|
273
|
-
|
274
|
-
self
|
275
|
-
end
|
276
|
-
|
277
|
-
# Deserializes the data based on type
|
278
|
-
# @param string type Data type
|
279
|
-
# @param string value Value to be deserialized
|
280
|
-
# @return [Object] Deserialized data
|
281
|
-
def _deserialize(type, value)
|
282
|
-
case type.to_sym
|
283
|
-
when :Time
|
284
|
-
Time.parse(value)
|
285
|
-
when :Date
|
286
|
-
Date.parse(value)
|
287
|
-
when :String
|
288
|
-
value.to_s
|
289
|
-
when :Integer
|
290
|
-
value.to_i
|
291
|
-
when :Float
|
292
|
-
value.to_f
|
293
|
-
when :Boolean
|
294
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
295
|
-
true
|
296
|
-
else
|
297
|
-
false
|
298
|
-
end
|
299
|
-
when :Object
|
300
|
-
# generic object (usually a Hash), return directly
|
301
|
-
value
|
302
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
303
|
-
inner_type = Regexp.last_match[:inner_type]
|
304
|
-
value.map { |v| _deserialize(inner_type, v) }
|
305
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
306
|
-
k_type = Regexp.last_match[:k_type]
|
307
|
-
v_type = Regexp.last_match[:v_type]
|
308
|
-
{}.tap do |hash|
|
309
|
-
value.each do |k, v|
|
310
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
311
|
-
end
|
312
|
-
end
|
313
|
-
else # model
|
314
|
-
# models (e.g. Pet) or oneOf
|
315
|
-
klass = Fastly.const_get(type)
|
316
|
-
klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
317
|
-
end
|
318
|
-
end
|
319
|
-
|
320
|
-
# Returns the string representation of the object
|
321
|
-
# @return [String] String presentation of the object
|
322
|
-
def to_s
|
323
|
-
to_hash.to_s
|
324
|
-
end
|
325
|
-
|
326
|
-
# to_body is an alias to to_hash (backward compatibility)
|
327
|
-
# @return [Hash] Returns the object in the form of hash
|
328
|
-
def to_body
|
329
|
-
to_hash
|
330
|
-
end
|
331
|
-
|
332
|
-
# Returns the object in the form of hash
|
333
|
-
# @return [Hash] Returns the object in the form of hash
|
334
|
-
def to_hash
|
335
|
-
hash = {}
|
336
|
-
self.class.attribute_map.each_pair do |attr, param|
|
337
|
-
value = self.send(attr)
|
338
|
-
if value.nil?
|
339
|
-
is_nullable = self.class.fastly_nullable.include?(attr)
|
340
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
341
|
-
end
|
342
|
-
|
343
|
-
hash[param] = _to_hash(value)
|
344
|
-
end
|
345
|
-
hash
|
346
|
-
end
|
347
|
-
|
348
|
-
# Outputs non-array value in the form of hash
|
349
|
-
# For object, use to_hash. Otherwise, just return the value
|
350
|
-
# @param [Object] value Any valid value
|
351
|
-
# @return [Hash] Returns the value in the form of hash
|
352
|
-
def _to_hash(value)
|
353
|
-
if value.is_a?(Array)
|
354
|
-
value.compact.map { |v| _to_hash(v) }
|
355
|
-
elsif value.is_a?(Hash)
|
356
|
-
{}.tap do |hash|
|
357
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
358
|
-
end
|
359
|
-
elsif value.respond_to? :to_hash
|
360
|
-
value.to_hash
|
361
|
-
else
|
362
|
-
value
|
363
|
-
end
|
364
|
-
end
|
365
|
-
|
366
|
-
end
|
367
|
-
|
368
|
-
end
|
@@ -1,337 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Fastly API
|
3
|
-
|
4
|
-
#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/)
|
5
|
-
|
6
|
-
The version of the OpenAPI document: 1.0.0
|
7
|
-
Contact: oss@fastly.com
|
8
|
-
|
9
|
-
=end
|
10
|
-
|
11
|
-
require 'date'
|
12
|
-
require 'time'
|
13
|
-
|
14
|
-
module Fastly
|
15
|
-
class LoggingHeroku
|
16
|
-
# The name for the real-time logging configuration.
|
17
|
-
attr_accessor :name
|
18
|
-
|
19
|
-
# Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`.
|
20
|
-
attr_accessor :placement
|
21
|
-
|
22
|
-
# The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`.
|
23
|
-
attr_accessor :format_version
|
24
|
-
|
25
|
-
# The name of an existing condition in the configured endpoint, or leave blank to always execute.
|
26
|
-
attr_accessor :response_condition
|
27
|
-
|
28
|
-
# A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats).
|
29
|
-
attr_accessor :format
|
30
|
-
|
31
|
-
# The token to use for authentication ([https://devcenter.heroku.com/articles/add-on-partner-log-integration](https://devcenter.heroku.com/articles/add-on-partner-log-integration)).
|
32
|
-
attr_accessor :token
|
33
|
-
|
34
|
-
# The URL to stream logs to.
|
35
|
-
attr_accessor :url
|
36
|
-
|
37
|
-
class EnumAttributeValidator
|
38
|
-
attr_reader :datatype
|
39
|
-
attr_reader :allowable_values
|
40
|
-
|
41
|
-
def initialize(datatype, allowable_values)
|
42
|
-
@allowable_values = allowable_values.map do |value|
|
43
|
-
case datatype.to_s
|
44
|
-
when /Integer/i
|
45
|
-
value.to_i
|
46
|
-
when /Float/i
|
47
|
-
value.to_f
|
48
|
-
else
|
49
|
-
value
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
def valid?(value)
|
55
|
-
!value || allowable_values.include?(value)
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
60
|
-
def self.attribute_map
|
61
|
-
{
|
62
|
-
:'name' => :'name',
|
63
|
-
:'placement' => :'placement',
|
64
|
-
:'format_version' => :'format_version',
|
65
|
-
:'response_condition' => :'response_condition',
|
66
|
-
:'format' => :'format',
|
67
|
-
:'token' => :'token',
|
68
|
-
:'url' => :'url'
|
69
|
-
}
|
70
|
-
end
|
71
|
-
|
72
|
-
# Returns all the JSON keys this model knows about
|
73
|
-
def self.acceptable_attributes
|
74
|
-
attribute_map.values
|
75
|
-
end
|
76
|
-
|
77
|
-
# Attribute type mapping.
|
78
|
-
def self.fastly_types
|
79
|
-
{
|
80
|
-
:'name' => :'String',
|
81
|
-
:'placement' => :'String',
|
82
|
-
:'format_version' => :'Integer',
|
83
|
-
:'response_condition' => :'String',
|
84
|
-
:'format' => :'String',
|
85
|
-
:'token' => :'String',
|
86
|
-
:'url' => :'String'
|
87
|
-
}
|
88
|
-
end
|
89
|
-
|
90
|
-
# List of attributes with nullable: true
|
91
|
-
def self.fastly_nullable
|
92
|
-
Set.new([
|
93
|
-
:'placement',
|
94
|
-
:'response_condition',
|
95
|
-
])
|
96
|
-
end
|
97
|
-
|
98
|
-
# List of class defined in allOf (OpenAPI v3)
|
99
|
-
def self.fastly_all_of
|
100
|
-
[
|
101
|
-
:'LoggingCommon',
|
102
|
-
:'LoggingHerokuAllOf'
|
103
|
-
]
|
104
|
-
end
|
105
|
-
|
106
|
-
# Initializes the object
|
107
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
108
|
-
def initialize(attributes = {})
|
109
|
-
if (!attributes.is_a?(Hash))
|
110
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::LoggingHeroku` initialize method"
|
111
|
-
end
|
112
|
-
|
113
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
114
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
115
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
116
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::LoggingHeroku`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
117
|
-
end
|
118
|
-
h[k.to_sym] = v
|
119
|
-
}
|
120
|
-
|
121
|
-
if attributes.key?(:'name')
|
122
|
-
self.name = attributes[:'name']
|
123
|
-
end
|
124
|
-
|
125
|
-
if attributes.key?(:'placement')
|
126
|
-
self.placement = attributes[:'placement']
|
127
|
-
end
|
128
|
-
|
129
|
-
if attributes.key?(:'format_version')
|
130
|
-
self.format_version = attributes[:'format_version']
|
131
|
-
else
|
132
|
-
self.format_version = FORMAT_VERSION::v2
|
133
|
-
end
|
134
|
-
|
135
|
-
if attributes.key?(:'response_condition')
|
136
|
-
self.response_condition = attributes[:'response_condition']
|
137
|
-
end
|
138
|
-
|
139
|
-
if attributes.key?(:'format')
|
140
|
-
self.format = attributes[:'format']
|
141
|
-
else
|
142
|
-
self.format = '%h %l %u %t \"%r\" %>s %b'
|
143
|
-
end
|
144
|
-
|
145
|
-
if attributes.key?(:'token')
|
146
|
-
self.token = attributes[:'token']
|
147
|
-
end
|
148
|
-
|
149
|
-
if attributes.key?(:'url')
|
150
|
-
self.url = attributes[:'url']
|
151
|
-
end
|
152
|
-
end
|
153
|
-
|
154
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
155
|
-
# @return Array for valid properties with the reasons
|
156
|
-
def list_invalid_properties
|
157
|
-
invalid_properties = Array.new
|
158
|
-
invalid_properties
|
159
|
-
end
|
160
|
-
|
161
|
-
# Check to see if the all the properties in the model are valid
|
162
|
-
# @return true if the model is valid
|
163
|
-
def valid?
|
164
|
-
placement_validator = EnumAttributeValidator.new('String', ["none", "waf_debug", "null"])
|
165
|
-
return false unless placement_validator.valid?(@placement)
|
166
|
-
format_version_validator = EnumAttributeValidator.new('Integer', [1, 2])
|
167
|
-
return false unless format_version_validator.valid?(@format_version)
|
168
|
-
true
|
169
|
-
end
|
170
|
-
|
171
|
-
# Custom attribute writer method checking allowed values (enum).
|
172
|
-
# @param [Object] placement Object to be assigned
|
173
|
-
def placement=(placement)
|
174
|
-
validator = EnumAttributeValidator.new('String', ["none", "waf_debug", "null"])
|
175
|
-
unless validator.valid?(placement)
|
176
|
-
fail ArgumentError, "invalid value for \"placement\", must be one of #{validator.allowable_values}."
|
177
|
-
end
|
178
|
-
@placement = placement
|
179
|
-
end
|
180
|
-
|
181
|
-
# Custom attribute writer method checking allowed values (enum).
|
182
|
-
# @param [Object] format_version Object to be assigned
|
183
|
-
def format_version=(format_version)
|
184
|
-
validator = EnumAttributeValidator.new('Integer', [1, 2])
|
185
|
-
unless validator.valid?(format_version)
|
186
|
-
fail ArgumentError, "invalid value for \"format_version\", must be one of #{validator.allowable_values}."
|
187
|
-
end
|
188
|
-
@format_version = format_version
|
189
|
-
end
|
190
|
-
|
191
|
-
# Checks equality by comparing each attribute.
|
192
|
-
# @param [Object] Object to be compared
|
193
|
-
def ==(o)
|
194
|
-
return true if self.equal?(o)
|
195
|
-
self.class == o.class &&
|
196
|
-
name == o.name &&
|
197
|
-
placement == o.placement &&
|
198
|
-
format_version == o.format_version &&
|
199
|
-
response_condition == o.response_condition &&
|
200
|
-
format == o.format &&
|
201
|
-
token == o.token &&
|
202
|
-
url == o.url
|
203
|
-
end
|
204
|
-
|
205
|
-
# @see the `==` method
|
206
|
-
# @param [Object] Object to be compared
|
207
|
-
def eql?(o)
|
208
|
-
self == o
|
209
|
-
end
|
210
|
-
|
211
|
-
# Calculates hash code according to all attributes.
|
212
|
-
# @return [Integer] Hash code
|
213
|
-
def hash
|
214
|
-
[name, placement, format_version, response_condition, format, token, url].hash
|
215
|
-
end
|
216
|
-
|
217
|
-
# Builds the object from hash
|
218
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
219
|
-
# @return [Object] Returns the model itself
|
220
|
-
def self.build_from_hash(attributes)
|
221
|
-
new.build_from_hash(attributes)
|
222
|
-
end
|
223
|
-
|
224
|
-
# Builds the object from hash
|
225
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
226
|
-
# @return [Object] Returns the model itself
|
227
|
-
def build_from_hash(attributes)
|
228
|
-
return nil unless attributes.is_a?(Hash)
|
229
|
-
self.class.fastly_types.each_pair do |key, type|
|
230
|
-
if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
|
231
|
-
self.send("#{key}=", nil)
|
232
|
-
elsif type =~ /\AArray<(.*)>/i
|
233
|
-
# check to ensure the input is an array given that the attribute
|
234
|
-
# is documented as an array but the input is not
|
235
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
236
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
237
|
-
end
|
238
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
239
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
240
|
-
end
|
241
|
-
end
|
242
|
-
|
243
|
-
self
|
244
|
-
end
|
245
|
-
|
246
|
-
# Deserializes the data based on type
|
247
|
-
# @param string type Data type
|
248
|
-
# @param string value Value to be deserialized
|
249
|
-
# @return [Object] Deserialized data
|
250
|
-
def _deserialize(type, value)
|
251
|
-
case type.to_sym
|
252
|
-
when :Time
|
253
|
-
Time.parse(value)
|
254
|
-
when :Date
|
255
|
-
Date.parse(value)
|
256
|
-
when :String
|
257
|
-
value.to_s
|
258
|
-
when :Integer
|
259
|
-
value.to_i
|
260
|
-
when :Float
|
261
|
-
value.to_f
|
262
|
-
when :Boolean
|
263
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
264
|
-
true
|
265
|
-
else
|
266
|
-
false
|
267
|
-
end
|
268
|
-
when :Object
|
269
|
-
# generic object (usually a Hash), return directly
|
270
|
-
value
|
271
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
272
|
-
inner_type = Regexp.last_match[:inner_type]
|
273
|
-
value.map { |v| _deserialize(inner_type, v) }
|
274
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
275
|
-
k_type = Regexp.last_match[:k_type]
|
276
|
-
v_type = Regexp.last_match[:v_type]
|
277
|
-
{}.tap do |hash|
|
278
|
-
value.each do |k, v|
|
279
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
280
|
-
end
|
281
|
-
end
|
282
|
-
else # model
|
283
|
-
# models (e.g. Pet) or oneOf
|
284
|
-
klass = Fastly.const_get(type)
|
285
|
-
klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
286
|
-
end
|
287
|
-
end
|
288
|
-
|
289
|
-
# Returns the string representation of the object
|
290
|
-
# @return [String] String presentation of the object
|
291
|
-
def to_s
|
292
|
-
to_hash.to_s
|
293
|
-
end
|
294
|
-
|
295
|
-
# to_body is an alias to to_hash (backward compatibility)
|
296
|
-
# @return [Hash] Returns the object in the form of hash
|
297
|
-
def to_body
|
298
|
-
to_hash
|
299
|
-
end
|
300
|
-
|
301
|
-
# Returns the object in the form of hash
|
302
|
-
# @return [Hash] Returns the object in the form of hash
|
303
|
-
def to_hash
|
304
|
-
hash = {}
|
305
|
-
self.class.attribute_map.each_pair do |attr, param|
|
306
|
-
value = self.send(attr)
|
307
|
-
if value.nil?
|
308
|
-
is_nullable = self.class.fastly_nullable.include?(attr)
|
309
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
310
|
-
end
|
311
|
-
|
312
|
-
hash[param] = _to_hash(value)
|
313
|
-
end
|
314
|
-
hash
|
315
|
-
end
|
316
|
-
|
317
|
-
# Outputs non-array value in the form of hash
|
318
|
-
# For object, use to_hash. Otherwise, just return the value
|
319
|
-
# @param [Object] value Any valid value
|
320
|
-
# @return [Hash] Returns the value in the form of hash
|
321
|
-
def _to_hash(value)
|
322
|
-
if value.is_a?(Array)
|
323
|
-
value.compact.map { |v| _to_hash(v) }
|
324
|
-
elsif value.is_a?(Hash)
|
325
|
-
{}.tap do |hash|
|
326
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
327
|
-
end
|
328
|
-
elsif value.respond_to? :to_hash
|
329
|
-
value.to_hash
|
330
|
-
else
|
331
|
-
value
|
332
|
-
end
|
333
|
-
end
|
334
|
-
|
335
|
-
end
|
336
|
-
|
337
|
-
end
|