fastly 5.3.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (224) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +62 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +86 -63
  5. data/docs/AclEntry.md +1 -1
  6. data/docs/AclEntryApi.md +176 -0
  7. data/docs/AclEntryResponse.md +1 -1
  8. data/docs/ApexRedirectApi.md +56 -0
  9. data/docs/Batch.md +12 -0
  10. data/docs/BatchErrors.md +13 -0
  11. data/docs/BulkUpdateAclEntry.md +1 -1
  12. data/docs/ClientKey.md +12 -0
  13. data/docs/ContactApi.md +50 -0
  14. data/docs/Content.md +2 -2
  15. data/docs/ContentApi.md +52 -0
  16. data/docs/DirectorApi.md +42 -0
  17. data/docs/DomainInspector.md +12 -0
  18. data/docs/DomainInspectorEntry.md +11 -0
  19. data/docs/DomainInspectorEntryDimensions.md +12 -0
  20. data/docs/DomainInspectorHistoricalApi.md +72 -0
  21. data/docs/DomainInspectorMeasurements.md +71 -0
  22. data/docs/DomainInspectorRealtimeApi.md +132 -0
  23. data/docs/DomainInspectorRealtimeEntry.md +12 -0
  24. data/docs/EventAttributes.md +1 -1
  25. data/docs/{EventsResponseAllOf.md → EventData.md} +1 -1
  26. data/docs/HistoricalDomains.md +13 -0
  27. data/docs/HistoricalDomainsData.md +11 -0
  28. data/docs/HistoricalDomainsMeta.md +18 -0
  29. data/docs/HistoricalDomainsMetaFilters.md +12 -0
  30. data/docs/HistoricalDomainsResponse.md +13 -0
  31. data/docs/HistoricalDomainsResponseAllOf.md +10 -0
  32. data/docs/{HistoricalFieldResultsAttributesAllOf.md → HistoricalFieldResultsAttributesAdditional.md} +1 -1
  33. data/docs/HistoricalOriginsResponse.md +13 -0
  34. data/docs/HistoricalOriginsResponseAllOf.md +10 -0
  35. data/docs/IamRolesApi.md +157 -0
  36. data/docs/IamServiceGroupsApi.md +157 -0
  37. data/docs/IamUserGroupsApi.md +315 -0
  38. data/docs/InlineResponse2005.md +11 -0
  39. data/docs/InlineResponse2006.md +11 -0
  40. data/docs/InlineResponse2007.md +10 -0
  41. data/docs/InlineResponse400.md +10 -0
  42. data/docs/LegacyWafConfigurationSet.md +11 -0
  43. data/docs/LegacyWafConfigurationSetsApi.md +125 -0
  44. data/docs/LegacyWafFirewall.md +18 -0
  45. data/docs/LegacyWafFirewallApi.md +352 -0
  46. data/docs/LegacyWafOwasp.md +38 -0
  47. data/docs/LegacyWafOwaspApi.md +138 -0
  48. data/docs/LegacyWafRule.md +14 -0
  49. data/docs/LegacyWafRuleApi.md +184 -0
  50. data/docs/LegacyWafRuleStatus.md +12 -0
  51. data/docs/LegacyWafRuleStatusApi.md +202 -0
  52. data/docs/LegacyWafRuleset.md +11 -0
  53. data/docs/LegacyWafRulesetApi.md +136 -0
  54. data/docs/LegacyWafTag.md +10 -0
  55. data/docs/LegacyWafTagApi.md +58 -0
  56. data/docs/LegacyWafUpdateStatus.md +15 -0
  57. data/docs/LegacyWafUpdateStatusApi.md +102 -0
  58. data/docs/LoggingKafkaApi.md +42 -0
  59. data/docs/LoggingKinesisApi.md +42 -0
  60. data/docs/OriginInspector.md +12 -0
  61. data/docs/OriginInspectorDimensions.md +12 -0
  62. data/docs/OriginInspectorEntry.md +11 -0
  63. data/docs/OriginInspectorHistorical.md +13 -0
  64. data/docs/OriginInspectorHistoricalApi.md +72 -0
  65. data/docs/OriginInspectorHistoricalData.md +11 -0
  66. data/docs/OriginInspectorHistoricalMeta.md +18 -0
  67. data/docs/OriginInspectorHistoricalMetaFilters.md +12 -0
  68. data/docs/OriginInspectorMeasurements.md +161 -0
  69. data/docs/OriginInspectorRealtimeApi.md +132 -0
  70. data/docs/OriginInspectorRealtimeEntry.md +12 -0
  71. data/docs/OriginInspectorRealtimeEntryRecorded.md +9 -0
  72. data/docs/OriginInspectorSubsequentRequestTimestamp.md +9 -0
  73. data/docs/OriginInspectorValues.md +161 -0
  74. data/docs/PaginationCursorMeta.md +11 -0
  75. data/docs/ReadOnlyServiceId.md +9 -0
  76. data/docs/ReadOnlyVersion.md +9 -0
  77. data/docs/RealtimeEntry.md +2 -2
  78. data/docs/RealtimeEntryAggregated.md +227 -0
  79. data/docs/RealtimeEntryRecorded.md +9 -0
  80. data/docs/RealtimeMeasurements.md +1 -1
  81. data/docs/RecordedTimestamp.md +9 -0
  82. data/docs/RequestSettingsApi.md +40 -0
  83. data/docs/ResponseObjectApi.md +82 -0
  84. data/docs/SchemasSnippetResponse.md +1 -1
  85. data/docs/Secret.md +12 -0
  86. data/docs/SecretResponse.md +13 -0
  87. data/docs/SecretStore.md +10 -0
  88. data/docs/SecretStoreApi.md +233 -0
  89. data/docs/SecretStoreItemApi.md +255 -0
  90. data/docs/SecretStoreResponse.md +12 -0
  91. data/docs/ServiceAuthorizationsApi.md +76 -0
  92. data/docs/SigningKey.md +10 -0
  93. data/docs/Snippet.md +1 -1
  94. data/docs/SnippetApi.md +46 -4
  95. data/docs/SnippetResponse.md +1 -1
  96. data/docs/SubsequentRequestTimestamp.md +9 -0
  97. data/docs/SudoApi.md +52 -0
  98. data/docs/SudoGenericTokenError.md +10 -0
  99. data/docs/SudoRequest.md +12 -0
  100. data/docs/SudoResponse.md +10 -0
  101. data/docs/TokensAdditionalProps.md +9 -0
  102. data/docs/TokensApi.md +70 -0
  103. data/docs/ValidatorResult.md +1 -5
  104. data/docs/ValidatorResultData.md +12 -0
  105. data/docs/ValidatorResultDataAttributes.md +14 -0
  106. data/docs/{ValidatorResultMessages.md → ValidatorResultDataAttributesMessages.md} +2 -2
  107. data/docs/Values.md +71 -0
  108. data/docs/VclApi.md +8 -6
  109. data/docs/VclSyntaxHighlightingResponse.md +10 -0
  110. data/docs/WafActiveRulesApi.md +41 -0
  111. data/lib/fastly/api/acl_entry_api.rb +332 -0
  112. data/lib/fastly/api/apex_redirect_api.rb +111 -0
  113. data/lib/fastly/api/contact_api.rb +90 -0
  114. data/lib/fastly/api/content_api.rb +79 -0
  115. data/lib/fastly/api/director_api.rb +82 -0
  116. data/lib/fastly/api/domain_inspector_historical_api.rb +125 -0
  117. data/lib/fastly/api/domain_inspector_realtime_api.rb +223 -0
  118. data/lib/fastly/api/iam_roles_api.rb +271 -0
  119. data/lib/fastly/api/iam_service_groups_api.rb +271 -0
  120. data/lib/fastly/api/iam_user_groups_api.rb +547 -0
  121. data/lib/fastly/api/legacy_waf_configuration_sets_api.rb +209 -0
  122. data/lib/fastly/api/legacy_waf_firewall_api.rb +627 -0
  123. data/lib/fastly/api/legacy_waf_owasp_api.rb +244 -0
  124. data/lib/fastly/api/legacy_waf_rule_api.rb +307 -0
  125. data/lib/fastly/api/legacy_waf_rule_status_api.rb +366 -0
  126. data/lib/fastly/api/legacy_waf_ruleset_api.rb +237 -0
  127. data/lib/fastly/api/legacy_waf_tag_api.rb +96 -0
  128. data/lib/fastly/api/legacy_waf_update_status_api.rb +184 -0
  129. data/lib/fastly/api/logging_kafka_api.rb +82 -0
  130. data/lib/fastly/api/logging_kinesis_api.rb +82 -0
  131. data/lib/fastly/api/origin_inspector_historical_api.rb +125 -0
  132. data/lib/fastly/api/origin_inspector_realtime_api.rb +223 -0
  133. data/lib/fastly/api/request_settings_api.rb +75 -0
  134. data/lib/fastly/api/response_object_api.rb +157 -0
  135. data/lib/fastly/api/secret_store_api.rb +381 -0
  136. data/lib/fastly/api/secret_store_item_api.rb +437 -0
  137. data/lib/fastly/api/service_authorizations_api.rb +126 -0
  138. data/lib/fastly/api/snippet_api.rb +88 -6
  139. data/lib/fastly/api/sudo_api.rb +83 -0
  140. data/lib/fastly/api/tokens_api.rb +122 -0
  141. data/lib/fastly/api/vcl_api.rb +10 -10
  142. data/lib/fastly/api/waf_active_rules_api.rb +75 -0
  143. data/lib/fastly/configuration.rb +504 -0
  144. data/lib/fastly/models/acl_entry.rb +1 -1
  145. data/lib/fastly/models/acl_entry_response.rb +1 -1
  146. data/lib/fastly/models/batch.rb +239 -0
  147. data/lib/fastly/models/batch_errors.rb +247 -0
  148. data/lib/fastly/models/bulk_update_acl_entry.rb +1 -1
  149. data/lib/fastly/models/client_key.rb +239 -0
  150. data/lib/fastly/models/content.rb +8 -4
  151. data/lib/fastly/models/domain.rb +1 -0
  152. data/lib/fastly/models/domain_inspector.rb +238 -0
  153. data/lib/fastly/models/domain_inspector_entry.rb +228 -0
  154. data/lib/fastly/models/domain_inspector_entry_dimensions.rb +238 -0
  155. data/lib/fastly/models/domain_inspector_measurements.rb +828 -0
  156. data/lib/fastly/models/domain_inspector_realtime_entry.rb +241 -0
  157. data/lib/fastly/models/event_attributes.rb +4 -2
  158. data/lib/fastly/models/{events_response_all_of.rb → event_data.rb} +3 -3
  159. data/lib/fastly/models/events_response.rb +1 -1
  160. data/lib/fastly/models/historical_domains.rb +249 -0
  161. data/lib/fastly/models/historical_domains_data.rb +228 -0
  162. data/lib/fastly/models/historical_domains_meta.rb +297 -0
  163. data/lib/fastly/models/historical_domains_meta_filters.rb +235 -0
  164. data/lib/fastly/models/historical_domains_response.rb +257 -0
  165. data/lib/fastly/models/historical_domains_response_all_of.rb +219 -0
  166. data/lib/fastly/models/historical_field_results_attributes.rb +1 -1
  167. data/lib/fastly/models/{historical_field_results_attributes_all_of.rb → historical_field_results_attributes_additional.rb} +3 -3
  168. data/lib/fastly/models/historical_origins_response.rb +257 -0
  169. data/lib/fastly/models/historical_origins_response_all_of.rb +219 -0
  170. data/lib/fastly/models/inline_response2005.rb +227 -0
  171. data/lib/fastly/models/inline_response2006.rb +227 -0
  172. data/lib/fastly/models/inline_response2007.rb +218 -0
  173. data/lib/fastly/models/inline_response400.rb +250 -0
  174. data/lib/fastly/models/legacy_waf_configuration_set.rb +227 -0
  175. data/lib/fastly/models/legacy_waf_firewall.rb +297 -0
  176. data/lib/fastly/models/legacy_waf_owasp.rb +527 -0
  177. data/lib/fastly/models/legacy_waf_rule.rb +257 -0
  178. data/lib/fastly/models/legacy_waf_rule_status.rb +237 -0
  179. data/lib/fastly/models/legacy_waf_ruleset.rb +227 -0
  180. data/lib/fastly/models/legacy_waf_tag.rb +217 -0
  181. data/lib/fastly/models/legacy_waf_update_status.rb +267 -0
  182. data/lib/fastly/models/origin_inspector.rb +238 -0
  183. data/lib/fastly/models/origin_inspector_dimensions.rb +238 -0
  184. data/lib/fastly/models/origin_inspector_entry.rb +228 -0
  185. data/lib/fastly/models/origin_inspector_historical.rb +249 -0
  186. data/lib/fastly/models/origin_inspector_historical_data.rb +225 -0
  187. data/lib/fastly/models/origin_inspector_historical_meta.rb +297 -0
  188. data/lib/fastly/models/origin_inspector_historical_meta_filters.rb +235 -0
  189. data/lib/fastly/models/origin_inspector_measurements.rb +1728 -0
  190. data/lib/fastly/models/origin_inspector_realtime_entry.rb +241 -0
  191. data/lib/fastly/models/origin_inspector_realtime_entry_recorded.rb +208 -0
  192. data/lib/fastly/models/origin_inspector_subsequent_request_timestamp.rb +208 -0
  193. data/lib/fastly/models/origin_inspector_values.rb +1728 -0
  194. data/lib/fastly/models/pagination_cursor_meta.rb +227 -0
  195. data/lib/fastly/models/read_only_service_id.rb +207 -0
  196. data/lib/fastly/models/read_only_version.rb +207 -0
  197. data/lib/fastly/models/realtime_entry.rb +2 -7
  198. data/lib/fastly/models/realtime_entry_aggregated.rb +2397 -0
  199. data/lib/fastly/models/realtime_entry_recorded.rb +208 -0
  200. data/lib/fastly/models/realtime_measurements.rb +4 -2
  201. data/lib/fastly/models/recorded_timestamp.rb +208 -0
  202. data/lib/fastly/models/schemas_snippet_response.rb +3 -3
  203. data/lib/fastly/models/secret.rb +238 -0
  204. data/lib/fastly/models/secret_response.rb +249 -0
  205. data/lib/fastly/models/secret_store.rb +217 -0
  206. data/lib/fastly/models/secret_store_response.rb +238 -0
  207. data/lib/fastly/models/signing_key.rb +218 -0
  208. data/lib/fastly/models/snippet.rb +3 -3
  209. data/lib/fastly/models/snippet_response.rb +3 -3
  210. data/lib/fastly/models/subsequent_request_timestamp.rb +208 -0
  211. data/lib/fastly/models/sudo_generic_token_error.rb +216 -0
  212. data/lib/fastly/models/sudo_request.rb +244 -0
  213. data/lib/fastly/models/sudo_response.rb +217 -0
  214. data/lib/fastly/models/tokens_additional_props.rb +227 -0
  215. data/lib/fastly/models/validator_result.rb +7 -84
  216. data/lib/fastly/models/validator_result_data.rb +234 -0
  217. data/lib/fastly/models/validator_result_data_attributes.rb +293 -0
  218. data/lib/fastly/models/{validator_result_messages.rb → validator_result_data_attributes_messages.rb} +4 -4
  219. data/lib/fastly/models/values.rb +828 -0
  220. data/lib/fastly/models/vcl_syntax_highlighting_response.rb +217 -0
  221. data/lib/fastly/version.rb +1 -1
  222. data/lib/fastly.rb +79 -3
  223. data/sig.json +1 -1
  224. metadata +160 -8
@@ -0,0 +1,235 @@
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://developer.fastly.com/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
+ # Filters that were applied when calculating the results for this query.
16
+ class HistoricalDomainsMetaFilters
17
+ attr_accessor :region
18
+
19
+ attr_accessor :datacenter
20
+
21
+ attr_accessor :domain
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'region' => :'region',
27
+ :'datacenter' => :'datacenter',
28
+ :'domain' => :'domain'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.fastly_types
39
+ {
40
+ :'region' => :'String',
41
+ :'datacenter' => :'String',
42
+ :'domain' => :'String'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.fastly_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::HistoricalDomainsMetaFilters` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!self.class.attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::HistoricalDomainsMetaFilters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'region')
68
+ self.region = attributes[:'region']
69
+ end
70
+
71
+ if attributes.key?(:'datacenter')
72
+ self.datacenter = attributes[:'datacenter']
73
+ end
74
+
75
+ if attributes.key?(:'domain')
76
+ self.domain = attributes[:'domain']
77
+ end
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properties with the reasons
82
+ def list_invalid_properties
83
+ invalid_properties = Array.new
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ true
91
+ end
92
+
93
+ # Checks equality by comparing each attribute.
94
+ # @param [Object] Object to be compared
95
+ def ==(o)
96
+ return true if self.equal?(o)
97
+ self.class == o.class &&
98
+ region == o.region &&
99
+ datacenter == o.datacenter &&
100
+ domain == o.domain
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Integer] Hash code
111
+ def hash
112
+ [region, datacenter, domain].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def self.build_from_hash(attributes)
119
+ new.build_from_hash(attributes)
120
+ end
121
+
122
+ # Builds the object from hash
123
+ # @param [Hash] attributes Model attributes in the form of hash
124
+ # @return [Object] Returns the model itself
125
+ def build_from_hash(attributes)
126
+ return nil unless attributes.is_a?(Hash)
127
+ self.class.fastly_types.each_pair do |key, type|
128
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
129
+ self.send("#{key}=", nil)
130
+ elsif type =~ /\AArray<(.*)>/i
131
+ # check to ensure the input is an array given that the attribute
132
+ # is documented as an array but the input is not
133
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
134
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
135
+ end
136
+ elsif !attributes[self.class.attribute_map[key]].nil?
137
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
138
+ end
139
+ end
140
+
141
+ self
142
+ end
143
+
144
+ # Deserializes the data based on type
145
+ # @param string type Data type
146
+ # @param string value Value to be deserialized
147
+ # @return [Object] Deserialized data
148
+ def _deserialize(type, value)
149
+ case type.to_sym
150
+ when :Time
151
+ Time.parse(value)
152
+ when :Date
153
+ Date.parse(value)
154
+ when :String
155
+ value.to_s
156
+ when :Integer
157
+ value.to_i
158
+ when :Float
159
+ value.to_f
160
+ when :Boolean
161
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
162
+ true
163
+ else
164
+ false
165
+ end
166
+ when :Object
167
+ # generic object (usually a Hash), return directly
168
+ value
169
+ when /\AArray<(?<inner_type>.+)>\z/
170
+ inner_type = Regexp.last_match[:inner_type]
171
+ value.map { |v| _deserialize(inner_type, v) }
172
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
173
+ k_type = Regexp.last_match[:k_type]
174
+ v_type = Regexp.last_match[:v_type]
175
+ {}.tap do |hash|
176
+ value.each do |k, v|
177
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
178
+ end
179
+ end
180
+ else # model
181
+ # models (e.g. Pet) or oneOf
182
+ klass = Fastly.const_get(type)
183
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
184
+ end
185
+ end
186
+
187
+ # Returns the string representation of the object
188
+ # @return [String] String presentation of the object
189
+ def to_s
190
+ to_hash.to_s
191
+ end
192
+
193
+ # to_body is an alias to to_hash (backward compatibility)
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_body
196
+ to_hash
197
+ end
198
+
199
+ # Returns the object in the form of hash
200
+ # @return [Hash] Returns the object in the form of hash
201
+ def to_hash
202
+ hash = {}
203
+ self.class.attribute_map.each_pair do |attr, param|
204
+ value = self.send(attr)
205
+ if value.nil?
206
+ is_nullable = self.class.fastly_nullable.include?(attr)
207
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
208
+ end
209
+
210
+ hash[param] = _to_hash(value)
211
+ end
212
+ hash
213
+ end
214
+
215
+ # Outputs non-array value in the form of hash
216
+ # For object, use to_hash. Otherwise, just return the value
217
+ # @param [Object] value Any valid value
218
+ # @return [Hash] Returns the value in the form of hash
219
+ def _to_hash(value)
220
+ if value.is_a?(Array)
221
+ value.compact.map { |v| _to_hash(v) }
222
+ elsif value.is_a?(Hash)
223
+ {}.tap do |hash|
224
+ value.each { |k, v| hash[k] = _to_hash(v) }
225
+ end
226
+ elsif value.respond_to? :to_hash
227
+ value.to_hash
228
+ else
229
+ value
230
+ end
231
+ end
232
+
233
+ end
234
+
235
+ end
@@ -0,0 +1,257 @@
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://developer.fastly.com/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 HistoricalDomainsResponse
16
+ # Whether or not we were able to successfully execute the query.
17
+ attr_accessor :status
18
+
19
+ attr_accessor :meta
20
+
21
+ # If the query was not successful, this will provide a string that explains why.
22
+ attr_accessor :msg
23
+
24
+ # A list of timeseries. Each individual timeseries represents a unique combination of dimensions, such as domain, region or POP.
25
+ attr_accessor :data
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'status' => :'status',
31
+ :'meta' => :'meta',
32
+ :'msg' => :'msg',
33
+ :'data' => :'data'
34
+ }
35
+ end
36
+
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.fastly_types
44
+ {
45
+ :'status' => :'String',
46
+ :'meta' => :'HistoricalDomainsMeta',
47
+ :'msg' => :'String',
48
+ :'data' => :'Array<DomainInspectorEntry>'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.fastly_nullable
54
+ Set.new([
55
+ :'msg',
56
+ ])
57
+ end
58
+
59
+ # List of class defined in allOf (OpenAPI v3)
60
+ def self.fastly_all_of
61
+ [
62
+ :'HistoricalDomains',
63
+ :'HistoricalDomainsResponseAllOf'
64
+ ]
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ if (!attributes.is_a?(Hash))
71
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::HistoricalDomainsResponse` initialize method"
72
+ end
73
+
74
+ # check to see if the attribute exists and convert string to symbol for hash key
75
+ attributes = attributes.each_with_object({}) { |(k, v), h|
76
+ if (!self.class.attribute_map.key?(k.to_sym))
77
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::HistoricalDomainsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
78
+ end
79
+ h[k.to_sym] = v
80
+ }
81
+
82
+ if attributes.key?(:'status')
83
+ self.status = attributes[:'status']
84
+ end
85
+
86
+ if attributes.key?(:'meta')
87
+ self.meta = attributes[:'meta']
88
+ end
89
+
90
+ if attributes.key?(:'msg')
91
+ self.msg = attributes[:'msg']
92
+ end
93
+
94
+ if attributes.key?(:'data')
95
+ if (value = attributes[:'data']).is_a?(Array)
96
+ self.data = value
97
+ end
98
+ end
99
+ end
100
+
101
+ # Show invalid properties with the reasons. Usually used together with valid?
102
+ # @return Array for valid properties with the reasons
103
+ def list_invalid_properties
104
+ invalid_properties = Array.new
105
+ invalid_properties
106
+ end
107
+
108
+ # Check to see if the all the properties in the model are valid
109
+ # @return true if the model is valid
110
+ def valid?
111
+ true
112
+ end
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param [Object] Object to be compared
116
+ def ==(o)
117
+ return true if self.equal?(o)
118
+ self.class == o.class &&
119
+ status == o.status &&
120
+ meta == o.meta &&
121
+ msg == o.msg &&
122
+ data == o.data
123
+ end
124
+
125
+ # @see the `==` method
126
+ # @param [Object] Object to be compared
127
+ def eql?(o)
128
+ self == o
129
+ end
130
+
131
+ # Calculates hash code according to all attributes.
132
+ # @return [Integer] Hash code
133
+ def hash
134
+ [status, meta, msg, data].hash
135
+ end
136
+
137
+ # Builds the object from hash
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ # @return [Object] Returns the model itself
140
+ def self.build_from_hash(attributes)
141
+ new.build_from_hash(attributes)
142
+ end
143
+
144
+ # Builds the object from hash
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ # @return [Object] Returns the model itself
147
+ def build_from_hash(attributes)
148
+ return nil unless attributes.is_a?(Hash)
149
+ self.class.fastly_types.each_pair do |key, type|
150
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
151
+ self.send("#{key}=", nil)
152
+ elsif type =~ /\AArray<(.*)>/i
153
+ # check to ensure the input is an array given that the attribute
154
+ # is documented as an array but the input is not
155
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
156
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
157
+ end
158
+ elsif !attributes[self.class.attribute_map[key]].nil?
159
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
160
+ end
161
+ end
162
+
163
+ self
164
+ end
165
+
166
+ # Deserializes the data based on type
167
+ # @param string type Data type
168
+ # @param string value Value to be deserialized
169
+ # @return [Object] Deserialized data
170
+ def _deserialize(type, value)
171
+ case type.to_sym
172
+ when :Time
173
+ Time.parse(value)
174
+ when :Date
175
+ Date.parse(value)
176
+ when :String
177
+ value.to_s
178
+ when :Integer
179
+ value.to_i
180
+ when :Float
181
+ value.to_f
182
+ when :Boolean
183
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
184
+ true
185
+ else
186
+ false
187
+ end
188
+ when :Object
189
+ # generic object (usually a Hash), return directly
190
+ value
191
+ when /\AArray<(?<inner_type>.+)>\z/
192
+ inner_type = Regexp.last_match[:inner_type]
193
+ value.map { |v| _deserialize(inner_type, v) }
194
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
195
+ k_type = Regexp.last_match[:k_type]
196
+ v_type = Regexp.last_match[:v_type]
197
+ {}.tap do |hash|
198
+ value.each do |k, v|
199
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
200
+ end
201
+ end
202
+ else # model
203
+ # models (e.g. Pet) or oneOf
204
+ klass = Fastly.const_get(type)
205
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
206
+ end
207
+ end
208
+
209
+ # Returns the string representation of the object
210
+ # @return [String] String presentation of the object
211
+ def to_s
212
+ to_hash.to_s
213
+ end
214
+
215
+ # to_body is an alias to to_hash (backward compatibility)
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_body
218
+ to_hash
219
+ end
220
+
221
+ # Returns the object in the form of hash
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_hash
224
+ hash = {}
225
+ self.class.attribute_map.each_pair do |attr, param|
226
+ value = self.send(attr)
227
+ if value.nil?
228
+ is_nullable = self.class.fastly_nullable.include?(attr)
229
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
230
+ end
231
+
232
+ hash[param] = _to_hash(value)
233
+ end
234
+ hash
235
+ end
236
+
237
+ # Outputs non-array value in the form of hash
238
+ # For object, use to_hash. Otherwise, just return the value
239
+ # @param [Object] value Any valid value
240
+ # @return [Hash] Returns the value in the form of hash
241
+ def _to_hash(value)
242
+ if value.is_a?(Array)
243
+ value.compact.map { |v| _to_hash(v) }
244
+ elsif value.is_a?(Hash)
245
+ {}.tap do |hash|
246
+ value.each { |k, v| hash[k] = _to_hash(v) }
247
+ end
248
+ elsif value.respond_to? :to_hash
249
+ value.to_hash
250
+ else
251
+ value
252
+ end
253
+ end
254
+
255
+ end
256
+
257
+ end
@@ -0,0 +1,219 @@
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://developer.fastly.com/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 HistoricalDomainsResponseAllOf
16
+ # A list of timeseries. Each individual timeseries represents a unique combination of dimensions, such as domain, region or POP.
17
+ attr_accessor :data
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'data' => :'data'
23
+ }
24
+ end
25
+
26
+ # Returns all the JSON keys this model knows about
27
+ def self.acceptable_attributes
28
+ attribute_map.values
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.fastly_types
33
+ {
34
+ :'data' => :'Array<DomainInspectorEntry>'
35
+ }
36
+ end
37
+
38
+ # List of attributes with nullable: true
39
+ def self.fastly_nullable
40
+ Set.new([
41
+ ])
42
+ end
43
+
44
+ # Initializes the object
45
+ # @param [Hash] attributes Model attributes in the form of hash
46
+ def initialize(attributes = {})
47
+ if (!attributes.is_a?(Hash))
48
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::HistoricalDomainsResponseAllOf` initialize method"
49
+ end
50
+
51
+ # check to see if the attribute exists and convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}) { |(k, v), h|
53
+ if (!self.class.attribute_map.key?(k.to_sym))
54
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::HistoricalDomainsResponseAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
55
+ end
56
+ h[k.to_sym] = v
57
+ }
58
+
59
+ if attributes.key?(:'data')
60
+ if (value = attributes[:'data']).is_a?(Array)
61
+ self.data = value
62
+ end
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ true
77
+ end
78
+
79
+ # Checks equality by comparing each attribute.
80
+ # @param [Object] Object to be compared
81
+ def ==(o)
82
+ return true if self.equal?(o)
83
+ self.class == o.class &&
84
+ data == o.data
85
+ end
86
+
87
+ # @see the `==` method
88
+ # @param [Object] Object to be compared
89
+ def eql?(o)
90
+ self == o
91
+ end
92
+
93
+ # Calculates hash code according to all attributes.
94
+ # @return [Integer] Hash code
95
+ def hash
96
+ [data].hash
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def self.build_from_hash(attributes)
103
+ new.build_from_hash(attributes)
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ self.class.fastly_types.each_pair do |key, type|
112
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
113
+ self.send("#{key}=", nil)
114
+ elsif type =~ /\AArray<(.*)>/i
115
+ # check to ensure the input is an array given that the attribute
116
+ # is documented as an array but the input is not
117
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
118
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
119
+ end
120
+ elsif !attributes[self.class.attribute_map[key]].nil?
121
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
122
+ end
123
+ end
124
+
125
+ self
126
+ end
127
+
128
+ # Deserializes the data based on type
129
+ # @param string type Data type
130
+ # @param string value Value to be deserialized
131
+ # @return [Object] Deserialized data
132
+ def _deserialize(type, value)
133
+ case type.to_sym
134
+ when :Time
135
+ Time.parse(value)
136
+ when :Date
137
+ Date.parse(value)
138
+ when :String
139
+ value.to_s
140
+ when :Integer
141
+ value.to_i
142
+ when :Float
143
+ value.to_f
144
+ when :Boolean
145
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
146
+ true
147
+ else
148
+ false
149
+ end
150
+ when :Object
151
+ # generic object (usually a Hash), return directly
152
+ value
153
+ when /\AArray<(?<inner_type>.+)>\z/
154
+ inner_type = Regexp.last_match[:inner_type]
155
+ value.map { |v| _deserialize(inner_type, v) }
156
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
157
+ k_type = Regexp.last_match[:k_type]
158
+ v_type = Regexp.last_match[:v_type]
159
+ {}.tap do |hash|
160
+ value.each do |k, v|
161
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
162
+ end
163
+ end
164
+ else # model
165
+ # models (e.g. Pet) or oneOf
166
+ klass = Fastly.const_get(type)
167
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
168
+ end
169
+ end
170
+
171
+ # Returns the string representation of the object
172
+ # @return [String] String presentation of the object
173
+ def to_s
174
+ to_hash.to_s
175
+ end
176
+
177
+ # to_body is an alias to to_hash (backward compatibility)
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_body
180
+ to_hash
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ if value.nil?
190
+ is_nullable = self.class.fastly_nullable.include?(attr)
191
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
192
+ end
193
+
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ # Outputs non-array value in the form of hash
200
+ # For object, use to_hash. Otherwise, just return the value
201
+ # @param [Object] value Any valid value
202
+ # @return [Hash] Returns the value in the form of hash
203
+ def _to_hash(value)
204
+ if value.is_a?(Array)
205
+ value.compact.map { |v| _to_hash(v) }
206
+ elsif value.is_a?(Hash)
207
+ {}.tap do |hash|
208
+ value.each { |k, v| hash[k] = _to_hash(v) }
209
+ end
210
+ elsif value.respond_to? :to_hash
211
+ value.to_hash
212
+ else
213
+ value
214
+ end
215
+ end
216
+
217
+ end
218
+
219
+ end