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,227 @@
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 InlineResponse20013
16
+ attr_accessor :data
17
+
18
+ attr_accessor :meta
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'data' => :'data',
24
+ :'meta' => :'meta'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.fastly_types
35
+ {
36
+ :'data' => :'Array<SecretResponse>',
37
+ :'meta' => :'PaginationCursorMeta'
38
+ }
39
+ end
40
+
41
+ # List of attributes with nullable: true
42
+ def self.fastly_nullable
43
+ Set.new([
44
+ ])
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ def initialize(attributes = {})
50
+ if (!attributes.is_a?(Hash))
51
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::InlineResponse20013` initialize method"
52
+ end
53
+
54
+ # check to see if the attribute exists and convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h|
56
+ if (!self.class.attribute_map.key?(k.to_sym))
57
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::InlineResponse20013`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58
+ end
59
+ h[k.to_sym] = v
60
+ }
61
+
62
+ if attributes.key?(:'data')
63
+ if (value = attributes[:'data']).is_a?(Array)
64
+ self.data = value
65
+ end
66
+ end
67
+
68
+ if attributes.key?(:'meta')
69
+ self.meta = attributes[:'meta']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ invalid_properties = Array.new
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ data == o.data &&
92
+ meta == o.meta
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [data, meta].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ new.build_from_hash(attributes)
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def build_from_hash(attributes)
118
+ return nil unless attributes.is_a?(Hash)
119
+ self.class.fastly_types.each_pair do |key, type|
120
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
121
+ self.send("#{key}=", nil)
122
+ elsif type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the attribute
124
+ # is documented as an array but the input is not
125
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
126
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
127
+ end
128
+ elsif !attributes[self.class.attribute_map[key]].nil?
129
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
130
+ end
131
+ end
132
+
133
+ self
134
+ end
135
+
136
+ # Deserializes the data based on type
137
+ # @param string type Data type
138
+ # @param string value Value to be deserialized
139
+ # @return [Object] Deserialized data
140
+ def _deserialize(type, value)
141
+ case type.to_sym
142
+ when :Time
143
+ Time.parse(value)
144
+ when :Date
145
+ Date.parse(value)
146
+ when :String
147
+ value.to_s
148
+ when :Integer
149
+ value.to_i
150
+ when :Float
151
+ value.to_f
152
+ when :Boolean
153
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
154
+ true
155
+ else
156
+ false
157
+ end
158
+ when :Object
159
+ # generic object (usually a Hash), return directly
160
+ value
161
+ when /\AArray<(?<inner_type>.+)>\z/
162
+ inner_type = Regexp.last_match[:inner_type]
163
+ value.map { |v| _deserialize(inner_type, v) }
164
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
165
+ k_type = Regexp.last_match[:k_type]
166
+ v_type = Regexp.last_match[:v_type]
167
+ {}.tap do |hash|
168
+ value.each do |k, v|
169
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
170
+ end
171
+ end
172
+ else # model
173
+ # models (e.g. Pet) or oneOf
174
+ klass = Fastly.const_get(type)
175
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
176
+ end
177
+ end
178
+
179
+ # Returns the string representation of the object
180
+ # @return [String] String presentation of the object
181
+ def to_s
182
+ to_hash.to_s
183
+ end
184
+
185
+ # to_body is an alias to to_hash (backward compatibility)
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_body
188
+ to_hash
189
+ end
190
+
191
+ # Returns the object in the form of hash
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_hash
194
+ hash = {}
195
+ self.class.attribute_map.each_pair do |attr, param|
196
+ value = self.send(attr)
197
+ if value.nil?
198
+ is_nullable = self.class.fastly_nullable.include?(attr)
199
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
200
+ end
201
+
202
+ hash[param] = _to_hash(value)
203
+ end
204
+ hash
205
+ end
206
+
207
+ # Outputs non-array value in the form of hash
208
+ # For object, use to_hash. Otherwise, just return the value
209
+ # @param [Object] value Any valid value
210
+ # @return [Hash] Returns the value in the form of hash
211
+ def _to_hash(value)
212
+ if value.is_a?(Array)
213
+ value.compact.map { |v| _to_hash(v) }
214
+ elsif value.is_a?(Hash)
215
+ {}.tap do |hash|
216
+ value.each { |k, v| hash[k] = _to_hash(v) }
217
+ end
218
+ elsif value.respond_to? :to_hash
219
+ value.to_hash
220
+ else
221
+ value
222
+ end
223
+ end
224
+
225
+ end
226
+
227
+ 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
+ class InlineResponse20014
16
+ attr_accessor :data
17
+
18
+ # Attribute mapping from ruby-style variable name to JSON key.
19
+ def self.attribute_map
20
+ {
21
+ :'data' => :'data'
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
+ :'data' => :'Array<ServiceAuthorizationResponseData>'
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::InlineResponse20014` 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::InlineResponse20014`. 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?(:'data')
59
+ if (value = attributes[:'data']).is_a?(Array)
60
+ self.data = value
61
+ end
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
+ data == o.data
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
+ [data].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
@@ -13,15 +13,16 @@ require 'time'
13
13
 
14
14
  module Fastly
15
15
  class InlineResponse2002
16
- attr_accessor :data
17
-
18
16
  attr_accessor :meta
19
17
 
18
+ # The operations returned by the request.
19
+ attr_accessor :data
20
+
20
21
  # Attribute mapping from ruby-style variable name to JSON key.
21
22
  def self.attribute_map
22
23
  {
23
- :'data' => :'data',
24
- :'meta' => :'meta'
24
+ :'meta' => :'meta',
25
+ :'data' => :'data'
25
26
  }
26
27
  end
27
28
 
@@ -33,8 +34,8 @@ module Fastly
33
34
  # Attribute type mapping.
34
35
  def self.fastly_types
35
36
  {
36
- :'data' => :'Array<DdosProtectionEvent>',
37
- :'meta' => :'PaginationCursorMeta'
37
+ :'meta' => :'Meta',
38
+ :'data' => :'Array<OperationGet>'
38
39
  }
39
40
  end
40
41
 
@@ -59,15 +60,15 @@ module Fastly
59
60
  h[k.to_sym] = v
60
61
  }
61
62
 
63
+ if attributes.key?(:'meta')
64
+ self.meta = attributes[:'meta']
65
+ end
66
+
62
67
  if attributes.key?(:'data')
63
68
  if (value = attributes[:'data']).is_a?(Array)
64
69
  self.data = value
65
70
  end
66
71
  end
67
-
68
- if attributes.key?(:'meta')
69
- self.meta = attributes[:'meta']
70
- end
71
72
  end
72
73
 
73
74
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -88,8 +89,8 @@ module Fastly
88
89
  def ==(o)
89
90
  return true if self.equal?(o)
90
91
  self.class == o.class &&
91
- data == o.data &&
92
- meta == o.meta
92
+ meta == o.meta &&
93
+ data == o.data
93
94
  end
94
95
 
95
96
  # @see the `==` method
@@ -101,7 +102,7 @@ module Fastly
101
102
  # Calculates hash code according to all attributes.
102
103
  # @return [Integer] Hash code
103
104
  def hash
104
- [data, meta].hash
105
+ [meta, data].hash
105
106
  end
106
107
 
107
108
  # Builds the object from hash
@@ -13,15 +13,16 @@ require 'time'
13
13
 
14
14
  module Fastly
15
15
  class InlineResponse2003
16
- attr_accessor :data
17
-
18
16
  attr_accessor :meta
19
17
 
18
+ # The operation tags returned by the request.
19
+ attr_accessor :data
20
+
20
21
  # Attribute mapping from ruby-style variable name to JSON key.
21
22
  def self.attribute_map
22
23
  {
23
- :'data' => :'data',
24
- :'meta' => :'meta'
24
+ :'meta' => :'meta',
25
+ :'data' => :'data'
25
26
  }
26
27
  end
27
28
 
@@ -33,8 +34,8 @@ module Fastly
33
34
  # Attribute type mapping.
34
35
  def self.fastly_types
35
36
  {
36
- :'data' => :'Array<DdosProtectionRuleWithStats>',
37
- :'meta' => :'PaginationCursorMeta'
37
+ :'meta' => :'Meta',
38
+ :'data' => :'Array<TagGet>'
38
39
  }
39
40
  end
40
41
 
@@ -59,37 +60,27 @@ module Fastly
59
60
  h[k.to_sym] = v
60
61
  }
61
62
 
63
+ if attributes.key?(:'meta')
64
+ self.meta = attributes[:'meta']
65
+ end
66
+
62
67
  if attributes.key?(:'data')
63
68
  if (value = attributes[:'data']).is_a?(Array)
64
69
  self.data = value
65
70
  end
66
71
  end
67
-
68
- if attributes.key?(:'meta')
69
- self.meta = attributes[:'meta']
70
- end
71
72
  end
72
73
 
73
74
  # Show invalid properties with the reasons. Usually used together with valid?
74
75
  # @return Array for valid properties with the reasons
75
76
  def list_invalid_properties
76
77
  invalid_properties = Array.new
77
- if @data.nil?
78
- invalid_properties.push('invalid value for "data", data cannot be nil.')
79
- end
80
-
81
- if @meta.nil?
82
- invalid_properties.push('invalid value for "meta", meta cannot be nil.')
83
- end
84
-
85
78
  invalid_properties
86
79
  end
87
80
 
88
81
  # Check to see if the all the properties in the model are valid
89
82
  # @return true if the model is valid
90
83
  def valid?
91
- return false if @data.nil?
92
- return false if @meta.nil?
93
84
  true
94
85
  end
95
86
 
@@ -98,8 +89,8 @@ module Fastly
98
89
  def ==(o)
99
90
  return true if self.equal?(o)
100
91
  self.class == o.class &&
101
- data == o.data &&
102
- meta == o.meta
92
+ meta == o.meta &&
93
+ data == o.data
103
94
  end
104
95
 
105
96
  # @see the `==` method
@@ -111,7 +102,7 @@ module Fastly
111
102
  # Calculates hash code according to all attributes.
112
103
  # @return [Integer] Hash code
113
104
  def hash
114
- [data, meta].hash
105
+ [meta, data].hash
115
106
  end
116
107
 
117
108
  # Builds the object from hash
@@ -13,16 +13,13 @@ require 'time'
13
13
 
14
14
  module Fastly
15
15
  class InlineResponse2004
16
+ # The service IDs of the services the token will have access to. Separate service IDs with a space.
16
17
  attr_accessor :data
17
18
 
18
- # Meta for the pagination.
19
- attr_accessor :meta
20
-
21
19
  # Attribute mapping from ruby-style variable name to JSON key.
22
20
  def self.attribute_map
23
21
  {
24
- :'data' => :'data',
25
- :'meta' => :'meta'
22
+ :'data' => :'data'
26
23
  }
27
24
  end
28
25
 
@@ -34,15 +31,13 @@ module Fastly
34
31
  # Attribute type mapping.
35
32
  def self.fastly_types
36
33
  {
37
- :'data' => :'Array<SuccessfulResponseAsObject>',
38
- :'meta' => :'Object'
34
+ :'data' => :'Array<String>'
39
35
  }
40
36
  end
41
37
 
42
38
  # List of attributes with nullable: true
43
39
  def self.fastly_nullable
44
40
  Set.new([
45
- :'meta'
46
41
  ])
47
42
  end
48
43
 
@@ -66,10 +61,6 @@ module Fastly
66
61
  self.data = value
67
62
  end
68
63
  end
69
-
70
- if attributes.key?(:'meta')
71
- self.meta = attributes[:'meta']
72
- end
73
64
  end
74
65
 
75
66
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -90,8 +81,7 @@ module Fastly
90
81
  def ==(o)
91
82
  return true if self.equal?(o)
92
83
  self.class == o.class &&
93
- data == o.data &&
94
- meta == o.meta
84
+ data == o.data
95
85
  end
96
86
 
97
87
  # @see the `==` method
@@ -103,7 +93,7 @@ module Fastly
103
93
  # Calculates hash code according to all attributes.
104
94
  # @return [Integer] Hash code
105
95
  def hash
106
- [data, meta].hash
96
+ [data].hash
107
97
  end
108
98
 
109
99
  # Builds the object from hash