fastly 17.2.0 → 18.1.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.
Files changed (355) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +74 -0
  3. data/Gemfile.lock +4 -4
  4. data/README.md +76 -2
  5. data/docs/AiRuntimeControlProviderConnectionsApi.md +210 -0
  6. data/docs/AiRuntimeControlProvidersApi.md +121 -0
  7. data/docs/AiRuntimeControlResponseBodyEnable.md +12 -0
  8. data/docs/AiRuntimeControlResponseCustomer.md +10 -0
  9. data/docs/AiRuntimeControlResponseLinks.md +10 -0
  10. data/docs/AiRuntimeControlResponseLinksLinks.md +10 -0
  11. data/docs/AiRuntimeControlResponseProduct.md +10 -0
  12. data/docs/AiRuntimeControlResponseProductProduct.md +11 -0
  13. data/docs/AiRuntimeControlSessionsApi.md +69 -0
  14. data/docs/AiRuntimeControlUsageMetricsApi.md +113 -0
  15. data/docs/AiRuntimeControlVirtualKeysApi.md +334 -0
  16. data/docs/ArcBedrockSetupResponse.md +11 -0
  17. data/docs/ArcCreateVirtualKeyResponse.md +19 -0
  18. data/docs/ArcError.md +12 -0
  19. data/docs/ArcFailoverTarget.md +10 -0
  20. data/docs/ArcGetProviderConnectionResponse.md +19 -0
  21. data/docs/ArcGetProviderConnectionResponseExtra.md +10 -0
  22. data/docs/ArcModel.md +12 -0
  23. data/docs/ArcModelsMeta.md +10 -0
  24. data/docs/ArcModelsResponse.md +11 -0
  25. data/docs/ArcProvider.md +13 -0
  26. data/docs/ArcProviderConnectionApiKey.md +14 -0
  27. data/docs/ArcProviderConnectionAwsIam.md +14 -0
  28. data/docs/ArcProviderConnectionListItemResponse.md +19 -0
  29. data/docs/ArcProviderConnectionListItemResponseExtra.md +10 -0
  30. data/docs/ArcProviderConnectionRequest.md +49 -0
  31. data/docs/ArcProviderConnectionResponse.md +18 -0
  32. data/docs/ArcProviderConnectionsMeta.md +11 -0
  33. data/docs/ArcProviderConnectionsResponse.md +11 -0
  34. data/docs/ArcProvidersMeta.md +10 -0
  35. data/docs/ArcProvidersResponse.md +11 -0
  36. data/docs/ArcRotateVirtualKeyRequest.md +10 -0
  37. data/docs/ArcRotateVirtualKeyResponse.md +17 -0
  38. data/docs/ArcSession.md +28 -0
  39. data/docs/ArcSessionLogEntry.md +12 -0
  40. data/docs/ArcSessionsMeta.md +14 -0
  41. data/docs/ArcSessionsResponse.md +11 -0
  42. data/docs/ArcUpdateProviderConnectionRequest.md +14 -0
  43. data/docs/ArcUpdateVirtualKeyRequest.md +16 -0
  44. data/docs/ArcUpdateVirtualKeyResponse.md +20 -0
  45. data/docs/ArcUsageMetric.md +18 -0
  46. data/docs/ArcUsageMetricsMeta.md +11 -0
  47. data/docs/ArcUsageMetricsResponse.md +11 -0
  48. data/docs/ArcVirtualKey.md +15 -0
  49. data/docs/ArcVirtualKeyFailoverRequest.md +13 -0
  50. data/docs/ArcVirtualKeyFailoverResponse.md +13 -0
  51. data/docs/ArcVirtualKeyListItemResponse.md +26 -0
  52. data/docs/ArcVirtualKeyListItemResponseExtra.md +20 -0
  53. data/docs/ArcVirtualKeyResponse.md +25 -0
  54. data/docs/ArcVirtualKeyResponseExtra.md +19 -0
  55. data/docs/ArcVirtualKeysMeta.md +14 -0
  56. data/docs/ArcVirtualKeysResponse.md +11 -0
  57. data/docs/AutomationToken.md +6 -2
  58. data/docs/AutomationTokenCreateRequest.md +10 -1
  59. data/docs/AutomationTokenCreateResponse.md +6 -2
  60. data/docs/AutomationTokenResponse.md +5 -1
  61. data/docs/AutomationTokenRole.md +11 -0
  62. data/docs/AutomationTokenUnversionedError.md +11 -0
  63. data/docs/AutomationTokenUnversionedErrorResponse.md +10 -0
  64. data/docs/AutomationTokenWorkspace.md +11 -0
  65. data/docs/AutomationTokenWorkspacesMeta.md +12 -0
  66. data/docs/AutomationTokenWorkspacesResponse.md +12 -0
  67. data/docs/AutomationTokensApi.md +43 -1
  68. data/docs/Backend.md +5 -0
  69. data/docs/BackendApi.md +20 -0
  70. data/docs/BackendResponse.md +5 -0
  71. data/docs/BotManagementAction.md +10 -0
  72. data/docs/BotManagementApi.md +475 -0
  73. data/docs/BotManagementBot.md +10 -0
  74. data/docs/BotManagementBotAction.md +10 -0
  75. data/docs/BotManagementBotResponse.md +12 -0
  76. data/docs/BotManagementBotResponseExtra.md +11 -0
  77. data/docs/BotManagementBotsResponse.md +11 -0
  78. data/docs/BotManagementCategoriesResponse.md +11 -0
  79. data/docs/BotManagementCategory.md +10 -0
  80. data/docs/BotManagementCategoryBots.md +10 -0
  81. data/docs/BotManagementCategoryBotsAction.md +10 -0
  82. data/docs/BotManagementCategoryResponse.md +13 -0
  83. data/docs/BotManagementCategoryResponseExtra.md +12 -0
  84. data/docs/BotManagementError.md +12 -0
  85. data/docs/BotManagementInvalidRequestError.md +12 -0
  86. data/docs/BotManagementInvalidRequestErrorExtra.md +12 -0
  87. data/docs/BotManagementMeta.md +12 -0
  88. data/docs/BotManagementNotAllowedError.md +12 -0
  89. data/docs/BotManagementNotAllowedErrorExtra.md +11 -0
  90. data/docs/BotManagementNotAuthenticatedError.md +12 -0
  91. data/docs/BotManagementNotAuthenticatedErrorExtra.md +11 -0
  92. data/docs/BotManagementNotFoundError.md +12 -0
  93. data/docs/BotManagementNotFoundErrorExtra.md +11 -0
  94. data/docs/BotManagementProtectionMode.md +9 -0
  95. data/docs/BotManagementRateLimitError.md +12 -0
  96. data/docs/BotManagementRateLimitErrorExtra.md +11 -0
  97. data/docs/BotManagementWorkspace.md +12 -0
  98. data/docs/BotManagementWorkspaceBotResponse.md +13 -0
  99. data/docs/BotManagementWorkspaceBotResponseExtra.md +10 -0
  100. data/docs/BotManagementWorkspaceBotsResponse.md +11 -0
  101. data/docs/BotManagementWorkspaceResponse.md +16 -0
  102. data/docs/BotManagementWorkspaceResponseExtra.md +13 -0
  103. data/docs/BotManagementWorkspacesResponse.md +11 -0
  104. data/docs/BotRequestMetricsDataItem.md +16 -0
  105. data/docs/BotRequestMetricsMetadata.md +14 -0
  106. data/docs/BotRequestMetricsResponse.md +11 -0
  107. data/docs/BotRequestsMetricsApi.md +77 -0
  108. data/docs/BulkUpdateDictionaryItem.md +1 -1
  109. data/docs/DdosProtectionRule.md +2 -1
  110. data/docs/DdosProtectionRuleAllOf.md +2 -1
  111. data/docs/DdosProtectionRulePatch.md +1 -1
  112. data/docs/DdosProtectionRuleWithStats.md +2 -1
  113. data/docs/DictionaryItem.md +1 -1
  114. data/docs/DictionaryItemApi.md +14 -14
  115. data/docs/DictionaryItemResponse.md +1 -1
  116. data/docs/HistoricalApi.md +10 -10
  117. data/docs/MetricsPlatformApi.md +69 -13
  118. data/docs/NetworkProtectApi.md +789 -0
  119. data/docs/NetworkProtectConflict.md +13 -0
  120. data/docs/NetworkProtectConflictError.md +11 -0
  121. data/docs/NetworkProtectEndpoint.md +11 -0
  122. data/docs/NetworkProtectEndpointCreate.md +11 -0
  123. data/docs/NetworkProtectEndpointPolicy.md +11 -0
  124. data/docs/NetworkProtectEndpointResponse.md +14 -0
  125. data/docs/NetworkProtectEndpointResponseFields.md +12 -0
  126. data/docs/NetworkProtectEndpointUpdate.md +10 -0
  127. data/docs/NetworkProtectEndpointsResponse.md +11 -0
  128. data/docs/NetworkProtectErrorDetail.md +11 -0
  129. data/docs/NetworkProtectInvalidRequest.md +13 -0
  130. data/docs/NetworkProtectListMeta.md +11 -0
  131. data/docs/NetworkProtectLoaStatus.md +9 -0
  132. data/docs/NetworkProtectNetwork.md +15 -0
  133. data/docs/NetworkProtectNetworkCreate.md +14 -0
  134. data/docs/NetworkProtectNetworkResponse.md +22 -0
  135. data/docs/NetworkProtectNetworkResponseFields.md +16 -0
  136. data/docs/NetworkProtectNetworkUpdate.md +14 -0
  137. data/docs/NetworkProtectNetworksResponse.md +11 -0
  138. data/docs/NetworkProtectPolicyEndpoint.md +13 -0
  139. data/docs/NetworkProtectPrefixList.md +12 -0
  140. data/docs/NetworkProtectPrefixListCreate.md +12 -0
  141. data/docs/NetworkProtectPrefixListFamily.md +9 -0
  142. data/docs/NetworkProtectPrefixListResponse.md +15 -0
  143. data/docs/NetworkProtectPrefixListResponseFields.md +12 -0
  144. data/docs/NetworkProtectPrefixListUpdate.md +11 -0
  145. data/docs/NetworkProtectPrefixListsResponse.md +11 -0
  146. data/docs/NetworkProtectRegion.md +9 -0
  147. data/docs/NetworkProtectRoaStatus.md +9 -0
  148. data/docs/NetworkProtectRule.md +16 -0
  149. data/docs/NetworkProtectRuleAction.md +9 -0
  150. data/docs/NetworkProtectRuleDestinationPorts.md +9 -0
  151. data/docs/NetworkProtectRuleIpProtocol.md +9 -0
  152. data/docs/NetworkProtectRuleMatchDestinationIp.md +10 -0
  153. data/docs/NetworkProtectRuleMatchDestinationPorts.md +10 -0
  154. data/docs/NetworkProtectRuleMatchIpProtocol.md +10 -0
  155. data/docs/NetworkProtectRuleMatchSourcePorts.md +10 -0
  156. data/docs/NetworkProtectRuleMatchSourcePrefixList.md +10 -0
  157. data/docs/NetworkProtectRuleResponse.md +16 -0
  158. data/docs/NetworkProtectRuleSet.md +11 -0
  159. data/docs/NetworkProtectRuleSetCreate.md +11 -0
  160. data/docs/NetworkProtectRuleSetDefaultAction.md +9 -0
  161. data/docs/NetworkProtectRuleSetResponse.md +14 -0
  162. data/docs/NetworkProtectRuleSetResponseFields.md +12 -0
  163. data/docs/NetworkProtectRuleSetUpdate.md +11 -0
  164. data/docs/NetworkProtectRuleSetsResponse.md +11 -0
  165. data/docs/NetworkProtectRuleSourcePorts.md +9 -0
  166. data/docs/NetworkProtectRuleTimestamps.md +11 -0
  167. data/docs/PlatformValues.md +359 -16
  168. data/docs/ProductAiRuntimeControlApi.md +115 -0
  169. data/docs/PurgeApi.md +6 -0
  170. data/docs/RealtimeEntryAggregated.md +18 -0
  171. data/docs/RealtimeEntryDatacenter.md +18 -0
  172. data/docs/RealtimeMeasurements.md +18 -0
  173. data/docs/Results.md +18 -0
  174. data/lib/fastly/api/ai_runtime_control_provider_connections_api.rb +355 -0
  175. data/lib/fastly/api/ai_runtime_control_providers_api.rb +195 -0
  176. data/lib/fastly/api/ai_runtime_control_sessions_api.rb +112 -0
  177. data/lib/fastly/api/ai_runtime_control_usage_metrics_api.rb +176 -0
  178. data/lib/fastly/api/ai_runtime_control_virtual_keys_api.rb +580 -0
  179. data/lib/fastly/api/automation_tokens_api.rb +78 -1
  180. data/lib/fastly/api/backend_api.rb +38 -0
  181. data/lib/fastly/api/bot_management_api.rb +869 -0
  182. data/lib/fastly/api/bot_requests_metrics_api.rb +137 -0
  183. data/lib/fastly/api/dictionary_item_api.rb +14 -14
  184. data/lib/fastly/api/domain_inspector_historical_api.rb +1 -1
  185. data/lib/fastly/api/historical_api.rb +15 -15
  186. data/lib/fastly/api/metrics_platform_api.rb +131 -24
  187. data/lib/fastly/api/network_protect_api.rb +1420 -0
  188. data/lib/fastly/api/origin_inspector_historical_api.rb +1 -1
  189. data/lib/fastly/api/product_ai_runtime_control_api.rb +186 -0
  190. data/lib/fastly/api/purge_api.rb +21 -0
  191. data/lib/fastly/configuration.rb +337 -1
  192. data/lib/fastly/models/ai_runtime_control_response_body_enable.rb +243 -0
  193. data/lib/fastly/models/ai_runtime_control_response_customer.rb +216 -0
  194. data/lib/fastly/models/ai_runtime_control_response_links.rb +216 -0
  195. data/lib/fastly/models/ai_runtime_control_response_links_links.rb +217 -0
  196. data/lib/fastly/models/ai_runtime_control_response_product.rb +216 -0
  197. data/lib/fastly/models/ai_runtime_control_response_product_product.rb +227 -0
  198. data/lib/fastly/models/arc_bedrock_setup_response.rb +237 -0
  199. data/lib/fastly/models/arc_create_virtual_key_response.rb +346 -0
  200. data/lib/fastly/models/arc_error.rb +238 -0
  201. data/lib/fastly/models/arc_failover_target.rb +223 -0
  202. data/lib/fastly/models/arc_get_provider_connection_response.rb +393 -0
  203. data/lib/fastly/models/arc_get_provider_connection_response_extra.rb +224 -0
  204. data/lib/fastly/models/arc_model.rb +253 -0
  205. data/lib/fastly/models/arc_models_meta.rb +217 -0
  206. data/lib/fastly/models/arc_models_response.rb +238 -0
  207. data/lib/fastly/models/arc_provider.rb +270 -0
  208. data/lib/fastly/models/arc_provider_connection_api_key.rb +335 -0
  209. data/lib/fastly/models/arc_provider_connection_aws_iam.rb +350 -0
  210. data/lib/fastly/models/arc_provider_connection_list_item_response.rb +386 -0
  211. data/lib/fastly/models/arc_provider_connection_list_item_response_extra.rb +217 -0
  212. data/lib/fastly/models/arc_provider_connection_request.rb +103 -0
  213. data/lib/fastly/models/arc_provider_connection_response.rb +369 -0
  214. data/lib/fastly/models/arc_provider_connections_meta.rb +228 -0
  215. data/lib/fastly/models/arc_provider_connections_response.rb +238 -0
  216. data/lib/fastly/models/arc_providers_meta.rb +217 -0
  217. data/lib/fastly/models/arc_providers_response.rb +238 -0
  218. data/lib/fastly/models/arc_rotate_virtual_key_request.rb +218 -0
  219. data/lib/fastly/models/arc_rotate_virtual_key_response.rb +324 -0
  220. data/lib/fastly/models/arc_session.rb +465 -0
  221. data/lib/fastly/models/arc_session_log_entry.rb +240 -0
  222. data/lib/fastly/models/arc_sessions_meta.rb +260 -0
  223. data/lib/fastly/models/arc_sessions_response.rb +238 -0
  224. data/lib/fastly/models/arc_update_provider_connection_request.rb +275 -0
  225. data/lib/fastly/models/arc_update_virtual_key_request.rb +345 -0
  226. data/lib/fastly/models/arc_update_virtual_key_response.rb +352 -0
  227. data/lib/fastly/models/arc_usage_metric.rb +347 -0
  228. data/lib/fastly/models/arc_usage_metrics_meta.rb +228 -0
  229. data/lib/fastly/models/arc_usage_metrics_response.rb +238 -0
  230. data/lib/fastly/models/arc_virtual_key.rb +342 -0
  231. data/lib/fastly/models/arc_virtual_key_failover_request.rb +255 -0
  232. data/lib/fastly/models/arc_virtual_key_failover_response.rb +270 -0
  233. data/lib/fastly/models/arc_virtual_key_list_item_response.rb +492 -0
  234. data/lib/fastly/models/arc_virtual_key_list_item_response_extra.rb +350 -0
  235. data/lib/fastly/models/arc_virtual_key_response.rb +477 -0
  236. data/lib/fastly/models/arc_virtual_key_response_extra.rb +335 -0
  237. data/lib/fastly/models/arc_virtual_keys_meta.rb +260 -0
  238. data/lib/fastly/models/arc_virtual_keys_response.rb +238 -0
  239. data/lib/fastly/models/automation_token.rb +49 -5
  240. data/lib/fastly/models/automation_token_create_request.rb +161 -7
  241. data/lib/fastly/models/automation_token_create_response.rb +49 -5
  242. data/lib/fastly/models/automation_token_error_response.rb +1 -0
  243. data/lib/fastly/models/automation_token_response.rb +46 -2
  244. data/lib/fastly/models/automation_token_role.rb +227 -0
  245. data/lib/fastly/models/automation_token_unversioned_error.rb +225 -0
  246. data/lib/fastly/models/automation_token_unversioned_error_response.rb +219 -0
  247. data/lib/fastly/models/automation_token_workspace.rb +237 -0
  248. data/lib/fastly/models/automation_token_workspaces_meta.rb +242 -0
  249. data/lib/fastly/models/automation_token_workspaces_response.rb +253 -0
  250. data/lib/fastly/models/backend.rb +90 -1
  251. data/lib/fastly/models/backend_response.rb +90 -1
  252. data/lib/fastly/models/bot_management_action.rb +257 -0
  253. data/lib/fastly/models/bot_management_bot.rb +222 -0
  254. data/lib/fastly/models/bot_management_bot_action.rb +257 -0
  255. data/lib/fastly/models/bot_management_bot_response.rb +259 -0
  256. data/lib/fastly/models/bot_management_bot_response_extra.rb +237 -0
  257. data/lib/fastly/models/bot_management_bots_response.rb +238 -0
  258. data/lib/fastly/models/bot_management_categories_response.rb +238 -0
  259. data/lib/fastly/models/bot_management_category.rb +222 -0
  260. data/lib/fastly/models/bot_management_category_bots.rb +222 -0
  261. data/lib/fastly/models/bot_management_category_bots_action.rb +257 -0
  262. data/lib/fastly/models/bot_management_category_response.rb +269 -0
  263. data/lib/fastly/models/bot_management_category_response_extra.rb +247 -0
  264. data/lib/fastly/models/bot_management_error.rb +248 -0
  265. data/lib/fastly/models/bot_management_invalid_request_error.rb +291 -0
  266. data/lib/fastly/models/bot_management_invalid_request_error_extra.rb +283 -0
  267. data/lib/fastly/models/bot_management_meta.rb +239 -0
  268. data/lib/fastly/models/bot_management_not_allowed_error.rb +287 -0
  269. data/lib/fastly/models/bot_management_not_allowed_error_extra.rb +259 -0
  270. data/lib/fastly/models/bot_management_not_authenticated_error.rb +287 -0
  271. data/lib/fastly/models/bot_management_not_authenticated_error_extra.rb +259 -0
  272. data/lib/fastly/models/bot_management_not_found_error.rb +287 -0
  273. data/lib/fastly/models/bot_management_not_found_error_extra.rb +259 -0
  274. data/lib/fastly/models/bot_management_protection_mode.rb +36 -0
  275. data/lib/fastly/models/bot_management_rate_limit_error.rb +287 -0
  276. data/lib/fastly/models/bot_management_rate_limit_error_extra.rb +259 -0
  277. data/lib/fastly/models/bot_management_workspace.rb +276 -0
  278. data/lib/fastly/models/bot_management_workspace_bot_response.rb +275 -0
  279. data/lib/fastly/models/bot_management_workspace_bot_response_extra.rb +222 -0
  280. data/lib/fastly/models/bot_management_workspace_bots_response.rb +238 -0
  281. data/lib/fastly/models/bot_management_workspace_response.rb +354 -0
  282. data/lib/fastly/models/bot_management_workspace_response_extra.rb +264 -0
  283. data/lib/fastly/models/bot_management_workspaces_response.rb +238 -0
  284. data/lib/fastly/models/bot_request_metrics_data_item.rb +278 -0
  285. data/lib/fastly/models/bot_request_metrics_metadata.rb +258 -0
  286. data/lib/fastly/models/bot_request_metrics_response.rb +228 -0
  287. data/lib/fastly/models/bulk_update_dictionary_item.rb +1 -1
  288. data/lib/fastly/models/ddos_protection_request_enable_mode.rb +2 -2
  289. data/lib/fastly/models/ddos_protection_request_update_configuration.rb +2 -2
  290. data/lib/fastly/models/ddos_protection_rule.rb +13 -2
  291. data/lib/fastly/models/ddos_protection_rule_all_of.rb +13 -2
  292. data/lib/fastly/models/ddos_protection_rule_patch.rb +1 -1
  293. data/lib/fastly/models/ddos_protection_rule_with_stats.rb +13 -2
  294. data/lib/fastly/models/dictionary_item.rb +1 -1
  295. data/lib/fastly/models/dictionary_item_response.rb +1 -1
  296. data/lib/fastly/models/event_attributes.rb +2 -2
  297. data/lib/fastly/models/network_protect_conflict.rb +299 -0
  298. data/lib/fastly/models/network_protect_conflict_error.rb +228 -0
  299. data/lib/fastly/models/network_protect_endpoint.rb +266 -0
  300. data/lib/fastly/models/network_protect_endpoint_create.rb +266 -0
  301. data/lib/fastly/models/network_protect_endpoint_policy.rb +255 -0
  302. data/lib/fastly/models/network_protect_endpoint_response.rb +340 -0
  303. data/lib/fastly/models/network_protect_endpoint_response_fields.rb +274 -0
  304. data/lib/fastly/models/network_protect_endpoint_update.rb +251 -0
  305. data/lib/fastly/models/network_protect_endpoints_response.rb +239 -0
  306. data/lib/fastly/models/network_protect_error_detail.rb +238 -0
  307. data/lib/fastly/models/{automation_token_create_request_attributes.rb → network_protect_invalid_request.rb} +63 -75
  308. data/lib/fastly/models/network_protect_list_meta.rb +263 -0
  309. data/lib/fastly/models/network_protect_loa_status.rb +36 -0
  310. data/lib/fastly/models/network_protect_network.rb +363 -0
  311. data/lib/fastly/models/network_protect_network_create.rb +340 -0
  312. data/lib/fastly/models/network_protect_network_response.rb +477 -0
  313. data/lib/fastly/models/network_protect_network_response_fields.rb +314 -0
  314. data/lib/fastly/models/network_protect_network_update.rb +329 -0
  315. data/lib/fastly/models/network_protect_networks_response.rb +239 -0
  316. data/lib/fastly/models/network_protect_policy_endpoint.rb +307 -0
  317. data/lib/fastly/models/network_protect_prefix_list.rb +282 -0
  318. data/lib/fastly/models/network_protect_prefix_list_create.rb +301 -0
  319. data/lib/fastly/models/network_protect_prefix_list_family.rb +35 -0
  320. data/lib/fastly/models/network_protect_prefix_list_response.rb +356 -0
  321. data/lib/fastly/models/network_protect_prefix_list_response_fields.rb +274 -0
  322. data/lib/fastly/models/network_protect_prefix_list_update.rb +269 -0
  323. data/lib/fastly/models/network_protect_prefix_lists_response.rb +239 -0
  324. data/lib/fastly/models/network_protect_region.rb +34 -0
  325. data/lib/fastly/models/network_protect_roa_status.rb +37 -0
  326. data/lib/fastly/models/network_protect_rule.rb +372 -0
  327. data/lib/fastly/models/network_protect_rule_action.rb +35 -0
  328. data/lib/fastly/models/network_protect_rule_destination_ports.rb +208 -0
  329. data/lib/fastly/models/network_protect_rule_ip_protocol.rb +37 -0
  330. data/lib/fastly/models/network_protect_rule_match_destination_ip.rb +223 -0
  331. data/lib/fastly/models/network_protect_rule_match_destination_ports.rb +222 -0
  332. data/lib/fastly/models/network_protect_rule_match_ip_protocol.rb +222 -0
  333. data/lib/fastly/models/network_protect_rule_match_source_ports.rb +222 -0
  334. data/lib/fastly/models/network_protect_rule_match_source_prefix_list.rb +244 -0
  335. data/lib/fastly/models/network_protect_rule_response.rb +329 -0
  336. data/lib/fastly/models/network_protect_rule_set.rb +258 -0
  337. data/lib/fastly/models/network_protect_rule_set_create.rb +249 -0
  338. data/lib/fastly/models/network_protect_rule_set_default_action.rb +35 -0
  339. data/lib/fastly/models/network_protect_rule_set_response.rb +332 -0
  340. data/lib/fastly/models/network_protect_rule_set_response_fields.rb +274 -0
  341. data/lib/fastly/models/network_protect_rule_set_update.rb +244 -0
  342. data/lib/fastly/models/network_protect_rule_sets_response.rb +239 -0
  343. data/lib/fastly/models/network_protect_rule_source_ports.rb +208 -0
  344. data/lib/fastly/models/network_protect_rule_timestamps.rb +228 -0
  345. data/lib/fastly/models/platform_values.rb +3568 -137
  346. data/lib/fastly/models/pop.rb +6 -6
  347. data/lib/fastly/models/realtime_entry_aggregated.rb +184 -4
  348. data/lib/fastly/models/realtime_entry_datacenter.rb +184 -4
  349. data/lib/fastly/models/realtime_measurements.rb +184 -4
  350. data/lib/fastly/models/results.rb +181 -1
  351. data/lib/fastly/version.rb +1 -1
  352. data/lib/fastly.rb +145 -1
  353. data/sig.json +1 -1
  354. metadata +2502 -2214
  355. data/docs/AutomationTokenCreateRequestAttributes.md +0 -15
@@ -0,0 +1,237 @@
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 BotManagementBotResponseExtra
16
+ # The unique identifier of the bot.
17
+ attr_accessor :bot_id
18
+
19
+ # The display name of the bot.
20
+ attr_accessor :name
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'bot_id' => :'bot_id',
26
+ :'name' => :'name'
27
+ }
28
+ end
29
+
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.fastly_types
37
+ {
38
+ :'bot_id' => :'String',
39
+ :'name' => :'String'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.fastly_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::BotManagementBotResponseExtra` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::BotManagementBotResponseExtra`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'bot_id')
65
+ self.bot_id = attributes[:'bot_id']
66
+ end
67
+
68
+ if attributes.key?(:'name')
69
+ self.name = attributes[:'name']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ invalid_properties = Array.new
77
+ if @bot_id.nil?
78
+ invalid_properties.push('invalid value for "bot_id", bot_id cannot be nil.')
79
+ end
80
+
81
+ if @name.nil?
82
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
83
+ end
84
+
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ return false if @bot_id.nil?
92
+ return false if @name.nil?
93
+ true
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(o)
99
+ return true if self.equal?(o)
100
+ self.class == o.class &&
101
+ bot_id == o.bot_id &&
102
+ name == o.name
103
+ end
104
+
105
+ # @see the `==` method
106
+ # @param [Object] Object to be compared
107
+ def eql?(o)
108
+ self == o
109
+ end
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Integer] Hash code
113
+ def hash
114
+ [bot_id, name].hash
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def self.build_from_hash(attributes)
121
+ new.build_from_hash(attributes)
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ self.class.fastly_types.each_pair do |key, type|
130
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
131
+ self.send("#{key}=", nil)
132
+ elsif type =~ /\AArray<(.*)>/i
133
+ # check to ensure the input is an array given that the attribute
134
+ # is documented as an array but the input is not
135
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
136
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
137
+ end
138
+ elsif !attributes[self.class.attribute_map[key]].nil?
139
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
140
+ end
141
+ end
142
+
143
+ self
144
+ end
145
+
146
+ # Deserializes the data based on type
147
+ # @param string type Data type
148
+ # @param string value Value to be deserialized
149
+ # @return [Object] Deserialized data
150
+ def _deserialize(type, value)
151
+ case type.to_sym
152
+ when :Time
153
+ Time.parse(value)
154
+ when :Date
155
+ Date.parse(value)
156
+ when :String
157
+ value.to_s
158
+ when :Integer
159
+ value.to_i
160
+ when :Float
161
+ value.to_f
162
+ when :Boolean
163
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
164
+ true
165
+ else
166
+ false
167
+ end
168
+ when :Object
169
+ # generic object (usually a Hash), return directly
170
+ value
171
+ when /\AArray<(?<inner_type>.+)>\z/
172
+ inner_type = Regexp.last_match[:inner_type]
173
+ value.map { |v| _deserialize(inner_type, v) }
174
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
175
+ k_type = Regexp.last_match[:k_type]
176
+ v_type = Regexp.last_match[:v_type]
177
+ {}.tap do |hash|
178
+ value.each do |k, v|
179
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
180
+ end
181
+ end
182
+ else # model
183
+ # models (e.g. Pet) or oneOf
184
+ klass = Fastly.const_get(type)
185
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
186
+ end
187
+ end
188
+
189
+ # Returns the string representation of the object
190
+ # @return [String] String presentation of the object
191
+ def to_s
192
+ to_hash.to_s
193
+ end
194
+
195
+ # to_body is an alias to to_hash (backward compatibility)
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_body
198
+ to_hash
199
+ end
200
+
201
+ # Returns the object in the form of hash
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_hash
204
+ hash = {}
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ if value.nil?
208
+ is_nullable = self.class.fastly_nullable.include?(attr)
209
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
210
+ end
211
+
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ # Outputs non-array value in the form of hash
218
+ # For object, use to_hash. Otherwise, just return the value
219
+ # @param [Object] value Any valid value
220
+ # @return [Hash] Returns the value in the form of hash
221
+ def _to_hash(value)
222
+ if value.is_a?(Array)
223
+ value.compact.map { |v| _to_hash(v) }
224
+ elsif value.is_a?(Hash)
225
+ {}.tap do |hash|
226
+ value.each { |k, v| hash[k] = _to_hash(v) }
227
+ end
228
+ elsif value.respond_to? :to_hash
229
+ value.to_hash
230
+ else
231
+ value
232
+ end
233
+ end
234
+
235
+ end
236
+
237
+ end
@@ -0,0 +1,238 @@
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 BotManagementBotsResponse
16
+ attr_accessor :meta
17
+
18
+ # The bots returned by the request.
19
+ attr_accessor :data
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'meta' => :'meta',
25
+ :'data' => :'data'
26
+ }
27
+ end
28
+
29
+ # Returns all the JSON keys this model knows about
30
+ def self.acceptable_attributes
31
+ attribute_map.values
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.fastly_types
36
+ {
37
+ :'meta' => :'BotManagementMeta',
38
+ :'data' => :'Array<BotManagementBotResponse>'
39
+ }
40
+ end
41
+
42
+ # List of attributes with nullable: true
43
+ def self.fastly_nullable
44
+ Set.new([
45
+ ])
46
+ end
47
+
48
+ # Initializes the object
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ def initialize(attributes = {})
51
+ if (!attributes.is_a?(Hash))
52
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::BotManagementBotsResponse` initialize method"
53
+ end
54
+
55
+ # check to see if the attribute exists and convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h|
57
+ if (!self.class.attribute_map.key?(k.to_sym))
58
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::BotManagementBotsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
59
+ end
60
+ h[k.to_sym] = v
61
+ }
62
+
63
+ if attributes.key?(:'meta')
64
+ self.meta = attributes[:'meta']
65
+ end
66
+
67
+ if attributes.key?(:'data')
68
+ if (value = attributes[:'data']).is_a?(Array)
69
+ self.data = value
70
+ end
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = Array.new
78
+ if @meta.nil?
79
+ invalid_properties.push('invalid value for "meta", meta cannot be nil.')
80
+ end
81
+
82
+ if @data.nil?
83
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
84
+ end
85
+
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ return false if @meta.nil?
93
+ return false if @data.nil?
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ meta == o.meta &&
103
+ data == o.data
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Integer] Hash code
114
+ def hash
115
+ [meta, data].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def self.build_from_hash(attributes)
122
+ new.build_from_hash(attributes)
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ self.class.fastly_types.each_pair do |key, type|
131
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
132
+ self.send("#{key}=", nil)
133
+ elsif type =~ /\AArray<(.*)>/i
134
+ # check to ensure the input is an array given that the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
137
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
138
+ end
139
+ elsif !attributes[self.class.attribute_map[key]].nil?
140
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
141
+ end
142
+ end
143
+
144
+ self
145
+ end
146
+
147
+ # Deserializes the data based on type
148
+ # @param string type Data type
149
+ # @param string value Value to be deserialized
150
+ # @return [Object] Deserialized data
151
+ def _deserialize(type, value)
152
+ case type.to_sym
153
+ when :Time
154
+ Time.parse(value)
155
+ when :Date
156
+ Date.parse(value)
157
+ when :String
158
+ value.to_s
159
+ when :Integer
160
+ value.to_i
161
+ when :Float
162
+ value.to_f
163
+ when :Boolean
164
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
165
+ true
166
+ else
167
+ false
168
+ end
169
+ when :Object
170
+ # generic object (usually a Hash), return directly
171
+ value
172
+ when /\AArray<(?<inner_type>.+)>\z/
173
+ inner_type = Regexp.last_match[:inner_type]
174
+ value.map { |v| _deserialize(inner_type, v) }
175
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
176
+ k_type = Regexp.last_match[:k_type]
177
+ v_type = Regexp.last_match[:v_type]
178
+ {}.tap do |hash|
179
+ value.each do |k, v|
180
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
181
+ end
182
+ end
183
+ else # model
184
+ # models (e.g. Pet) or oneOf
185
+ klass = Fastly.const_get(type)
186
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
187
+ end
188
+ end
189
+
190
+ # Returns the string representation of the object
191
+ # @return [String] String presentation of the object
192
+ def to_s
193
+ to_hash.to_s
194
+ end
195
+
196
+ # to_body is an alias to to_hash (backward compatibility)
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_body
199
+ to_hash
200
+ end
201
+
202
+ # Returns the object in the form of hash
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_hash
205
+ hash = {}
206
+ self.class.attribute_map.each_pair do |attr, param|
207
+ value = self.send(attr)
208
+ if value.nil?
209
+ is_nullable = self.class.fastly_nullable.include?(attr)
210
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
211
+ end
212
+
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ # Outputs non-array value in the form of hash
219
+ # For object, use to_hash. Otherwise, just return the value
220
+ # @param [Object] value Any valid value
221
+ # @return [Hash] Returns the value in the form of hash
222
+ def _to_hash(value)
223
+ if value.is_a?(Array)
224
+ value.compact.map { |v| _to_hash(v) }
225
+ elsif value.is_a?(Hash)
226
+ {}.tap do |hash|
227
+ value.each { |k, v| hash[k] = _to_hash(v) }
228
+ end
229
+ elsif value.respond_to? :to_hash
230
+ value.to_hash
231
+ else
232
+ value
233
+ end
234
+ end
235
+
236
+ end
237
+
238
+ end
@@ -0,0 +1,238 @@
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 BotManagementCategoriesResponse
16
+ attr_accessor :meta
17
+
18
+ # The categories returned by the request.
19
+ attr_accessor :data
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'meta' => :'meta',
25
+ :'data' => :'data'
26
+ }
27
+ end
28
+
29
+ # Returns all the JSON keys this model knows about
30
+ def self.acceptable_attributes
31
+ attribute_map.values
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.fastly_types
36
+ {
37
+ :'meta' => :'BotManagementMeta',
38
+ :'data' => :'Array<BotManagementCategoryResponse>'
39
+ }
40
+ end
41
+
42
+ # List of attributes with nullable: true
43
+ def self.fastly_nullable
44
+ Set.new([
45
+ ])
46
+ end
47
+
48
+ # Initializes the object
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ def initialize(attributes = {})
51
+ if (!attributes.is_a?(Hash))
52
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::BotManagementCategoriesResponse` initialize method"
53
+ end
54
+
55
+ # check to see if the attribute exists and convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h|
57
+ if (!self.class.attribute_map.key?(k.to_sym))
58
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::BotManagementCategoriesResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
59
+ end
60
+ h[k.to_sym] = v
61
+ }
62
+
63
+ if attributes.key?(:'meta')
64
+ self.meta = attributes[:'meta']
65
+ end
66
+
67
+ if attributes.key?(:'data')
68
+ if (value = attributes[:'data']).is_a?(Array)
69
+ self.data = value
70
+ end
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = Array.new
78
+ if @meta.nil?
79
+ invalid_properties.push('invalid value for "meta", meta cannot be nil.')
80
+ end
81
+
82
+ if @data.nil?
83
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
84
+ end
85
+
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ return false if @meta.nil?
93
+ return false if @data.nil?
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ meta == o.meta &&
103
+ data == o.data
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Integer] Hash code
114
+ def hash
115
+ [meta, data].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def self.build_from_hash(attributes)
122
+ new.build_from_hash(attributes)
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ self.class.fastly_types.each_pair do |key, type|
131
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
132
+ self.send("#{key}=", nil)
133
+ elsif type =~ /\AArray<(.*)>/i
134
+ # check to ensure the input is an array given that the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
137
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
138
+ end
139
+ elsif !attributes[self.class.attribute_map[key]].nil?
140
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
141
+ end
142
+ end
143
+
144
+ self
145
+ end
146
+
147
+ # Deserializes the data based on type
148
+ # @param string type Data type
149
+ # @param string value Value to be deserialized
150
+ # @return [Object] Deserialized data
151
+ def _deserialize(type, value)
152
+ case type.to_sym
153
+ when :Time
154
+ Time.parse(value)
155
+ when :Date
156
+ Date.parse(value)
157
+ when :String
158
+ value.to_s
159
+ when :Integer
160
+ value.to_i
161
+ when :Float
162
+ value.to_f
163
+ when :Boolean
164
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
165
+ true
166
+ else
167
+ false
168
+ end
169
+ when :Object
170
+ # generic object (usually a Hash), return directly
171
+ value
172
+ when /\AArray<(?<inner_type>.+)>\z/
173
+ inner_type = Regexp.last_match[:inner_type]
174
+ value.map { |v| _deserialize(inner_type, v) }
175
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
176
+ k_type = Regexp.last_match[:k_type]
177
+ v_type = Regexp.last_match[:v_type]
178
+ {}.tap do |hash|
179
+ value.each do |k, v|
180
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
181
+ end
182
+ end
183
+ else # model
184
+ # models (e.g. Pet) or oneOf
185
+ klass = Fastly.const_get(type)
186
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
187
+ end
188
+ end
189
+
190
+ # Returns the string representation of the object
191
+ # @return [String] String presentation of the object
192
+ def to_s
193
+ to_hash.to_s
194
+ end
195
+
196
+ # to_body is an alias to to_hash (backward compatibility)
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_body
199
+ to_hash
200
+ end
201
+
202
+ # Returns the object in the form of hash
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_hash
205
+ hash = {}
206
+ self.class.attribute_map.each_pair do |attr, param|
207
+ value = self.send(attr)
208
+ if value.nil?
209
+ is_nullable = self.class.fastly_nullable.include?(attr)
210
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
211
+ end
212
+
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ # Outputs non-array value in the form of hash
219
+ # For object, use to_hash. Otherwise, just return the value
220
+ # @param [Object] value Any valid value
221
+ # @return [Hash] Returns the value in the form of hash
222
+ def _to_hash(value)
223
+ if value.is_a?(Array)
224
+ value.compact.map { |v| _to_hash(v) }
225
+ elsif value.is_a?(Hash)
226
+ {}.tap do |hash|
227
+ value.each { |k, v| hash[k] = _to_hash(v) }
228
+ end
229
+ elsif value.respond_to? :to_hash
230
+ value.to_hash
231
+ else
232
+ value
233
+ end
234
+ end
235
+
236
+ end
237
+
238
+ end