fastly 16.1.0 → 17.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (308) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +58 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +101 -58
  5. data/docs/Action.md +11 -0
  6. data/docs/ActionType.md +9 -0
  7. data/docs/AgentKey.md +14 -0
  8. data/docs/AgentKeyMeta.md +10 -0
  9. data/docs/Backend.md +3 -1
  10. data/docs/BackendApi.md +12 -4
  11. data/docs/BackendResponse.md +3 -1
  12. data/docs/BotManagementRequestUpdateConfiguration.md +10 -0
  13. data/docs/BotManagementResponseConfiguration.md +10 -0
  14. data/docs/BotManagementResponseConfigurationConfiguration.md +10 -0
  15. data/docs/BotManagementResponseConfigure.md +13 -0
  16. data/docs/ClientSideProtectionApi.md +821 -0
  17. data/docs/ConditionOperator.md +9 -0
  18. data/docs/ConditionType.md +9 -0
  19. data/docs/DdosProtectionApi.md +4 -4
  20. data/docs/Directive.md +11 -0
  21. data/docs/DmDomainsApi.md +2 -2
  22. data/docs/DmRoutingConfigsApi.md +912 -0
  23. data/docs/DomainOwnershipsApi.md +2 -2
  24. data/docs/DomainResearchApi.md +2 -2
  25. data/docs/DraftDiff.md +12 -0
  26. data/docs/DraftUpdate.md +10 -0
  27. data/docs/EventsResponse.md +1 -1
  28. data/docs/HeaderEvent.md +14 -0
  29. data/docs/InitialVersion.md +12 -0
  30. data/docs/InitialVersionPath.md +11 -0
  31. data/docs/InlineResponse20010.md +2 -2
  32. data/docs/InlineResponse20011.md +2 -2
  33. data/docs/InlineResponse20012.md +1 -1
  34. data/docs/InlineResponse20013.md +2 -2
  35. data/docs/InlineResponse20014.md +2 -1
  36. data/docs/InlineResponse20015.md +10 -0
  37. data/docs/InlineResponse20016.md +10 -0
  38. data/docs/InlineResponse20017.md +11 -0
  39. data/docs/InlineResponse20018.md +11 -0
  40. data/docs/InlineResponse20019.md +11 -0
  41. data/docs/InlineResponse20020.md +11 -0
  42. data/docs/InlineResponse20021.md +11 -0
  43. data/docs/InlineResponse20022.md +10 -0
  44. data/docs/InlineResponse2005.md +2 -2
  45. data/docs/InlineResponse2006.md +2 -2
  46. data/docs/InlineResponse2007.md +2 -2
  47. data/docs/InlineResponse2008.md +2 -1
  48. data/docs/InlineResponse2009.md +2 -1
  49. data/docs/InvitationsResponse.md +1 -1
  50. data/docs/KvStoreApi.md +2 -2
  51. data/docs/KvStoreItemApi.md +2 -2
  52. data/docs/KvStoreResponseBodyEnable.md +12 -0
  53. data/docs/KvStoreResponseCustomer.md +10 -0
  54. data/docs/KvStoreResponseLinks.md +10 -0
  55. data/docs/KvStoreResponseLinksLinks.md +10 -0
  56. data/docs/KvStoreResponseProduct.md +10 -0
  57. data/docs/KvStoreResponseProductProduct.md +11 -0
  58. data/docs/LoggingAzureblobApi.md +4 -4
  59. data/docs/LoggingAzureblobResponse.md +1 -1
  60. data/docs/LoggingCloudfilesApi.md +4 -4
  61. data/docs/LoggingCloudfilesResponse.md +1 -1
  62. data/docs/LoggingDigitaloceanApi.md +4 -4
  63. data/docs/LoggingDigitaloceanResponse.md +1 -1
  64. data/docs/LoggingFtpApi.md +4 -4
  65. data/docs/LoggingFtpResponse.md +1 -1
  66. data/docs/LoggingGcsApi.md +4 -4
  67. data/docs/LoggingGcsResponse.md +1 -1
  68. data/docs/LoggingGenericCommon.md +1 -1
  69. data/docs/LoggingGenericCommonResponse.md +1 -1
  70. data/docs/LoggingGenericCommonResponseAllOf.md +1 -1
  71. data/docs/LoggingHttpsAdditional.md +1 -1
  72. data/docs/LoggingHttpsApi.md +4 -4
  73. data/docs/LoggingHttpsResponse.md +1 -1
  74. data/docs/LoggingOpenstackApi.md +4 -4
  75. data/docs/LoggingOpenstackResponse.md +1 -1
  76. data/docs/LoggingS3Api.md +4 -4
  77. data/docs/LoggingS3Response.md +1 -1
  78. data/docs/LoggingSftpApi.md +4 -4
  79. data/docs/LoggingSftpResponse.md +1 -1
  80. data/docs/LoggingSumologicAdditional.md +1 -1
  81. data/docs/LoggingSumologicApi.md +4 -4
  82. data/docs/LoggingSumologicResponse.md +1 -1
  83. data/docs/LoggingSyslogAdditional.md +1 -1
  84. data/docs/LoggingSyslogApi.md +4 -4
  85. data/docs/LoggingSyslogResponse.md +1 -1
  86. data/docs/MutualAuthenticationsResponse.md +1 -1
  87. data/docs/NgwafAgentKeysApi.md +55 -0
  88. data/docs/NgwafSimulateApi.md +61 -0
  89. data/docs/Notification.md +11 -0
  90. data/docs/NotificationConfig.md +10 -0
  91. data/docs/Page.md +17 -0
  92. data/docs/PageCreate.md +14 -0
  93. data/docs/PageUpdate.md +14 -0
  94. data/docs/Pagination.md +1 -1
  95. data/docs/PaginationMeta.md +4 -4
  96. data/docs/PaginationMeta1.md +13 -0
  97. data/docs/PathChange.md +15 -0
  98. data/docs/PathCreate.md +10 -0
  99. data/docs/PathResponse.md +14 -0
  100. data/docs/PathResponseAllOf.md +12 -0
  101. data/docs/PathUpdate.md +10 -0
  102. data/docs/PathWithRules.md +11 -0
  103. data/docs/PathsResponse.md +11 -0
  104. data/docs/Policy.md +17 -0
  105. data/docs/PolicyCreate.md +13 -0
  106. data/docs/PolicyUpdate.md +13 -0
  107. data/docs/Position.md +11 -0
  108. data/docs/ProductBotManagementApi.md +78 -0
  109. data/docs/ProductKvStoreApi.md +115 -0
  110. data/docs/RealtimeEntry.md +1 -1
  111. data/docs/RealtimeEntryAggregated.md +34 -3
  112. data/docs/RealtimeEntryDatacenter.md +345 -0
  113. data/docs/RealtimeMeasurements.md +34 -3
  114. data/docs/Report.md +15 -0
  115. data/docs/RequestBodyForCreate.md +1 -0
  116. data/docs/RequestBodyForUpdate.md +1 -0
  117. data/docs/Results.md +34 -3
  118. data/docs/RoutingConfig.md +11 -0
  119. data/docs/RoutingConfigCondition.md +13 -0
  120. data/docs/RoutingConfigResponse.md +16 -0
  121. data/docs/RoutingConfigResponseAllOf.md +14 -0
  122. data/docs/RoutingConfigState.md +9 -0
  123. data/docs/RoutingConfigVersionResponse.md +13 -0
  124. data/docs/RoutingConfigsResponse.md +11 -0
  125. data/docs/RuleChange.md +12 -0
  126. data/docs/RuleCreate.md +12 -0
  127. data/docs/RuleResponse.md +15 -0
  128. data/docs/RuleResponseAllOf.md +13 -0
  129. data/docs/RuleUpdate.md +12 -0
  130. data/docs/RulesResponse.md +11 -0
  131. data/docs/Script.md +20 -0
  132. data/docs/ScriptUpdate.md +12 -0
  133. data/docs/SecretStoreApi.md +2 -2
  134. data/docs/SecretStoreItemApi.md +2 -2
  135. data/docs/SecurityHeader.md +12 -0
  136. data/docs/ServiceAuthorizationsApi.md +2 -2
  137. data/docs/ServiceAuthorizationsResponse.md +1 -1
  138. data/docs/SuccessfulResponseAsObject.md +1 -0
  139. data/docs/SuccessfulResponseAsObjectAllOf.md +1 -0
  140. data/docs/TlsActivationsResponse.md +1 -1
  141. data/docs/TlsBulkCertificatesResponse.md +1 -1
  142. data/docs/TlsCertificatesResponse.md +1 -1
  143. data/docs/TlsConfigurationsResponse.md +1 -1
  144. data/docs/TlsDomainsResponse.md +1 -1
  145. data/docs/TlsPrivateKeysResponse.md +1 -1
  146. data/docs/TlsSubscriptionsResponse.md +1 -1
  147. data/docs/VersionsResponse.md +11 -0
  148. data/docs/WafSimulateRequest.md +11 -0
  149. data/docs/WafSimulateResponse.md +11 -0
  150. data/docs/WafSimulateSignal.md +16 -0
  151. data/docs/Website.md +14 -0
  152. data/docs/WebsiteCreate.md +10 -0
  153. data/docs/WebsiteUpdate.md +10 -0
  154. data/lib/fastly/api/backend_api.rb +16 -4
  155. data/lib/fastly/api/client_side_protection_api.rb +1465 -0
  156. data/lib/fastly/api/ddos_protection_api.rb +6 -6
  157. data/lib/fastly/api/dm_domains_api.rb +3 -3
  158. data/lib/fastly/api/dm_routing_configs_api.rb +1596 -0
  159. data/lib/fastly/api/domain_ownerships_api.rb +3 -3
  160. data/lib/fastly/api/domain_research_api.rb +3 -3
  161. data/lib/fastly/api/kv_store_api.rb +3 -3
  162. data/lib/fastly/api/kv_store_item_api.rb +3 -3
  163. data/lib/fastly/api/logging_azureblob_api.rb +6 -6
  164. data/lib/fastly/api/logging_cloudfiles_api.rb +6 -6
  165. data/lib/fastly/api/logging_digitalocean_api.rb +6 -6
  166. data/lib/fastly/api/logging_ftp_api.rb +6 -6
  167. data/lib/fastly/api/logging_gcs_api.rb +6 -6
  168. data/lib/fastly/api/logging_https_api.rb +4 -4
  169. data/lib/fastly/api/logging_openstack_api.rb +6 -6
  170. data/lib/fastly/api/logging_s3_api.rb +6 -6
  171. data/lib/fastly/api/logging_sftp_api.rb +6 -6
  172. data/lib/fastly/api/logging_sumologic_api.rb +4 -4
  173. data/lib/fastly/api/logging_syslog_api.rb +4 -4
  174. data/lib/fastly/api/ngwaf_agent_keys_api.rb +83 -0
  175. data/lib/fastly/api/ngwaf_simulate_api.rb +95 -0
  176. data/lib/fastly/api/product_bot_management_api.rb +133 -0
  177. data/lib/fastly/api/product_kv_store_api.rb +186 -0
  178. data/lib/fastly/api/secret_store_api.rb +3 -3
  179. data/lib/fastly/api/secret_store_item_api.rb +3 -3
  180. data/lib/fastly/api/service_authorizations_api.rb +3 -3
  181. data/lib/fastly/configuration.rb +294 -0
  182. data/lib/fastly/models/action.rb +237 -0
  183. data/lib/fastly/models/action_type.rb +34 -0
  184. data/lib/fastly/models/agent_key.rb +283 -0
  185. data/lib/fastly/models/agent_key_meta.rb +223 -0
  186. data/lib/fastly/models/backend.rb +24 -2
  187. data/lib/fastly/models/backend_response.rb +24 -2
  188. data/lib/fastly/models/bot_management_request_update_configuration.rb +256 -0
  189. data/lib/fastly/models/bot_management_response_configuration.rb +216 -0
  190. data/lib/fastly/models/bot_management_response_configuration_configuration.rb +217 -0
  191. data/lib/fastly/models/bot_management_response_configure.rb +253 -0
  192. data/lib/fastly/models/condition_operator.rb +37 -0
  193. data/lib/fastly/models/condition_type.rb +34 -0
  194. data/lib/fastly/models/directive.rb +229 -0
  195. data/lib/fastly/models/draft_diff.rb +244 -0
  196. data/lib/fastly/models/draft_update.rb +218 -0
  197. data/lib/fastly/models/events_response.rb +1 -1
  198. data/lib/fastly/models/header_event.rb +252 -0
  199. data/lib/fastly/models/initial_version.rb +242 -0
  200. data/lib/fastly/models/initial_version_path.rb +254 -0
  201. data/lib/fastly/models/inline_response20010.rb +2 -2
  202. data/lib/fastly/models/inline_response20011.rb +2 -2
  203. data/lib/fastly/models/inline_response20012.rb +1 -1
  204. data/lib/fastly/models/inline_response20013.rb +11 -1
  205. data/lib/fastly/models/inline_response20014.rb +15 -4
  206. data/lib/fastly/models/inline_response20015.rb +217 -0
  207. data/lib/fastly/models/inline_response20016.rb +218 -0
  208. data/lib/fastly/models/inline_response20017.rb +227 -0
  209. data/lib/fastly/models/inline_response20018.rb +227 -0
  210. data/lib/fastly/models/inline_response20019.rb +228 -0
  211. data/lib/fastly/models/inline_response20020.rb +227 -0
  212. data/lib/fastly/models/inline_response20021.rb +227 -0
  213. data/lib/fastly/models/inline_response20022.rb +218 -0
  214. data/lib/fastly/models/inline_response2005.rb +2 -2
  215. data/lib/fastly/models/inline_response2006.rb +2 -12
  216. data/lib/fastly/models/inline_response2007.rb +2 -4
  217. data/lib/fastly/models/inline_response2008.rb +18 -8
  218. data/lib/fastly/models/inline_response2009.rb +17 -8
  219. data/lib/fastly/models/invitations_response.rb +1 -1
  220. data/lib/fastly/models/kv_store_response_body_enable.rb +243 -0
  221. data/lib/fastly/models/kv_store_response_customer.rb +216 -0
  222. data/lib/fastly/models/kv_store_response_links.rb +216 -0
  223. data/lib/fastly/models/kv_store_response_links_links.rb +217 -0
  224. data/lib/fastly/models/kv_store_response_product.rb +216 -0
  225. data/lib/fastly/models/kv_store_response_product_product.rb +227 -0
  226. data/lib/fastly/models/logging_azureblob_response.rb +3 -3
  227. data/lib/fastly/models/logging_cloudfiles_response.rb +3 -3
  228. data/lib/fastly/models/logging_digitalocean_response.rb +3 -3
  229. data/lib/fastly/models/logging_ftp_response.rb +3 -3
  230. data/lib/fastly/models/logging_gcs_response.rb +3 -3
  231. data/lib/fastly/models/logging_generic_common.rb +3 -3
  232. data/lib/fastly/models/logging_generic_common_response.rb +3 -3
  233. data/lib/fastly/models/logging_generic_common_response_all_of.rb +3 -3
  234. data/lib/fastly/models/logging_https_additional.rb +1 -1
  235. data/lib/fastly/models/logging_https_response.rb +1 -1
  236. data/lib/fastly/models/logging_message_type.rb +1 -1
  237. data/lib/fastly/models/logging_openstack_response.rb +3 -3
  238. data/lib/fastly/models/logging_s3_response.rb +3 -3
  239. data/lib/fastly/models/logging_sftp_response.rb +3 -3
  240. data/lib/fastly/models/logging_sumologic_additional.rb +1 -1
  241. data/lib/fastly/models/logging_sumologic_response.rb +1 -1
  242. data/lib/fastly/models/logging_syslog_additional.rb +1 -1
  243. data/lib/fastly/models/logging_syslog_response.rb +1 -1
  244. data/lib/fastly/models/mutual_authentications_response.rb +1 -1
  245. data/lib/fastly/models/notification.rb +270 -0
  246. data/lib/fastly/models/notification_config.rb +218 -0
  247. data/lib/fastly/models/page.rb +289 -0
  248. data/lib/fastly/models/page_create.rb +266 -0
  249. data/lib/fastly/models/page_update.rb +256 -0
  250. data/lib/fastly/models/pagination.rb +1 -1
  251. data/lib/fastly/models/pagination_meta.rb +30 -55
  252. data/lib/fastly/models/pagination_meta1.rb +273 -0
  253. data/lib/fastly/models/path_change.rb +274 -0
  254. data/lib/fastly/models/path_create.rb +242 -0
  255. data/lib/fastly/models/path_response.rb +285 -0
  256. data/lib/fastly/models/path_response_all_of.rb +254 -0
  257. data/lib/fastly/models/path_update.rb +233 -0
  258. data/lib/fastly/models/path_with_rules.rb +228 -0
  259. data/lib/fastly/models/paths_response.rb +228 -0
  260. data/lib/fastly/models/policy.rb +315 -0
  261. data/lib/fastly/models/policy_create.rb +289 -0
  262. data/lib/fastly/models/policy_update.rb +279 -0
  263. data/lib/fastly/models/position.rb +228 -0
  264. data/lib/fastly/models/realtime_entry.rb +2 -5
  265. data/lib/fastly/models/realtime_entry_aggregated.rb +344 -34
  266. data/lib/fastly/models/realtime_entry_datacenter.rb +3577 -0
  267. data/lib/fastly/models/realtime_measurements.rb +344 -34
  268. data/lib/fastly/models/report.rb +261 -0
  269. data/lib/fastly/models/request_body_for_create.rb +12 -1
  270. data/lib/fastly/models/request_body_for_update.rb +12 -1
  271. data/lib/fastly/models/results.rb +341 -31
  272. data/lib/fastly/models/routing_config.rb +251 -0
  273. data/lib/fastly/models/routing_config_condition.rb +261 -0
  274. data/lib/fastly/models/routing_config_response.rb +305 -0
  275. data/lib/fastly/models/routing_config_response_all_of.rb +274 -0
  276. data/lib/fastly/models/routing_config_state.rb +36 -0
  277. data/lib/fastly/models/routing_config_version_response.rb +250 -0
  278. data/lib/fastly/models/routing_configs_response.rb +228 -0
  279. data/lib/fastly/models/rule_change.rb +236 -0
  280. data/lib/fastly/models/rule_create.rb +267 -0
  281. data/lib/fastly/models/rule_response.rb +279 -0
  282. data/lib/fastly/models/rule_response_all_of.rb +248 -0
  283. data/lib/fastly/models/rule_update.rb +252 -0
  284. data/lib/fastly/models/rules_response.rb +228 -0
  285. data/lib/fastly/models/script.rb +350 -0
  286. data/lib/fastly/models/script_update.rb +271 -0
  287. data/lib/fastly/models/security_header.rb +234 -0
  288. data/lib/fastly/models/service_authorizations_response.rb +1 -1
  289. data/lib/fastly/models/successful_response_as_object.rb +12 -1
  290. data/lib/fastly/models/successful_response_as_object_all_of.rb +12 -1
  291. data/lib/fastly/models/tls_activations_response.rb +1 -1
  292. data/lib/fastly/models/tls_bulk_certificates_response.rb +1 -1
  293. data/lib/fastly/models/tls_certificates_response.rb +1 -1
  294. data/lib/fastly/models/tls_configurations_response.rb +1 -1
  295. data/lib/fastly/models/tls_domains_response.rb +1 -1
  296. data/lib/fastly/models/tls_private_keys_response.rb +1 -1
  297. data/lib/fastly/models/tls_subscriptions_response.rb +1 -1
  298. data/lib/fastly/models/versions_response.rb +228 -0
  299. data/lib/fastly/models/waf_simulate_request.rb +233 -0
  300. data/lib/fastly/models/waf_simulate_response.rb +240 -0
  301. data/lib/fastly/models/waf_simulate_signal.rb +344 -0
  302. data/lib/fastly/models/website.rb +257 -0
  303. data/lib/fastly/models/website_create.rb +222 -0
  304. data/lib/fastly/models/website_update.rb +217 -0
  305. data/lib/fastly/version.rb +1 -1
  306. data/lib/fastly.rb +77 -0
  307. data/sig.json +1 -1
  308. metadata +156 -2
@@ -0,0 +1,267 @@
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
+ # All attributes for creating a rule. A rule with an empty `conditions` array is the default (catch-all) rule for its path.
16
+ class RuleCreate
17
+ attr_accessor :action
18
+
19
+ # The conditions a request must satisfy for this rule to match. An empty array indicates the default rule for the path.
20
+ attr_accessor :conditions
21
+
22
+ attr_accessor :position
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'action' => :'action',
28
+ :'conditions' => :'conditions',
29
+ :'position' => :'position'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.fastly_types
40
+ {
41
+ :'action' => :'Action',
42
+ :'conditions' => :'Array<RoutingConfigCondition>',
43
+ :'position' => :'Position'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.fastly_nullable
49
+ Set.new([
50
+ ])
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::RuleCreate` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::RuleCreate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'action')
69
+ self.action = attributes[:'action']
70
+ end
71
+
72
+ if attributes.key?(:'conditions')
73
+ if (value = attributes[:'conditions']).is_a?(Array)
74
+ self.conditions = value
75
+ end
76
+ end
77
+
78
+ if attributes.key?(:'position')
79
+ self.position = attributes[:'position']
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ invalid_properties = Array.new
87
+ if @action.nil?
88
+ invalid_properties.push('invalid value for "action", action cannot be nil.')
89
+ end
90
+
91
+ if @conditions.nil?
92
+ invalid_properties.push('invalid value for "conditions", conditions cannot be nil.')
93
+ end
94
+
95
+ if @conditions.length > 5
96
+ invalid_properties.push('invalid value for "conditions", number of items must be less than or equal to 5.')
97
+ end
98
+
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ return false if @action.nil?
106
+ return false if @conditions.nil?
107
+ return false if @conditions.length > 5
108
+ true
109
+ end
110
+
111
+ # Custom attribute writer method with validation
112
+ # @param [Object] conditions Value to be assigned
113
+ def conditions=(conditions)
114
+ if conditions.nil?
115
+ fail ArgumentError, 'conditions cannot be nil'
116
+ end
117
+
118
+ if conditions.length > 5
119
+ fail ArgumentError, 'invalid value for "conditions", number of items must be less than or equal to 5.'
120
+ end
121
+
122
+ @conditions = conditions
123
+ end
124
+
125
+ # Checks equality by comparing each attribute.
126
+ # @param [Object] Object to be compared
127
+ def ==(o)
128
+ return true if self.equal?(o)
129
+ self.class == o.class &&
130
+ action == o.action &&
131
+ conditions == o.conditions &&
132
+ position == o.position
133
+ end
134
+
135
+ # @see the `==` method
136
+ # @param [Object] Object to be compared
137
+ def eql?(o)
138
+ self == o
139
+ end
140
+
141
+ # Calculates hash code according to all attributes.
142
+ # @return [Integer] Hash code
143
+ def hash
144
+ [action, conditions, position].hash
145
+ end
146
+
147
+ # Builds the object from hash
148
+ # @param [Hash] attributes Model attributes in the form of hash
149
+ # @return [Object] Returns the model itself
150
+ def self.build_from_hash(attributes)
151
+ new.build_from_hash(attributes)
152
+ end
153
+
154
+ # Builds the object from hash
155
+ # @param [Hash] attributes Model attributes in the form of hash
156
+ # @return [Object] Returns the model itself
157
+ def build_from_hash(attributes)
158
+ return nil unless attributes.is_a?(Hash)
159
+ self.class.fastly_types.each_pair do |key, type|
160
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
161
+ self.send("#{key}=", nil)
162
+ elsif type =~ /\AArray<(.*)>/i
163
+ # check to ensure the input is an array given that the attribute
164
+ # is documented as an array but the input is not
165
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
166
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
167
+ end
168
+ elsif !attributes[self.class.attribute_map[key]].nil?
169
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
170
+ end
171
+ end
172
+
173
+ self
174
+ end
175
+
176
+ # Deserializes the data based on type
177
+ # @param string type Data type
178
+ # @param string value Value to be deserialized
179
+ # @return [Object] Deserialized data
180
+ def _deserialize(type, value)
181
+ case type.to_sym
182
+ when :Time
183
+ Time.parse(value)
184
+ when :Date
185
+ Date.parse(value)
186
+ when :String
187
+ value.to_s
188
+ when :Integer
189
+ value.to_i
190
+ when :Float
191
+ value.to_f
192
+ when :Boolean
193
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
194
+ true
195
+ else
196
+ false
197
+ end
198
+ when :Object
199
+ # generic object (usually a Hash), return directly
200
+ value
201
+ when /\AArray<(?<inner_type>.+)>\z/
202
+ inner_type = Regexp.last_match[:inner_type]
203
+ value.map { |v| _deserialize(inner_type, v) }
204
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
205
+ k_type = Regexp.last_match[:k_type]
206
+ v_type = Regexp.last_match[:v_type]
207
+ {}.tap do |hash|
208
+ value.each do |k, v|
209
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
210
+ end
211
+ end
212
+ else # model
213
+ # models (e.g. Pet) or oneOf
214
+ klass = Fastly.const_get(type)
215
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
216
+ end
217
+ end
218
+
219
+ # Returns the string representation of the object
220
+ # @return [String] String presentation of the object
221
+ def to_s
222
+ to_hash.to_s
223
+ end
224
+
225
+ # to_body is an alias to to_hash (backward compatibility)
226
+ # @return [Hash] Returns the object in the form of hash
227
+ def to_body
228
+ to_hash
229
+ end
230
+
231
+ # Returns the object in the form of hash
232
+ # @return [Hash] Returns the object in the form of hash
233
+ def to_hash
234
+ hash = {}
235
+ self.class.attribute_map.each_pair do |attr, param|
236
+ value = self.send(attr)
237
+ if value.nil?
238
+ is_nullable = self.class.fastly_nullable.include?(attr)
239
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
240
+ end
241
+
242
+ hash[param] = _to_hash(value)
243
+ end
244
+ hash
245
+ end
246
+
247
+ # Outputs non-array value in the form of hash
248
+ # For object, use to_hash. Otherwise, just return the value
249
+ # @param [Object] value Any valid value
250
+ # @return [Hash] Returns the value in the form of hash
251
+ def _to_hash(value)
252
+ if value.is_a?(Array)
253
+ value.compact.map { |v| _to_hash(v) }
254
+ elsif value.is_a?(Hash)
255
+ {}.tap do |hash|
256
+ value.each { |k, v| hash[k] = _to_hash(v) }
257
+ end
258
+ elsif value.respond_to? :to_hash
259
+ value.to_hash
260
+ else
261
+ value
262
+ end
263
+ end
264
+
265
+ end
266
+
267
+ end
@@ -0,0 +1,279 @@
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
+ # All attributes for a rule response.
16
+ class RuleResponse
17
+ # Date and time in ISO 8601 format.
18
+ attr_accessor :created_at
19
+
20
+ # Date and time in ISO 8601 format.
21
+ attr_accessor :updated_at
22
+
23
+ # Alphanumeric string identifying the rule. Stable across versions of the routing config.
24
+ attr_accessor :id
25
+
26
+ # Whether this is the default (catch-all) rule for the path.
27
+ attr_accessor :is_default
28
+
29
+ attr_accessor :action
30
+
31
+ # The conditions a request must satisfy for this rule to match. Empty for the default rule.
32
+ attr_accessor :conditions
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'created_at' => :'created_at',
38
+ :'updated_at' => :'updated_at',
39
+ :'id' => :'id',
40
+ :'is_default' => :'is_default',
41
+ :'action' => :'action',
42
+ :'conditions' => :'conditions'
43
+ }
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.fastly_types
53
+ {
54
+ :'created_at' => :'Time',
55
+ :'updated_at' => :'Time',
56
+ :'id' => :'String',
57
+ :'is_default' => :'Boolean',
58
+ :'action' => :'Action',
59
+ :'conditions' => :'Array<RoutingConfigCondition>'
60
+ }
61
+ end
62
+
63
+ # List of attributes with nullable: true
64
+ def self.fastly_nullable
65
+ Set.new([
66
+ :'created_at',
67
+ :'updated_at',
68
+ ])
69
+ end
70
+
71
+ # List of class defined in allOf (OpenAPI v3)
72
+ def self.fastly_all_of
73
+ [
74
+ :'RuleResponseAllOf',
75
+ :'TimestampsNoDelete'
76
+ ]
77
+ end
78
+
79
+ # Initializes the object
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ def initialize(attributes = {})
82
+ if (!attributes.is_a?(Hash))
83
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::RuleResponse` initialize method"
84
+ end
85
+
86
+ # check to see if the attribute exists and convert string to symbol for hash key
87
+ attributes = attributes.each_with_object({}) { |(k, v), h|
88
+ if (!self.class.attribute_map.key?(k.to_sym))
89
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::RuleResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
90
+ end
91
+ h[k.to_sym] = v
92
+ }
93
+
94
+ if attributes.key?(:'created_at')
95
+ self.created_at = attributes[:'created_at']
96
+ end
97
+
98
+ if attributes.key?(:'updated_at')
99
+ self.updated_at = attributes[:'updated_at']
100
+ end
101
+
102
+ if attributes.key?(:'id')
103
+ self.id = attributes[:'id']
104
+ end
105
+
106
+ if attributes.key?(:'is_default')
107
+ self.is_default = attributes[:'is_default']
108
+ end
109
+
110
+ if attributes.key?(:'action')
111
+ self.action = attributes[:'action']
112
+ end
113
+
114
+ if attributes.key?(:'conditions')
115
+ if (value = attributes[:'conditions']).is_a?(Array)
116
+ self.conditions = value
117
+ end
118
+ end
119
+ end
120
+
121
+ # Show invalid properties with the reasons. Usually used together with valid?
122
+ # @return Array for valid properties with the reasons
123
+ def list_invalid_properties
124
+ invalid_properties = Array.new
125
+ invalid_properties
126
+ end
127
+
128
+ # Check to see if the all the properties in the model are valid
129
+ # @return true if the model is valid
130
+ def valid?
131
+ true
132
+ end
133
+
134
+ # Checks equality by comparing each attribute.
135
+ # @param [Object] Object to be compared
136
+ def ==(o)
137
+ return true if self.equal?(o)
138
+ self.class == o.class &&
139
+ created_at == o.created_at &&
140
+ updated_at == o.updated_at &&
141
+ id == o.id &&
142
+ is_default == o.is_default &&
143
+ action == o.action &&
144
+ conditions == o.conditions
145
+ end
146
+
147
+ # @see the `==` method
148
+ # @param [Object] Object to be compared
149
+ def eql?(o)
150
+ self == o
151
+ end
152
+
153
+ # Calculates hash code according to all attributes.
154
+ # @return [Integer] Hash code
155
+ def hash
156
+ [created_at, updated_at, id, is_default, action, conditions].hash
157
+ end
158
+
159
+ # Builds the object from hash
160
+ # @param [Hash] attributes Model attributes in the form of hash
161
+ # @return [Object] Returns the model itself
162
+ def self.build_from_hash(attributes)
163
+ new.build_from_hash(attributes)
164
+ end
165
+
166
+ # Builds the object from hash
167
+ # @param [Hash] attributes Model attributes in the form of hash
168
+ # @return [Object] Returns the model itself
169
+ def build_from_hash(attributes)
170
+ return nil unless attributes.is_a?(Hash)
171
+ self.class.fastly_types.each_pair do |key, type|
172
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
173
+ self.send("#{key}=", nil)
174
+ elsif type =~ /\AArray<(.*)>/i
175
+ # check to ensure the input is an array given that the attribute
176
+ # is documented as an array but the input is not
177
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
178
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
179
+ end
180
+ elsif !attributes[self.class.attribute_map[key]].nil?
181
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
182
+ end
183
+ end
184
+
185
+ self
186
+ end
187
+
188
+ # Deserializes the data based on type
189
+ # @param string type Data type
190
+ # @param string value Value to be deserialized
191
+ # @return [Object] Deserialized data
192
+ def _deserialize(type, value)
193
+ case type.to_sym
194
+ when :Time
195
+ Time.parse(value)
196
+ when :Date
197
+ Date.parse(value)
198
+ when :String
199
+ value.to_s
200
+ when :Integer
201
+ value.to_i
202
+ when :Float
203
+ value.to_f
204
+ when :Boolean
205
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
206
+ true
207
+ else
208
+ false
209
+ end
210
+ when :Object
211
+ # generic object (usually a Hash), return directly
212
+ value
213
+ when /\AArray<(?<inner_type>.+)>\z/
214
+ inner_type = Regexp.last_match[:inner_type]
215
+ value.map { |v| _deserialize(inner_type, v) }
216
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
217
+ k_type = Regexp.last_match[:k_type]
218
+ v_type = Regexp.last_match[:v_type]
219
+ {}.tap do |hash|
220
+ value.each do |k, v|
221
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
222
+ end
223
+ end
224
+ else # model
225
+ # models (e.g. Pet) or oneOf
226
+ klass = Fastly.const_get(type)
227
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
228
+ end
229
+ end
230
+
231
+ # Returns the string representation of the object
232
+ # @return [String] String presentation of the object
233
+ def to_s
234
+ to_hash.to_s
235
+ end
236
+
237
+ # to_body is an alias to to_hash (backward compatibility)
238
+ # @return [Hash] Returns the object in the form of hash
239
+ def to_body
240
+ to_hash
241
+ end
242
+
243
+ # Returns the object in the form of hash
244
+ # @return [Hash] Returns the object in the form of hash
245
+ def to_hash
246
+ hash = {}
247
+ self.class.attribute_map.each_pair do |attr, param|
248
+ value = self.send(attr)
249
+ if value.nil?
250
+ is_nullable = self.class.fastly_nullable.include?(attr)
251
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
252
+ end
253
+
254
+ hash[param] = _to_hash(value)
255
+ end
256
+ hash
257
+ end
258
+
259
+ # Outputs non-array value in the form of hash
260
+ # For object, use to_hash. Otherwise, just return the value
261
+ # @param [Object] value Any valid value
262
+ # @return [Hash] Returns the value in the form of hash
263
+ def _to_hash(value)
264
+ if value.is_a?(Array)
265
+ value.compact.map { |v| _to_hash(v) }
266
+ elsif value.is_a?(Hash)
267
+ {}.tap do |hash|
268
+ value.each { |k, v| hash[k] = _to_hash(v) }
269
+ end
270
+ elsif value.respond_to? :to_hash
271
+ value.to_hash
272
+ else
273
+ value
274
+ end
275
+ end
276
+
277
+ end
278
+
279
+ end