fastly 13.1.0 → 15.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 (232) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +48 -0
  3. data/Gemfile.lock +4 -4
  4. data/README.md +26 -12
  5. data/docs/ApiDiscoveryResponseBodyGetAllServices.md +13 -0
  6. data/docs/ApiDiscoveryResponseCustomer.md +10 -0
  7. data/docs/{LogTimeseriesGetResponseMetaFilters.md → ApiDiscoveryResponseCustomerCustomer.md} +3 -2
  8. data/docs/ApiDiscoveryResponseEnable.md +12 -0
  9. data/docs/ApiDiscoveryResponseEnabledServices.md +10 -0
  10. data/docs/ApiDiscoveryResponseLinks.md +10 -0
  11. data/docs/ApiDiscoveryResponseLinksGetAllServices.md +10 -0
  12. data/docs/{LogTimeseriesResultDimensions.md → ApiDiscoveryResponseLinksGetAllServicesLinks.md} +2 -2
  13. data/docs/{DdosProtectionAction.md → ApiDiscoveryResponseLinksLinks.md} +2 -1
  14. data/docs/ApiDiscoveryResponseProduct.md +10 -0
  15. data/docs/ApiDiscoveryResponseProductProduct.md +11 -0
  16. data/docs/ApiDiscoveryResponseService.md +10 -0
  17. data/docs/{BotManagementResponseServiceService.md → ApiDiscoveryResponseServiceService.md} +1 -1
  18. data/docs/AttackReport.md +19 -0
  19. data/docs/AttackSignal.md +12 -0
  20. data/docs/AttackSource.md +13 -0
  21. data/docs/Backend.md +4 -4
  22. data/docs/BackendApi.md +10 -10
  23. data/docs/BackendResponse.md +4 -4
  24. data/docs/BotManagementResponseBodyEnable.md +1 -1
  25. data/docs/BotManagementResponseService.md +1 -1
  26. data/docs/BrotliCompressionResponseBodyEnable.md +1 -1
  27. data/docs/BrotliCompressionResponseService.md +1 -1
  28. data/docs/DdosProtectionApi.md +42 -0
  29. data/docs/DdosProtectionAttributeStats.md +1 -1
  30. data/docs/DdosProtectionInvalidRequest.md +13 -0
  31. data/docs/DdosProtectionNotAuthorized.md +11 -0
  32. data/docs/DdosProtectionResponseConfigure.md +1 -1
  33. data/docs/DdosProtectionResponseEnable.md +1 -1
  34. data/docs/DdosProtectionResponseService.md +1 -1
  35. data/docs/DdosProtectionRule.md +1 -1
  36. data/docs/DdosProtectionRuleAllOf.md +1 -1
  37. data/docs/DdosProtectionRulePatch.md +10 -0
  38. data/docs/DdosProtectionRuleWithStats.md +23 -0
  39. data/docs/DdosProtectionRuleWithStatsAllOf.md +10 -0
  40. data/docs/DdosProtectionTrafficStats.md +1 -0
  41. data/docs/DdosProtectionTrafficStatsAllOf.md +1 -0
  42. data/docs/DmDomainsApi.md +220 -0
  43. data/docs/DomainInspectorResponseBodyEnable.md +1 -1
  44. data/docs/DomainInspectorResponseService.md +1 -1
  45. data/docs/DomainOwnershipsApi.md +2 -2
  46. data/docs/FanoutResponseBodyEnable.md +1 -1
  47. data/docs/FanoutResponseService.md +1 -1
  48. data/docs/Healthcheck.md +1 -1
  49. data/docs/HealthcheckApi.md +4 -4
  50. data/docs/HealthcheckResponse.md +1 -1
  51. data/docs/HistoricalApi.md +2 -0
  52. data/docs/IamRolesApi.md +23 -253
  53. data/docs/IamV1RoleListResponse.md +12 -0
  54. data/docs/IamV1RoleResponse.md +13 -0
  55. data/docs/ImageOptimizerResponseBodyEnable.md +1 -1
  56. data/docs/ImageOptimizerResponseService.md +1 -1
  57. data/docs/InlineResponse20010.md +10 -0
  58. data/docs/InlineResponse2003.md +2 -2
  59. data/docs/InlineResponse2004.md +2 -1
  60. data/docs/InlineResponse2005.md +1 -2
  61. data/docs/InlineResponse2006.md +1 -1
  62. data/docs/InlineResponse2007.md +1 -1
  63. data/docs/InlineResponse2008.md +1 -1
  64. data/docs/InlineResponse2009.md +2 -1
  65. data/docs/InvitationDataAttributes.md +1 -0
  66. data/docs/KvStoreApi.md +4 -2
  67. data/docs/KvStoreItemApi.md +2 -2
  68. data/docs/ListAttackReport.md +11 -0
  69. data/docs/ListAttackReportMeta.md +10 -0
  70. data/docs/{DdosProtectionTrafficAttribute.md → ListSignalReport.md} +2 -1
  71. data/docs/LogExplorerApi.md +1 -1
  72. data/docs/LogExplorerInsightsResponseBodyEnable.md +1 -1
  73. data/docs/LogExplorerInsightsResponseService.md +1 -1
  74. data/docs/LoggingHttpsAdditional.md +1 -0
  75. data/docs/LoggingHttpsApi.md +4 -0
  76. data/docs/LoggingHttpsResponse.md +1 -0
  77. data/docs/NgwafReportsApi.md +99 -0
  78. data/docs/NgwafResponseConfigure.md +1 -1
  79. data/docs/NgwafResponseEnable.md +1 -1
  80. data/docs/NgwafResponseService.md +1 -1
  81. data/docs/ObservabilityTimeseriesApi.md +67 -0
  82. data/docs/OriginInspectorResponseBodyEnable.md +1 -1
  83. data/docs/OriginInspectorResponseService.md +1 -1
  84. data/docs/PoolApi.md +4 -4
  85. data/docs/PoolResponse.md +1 -1
  86. data/docs/PoolResponseCommon.md +1 -1
  87. data/docs/PoolResponsePost.md +1 -1
  88. data/docs/ProductApiDiscoveryApi.md +163 -0
  89. data/docs/RealtimeEntryAggregated.md +1 -0
  90. data/docs/RealtimeMeasurements.md +1 -0
  91. data/docs/RequestBodyForCreate.md +12 -0
  92. data/docs/RequestBodyForUpdate.md +11 -0
  93. data/docs/Results.md +1 -0
  94. data/docs/SchemasUserResponse.md +1 -0
  95. data/docs/SecretStoreApi.md +2 -2
  96. data/docs/SecretStoreItemApi.md +2 -2
  97. data/docs/ServiceAuthorizationsApi.md +2 -2
  98. data/docs/SignalReport.md +13 -0
  99. data/docs/SuccessfulResponseAsObject.md +17 -0
  100. data/docs/SuccessfulResponseAsObjectAllOf.md +15 -0
  101. data/docs/TimeseriesGetResponse.md +11 -0
  102. data/docs/TimeseriesMeta.md +13 -0
  103. data/docs/TimeseriesResult.md +11 -0
  104. data/docs/TlsSubscriptionsApi.md +0 -2
  105. data/docs/TopWorkspace.md +12 -0
  106. data/docs/User.md +1 -0
  107. data/docs/UserApi.md +4 -0
  108. data/docs/UserResponse.md +1 -0
  109. data/docs/WebsocketsResponseBodyEnable.md +1 -1
  110. data/docs/WebsocketsResponseService.md +1 -1
  111. data/lib/fastly/api/backend_api.rb +16 -16
  112. data/lib/fastly/api/ddos_protection_api.rb +73 -0
  113. data/lib/fastly/api/dm_domains_api.rb +362 -0
  114. data/lib/fastly/api/domain_ownerships_api.rb +3 -3
  115. data/lib/fastly/api/healthcheck_api.rb +20 -4
  116. data/lib/fastly/api/historical_api.rb +3 -0
  117. data/lib/fastly/api/iam_roles_api.rb +43 -435
  118. data/lib/fastly/api/kv_store_api.rb +6 -3
  119. data/lib/fastly/api/kv_store_item_api.rb +3 -3
  120. data/lib/fastly/api/logging_https_api.rb +6 -0
  121. data/lib/fastly/api/ngwaf_reports_api.rb +161 -0
  122. data/lib/fastly/api/{observability_timeseries_for_logs_api.rb → observability_timeseries_api.rb} +38 -43
  123. data/lib/fastly/api/pool_api.rb +4 -4
  124. data/lib/fastly/api/product_api_discovery_api.rb +263 -0
  125. data/lib/fastly/api/secret_store_api.rb +3 -3
  126. data/lib/fastly/api/secret_store_item_api.rb +3 -3
  127. data/lib/fastly/api/service_authorizations_api.rb +3 -3
  128. data/lib/fastly/api/tls_subscriptions_api.rb +0 -3
  129. data/lib/fastly/api/user_api.rb +6 -0
  130. data/lib/fastly/configuration.rb +75 -39
  131. data/lib/fastly/models/api_discovery_response_body_get_all_services.rb +256 -0
  132. data/lib/fastly/models/api_discovery_response_customer.rb +216 -0
  133. data/lib/fastly/models/api_discovery_response_customer_customer.rb +227 -0
  134. data/lib/fastly/models/api_discovery_response_enable.rb +243 -0
  135. data/lib/fastly/models/{log_timeseries_get_response_meta_filters.rb → api_discovery_response_enabled_services.rb} +12 -13
  136. data/lib/fastly/models/api_discovery_response_links.rb +216 -0
  137. data/lib/fastly/models/api_discovery_response_links_get_all_services.rb +216 -0
  138. data/lib/fastly/models/api_discovery_response_links_get_all_services_links.rb +217 -0
  139. data/lib/fastly/models/api_discovery_response_links_links.rb +217 -0
  140. data/lib/fastly/models/api_discovery_response_product.rb +216 -0
  141. data/lib/fastly/models/api_discovery_response_product_product.rb +227 -0
  142. data/lib/fastly/models/api_discovery_response_service.rb +216 -0
  143. data/lib/fastly/models/{bot_management_response_service_service.rb → api_discovery_response_service_service.rb} +3 -3
  144. data/lib/fastly/models/attack_report.rb +359 -0
  145. data/lib/fastly/models/attack_signal.rb +252 -0
  146. data/lib/fastly/models/attack_source.rb +267 -0
  147. data/lib/fastly/models/backend.rb +7 -1
  148. data/lib/fastly/models/backend_response.rb +7 -1
  149. data/lib/fastly/models/bot_management_response_body_enable.rb +1 -1
  150. data/lib/fastly/models/bot_management_response_service.rb +1 -1
  151. data/lib/fastly/models/brotli_compression_response_body_enable.rb +1 -1
  152. data/lib/fastly/models/brotli_compression_response_service.rb +1 -1
  153. data/lib/fastly/models/ddos_protection_attribute_stats.rb +2 -1
  154. data/lib/fastly/models/ddos_protection_invalid_request.rb +309 -0
  155. data/lib/fastly/models/{log_timeseries_filter_field_item.rb → ddos_protection_not_authorized.rb} +24 -36
  156. data/lib/fastly/models/ddos_protection_response_configure.rb +1 -1
  157. data/lib/fastly/models/ddos_protection_response_enable.rb +1 -1
  158. data/lib/fastly/models/ddos_protection_response_service.rb +1 -1
  159. data/lib/fastly/models/ddos_protection_rule.rb +2 -1
  160. data/lib/fastly/models/ddos_protection_rule_all_of.rb +2 -1
  161. data/lib/fastly/models/ddos_protection_rule_patch.rb +219 -0
  162. data/lib/fastly/models/ddos_protection_rule_with_stats.rb +365 -0
  163. data/lib/fastly/models/ddos_protection_rule_with_stats_all_of.rb +216 -0
  164. data/lib/fastly/models/ddos_protection_traffic_stats.rb +20 -4
  165. data/lib/fastly/models/ddos_protection_traffic_stats_all_of.rb +20 -4
  166. data/lib/fastly/models/domain_inspector_response_body_enable.rb +1 -1
  167. data/lib/fastly/models/domain_inspector_response_service.rb +1 -1
  168. data/lib/fastly/models/fanout_response_body_enable.rb +1 -1
  169. data/lib/fastly/models/fanout_response_service.rb +1 -1
  170. data/lib/fastly/models/healthcheck.rb +25 -1
  171. data/lib/fastly/models/healthcheck_response.rb +25 -1
  172. data/lib/fastly/models/iam_v1_role_list_response.rb +240 -0
  173. data/lib/fastly/models/{iam_role_all_of.rb → iam_v1_role_response.rb} +14 -34
  174. data/lib/fastly/models/image_optimizer_response_body_enable.rb +1 -1
  175. data/lib/fastly/models/image_optimizer_response_service.rb +1 -1
  176. data/lib/fastly/models/inline_response20010.rb +218 -0
  177. data/lib/fastly/models/inline_response2003.rb +11 -1
  178. data/lib/fastly/models/inline_response2004.rb +20 -8
  179. data/lib/fastly/models/inline_response2005.rb +8 -18
  180. data/lib/fastly/models/inline_response2006.rb +1 -1
  181. data/lib/fastly/models/inline_response2007.rb +1 -1
  182. data/lib/fastly/models/inline_response2008.rb +1 -1
  183. data/lib/fastly/models/inline_response2009.rb +13 -4
  184. data/lib/fastly/models/invitation_data_attributes.rb +12 -1
  185. data/lib/fastly/models/{log_timeseries_get_response.rb → list_attack_report.rb} +5 -5
  186. data/lib/fastly/models/list_attack_report_meta.rb +218 -0
  187. data/lib/fastly/models/{log_timeseries_result_dimensions.rb → list_signal_report.rb} +12 -10
  188. data/lib/fastly/models/log_explorer_insights_response_body_enable.rb +1 -1
  189. data/lib/fastly/models/log_explorer_insights_response_service.rb +1 -1
  190. data/lib/fastly/models/logging_https_additional.rb +16 -4
  191. data/lib/fastly/models/logging_https_response.rb +13 -1
  192. data/lib/fastly/models/ngwaf_response_configure.rb +1 -1
  193. data/lib/fastly/models/ngwaf_response_enable.rb +1 -1
  194. data/lib/fastly/models/ngwaf_response_service.rb +1 -1
  195. data/lib/fastly/models/origin_inspector_response_body_enable.rb +1 -1
  196. data/lib/fastly/models/origin_inspector_response_service.rb +1 -1
  197. data/lib/fastly/models/pool_response.rb +1 -1
  198. data/lib/fastly/models/pool_response_common.rb +1 -1
  199. data/lib/fastly/models/pool_response_post.rb +1 -1
  200. data/lib/fastly/models/realtime_entry_aggregated.rb +14 -4
  201. data/lib/fastly/models/realtime_measurements.rb +14 -4
  202. data/lib/fastly/models/request_body_for_create.rb +244 -0
  203. data/lib/fastly/models/request_body_for_update.rb +229 -0
  204. data/lib/fastly/models/results.rb +11 -1
  205. data/lib/fastly/models/role_user.rb +2 -0
  206. data/lib/fastly/models/schemas_user_response.rb +13 -1
  207. data/lib/fastly/models/signal_report.rb +249 -0
  208. data/lib/fastly/models/{iam_role.rb → successful_response_as_object.rb} +37 -35
  209. data/lib/fastly/models/successful_response_as_object_all_of.rb +268 -0
  210. data/lib/fastly/models/timeseries_get_response.rb +227 -0
  211. data/lib/fastly/models/{log_timeseries_get_response_meta.rb → timeseries_meta.rb} +23 -32
  212. data/lib/fastly/models/{log_timeseries_result.rb → timeseries_result.rb} +9 -5
  213. data/lib/fastly/models/top_workspace.rb +238 -0
  214. data/lib/fastly/models/user.rb +13 -1
  215. data/lib/fastly/models/user_response.rb +13 -1
  216. data/lib/fastly/models/websockets_response_body_enable.rb +1 -1
  217. data/lib/fastly/models/websockets_response_service.rb +1 -1
  218. data/lib/fastly/version.rb +1 -1
  219. data/lib/fastly.rb +40 -13
  220. data/sig.json +1 -1
  221. metadata +82 -28
  222. data/docs/IamRole.md +0 -17
  223. data/docs/IamRoleAllOf.md +0 -15
  224. data/docs/LogTimeseriesFilterFieldItem.md +0 -12
  225. data/docs/LogTimeseriesGetResponse.md +0 -11
  226. data/docs/LogTimeseriesGetResponseMeta.md +0 -14
  227. data/docs/LogTimeseriesResult.md +0 -11
  228. data/docs/LogTimeseriesValueField.md +0 -59
  229. data/docs/ObservabilityTimeseriesForLogsApi.md +0 -67
  230. data/lib/fastly/models/ddos_protection_action.rb +0 -37
  231. data/lib/fastly/models/ddos_protection_traffic_attribute.rb +0 -40
  232. data/lib/fastly/models/log_timeseries_value_field.rb +0 -108
@@ -0,0 +1,365 @@
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 DdosProtectionRuleWithStats
16
+ # Date and time in ISO 8601 format.
17
+ attr_accessor :created_at
18
+
19
+ # Date and time in ISO 8601 format.
20
+ attr_accessor :updated_at
21
+
22
+ # Unique ID of the rule.
23
+ attr_accessor :id
24
+
25
+ # A human-readable name for the rule.
26
+ attr_accessor :name
27
+
28
+ # Action types for a rule. Supported action values are default, block, log, off. The default action value follows the current protection mode of the associated service.
29
+ attr_accessor :action
30
+
31
+ # Alphanumeric string identifying the customer.
32
+ attr_accessor :customer_id
33
+
34
+ # Alphanumeric string identifying the service.
35
+ attr_accessor :service_id
36
+
37
+ # Source IP address attribute.
38
+ attr_accessor :source_ip
39
+
40
+ # Country code attribute.
41
+ attr_accessor :country_code
42
+
43
+ # Host attribute.
44
+ attr_accessor :host
45
+
46
+ # ASN attribute.
47
+ attr_accessor :asn
48
+
49
+ # Source IP prefix attribute.
50
+ attr_accessor :source_ip_prefix
51
+
52
+ # Attribute category for additional, unlisted attributes used in a rule.
53
+ attr_accessor :additional_attributes
54
+
55
+ attr_accessor :traffic_stats
56
+
57
+ # Attribute mapping from ruby-style variable name to JSON key.
58
+ def self.attribute_map
59
+ {
60
+ :'created_at' => :'created_at',
61
+ :'updated_at' => :'updated_at',
62
+ :'id' => :'id',
63
+ :'name' => :'name',
64
+ :'action' => :'action',
65
+ :'customer_id' => :'customer_id',
66
+ :'service_id' => :'service_id',
67
+ :'source_ip' => :'source_ip',
68
+ :'country_code' => :'country_code',
69
+ :'host' => :'host',
70
+ :'asn' => :'asn',
71
+ :'source_ip_prefix' => :'source_ip_prefix',
72
+ :'additional_attributes' => :'additional_attributes',
73
+ :'traffic_stats' => :'traffic_stats'
74
+ }
75
+ end
76
+
77
+ # Returns all the JSON keys this model knows about
78
+ def self.acceptable_attributes
79
+ attribute_map.values
80
+ end
81
+
82
+ # Attribute type mapping.
83
+ def self.fastly_types
84
+ {
85
+ :'created_at' => :'Time',
86
+ :'updated_at' => :'Time',
87
+ :'id' => :'String',
88
+ :'name' => :'String',
89
+ :'action' => :'String',
90
+ :'customer_id' => :'String',
91
+ :'service_id' => :'String',
92
+ :'source_ip' => :'String',
93
+ :'country_code' => :'String',
94
+ :'host' => :'String',
95
+ :'asn' => :'String',
96
+ :'source_ip_prefix' => :'String',
97
+ :'additional_attributes' => :'Array<String>',
98
+ :'traffic_stats' => :'DdosProtectionTrafficStats'
99
+ }
100
+ end
101
+
102
+ # List of attributes with nullable: true
103
+ def self.fastly_nullable
104
+ Set.new([
105
+ :'created_at',
106
+ :'updated_at',
107
+ :'source_ip',
108
+ :'country_code',
109
+ :'host',
110
+ :'asn',
111
+ :'source_ip_prefix',
112
+ ])
113
+ end
114
+
115
+ # List of class defined in allOf (OpenAPI v3)
116
+ def self.fastly_all_of
117
+ [
118
+ :'DdosProtectionRule',
119
+ :'DdosProtectionRuleWithStatsAllOf'
120
+ ]
121
+ end
122
+
123
+ # Initializes the object
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ def initialize(attributes = {})
126
+ if (!attributes.is_a?(Hash))
127
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::DdosProtectionRuleWithStats` initialize method"
128
+ end
129
+
130
+ # check to see if the attribute exists and convert string to symbol for hash key
131
+ attributes = attributes.each_with_object({}) { |(k, v), h|
132
+ if (!self.class.attribute_map.key?(k.to_sym))
133
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::DdosProtectionRuleWithStats`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
134
+ end
135
+ h[k.to_sym] = v
136
+ }
137
+
138
+ if attributes.key?(:'created_at')
139
+ self.created_at = attributes[:'created_at']
140
+ end
141
+
142
+ if attributes.key?(:'updated_at')
143
+ self.updated_at = attributes[:'updated_at']
144
+ end
145
+
146
+ if attributes.key?(:'id')
147
+ self.id = attributes[:'id']
148
+ end
149
+
150
+ if attributes.key?(:'name')
151
+ self.name = attributes[:'name']
152
+ end
153
+
154
+ if attributes.key?(:'action')
155
+ self.action = attributes[:'action']
156
+ else
157
+ self.action = 'default'
158
+ end
159
+
160
+ if attributes.key?(:'customer_id')
161
+ self.customer_id = attributes[:'customer_id']
162
+ end
163
+
164
+ if attributes.key?(:'service_id')
165
+ self.service_id = attributes[:'service_id']
166
+ end
167
+
168
+ if attributes.key?(:'source_ip')
169
+ self.source_ip = attributes[:'source_ip']
170
+ end
171
+
172
+ if attributes.key?(:'country_code')
173
+ self.country_code = attributes[:'country_code']
174
+ end
175
+
176
+ if attributes.key?(:'host')
177
+ self.host = attributes[:'host']
178
+ end
179
+
180
+ if attributes.key?(:'asn')
181
+ self.asn = attributes[:'asn']
182
+ end
183
+
184
+ if attributes.key?(:'source_ip_prefix')
185
+ self.source_ip_prefix = attributes[:'source_ip_prefix']
186
+ end
187
+
188
+ if attributes.key?(:'additional_attributes')
189
+ if (value = attributes[:'additional_attributes']).is_a?(Array)
190
+ self.additional_attributes = value
191
+ end
192
+ end
193
+
194
+ if attributes.key?(:'traffic_stats')
195
+ self.traffic_stats = attributes[:'traffic_stats']
196
+ end
197
+ end
198
+
199
+ # Show invalid properties with the reasons. Usually used together with valid?
200
+ # @return Array for valid properties with the reasons
201
+ def list_invalid_properties
202
+ invalid_properties = Array.new
203
+ invalid_properties
204
+ end
205
+
206
+ # Check to see if the all the properties in the model are valid
207
+ # @return true if the model is valid
208
+ def valid?
209
+ true
210
+ end
211
+
212
+ # Checks equality by comparing each attribute.
213
+ # @param [Object] Object to be compared
214
+ def ==(o)
215
+ return true if self.equal?(o)
216
+ self.class == o.class &&
217
+ created_at == o.created_at &&
218
+ updated_at == o.updated_at &&
219
+ id == o.id &&
220
+ name == o.name &&
221
+ action == o.action &&
222
+ customer_id == o.customer_id &&
223
+ service_id == o.service_id &&
224
+ source_ip == o.source_ip &&
225
+ country_code == o.country_code &&
226
+ host == o.host &&
227
+ asn == o.asn &&
228
+ source_ip_prefix == o.source_ip_prefix &&
229
+ additional_attributes == o.additional_attributes &&
230
+ traffic_stats == o.traffic_stats
231
+ end
232
+
233
+ # @see the `==` method
234
+ # @param [Object] Object to be compared
235
+ def eql?(o)
236
+ self == o
237
+ end
238
+
239
+ # Calculates hash code according to all attributes.
240
+ # @return [Integer] Hash code
241
+ def hash
242
+ [created_at, updated_at, id, name, action, customer_id, service_id, source_ip, country_code, host, asn, source_ip_prefix, additional_attributes, traffic_stats].hash
243
+ end
244
+
245
+ # Builds the object from hash
246
+ # @param [Hash] attributes Model attributes in the form of hash
247
+ # @return [Object] Returns the model itself
248
+ def self.build_from_hash(attributes)
249
+ new.build_from_hash(attributes)
250
+ end
251
+
252
+ # Builds the object from hash
253
+ # @param [Hash] attributes Model attributes in the form of hash
254
+ # @return [Object] Returns the model itself
255
+ def build_from_hash(attributes)
256
+ return nil unless attributes.is_a?(Hash)
257
+ self.class.fastly_types.each_pair do |key, type|
258
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
259
+ self.send("#{key}=", nil)
260
+ elsif type =~ /\AArray<(.*)>/i
261
+ # check to ensure the input is an array given that the attribute
262
+ # is documented as an array but the input is not
263
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
264
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
265
+ end
266
+ elsif !attributes[self.class.attribute_map[key]].nil?
267
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
268
+ end
269
+ end
270
+
271
+ self
272
+ end
273
+
274
+ # Deserializes the data based on type
275
+ # @param string type Data type
276
+ # @param string value Value to be deserialized
277
+ # @return [Object] Deserialized data
278
+ def _deserialize(type, value)
279
+ case type.to_sym
280
+ when :Time
281
+ Time.parse(value)
282
+ when :Date
283
+ Date.parse(value)
284
+ when :String
285
+ value.to_s
286
+ when :Integer
287
+ value.to_i
288
+ when :Float
289
+ value.to_f
290
+ when :Boolean
291
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
292
+ true
293
+ else
294
+ false
295
+ end
296
+ when :Object
297
+ # generic object (usually a Hash), return directly
298
+ value
299
+ when /\AArray<(?<inner_type>.+)>\z/
300
+ inner_type = Regexp.last_match[:inner_type]
301
+ value.map { |v| _deserialize(inner_type, v) }
302
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
303
+ k_type = Regexp.last_match[:k_type]
304
+ v_type = Regexp.last_match[:v_type]
305
+ {}.tap do |hash|
306
+ value.each do |k, v|
307
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
308
+ end
309
+ end
310
+ else # model
311
+ # models (e.g. Pet) or oneOf
312
+ klass = Fastly.const_get(type)
313
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
314
+ end
315
+ end
316
+
317
+ # Returns the string representation of the object
318
+ # @return [String] String presentation of the object
319
+ def to_s
320
+ to_hash.to_s
321
+ end
322
+
323
+ # to_body is an alias to to_hash (backward compatibility)
324
+ # @return [Hash] Returns the object in the form of hash
325
+ def to_body
326
+ to_hash
327
+ end
328
+
329
+ # Returns the object in the form of hash
330
+ # @return [Hash] Returns the object in the form of hash
331
+ def to_hash
332
+ hash = {}
333
+ self.class.attribute_map.each_pair do |attr, param|
334
+ value = self.send(attr)
335
+ if value.nil?
336
+ is_nullable = self.class.fastly_nullable.include?(attr)
337
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
338
+ end
339
+
340
+ hash[param] = _to_hash(value)
341
+ end
342
+ hash
343
+ end
344
+
345
+ # Outputs non-array value in the form of hash
346
+ # For object, use to_hash. Otherwise, just return the value
347
+ # @param [Object] value Any valid value
348
+ # @return [Hash] Returns the value in the form of hash
349
+ def _to_hash(value)
350
+ if value.is_a?(Array)
351
+ value.compact.map { |v| _to_hash(v) }
352
+ elsif value.is_a?(Hash)
353
+ {}.tap do |hash|
354
+ value.each { |k, v| hash[k] = _to_hash(v) }
355
+ end
356
+ elsif value.respond_to? :to_hash
357
+ value.to_hash
358
+ else
359
+ value
360
+ end
361
+ end
362
+
363
+ end
364
+
365
+ end
@@ -0,0 +1,216 @@
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 DdosProtectionRuleWithStatsAllOf
16
+ attr_accessor :traffic_stats
17
+
18
+ # Attribute mapping from ruby-style variable name to JSON key.
19
+ def self.attribute_map
20
+ {
21
+ :'traffic_stats' => :'traffic_stats'
22
+ }
23
+ end
24
+
25
+ # Returns all the JSON keys this model knows about
26
+ def self.acceptable_attributes
27
+ attribute_map.values
28
+ end
29
+
30
+ # Attribute type mapping.
31
+ def self.fastly_types
32
+ {
33
+ :'traffic_stats' => :'DdosProtectionTrafficStats'
34
+ }
35
+ end
36
+
37
+ # List of attributes with nullable: true
38
+ def self.fastly_nullable
39
+ Set.new([
40
+ ])
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ if (!attributes.is_a?(Hash))
47
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::DdosProtectionRuleWithStatsAllOf` initialize method"
48
+ end
49
+
50
+ # check to see if the attribute exists and convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h|
52
+ if (!self.class.attribute_map.key?(k.to_sym))
53
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::DdosProtectionRuleWithStatsAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
54
+ end
55
+ h[k.to_sym] = v
56
+ }
57
+
58
+ if attributes.key?(:'traffic_stats')
59
+ self.traffic_stats = attributes[:'traffic_stats']
60
+ end
61
+ end
62
+
63
+ # Show invalid properties with the reasons. Usually used together with valid?
64
+ # @return Array for valid properties with the reasons
65
+ def list_invalid_properties
66
+ invalid_properties = Array.new
67
+ invalid_properties
68
+ end
69
+
70
+ # Check to see if the all the properties in the model are valid
71
+ # @return true if the model is valid
72
+ def valid?
73
+ true
74
+ end
75
+
76
+ # Checks equality by comparing each attribute.
77
+ # @param [Object] Object to be compared
78
+ def ==(o)
79
+ return true if self.equal?(o)
80
+ self.class == o.class &&
81
+ traffic_stats == o.traffic_stats
82
+ end
83
+
84
+ # @see the `==` method
85
+ # @param [Object] Object to be compared
86
+ def eql?(o)
87
+ self == o
88
+ end
89
+
90
+ # Calculates hash code according to all attributes.
91
+ # @return [Integer] Hash code
92
+ def hash
93
+ [traffic_stats].hash
94
+ end
95
+
96
+ # Builds the object from hash
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ # @return [Object] Returns the model itself
99
+ def self.build_from_hash(attributes)
100
+ new.build_from_hash(attributes)
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ def build_from_hash(attributes)
107
+ return nil unless attributes.is_a?(Hash)
108
+ self.class.fastly_types.each_pair do |key, type|
109
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
110
+ self.send("#{key}=", nil)
111
+ elsif type =~ /\AArray<(.*)>/i
112
+ # check to ensure the input is an array given that the attribute
113
+ # is documented as an array but the input is not
114
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
115
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
116
+ end
117
+ elsif !attributes[self.class.attribute_map[key]].nil?
118
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
119
+ end
120
+ end
121
+
122
+ self
123
+ end
124
+
125
+ # Deserializes the data based on type
126
+ # @param string type Data type
127
+ # @param string value Value to be deserialized
128
+ # @return [Object] Deserialized data
129
+ def _deserialize(type, value)
130
+ case type.to_sym
131
+ when :Time
132
+ Time.parse(value)
133
+ when :Date
134
+ Date.parse(value)
135
+ when :String
136
+ value.to_s
137
+ when :Integer
138
+ value.to_i
139
+ when :Float
140
+ value.to_f
141
+ when :Boolean
142
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
143
+ true
144
+ else
145
+ false
146
+ end
147
+ when :Object
148
+ # generic object (usually a Hash), return directly
149
+ value
150
+ when /\AArray<(?<inner_type>.+)>\z/
151
+ inner_type = Regexp.last_match[:inner_type]
152
+ value.map { |v| _deserialize(inner_type, v) }
153
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
154
+ k_type = Regexp.last_match[:k_type]
155
+ v_type = Regexp.last_match[:v_type]
156
+ {}.tap do |hash|
157
+ value.each do |k, v|
158
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
159
+ end
160
+ end
161
+ else # model
162
+ # models (e.g. Pet) or oneOf
163
+ klass = Fastly.const_get(type)
164
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
165
+ end
166
+ end
167
+
168
+ # Returns the string representation of the object
169
+ # @return [String] String presentation of the object
170
+ def to_s
171
+ to_hash.to_s
172
+ end
173
+
174
+ # to_body is an alias to to_hash (backward compatibility)
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_body
177
+ to_hash
178
+ end
179
+
180
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ if value.nil?
187
+ is_nullable = self.class.fastly_nullable.include?(attr)
188
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
189
+ end
190
+
191
+ hash[param] = _to_hash(value)
192
+ end
193
+ hash
194
+ end
195
+
196
+ # Outputs non-array value in the form of hash
197
+ # For object, use to_hash. Otherwise, just return the value
198
+ # @param [Object] value Any valid value
199
+ # @return [Hash] Returns the value in the form of hash
200
+ def _to_hash(value)
201
+ if value.is_a?(Array)
202
+ value.compact.map { |v| _to_hash(v) }
203
+ elsif value.is_a?(Hash)
204
+ {}.tap do |hash|
205
+ value.each { |k, v| hash[k] = _to_hash(v) }
206
+ end
207
+ elsif value.respond_to? :to_hash
208
+ value.to_hash
209
+ else
210
+ value
211
+ end
212
+ end
213
+
214
+ end
215
+
216
+ end
@@ -27,6 +27,9 @@ module Fastly
27
27
 
28
28
  attr_accessor :attributes
29
29
 
30
+ # Rule traffic percentage for the event.
31
+ attr_accessor :traffic_percentage
32
+
30
33
  # Attribute mapping from ruby-style variable name to JSON key.
31
34
  def self.attribute_map
32
35
  {
@@ -34,7 +37,8 @@ module Fastly
34
37
  :'updated_at' => :'updated_at',
35
38
  :'customer_id' => :'customer_id',
36
39
  :'service_id' => :'service_id',
37
- :'attributes' => :'attributes'
40
+ :'attributes' => :'attributes',
41
+ :'traffic_percentage' => :'traffic_percentage'
38
42
  }
39
43
  end
40
44
 
@@ -50,7 +54,8 @@ module Fastly
50
54
  :'updated_at' => :'Time',
51
55
  :'customer_id' => :'String',
52
56
  :'service_id' => :'String',
53
- :'attributes' => :'Array<DdosProtectionAttributeStats>'
57
+ :'attributes' => :'Array<DdosProtectionAttributeStats>',
58
+ :'traffic_percentage' => :'Float'
54
59
  }
55
60
  end
56
61
 
@@ -106,6 +111,10 @@ module Fastly
106
111
  self.attributes = value
107
112
  end
108
113
  end
114
+
115
+ if attributes.key?(:'traffic_percentage')
116
+ self.traffic_percentage = attributes[:'traffic_percentage']
117
+ end
109
118
  end
110
119
 
111
120
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -121,6 +130,12 @@ module Fastly
121
130
  true
122
131
  end
123
132
 
133
+ # Custom attribute writer method with validation
134
+ # @param [Object] traffic_percentage Value to be assigned
135
+ def traffic_percentage=(traffic_percentage)
136
+ @traffic_percentage = traffic_percentage
137
+ end
138
+
124
139
  # Checks equality by comparing each attribute.
125
140
  # @param [Object] Object to be compared
126
141
  def ==(o)
@@ -130,7 +145,8 @@ module Fastly
130
145
  updated_at == o.updated_at &&
131
146
  customer_id == o.customer_id &&
132
147
  service_id == o.service_id &&
133
- attributes == o.attributes
148
+ attributes == o.attributes &&
149
+ traffic_percentage == o.traffic_percentage
134
150
  end
135
151
 
136
152
  # @see the `==` method
@@ -142,7 +158,7 @@ module Fastly
142
158
  # Calculates hash code according to all attributes.
143
159
  # @return [Integer] Hash code
144
160
  def hash
145
- [created_at, updated_at, customer_id, service_id, attributes].hash
161
+ [created_at, updated_at, customer_id, service_id, attributes, traffic_percentage].hash
146
162
  end
147
163
 
148
164
  # Builds the object from hash