fastly 15.0.0 → 16.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 (164) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +40 -1
  3. data/Gemfile.lock +3 -3
  4. data/README.md +32 -3
  5. data/docs/ApisecurityOperationsApi.md +465 -0
  6. data/docs/AutomationTokensApi.md +2 -2
  7. data/docs/Backend.md +1 -0
  8. data/docs/BackendApi.md +4 -0
  9. data/docs/BackendResponse.md +1 -0
  10. data/docs/DdosProtectionApi.md +4 -4
  11. data/docs/DdosProtectionEvent.md +2 -0
  12. data/docs/DdosProtectionEventAllOf.md +2 -0
  13. data/docs/DdosProtectionRequestEnableMode.md +10 -0
  14. data/docs/DiscoveredOperationBase.md +12 -0
  15. data/docs/DiscoveredOperationGet.md +15 -0
  16. data/docs/DiscoveredOperationGetExtra.md +12 -0
  17. data/docs/DmDomainsApi.md +2 -2
  18. data/docs/DomainInspectorHistoricalApi.md +1 -1
  19. data/docs/DomainInspectorMeasurements.md +63 -0
  20. data/docs/DomainOwnershipsApi.md +2 -2
  21. data/docs/DomainResearchApi.md +103 -0
  22. data/docs/DomainResearchResponseBodyEnable.md +12 -0
  23. data/docs/DomainResearchResponseCustomer.md +10 -0
  24. data/docs/DomainResearchResponseLinks.md +10 -0
  25. data/docs/DomainResearchResponseLinksLinks.md +10 -0
  26. data/docs/DomainResearchResponseProduct.md +10 -0
  27. data/docs/DomainResearchResponseProductProduct.md +11 -0
  28. data/docs/HistoricalApi.md +8 -0
  29. data/docs/HistoricalMeta.md +1 -0
  30. data/docs/IamV1RoleResponse.md +1 -0
  31. data/docs/InlineResponse2001.md +2 -1
  32. data/docs/InlineResponse20010.md +2 -1
  33. data/docs/InlineResponse20011.md +11 -0
  34. data/docs/InlineResponse20012.md +11 -0
  35. data/docs/InlineResponse20013.md +11 -0
  36. data/docs/InlineResponse20014.md +10 -0
  37. data/docs/InlineResponse2002.md +2 -2
  38. data/docs/InlineResponse2003.md +2 -2
  39. data/docs/InlineResponse2004.md +1 -2
  40. data/docs/InlineResponse2005.md +2 -1
  41. data/docs/InlineResponse2006.md +2 -2
  42. data/docs/InlineResponse2007.md +2 -2
  43. data/docs/InlineResponse2008.md +1 -2
  44. data/docs/InlineResponse2009.md +1 -2
  45. data/docs/InsightsApi.md +3 -3
  46. data/docs/KvStoreApi.md +43 -4
  47. data/docs/KvStoreDetails.md +2 -0
  48. data/docs/KvStoreItemApi.md +2 -2
  49. data/docs/{KvStoreRequestCreate.md → KvStoreRequestCreateOrUpdate.md} +1 -1
  50. data/docs/LogInsights.md +1 -1
  51. data/docs/Meta.md +11 -0
  52. data/docs/MetricsPlatformApi.md +75 -0
  53. data/docs/NgwafRequestEnable.md +1 -0
  54. data/docs/Offer.md +12 -0
  55. data/docs/OfferAllOf.md +12 -0
  56. data/docs/OperationBase.md +14 -0
  57. data/docs/OperationCreate.md +14 -0
  58. data/docs/OperationGet.md +18 -0
  59. data/docs/OperationGetExtra.md +13 -0
  60. data/docs/OperationUpdate.md +14 -0
  61. data/docs/OriginInspectorHistoricalApi.md +1 -1
  62. data/docs/PackageMetadata.md +2 -2
  63. data/docs/PlatformMetadata.md +14 -0
  64. data/docs/PlatformMetricsResponse.md +11 -0
  65. data/docs/PlatformValues.md +25 -0
  66. data/docs/ProductDdosProtectionApi.md +3 -1
  67. data/docs/ProductDomainResearchApi.md +115 -0
  68. data/docs/RealtimeEntryAggregated.md +25 -0
  69. data/docs/RealtimeMeasurements.md +25 -0
  70. data/docs/Results.md +25 -0
  71. data/docs/SecretStoreApi.md +2 -2
  72. data/docs/SecretStoreItemApi.md +2 -2
  73. data/docs/ServiceAuthorizationsApi.md +2 -2
  74. data/docs/Status.md +15 -0
  75. data/docs/StatusAllOf.md +15 -0
  76. data/docs/Suggestion.md +13 -0
  77. data/docs/SuggestionAllOf.md +13 -0
  78. data/docs/TagBase.md +11 -0
  79. data/docs/TagCreate.md +11 -0
  80. data/docs/TagGet.md +15 -0
  81. data/docs/TagGetExtra.md +13 -0
  82. data/docs/Values.md +63 -0
  83. data/lib/fastly/api/apisecurity_operations_api.rb +829 -0
  84. data/lib/fastly/api/automation_tokens_api.rb +3 -3
  85. data/lib/fastly/api/backend_api.rb +6 -0
  86. data/lib/fastly/api/ddos_protection_api.rb +6 -6
  87. data/lib/fastly/api/dm_domains_api.rb +3 -3
  88. data/lib/fastly/api/domain_inspector_historical_api.rb +1 -1
  89. data/lib/fastly/api/domain_ownerships_api.rb +3 -3
  90. data/lib/fastly/api/domain_research_api.rb +163 -0
  91. data/lib/fastly/api/historical_api.rb +12 -0
  92. data/lib/fastly/api/kv_store_api.rb +74 -6
  93. data/lib/fastly/api/kv_store_item_api.rb +3 -3
  94. data/lib/fastly/api/metrics_platform_api.rb +134 -0
  95. data/lib/fastly/api/origin_inspector_historical_api.rb +1 -1
  96. data/lib/fastly/api/product_ddos_protection_api.rb +10 -3
  97. data/lib/fastly/api/product_domain_research_api.rb +186 -0
  98. data/lib/fastly/api/secret_store_api.rb +3 -3
  99. data/lib/fastly/api/secret_store_item_api.rb +3 -3
  100. data/lib/fastly/api/service_authorizations_api.rb +3 -3
  101. data/lib/fastly/configuration.rb +108 -0
  102. data/lib/fastly/models/backend.rb +11 -1
  103. data/lib/fastly/models/backend_response.rb +11 -1
  104. data/lib/fastly/models/ddos_protection_event.rb +21 -1
  105. data/lib/fastly/models/ddos_protection_event_all_of.rb +21 -1
  106. data/lib/fastly/models/ddos_protection_request_enable_mode.rb +251 -0
  107. data/lib/fastly/models/discovered_operation_base.rb +271 -0
  108. data/lib/fastly/models/discovered_operation_get.rb +336 -0
  109. data/lib/fastly/models/discovered_operation_get_extra.rb +271 -0
  110. data/lib/fastly/models/domain_inspector_measurements.rb +634 -4
  111. data/lib/fastly/models/domain_research_response_body_enable.rb +243 -0
  112. data/lib/fastly/models/domain_research_response_customer.rb +216 -0
  113. data/lib/fastly/models/domain_research_response_links.rb +216 -0
  114. data/lib/fastly/models/domain_research_response_links_links.rb +217 -0
  115. data/lib/fastly/models/domain_research_response_product.rb +216 -0
  116. data/lib/fastly/models/domain_research_response_product_product.rb +227 -0
  117. data/lib/fastly/models/historical_meta.rb +13 -4
  118. data/lib/fastly/models/iam_v1_role_response.rb +10 -1
  119. data/lib/fastly/models/inline_response2001.rb +12 -3
  120. data/lib/fastly/models/inline_response20010.rb +13 -4
  121. data/lib/fastly/models/inline_response20011.rb +227 -0
  122. data/lib/fastly/models/inline_response20012.rb +227 -0
  123. data/lib/fastly/models/inline_response20013.rb +227 -0
  124. data/lib/fastly/models/inline_response20014.rb +218 -0
  125. data/lib/fastly/models/inline_response2002.rb +14 -13
  126. data/lib/fastly/models/inline_response2003.rb +14 -23
  127. data/lib/fastly/models/inline_response2004.rb +5 -15
  128. data/lib/fastly/models/inline_response2005.rb +18 -8
  129. data/lib/fastly/models/inline_response2006.rb +11 -1
  130. data/lib/fastly/models/inline_response2007.rb +4 -2
  131. data/lib/fastly/models/inline_response2008.rb +8 -18
  132. data/lib/fastly/models/inline_response2009.rb +8 -17
  133. data/lib/fastly/models/kv_store_details.rb +24 -4
  134. data/lib/fastly/models/{kv_store_request_create.rb → kv_store_request_create_or_update.rb} +3 -3
  135. data/lib/fastly/models/log_insights.rb +4 -2
  136. data/lib/fastly/models/meta.rb +266 -0
  137. data/lib/fastly/models/ngwaf_request_enable.rb +14 -4
  138. data/lib/fastly/models/offer.rb +245 -0
  139. data/lib/fastly/models/offer_all_of.rb +237 -0
  140. data/lib/fastly/models/operation_base.rb +308 -0
  141. data/lib/fastly/models/operation_create.rb +315 -0
  142. data/lib/fastly/models/operation_get.rb +381 -0
  143. data/lib/fastly/models/operation_get_extra.rb +257 -0
  144. data/lib/fastly/models/operation_update.rb +308 -0
  145. data/lib/fastly/models/package_metadata.rb +2 -2
  146. data/lib/fastly/models/platform_metadata.rb +258 -0
  147. data/lib/fastly/models/platform_metrics_response.rb +228 -0
  148. data/lib/fastly/models/platform_values.rb +368 -0
  149. data/lib/fastly/models/realtime_entry_aggregated.rb +254 -4
  150. data/lib/fastly/models/realtime_measurements.rb +254 -4
  151. data/lib/fastly/models/results.rb +251 -1
  152. data/lib/fastly/models/status.rb +276 -0
  153. data/lib/fastly/models/status_all_of.rb +268 -0
  154. data/lib/fastly/models/suggestion.rb +255 -0
  155. data/lib/fastly/models/suggestion_all_of.rb +247 -0
  156. data/lib/fastly/models/tag_base.rb +275 -0
  157. data/lib/fastly/models/tag_create.rb +282 -0
  158. data/lib/fastly/models/tag_get.rb +352 -0
  159. data/lib/fastly/models/tag_get_extra.rb +267 -0
  160. data/lib/fastly/models/values.rb +634 -4
  161. data/lib/fastly/version.rb +1 -1
  162. data/lib/fastly.rb +38 -1
  163. data/sig.json +1 -1
  164. metadata +78 -4
@@ -0,0 +1,336 @@
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 DiscoveredOperationGet
16
+ # The HTTP method for the operation.
17
+ attr_accessor :method
18
+
19
+ # The domain for the operation.
20
+ attr_accessor :domain
21
+
22
+ # The path for the operation, which may include path parameters.
23
+ attr_accessor :path
24
+
25
+ # The current status of the operation.
26
+ attr_accessor :status
27
+
28
+ # The timestamp when the operation was last updated.
29
+ attr_accessor :updated_at
30
+
31
+ # The timestamp when the operation was last seen in traffic.
32
+ attr_accessor :last_seen_at
33
+
34
+ class EnumAttributeValidator
35
+ attr_reader :datatype
36
+ attr_reader :allowable_values
37
+
38
+ def initialize(datatype, allowable_values)
39
+ @allowable_values = allowable_values.map do |value|
40
+ case datatype.to_s
41
+ when /Integer/i
42
+ value.to_i
43
+ when /Float/i
44
+ value.to_f
45
+ else
46
+ value
47
+ end
48
+ end
49
+ end
50
+
51
+ def valid?(value)
52
+ !value || allowable_values.include?(value)
53
+ end
54
+ end
55
+
56
+ # Attribute mapping from ruby-style variable name to JSON key.
57
+ def self.attribute_map
58
+ {
59
+ :'method' => :'method',
60
+ :'domain' => :'domain',
61
+ :'path' => :'path',
62
+ :'status' => :'status',
63
+ :'updated_at' => :'updated_at',
64
+ :'last_seen_at' => :'last_seen_at'
65
+ }
66
+ end
67
+
68
+ # Returns all the JSON keys this model knows about
69
+ def self.acceptable_attributes
70
+ attribute_map.values
71
+ end
72
+
73
+ # Attribute type mapping.
74
+ def self.fastly_types
75
+ {
76
+ :'method' => :'String',
77
+ :'domain' => :'String',
78
+ :'path' => :'String',
79
+ :'status' => :'String',
80
+ :'updated_at' => :'Time',
81
+ :'last_seen_at' => :'Time'
82
+ }
83
+ end
84
+
85
+ # List of attributes with nullable: true
86
+ def self.fastly_nullable
87
+ Set.new([
88
+ ])
89
+ end
90
+
91
+ # List of class defined in allOf (OpenAPI v3)
92
+ def self.fastly_all_of
93
+ [
94
+ :'DiscoveredOperationBase',
95
+ :'DiscoveredOperationGetExtra'
96
+ ]
97
+ end
98
+
99
+ # Initializes the object
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ def initialize(attributes = {})
102
+ if (!attributes.is_a?(Hash))
103
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::DiscoveredOperationGet` initialize method"
104
+ end
105
+
106
+ # check to see if the attribute exists and convert string to symbol for hash key
107
+ attributes = attributes.each_with_object({}) { |(k, v), h|
108
+ if (!self.class.attribute_map.key?(k.to_sym))
109
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::DiscoveredOperationGet`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
110
+ end
111
+ h[k.to_sym] = v
112
+ }
113
+
114
+ if attributes.key?(:'method')
115
+ self.method = attributes[:'method']
116
+ end
117
+
118
+ if attributes.key?(:'domain')
119
+ self.domain = attributes[:'domain']
120
+ end
121
+
122
+ if attributes.key?(:'path')
123
+ self.path = attributes[:'path']
124
+ end
125
+
126
+ if attributes.key?(:'status')
127
+ self.status = attributes[:'status']
128
+ end
129
+
130
+ if attributes.key?(:'updated_at')
131
+ self.updated_at = attributes[:'updated_at']
132
+ end
133
+
134
+ if attributes.key?(:'last_seen_at')
135
+ self.last_seen_at = attributes[:'last_seen_at']
136
+ end
137
+ end
138
+
139
+ # Show invalid properties with the reasons. Usually used together with valid?
140
+ # @return Array for valid properties with the reasons
141
+ def list_invalid_properties
142
+ invalid_properties = Array.new
143
+ if @method.nil?
144
+ invalid_properties.push('invalid value for "method", method cannot be nil.')
145
+ end
146
+
147
+ if @domain.nil?
148
+ invalid_properties.push('invalid value for "domain", domain cannot be nil.')
149
+ end
150
+
151
+ if @path.nil?
152
+ invalid_properties.push('invalid value for "path", path cannot be nil.')
153
+ end
154
+
155
+ invalid_properties
156
+ end
157
+
158
+ # Check to see if the all the properties in the model are valid
159
+ # @return true if the model is valid
160
+ def valid?
161
+ return false if @method.nil?
162
+ method_validator = EnumAttributeValidator.new('String', ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "CONNECT", "TRACE"])
163
+ return false unless method_validator.valid?(@method)
164
+ return false if @domain.nil?
165
+ return false if @path.nil?
166
+ status_validator = EnumAttributeValidator.new('String', ["DISCOVERED", "SAVED", "IGNORED"])
167
+ return false unless status_validator.valid?(@status)
168
+ true
169
+ end
170
+
171
+ # Custom attribute writer method checking allowed values (enum).
172
+ # @param [Object] method Object to be assigned
173
+ def method=(method)
174
+ validator = EnumAttributeValidator.new('String', ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "CONNECT", "TRACE"])
175
+ unless validator.valid?(method)
176
+ fail ArgumentError, "invalid value for \"method\", must be one of #{validator.allowable_values}."
177
+ end
178
+ @method = method
179
+ end
180
+
181
+ # Custom attribute writer method checking allowed values (enum).
182
+ # @param [Object] status Object to be assigned
183
+ def status=(status)
184
+ validator = EnumAttributeValidator.new('String', ["DISCOVERED", "SAVED", "IGNORED"])
185
+ unless validator.valid?(status)
186
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
187
+ end
188
+ @status = status
189
+ end
190
+
191
+ # Checks equality by comparing each attribute.
192
+ # @param [Object] Object to be compared
193
+ def ==(o)
194
+ return true if self.equal?(o)
195
+ self.class == o.class &&
196
+ method == o.method &&
197
+ domain == o.domain &&
198
+ path == o.path &&
199
+ status == o.status &&
200
+ updated_at == o.updated_at &&
201
+ last_seen_at == o.last_seen_at
202
+ end
203
+
204
+ # @see the `==` method
205
+ # @param [Object] Object to be compared
206
+ def eql?(o)
207
+ self == o
208
+ end
209
+
210
+ # Calculates hash code according to all attributes.
211
+ # @return [Integer] Hash code
212
+ def hash
213
+ [method, domain, path, status, updated_at, last_seen_at].hash
214
+ end
215
+
216
+ # Builds the object from hash
217
+ # @param [Hash] attributes Model attributes in the form of hash
218
+ # @return [Object] Returns the model itself
219
+ def self.build_from_hash(attributes)
220
+ new.build_from_hash(attributes)
221
+ end
222
+
223
+ # Builds the object from hash
224
+ # @param [Hash] attributes Model attributes in the form of hash
225
+ # @return [Object] Returns the model itself
226
+ def build_from_hash(attributes)
227
+ return nil unless attributes.is_a?(Hash)
228
+ self.class.fastly_types.each_pair do |key, type|
229
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
230
+ self.send("#{key}=", nil)
231
+ elsif type =~ /\AArray<(.*)>/i
232
+ # check to ensure the input is an array given that the attribute
233
+ # is documented as an array but the input is not
234
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
235
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
236
+ end
237
+ elsif !attributes[self.class.attribute_map[key]].nil?
238
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
239
+ end
240
+ end
241
+
242
+ self
243
+ end
244
+
245
+ # Deserializes the data based on type
246
+ # @param string type Data type
247
+ # @param string value Value to be deserialized
248
+ # @return [Object] Deserialized data
249
+ def _deserialize(type, value)
250
+ case type.to_sym
251
+ when :Time
252
+ Time.parse(value)
253
+ when :Date
254
+ Date.parse(value)
255
+ when :String
256
+ value.to_s
257
+ when :Integer
258
+ value.to_i
259
+ when :Float
260
+ value.to_f
261
+ when :Boolean
262
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
263
+ true
264
+ else
265
+ false
266
+ end
267
+ when :Object
268
+ # generic object (usually a Hash), return directly
269
+ value
270
+ when /\AArray<(?<inner_type>.+)>\z/
271
+ inner_type = Regexp.last_match[:inner_type]
272
+ value.map { |v| _deserialize(inner_type, v) }
273
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
274
+ k_type = Regexp.last_match[:k_type]
275
+ v_type = Regexp.last_match[:v_type]
276
+ {}.tap do |hash|
277
+ value.each do |k, v|
278
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
279
+ end
280
+ end
281
+ else # model
282
+ # models (e.g. Pet) or oneOf
283
+ klass = Fastly.const_get(type)
284
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
285
+ end
286
+ end
287
+
288
+ # Returns the string representation of the object
289
+ # @return [String] String presentation of the object
290
+ def to_s
291
+ to_hash.to_s
292
+ end
293
+
294
+ # to_body is an alias to to_hash (backward compatibility)
295
+ # @return [Hash] Returns the object in the form of hash
296
+ def to_body
297
+ to_hash
298
+ end
299
+
300
+ # Returns the object in the form of hash
301
+ # @return [Hash] Returns the object in the form of hash
302
+ def to_hash
303
+ hash = {}
304
+ self.class.attribute_map.each_pair do |attr, param|
305
+ value = self.send(attr)
306
+ if value.nil?
307
+ is_nullable = self.class.fastly_nullable.include?(attr)
308
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
309
+ end
310
+
311
+ hash[param] = _to_hash(value)
312
+ end
313
+ hash
314
+ end
315
+
316
+ # Outputs non-array value in the form of hash
317
+ # For object, use to_hash. Otherwise, just return the value
318
+ # @param [Object] value Any valid value
319
+ # @return [Hash] Returns the value in the form of hash
320
+ def _to_hash(value)
321
+ if value.is_a?(Array)
322
+ value.compact.map { |v| _to_hash(v) }
323
+ elsif value.is_a?(Hash)
324
+ {}.tap do |hash|
325
+ value.each { |k, v| hash[k] = _to_hash(v) }
326
+ end
327
+ elsif value.respond_to? :to_hash
328
+ value.to_hash
329
+ else
330
+ value
331
+ end
332
+ end
333
+
334
+ end
335
+
336
+ end
@@ -0,0 +1,271 @@
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 DiscoveredOperationGetExtra
16
+ # The current status of the operation.
17
+ attr_accessor :status
18
+
19
+ # The timestamp when the operation was last updated.
20
+ attr_accessor :updated_at
21
+
22
+ # The timestamp when the operation was last seen in traffic.
23
+ attr_accessor :last_seen_at
24
+
25
+ class EnumAttributeValidator
26
+ attr_reader :datatype
27
+ attr_reader :allowable_values
28
+
29
+ def initialize(datatype, allowable_values)
30
+ @allowable_values = allowable_values.map do |value|
31
+ case datatype.to_s
32
+ when /Integer/i
33
+ value.to_i
34
+ when /Float/i
35
+ value.to_f
36
+ else
37
+ value
38
+ end
39
+ end
40
+ end
41
+
42
+ def valid?(value)
43
+ !value || allowable_values.include?(value)
44
+ end
45
+ end
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'status' => :'status',
51
+ :'updated_at' => :'updated_at',
52
+ :'last_seen_at' => :'last_seen_at'
53
+ }
54
+ end
55
+
56
+ # Returns all the JSON keys this model knows about
57
+ def self.acceptable_attributes
58
+ attribute_map.values
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.fastly_types
63
+ {
64
+ :'status' => :'String',
65
+ :'updated_at' => :'Time',
66
+ :'last_seen_at' => :'Time'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.fastly_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::DiscoveredOperationGetExtra` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!self.class.attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::DiscoveredOperationGetExtra`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ if attributes.key?(:'status')
92
+ self.status = attributes[:'status']
93
+ end
94
+
95
+ if attributes.key?(:'updated_at')
96
+ self.updated_at = attributes[:'updated_at']
97
+ end
98
+
99
+ if attributes.key?(:'last_seen_at')
100
+ self.last_seen_at = attributes[:'last_seen_at']
101
+ end
102
+ end
103
+
104
+ # Show invalid properties with the reasons. Usually used together with valid?
105
+ # @return Array for valid properties with the reasons
106
+ def list_invalid_properties
107
+ invalid_properties = Array.new
108
+ invalid_properties
109
+ end
110
+
111
+ # Check to see if the all the properties in the model are valid
112
+ # @return true if the model is valid
113
+ def valid?
114
+ status_validator = EnumAttributeValidator.new('String', ["DISCOVERED", "SAVED", "IGNORED"])
115
+ return false unless status_validator.valid?(@status)
116
+ true
117
+ end
118
+
119
+ # Custom attribute writer method checking allowed values (enum).
120
+ # @param [Object] status Object to be assigned
121
+ def status=(status)
122
+ validator = EnumAttributeValidator.new('String', ["DISCOVERED", "SAVED", "IGNORED"])
123
+ unless validator.valid?(status)
124
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
125
+ end
126
+ @status = status
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
+ status == o.status &&
135
+ updated_at == o.updated_at &&
136
+ last_seen_at == o.last_seen_at
137
+ end
138
+
139
+ # @see the `==` method
140
+ # @param [Object] Object to be compared
141
+ def eql?(o)
142
+ self == o
143
+ end
144
+
145
+ # Calculates hash code according to all attributes.
146
+ # @return [Integer] Hash code
147
+ def hash
148
+ [status, updated_at, last_seen_at].hash
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def self.build_from_hash(attributes)
155
+ new.build_from_hash(attributes)
156
+ end
157
+
158
+ # Builds the object from hash
159
+ # @param [Hash] attributes Model attributes in the form of hash
160
+ # @return [Object] Returns the model itself
161
+ def build_from_hash(attributes)
162
+ return nil unless attributes.is_a?(Hash)
163
+ self.class.fastly_types.each_pair do |key, type|
164
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
165
+ self.send("#{key}=", nil)
166
+ elsif type =~ /\AArray<(.*)>/i
167
+ # check to ensure the input is an array given that the attribute
168
+ # is documented as an array but the input is not
169
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
170
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
171
+ end
172
+ elsif !attributes[self.class.attribute_map[key]].nil?
173
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
174
+ end
175
+ end
176
+
177
+ self
178
+ end
179
+
180
+ # Deserializes the data based on type
181
+ # @param string type Data type
182
+ # @param string value Value to be deserialized
183
+ # @return [Object] Deserialized data
184
+ def _deserialize(type, value)
185
+ case type.to_sym
186
+ when :Time
187
+ Time.parse(value)
188
+ when :Date
189
+ Date.parse(value)
190
+ when :String
191
+ value.to_s
192
+ when :Integer
193
+ value.to_i
194
+ when :Float
195
+ value.to_f
196
+ when :Boolean
197
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
198
+ true
199
+ else
200
+ false
201
+ end
202
+ when :Object
203
+ # generic object (usually a Hash), return directly
204
+ value
205
+ when /\AArray<(?<inner_type>.+)>\z/
206
+ inner_type = Regexp.last_match[:inner_type]
207
+ value.map { |v| _deserialize(inner_type, v) }
208
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
209
+ k_type = Regexp.last_match[:k_type]
210
+ v_type = Regexp.last_match[:v_type]
211
+ {}.tap do |hash|
212
+ value.each do |k, v|
213
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
214
+ end
215
+ end
216
+ else # model
217
+ # models (e.g. Pet) or oneOf
218
+ klass = Fastly.const_get(type)
219
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
220
+ end
221
+ end
222
+
223
+ # Returns the string representation of the object
224
+ # @return [String] String presentation of the object
225
+ def to_s
226
+ to_hash.to_s
227
+ end
228
+
229
+ # to_body is an alias to to_hash (backward compatibility)
230
+ # @return [Hash] Returns the object in the form of hash
231
+ def to_body
232
+ to_hash
233
+ end
234
+
235
+ # Returns the object in the form of hash
236
+ # @return [Hash] Returns the object in the form of hash
237
+ def to_hash
238
+ hash = {}
239
+ self.class.attribute_map.each_pair do |attr, param|
240
+ value = self.send(attr)
241
+ if value.nil?
242
+ is_nullable = self.class.fastly_nullable.include?(attr)
243
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
244
+ end
245
+
246
+ hash[param] = _to_hash(value)
247
+ end
248
+ hash
249
+ end
250
+
251
+ # Outputs non-array value in the form of hash
252
+ # For object, use to_hash. Otherwise, just return the value
253
+ # @param [Object] value Any valid value
254
+ # @return [Hash] Returns the value in the form of hash
255
+ def _to_hash(value)
256
+ if value.is_a?(Array)
257
+ value.compact.map { |v| _to_hash(v) }
258
+ elsif value.is_a?(Hash)
259
+ {}.tap do |hash|
260
+ value.each { |k, v| hash[k] = _to_hash(v) }
261
+ end
262
+ elsif value.respond_to? :to_hash
263
+ value.to_hash
264
+ else
265
+ value
266
+ end
267
+ end
268
+
269
+ end
270
+
271
+ end