fastly 5.3.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (224) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +62 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +86 -63
  5. data/docs/AclEntry.md +1 -1
  6. data/docs/AclEntryApi.md +176 -0
  7. data/docs/AclEntryResponse.md +1 -1
  8. data/docs/ApexRedirectApi.md +56 -0
  9. data/docs/Batch.md +12 -0
  10. data/docs/BatchErrors.md +13 -0
  11. data/docs/BulkUpdateAclEntry.md +1 -1
  12. data/docs/ClientKey.md +12 -0
  13. data/docs/ContactApi.md +50 -0
  14. data/docs/Content.md +2 -2
  15. data/docs/ContentApi.md +52 -0
  16. data/docs/DirectorApi.md +42 -0
  17. data/docs/DomainInspector.md +12 -0
  18. data/docs/DomainInspectorEntry.md +11 -0
  19. data/docs/DomainInspectorEntryDimensions.md +12 -0
  20. data/docs/DomainInspectorHistoricalApi.md +72 -0
  21. data/docs/DomainInspectorMeasurements.md +71 -0
  22. data/docs/DomainInspectorRealtimeApi.md +132 -0
  23. data/docs/DomainInspectorRealtimeEntry.md +12 -0
  24. data/docs/EventAttributes.md +1 -1
  25. data/docs/{EventsResponseAllOf.md → EventData.md} +1 -1
  26. data/docs/HistoricalDomains.md +13 -0
  27. data/docs/HistoricalDomainsData.md +11 -0
  28. data/docs/HistoricalDomainsMeta.md +18 -0
  29. data/docs/HistoricalDomainsMetaFilters.md +12 -0
  30. data/docs/HistoricalDomainsResponse.md +13 -0
  31. data/docs/HistoricalDomainsResponseAllOf.md +10 -0
  32. data/docs/{HistoricalFieldResultsAttributesAllOf.md → HistoricalFieldResultsAttributesAdditional.md} +1 -1
  33. data/docs/HistoricalOriginsResponse.md +13 -0
  34. data/docs/HistoricalOriginsResponseAllOf.md +10 -0
  35. data/docs/IamRolesApi.md +157 -0
  36. data/docs/IamServiceGroupsApi.md +157 -0
  37. data/docs/IamUserGroupsApi.md +315 -0
  38. data/docs/InlineResponse2005.md +11 -0
  39. data/docs/InlineResponse2006.md +11 -0
  40. data/docs/InlineResponse2007.md +10 -0
  41. data/docs/InlineResponse400.md +10 -0
  42. data/docs/LegacyWafConfigurationSet.md +11 -0
  43. data/docs/LegacyWafConfigurationSetsApi.md +125 -0
  44. data/docs/LegacyWafFirewall.md +18 -0
  45. data/docs/LegacyWafFirewallApi.md +352 -0
  46. data/docs/LegacyWafOwasp.md +38 -0
  47. data/docs/LegacyWafOwaspApi.md +138 -0
  48. data/docs/LegacyWafRule.md +14 -0
  49. data/docs/LegacyWafRuleApi.md +184 -0
  50. data/docs/LegacyWafRuleStatus.md +12 -0
  51. data/docs/LegacyWafRuleStatusApi.md +202 -0
  52. data/docs/LegacyWafRuleset.md +11 -0
  53. data/docs/LegacyWafRulesetApi.md +136 -0
  54. data/docs/LegacyWafTag.md +10 -0
  55. data/docs/LegacyWafTagApi.md +58 -0
  56. data/docs/LegacyWafUpdateStatus.md +15 -0
  57. data/docs/LegacyWafUpdateStatusApi.md +102 -0
  58. data/docs/LoggingKafkaApi.md +42 -0
  59. data/docs/LoggingKinesisApi.md +42 -0
  60. data/docs/OriginInspector.md +12 -0
  61. data/docs/OriginInspectorDimensions.md +12 -0
  62. data/docs/OriginInspectorEntry.md +11 -0
  63. data/docs/OriginInspectorHistorical.md +13 -0
  64. data/docs/OriginInspectorHistoricalApi.md +72 -0
  65. data/docs/OriginInspectorHistoricalData.md +11 -0
  66. data/docs/OriginInspectorHistoricalMeta.md +18 -0
  67. data/docs/OriginInspectorHistoricalMetaFilters.md +12 -0
  68. data/docs/OriginInspectorMeasurements.md +161 -0
  69. data/docs/OriginInspectorRealtimeApi.md +132 -0
  70. data/docs/OriginInspectorRealtimeEntry.md +12 -0
  71. data/docs/OriginInspectorRealtimeEntryRecorded.md +9 -0
  72. data/docs/OriginInspectorSubsequentRequestTimestamp.md +9 -0
  73. data/docs/OriginInspectorValues.md +161 -0
  74. data/docs/PaginationCursorMeta.md +11 -0
  75. data/docs/ReadOnlyServiceId.md +9 -0
  76. data/docs/ReadOnlyVersion.md +9 -0
  77. data/docs/RealtimeEntry.md +2 -2
  78. data/docs/RealtimeEntryAggregated.md +227 -0
  79. data/docs/RealtimeEntryRecorded.md +9 -0
  80. data/docs/RealtimeMeasurements.md +1 -1
  81. data/docs/RecordedTimestamp.md +9 -0
  82. data/docs/RequestSettingsApi.md +40 -0
  83. data/docs/ResponseObjectApi.md +82 -0
  84. data/docs/SchemasSnippetResponse.md +1 -1
  85. data/docs/Secret.md +12 -0
  86. data/docs/SecretResponse.md +13 -0
  87. data/docs/SecretStore.md +10 -0
  88. data/docs/SecretStoreApi.md +233 -0
  89. data/docs/SecretStoreItemApi.md +255 -0
  90. data/docs/SecretStoreResponse.md +12 -0
  91. data/docs/ServiceAuthorizationsApi.md +76 -0
  92. data/docs/SigningKey.md +10 -0
  93. data/docs/Snippet.md +1 -1
  94. data/docs/SnippetApi.md +46 -4
  95. data/docs/SnippetResponse.md +1 -1
  96. data/docs/SubsequentRequestTimestamp.md +9 -0
  97. data/docs/SudoApi.md +52 -0
  98. data/docs/SudoGenericTokenError.md +10 -0
  99. data/docs/SudoRequest.md +12 -0
  100. data/docs/SudoResponse.md +10 -0
  101. data/docs/TokensAdditionalProps.md +9 -0
  102. data/docs/TokensApi.md +70 -0
  103. data/docs/ValidatorResult.md +1 -5
  104. data/docs/ValidatorResultData.md +12 -0
  105. data/docs/ValidatorResultDataAttributes.md +14 -0
  106. data/docs/{ValidatorResultMessages.md → ValidatorResultDataAttributesMessages.md} +2 -2
  107. data/docs/Values.md +71 -0
  108. data/docs/VclApi.md +8 -6
  109. data/docs/VclSyntaxHighlightingResponse.md +10 -0
  110. data/docs/WafActiveRulesApi.md +41 -0
  111. data/lib/fastly/api/acl_entry_api.rb +332 -0
  112. data/lib/fastly/api/apex_redirect_api.rb +111 -0
  113. data/lib/fastly/api/contact_api.rb +90 -0
  114. data/lib/fastly/api/content_api.rb +79 -0
  115. data/lib/fastly/api/director_api.rb +82 -0
  116. data/lib/fastly/api/domain_inspector_historical_api.rb +125 -0
  117. data/lib/fastly/api/domain_inspector_realtime_api.rb +223 -0
  118. data/lib/fastly/api/iam_roles_api.rb +271 -0
  119. data/lib/fastly/api/iam_service_groups_api.rb +271 -0
  120. data/lib/fastly/api/iam_user_groups_api.rb +547 -0
  121. data/lib/fastly/api/legacy_waf_configuration_sets_api.rb +209 -0
  122. data/lib/fastly/api/legacy_waf_firewall_api.rb +627 -0
  123. data/lib/fastly/api/legacy_waf_owasp_api.rb +244 -0
  124. data/lib/fastly/api/legacy_waf_rule_api.rb +307 -0
  125. data/lib/fastly/api/legacy_waf_rule_status_api.rb +366 -0
  126. data/lib/fastly/api/legacy_waf_ruleset_api.rb +237 -0
  127. data/lib/fastly/api/legacy_waf_tag_api.rb +96 -0
  128. data/lib/fastly/api/legacy_waf_update_status_api.rb +184 -0
  129. data/lib/fastly/api/logging_kafka_api.rb +82 -0
  130. data/lib/fastly/api/logging_kinesis_api.rb +82 -0
  131. data/lib/fastly/api/origin_inspector_historical_api.rb +125 -0
  132. data/lib/fastly/api/origin_inspector_realtime_api.rb +223 -0
  133. data/lib/fastly/api/request_settings_api.rb +75 -0
  134. data/lib/fastly/api/response_object_api.rb +157 -0
  135. data/lib/fastly/api/secret_store_api.rb +381 -0
  136. data/lib/fastly/api/secret_store_item_api.rb +437 -0
  137. data/lib/fastly/api/service_authorizations_api.rb +126 -0
  138. data/lib/fastly/api/snippet_api.rb +88 -6
  139. data/lib/fastly/api/sudo_api.rb +83 -0
  140. data/lib/fastly/api/tokens_api.rb +122 -0
  141. data/lib/fastly/api/vcl_api.rb +10 -10
  142. data/lib/fastly/api/waf_active_rules_api.rb +75 -0
  143. data/lib/fastly/configuration.rb +504 -0
  144. data/lib/fastly/models/acl_entry.rb +1 -1
  145. data/lib/fastly/models/acl_entry_response.rb +1 -1
  146. data/lib/fastly/models/batch.rb +239 -0
  147. data/lib/fastly/models/batch_errors.rb +247 -0
  148. data/lib/fastly/models/bulk_update_acl_entry.rb +1 -1
  149. data/lib/fastly/models/client_key.rb +239 -0
  150. data/lib/fastly/models/content.rb +8 -4
  151. data/lib/fastly/models/domain.rb +1 -0
  152. data/lib/fastly/models/domain_inspector.rb +238 -0
  153. data/lib/fastly/models/domain_inspector_entry.rb +228 -0
  154. data/lib/fastly/models/domain_inspector_entry_dimensions.rb +238 -0
  155. data/lib/fastly/models/domain_inspector_measurements.rb +828 -0
  156. data/lib/fastly/models/domain_inspector_realtime_entry.rb +241 -0
  157. data/lib/fastly/models/event_attributes.rb +4 -2
  158. data/lib/fastly/models/{events_response_all_of.rb → event_data.rb} +3 -3
  159. data/lib/fastly/models/events_response.rb +1 -1
  160. data/lib/fastly/models/historical_domains.rb +249 -0
  161. data/lib/fastly/models/historical_domains_data.rb +228 -0
  162. data/lib/fastly/models/historical_domains_meta.rb +297 -0
  163. data/lib/fastly/models/historical_domains_meta_filters.rb +235 -0
  164. data/lib/fastly/models/historical_domains_response.rb +257 -0
  165. data/lib/fastly/models/historical_domains_response_all_of.rb +219 -0
  166. data/lib/fastly/models/historical_field_results_attributes.rb +1 -1
  167. data/lib/fastly/models/{historical_field_results_attributes_all_of.rb → historical_field_results_attributes_additional.rb} +3 -3
  168. data/lib/fastly/models/historical_origins_response.rb +257 -0
  169. data/lib/fastly/models/historical_origins_response_all_of.rb +219 -0
  170. data/lib/fastly/models/inline_response2005.rb +227 -0
  171. data/lib/fastly/models/inline_response2006.rb +227 -0
  172. data/lib/fastly/models/inline_response2007.rb +218 -0
  173. data/lib/fastly/models/inline_response400.rb +250 -0
  174. data/lib/fastly/models/legacy_waf_configuration_set.rb +227 -0
  175. data/lib/fastly/models/legacy_waf_firewall.rb +297 -0
  176. data/lib/fastly/models/legacy_waf_owasp.rb +527 -0
  177. data/lib/fastly/models/legacy_waf_rule.rb +257 -0
  178. data/lib/fastly/models/legacy_waf_rule_status.rb +237 -0
  179. data/lib/fastly/models/legacy_waf_ruleset.rb +227 -0
  180. data/lib/fastly/models/legacy_waf_tag.rb +217 -0
  181. data/lib/fastly/models/legacy_waf_update_status.rb +267 -0
  182. data/lib/fastly/models/origin_inspector.rb +238 -0
  183. data/lib/fastly/models/origin_inspector_dimensions.rb +238 -0
  184. data/lib/fastly/models/origin_inspector_entry.rb +228 -0
  185. data/lib/fastly/models/origin_inspector_historical.rb +249 -0
  186. data/lib/fastly/models/origin_inspector_historical_data.rb +225 -0
  187. data/lib/fastly/models/origin_inspector_historical_meta.rb +297 -0
  188. data/lib/fastly/models/origin_inspector_historical_meta_filters.rb +235 -0
  189. data/lib/fastly/models/origin_inspector_measurements.rb +1728 -0
  190. data/lib/fastly/models/origin_inspector_realtime_entry.rb +241 -0
  191. data/lib/fastly/models/origin_inspector_realtime_entry_recorded.rb +208 -0
  192. data/lib/fastly/models/origin_inspector_subsequent_request_timestamp.rb +208 -0
  193. data/lib/fastly/models/origin_inspector_values.rb +1728 -0
  194. data/lib/fastly/models/pagination_cursor_meta.rb +227 -0
  195. data/lib/fastly/models/read_only_service_id.rb +207 -0
  196. data/lib/fastly/models/read_only_version.rb +207 -0
  197. data/lib/fastly/models/realtime_entry.rb +2 -7
  198. data/lib/fastly/models/realtime_entry_aggregated.rb +2397 -0
  199. data/lib/fastly/models/realtime_entry_recorded.rb +208 -0
  200. data/lib/fastly/models/realtime_measurements.rb +4 -2
  201. data/lib/fastly/models/recorded_timestamp.rb +208 -0
  202. data/lib/fastly/models/schemas_snippet_response.rb +3 -3
  203. data/lib/fastly/models/secret.rb +238 -0
  204. data/lib/fastly/models/secret_response.rb +249 -0
  205. data/lib/fastly/models/secret_store.rb +217 -0
  206. data/lib/fastly/models/secret_store_response.rb +238 -0
  207. data/lib/fastly/models/signing_key.rb +218 -0
  208. data/lib/fastly/models/snippet.rb +3 -3
  209. data/lib/fastly/models/snippet_response.rb +3 -3
  210. data/lib/fastly/models/subsequent_request_timestamp.rb +208 -0
  211. data/lib/fastly/models/sudo_generic_token_error.rb +216 -0
  212. data/lib/fastly/models/sudo_request.rb +244 -0
  213. data/lib/fastly/models/sudo_response.rb +217 -0
  214. data/lib/fastly/models/tokens_additional_props.rb +227 -0
  215. data/lib/fastly/models/validator_result.rb +7 -84
  216. data/lib/fastly/models/validator_result_data.rb +234 -0
  217. data/lib/fastly/models/validator_result_data_attributes.rb +293 -0
  218. data/lib/fastly/models/{validator_result_messages.rb → validator_result_data_attributes_messages.rb} +4 -4
  219. data/lib/fastly/models/values.rb +828 -0
  220. data/lib/fastly/models/vcl_syntax_highlighting_response.rb +217 -0
  221. data/lib/fastly/version.rb +1 -1
  222. data/lib/fastly.rb +79 -3
  223. data/sig.json +1 -1
  224. metadata +160 -8
@@ -0,0 +1,828 @@
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
+ # A measurements object provides a count of the total number of `requests` received by Fastly for your domain in the reported time period and for the relevant POP, as specified in the [entry](#entry-data-model). It also includes the number of responses for specific HTTP response status codes and for status code ranges. This dataset is sparse: only the keys with non-zero values will be included in the record. Where a specific status code does not have a field in this model (e.g., `429 Too Many Requests`), any responses with that code will be counted as part of the range count (`4xx` in this case) but will not be separately identified in the data.
16
+ class DomainInspectorMeasurements
17
+ # Number of requests sent by end users to Fastly.
18
+ attr_accessor :edge_requests
19
+
20
+ # Total header bytes delivered from Fastly to the end user.
21
+ attr_accessor :edge_resp_header_bytes
22
+
23
+ # Total body bytes delivered from Fastly to the end user.
24
+ attr_accessor :edge_resp_body_bytes
25
+
26
+ # Number of 1xx \"Informational\" category status codes delivered.
27
+ attr_accessor :status_1xx
28
+
29
+ # Number of 2xx \"Success\" status codes delivered.
30
+ attr_accessor :status_2xx
31
+
32
+ # Number of 3xx \"Redirection\" codes delivered.
33
+ attr_accessor :status_3xx
34
+
35
+ # Number of 4xx \"Client Error\" codes delivered.
36
+ attr_accessor :status_4xx
37
+
38
+ # Number of 5xx \"Server Error\" codes delivered.
39
+ attr_accessor :status_5xx
40
+
41
+ # Number of responses delivered with status code 200 (Success).
42
+ attr_accessor :status_200
43
+
44
+ # Number of responses delivered with status code 204 (No Content).
45
+ attr_accessor :status_204
46
+
47
+ # Number of responses delivered with status code 206 (Partial Content).
48
+ attr_accessor :status_206
49
+
50
+ # Number of responses delivered with status code 301 (Moved Permanently).
51
+ attr_accessor :status_301
52
+
53
+ # Number of responses delivered with status code 302 (Found).
54
+ attr_accessor :status_302
55
+
56
+ # Number of responses delivered with status code 304 (Not Modified).
57
+ attr_accessor :status_304
58
+
59
+ # Number of responses delivered with status code 400 (Bad Request).
60
+ attr_accessor :status_400
61
+
62
+ # Number of responses delivered with status code 401 (Unauthorized).
63
+ attr_accessor :status_401
64
+
65
+ # Number of responses delivered with status code 403 (Forbidden).
66
+ attr_accessor :status_403
67
+
68
+ # Number of responses delivered with status code 404 (Not Found).
69
+ attr_accessor :status_404
70
+
71
+ # Number of responses delivered with status code 416 (Range Not Satisfiable).
72
+ attr_accessor :status_416
73
+
74
+ # Number of responses delivered with status code 429 (Too Many Requests).
75
+ attr_accessor :status_429
76
+
77
+ # Number of responses delivered with status code 500 (Internal Server Error).
78
+ attr_accessor :status_500
79
+
80
+ # Number of responses delivered with status code 501 (Not Implemented).
81
+ attr_accessor :status_501
82
+
83
+ # Number of responses delivered with status code 502 (Bad Gateway).
84
+ attr_accessor :status_502
85
+
86
+ # Number of responses delivered with status code 503 (Service Unavailable).
87
+ attr_accessor :status_503
88
+
89
+ # Number of responses delivered with status code 504 (Gateway Timeout).
90
+ attr_accessor :status_504
91
+
92
+ # Number of responses delivered with status code 505 (HTTP Version Not Supported).
93
+ attr_accessor :status_505
94
+
95
+ # Number of requests processed.
96
+ attr_accessor :requests
97
+
98
+ # Total header bytes delivered.
99
+ attr_accessor :resp_header_bytes
100
+
101
+ # Total body bytes delivered.
102
+ attr_accessor :resp_body_bytes
103
+
104
+ # Total header bytes sent to origin.
105
+ attr_accessor :bereq_header_bytes
106
+
107
+ # Total body bytes sent to origin.
108
+ attr_accessor :bereq_body_bytes
109
+
110
+ # Number of requests sent by end users to Fastly that resulted in a hit at the edge.
111
+ attr_accessor :edge_hit_requests
112
+
113
+ # Number of requests sent by end users to Fastly that resulted in a miss at the edge.
114
+ attr_accessor :edge_miss_requests
115
+
116
+ # Number of requests sent to origin.
117
+ attr_accessor :origin_fetches
118
+
119
+ # Total header bytes received from origin.
120
+ attr_accessor :origin_fetch_resp_header_bytes
121
+
122
+ # Total body bytes received from origin.
123
+ attr_accessor :origin_fetch_resp_body_bytes
124
+
125
+ # Total bytes delivered (`resp_header_bytes` + `resp_body_bytes` + `bereq_header_bytes` + `bereq_body_bytes`).
126
+ attr_accessor :bandwidth
127
+
128
+ # Ratio of cache hits to cache misses at the edge, between 0 and 1 (`edge_hit_requests` / (`edge_hit_requests` + `edge_miss_requests`)).
129
+ attr_accessor :edge_hit_ratio
130
+
131
+ # Ratio of response bytes delivered from the edge compared to what is delivered from origin, 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`).
132
+ attr_accessor :origin_offload
133
+
134
+ # Number of responses received from origin with status code 200 (Success).
135
+ attr_accessor :origin_status_200
136
+
137
+ # Number of responses received from origin with status code 204 (No Content).
138
+ attr_accessor :origin_status_204
139
+
140
+ # Number of responses received from origin with status code 206 (Partial Content).
141
+ attr_accessor :origin_status_206
142
+
143
+ # Number of responses received from origin with status code 301 (Moved Permanently).
144
+ attr_accessor :origin_status_301
145
+
146
+ # Number of responses received from origin with status code 302 (Found).
147
+ attr_accessor :origin_status_302
148
+
149
+ # Number of responses received from origin with status code 304 (Not Modified).
150
+ attr_accessor :origin_status_304
151
+
152
+ # Number of responses received from origin with status code 400 (Bad Request).
153
+ attr_accessor :origin_status_400
154
+
155
+ # Number of responses received from origin with status code 401 (Unauthorized).
156
+ attr_accessor :origin_status_401
157
+
158
+ # Number of responses received from origin with status code 403 (Forbidden).
159
+ attr_accessor :origin_status_403
160
+
161
+ # Number of responses received from origin with status code 404 (Not Found).
162
+ attr_accessor :origin_status_404
163
+
164
+ # Number of responses received from origin with status code 416 (Range Not Satisfiable).
165
+ attr_accessor :origin_status_416
166
+
167
+ # Number of responses received from origin with status code 429 (Too Many Requests).
168
+ attr_accessor :origin_status_429
169
+
170
+ # Number of responses received from origin with status code 500 (Internal Server Error).
171
+ attr_accessor :origin_status_500
172
+
173
+ # Number of responses received from origin with status code 501 (Not Implemented).
174
+ attr_accessor :origin_status_501
175
+
176
+ # Number of responses received from origin with status code 502 (Bad Gateway).
177
+ attr_accessor :origin_status_502
178
+
179
+ # Number of responses received from origin with status code 503 (Service Unavailable).
180
+ attr_accessor :origin_status_503
181
+
182
+ # Number of responses received from origin with status code 504 (Gateway Timeout).
183
+ attr_accessor :origin_status_504
184
+
185
+ # Number of responses received from origin with status code 505 (HTTP Version Not Supported).
186
+ attr_accessor :origin_status_505
187
+
188
+ # Number of \"Informational\" category status codes received from origin.
189
+ attr_accessor :origin_status_1xx
190
+
191
+ # Number of \"Success\" status codes received from origin.
192
+ attr_accessor :origin_status_2xx
193
+
194
+ # Number of \"Redirection\" codes received from origin.
195
+ attr_accessor :origin_status_3xx
196
+
197
+ # Number of \"Client Error\" codes received from origin.
198
+ attr_accessor :origin_status_4xx
199
+
200
+ # Number of \"Server Error\" codes received from origin.
201
+ attr_accessor :origin_status_5xx
202
+
203
+ # Attribute mapping from ruby-style variable name to JSON key.
204
+ def self.attribute_map
205
+ {
206
+ :'edge_requests' => :'edge_requests',
207
+ :'edge_resp_header_bytes' => :'edge_resp_header_bytes',
208
+ :'edge_resp_body_bytes' => :'edge_resp_body_bytes',
209
+ :'status_1xx' => :'status_1xx',
210
+ :'status_2xx' => :'status_2xx',
211
+ :'status_3xx' => :'status_3xx',
212
+ :'status_4xx' => :'status_4xx',
213
+ :'status_5xx' => :'status_5xx',
214
+ :'status_200' => :'status_200',
215
+ :'status_204' => :'status_204',
216
+ :'status_206' => :'status_206',
217
+ :'status_301' => :'status_301',
218
+ :'status_302' => :'status_302',
219
+ :'status_304' => :'status_304',
220
+ :'status_400' => :'status_400',
221
+ :'status_401' => :'status_401',
222
+ :'status_403' => :'status_403',
223
+ :'status_404' => :'status_404',
224
+ :'status_416' => :'status_416',
225
+ :'status_429' => :'status_429',
226
+ :'status_500' => :'status_500',
227
+ :'status_501' => :'status_501',
228
+ :'status_502' => :'status_502',
229
+ :'status_503' => :'status_503',
230
+ :'status_504' => :'status_504',
231
+ :'status_505' => :'status_505',
232
+ :'requests' => :'requests',
233
+ :'resp_header_bytes' => :'resp_header_bytes',
234
+ :'resp_body_bytes' => :'resp_body_bytes',
235
+ :'bereq_header_bytes' => :'bereq_header_bytes',
236
+ :'bereq_body_bytes' => :'bereq_body_bytes',
237
+ :'edge_hit_requests' => :'edge_hit_requests',
238
+ :'edge_miss_requests' => :'edge_miss_requests',
239
+ :'origin_fetches' => :'origin_fetches',
240
+ :'origin_fetch_resp_header_bytes' => :'origin_fetch_resp_header_bytes',
241
+ :'origin_fetch_resp_body_bytes' => :'origin_fetch_resp_body_bytes',
242
+ :'bandwidth' => :'bandwidth',
243
+ :'edge_hit_ratio' => :'edge_hit_ratio',
244
+ :'origin_offload' => :'origin_offload',
245
+ :'origin_status_200' => :'origin_status_200',
246
+ :'origin_status_204' => :'origin_status_204',
247
+ :'origin_status_206' => :'origin_status_206',
248
+ :'origin_status_301' => :'origin_status_301',
249
+ :'origin_status_302' => :'origin_status_302',
250
+ :'origin_status_304' => :'origin_status_304',
251
+ :'origin_status_400' => :'origin_status_400',
252
+ :'origin_status_401' => :'origin_status_401',
253
+ :'origin_status_403' => :'origin_status_403',
254
+ :'origin_status_404' => :'origin_status_404',
255
+ :'origin_status_416' => :'origin_status_416',
256
+ :'origin_status_429' => :'origin_status_429',
257
+ :'origin_status_500' => :'origin_status_500',
258
+ :'origin_status_501' => :'origin_status_501',
259
+ :'origin_status_502' => :'origin_status_502',
260
+ :'origin_status_503' => :'origin_status_503',
261
+ :'origin_status_504' => :'origin_status_504',
262
+ :'origin_status_505' => :'origin_status_505',
263
+ :'origin_status_1xx' => :'origin_status_1xx',
264
+ :'origin_status_2xx' => :'origin_status_2xx',
265
+ :'origin_status_3xx' => :'origin_status_3xx',
266
+ :'origin_status_4xx' => :'origin_status_4xx',
267
+ :'origin_status_5xx' => :'origin_status_5xx'
268
+ }
269
+ end
270
+
271
+ # Returns all the JSON keys this model knows about
272
+ def self.acceptable_attributes
273
+ attribute_map.values
274
+ end
275
+
276
+ # Attribute type mapping.
277
+ def self.fastly_types
278
+ {
279
+ :'edge_requests' => :'Integer',
280
+ :'edge_resp_header_bytes' => :'Integer',
281
+ :'edge_resp_body_bytes' => :'Integer',
282
+ :'status_1xx' => :'Integer',
283
+ :'status_2xx' => :'Integer',
284
+ :'status_3xx' => :'Integer',
285
+ :'status_4xx' => :'Integer',
286
+ :'status_5xx' => :'Integer',
287
+ :'status_200' => :'Integer',
288
+ :'status_204' => :'Integer',
289
+ :'status_206' => :'Integer',
290
+ :'status_301' => :'Integer',
291
+ :'status_302' => :'Integer',
292
+ :'status_304' => :'Integer',
293
+ :'status_400' => :'Integer',
294
+ :'status_401' => :'Integer',
295
+ :'status_403' => :'Integer',
296
+ :'status_404' => :'Integer',
297
+ :'status_416' => :'Integer',
298
+ :'status_429' => :'Integer',
299
+ :'status_500' => :'Integer',
300
+ :'status_501' => :'Integer',
301
+ :'status_502' => :'Integer',
302
+ :'status_503' => :'Integer',
303
+ :'status_504' => :'Integer',
304
+ :'status_505' => :'Integer',
305
+ :'requests' => :'Integer',
306
+ :'resp_header_bytes' => :'Integer',
307
+ :'resp_body_bytes' => :'Integer',
308
+ :'bereq_header_bytes' => :'Integer',
309
+ :'bereq_body_bytes' => :'Integer',
310
+ :'edge_hit_requests' => :'Integer',
311
+ :'edge_miss_requests' => :'Integer',
312
+ :'origin_fetches' => :'Integer',
313
+ :'origin_fetch_resp_header_bytes' => :'Integer',
314
+ :'origin_fetch_resp_body_bytes' => :'Integer',
315
+ :'bandwidth' => :'Integer',
316
+ :'edge_hit_ratio' => :'Float',
317
+ :'origin_offload' => :'Float',
318
+ :'origin_status_200' => :'Integer',
319
+ :'origin_status_204' => :'Integer',
320
+ :'origin_status_206' => :'Integer',
321
+ :'origin_status_301' => :'Integer',
322
+ :'origin_status_302' => :'Integer',
323
+ :'origin_status_304' => :'Integer',
324
+ :'origin_status_400' => :'Integer',
325
+ :'origin_status_401' => :'Integer',
326
+ :'origin_status_403' => :'Integer',
327
+ :'origin_status_404' => :'Integer',
328
+ :'origin_status_416' => :'Integer',
329
+ :'origin_status_429' => :'Integer',
330
+ :'origin_status_500' => :'Integer',
331
+ :'origin_status_501' => :'Integer',
332
+ :'origin_status_502' => :'Integer',
333
+ :'origin_status_503' => :'Integer',
334
+ :'origin_status_504' => :'Integer',
335
+ :'origin_status_505' => :'Integer',
336
+ :'origin_status_1xx' => :'Integer',
337
+ :'origin_status_2xx' => :'Integer',
338
+ :'origin_status_3xx' => :'Integer',
339
+ :'origin_status_4xx' => :'Integer',
340
+ :'origin_status_5xx' => :'Integer'
341
+ }
342
+ end
343
+
344
+ # List of attributes with nullable: true
345
+ def self.fastly_nullable
346
+ Set.new([
347
+ ])
348
+ end
349
+
350
+ # Initializes the object
351
+ # @param [Hash] attributes Model attributes in the form of hash
352
+ def initialize(attributes = {})
353
+ if (!attributes.is_a?(Hash))
354
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::DomainInspectorMeasurements` initialize method"
355
+ end
356
+
357
+ # check to see if the attribute exists and convert string to symbol for hash key
358
+ attributes = attributes.each_with_object({}) { |(k, v), h|
359
+ if (!self.class.attribute_map.key?(k.to_sym))
360
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::DomainInspectorMeasurements`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
361
+ end
362
+ h[k.to_sym] = v
363
+ }
364
+
365
+ if attributes.key?(:'edge_requests')
366
+ self.edge_requests = attributes[:'edge_requests']
367
+ end
368
+
369
+ if attributes.key?(:'edge_resp_header_bytes')
370
+ self.edge_resp_header_bytes = attributes[:'edge_resp_header_bytes']
371
+ end
372
+
373
+ if attributes.key?(:'edge_resp_body_bytes')
374
+ self.edge_resp_body_bytes = attributes[:'edge_resp_body_bytes']
375
+ end
376
+
377
+ if attributes.key?(:'status_1xx')
378
+ self.status_1xx = attributes[:'status_1xx']
379
+ end
380
+
381
+ if attributes.key?(:'status_2xx')
382
+ self.status_2xx = attributes[:'status_2xx']
383
+ end
384
+
385
+ if attributes.key?(:'status_3xx')
386
+ self.status_3xx = attributes[:'status_3xx']
387
+ end
388
+
389
+ if attributes.key?(:'status_4xx')
390
+ self.status_4xx = attributes[:'status_4xx']
391
+ end
392
+
393
+ if attributes.key?(:'status_5xx')
394
+ self.status_5xx = attributes[:'status_5xx']
395
+ end
396
+
397
+ if attributes.key?(:'status_200')
398
+ self.status_200 = attributes[:'status_200']
399
+ end
400
+
401
+ if attributes.key?(:'status_204')
402
+ self.status_204 = attributes[:'status_204']
403
+ end
404
+
405
+ if attributes.key?(:'status_206')
406
+ self.status_206 = attributes[:'status_206']
407
+ end
408
+
409
+ if attributes.key?(:'status_301')
410
+ self.status_301 = attributes[:'status_301']
411
+ end
412
+
413
+ if attributes.key?(:'status_302')
414
+ self.status_302 = attributes[:'status_302']
415
+ end
416
+
417
+ if attributes.key?(:'status_304')
418
+ self.status_304 = attributes[:'status_304']
419
+ end
420
+
421
+ if attributes.key?(:'status_400')
422
+ self.status_400 = attributes[:'status_400']
423
+ end
424
+
425
+ if attributes.key?(:'status_401')
426
+ self.status_401 = attributes[:'status_401']
427
+ end
428
+
429
+ if attributes.key?(:'status_403')
430
+ self.status_403 = attributes[:'status_403']
431
+ end
432
+
433
+ if attributes.key?(:'status_404')
434
+ self.status_404 = attributes[:'status_404']
435
+ end
436
+
437
+ if attributes.key?(:'status_416')
438
+ self.status_416 = attributes[:'status_416']
439
+ end
440
+
441
+ if attributes.key?(:'status_429')
442
+ self.status_429 = attributes[:'status_429']
443
+ end
444
+
445
+ if attributes.key?(:'status_500')
446
+ self.status_500 = attributes[:'status_500']
447
+ end
448
+
449
+ if attributes.key?(:'status_501')
450
+ self.status_501 = attributes[:'status_501']
451
+ end
452
+
453
+ if attributes.key?(:'status_502')
454
+ self.status_502 = attributes[:'status_502']
455
+ end
456
+
457
+ if attributes.key?(:'status_503')
458
+ self.status_503 = attributes[:'status_503']
459
+ end
460
+
461
+ if attributes.key?(:'status_504')
462
+ self.status_504 = attributes[:'status_504']
463
+ end
464
+
465
+ if attributes.key?(:'status_505')
466
+ self.status_505 = attributes[:'status_505']
467
+ end
468
+
469
+ if attributes.key?(:'requests')
470
+ self.requests = attributes[:'requests']
471
+ end
472
+
473
+ if attributes.key?(:'resp_header_bytes')
474
+ self.resp_header_bytes = attributes[:'resp_header_bytes']
475
+ end
476
+
477
+ if attributes.key?(:'resp_body_bytes')
478
+ self.resp_body_bytes = attributes[:'resp_body_bytes']
479
+ end
480
+
481
+ if attributes.key?(:'bereq_header_bytes')
482
+ self.bereq_header_bytes = attributes[:'bereq_header_bytes']
483
+ end
484
+
485
+ if attributes.key?(:'bereq_body_bytes')
486
+ self.bereq_body_bytes = attributes[:'bereq_body_bytes']
487
+ end
488
+
489
+ if attributes.key?(:'edge_hit_requests')
490
+ self.edge_hit_requests = attributes[:'edge_hit_requests']
491
+ end
492
+
493
+ if attributes.key?(:'edge_miss_requests')
494
+ self.edge_miss_requests = attributes[:'edge_miss_requests']
495
+ end
496
+
497
+ if attributes.key?(:'origin_fetches')
498
+ self.origin_fetches = attributes[:'origin_fetches']
499
+ end
500
+
501
+ if attributes.key?(:'origin_fetch_resp_header_bytes')
502
+ self.origin_fetch_resp_header_bytes = attributes[:'origin_fetch_resp_header_bytes']
503
+ end
504
+
505
+ if attributes.key?(:'origin_fetch_resp_body_bytes')
506
+ self.origin_fetch_resp_body_bytes = attributes[:'origin_fetch_resp_body_bytes']
507
+ end
508
+
509
+ if attributes.key?(:'bandwidth')
510
+ self.bandwidth = attributes[:'bandwidth']
511
+ end
512
+
513
+ if attributes.key?(:'edge_hit_ratio')
514
+ self.edge_hit_ratio = attributes[:'edge_hit_ratio']
515
+ end
516
+
517
+ if attributes.key?(:'origin_offload')
518
+ self.origin_offload = attributes[:'origin_offload']
519
+ end
520
+
521
+ if attributes.key?(:'origin_status_200')
522
+ self.origin_status_200 = attributes[:'origin_status_200']
523
+ end
524
+
525
+ if attributes.key?(:'origin_status_204')
526
+ self.origin_status_204 = attributes[:'origin_status_204']
527
+ end
528
+
529
+ if attributes.key?(:'origin_status_206')
530
+ self.origin_status_206 = attributes[:'origin_status_206']
531
+ end
532
+
533
+ if attributes.key?(:'origin_status_301')
534
+ self.origin_status_301 = attributes[:'origin_status_301']
535
+ end
536
+
537
+ if attributes.key?(:'origin_status_302')
538
+ self.origin_status_302 = attributes[:'origin_status_302']
539
+ end
540
+
541
+ if attributes.key?(:'origin_status_304')
542
+ self.origin_status_304 = attributes[:'origin_status_304']
543
+ end
544
+
545
+ if attributes.key?(:'origin_status_400')
546
+ self.origin_status_400 = attributes[:'origin_status_400']
547
+ end
548
+
549
+ if attributes.key?(:'origin_status_401')
550
+ self.origin_status_401 = attributes[:'origin_status_401']
551
+ end
552
+
553
+ if attributes.key?(:'origin_status_403')
554
+ self.origin_status_403 = attributes[:'origin_status_403']
555
+ end
556
+
557
+ if attributes.key?(:'origin_status_404')
558
+ self.origin_status_404 = attributes[:'origin_status_404']
559
+ end
560
+
561
+ if attributes.key?(:'origin_status_416')
562
+ self.origin_status_416 = attributes[:'origin_status_416']
563
+ end
564
+
565
+ if attributes.key?(:'origin_status_429')
566
+ self.origin_status_429 = attributes[:'origin_status_429']
567
+ end
568
+
569
+ if attributes.key?(:'origin_status_500')
570
+ self.origin_status_500 = attributes[:'origin_status_500']
571
+ end
572
+
573
+ if attributes.key?(:'origin_status_501')
574
+ self.origin_status_501 = attributes[:'origin_status_501']
575
+ end
576
+
577
+ if attributes.key?(:'origin_status_502')
578
+ self.origin_status_502 = attributes[:'origin_status_502']
579
+ end
580
+
581
+ if attributes.key?(:'origin_status_503')
582
+ self.origin_status_503 = attributes[:'origin_status_503']
583
+ end
584
+
585
+ if attributes.key?(:'origin_status_504')
586
+ self.origin_status_504 = attributes[:'origin_status_504']
587
+ end
588
+
589
+ if attributes.key?(:'origin_status_505')
590
+ self.origin_status_505 = attributes[:'origin_status_505']
591
+ end
592
+
593
+ if attributes.key?(:'origin_status_1xx')
594
+ self.origin_status_1xx = attributes[:'origin_status_1xx']
595
+ end
596
+
597
+ if attributes.key?(:'origin_status_2xx')
598
+ self.origin_status_2xx = attributes[:'origin_status_2xx']
599
+ end
600
+
601
+ if attributes.key?(:'origin_status_3xx')
602
+ self.origin_status_3xx = attributes[:'origin_status_3xx']
603
+ end
604
+
605
+ if attributes.key?(:'origin_status_4xx')
606
+ self.origin_status_4xx = attributes[:'origin_status_4xx']
607
+ end
608
+
609
+ if attributes.key?(:'origin_status_5xx')
610
+ self.origin_status_5xx = attributes[:'origin_status_5xx']
611
+ end
612
+ end
613
+
614
+ # Show invalid properties with the reasons. Usually used together with valid?
615
+ # @return Array for valid properties with the reasons
616
+ def list_invalid_properties
617
+ invalid_properties = Array.new
618
+ invalid_properties
619
+ end
620
+
621
+ # Check to see if the all the properties in the model are valid
622
+ # @return true if the model is valid
623
+ def valid?
624
+ true
625
+ end
626
+
627
+ # Checks equality by comparing each attribute.
628
+ # @param [Object] Object to be compared
629
+ def ==(o)
630
+ return true if self.equal?(o)
631
+ self.class == o.class &&
632
+ edge_requests == o.edge_requests &&
633
+ edge_resp_header_bytes == o.edge_resp_header_bytes &&
634
+ edge_resp_body_bytes == o.edge_resp_body_bytes &&
635
+ status_1xx == o.status_1xx &&
636
+ status_2xx == o.status_2xx &&
637
+ status_3xx == o.status_3xx &&
638
+ status_4xx == o.status_4xx &&
639
+ status_5xx == o.status_5xx &&
640
+ status_200 == o.status_200 &&
641
+ status_204 == o.status_204 &&
642
+ status_206 == o.status_206 &&
643
+ status_301 == o.status_301 &&
644
+ status_302 == o.status_302 &&
645
+ status_304 == o.status_304 &&
646
+ status_400 == o.status_400 &&
647
+ status_401 == o.status_401 &&
648
+ status_403 == o.status_403 &&
649
+ status_404 == o.status_404 &&
650
+ status_416 == o.status_416 &&
651
+ status_429 == o.status_429 &&
652
+ status_500 == o.status_500 &&
653
+ status_501 == o.status_501 &&
654
+ status_502 == o.status_502 &&
655
+ status_503 == o.status_503 &&
656
+ status_504 == o.status_504 &&
657
+ status_505 == o.status_505 &&
658
+ requests == o.requests &&
659
+ resp_header_bytes == o.resp_header_bytes &&
660
+ resp_body_bytes == o.resp_body_bytes &&
661
+ bereq_header_bytes == o.bereq_header_bytes &&
662
+ bereq_body_bytes == o.bereq_body_bytes &&
663
+ edge_hit_requests == o.edge_hit_requests &&
664
+ edge_miss_requests == o.edge_miss_requests &&
665
+ origin_fetches == o.origin_fetches &&
666
+ origin_fetch_resp_header_bytes == o.origin_fetch_resp_header_bytes &&
667
+ origin_fetch_resp_body_bytes == o.origin_fetch_resp_body_bytes &&
668
+ bandwidth == o.bandwidth &&
669
+ edge_hit_ratio == o.edge_hit_ratio &&
670
+ origin_offload == o.origin_offload &&
671
+ origin_status_200 == o.origin_status_200 &&
672
+ origin_status_204 == o.origin_status_204 &&
673
+ origin_status_206 == o.origin_status_206 &&
674
+ origin_status_301 == o.origin_status_301 &&
675
+ origin_status_302 == o.origin_status_302 &&
676
+ origin_status_304 == o.origin_status_304 &&
677
+ origin_status_400 == o.origin_status_400 &&
678
+ origin_status_401 == o.origin_status_401 &&
679
+ origin_status_403 == o.origin_status_403 &&
680
+ origin_status_404 == o.origin_status_404 &&
681
+ origin_status_416 == o.origin_status_416 &&
682
+ origin_status_429 == o.origin_status_429 &&
683
+ origin_status_500 == o.origin_status_500 &&
684
+ origin_status_501 == o.origin_status_501 &&
685
+ origin_status_502 == o.origin_status_502 &&
686
+ origin_status_503 == o.origin_status_503 &&
687
+ origin_status_504 == o.origin_status_504 &&
688
+ origin_status_505 == o.origin_status_505 &&
689
+ origin_status_1xx == o.origin_status_1xx &&
690
+ origin_status_2xx == o.origin_status_2xx &&
691
+ origin_status_3xx == o.origin_status_3xx &&
692
+ origin_status_4xx == o.origin_status_4xx &&
693
+ origin_status_5xx == o.origin_status_5xx
694
+ end
695
+
696
+ # @see the `==` method
697
+ # @param [Object] Object to be compared
698
+ def eql?(o)
699
+ self == o
700
+ end
701
+
702
+ # Calculates hash code according to all attributes.
703
+ # @return [Integer] Hash code
704
+ def hash
705
+ [edge_requests, edge_resp_header_bytes, edge_resp_body_bytes, status_1xx, status_2xx, status_3xx, status_4xx, status_5xx, status_200, status_204, status_206, status_301, status_302, status_304, status_400, status_401, status_403, status_404, status_416, status_429, status_500, status_501, status_502, status_503, status_504, status_505, requests, resp_header_bytes, resp_body_bytes, bereq_header_bytes, bereq_body_bytes, edge_hit_requests, edge_miss_requests, origin_fetches, origin_fetch_resp_header_bytes, origin_fetch_resp_body_bytes, bandwidth, edge_hit_ratio, origin_offload, origin_status_200, origin_status_204, origin_status_206, origin_status_301, origin_status_302, origin_status_304, origin_status_400, origin_status_401, origin_status_403, origin_status_404, origin_status_416, origin_status_429, origin_status_500, origin_status_501, origin_status_502, origin_status_503, origin_status_504, origin_status_505, origin_status_1xx, origin_status_2xx, origin_status_3xx, origin_status_4xx, origin_status_5xx].hash
706
+ end
707
+
708
+ # Builds the object from hash
709
+ # @param [Hash] attributes Model attributes in the form of hash
710
+ # @return [Object] Returns the model itself
711
+ def self.build_from_hash(attributes)
712
+ new.build_from_hash(attributes)
713
+ end
714
+
715
+ # Builds the object from hash
716
+ # @param [Hash] attributes Model attributes in the form of hash
717
+ # @return [Object] Returns the model itself
718
+ def build_from_hash(attributes)
719
+ return nil unless attributes.is_a?(Hash)
720
+ self.class.fastly_types.each_pair do |key, type|
721
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
722
+ self.send("#{key}=", nil)
723
+ elsif type =~ /\AArray<(.*)>/i
724
+ # check to ensure the input is an array given that the attribute
725
+ # is documented as an array but the input is not
726
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
727
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
728
+ end
729
+ elsif !attributes[self.class.attribute_map[key]].nil?
730
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
731
+ end
732
+ end
733
+
734
+ self
735
+ end
736
+
737
+ # Deserializes the data based on type
738
+ # @param string type Data type
739
+ # @param string value Value to be deserialized
740
+ # @return [Object] Deserialized data
741
+ def _deserialize(type, value)
742
+ case type.to_sym
743
+ when :Time
744
+ Time.parse(value)
745
+ when :Date
746
+ Date.parse(value)
747
+ when :String
748
+ value.to_s
749
+ when :Integer
750
+ value.to_i
751
+ when :Float
752
+ value.to_f
753
+ when :Boolean
754
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
755
+ true
756
+ else
757
+ false
758
+ end
759
+ when :Object
760
+ # generic object (usually a Hash), return directly
761
+ value
762
+ when /\AArray<(?<inner_type>.+)>\z/
763
+ inner_type = Regexp.last_match[:inner_type]
764
+ value.map { |v| _deserialize(inner_type, v) }
765
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
766
+ k_type = Regexp.last_match[:k_type]
767
+ v_type = Regexp.last_match[:v_type]
768
+ {}.tap do |hash|
769
+ value.each do |k, v|
770
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
771
+ end
772
+ end
773
+ else # model
774
+ # models (e.g. Pet) or oneOf
775
+ klass = Fastly.const_get(type)
776
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
777
+ end
778
+ end
779
+
780
+ # Returns the string representation of the object
781
+ # @return [String] String presentation of the object
782
+ def to_s
783
+ to_hash.to_s
784
+ end
785
+
786
+ # to_body is an alias to to_hash (backward compatibility)
787
+ # @return [Hash] Returns the object in the form of hash
788
+ def to_body
789
+ to_hash
790
+ end
791
+
792
+ # Returns the object in the form of hash
793
+ # @return [Hash] Returns the object in the form of hash
794
+ def to_hash
795
+ hash = {}
796
+ self.class.attribute_map.each_pair do |attr, param|
797
+ value = self.send(attr)
798
+ if value.nil?
799
+ is_nullable = self.class.fastly_nullable.include?(attr)
800
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
801
+ end
802
+
803
+ hash[param] = _to_hash(value)
804
+ end
805
+ hash
806
+ end
807
+
808
+ # Outputs non-array value in the form of hash
809
+ # For object, use to_hash. Otherwise, just return the value
810
+ # @param [Object] value Any valid value
811
+ # @return [Hash] Returns the value in the form of hash
812
+ def _to_hash(value)
813
+ if value.is_a?(Array)
814
+ value.compact.map { |v| _to_hash(v) }
815
+ elsif value.is_a?(Hash)
816
+ {}.tap do |hash|
817
+ value.each { |k, v| hash[k] = _to_hash(v) }
818
+ end
819
+ elsif value.respond_to? :to_hash
820
+ value.to_hash
821
+ else
822
+ value
823
+ end
824
+ end
825
+
826
+ end
827
+
828
+ end