fastly 5.3.1 → 6.0.1

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