fastly 8.10.0 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +51 -2
- data/Gemfile.lock +3 -3
- data/README.md +63 -45
- data/docs/AccessKey.md +12 -0
- data/docs/AccessKeyResponse.md +15 -0
- data/docs/AclsInComputeApi.md +4 -4
- data/docs/AiAcceleratorResponseBodyEnable.md +12 -0
- data/docs/AiAcceleratorResponseCustomer.md +10 -0
- data/docs/AiAcceleratorResponseCustomerCustomer.md +11 -0
- data/docs/AiAcceleratorResponseLinks.md +10 -0
- data/docs/AiAcceleratorResponseLinksLinks.md +10 -0
- data/docs/AiAcceleratorResponseProduct.md +10 -0
- data/docs/AiAcceleratorResponseProductProduct.md +11 -0
- data/docs/Backend.md +1 -1
- data/docs/BackendApi.md +4 -4
- data/docs/BackendResponse.md +1 -1
- data/docs/BillingUsageMetricsApi.md +17 -23
- data/docs/BotManagementResponseBodyEnable.md +12 -0
- data/docs/BotManagementResponseLinks.md +10 -0
- data/docs/BotManagementResponseLinksLinks.md +11 -0
- data/docs/BotManagementResponseProduct.md +10 -0
- data/docs/BotManagementResponseProductProduct.md +11 -0
- data/docs/BotManagementResponseService.md +10 -0
- data/docs/{EnabledProductResponseService.md → BotManagementResponseServiceService.md} +1 -1
- data/docs/BrotliCompressionResponseBodyEnable.md +12 -0
- data/docs/BrotliCompressionResponseLinks.md +10 -0
- data/docs/BrotliCompressionResponseLinksLinks.md +11 -0
- data/docs/BrotliCompressionResponseProduct.md +10 -0
- data/docs/BrotliCompressionResponseProductProduct.md +11 -0
- data/docs/BrotliCompressionResponseService.md +10 -0
- data/docs/ComputeAclList.md +11 -0
- data/docs/{LegacyWafTag.md → ComputeAclListMeta.md} +2 -2
- data/docs/ComputeAclLookup.md +1 -2
- data/docs/{InlineResponse2004Meta.md → ComputeAclUpdate.md} +2 -3
- data/docs/DdosProtectionRequestUpdateConfiguration.md +10 -0
- data/docs/DdosProtectionResponseConfiguration.md +10 -0
- data/docs/DdosProtectionResponseConfigurationConfiguration.md +10 -0
- data/docs/DdosProtectionResponseConfigure.md +13 -0
- data/docs/DdosProtectionResponseEnable.md +12 -0
- data/docs/DdosProtectionResponseLinks.md +10 -0
- data/docs/DdosProtectionResponseLinksLinks.md +11 -0
- data/docs/DdosProtectionResponseProduct.md +10 -0
- data/docs/DdosProtectionResponseProductProduct.md +11 -0
- data/docs/DdosProtectionResponseService.md +10 -0
- data/docs/DimensionAttributesCountryStats.md +12 -0
- data/docs/DimensionAttributesRate.md +10 -0
- data/docs/DimensionBrowser.md +10 -0
- data/docs/DimensionContentType.md +10 -0
- data/docs/DimensionCountry.md +10 -0
- data/docs/DimensionDevice.md +10 -0
- data/docs/DimensionOs.md +10 -0
- data/docs/DimensionResponse.md +10 -0
- data/docs/DimensionStatusCode.md +10 -0
- data/docs/DimensionUrl.md +10 -0
- data/docs/DomainInspectorMeasurements.md +2 -0
- data/docs/DomainInspectorResponseBodyEnable.md +12 -0
- data/docs/DomainInspectorResponseLinks.md +10 -0
- data/docs/DomainInspectorResponseLinksLinks.md +11 -0
- data/docs/DomainInspectorResponseProduct.md +10 -0
- data/docs/{InlineResponse2003Meta.md → DomainInspectorResponseProductProduct.md} +3 -3
- data/docs/DomainInspectorResponseService.md +10 -0
- data/docs/FanoutResponseBodyEnable.md +12 -0
- data/docs/FanoutResponseLinks.md +10 -0
- data/docs/{EnabledProductResponseLinks.md → FanoutResponseLinksLinks.md} +1 -1
- data/docs/FanoutResponseProduct.md +10 -0
- data/docs/{EnabledProductResponseProduct.md → FanoutResponseProductProduct.md} +1 -1
- data/docs/FanoutResponseService.md +10 -0
- data/docs/FilterFieldItem.md +12 -0
- data/docs/GetLogInsightsResponse.md +11 -0
- data/docs/GetLogRecordsResponse.md +11 -0
- data/docs/GetLogRecordsResponseMeta.md +10 -0
- data/docs/GetLogRecordsResponseMetaFilters.md +16 -0
- data/docs/ImageOptimizerResponseBodyEnable.md +12 -0
- data/docs/ImageOptimizerResponseLinks.md +10 -0
- data/docs/ImageOptimizerResponseLinksLinks.md +11 -0
- data/docs/ImageOptimizerResponseProduct.md +10 -0
- data/docs/ImageOptimizerResponseProductProduct.md +11 -0
- data/docs/ImageOptimizerResponseService.md +10 -0
- data/docs/InlineResponse2003.md +2 -2
- data/docs/InlineResponse2004.md +1 -1
- data/docs/InsightsApi.md +69 -0
- data/docs/KvStoreApi.md +30 -30
- data/docs/{Batch.md → KvStoreBatchResponse.md} +2 -2
- data/docs/{BatchErrors.md → KvStoreBatchResponseErrors.md} +4 -4
- data/docs/{StoreResponse.md → KvStoreDetails.md} +2 -2
- data/docs/KvStoreItemApi.md +55 -50
- data/docs/KvStoreRequestCreate.md +10 -0
- data/docs/KvStoreUpsertBatch.md +14 -0
- data/docs/LogExplorerApi.md +65 -0
- data/docs/LogExplorerInsightsResponseBodyEnable.md +12 -0
- data/docs/LogExplorerInsightsResponseLinks.md +10 -0
- data/docs/LogExplorerInsightsResponseLinksLinks.md +11 -0
- data/docs/LogExplorerInsightsResponseProduct.md +10 -0
- data/docs/LogExplorerInsightsResponseProductProduct.md +11 -0
- data/docs/LogExplorerInsightsResponseService.md +10 -0
- data/docs/LogInsights.md +12 -0
- data/docs/LogInsightsDimensionAttributes.md +49 -0
- data/docs/LogInsightsDimensions.md +61 -0
- data/docs/LogInsightsMeta.md +10 -0
- data/docs/LogInsightsMetaFilter.md +14 -0
- data/docs/LogInsightsValues.md +65 -0
- data/docs/{ReadOnlyServiceId.md → LogPropertyServiceId.md} +1 -1
- data/docs/LogRecord.md +37 -0
- data/docs/LoggingGrafanacloudlogsAdditional.md +14 -0
- data/docs/LoggingGrafanacloudlogsApi.md +259 -0
- data/docs/LoggingGrafanacloudlogsResponse.md +23 -0
- data/docs/{ReadOnlyVersion.md → NgwafRequestEnable.md} +2 -1
- data/docs/NgwafRequestUpdateConfiguration.md +11 -0
- data/docs/NgwafResponseConfiguration.md +10 -0
- data/docs/{ConfiguredProductResponseConfiguration.md → NgwafResponseConfigurationConfiguration.md} +2 -2
- data/docs/NgwafResponseConfigure.md +13 -0
- data/docs/NgwafResponseEnable.md +12 -0
- data/docs/NgwafResponseLinks.md +10 -0
- data/docs/{ConfiguredProductResponseLinks.md → NgwafResponseLinksLinks.md} +1 -1
- data/docs/NgwafResponseProduct.md +10 -0
- data/docs/{ConfiguredProductResponseProduct.md → NgwafResponseProductProduct.md} +1 -1
- data/docs/NgwafResponseService.md +10 -0
- data/docs/ObjectStorageAccessKeysApi.md +163 -0
- data/docs/ObjectStorageResponseBodyEnable.md +12 -0
- data/docs/ObjectStorageResponseCustomer.md +10 -0
- data/docs/ObjectStorageResponseLinks.md +10 -0
- data/docs/ObjectStorageResponseLinksLinks.md +10 -0
- data/docs/ObjectStorageResponseProduct.md +10 -0
- data/docs/ObjectStorageResponseProductProduct.md +11 -0
- data/docs/OriginInspectorMeasurements.md +4 -0
- data/docs/OriginInspectorResponseBodyEnable.md +12 -0
- data/docs/OriginInspectorResponseLinks.md +10 -0
- data/docs/OriginInspectorResponseLinksLinks.md +11 -0
- data/docs/OriginInspectorResponseProduct.md +10 -0
- data/docs/OriginInspectorResponseProductProduct.md +11 -0
- data/docs/OriginInspectorResponseService.md +10 -0
- data/docs/OriginInspectorValues.md +4 -0
- data/docs/ProductAiAcceleratorApi.md +115 -0
- data/docs/ProductBotManagementApi.md +130 -0
- data/docs/ProductBrotliCompressionApi.md +130 -0
- data/docs/ProductDdosProtectionApi.md +208 -0
- data/docs/ProductDomainInspectorApi.md +130 -0
- data/docs/ProductFanoutApi.md +130 -0
- data/docs/ProductImageOptimizerApi.md +130 -0
- data/docs/ProductLogExplorerInsightsApi.md +130 -0
- data/docs/ProductNgwafApi.md +210 -0
- data/docs/ProductObjectStorageApi.md +115 -0
- data/docs/ProductOriginInspectorApi.md +130 -0
- data/docs/ProductWebsocketsApi.md +130 -0
- data/docs/RealtimeEntryAggregated.md +18 -7
- data/docs/RealtimeMeasurements.md +18 -7
- data/docs/Results.md +18 -7
- data/docs/SnippetApi.md +15 -15
- data/docs/Usagemetric.md +18 -0
- data/docs/{Store.md → Usagemetrics.md} +2 -2
- data/docs/ValueField.md +59 -0
- data/docs/Values.md +2 -0
- data/docs/Values503Responses.md +12 -0
- data/docs/ValuesBandwidth.md +11 -0
- data/docs/ValuesBrowser.md +11 -0
- data/docs/ValuesCacheHitRatio.md +10 -0
- data/docs/ValuesCountryStats.md +12 -0
- data/docs/ValuesDuration.md +12 -0
- data/docs/ValuesMisses.md +10 -0
- data/docs/ValuesRate.md +10 -0
- data/docs/ValuesRequests.md +10 -0
- data/docs/ValuesStatusCodes.md +12 -0
- data/docs/WebsocketsResponseBodyEnable.md +12 -0
- data/docs/WebsocketsResponseLinks.md +10 -0
- data/docs/WebsocketsResponseLinksLinks.md +11 -0
- data/docs/WebsocketsResponseProduct.md +10 -0
- data/docs/WebsocketsResponseProductProduct.md +11 -0
- data/docs/WebsocketsResponseService.md +10 -0
- data/lib/fastly/api/acls_in_compute_api.rb +6 -6
- data/lib/fastly/api/backend_api.rb +4 -4
- data/lib/fastly/api/billing_usage_metrics_api.rb +46 -73
- data/lib/fastly/api/insights_api.rb +125 -0
- data/lib/fastly/api/kv_store_api.rb +53 -45
- data/lib/fastly/api/kv_store_item_api.rb +114 -99
- data/lib/fastly/api/log_explorer_api.rb +109 -0
- data/lib/fastly/api/logging_grafanacloudlogs_api.rb +471 -0
- data/lib/fastly/api/object_storage_access_keys_api.rb +263 -0
- data/lib/fastly/api/product_ai_accelerator_api.rb +186 -0
- data/lib/fastly/api/product_bot_management_api.rb +207 -0
- data/lib/fastly/api/product_brotli_compression_api.rb +207 -0
- data/lib/fastly/api/product_ddos_protection_api.rb +340 -0
- data/lib/fastly/api/product_domain_inspector_api.rb +207 -0
- data/lib/fastly/api/product_fanout_api.rb +207 -0
- data/lib/fastly/api/product_image_optimizer_api.rb +207 -0
- data/lib/fastly/api/product_log_explorer_insights_api.rb +207 -0
- data/lib/fastly/api/product_ngwaf_api.rb +347 -0
- data/lib/fastly/api/product_object_storage_api.rb +186 -0
- data/lib/fastly/api/product_origin_inspector_api.rb +207 -0
- data/lib/fastly/api/product_websockets_api.rb +207 -0
- data/lib/fastly/api/snippet_api.rb +35 -35
- data/lib/fastly/configuration.rb +308 -200
- data/lib/fastly/models/access_key.rb +248 -0
- data/lib/fastly/models/{legacy_waf_update_status.rb → access_key_response.rb} +48 -46
- data/lib/fastly/models/ai_accelerator_response_body_enable.rb +243 -0
- data/lib/fastly/models/ai_accelerator_response_customer.rb +216 -0
- data/lib/fastly/models/ai_accelerator_response_customer_customer.rb +227 -0
- data/lib/fastly/models/ai_accelerator_response_links.rb +216 -0
- data/lib/fastly/models/ai_accelerator_response_links_links.rb +217 -0
- data/lib/fastly/models/ai_accelerator_response_product.rb +216 -0
- data/lib/fastly/models/ai_accelerator_response_product_product.rb +227 -0
- data/lib/fastly/models/backend.rb +1 -1
- data/lib/fastly/models/backend_response.rb +1 -1
- data/lib/fastly/models/bot_management_response_body_enable.rb +243 -0
- data/lib/fastly/models/bot_management_response_links.rb +216 -0
- data/lib/fastly/models/bot_management_response_links_links.rb +227 -0
- data/lib/fastly/models/bot_management_response_product.rb +216 -0
- data/lib/fastly/models/bot_management_response_product_product.rb +227 -0
- data/lib/fastly/models/bot_management_response_service.rb +216 -0
- data/lib/fastly/models/{enabled_product_response_service.rb → bot_management_response_service_service.rb} +3 -3
- data/lib/fastly/models/brotli_compression_response_body_enable.rb +243 -0
- data/lib/fastly/models/brotli_compression_response_links.rb +216 -0
- data/lib/fastly/models/brotli_compression_response_links_links.rb +227 -0
- data/lib/fastly/models/brotli_compression_response_product.rb +216 -0
- data/lib/fastly/models/brotli_compression_response_product_product.rb +227 -0
- data/lib/fastly/models/brotli_compression_response_service.rb +216 -0
- data/lib/fastly/models/compute_acl_list.rb +228 -0
- data/lib/fastly/models/compute_acl_list_entries.rb +1 -1
- data/lib/fastly/models/compute_acl_list_meta.rb +218 -0
- data/lib/fastly/models/compute_acl_lookup.rb +3 -13
- data/lib/fastly/models/compute_acl_update.rb +219 -0
- data/lib/fastly/models/compute_acl_update_entry.rb +1 -1
- data/lib/fastly/models/ddos_protection_request_update_configuration.rb +256 -0
- data/lib/fastly/models/ddos_protection_response_configuration.rb +216 -0
- data/lib/fastly/models/ddos_protection_response_configuration_configuration.rb +217 -0
- data/lib/fastly/models/ddos_protection_response_configure.rb +253 -0
- data/lib/fastly/models/ddos_protection_response_enable.rb +243 -0
- data/lib/fastly/models/ddos_protection_response_links.rb +216 -0
- data/lib/fastly/models/ddos_protection_response_links_links.rb +227 -0
- data/lib/fastly/models/ddos_protection_response_product.rb +216 -0
- data/lib/fastly/models/ddos_protection_response_product_product.rb +227 -0
- data/lib/fastly/models/ddos_protection_response_service.rb +216 -0
- data/lib/fastly/models/dimension_attributes_country_stats.rb +237 -0
- data/lib/fastly/models/dimension_attributes_rate.rb +217 -0
- data/lib/fastly/models/dimension_browser.rb +217 -0
- data/lib/fastly/models/dimension_content_type.rb +217 -0
- data/lib/fastly/models/dimension_country.rb +217 -0
- data/lib/fastly/models/dimension_device.rb +217 -0
- data/lib/fastly/models/{store.rb → dimension_os.rb} +11 -11
- data/lib/fastly/models/{read_only_service_id.rb → dimension_response.rb} +15 -5
- data/lib/fastly/models/dimension_status_code.rb +217 -0
- data/lib/fastly/models/{legacy_waf_tag.rb → dimension_url.rb} +11 -11
- data/lib/fastly/models/domain_inspector_measurements.rb +21 -1
- data/lib/fastly/models/domain_inspector_response_body_enable.rb +243 -0
- data/lib/fastly/models/domain_inspector_response_links.rb +216 -0
- data/lib/fastly/models/domain_inspector_response_links_links.rb +227 -0
- data/lib/fastly/models/domain_inspector_response_product.rb +216 -0
- data/lib/fastly/models/domain_inspector_response_product_product.rb +227 -0
- data/lib/fastly/models/domain_inspector_response_service.rb +216 -0
- data/lib/fastly/models/fanout_response_body_enable.rb +243 -0
- data/lib/fastly/models/fanout_response_links.rb +216 -0
- data/lib/fastly/models/{enabled_product_response_links.rb → fanout_response_links_links.rb} +3 -3
- data/lib/fastly/models/fanout_response_product.rb +216 -0
- data/lib/fastly/models/{enabled_product_response_product.rb → fanout_response_product_product.rb} +3 -3
- data/lib/fastly/models/fanout_response_service.rb +216 -0
- data/lib/fastly/models/filter_field_item.rb +271 -0
- data/lib/fastly/models/{inline_response2004_meta.rb → get_log_insights_response.rb} +18 -16
- data/lib/fastly/models/get_log_records_response.rb +227 -0
- data/lib/fastly/models/get_log_records_response_meta.rb +216 -0
- data/lib/fastly/models/{legacy_waf_firewall.rb → get_log_records_response_meta_filters.rb} +80 -70
- data/lib/fastly/models/image_optimizer_response_body_enable.rb +243 -0
- data/lib/fastly/models/image_optimizer_response_links.rb +216 -0
- data/lib/fastly/models/image_optimizer_response_links_links.rb +227 -0
- data/lib/fastly/models/image_optimizer_response_product.rb +216 -0
- data/lib/fastly/models/image_optimizer_response_product_product.rb +227 -0
- data/lib/fastly/models/image_optimizer_response_service.rb +216 -0
- data/lib/fastly/models/inline_response2003.rb +2 -2
- data/lib/fastly/models/inline_response2004.rb +1 -1
- data/lib/fastly/models/{batch.rb → kv_store_batch_response.rb} +5 -5
- data/lib/fastly/models/{batch_errors.rb → kv_store_batch_response_errors.rb} +6 -6
- data/lib/fastly/models/{store_response.rb → kv_store_details.rb} +4 -4
- data/lib/fastly/models/{legacy_waf_configuration_set.rb → kv_store_request_create.rb} +10 -15
- data/lib/fastly/models/kv_store_upsert_batch.rb +269 -0
- data/lib/fastly/models/log_explorer_insights_response_body_enable.rb +243 -0
- data/lib/fastly/models/log_explorer_insights_response_links.rb +216 -0
- data/lib/fastly/models/log_explorer_insights_response_links_links.rb +227 -0
- data/lib/fastly/models/log_explorer_insights_response_product.rb +216 -0
- data/lib/fastly/models/log_explorer_insights_response_product_product.rb +227 -0
- data/lib/fastly/models/log_explorer_insights_response_service.rb +216 -0
- data/lib/fastly/models/log_insights.rb +234 -0
- data/lib/fastly/models/log_insights_dimension_attributes.rb +103 -0
- data/lib/fastly/models/log_insights_dimensions.rb +109 -0
- data/lib/fastly/models/log_insights_meta.rb +217 -0
- data/lib/fastly/models/{inline_response2003_meta.rb → log_insights_meta_filter.rb} +69 -13
- data/lib/fastly/models/log_insights_values.rb +111 -0
- data/lib/fastly/models/{read_only_version.rb → log_property_service_id.rb} +4 -3
- data/lib/fastly/models/log_record.rb +486 -0
- data/lib/fastly/models/logging_grafanacloudlogs_additional.rb +257 -0
- data/lib/fastly/models/logging_grafanacloudlogs_response.rb +408 -0
- data/lib/fastly/models/{set_workspace_id.rb → ngwaf_request_enable.rb} +9 -4
- data/lib/fastly/models/{set_configuration.rb → ngwaf_request_update_configuration.rb} +5 -5
- data/lib/fastly/models/ngwaf_response_configuration.rb +216 -0
- data/lib/fastly/models/{configured_product_response_configuration.rb → ngwaf_response_configuration_configuration.rb} +4 -4
- data/lib/fastly/models/{configured_product_response.rb → ngwaf_response_configure.rb} +17 -7
- data/lib/fastly/models/{enabled_product_response.rb → ngwaf_response_enable.rb} +15 -6
- data/lib/fastly/models/ngwaf_response_links.rb +216 -0
- data/lib/fastly/models/{configured_product_response_links.rb → ngwaf_response_links_links.rb} +3 -3
- data/lib/fastly/models/ngwaf_response_product.rb +216 -0
- data/lib/fastly/models/ngwaf_response_product_product.rb +227 -0
- data/lib/fastly/models/ngwaf_response_service.rb +216 -0
- data/lib/fastly/models/object_storage_response_body_enable.rb +243 -0
- data/lib/fastly/models/object_storage_response_customer.rb +216 -0
- data/lib/fastly/models/object_storage_response_links.rb +216 -0
- data/lib/fastly/models/object_storage_response_links_links.rb +217 -0
- data/lib/fastly/models/object_storage_response_product.rb +216 -0
- data/lib/fastly/models/object_storage_response_product_product.rb +227 -0
- data/lib/fastly/models/origin_inspector_measurements.rb +41 -1
- data/lib/fastly/models/origin_inspector_response_body_enable.rb +243 -0
- data/lib/fastly/models/origin_inspector_response_links.rb +216 -0
- data/lib/fastly/models/origin_inspector_response_links_links.rb +227 -0
- data/lib/fastly/models/origin_inspector_response_product.rb +216 -0
- data/lib/fastly/models/origin_inspector_response_product_product.rb +227 -0
- data/lib/fastly/models/origin_inspector_response_service.rb +216 -0
- data/lib/fastly/models/origin_inspector_values.rb +41 -1
- data/lib/fastly/models/realtime_entry_aggregated.rb +184 -74
- data/lib/fastly/models/realtime_measurements.rb +184 -74
- data/lib/fastly/models/results.rb +181 -71
- data/lib/fastly/models/schemas_snippet_response.rb +1 -0
- data/lib/fastly/models/snippet.rb +1 -0
- data/lib/fastly/models/snippet_common.rb +1 -0
- data/lib/fastly/models/snippet_response.rb +1 -0
- data/lib/fastly/models/snippet_response_post.rb +1 -0
- data/lib/fastly/models/snippet_with_dynamic_number.rb +1 -0
- data/lib/fastly/models/usagemetric.rb +297 -0
- data/lib/fastly/models/usagemetrics.rb +218 -0
- data/lib/fastly/models/value_field.rb +108 -0
- data/lib/fastly/models/values.rb +21 -1
- data/lib/fastly/models/{legacy_waf_rule_status.rb → values503_responses.rb} +25 -25
- data/lib/fastly/models/values_bandwidth.rb +227 -0
- data/lib/fastly/models/values_browser.rb +227 -0
- data/lib/fastly/models/values_cache_hit_ratio.rb +217 -0
- data/lib/fastly/models/values_country_stats.rb +237 -0
- data/lib/fastly/models/{legacy_waf_rule.rb → values_duration.rb} +25 -45
- data/lib/fastly/models/values_misses.rb +217 -0
- data/lib/fastly/models/values_rate.rb +217 -0
- data/lib/fastly/models/values_requests.rb +217 -0
- data/lib/fastly/models/values_status_codes.rb +237 -0
- data/lib/fastly/models/websockets_response_body_enable.rb +243 -0
- data/lib/fastly/models/websockets_response_links.rb +216 -0
- data/lib/fastly/models/websockets_response_links_links.rb +227 -0
- data/lib/fastly/models/websockets_response_product.rb +216 -0
- data/lib/fastly/models/{configured_product_response_product.rb → websockets_response_product_product.rb} +3 -3
- data/lib/fastly/models/websockets_response_service.rb +216 -0
- data/lib/fastly/version.rb +1 -1
- data/lib/fastly.rb +147 -35
- data/sig.json +1 -1
- metadata +299 -75
- data/docs/ConfiguredProductResponse.md +0 -13
- data/docs/EnabledProductResponse.md +0 -12
- data/docs/EnabledProductsApi.md +0 -220
- data/docs/LegacyWafConfigurationSet.md +0 -11
- data/docs/LegacyWafConfigurationSetsApi.md +0 -128
- data/docs/LegacyWafFirewall.md +0 -18
- data/docs/LegacyWafFirewallApi.md +0 -355
- data/docs/LegacyWafOwasp.md +0 -38
- data/docs/LegacyWafOwaspApi.md +0 -141
- data/docs/LegacyWafRule.md +0 -14
- data/docs/LegacyWafRuleApi.md +0 -187
- data/docs/LegacyWafRuleStatus.md +0 -12
- data/docs/LegacyWafRuleStatusApi.md +0 -205
- data/docs/LegacyWafRuleset.md +0 -11
- data/docs/LegacyWafRulesetApi.md +0 -139
- data/docs/LegacyWafTagApi.md +0 -61
- data/docs/LegacyWafUpdateStatus.md +0 -15
- data/docs/LegacyWafUpdateStatusApi.md +0 -105
- data/docs/SetConfiguration.md +0 -11
- data/docs/SetWorkspaceId.md +0 -10
- data/lib/fastly/api/enabled_products_api.rb +0 -382
- data/lib/fastly/api/legacy_waf_configuration_sets_api.rb +0 -209
- data/lib/fastly/api/legacy_waf_firewall_api.rb +0 -627
- data/lib/fastly/api/legacy_waf_owasp_api.rb +0 -244
- data/lib/fastly/api/legacy_waf_rule_api.rb +0 -307
- data/lib/fastly/api/legacy_waf_rule_status_api.rb +0 -366
- data/lib/fastly/api/legacy_waf_ruleset_api.rb +0 -237
- data/lib/fastly/api/legacy_waf_tag_api.rb +0 -96
- data/lib/fastly/api/legacy_waf_update_status_api.rb +0 -184
- data/lib/fastly/models/legacy_waf_owasp.rb +0 -527
- data/lib/fastly/models/legacy_waf_ruleset.rb +0 -227
@@ -1,527 +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://www.fastly.com/documentation/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 LegacyWafOwasp
|
16
|
-
# Allowed HTTP versions.
|
17
|
-
attr_accessor :allowed_http_versions
|
18
|
-
|
19
|
-
# A space-separated list of HTTP method names.
|
20
|
-
attr_accessor :allowed_methods
|
21
|
-
|
22
|
-
# Allowed request content types.
|
23
|
-
attr_accessor :allowed_request_content_type
|
24
|
-
|
25
|
-
# The maximum allowed length of an argument.
|
26
|
-
attr_accessor :arg_length
|
27
|
-
|
28
|
-
# The maximum allowed argument name length.
|
29
|
-
attr_accessor :arg_name_length
|
30
|
-
|
31
|
-
# The maximum allowed size of all files (in bytes).
|
32
|
-
attr_accessor :combined_file_sizes
|
33
|
-
|
34
|
-
# Date and time that the settings object was created.
|
35
|
-
attr_accessor :created_at
|
36
|
-
|
37
|
-
# Score value to add for critical anomalies.
|
38
|
-
attr_accessor :critical_anomaly_score
|
39
|
-
|
40
|
-
# CRS validate UTF8 encoding.
|
41
|
-
attr_accessor :crs_validate_utf8_encoding
|
42
|
-
|
43
|
-
# Score value to add for error anomalies.
|
44
|
-
attr_accessor :error_anomaly_score
|
45
|
-
|
46
|
-
# A space-separated list of country codes in ISO 3166-1 (two-letter) format.
|
47
|
-
attr_accessor :high_risk_country_codes
|
48
|
-
|
49
|
-
# HTTP violation threshold.
|
50
|
-
attr_accessor :http_violation_score_threshold
|
51
|
-
|
52
|
-
# Inbound anomaly threshold.
|
53
|
-
attr_accessor :inbound_anomaly_score_threshold
|
54
|
-
|
55
|
-
# Local file inclusion attack threshold.
|
56
|
-
attr_accessor :lfi_score_threshold
|
57
|
-
|
58
|
-
# The maximum allowed file size (in bytes).
|
59
|
-
attr_accessor :max_file_size
|
60
|
-
|
61
|
-
# The maximum number of arguments allowed.
|
62
|
-
attr_accessor :max_num_args
|
63
|
-
|
64
|
-
# Score value to add for notice anomalies.
|
65
|
-
attr_accessor :notice_anomaly_score
|
66
|
-
|
67
|
-
# The configured paranoia level.
|
68
|
-
attr_accessor :paranoia_level
|
69
|
-
|
70
|
-
# PHP injection threshold.
|
71
|
-
attr_accessor :php_injection_score_threshold
|
72
|
-
|
73
|
-
# Remote code execution threshold.
|
74
|
-
attr_accessor :rce_score_threshold
|
75
|
-
|
76
|
-
# A space-separated list of disallowed file extensions.
|
77
|
-
attr_accessor :restricted_extensions
|
78
|
-
|
79
|
-
# A space-separated list of disallowed header names.
|
80
|
-
attr_accessor :restricted_headers
|
81
|
-
|
82
|
-
# Remote file inclusion attack threshold.
|
83
|
-
attr_accessor :rfi_score_threshold
|
84
|
-
|
85
|
-
# Session fixation attack threshold.
|
86
|
-
attr_accessor :session_fixation_score_threshold
|
87
|
-
|
88
|
-
# SQL injection attack threshold.
|
89
|
-
attr_accessor :sql_injection_score_threshold
|
90
|
-
|
91
|
-
# The maximum size of argument names and values.
|
92
|
-
attr_accessor :total_arg_length
|
93
|
-
|
94
|
-
# Date and time that the settings object was last updated.
|
95
|
-
attr_accessor :updated_at
|
96
|
-
|
97
|
-
# Score value to add for warning anomalies.
|
98
|
-
attr_accessor :warning_anomaly_score
|
99
|
-
|
100
|
-
# XSS attack threshold.
|
101
|
-
attr_accessor :xss_score_threshold
|
102
|
-
|
103
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
104
|
-
def self.attribute_map
|
105
|
-
{
|
106
|
-
:'allowed_http_versions' => :'allowed_http_versions',
|
107
|
-
:'allowed_methods' => :'allowed_methods',
|
108
|
-
:'allowed_request_content_type' => :'allowed_request_content_type',
|
109
|
-
:'arg_length' => :'arg_length',
|
110
|
-
:'arg_name_length' => :'arg_name_length',
|
111
|
-
:'combined_file_sizes' => :'combined_file_sizes',
|
112
|
-
:'created_at' => :'created_at',
|
113
|
-
:'critical_anomaly_score' => :'critical_anomaly_score',
|
114
|
-
:'crs_validate_utf8_encoding' => :'crs_validate_utf8_encoding',
|
115
|
-
:'error_anomaly_score' => :'error_anomaly_score',
|
116
|
-
:'high_risk_country_codes' => :'high_risk_country_codes',
|
117
|
-
:'http_violation_score_threshold' => :'http_violation_score_threshold',
|
118
|
-
:'inbound_anomaly_score_threshold' => :'inbound_anomaly_score_threshold',
|
119
|
-
:'lfi_score_threshold' => :'lfi_score_threshold',
|
120
|
-
:'max_file_size' => :'max_file_size',
|
121
|
-
:'max_num_args' => :'max_num_args',
|
122
|
-
:'notice_anomaly_score' => :'notice_anomaly_score',
|
123
|
-
:'paranoia_level' => :'paranoia_level',
|
124
|
-
:'php_injection_score_threshold' => :'php_injection_score_threshold',
|
125
|
-
:'rce_score_threshold' => :'rce_score_threshold',
|
126
|
-
:'restricted_extensions' => :'restricted_extensions',
|
127
|
-
:'restricted_headers' => :'restricted_headers',
|
128
|
-
:'rfi_score_threshold' => :'rfi_score_threshold',
|
129
|
-
:'session_fixation_score_threshold' => :'session_fixation_score_threshold',
|
130
|
-
:'sql_injection_score_threshold' => :'sql_injection_score_threshold',
|
131
|
-
:'total_arg_length' => :'total_arg_length',
|
132
|
-
:'updated_at' => :'updated_at',
|
133
|
-
:'warning_anomaly_score' => :'warning_anomaly_score',
|
134
|
-
:'xss_score_threshold' => :'xss_score_threshold'
|
135
|
-
}
|
136
|
-
end
|
137
|
-
|
138
|
-
# Returns all the JSON keys this model knows about
|
139
|
-
def self.acceptable_attributes
|
140
|
-
attribute_map.values
|
141
|
-
end
|
142
|
-
|
143
|
-
# Attribute type mapping.
|
144
|
-
def self.fastly_types
|
145
|
-
{
|
146
|
-
:'allowed_http_versions' => :'String',
|
147
|
-
:'allowed_methods' => :'String',
|
148
|
-
:'allowed_request_content_type' => :'String',
|
149
|
-
:'arg_length' => :'Integer',
|
150
|
-
:'arg_name_length' => :'Integer',
|
151
|
-
:'combined_file_sizes' => :'Integer',
|
152
|
-
:'created_at' => :'String',
|
153
|
-
:'critical_anomaly_score' => :'Integer',
|
154
|
-
:'crs_validate_utf8_encoding' => :'Boolean',
|
155
|
-
:'error_anomaly_score' => :'Integer',
|
156
|
-
:'high_risk_country_codes' => :'String',
|
157
|
-
:'http_violation_score_threshold' => :'Integer',
|
158
|
-
:'inbound_anomaly_score_threshold' => :'Integer',
|
159
|
-
:'lfi_score_threshold' => :'Integer',
|
160
|
-
:'max_file_size' => :'Integer',
|
161
|
-
:'max_num_args' => :'Integer',
|
162
|
-
:'notice_anomaly_score' => :'Integer',
|
163
|
-
:'paranoia_level' => :'Integer',
|
164
|
-
:'php_injection_score_threshold' => :'Integer',
|
165
|
-
:'rce_score_threshold' => :'Integer',
|
166
|
-
:'restricted_extensions' => :'String',
|
167
|
-
:'restricted_headers' => :'String',
|
168
|
-
:'rfi_score_threshold' => :'Integer',
|
169
|
-
:'session_fixation_score_threshold' => :'Integer',
|
170
|
-
:'sql_injection_score_threshold' => :'Integer',
|
171
|
-
:'total_arg_length' => :'Integer',
|
172
|
-
:'updated_at' => :'String',
|
173
|
-
:'warning_anomaly_score' => :'Integer',
|
174
|
-
:'xss_score_threshold' => :'Integer'
|
175
|
-
}
|
176
|
-
end
|
177
|
-
|
178
|
-
# List of attributes with nullable: true
|
179
|
-
def self.fastly_nullable
|
180
|
-
Set.new([
|
181
|
-
])
|
182
|
-
end
|
183
|
-
|
184
|
-
# Initializes the object
|
185
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
186
|
-
def initialize(attributes = {})
|
187
|
-
if (!attributes.is_a?(Hash))
|
188
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::LegacyWafOwasp` initialize method"
|
189
|
-
end
|
190
|
-
|
191
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
192
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
193
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
194
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::LegacyWafOwasp`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
195
|
-
end
|
196
|
-
h[k.to_sym] = v
|
197
|
-
}
|
198
|
-
|
199
|
-
if attributes.key?(:'allowed_http_versions')
|
200
|
-
self.allowed_http_versions = attributes[:'allowed_http_versions']
|
201
|
-
else
|
202
|
-
self.allowed_http_versions = 'HTTP/1.0 HTTP/1.1 HTTP/2'
|
203
|
-
end
|
204
|
-
|
205
|
-
if attributes.key?(:'allowed_methods')
|
206
|
-
self.allowed_methods = attributes[:'allowed_methods']
|
207
|
-
else
|
208
|
-
self.allowed_methods = 'GET HEAD POST OPTIONS PUT PATCH DELETE'
|
209
|
-
end
|
210
|
-
|
211
|
-
if attributes.key?(:'allowed_request_content_type')
|
212
|
-
self.allowed_request_content_type = attributes[:'allowed_request_content_type']
|
213
|
-
else
|
214
|
-
self.allowed_request_content_type = 'application/x-www-form-urlencoded|multipart/form-data|text/xml|application/xml|application/x-amf|application/json|text/plain'
|
215
|
-
end
|
216
|
-
|
217
|
-
if attributes.key?(:'arg_length')
|
218
|
-
self.arg_length = attributes[:'arg_length']
|
219
|
-
else
|
220
|
-
self.arg_length = 400
|
221
|
-
end
|
222
|
-
|
223
|
-
if attributes.key?(:'arg_name_length')
|
224
|
-
self.arg_name_length = attributes[:'arg_name_length']
|
225
|
-
else
|
226
|
-
self.arg_name_length = 100
|
227
|
-
end
|
228
|
-
|
229
|
-
if attributes.key?(:'combined_file_sizes')
|
230
|
-
self.combined_file_sizes = attributes[:'combined_file_sizes']
|
231
|
-
else
|
232
|
-
self.combined_file_sizes = 10000000
|
233
|
-
end
|
234
|
-
|
235
|
-
if attributes.key?(:'created_at')
|
236
|
-
self.created_at = attributes[:'created_at']
|
237
|
-
end
|
238
|
-
|
239
|
-
if attributes.key?(:'critical_anomaly_score')
|
240
|
-
self.critical_anomaly_score = attributes[:'critical_anomaly_score']
|
241
|
-
else
|
242
|
-
self.critical_anomaly_score = 6
|
243
|
-
end
|
244
|
-
|
245
|
-
if attributes.key?(:'crs_validate_utf8_encoding')
|
246
|
-
self.crs_validate_utf8_encoding = attributes[:'crs_validate_utf8_encoding']
|
247
|
-
end
|
248
|
-
|
249
|
-
if attributes.key?(:'error_anomaly_score')
|
250
|
-
self.error_anomaly_score = attributes[:'error_anomaly_score']
|
251
|
-
else
|
252
|
-
self.error_anomaly_score = 5
|
253
|
-
end
|
254
|
-
|
255
|
-
if attributes.key?(:'high_risk_country_codes')
|
256
|
-
self.high_risk_country_codes = attributes[:'high_risk_country_codes']
|
257
|
-
end
|
258
|
-
|
259
|
-
if attributes.key?(:'http_violation_score_threshold')
|
260
|
-
self.http_violation_score_threshold = attributes[:'http_violation_score_threshold']
|
261
|
-
end
|
262
|
-
|
263
|
-
if attributes.key?(:'inbound_anomaly_score_threshold')
|
264
|
-
self.inbound_anomaly_score_threshold = attributes[:'inbound_anomaly_score_threshold']
|
265
|
-
end
|
266
|
-
|
267
|
-
if attributes.key?(:'lfi_score_threshold')
|
268
|
-
self.lfi_score_threshold = attributes[:'lfi_score_threshold']
|
269
|
-
end
|
270
|
-
|
271
|
-
if attributes.key?(:'max_file_size')
|
272
|
-
self.max_file_size = attributes[:'max_file_size']
|
273
|
-
else
|
274
|
-
self.max_file_size = 10000000
|
275
|
-
end
|
276
|
-
|
277
|
-
if attributes.key?(:'max_num_args')
|
278
|
-
self.max_num_args = attributes[:'max_num_args']
|
279
|
-
else
|
280
|
-
self.max_num_args = 255
|
281
|
-
end
|
282
|
-
|
283
|
-
if attributes.key?(:'notice_anomaly_score')
|
284
|
-
self.notice_anomaly_score = attributes[:'notice_anomaly_score']
|
285
|
-
else
|
286
|
-
self.notice_anomaly_score = 4
|
287
|
-
end
|
288
|
-
|
289
|
-
if attributes.key?(:'paranoia_level')
|
290
|
-
self.paranoia_level = attributes[:'paranoia_level']
|
291
|
-
else
|
292
|
-
self.paranoia_level = 1
|
293
|
-
end
|
294
|
-
|
295
|
-
if attributes.key?(:'php_injection_score_threshold')
|
296
|
-
self.php_injection_score_threshold = attributes[:'php_injection_score_threshold']
|
297
|
-
end
|
298
|
-
|
299
|
-
if attributes.key?(:'rce_score_threshold')
|
300
|
-
self.rce_score_threshold = attributes[:'rce_score_threshold']
|
301
|
-
end
|
302
|
-
|
303
|
-
if attributes.key?(:'restricted_extensions')
|
304
|
-
self.restricted_extensions = attributes[:'restricted_extensions']
|
305
|
-
else
|
306
|
-
self.restricted_extensions = '.asa/ .asax/ .ascx/ .axd/ .backup/ .bak/ .bat/ .cdx/ .cer/ .cfg/ .cmd/ .com/ .config/ .conf/ .cs/ .csproj/ .csr/ .dat/ .db/ .dbf/ .dll/ .dos/ .htr/ .htw/ .ida/ .idc/ .idq/ .inc/ .ini/ .key/ .licx/ .lnk/ .log/ .mdb/ .old/ .pass/ .pdb/ .pol/ .printer/ .pwd/ .resources/ .resx/ .sql/ .sys/ .vb/ .vbs/ .vbproj/ .vsdisco/ .webinfo/ .xsd/ .xsx'
|
307
|
-
end
|
308
|
-
|
309
|
-
if attributes.key?(:'restricted_headers')
|
310
|
-
self.restricted_headers = attributes[:'restricted_headers']
|
311
|
-
else
|
312
|
-
self.restricted_headers = '/proxy/ /lock-token/ /content-range/ /translate/ /if/'
|
313
|
-
end
|
314
|
-
|
315
|
-
if attributes.key?(:'rfi_score_threshold')
|
316
|
-
self.rfi_score_threshold = attributes[:'rfi_score_threshold']
|
317
|
-
end
|
318
|
-
|
319
|
-
if attributes.key?(:'session_fixation_score_threshold')
|
320
|
-
self.session_fixation_score_threshold = attributes[:'session_fixation_score_threshold']
|
321
|
-
end
|
322
|
-
|
323
|
-
if attributes.key?(:'sql_injection_score_threshold')
|
324
|
-
self.sql_injection_score_threshold = attributes[:'sql_injection_score_threshold']
|
325
|
-
end
|
326
|
-
|
327
|
-
if attributes.key?(:'total_arg_length')
|
328
|
-
self.total_arg_length = attributes[:'total_arg_length']
|
329
|
-
else
|
330
|
-
self.total_arg_length = 6400
|
331
|
-
end
|
332
|
-
|
333
|
-
if attributes.key?(:'updated_at')
|
334
|
-
self.updated_at = attributes[:'updated_at']
|
335
|
-
end
|
336
|
-
|
337
|
-
if attributes.key?(:'warning_anomaly_score')
|
338
|
-
self.warning_anomaly_score = attributes[:'warning_anomaly_score']
|
339
|
-
end
|
340
|
-
|
341
|
-
if attributes.key?(:'xss_score_threshold')
|
342
|
-
self.xss_score_threshold = attributes[:'xss_score_threshold']
|
343
|
-
end
|
344
|
-
end
|
345
|
-
|
346
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
347
|
-
# @return Array for valid properties with the reasons
|
348
|
-
def list_invalid_properties
|
349
|
-
invalid_properties = Array.new
|
350
|
-
invalid_properties
|
351
|
-
end
|
352
|
-
|
353
|
-
# Check to see if the all the properties in the model are valid
|
354
|
-
# @return true if the model is valid
|
355
|
-
def valid?
|
356
|
-
true
|
357
|
-
end
|
358
|
-
|
359
|
-
# Checks equality by comparing each attribute.
|
360
|
-
# @param [Object] Object to be compared
|
361
|
-
def ==(o)
|
362
|
-
return true if self.equal?(o)
|
363
|
-
self.class == o.class &&
|
364
|
-
allowed_http_versions == o.allowed_http_versions &&
|
365
|
-
allowed_methods == o.allowed_methods &&
|
366
|
-
allowed_request_content_type == o.allowed_request_content_type &&
|
367
|
-
arg_length == o.arg_length &&
|
368
|
-
arg_name_length == o.arg_name_length &&
|
369
|
-
combined_file_sizes == o.combined_file_sizes &&
|
370
|
-
created_at == o.created_at &&
|
371
|
-
critical_anomaly_score == o.critical_anomaly_score &&
|
372
|
-
crs_validate_utf8_encoding == o.crs_validate_utf8_encoding &&
|
373
|
-
error_anomaly_score == o.error_anomaly_score &&
|
374
|
-
high_risk_country_codes == o.high_risk_country_codes &&
|
375
|
-
http_violation_score_threshold == o.http_violation_score_threshold &&
|
376
|
-
inbound_anomaly_score_threshold == o.inbound_anomaly_score_threshold &&
|
377
|
-
lfi_score_threshold == o.lfi_score_threshold &&
|
378
|
-
max_file_size == o.max_file_size &&
|
379
|
-
max_num_args == o.max_num_args &&
|
380
|
-
notice_anomaly_score == o.notice_anomaly_score &&
|
381
|
-
paranoia_level == o.paranoia_level &&
|
382
|
-
php_injection_score_threshold == o.php_injection_score_threshold &&
|
383
|
-
rce_score_threshold == o.rce_score_threshold &&
|
384
|
-
restricted_extensions == o.restricted_extensions &&
|
385
|
-
restricted_headers == o.restricted_headers &&
|
386
|
-
rfi_score_threshold == o.rfi_score_threshold &&
|
387
|
-
session_fixation_score_threshold == o.session_fixation_score_threshold &&
|
388
|
-
sql_injection_score_threshold == o.sql_injection_score_threshold &&
|
389
|
-
total_arg_length == o.total_arg_length &&
|
390
|
-
updated_at == o.updated_at &&
|
391
|
-
warning_anomaly_score == o.warning_anomaly_score &&
|
392
|
-
xss_score_threshold == o.xss_score_threshold
|
393
|
-
end
|
394
|
-
|
395
|
-
# @see the `==` method
|
396
|
-
# @param [Object] Object to be compared
|
397
|
-
def eql?(o)
|
398
|
-
self == o
|
399
|
-
end
|
400
|
-
|
401
|
-
# Calculates hash code according to all attributes.
|
402
|
-
# @return [Integer] Hash code
|
403
|
-
def hash
|
404
|
-
[allowed_http_versions, allowed_methods, allowed_request_content_type, arg_length, arg_name_length, combined_file_sizes, created_at, critical_anomaly_score, crs_validate_utf8_encoding, error_anomaly_score, high_risk_country_codes, http_violation_score_threshold, inbound_anomaly_score_threshold, lfi_score_threshold, max_file_size, max_num_args, notice_anomaly_score, paranoia_level, php_injection_score_threshold, rce_score_threshold, restricted_extensions, restricted_headers, rfi_score_threshold, session_fixation_score_threshold, sql_injection_score_threshold, total_arg_length, updated_at, warning_anomaly_score, xss_score_threshold].hash
|
405
|
-
end
|
406
|
-
|
407
|
-
# Builds the object from hash
|
408
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
409
|
-
# @return [Object] Returns the model itself
|
410
|
-
def self.build_from_hash(attributes)
|
411
|
-
new.build_from_hash(attributes)
|
412
|
-
end
|
413
|
-
|
414
|
-
# Builds the object from hash
|
415
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
416
|
-
# @return [Object] Returns the model itself
|
417
|
-
def build_from_hash(attributes)
|
418
|
-
return nil unless attributes.is_a?(Hash)
|
419
|
-
self.class.fastly_types.each_pair do |key, type|
|
420
|
-
if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
|
421
|
-
self.send("#{key}=", nil)
|
422
|
-
elsif type =~ /\AArray<(.*)>/i
|
423
|
-
# check to ensure the input is an array given that the attribute
|
424
|
-
# is documented as an array but the input is not
|
425
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
426
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
427
|
-
end
|
428
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
429
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
430
|
-
end
|
431
|
-
end
|
432
|
-
|
433
|
-
self
|
434
|
-
end
|
435
|
-
|
436
|
-
# Deserializes the data based on type
|
437
|
-
# @param string type Data type
|
438
|
-
# @param string value Value to be deserialized
|
439
|
-
# @return [Object] Deserialized data
|
440
|
-
def _deserialize(type, value)
|
441
|
-
case type.to_sym
|
442
|
-
when :Time
|
443
|
-
Time.parse(value)
|
444
|
-
when :Date
|
445
|
-
Date.parse(value)
|
446
|
-
when :String
|
447
|
-
value.to_s
|
448
|
-
when :Integer
|
449
|
-
value.to_i
|
450
|
-
when :Float
|
451
|
-
value.to_f
|
452
|
-
when :Boolean
|
453
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
454
|
-
true
|
455
|
-
else
|
456
|
-
false
|
457
|
-
end
|
458
|
-
when :Object
|
459
|
-
# generic object (usually a Hash), return directly
|
460
|
-
value
|
461
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
462
|
-
inner_type = Regexp.last_match[:inner_type]
|
463
|
-
value.map { |v| _deserialize(inner_type, v) }
|
464
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
465
|
-
k_type = Regexp.last_match[:k_type]
|
466
|
-
v_type = Regexp.last_match[:v_type]
|
467
|
-
{}.tap do |hash|
|
468
|
-
value.each do |k, v|
|
469
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
470
|
-
end
|
471
|
-
end
|
472
|
-
else # model
|
473
|
-
# models (e.g. Pet) or oneOf
|
474
|
-
klass = Fastly.const_get(type)
|
475
|
-
klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
476
|
-
end
|
477
|
-
end
|
478
|
-
|
479
|
-
# Returns the string representation of the object
|
480
|
-
# @return [String] String presentation of the object
|
481
|
-
def to_s
|
482
|
-
to_hash.to_s
|
483
|
-
end
|
484
|
-
|
485
|
-
# to_body is an alias to to_hash (backward compatibility)
|
486
|
-
# @return [Hash] Returns the object in the form of hash
|
487
|
-
def to_body
|
488
|
-
to_hash
|
489
|
-
end
|
490
|
-
|
491
|
-
# Returns the object in the form of hash
|
492
|
-
# @return [Hash] Returns the object in the form of hash
|
493
|
-
def to_hash
|
494
|
-
hash = {}
|
495
|
-
self.class.attribute_map.each_pair do |attr, param|
|
496
|
-
value = self.send(attr)
|
497
|
-
if value.nil?
|
498
|
-
is_nullable = self.class.fastly_nullable.include?(attr)
|
499
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
500
|
-
end
|
501
|
-
|
502
|
-
hash[param] = _to_hash(value)
|
503
|
-
end
|
504
|
-
hash
|
505
|
-
end
|
506
|
-
|
507
|
-
# Outputs non-array value in the form of hash
|
508
|
-
# For object, use to_hash. Otherwise, just return the value
|
509
|
-
# @param [Object] value Any valid value
|
510
|
-
# @return [Hash] Returns the value in the form of hash
|
511
|
-
def _to_hash(value)
|
512
|
-
if value.is_a?(Array)
|
513
|
-
value.compact.map { |v| _to_hash(v) }
|
514
|
-
elsif value.is_a?(Hash)
|
515
|
-
{}.tap do |hash|
|
516
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
517
|
-
end
|
518
|
-
elsif value.respond_to? :to_hash
|
519
|
-
value.to_hash
|
520
|
-
else
|
521
|
-
value
|
522
|
-
end
|
523
|
-
end
|
524
|
-
|
525
|
-
end
|
526
|
-
|
527
|
-
end
|