fastly 15.0.0 → 15.1.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 (93) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +10 -3
  5. data/docs/DdosProtectionEvent.md +2 -0
  6. data/docs/DdosProtectionEventAllOf.md +2 -0
  7. data/docs/DdosProtectionRequestEnableMode.md +10 -0
  8. data/docs/DomainInspectorHistoricalApi.md +1 -1
  9. data/docs/DomainResearchApi.md +103 -0
  10. data/docs/DomainResearchResponseBodyEnable.md +12 -0
  11. data/docs/DomainResearchResponseCustomer.md +10 -0
  12. data/docs/DomainResearchResponseLinks.md +10 -0
  13. data/docs/DomainResearchResponseLinksLinks.md +10 -0
  14. data/docs/DomainResearchResponseProduct.md +10 -0
  15. data/docs/DomainResearchResponseProductProduct.md +11 -0
  16. data/docs/IamV1RoleResponse.md +1 -0
  17. data/docs/InlineResponse20010.md +2 -1
  18. data/docs/InlineResponse20011.md +10 -0
  19. data/docs/InlineResponse2006.md +1 -2
  20. data/docs/InlineResponse2007.md +1 -1
  21. data/docs/InlineResponse2008.md +1 -1
  22. data/docs/InlineResponse2009.md +1 -1
  23. data/docs/KvStoreApi.md +43 -4
  24. data/docs/KvStoreDetails.md +2 -0
  25. data/docs/KvStoreItemApi.md +2 -2
  26. data/docs/{KvStoreRequestCreate.md → KvStoreRequestCreateOrUpdate.md} +1 -1
  27. data/docs/MetricsPlatformApi.md +75 -0
  28. data/docs/NgwafRequestEnable.md +1 -0
  29. data/docs/Offer.md +12 -0
  30. data/docs/OfferAllOf.md +12 -0
  31. data/docs/OriginInspectorHistoricalApi.md +1 -1
  32. data/docs/PlatformMetadata.md +14 -0
  33. data/docs/PlatformMetricsResponse.md +11 -0
  34. data/docs/PlatformValues.md +25 -0
  35. data/docs/ProductDdosProtectionApi.md +3 -1
  36. data/docs/ProductDomainResearchApi.md +115 -0
  37. data/docs/RealtimeEntryAggregated.md +4 -0
  38. data/docs/RealtimeMeasurements.md +4 -0
  39. data/docs/Results.md +4 -0
  40. data/docs/SecretStoreApi.md +2 -2
  41. data/docs/SecretStoreItemApi.md +2 -2
  42. data/docs/ServiceAuthorizationsApi.md +2 -2
  43. data/docs/Status.md +15 -0
  44. data/docs/StatusAllOf.md +15 -0
  45. data/docs/Suggestion.md +13 -0
  46. data/docs/SuggestionAllOf.md +13 -0
  47. data/lib/fastly/api/domain_inspector_historical_api.rb +1 -1
  48. data/lib/fastly/api/domain_research_api.rb +163 -0
  49. data/lib/fastly/api/kv_store_api.rb +74 -6
  50. data/lib/fastly/api/kv_store_item_api.rb +3 -3
  51. data/lib/fastly/api/metrics_platform_api.rb +134 -0
  52. data/lib/fastly/api/origin_inspector_historical_api.rb +1 -1
  53. data/lib/fastly/api/product_ddos_protection_api.rb +10 -3
  54. data/lib/fastly/api/product_domain_research_api.rb +186 -0
  55. data/lib/fastly/api/secret_store_api.rb +3 -3
  56. data/lib/fastly/api/secret_store_item_api.rb +3 -3
  57. data/lib/fastly/api/service_authorizations_api.rb +3 -3
  58. data/lib/fastly/configuration.rb +42 -0
  59. data/lib/fastly/models/ddos_protection_event.rb +21 -1
  60. data/lib/fastly/models/ddos_protection_event_all_of.rb +21 -1
  61. data/lib/fastly/models/ddos_protection_request_enable_mode.rb +251 -0
  62. data/lib/fastly/models/domain_research_response_body_enable.rb +243 -0
  63. data/lib/fastly/models/domain_research_response_customer.rb +216 -0
  64. data/lib/fastly/models/domain_research_response_links.rb +216 -0
  65. data/lib/fastly/models/domain_research_response_links_links.rb +217 -0
  66. data/lib/fastly/models/domain_research_response_product.rb +216 -0
  67. data/lib/fastly/models/domain_research_response_product_product.rb +227 -0
  68. data/lib/fastly/models/iam_v1_role_response.rb +10 -1
  69. data/lib/fastly/models/inline_response20010.rb +13 -4
  70. data/lib/fastly/models/inline_response20011.rb +218 -0
  71. data/lib/fastly/models/inline_response2006.rb +8 -17
  72. data/lib/fastly/models/inline_response2007.rb +1 -1
  73. data/lib/fastly/models/inline_response2008.rb +1 -1
  74. data/lib/fastly/models/inline_response2009.rb +1 -1
  75. data/lib/fastly/models/kv_store_details.rb +24 -4
  76. data/lib/fastly/models/{kv_store_request_create.rb → kv_store_request_create_or_update.rb} +3 -3
  77. data/lib/fastly/models/ngwaf_request_enable.rb +14 -4
  78. data/lib/fastly/models/offer.rb +245 -0
  79. data/lib/fastly/models/offer_all_of.rb +237 -0
  80. data/lib/fastly/models/platform_metadata.rb +258 -0
  81. data/lib/fastly/models/platform_metrics_response.rb +228 -0
  82. data/lib/fastly/models/platform_values.rb +368 -0
  83. data/lib/fastly/models/realtime_entry_aggregated.rb +44 -4
  84. data/lib/fastly/models/realtime_measurements.rb +44 -4
  85. data/lib/fastly/models/results.rb +41 -1
  86. data/lib/fastly/models/status.rb +276 -0
  87. data/lib/fastly/models/status_all_of.rb +268 -0
  88. data/lib/fastly/models/suggestion.rb +255 -0
  89. data/lib/fastly/models/suggestion_all_of.rb +247 -0
  90. data/lib/fastly/version.rb +1 -1
  91. data/lib/fastly.rb +21 -1
  92. data/sig.json +1 -1
  93. metadata +44 -4
@@ -0,0 +1,228 @@
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 PlatformMetricsResponse
16
+ attr_accessor :meta
17
+
18
+ # An array of values representing the metric values at each point in time. Note that this dataset is sparse: only the keys with non-zero values will be included in the record.
19
+ attr_accessor :data
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'meta' => :'meta',
25
+ :'data' => :'data'
26
+ }
27
+ end
28
+
29
+ # Returns all the JSON keys this model knows about
30
+ def self.acceptable_attributes
31
+ attribute_map.values
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.fastly_types
36
+ {
37
+ :'meta' => :'PlatformMetadata',
38
+ :'data' => :'Array<PlatformValues>'
39
+ }
40
+ end
41
+
42
+ # List of attributes with nullable: true
43
+ def self.fastly_nullable
44
+ Set.new([
45
+ ])
46
+ end
47
+
48
+ # Initializes the object
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ def initialize(attributes = {})
51
+ if (!attributes.is_a?(Hash))
52
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::PlatformMetricsResponse` initialize method"
53
+ end
54
+
55
+ # check to see if the attribute exists and convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h|
57
+ if (!self.class.attribute_map.key?(k.to_sym))
58
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::PlatformMetricsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
59
+ end
60
+ h[k.to_sym] = v
61
+ }
62
+
63
+ if attributes.key?(:'meta')
64
+ self.meta = attributes[:'meta']
65
+ end
66
+
67
+ if attributes.key?(:'data')
68
+ if (value = attributes[:'data']).is_a?(Array)
69
+ self.data = value
70
+ end
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = Array.new
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ meta == o.meta &&
93
+ data == o.data
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Integer] Hash code
104
+ def hash
105
+ [meta, data].hash
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def self.build_from_hash(attributes)
112
+ new.build_from_hash(attributes)
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 build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ self.class.fastly_types.each_pair do |key, type|
121
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
122
+ self.send("#{key}=", nil)
123
+ elsif type =~ /\AArray<(.*)>/i
124
+ # check to ensure the input is an array given that the attribute
125
+ # is documented as an array but the input is not
126
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
127
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
128
+ end
129
+ elsif !attributes[self.class.attribute_map[key]].nil?
130
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
131
+ end
132
+ end
133
+
134
+ self
135
+ end
136
+
137
+ # Deserializes the data based on type
138
+ # @param string type Data type
139
+ # @param string value Value to be deserialized
140
+ # @return [Object] Deserialized data
141
+ def _deserialize(type, value)
142
+ case type.to_sym
143
+ when :Time
144
+ Time.parse(value)
145
+ when :Date
146
+ Date.parse(value)
147
+ when :String
148
+ value.to_s
149
+ when :Integer
150
+ value.to_i
151
+ when :Float
152
+ value.to_f
153
+ when :Boolean
154
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
155
+ true
156
+ else
157
+ false
158
+ end
159
+ when :Object
160
+ # generic object (usually a Hash), return directly
161
+ value
162
+ when /\AArray<(?<inner_type>.+)>\z/
163
+ inner_type = Regexp.last_match[:inner_type]
164
+ value.map { |v| _deserialize(inner_type, v) }
165
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
166
+ k_type = Regexp.last_match[:k_type]
167
+ v_type = Regexp.last_match[:v_type]
168
+ {}.tap do |hash|
169
+ value.each do |k, v|
170
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
171
+ end
172
+ end
173
+ else # model
174
+ # models (e.g. Pet) or oneOf
175
+ klass = Fastly.const_get(type)
176
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
177
+ end
178
+ end
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # to_body is an alias to to_hash (backward compatibility)
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_body
189
+ to_hash
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ if value.nil?
199
+ is_nullable = self.class.fastly_nullable.include?(attr)
200
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
201
+ end
202
+
203
+ hash[param] = _to_hash(value)
204
+ end
205
+ hash
206
+ end
207
+
208
+ # Outputs non-array value in the form of hash
209
+ # For object, use to_hash. Otherwise, just return the value
210
+ # @param [Object] value Any valid value
211
+ # @return [Hash] Returns the value in the form of hash
212
+ def _to_hash(value)
213
+ if value.is_a?(Array)
214
+ value.compact.map { |v| _to_hash(v) }
215
+ elsif value.is_a?(Hash)
216
+ {}.tap do |hash|
217
+ value.each { |k, v| hash[k] = _to_hash(v) }
218
+ end
219
+ elsif value.respond_to? :to_hash
220
+ value.to_hash
221
+ else
222
+ value
223
+ end
224
+ end
225
+
226
+ end
227
+
228
+ end
@@ -0,0 +1,368 @@
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
+ # The results of the query, optionally filtered and grouped over the requested timespan.
16
+ class PlatformValues
17
+ # Timestamp of the metrics data point.
18
+ attr_accessor :timestamp
19
+
20
+ # 25th percentile of time to first byte from origin, in microseconds.
21
+ attr_accessor :ttfb_origin_p25_us
22
+
23
+ # 50th percentile of time to first byte from origin, in microseconds.
24
+ attr_accessor :ttfb_origin_p50_us
25
+
26
+ # 75th percentile of time to first byte from origin, in microseconds.
27
+ attr_accessor :ttfb_origin_p75_us
28
+
29
+ # 95th percentile of time to first byte from origin, in microseconds.
30
+ attr_accessor :ttfb_origin_p95_us
31
+
32
+ # 99th percentile of time to first byte from origin, in microseconds.
33
+ attr_accessor :ttfb_origin_p99_us
34
+
35
+ # 25th percentile of time to first byte from shield, in microseconds.
36
+ attr_accessor :ttfb_shield_p25_us
37
+
38
+ # 50th percentile of time to first byte from shield, in microseconds.
39
+ attr_accessor :ttfb_shield_p50_us
40
+
41
+ # 75th percentile of time to first byte from shield, in microseconds.
42
+ attr_accessor :ttfb_shield_p75_us
43
+
44
+ # 95th percentile of time to first byte from shield, in microseconds.
45
+ attr_accessor :ttfb_shield_p95_us
46
+
47
+ # 99th percentile of time to first byte from shield, in microseconds.
48
+ attr_accessor :ttfb_shield_p99_us
49
+
50
+ # 25th percentile of time to first byte from edge, in microseconds.
51
+ attr_accessor :ttfb_edge_p25_us
52
+
53
+ # 50th percentile of time to first byte from edge, in microseconds.
54
+ attr_accessor :ttfb_edge_p50_us
55
+
56
+ # 75th percentile of time to first byte from edge, in microseconds.
57
+ attr_accessor :ttfb_edge_p75_us
58
+
59
+ # 95th percentile of time to first byte from edge, in microseconds.
60
+ attr_accessor :ttfb_edge_p95_us
61
+
62
+ # 99th percentile of time to first byte from edge, in microseconds.
63
+ attr_accessor :ttfb_edge_p99_us
64
+
65
+ # Attribute mapping from ruby-style variable name to JSON key.
66
+ def self.attribute_map
67
+ {
68
+ :'timestamp' => :'timestamp',
69
+ :'ttfb_origin_p25_us' => :'ttfb_origin_p25_us',
70
+ :'ttfb_origin_p50_us' => :'ttfb_origin_p50_us',
71
+ :'ttfb_origin_p75_us' => :'ttfb_origin_p75_us',
72
+ :'ttfb_origin_p95_us' => :'ttfb_origin_p95_us',
73
+ :'ttfb_origin_p99_us' => :'ttfb_origin_p99_us',
74
+ :'ttfb_shield_p25_us' => :'ttfb_shield_p25_us',
75
+ :'ttfb_shield_p50_us' => :'ttfb_shield_p50_us',
76
+ :'ttfb_shield_p75_us' => :'ttfb_shield_p75_us',
77
+ :'ttfb_shield_p95_us' => :'ttfb_shield_p95_us',
78
+ :'ttfb_shield_p99_us' => :'ttfb_shield_p99_us',
79
+ :'ttfb_edge_p25_us' => :'ttfb_edge_p25_us',
80
+ :'ttfb_edge_p50_us' => :'ttfb_edge_p50_us',
81
+ :'ttfb_edge_p75_us' => :'ttfb_edge_p75_us',
82
+ :'ttfb_edge_p95_us' => :'ttfb_edge_p95_us',
83
+ :'ttfb_edge_p99_us' => :'ttfb_edge_p99_us'
84
+ }
85
+ end
86
+
87
+ # Returns all the JSON keys this model knows about
88
+ def self.acceptable_attributes
89
+ attribute_map.values
90
+ end
91
+
92
+ # Attribute type mapping.
93
+ def self.fastly_types
94
+ {
95
+ :'timestamp' => :'Time',
96
+ :'ttfb_origin_p25_us' => :'Float',
97
+ :'ttfb_origin_p50_us' => :'Float',
98
+ :'ttfb_origin_p75_us' => :'Float',
99
+ :'ttfb_origin_p95_us' => :'Float',
100
+ :'ttfb_origin_p99_us' => :'Float',
101
+ :'ttfb_shield_p25_us' => :'Float',
102
+ :'ttfb_shield_p50_us' => :'Float',
103
+ :'ttfb_shield_p75_us' => :'Float',
104
+ :'ttfb_shield_p95_us' => :'Float',
105
+ :'ttfb_shield_p99_us' => :'Float',
106
+ :'ttfb_edge_p25_us' => :'Float',
107
+ :'ttfb_edge_p50_us' => :'Float',
108
+ :'ttfb_edge_p75_us' => :'Float',
109
+ :'ttfb_edge_p95_us' => :'Float',
110
+ :'ttfb_edge_p99_us' => :'Float'
111
+ }
112
+ end
113
+
114
+ # List of attributes with nullable: true
115
+ def self.fastly_nullable
116
+ Set.new([
117
+ ])
118
+ end
119
+
120
+ # Initializes the object
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ def initialize(attributes = {})
123
+ if (!attributes.is_a?(Hash))
124
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::PlatformValues` initialize method"
125
+ end
126
+
127
+ # check to see if the attribute exists and convert string to symbol for hash key
128
+ attributes = attributes.each_with_object({}) { |(k, v), h|
129
+ if (!self.class.attribute_map.key?(k.to_sym))
130
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::PlatformValues`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
131
+ end
132
+ h[k.to_sym] = v
133
+ }
134
+
135
+ if attributes.key?(:'timestamp')
136
+ self.timestamp = attributes[:'timestamp']
137
+ end
138
+
139
+ if attributes.key?(:'ttfb_origin_p25_us')
140
+ self.ttfb_origin_p25_us = attributes[:'ttfb_origin_p25_us']
141
+ end
142
+
143
+ if attributes.key?(:'ttfb_origin_p50_us')
144
+ self.ttfb_origin_p50_us = attributes[:'ttfb_origin_p50_us']
145
+ end
146
+
147
+ if attributes.key?(:'ttfb_origin_p75_us')
148
+ self.ttfb_origin_p75_us = attributes[:'ttfb_origin_p75_us']
149
+ end
150
+
151
+ if attributes.key?(:'ttfb_origin_p95_us')
152
+ self.ttfb_origin_p95_us = attributes[:'ttfb_origin_p95_us']
153
+ end
154
+
155
+ if attributes.key?(:'ttfb_origin_p99_us')
156
+ self.ttfb_origin_p99_us = attributes[:'ttfb_origin_p99_us']
157
+ end
158
+
159
+ if attributes.key?(:'ttfb_shield_p25_us')
160
+ self.ttfb_shield_p25_us = attributes[:'ttfb_shield_p25_us']
161
+ end
162
+
163
+ if attributes.key?(:'ttfb_shield_p50_us')
164
+ self.ttfb_shield_p50_us = attributes[:'ttfb_shield_p50_us']
165
+ end
166
+
167
+ if attributes.key?(:'ttfb_shield_p75_us')
168
+ self.ttfb_shield_p75_us = attributes[:'ttfb_shield_p75_us']
169
+ end
170
+
171
+ if attributes.key?(:'ttfb_shield_p95_us')
172
+ self.ttfb_shield_p95_us = attributes[:'ttfb_shield_p95_us']
173
+ end
174
+
175
+ if attributes.key?(:'ttfb_shield_p99_us')
176
+ self.ttfb_shield_p99_us = attributes[:'ttfb_shield_p99_us']
177
+ end
178
+
179
+ if attributes.key?(:'ttfb_edge_p25_us')
180
+ self.ttfb_edge_p25_us = attributes[:'ttfb_edge_p25_us']
181
+ end
182
+
183
+ if attributes.key?(:'ttfb_edge_p50_us')
184
+ self.ttfb_edge_p50_us = attributes[:'ttfb_edge_p50_us']
185
+ end
186
+
187
+ if attributes.key?(:'ttfb_edge_p75_us')
188
+ self.ttfb_edge_p75_us = attributes[:'ttfb_edge_p75_us']
189
+ end
190
+
191
+ if attributes.key?(:'ttfb_edge_p95_us')
192
+ self.ttfb_edge_p95_us = attributes[:'ttfb_edge_p95_us']
193
+ end
194
+
195
+ if attributes.key?(:'ttfb_edge_p99_us')
196
+ self.ttfb_edge_p99_us = attributes[:'ttfb_edge_p99_us']
197
+ end
198
+ end
199
+
200
+ # Show invalid properties with the reasons. Usually used together with valid?
201
+ # @return Array for valid properties with the reasons
202
+ def list_invalid_properties
203
+ invalid_properties = Array.new
204
+ invalid_properties
205
+ end
206
+
207
+ # Check to see if the all the properties in the model are valid
208
+ # @return true if the model is valid
209
+ def valid?
210
+ true
211
+ end
212
+
213
+ # Checks equality by comparing each attribute.
214
+ # @param [Object] Object to be compared
215
+ def ==(o)
216
+ return true if self.equal?(o)
217
+ self.class == o.class &&
218
+ timestamp == o.timestamp &&
219
+ ttfb_origin_p25_us == o.ttfb_origin_p25_us &&
220
+ ttfb_origin_p50_us == o.ttfb_origin_p50_us &&
221
+ ttfb_origin_p75_us == o.ttfb_origin_p75_us &&
222
+ ttfb_origin_p95_us == o.ttfb_origin_p95_us &&
223
+ ttfb_origin_p99_us == o.ttfb_origin_p99_us &&
224
+ ttfb_shield_p25_us == o.ttfb_shield_p25_us &&
225
+ ttfb_shield_p50_us == o.ttfb_shield_p50_us &&
226
+ ttfb_shield_p75_us == o.ttfb_shield_p75_us &&
227
+ ttfb_shield_p95_us == o.ttfb_shield_p95_us &&
228
+ ttfb_shield_p99_us == o.ttfb_shield_p99_us &&
229
+ ttfb_edge_p25_us == o.ttfb_edge_p25_us &&
230
+ ttfb_edge_p50_us == o.ttfb_edge_p50_us &&
231
+ ttfb_edge_p75_us == o.ttfb_edge_p75_us &&
232
+ ttfb_edge_p95_us == o.ttfb_edge_p95_us &&
233
+ ttfb_edge_p99_us == o.ttfb_edge_p99_us
234
+ end
235
+
236
+ # @see the `==` method
237
+ # @param [Object] Object to be compared
238
+ def eql?(o)
239
+ self == o
240
+ end
241
+
242
+ # Calculates hash code according to all attributes.
243
+ # @return [Integer] Hash code
244
+ def hash
245
+ [timestamp, ttfb_origin_p25_us, ttfb_origin_p50_us, ttfb_origin_p75_us, ttfb_origin_p95_us, ttfb_origin_p99_us, ttfb_shield_p25_us, ttfb_shield_p50_us, ttfb_shield_p75_us, ttfb_shield_p95_us, ttfb_shield_p99_us, ttfb_edge_p25_us, ttfb_edge_p50_us, ttfb_edge_p75_us, ttfb_edge_p95_us, ttfb_edge_p99_us].hash
246
+ end
247
+
248
+ # Builds the object from hash
249
+ # @param [Hash] attributes Model attributes in the form of hash
250
+ # @return [Object] Returns the model itself
251
+ def self.build_from_hash(attributes)
252
+ new.build_from_hash(attributes)
253
+ end
254
+
255
+ # Builds the object from hash
256
+ # @param [Hash] attributes Model attributes in the form of hash
257
+ # @return [Object] Returns the model itself
258
+ def build_from_hash(attributes)
259
+ return nil unless attributes.is_a?(Hash)
260
+ self.class.fastly_types.each_pair do |key, type|
261
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
262
+ self.send("#{key}=", nil)
263
+ elsif type =~ /\AArray<(.*)>/i
264
+ # check to ensure the input is an array given that the attribute
265
+ # is documented as an array but the input is not
266
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
267
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
268
+ end
269
+ elsif !attributes[self.class.attribute_map[key]].nil?
270
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
271
+ end
272
+ end
273
+
274
+ self
275
+ end
276
+
277
+ # Deserializes the data based on type
278
+ # @param string type Data type
279
+ # @param string value Value to be deserialized
280
+ # @return [Object] Deserialized data
281
+ def _deserialize(type, value)
282
+ case type.to_sym
283
+ when :Time
284
+ Time.parse(value)
285
+ when :Date
286
+ Date.parse(value)
287
+ when :String
288
+ value.to_s
289
+ when :Integer
290
+ value.to_i
291
+ when :Float
292
+ value.to_f
293
+ when :Boolean
294
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
295
+ true
296
+ else
297
+ false
298
+ end
299
+ when :Object
300
+ # generic object (usually a Hash), return directly
301
+ value
302
+ when /\AArray<(?<inner_type>.+)>\z/
303
+ inner_type = Regexp.last_match[:inner_type]
304
+ value.map { |v| _deserialize(inner_type, v) }
305
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
306
+ k_type = Regexp.last_match[:k_type]
307
+ v_type = Regexp.last_match[:v_type]
308
+ {}.tap do |hash|
309
+ value.each do |k, v|
310
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
311
+ end
312
+ end
313
+ else # model
314
+ # models (e.g. Pet) or oneOf
315
+ klass = Fastly.const_get(type)
316
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
317
+ end
318
+ end
319
+
320
+ # Returns the string representation of the object
321
+ # @return [String] String presentation of the object
322
+ def to_s
323
+ to_hash.to_s
324
+ end
325
+
326
+ # to_body is an alias to to_hash (backward compatibility)
327
+ # @return [Hash] Returns the object in the form of hash
328
+ def to_body
329
+ to_hash
330
+ end
331
+
332
+ # Returns the object in the form of hash
333
+ # @return [Hash] Returns the object in the form of hash
334
+ def to_hash
335
+ hash = {}
336
+ self.class.attribute_map.each_pair do |attr, param|
337
+ value = self.send(attr)
338
+ if value.nil?
339
+ is_nullable = self.class.fastly_nullable.include?(attr)
340
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
341
+ end
342
+
343
+ hash[param] = _to_hash(value)
344
+ end
345
+ hash
346
+ end
347
+
348
+ # Outputs non-array value in the form of hash
349
+ # For object, use to_hash. Otherwise, just return the value
350
+ # @param [Object] value Any valid value
351
+ # @return [Hash] Returns the value in the form of hash
352
+ def _to_hash(value)
353
+ if value.is_a?(Array)
354
+ value.compact.map { |v| _to_hash(v) }
355
+ elsif value.is_a?(Hash)
356
+ {}.tap do |hash|
357
+ value.each { |k, v| hash[k] = _to_hash(v) }
358
+ end
359
+ elsif value.respond_to? :to_hash
360
+ value.to_hash
361
+ else
362
+ value
363
+ end
364
+ end
365
+
366
+ end
367
+
368
+ end