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