fastly 8.4.0 → 8.6.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 +22 -0
- data/Gemfile.lock +1 -1
- data/README.md +15 -2
- data/docs/{RelationshipTlsDnsRecord.md → AsyncResponse.md} +3 -2
- data/docs/BillingInvoicesApi.md +37 -4
- data/docs/BillingUsageMetricsApi.md +111 -0
- data/docs/ContentApi.md +1 -1
- data/docs/CreateDashboardRequest.md +12 -0
- data/docs/Dashboard.md +17 -0
- data/docs/DashboardItem.md +15 -0
- data/docs/DashboardItemPropertyDataSource.md +11 -0
- data/docs/DashboardItemPropertyDataSourcePropertyConfig.md +10 -0
- data/docs/DashboardItemPropertyVisualization.md +11 -0
- data/docs/DashboardItemPropertyVisualizationPropertyConfig.md +12 -0
- data/docs/{RelationshipTlsDnsRecords.md → DashboardPropertyCreatedBy.md} +1 -2
- data/docs/{RelationshipTlsDnsRecordDnsRecord.md → DashboardPropertyUpdatedBy.md} +1 -2
- data/docs/DomainInspectorMeasurements.md +1 -1
- data/docs/{InvoiceResponse.md → EomInvoiceResponse.md} +1 -1
- data/docs/GetServiceLevelUsageResponse.md +10 -0
- data/docs/GetServiceLevelUsageTypesResponse.md +10 -0
- data/docs/IncludedWithTlsConfiguration.md +10 -0
- data/docs/IncludedWithTlsConfigurationItem.md +12 -0
- data/docs/ListDashboardsResponse.md +11 -0
- data/docs/{ListInvoicesResponse.md → ListEomInvoicesResponse.md} +1 -1
- data/docs/LoggingKafkaAdditional.md +1 -1
- data/docs/LoggingKafkaApi.md +2 -2
- data/docs/LoggingKafkaResponse.md +1 -1
- data/docs/LoggingKafkaResponsePost.md +1 -1
- data/docs/LoggingLogentriesAdditional.md +1 -1
- data/docs/LoggingLogentriesApi.md +4 -4
- data/docs/LoggingLogentriesResponse.md +1 -1
- data/docs/LoggingSplunkAdditional.md +1 -1
- data/docs/LoggingSplunkApi.md +4 -4
- data/docs/LoggingSplunkResponse.md +1 -1
- data/docs/LoggingSyslogAdditional.md +1 -1
- data/docs/LoggingSyslogApi.md +4 -4
- data/docs/LoggingSyslogResponse.md +1 -1
- data/docs/{LoggingUseTls.md → LoggingUseTlsString.md} +1 -1
- data/docs/MtdInvoiceResponse.md +15 -0
- data/docs/Mtdinvoice.md +15 -0
- data/docs/Mtdlineitems.md +18 -0
- data/docs/ObservabilityCustomDashboardsApi.md +203 -0
- data/docs/RealtimeEntryAggregated.md +1 -0
- data/docs/RealtimeMeasurements.md +1 -0
- data/docs/RelationshipDefaultEcdsaTlsCertificate.md +10 -0
- data/docs/RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificate.md +10 -0
- data/docs/RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificateData.md +11 -0
- data/docs/RelationshipDefaultTlsCertificate.md +10 -0
- data/docs/RelationshipDefaultTlsCertificateDefaultCertificate.md +10 -0
- data/docs/RelationshipDefaultTlsCertificateDefaultCertificateData.md +11 -0
- data/docs/RelationshipTlsDnsRecordsRequest.md +10 -0
- data/docs/RelationshipTlsDnsRecordsRequestDnsRecords.md +10 -0
- data/docs/RelationshipTlsDnsRecordsRequestDnsRecordsData.md +11 -0
- data/docs/RelationshipTlsDnsRecordsResponse.md +10 -0
- data/docs/RelationshipTlsDnsRecordsResponseDnsRecords.md +10 -0
- data/docs/{RelationshipMemberTlsDnsRecord.md → RelationshipTlsDnsRecordsResponseDnsRecordsData.md} +1 -1
- data/docs/Results.md +1 -0
- data/docs/Serviceusagemetric.md +13 -0
- data/docs/Serviceusagemetrics.md +10 -0
- data/docs/ServiceusagemetricsData.md +16 -0
- data/docs/Serviceusagetype.md +11 -0
- data/docs/Serviceusagetypes.md +10 -0
- data/docs/TlsCertificateBlobResponse.md +10 -0
- data/docs/TlsCertificatesApi.md +38 -0
- data/docs/TlsDnsRecord.md +1 -2
- data/docs/UpdateDashboardRequest.md +12 -0
- data/docs/Values.md +1 -1
- data/lib/fastly/api/billing_invoices_api.rb +62 -6
- data/lib/fastly/api/billing_usage_metrics_api.rb +213 -0
- data/lib/fastly/api/content_api.rb +2 -2
- data/lib/fastly/api/logging_datadog_api.rb +2 -2
- data/lib/fastly/api/logging_kafka_api.rb +2 -2
- data/lib/fastly/api/logging_logentries_api.rb +4 -4
- data/lib/fastly/api/logging_splunk_api.rb +4 -4
- data/lib/fastly/api/logging_syslog_api.rb +4 -4
- data/lib/fastly/api/observability_custom_dashboards_api.rb +333 -0
- data/lib/fastly/api/tls_certificates_api.rb +63 -0
- data/lib/fastly/configuration.rb +54 -0
- data/lib/fastly/models/async_response.rb +225 -0
- data/lib/fastly/models/create_dashboard_request.rb +245 -0
- data/lib/fastly/models/dashboard.rb +290 -0
- data/lib/fastly/models/dashboard_item.rb +368 -0
- data/lib/fastly/models/dashboard_item_property_data_source.rb +271 -0
- data/lib/fastly/models/dashboard_item_property_data_source_property_config.rb +244 -0
- data/lib/fastly/models/dashboard_item_property_visualization.rb +271 -0
- data/lib/fastly/models/dashboard_item_property_visualization_property_config.rb +303 -0
- data/lib/fastly/models/dashboard_property_created_by.rb +208 -0
- data/lib/fastly/models/dashboard_property_updated_by.rb +208 -0
- data/lib/fastly/models/domain_inspector_measurements.rb +1 -1
- data/lib/fastly/models/{invoice_response.rb → eom_invoice_response.rb} +3 -3
- data/lib/fastly/models/get_service_level_usage_response.rb +223 -0
- data/lib/fastly/models/get_service_level_usage_types_response.rb +225 -0
- data/lib/fastly/models/included_with_tls_configuration.rb +218 -0
- data/lib/fastly/models/included_with_tls_configuration_item.rb +237 -0
- data/lib/fastly/models/invoicelineitems.rb +5 -5
- data/lib/fastly/models/list_dashboards_response.rb +229 -0
- data/lib/fastly/models/{list_invoices_response.rb → list_eom_invoices_response.rb} +3 -3
- data/lib/fastly/models/logging_datadog_additional.rb +2 -2
- data/lib/fastly/models/logging_datadog_response.rb +2 -2
- data/lib/fastly/models/logging_kafka_additional.rb +2 -2
- data/lib/fastly/models/logging_kafka_response.rb +2 -2
- data/lib/fastly/models/logging_kafka_response_post.rb +2 -2
- data/lib/fastly/models/logging_logentries_additional.rb +2 -2
- data/lib/fastly/models/logging_logentries_response.rb +2 -2
- data/lib/fastly/models/logging_splunk_additional.rb +2 -2
- data/lib/fastly/models/logging_splunk_response.rb +2 -2
- data/lib/fastly/models/logging_syslog_additional.rb +2 -2
- data/lib/fastly/models/logging_syslog_response.rb +2 -2
- data/lib/fastly/models/{logging_use_tls.rb → logging_use_tls_string.rb} +5 -5
- data/lib/fastly/models/mtd_invoice_response.rb +275 -0
- data/lib/fastly/models/mtdinvoice.rb +268 -0
- data/lib/fastly/models/mtdlineitems.rb +297 -0
- data/lib/fastly/models/realtime_entry_aggregated.rb +14 -4
- data/lib/fastly/models/realtime_measurements.rb +14 -4
- data/lib/fastly/models/relationship_default_ecdsa_tls_certificate.rb +216 -0
- data/lib/fastly/models/relationship_default_ecdsa_tls_certificate_default_ecdsa_certificate.rb +216 -0
- data/lib/fastly/models/relationship_default_ecdsa_tls_certificate_default_ecdsa_certificate_data.rb +228 -0
- data/lib/fastly/models/relationship_default_tls_certificate.rb +216 -0
- data/lib/fastly/models/relationship_default_tls_certificate_default_certificate.rb +216 -0
- data/lib/fastly/models/relationship_default_tls_certificate_default_certificate_data.rb +228 -0
- data/lib/fastly/models/{relationship_tls_dns_records.rb → relationship_tls_dns_records_request.rb} +4 -4
- data/lib/fastly/models/relationship_tls_dns_records_request_dns_records.rb +218 -0
- data/lib/fastly/models/{relationship_member_tls_dns_record.rb → relationship_tls_dns_records_request_dns_records_data.rb} +3 -3
- data/lib/fastly/models/relationship_tls_dns_records_response.rb +216 -0
- data/lib/fastly/models/relationship_tls_dns_records_response_dns_records.rb +218 -0
- data/lib/fastly/models/relationship_tls_dns_records_response_dns_records_data.rb +227 -0
- data/lib/fastly/models/relationships_for_tls_configuration.rb +1 -1
- data/lib/fastly/models/results.rb +11 -1
- data/lib/fastly/models/serviceusagemetric.rb +246 -0
- data/lib/fastly/models/{relationship_tls_dns_record.rb → serviceusagemetrics.rb} +10 -10
- data/lib/fastly/models/serviceusagemetrics_data.rb +276 -0
- data/lib/fastly/models/serviceusagetype.rb +227 -0
- data/lib/fastly/models/{relationship_tls_dns_record_dns_record.rb → serviceusagetypes.rb} +4 -4
- data/lib/fastly/models/tls_certificate_blob_response.rb +217 -0
- data/lib/fastly/models/tls_dns_record.rb +48 -12
- data/lib/fastly/models/update_dashboard_request.rb +240 -0
- data/lib/fastly/models/values.rb +1 -1
- data/lib/fastly/version.rb +1 -1
- data/lib/fastly.rb +42 -7
- data/sig.json +1 -1
- metadata +86 -16
@@ -758,6 +758,9 @@ module Fastly
|
|
758
758
|
# Number of \"Server Error\" codes delivered for all sources.
|
759
759
|
attr_accessor :all_status_5xx
|
760
760
|
|
761
|
+
# Origin Offload measures the ratio of bytes served to end users that were cached by Fastly, over the bytes served to end users, between 0 and 1. ((`edge_resp_body_bytes` + `edge_resp_header_bytes`) - (`origin_fetch_resp_body_bytes` + `origin_fetch_resp_header_bytes`)) / (`edge_resp_body_bytes` + `edge_resp_header_bytes`).
|
762
|
+
attr_accessor :origin_offload
|
763
|
+
|
761
764
|
attr_accessor :service_id
|
762
765
|
|
763
766
|
# Timestamp for the start of the time period being reported
|
@@ -1014,6 +1017,7 @@ module Fastly
|
|
1014
1017
|
:'all_status_3xx' => :'all_status_3xx',
|
1015
1018
|
:'all_status_4xx' => :'all_status_4xx',
|
1016
1019
|
:'all_status_5xx' => :'all_status_5xx',
|
1020
|
+
:'origin_offload' => :'origin_offload',
|
1017
1021
|
:'service_id' => :'service_id',
|
1018
1022
|
:'start_time' => :'start_time'
|
1019
1023
|
}
|
@@ -1275,6 +1279,7 @@ module Fastly
|
|
1275
1279
|
:'all_status_3xx' => :'Integer',
|
1276
1280
|
:'all_status_4xx' => :'Integer',
|
1277
1281
|
:'all_status_5xx' => :'Integer',
|
1282
|
+
:'origin_offload' => :'Float',
|
1278
1283
|
:'service_id' => :'String',
|
1279
1284
|
:'start_time' => :'Integer'
|
1280
1285
|
}
|
@@ -2294,6 +2299,10 @@ module Fastly
|
|
2294
2299
|
self.all_status_5xx = attributes[:'all_status_5xx']
|
2295
2300
|
end
|
2296
2301
|
|
2302
|
+
if attributes.key?(:'origin_offload')
|
2303
|
+
self.origin_offload = attributes[:'origin_offload']
|
2304
|
+
end
|
2305
|
+
|
2297
2306
|
if attributes.key?(:'service_id')
|
2298
2307
|
self.service_id = attributes[:'service_id']
|
2299
2308
|
end
|
@@ -2569,6 +2578,7 @@ module Fastly
|
|
2569
2578
|
all_status_3xx == o.all_status_3xx &&
|
2570
2579
|
all_status_4xx == o.all_status_4xx &&
|
2571
2580
|
all_status_5xx == o.all_status_5xx &&
|
2581
|
+
origin_offload == o.origin_offload &&
|
2572
2582
|
service_id == o.service_id &&
|
2573
2583
|
start_time == o.start_time
|
2574
2584
|
end
|
@@ -2582,7 +2592,7 @@ module Fastly
|
|
2582
2592
|
# Calculates hash code according to all attributes.
|
2583
2593
|
# @return [Integer] Hash code
|
2584
2594
|
def hash
|
2585
|
-
[requests, hits, hits_time, miss, miss_time, pass, pass_time, errors, restarts, hit_ratio, bandwidth, body_size, header_size, req_body_bytes, req_header_bytes, resp_body_bytes, resp_header_bytes, bereq_body_bytes, bereq_header_bytes, uncacheable, pipe, synth, tls, tls_v10, tls_v11, tls_v12, tls_v13, edge_requests, edge_resp_header_bytes, edge_resp_body_bytes, edge_hit_requests, edge_miss_requests, origin_fetches, origin_fetch_header_bytes, origin_fetch_body_bytes, origin_fetch_resp_header_bytes, origin_fetch_resp_body_bytes, origin_revalidations, origin_cache_fetches, shield, shield_resp_body_bytes, shield_resp_header_bytes, shield_fetches, shield_fetch_header_bytes, shield_fetch_body_bytes, shield_fetch_resp_header_bytes, shield_fetch_resp_body_bytes, shield_revalidations, shield_cache_fetches, ipv6, otfp, otfp_resp_body_bytes, otfp_resp_header_bytes, otfp_shield_resp_body_bytes, otfp_shield_resp_header_bytes, otfp_manifests, otfp_deliver_time, otfp_shield_time, video, pci, log, log_bytes, http2, http3, waf_logged, waf_blocked, waf_passed, attack_req_body_bytes, attack_req_header_bytes, attack_logged_req_body_bytes, attack_logged_req_header_bytes, attack_blocked_req_body_bytes, attack_blocked_req_header_bytes, attack_passed_req_body_bytes, attack_passed_req_header_bytes, attack_resp_synth_bytes, imgopto, imgopto_resp_body_bytes, imgopto_resp_header_bytes, imgopto_shield, imgopto_shield_resp_body_bytes, imgopto_shield_resp_header_bytes, imgopto_transforms, imgvideo, imgvideo_frames, imgvideo_resp_header_bytes, imgvideo_resp_body_bytes, imgvideo_shield_resp_header_bytes, imgvideo_shield_resp_body_bytes, imgvideo_shield, imgvideo_shield_frames, status_200, status_204, status_206, status_301, status_302, status_304, status_400, status_401, status_403, status_404, status_406, status_416, status_429, status_500, status_501, status_502, status_503, status_504, status_505, status_1xx, status_2xx, status_3xx, status_4xx, status_5xx, object_size_1k, object_size_10k, object_size_100k, object_size_1m, object_size_10m, object_size_100m, object_size_1g, recv_sub_time, recv_sub_count, hash_sub_time, hash_sub_count, miss_sub_time, miss_sub_count, fetch_sub_time, fetch_sub_count, pass_sub_time, pass_sub_count, pipe_sub_time, pipe_sub_count, deliver_sub_time, deliver_sub_count, error_sub_time, error_sub_count, hit_sub_time, hit_sub_count, prehash_sub_time, prehash_sub_count, predeliver_sub_time, predeliver_sub_count, tls_handshake_sent_bytes, hit_resp_body_bytes, miss_resp_body_bytes, pass_resp_body_bytes, segblock_origin_fetches, segblock_shield_fetches, compute_requests, compute_request_time_ms, compute_request_time_billed_ms, compute_ram_used, compute_execution_time_ms, compute_req_header_bytes, compute_req_body_bytes, compute_resp_header_bytes, compute_resp_body_bytes, compute_resp_status_1xx, compute_resp_status_2xx, compute_resp_status_3xx, compute_resp_status_4xx, compute_resp_status_5xx, compute_bereq_header_bytes, compute_bereq_body_bytes, compute_beresp_header_bytes, compute_beresp_body_bytes, compute_bereqs, compute_bereq_errors, compute_resource_limit_exceeded, compute_heap_limit_exceeded, compute_stack_limit_exceeded, compute_globals_limit_exceeded, compute_guest_errors, compute_runtime_errors, edge_hit_resp_body_bytes, edge_hit_resp_header_bytes, edge_miss_resp_body_bytes, edge_miss_resp_header_bytes, origin_cache_fetch_resp_body_bytes, origin_cache_fetch_resp_header_bytes, shield_hit_requests, shield_miss_requests, shield_hit_resp_header_bytes, shield_hit_resp_body_bytes, shield_miss_resp_header_bytes, shield_miss_resp_body_bytes, websocket_req_header_bytes, websocket_req_body_bytes, websocket_resp_header_bytes, websocket_resp_body_bytes, websocket_bereq_header_bytes, websocket_bereq_body_bytes, websocket_beresp_header_bytes, websocket_beresp_body_bytes, websocket_conn_time_ms, fanout_recv_publishes, fanout_send_publishes, kv_store_class_a_operations, kv_store_class_b_operations, object_store_class_a_operations, object_store_class_b_operations, fanout_req_header_bytes, fanout_req_body_bytes, fanout_resp_header_bytes, fanout_resp_body_bytes, fanout_bereq_header_bytes, fanout_bereq_body_bytes, fanout_beresp_header_bytes, fanout_beresp_body_bytes, fanout_conn_time_ms, ddos_action_limit_streams_connections, ddos_action_limit_streams_requests, ddos_action_tarpit_accept, ddos_action_tarpit, ddos_action_close, ddos_action_blackhole, bot_challenge_starts, bot_challenge_complete_tokens_passed, bot_challenge_complete_tokens_failed, bot_challenge_complete_tokens_checked, bot_challenge_complete_tokens_disabled, bot_challenge_complete_tokens_issued, bot_challenges_issued, bot_challenges_succeeded, bot_challenges_failed, ddos_action_downgrade, ddos_action_downgraded_connections, vcl_on_compute_hit_requests, vcl_on_compute_miss_requests, vcl_on_compute_pass_requests, vcl_on_compute_error_requests, vcl_on_compute_synth_requests, vcl_on_compute_edge_hit_requests, vcl_on_compute_edge_miss_requests, all_hit_requests, all_miss_requests, all_pass_requests, all_error_requests, all_synth_requests, all_edge_hit_requests, all_edge_miss_requests, all_status_1xx, all_status_2xx, all_status_3xx, all_status_4xx, all_status_5xx, service_id, start_time].hash
|
2595
|
+
[requests, hits, hits_time, miss, miss_time, pass, pass_time, errors, restarts, hit_ratio, bandwidth, body_size, header_size, req_body_bytes, req_header_bytes, resp_body_bytes, resp_header_bytes, bereq_body_bytes, bereq_header_bytes, uncacheable, pipe, synth, tls, tls_v10, tls_v11, tls_v12, tls_v13, edge_requests, edge_resp_header_bytes, edge_resp_body_bytes, edge_hit_requests, edge_miss_requests, origin_fetches, origin_fetch_header_bytes, origin_fetch_body_bytes, origin_fetch_resp_header_bytes, origin_fetch_resp_body_bytes, origin_revalidations, origin_cache_fetches, shield, shield_resp_body_bytes, shield_resp_header_bytes, shield_fetches, shield_fetch_header_bytes, shield_fetch_body_bytes, shield_fetch_resp_header_bytes, shield_fetch_resp_body_bytes, shield_revalidations, shield_cache_fetches, ipv6, otfp, otfp_resp_body_bytes, otfp_resp_header_bytes, otfp_shield_resp_body_bytes, otfp_shield_resp_header_bytes, otfp_manifests, otfp_deliver_time, otfp_shield_time, video, pci, log, log_bytes, http2, http3, waf_logged, waf_blocked, waf_passed, attack_req_body_bytes, attack_req_header_bytes, attack_logged_req_body_bytes, attack_logged_req_header_bytes, attack_blocked_req_body_bytes, attack_blocked_req_header_bytes, attack_passed_req_body_bytes, attack_passed_req_header_bytes, attack_resp_synth_bytes, imgopto, imgopto_resp_body_bytes, imgopto_resp_header_bytes, imgopto_shield, imgopto_shield_resp_body_bytes, imgopto_shield_resp_header_bytes, imgopto_transforms, imgvideo, imgvideo_frames, imgvideo_resp_header_bytes, imgvideo_resp_body_bytes, imgvideo_shield_resp_header_bytes, imgvideo_shield_resp_body_bytes, imgvideo_shield, imgvideo_shield_frames, status_200, status_204, status_206, status_301, status_302, status_304, status_400, status_401, status_403, status_404, status_406, status_416, status_429, status_500, status_501, status_502, status_503, status_504, status_505, status_1xx, status_2xx, status_3xx, status_4xx, status_5xx, object_size_1k, object_size_10k, object_size_100k, object_size_1m, object_size_10m, object_size_100m, object_size_1g, recv_sub_time, recv_sub_count, hash_sub_time, hash_sub_count, miss_sub_time, miss_sub_count, fetch_sub_time, fetch_sub_count, pass_sub_time, pass_sub_count, pipe_sub_time, pipe_sub_count, deliver_sub_time, deliver_sub_count, error_sub_time, error_sub_count, hit_sub_time, hit_sub_count, prehash_sub_time, prehash_sub_count, predeliver_sub_time, predeliver_sub_count, tls_handshake_sent_bytes, hit_resp_body_bytes, miss_resp_body_bytes, pass_resp_body_bytes, segblock_origin_fetches, segblock_shield_fetches, compute_requests, compute_request_time_ms, compute_request_time_billed_ms, compute_ram_used, compute_execution_time_ms, compute_req_header_bytes, compute_req_body_bytes, compute_resp_header_bytes, compute_resp_body_bytes, compute_resp_status_1xx, compute_resp_status_2xx, compute_resp_status_3xx, compute_resp_status_4xx, compute_resp_status_5xx, compute_bereq_header_bytes, compute_bereq_body_bytes, compute_beresp_header_bytes, compute_beresp_body_bytes, compute_bereqs, compute_bereq_errors, compute_resource_limit_exceeded, compute_heap_limit_exceeded, compute_stack_limit_exceeded, compute_globals_limit_exceeded, compute_guest_errors, compute_runtime_errors, edge_hit_resp_body_bytes, edge_hit_resp_header_bytes, edge_miss_resp_body_bytes, edge_miss_resp_header_bytes, origin_cache_fetch_resp_body_bytes, origin_cache_fetch_resp_header_bytes, shield_hit_requests, shield_miss_requests, shield_hit_resp_header_bytes, shield_hit_resp_body_bytes, shield_miss_resp_header_bytes, shield_miss_resp_body_bytes, websocket_req_header_bytes, websocket_req_body_bytes, websocket_resp_header_bytes, websocket_resp_body_bytes, websocket_bereq_header_bytes, websocket_bereq_body_bytes, websocket_beresp_header_bytes, websocket_beresp_body_bytes, websocket_conn_time_ms, fanout_recv_publishes, fanout_send_publishes, kv_store_class_a_operations, kv_store_class_b_operations, object_store_class_a_operations, object_store_class_b_operations, fanout_req_header_bytes, fanout_req_body_bytes, fanout_resp_header_bytes, fanout_resp_body_bytes, fanout_bereq_header_bytes, fanout_bereq_body_bytes, fanout_beresp_header_bytes, fanout_beresp_body_bytes, fanout_conn_time_ms, ddos_action_limit_streams_connections, ddos_action_limit_streams_requests, ddos_action_tarpit_accept, ddos_action_tarpit, ddos_action_close, ddos_action_blackhole, bot_challenge_starts, bot_challenge_complete_tokens_passed, bot_challenge_complete_tokens_failed, bot_challenge_complete_tokens_checked, bot_challenge_complete_tokens_disabled, bot_challenge_complete_tokens_issued, bot_challenges_issued, bot_challenges_succeeded, bot_challenges_failed, ddos_action_downgrade, ddos_action_downgraded_connections, vcl_on_compute_hit_requests, vcl_on_compute_miss_requests, vcl_on_compute_pass_requests, vcl_on_compute_error_requests, vcl_on_compute_synth_requests, vcl_on_compute_edge_hit_requests, vcl_on_compute_edge_miss_requests, all_hit_requests, all_miss_requests, all_pass_requests, all_error_requests, all_synth_requests, all_edge_hit_requests, all_edge_miss_requests, all_status_1xx, all_status_2xx, all_status_3xx, all_status_4xx, all_status_5xx, origin_offload, service_id, start_time].hash
|
2586
2596
|
end
|
2587
2597
|
|
2588
2598
|
# Builds the object from hash
|
@@ -0,0 +1,246 @@
|
|
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 Serviceusagemetric
|
16
|
+
attr_accessor :customer_id
|
17
|
+
|
18
|
+
# Service ID associated with the usage.
|
19
|
+
attr_accessor :service_id
|
20
|
+
|
21
|
+
# Name of the service associated with the usage.
|
22
|
+
attr_accessor :service_name
|
23
|
+
|
24
|
+
# The quantity of the usage for the billing period. Amount will be in the units provided in the parent object (e.g., a quantity of `1.3` with a unit of `gb` would have a usage amount of 1.3 gigabytes).
|
25
|
+
attr_accessor :usage_units
|
26
|
+
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
28
|
+
def self.attribute_map
|
29
|
+
{
|
30
|
+
:'customer_id' => :'customer_id',
|
31
|
+
:'service_id' => :'service_id',
|
32
|
+
:'service_name' => :'service_name',
|
33
|
+
:'usage_units' => :'usage_units'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Returns all the JSON keys this model knows about
|
38
|
+
def self.acceptable_attributes
|
39
|
+
attribute_map.values
|
40
|
+
end
|
41
|
+
|
42
|
+
# Attribute type mapping.
|
43
|
+
def self.fastly_types
|
44
|
+
{
|
45
|
+
:'customer_id' => :'String',
|
46
|
+
:'service_id' => :'String',
|
47
|
+
:'service_name' => :'String',
|
48
|
+
:'usage_units' => :'Float'
|
49
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
# List of attributes with nullable: true
|
53
|
+
def self.fastly_nullable
|
54
|
+
Set.new([
|
55
|
+
])
|
56
|
+
end
|
57
|
+
|
58
|
+
# Initializes the object
|
59
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
60
|
+
def initialize(attributes = {})
|
61
|
+
if (!attributes.is_a?(Hash))
|
62
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::Serviceusagemetric` initialize method"
|
63
|
+
end
|
64
|
+
|
65
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
66
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
67
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::Serviceusagemetric`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
69
|
+
end
|
70
|
+
h[k.to_sym] = v
|
71
|
+
}
|
72
|
+
|
73
|
+
if attributes.key?(:'customer_id')
|
74
|
+
self.customer_id = attributes[:'customer_id']
|
75
|
+
end
|
76
|
+
|
77
|
+
if attributes.key?(:'service_id')
|
78
|
+
self.service_id = attributes[:'service_id']
|
79
|
+
end
|
80
|
+
|
81
|
+
if attributes.key?(:'service_name')
|
82
|
+
self.service_name = attributes[:'service_name']
|
83
|
+
end
|
84
|
+
|
85
|
+
if attributes.key?(:'usage_units')
|
86
|
+
self.usage_units = attributes[:'usage_units']
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
91
|
+
# @return Array for valid properties with the reasons
|
92
|
+
def list_invalid_properties
|
93
|
+
invalid_properties = Array.new
|
94
|
+
invalid_properties
|
95
|
+
end
|
96
|
+
|
97
|
+
# Check to see if the all the properties in the model are valid
|
98
|
+
# @return true if the model is valid
|
99
|
+
def valid?
|
100
|
+
true
|
101
|
+
end
|
102
|
+
|
103
|
+
# Checks equality by comparing each attribute.
|
104
|
+
# @param [Object] Object to be compared
|
105
|
+
def ==(o)
|
106
|
+
return true if self.equal?(o)
|
107
|
+
self.class == o.class &&
|
108
|
+
customer_id == o.customer_id &&
|
109
|
+
service_id == o.service_id &&
|
110
|
+
service_name == o.service_name &&
|
111
|
+
usage_units == o.usage_units
|
112
|
+
end
|
113
|
+
|
114
|
+
# @see the `==` method
|
115
|
+
# @param [Object] Object to be compared
|
116
|
+
def eql?(o)
|
117
|
+
self == o
|
118
|
+
end
|
119
|
+
|
120
|
+
# Calculates hash code according to all attributes.
|
121
|
+
# @return [Integer] Hash code
|
122
|
+
def hash
|
123
|
+
[customer_id, service_id, service_name, usage_units].hash
|
124
|
+
end
|
125
|
+
|
126
|
+
# Builds the object from hash
|
127
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
128
|
+
# @return [Object] Returns the model itself
|
129
|
+
def self.build_from_hash(attributes)
|
130
|
+
new.build_from_hash(attributes)
|
131
|
+
end
|
132
|
+
|
133
|
+
# Builds the object from hash
|
134
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
135
|
+
# @return [Object] Returns the model itself
|
136
|
+
def build_from_hash(attributes)
|
137
|
+
return nil unless attributes.is_a?(Hash)
|
138
|
+
self.class.fastly_types.each_pair do |key, type|
|
139
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
|
140
|
+
self.send("#{key}=", nil)
|
141
|
+
elsif type =~ /\AArray<(.*)>/i
|
142
|
+
# check to ensure the input is an array given that the attribute
|
143
|
+
# is documented as an array but the input is not
|
144
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
145
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
146
|
+
end
|
147
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
148
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
self
|
153
|
+
end
|
154
|
+
|
155
|
+
# Deserializes the data based on type
|
156
|
+
# @param string type Data type
|
157
|
+
# @param string value Value to be deserialized
|
158
|
+
# @return [Object] Deserialized data
|
159
|
+
def _deserialize(type, value)
|
160
|
+
case type.to_sym
|
161
|
+
when :Time
|
162
|
+
Time.parse(value)
|
163
|
+
when :Date
|
164
|
+
Date.parse(value)
|
165
|
+
when :String
|
166
|
+
value.to_s
|
167
|
+
when :Integer
|
168
|
+
value.to_i
|
169
|
+
when :Float
|
170
|
+
value.to_f
|
171
|
+
when :Boolean
|
172
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
173
|
+
true
|
174
|
+
else
|
175
|
+
false
|
176
|
+
end
|
177
|
+
when :Object
|
178
|
+
# generic object (usually a Hash), return directly
|
179
|
+
value
|
180
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
181
|
+
inner_type = Regexp.last_match[:inner_type]
|
182
|
+
value.map { |v| _deserialize(inner_type, v) }
|
183
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
184
|
+
k_type = Regexp.last_match[:k_type]
|
185
|
+
v_type = Regexp.last_match[:v_type]
|
186
|
+
{}.tap do |hash|
|
187
|
+
value.each do |k, v|
|
188
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
189
|
+
end
|
190
|
+
end
|
191
|
+
else # model
|
192
|
+
# models (e.g. Pet) or oneOf
|
193
|
+
klass = Fastly.const_get(type)
|
194
|
+
klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
# Returns the string representation of the object
|
199
|
+
# @return [String] String presentation of the object
|
200
|
+
def to_s
|
201
|
+
to_hash.to_s
|
202
|
+
end
|
203
|
+
|
204
|
+
# to_body is an alias to to_hash (backward compatibility)
|
205
|
+
# @return [Hash] Returns the object in the form of hash
|
206
|
+
def to_body
|
207
|
+
to_hash
|
208
|
+
end
|
209
|
+
|
210
|
+
# Returns the object in the form of hash
|
211
|
+
# @return [Hash] Returns the object in the form of hash
|
212
|
+
def to_hash
|
213
|
+
hash = {}
|
214
|
+
self.class.attribute_map.each_pair do |attr, param|
|
215
|
+
value = self.send(attr)
|
216
|
+
if value.nil?
|
217
|
+
is_nullable = self.class.fastly_nullable.include?(attr)
|
218
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
219
|
+
end
|
220
|
+
|
221
|
+
hash[param] = _to_hash(value)
|
222
|
+
end
|
223
|
+
hash
|
224
|
+
end
|
225
|
+
|
226
|
+
# Outputs non-array value in the form of hash
|
227
|
+
# For object, use to_hash. Otherwise, just return the value
|
228
|
+
# @param [Object] value Any valid value
|
229
|
+
# @return [Hash] Returns the value in the form of hash
|
230
|
+
def _to_hash(value)
|
231
|
+
if value.is_a?(Array)
|
232
|
+
value.compact.map { |v| _to_hash(v) }
|
233
|
+
elsif value.is_a?(Hash)
|
234
|
+
{}.tap do |hash|
|
235
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
236
|
+
end
|
237
|
+
elsif value.respond_to? :to_hash
|
238
|
+
value.to_hash
|
239
|
+
else
|
240
|
+
value
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
244
|
+
end
|
245
|
+
|
246
|
+
end
|
@@ -12,13 +12,13 @@ require 'date'
|
|
12
12
|
require 'time'
|
13
13
|
|
14
14
|
module Fastly
|
15
|
-
class
|
16
|
-
attr_accessor :
|
15
|
+
class Serviceusagemetrics
|
16
|
+
attr_accessor :data
|
17
17
|
|
18
18
|
# Attribute mapping from ruby-style variable name to JSON key.
|
19
19
|
def self.attribute_map
|
20
20
|
{
|
21
|
-
:'
|
21
|
+
:'data' => :'data'
|
22
22
|
}
|
23
23
|
end
|
24
24
|
|
@@ -30,7 +30,7 @@ module Fastly
|
|
30
30
|
# Attribute type mapping.
|
31
31
|
def self.fastly_types
|
32
32
|
{
|
33
|
-
:'
|
33
|
+
:'data' => :'ServiceusagemetricsData'
|
34
34
|
}
|
35
35
|
end
|
36
36
|
|
@@ -44,19 +44,19 @@ module Fastly
|
|
44
44
|
# @param [Hash] attributes Model attributes in the form of hash
|
45
45
|
def initialize(attributes = {})
|
46
46
|
if (!attributes.is_a?(Hash))
|
47
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::
|
47
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::Serviceusagemetrics` initialize method"
|
48
48
|
end
|
49
49
|
|
50
50
|
# check to see if the attribute exists and convert string to symbol for hash key
|
51
51
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
52
52
|
if (!self.class.attribute_map.key?(k.to_sym))
|
53
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::
|
53
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::Serviceusagemetrics`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
54
54
|
end
|
55
55
|
h[k.to_sym] = v
|
56
56
|
}
|
57
57
|
|
58
|
-
if attributes.key?(:'
|
59
|
-
self.
|
58
|
+
if attributes.key?(:'data')
|
59
|
+
self.data = attributes[:'data']
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
@@ -78,7 +78,7 @@ module Fastly
|
|
78
78
|
def ==(o)
|
79
79
|
return true if self.equal?(o)
|
80
80
|
self.class == o.class &&
|
81
|
-
|
81
|
+
data == o.data
|
82
82
|
end
|
83
83
|
|
84
84
|
# @see the `==` method
|
@@ -90,7 +90,7 @@ module Fastly
|
|
90
90
|
# Calculates hash code according to all attributes.
|
91
91
|
# @return [Integer] Hash code
|
92
92
|
def hash
|
93
|
-
[
|
93
|
+
[data].hash
|
94
94
|
end
|
95
95
|
|
96
96
|
# Builds the object from hash
|
@@ -0,0 +1,276 @@
|
|
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 ServiceusagemetricsData
|
16
|
+
attr_accessor :customer_id
|
17
|
+
|
18
|
+
# Date and time (in ISO 8601 format) for initiation point of a billing cycle, signifying the start of charges for a service or subscription.
|
19
|
+
attr_accessor :start_time
|
20
|
+
|
21
|
+
# Date and time (in ISO 8601 format) for termination point of a billing cycle, signifying the end of charges for a service or subscription.
|
22
|
+
attr_accessor :end_time
|
23
|
+
|
24
|
+
# The usage type identifier for the usage. This is a single, billable metric for the product.
|
25
|
+
attr_accessor :usage_type
|
26
|
+
|
27
|
+
# The unit for the usage as shown on an invoice. If there is no explicit unit, this field will be \"unit\" (e.g., a request with `product_id` of 'cdn_usage' and `usage_type` of 'North America Requests' has no unit, and will return \"unit\").
|
28
|
+
attr_accessor :unit
|
29
|
+
|
30
|
+
attr_accessor :details
|
31
|
+
|
32
|
+
attr_accessor :meta
|
33
|
+
|
34
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
35
|
+
def self.attribute_map
|
36
|
+
{
|
37
|
+
:'customer_id' => :'customer_id',
|
38
|
+
:'start_time' => :'start_time',
|
39
|
+
:'end_time' => :'end_time',
|
40
|
+
:'usage_type' => :'usage_type',
|
41
|
+
:'unit' => :'unit',
|
42
|
+
:'details' => :'details',
|
43
|
+
:'meta' => :'meta'
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
# Returns all the JSON keys this model knows about
|
48
|
+
def self.acceptable_attributes
|
49
|
+
attribute_map.values
|
50
|
+
end
|
51
|
+
|
52
|
+
# Attribute type mapping.
|
53
|
+
def self.fastly_types
|
54
|
+
{
|
55
|
+
:'customer_id' => :'String',
|
56
|
+
:'start_time' => :'Time',
|
57
|
+
:'end_time' => :'Time',
|
58
|
+
:'usage_type' => :'String',
|
59
|
+
:'unit' => :'String',
|
60
|
+
:'details' => :'Array<Serviceusagemetric>',
|
61
|
+
:'meta' => :'Metadata'
|
62
|
+
}
|
63
|
+
end
|
64
|
+
|
65
|
+
# List of attributes with nullable: true
|
66
|
+
def self.fastly_nullable
|
67
|
+
Set.new([
|
68
|
+
])
|
69
|
+
end
|
70
|
+
|
71
|
+
# Initializes the object
|
72
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
73
|
+
def initialize(attributes = {})
|
74
|
+
if (!attributes.is_a?(Hash))
|
75
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::ServiceusagemetricsData` initialize method"
|
76
|
+
end
|
77
|
+
|
78
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
79
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
80
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
81
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::ServiceusagemetricsData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
82
|
+
end
|
83
|
+
h[k.to_sym] = v
|
84
|
+
}
|
85
|
+
|
86
|
+
if attributes.key?(:'customer_id')
|
87
|
+
self.customer_id = attributes[:'customer_id']
|
88
|
+
end
|
89
|
+
|
90
|
+
if attributes.key?(:'start_time')
|
91
|
+
self.start_time = attributes[:'start_time']
|
92
|
+
end
|
93
|
+
|
94
|
+
if attributes.key?(:'end_time')
|
95
|
+
self.end_time = attributes[:'end_time']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.key?(:'usage_type')
|
99
|
+
self.usage_type = attributes[:'usage_type']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.key?(:'unit')
|
103
|
+
self.unit = attributes[:'unit']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.key?(:'details')
|
107
|
+
if (value = attributes[:'details']).is_a?(Array)
|
108
|
+
self.details = value
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
if attributes.key?(:'meta')
|
113
|
+
self.meta = attributes[:'meta']
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
118
|
+
# @return Array for valid properties with the reasons
|
119
|
+
def list_invalid_properties
|
120
|
+
invalid_properties = Array.new
|
121
|
+
invalid_properties
|
122
|
+
end
|
123
|
+
|
124
|
+
# Check to see if the all the properties in the model are valid
|
125
|
+
# @return true if the model is valid
|
126
|
+
def valid?
|
127
|
+
true
|
128
|
+
end
|
129
|
+
|
130
|
+
# Checks equality by comparing each attribute.
|
131
|
+
# @param [Object] Object to be compared
|
132
|
+
def ==(o)
|
133
|
+
return true if self.equal?(o)
|
134
|
+
self.class == o.class &&
|
135
|
+
customer_id == o.customer_id &&
|
136
|
+
start_time == o.start_time &&
|
137
|
+
end_time == o.end_time &&
|
138
|
+
usage_type == o.usage_type &&
|
139
|
+
unit == o.unit &&
|
140
|
+
details == o.details &&
|
141
|
+
meta == o.meta
|
142
|
+
end
|
143
|
+
|
144
|
+
# @see the `==` method
|
145
|
+
# @param [Object] Object to be compared
|
146
|
+
def eql?(o)
|
147
|
+
self == o
|
148
|
+
end
|
149
|
+
|
150
|
+
# Calculates hash code according to all attributes.
|
151
|
+
# @return [Integer] Hash code
|
152
|
+
def hash
|
153
|
+
[customer_id, start_time, end_time, usage_type, unit, details, meta].hash
|
154
|
+
end
|
155
|
+
|
156
|
+
# Builds the object from hash
|
157
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
158
|
+
# @return [Object] Returns the model itself
|
159
|
+
def self.build_from_hash(attributes)
|
160
|
+
new.build_from_hash(attributes)
|
161
|
+
end
|
162
|
+
|
163
|
+
# Builds the object from hash
|
164
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
165
|
+
# @return [Object] Returns the model itself
|
166
|
+
def build_from_hash(attributes)
|
167
|
+
return nil unless attributes.is_a?(Hash)
|
168
|
+
self.class.fastly_types.each_pair do |key, type|
|
169
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
|
170
|
+
self.send("#{key}=", nil)
|
171
|
+
elsif type =~ /\AArray<(.*)>/i
|
172
|
+
# check to ensure the input is an array given that the attribute
|
173
|
+
# is documented as an array but the input is not
|
174
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
175
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
176
|
+
end
|
177
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
178
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
self
|
183
|
+
end
|
184
|
+
|
185
|
+
# Deserializes the data based on type
|
186
|
+
# @param string type Data type
|
187
|
+
# @param string value Value to be deserialized
|
188
|
+
# @return [Object] Deserialized data
|
189
|
+
def _deserialize(type, value)
|
190
|
+
case type.to_sym
|
191
|
+
when :Time
|
192
|
+
Time.parse(value)
|
193
|
+
when :Date
|
194
|
+
Date.parse(value)
|
195
|
+
when :String
|
196
|
+
value.to_s
|
197
|
+
when :Integer
|
198
|
+
value.to_i
|
199
|
+
when :Float
|
200
|
+
value.to_f
|
201
|
+
when :Boolean
|
202
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
203
|
+
true
|
204
|
+
else
|
205
|
+
false
|
206
|
+
end
|
207
|
+
when :Object
|
208
|
+
# generic object (usually a Hash), return directly
|
209
|
+
value
|
210
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
211
|
+
inner_type = Regexp.last_match[:inner_type]
|
212
|
+
value.map { |v| _deserialize(inner_type, v) }
|
213
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
214
|
+
k_type = Regexp.last_match[:k_type]
|
215
|
+
v_type = Regexp.last_match[:v_type]
|
216
|
+
{}.tap do |hash|
|
217
|
+
value.each do |k, v|
|
218
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
219
|
+
end
|
220
|
+
end
|
221
|
+
else # model
|
222
|
+
# models (e.g. Pet) or oneOf
|
223
|
+
klass = Fastly.const_get(type)
|
224
|
+
klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
225
|
+
end
|
226
|
+
end
|
227
|
+
|
228
|
+
# Returns the string representation of the object
|
229
|
+
# @return [String] String presentation of the object
|
230
|
+
def to_s
|
231
|
+
to_hash.to_s
|
232
|
+
end
|
233
|
+
|
234
|
+
# to_body is an alias to to_hash (backward compatibility)
|
235
|
+
# @return [Hash] Returns the object in the form of hash
|
236
|
+
def to_body
|
237
|
+
to_hash
|
238
|
+
end
|
239
|
+
|
240
|
+
# Returns the object in the form of hash
|
241
|
+
# @return [Hash] Returns the object in the form of hash
|
242
|
+
def to_hash
|
243
|
+
hash = {}
|
244
|
+
self.class.attribute_map.each_pair do |attr, param|
|
245
|
+
value = self.send(attr)
|
246
|
+
if value.nil?
|
247
|
+
is_nullable = self.class.fastly_nullable.include?(attr)
|
248
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
249
|
+
end
|
250
|
+
|
251
|
+
hash[param] = _to_hash(value)
|
252
|
+
end
|
253
|
+
hash
|
254
|
+
end
|
255
|
+
|
256
|
+
# Outputs non-array value in the form of hash
|
257
|
+
# For object, use to_hash. Otherwise, just return the value
|
258
|
+
# @param [Object] value Any valid value
|
259
|
+
# @return [Hash] Returns the value in the form of hash
|
260
|
+
def _to_hash(value)
|
261
|
+
if value.is_a?(Array)
|
262
|
+
value.compact.map { |v| _to_hash(v) }
|
263
|
+
elsif value.is_a?(Hash)
|
264
|
+
{}.tap do |hash|
|
265
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
266
|
+
end
|
267
|
+
elsif value.respond_to? :to_hash
|
268
|
+
value.to_hash
|
269
|
+
else
|
270
|
+
value
|
271
|
+
end
|
272
|
+
end
|
273
|
+
|
274
|
+
end
|
275
|
+
|
276
|
+
end
|