fastly 8.5.0 → 8.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +15 -2
  5. data/docs/{RelationshipTlsDnsRecord.md → AsyncResponse.md} +3 -2
  6. data/docs/Billing.md +1 -2
  7. data/docs/BillingApi.md +2 -2
  8. data/docs/BillingBandwidth.md +11 -0
  9. data/docs/BillingBandwidthTiers.md +14 -0
  10. data/docs/{RelationshipTlsDnsRecords.md → BillingEstimateInvoiceId.md} +2 -2
  11. data/docs/BillingEstimateResponse.md +2 -2
  12. data/docs/{RelationshipTlsDnsRecordDnsRecord.md → BillingInvoiceId.md} +2 -2
  13. data/docs/BillingInvoicesApi.md +39 -6
  14. data/docs/BillingRegions.md +13 -0
  15. data/docs/BillingResponse.md +2 -2
  16. data/docs/BillingResponseLineItem.md +1 -1
  17. data/docs/BillingUsageMetricsApi.md +111 -0
  18. data/docs/CreateDashboardRequest.md +12 -0
  19. data/docs/Dashboard.md +17 -0
  20. data/docs/DashboardItem.md +15 -0
  21. data/docs/DashboardItemPropertyDataSource.md +11 -0
  22. data/docs/DashboardItemPropertyDataSourcePropertyConfig.md +10 -0
  23. data/docs/DashboardItemPropertyVisualization.md +11 -0
  24. data/docs/DashboardItemPropertyVisualizationPropertyConfig.md +12 -0
  25. data/docs/{LineItemDataReadOnlyInvoiceId.md → DashboardPropertyCreatedBy.md} +1 -1
  26. data/docs/DashboardPropertyUpdatedBy.md +9 -0
  27. data/docs/DomainInspectorMeasurements.md +1 -1
  28. data/docs/{InvoiceResponse.md → EomInvoiceResponse.md} +2 -2
  29. data/docs/GetServiceLevelUsageResponse.md +10 -0
  30. data/docs/GetServiceLevelUsageTypesResponse.md +10 -0
  31. data/docs/IncludedWithTlsConfiguration.md +10 -0
  32. data/docs/IncludedWithTlsConfigurationItem.md +12 -0
  33. data/docs/Invoice.md +1 -1
  34. data/docs/LineItemData.md +1 -1
  35. data/docs/ListDashboardsResponse.md +11 -0
  36. data/docs/{ListInvoicesResponse.md → ListEomInvoicesResponse.md} +1 -1
  37. data/docs/MtdInvoiceResponse.md +15 -0
  38. data/docs/Mtdinvoice.md +15 -0
  39. data/docs/Mtdlineitems.md +18 -0
  40. data/docs/ObservabilityCustomDashboardsApi.md +203 -0
  41. data/docs/RealtimeEntryAggregated.md +1 -0
  42. data/docs/RealtimeMeasurements.md +1 -0
  43. data/docs/RelationshipDefaultEcdsaTlsCertificate.md +10 -0
  44. data/docs/RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificate.md +10 -0
  45. data/docs/RelationshipDefaultEcdsaTlsCertificateDefaultEcdsaCertificateData.md +11 -0
  46. data/docs/RelationshipDefaultTlsCertificate.md +10 -0
  47. data/docs/RelationshipDefaultTlsCertificateDefaultCertificate.md +10 -0
  48. data/docs/RelationshipDefaultTlsCertificateDefaultCertificateData.md +11 -0
  49. data/docs/RelationshipTlsDnsRecordsRequest.md +10 -0
  50. data/docs/RelationshipTlsDnsRecordsRequestDnsRecords.md +10 -0
  51. data/docs/RelationshipTlsDnsRecordsRequestDnsRecordsData.md +11 -0
  52. data/docs/RelationshipTlsDnsRecordsResponse.md +10 -0
  53. data/docs/RelationshipTlsDnsRecordsResponseDnsRecords.md +10 -0
  54. data/docs/{RelationshipMemberTlsDnsRecord.md → RelationshipTlsDnsRecordsResponseDnsRecordsData.md} +1 -1
  55. data/docs/Results.md +1 -0
  56. data/docs/Serviceusagemetric.md +13 -0
  57. data/docs/Serviceusagemetrics.md +10 -0
  58. data/docs/ServiceusagemetricsData.md +16 -0
  59. data/docs/Serviceusagetype.md +11 -0
  60. data/docs/Serviceusagetypes.md +10 -0
  61. data/docs/TlsCertificateBlobResponse.md +10 -0
  62. data/docs/TlsCertificatesApi.md +38 -0
  63. data/docs/TlsDnsRecord.md +1 -2
  64. data/docs/UpdateDashboardRequest.md +12 -0
  65. data/docs/Values.md +1 -1
  66. data/lib/fastly/api/billing_api.rb +2 -2
  67. data/lib/fastly/api/billing_invoices_api.rb +64 -8
  68. data/lib/fastly/api/billing_usage_metrics_api.rb +213 -0
  69. data/lib/fastly/api/observability_custom_dashboards_api.rb +333 -0
  70. data/lib/fastly/api/tls_certificates_api.rb +63 -0
  71. data/lib/fastly/configuration.rb +54 -0
  72. data/lib/fastly/models/async_response.rb +225 -0
  73. data/lib/fastly/models/billing.rb +2 -11
  74. data/lib/fastly/models/billing_bandwidth.rb +227 -0
  75. data/lib/fastly/models/billing_bandwidth_tiers.rb +252 -0
  76. data/lib/fastly/models/{relationship_tls_dns_record.rb → billing_estimate_invoice_id.rb} +10 -10
  77. data/lib/fastly/models/billing_estimate_response.rb +12 -11
  78. data/lib/fastly/models/billing_invoice_id.rb +216 -0
  79. data/lib/fastly/models/billing_regions.rb +243 -0
  80. data/lib/fastly/models/billing_response.rb +12 -11
  81. data/lib/fastly/models/billing_response_line_item.rb +2 -1
  82. data/lib/fastly/models/create_dashboard_request.rb +245 -0
  83. data/lib/fastly/models/dashboard.rb +290 -0
  84. data/lib/fastly/models/dashboard_item.rb +368 -0
  85. data/lib/fastly/models/dashboard_item_property_data_source.rb +271 -0
  86. data/lib/fastly/models/dashboard_item_property_data_source_property_config.rb +244 -0
  87. data/lib/fastly/models/dashboard_item_property_visualization.rb +271 -0
  88. data/lib/fastly/models/dashboard_item_property_visualization_property_config.rb +303 -0
  89. data/lib/fastly/models/{line_item_data_read_only_invoice_id.rb → dashboard_property_created_by.rb} +4 -3
  90. data/lib/fastly/models/dashboard_property_updated_by.rb +208 -0
  91. data/lib/fastly/models/domain_inspector_measurements.rb +1 -1
  92. data/lib/fastly/models/{invoice_response.rb → eom_invoice_response.rb} +4 -4
  93. data/lib/fastly/models/get_service_level_usage_response.rb +223 -0
  94. data/lib/fastly/models/get_service_level_usage_types_response.rb +225 -0
  95. data/lib/fastly/models/included_with_tls_configuration.rb +218 -0
  96. data/lib/fastly/models/included_with_tls_configuration_item.rb +237 -0
  97. data/lib/fastly/models/invoice.rb +1 -1
  98. data/lib/fastly/models/invoicelineitems.rb +5 -5
  99. data/lib/fastly/models/line_item_data.rb +2 -1
  100. data/lib/fastly/models/list_dashboards_response.rb +229 -0
  101. data/lib/fastly/models/{list_invoices_response.rb → list_eom_invoices_response.rb} +3 -3
  102. data/lib/fastly/models/mtd_invoice_response.rb +275 -0
  103. data/lib/fastly/models/mtdinvoice.rb +268 -0
  104. data/lib/fastly/models/mtdlineitems.rb +297 -0
  105. data/lib/fastly/models/realtime_entry_aggregated.rb +14 -4
  106. data/lib/fastly/models/realtime_measurements.rb +14 -4
  107. data/lib/fastly/models/relationship_default_ecdsa_tls_certificate.rb +216 -0
  108. data/lib/fastly/models/relationship_default_ecdsa_tls_certificate_default_ecdsa_certificate.rb +216 -0
  109. data/lib/fastly/models/relationship_default_ecdsa_tls_certificate_default_ecdsa_certificate_data.rb +228 -0
  110. data/lib/fastly/models/relationship_default_tls_certificate.rb +216 -0
  111. data/lib/fastly/models/relationship_default_tls_certificate_default_certificate.rb +216 -0
  112. data/lib/fastly/models/relationship_default_tls_certificate_default_certificate_data.rb +228 -0
  113. data/lib/fastly/models/{relationship_tls_dns_records.rb → relationship_tls_dns_records_request.rb} +4 -4
  114. data/lib/fastly/models/relationship_tls_dns_records_request_dns_records.rb +218 -0
  115. data/lib/fastly/models/{relationship_member_tls_dns_record.rb → relationship_tls_dns_records_request_dns_records_data.rb} +3 -3
  116. data/lib/fastly/models/relationship_tls_dns_records_response.rb +216 -0
  117. data/lib/fastly/models/relationship_tls_dns_records_response_dns_records.rb +218 -0
  118. data/lib/fastly/models/relationship_tls_dns_records_response_dns_records_data.rb +227 -0
  119. data/lib/fastly/models/relationships_for_tls_configuration.rb +1 -1
  120. data/lib/fastly/models/results.rb +11 -1
  121. data/lib/fastly/models/serviceusagemetric.rb +246 -0
  122. data/lib/fastly/models/serviceusagemetrics.rb +216 -0
  123. data/lib/fastly/models/serviceusagemetrics_data.rb +276 -0
  124. data/lib/fastly/models/serviceusagetype.rb +227 -0
  125. data/lib/fastly/models/{relationship_tls_dns_record_dns_record.rb → serviceusagetypes.rb} +4 -4
  126. data/lib/fastly/models/tls_certificate_blob_response.rb +217 -0
  127. data/lib/fastly/models/tls_dns_record.rb +48 -12
  128. data/lib/fastly/models/update_dashboard_request.rb +240 -0
  129. data/lib/fastly/models/values.rb +1 -1
  130. data/lib/fastly/version.rb +1 -1
  131. data/lib/fastly.rb +46 -7
  132. data/sig.json +1 -1
  133. metadata +94 -16
@@ -0,0 +1,268 @@
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 Mtdinvoice
16
+ # The Customer ID associated with the invoice.
17
+ attr_accessor :customer_id
18
+
19
+ # An alphanumeric string identifying the invoice.
20
+ attr_accessor :invoice_id
21
+
22
+ # The date and time (in ISO 8601 format) for the initiation point of a billing cycle, signifying the start of charges for a service or subscription.
23
+ attr_accessor :billing_start_date
24
+
25
+ # The date and time (in ISO 8601 format) for the termination point of a billing cycle, signifying the end of charges for a service or subscription.
26
+ attr_accessor :billing_end_date
27
+
28
+ # The total billable amount for invoiced services charged within a single month.
29
+ attr_accessor :monthly_transaction_amount
30
+
31
+ attr_accessor :transaction_line_items
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'customer_id' => :'customer_id',
37
+ :'invoice_id' => :'invoice_id',
38
+ :'billing_start_date' => :'billing_start_date',
39
+ :'billing_end_date' => :'billing_end_date',
40
+ :'monthly_transaction_amount' => :'monthly_transaction_amount',
41
+ :'transaction_line_items' => :'transaction_line_items'
42
+ }
43
+ end
44
+
45
+ # Returns all the JSON keys this model knows about
46
+ def self.acceptable_attributes
47
+ attribute_map.values
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.fastly_types
52
+ {
53
+ :'customer_id' => :'String',
54
+ :'invoice_id' => :'String',
55
+ :'billing_start_date' => :'Time',
56
+ :'billing_end_date' => :'Time',
57
+ :'monthly_transaction_amount' => :'String',
58
+ :'transaction_line_items' => :'Array<Mtdlineitems>'
59
+ }
60
+ end
61
+
62
+ # List of attributes with nullable: true
63
+ def self.fastly_nullable
64
+ Set.new([
65
+ ])
66
+ end
67
+
68
+ # Initializes the object
69
+ # @param [Hash] attributes Model attributes in the form of hash
70
+ def initialize(attributes = {})
71
+ if (!attributes.is_a?(Hash))
72
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::Mtdinvoice` initialize method"
73
+ end
74
+
75
+ # check to see if the attribute exists and convert string to symbol for hash key
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!self.class.attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::Mtdinvoice`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
79
+ end
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+ if attributes.key?(:'customer_id')
84
+ self.customer_id = attributes[:'customer_id']
85
+ end
86
+
87
+ if attributes.key?(:'invoice_id')
88
+ self.invoice_id = attributes[:'invoice_id']
89
+ end
90
+
91
+ if attributes.key?(:'billing_start_date')
92
+ self.billing_start_date = attributes[:'billing_start_date']
93
+ end
94
+
95
+ if attributes.key?(:'billing_end_date')
96
+ self.billing_end_date = attributes[:'billing_end_date']
97
+ end
98
+
99
+ if attributes.key?(:'monthly_transaction_amount')
100
+ self.monthly_transaction_amount = attributes[:'monthly_transaction_amount']
101
+ end
102
+
103
+ if attributes.key?(:'transaction_line_items')
104
+ if (value = attributes[:'transaction_line_items']).is_a?(Array)
105
+ self.transaction_line_items = value
106
+ end
107
+ end
108
+ end
109
+
110
+ # Show invalid properties with the reasons. Usually used together with valid?
111
+ # @return Array for valid properties with the reasons
112
+ def list_invalid_properties
113
+ invalid_properties = Array.new
114
+ invalid_properties
115
+ end
116
+
117
+ # Check to see if the all the properties in the model are valid
118
+ # @return true if the model is valid
119
+ def valid?
120
+ true
121
+ end
122
+
123
+ # Checks equality by comparing each attribute.
124
+ # @param [Object] Object to be compared
125
+ def ==(o)
126
+ return true if self.equal?(o)
127
+ self.class == o.class &&
128
+ customer_id == o.customer_id &&
129
+ invoice_id == o.invoice_id &&
130
+ billing_start_date == o.billing_start_date &&
131
+ billing_end_date == o.billing_end_date &&
132
+ monthly_transaction_amount == o.monthly_transaction_amount &&
133
+ transaction_line_items == o.transaction_line_items
134
+ end
135
+
136
+ # @see the `==` method
137
+ # @param [Object] Object to be compared
138
+ def eql?(o)
139
+ self == o
140
+ end
141
+
142
+ # Calculates hash code according to all attributes.
143
+ # @return [Integer] Hash code
144
+ def hash
145
+ [customer_id, invoice_id, billing_start_date, billing_end_date, monthly_transaction_amount, transaction_line_items].hash
146
+ end
147
+
148
+ # Builds the object from hash
149
+ # @param [Hash] attributes Model attributes in the form of hash
150
+ # @return [Object] Returns the model itself
151
+ def self.build_from_hash(attributes)
152
+ new.build_from_hash(attributes)
153
+ end
154
+
155
+ # Builds the object from hash
156
+ # @param [Hash] attributes Model attributes in the form of hash
157
+ # @return [Object] Returns the model itself
158
+ def build_from_hash(attributes)
159
+ return nil unless attributes.is_a?(Hash)
160
+ self.class.fastly_types.each_pair do |key, type|
161
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
162
+ self.send("#{key}=", nil)
163
+ elsif type =~ /\AArray<(.*)>/i
164
+ # check to ensure the input is an array given that the attribute
165
+ # is documented as an array but the input is not
166
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
167
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
168
+ end
169
+ elsif !attributes[self.class.attribute_map[key]].nil?
170
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
171
+ end
172
+ end
173
+
174
+ self
175
+ end
176
+
177
+ # Deserializes the data based on type
178
+ # @param string type Data type
179
+ # @param string value Value to be deserialized
180
+ # @return [Object] Deserialized data
181
+ def _deserialize(type, value)
182
+ case type.to_sym
183
+ when :Time
184
+ Time.parse(value)
185
+ when :Date
186
+ Date.parse(value)
187
+ when :String
188
+ value.to_s
189
+ when :Integer
190
+ value.to_i
191
+ when :Float
192
+ value.to_f
193
+ when :Boolean
194
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
195
+ true
196
+ else
197
+ false
198
+ end
199
+ when :Object
200
+ # generic object (usually a Hash), return directly
201
+ value
202
+ when /\AArray<(?<inner_type>.+)>\z/
203
+ inner_type = Regexp.last_match[:inner_type]
204
+ value.map { |v| _deserialize(inner_type, v) }
205
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
206
+ k_type = Regexp.last_match[:k_type]
207
+ v_type = Regexp.last_match[:v_type]
208
+ {}.tap do |hash|
209
+ value.each do |k, v|
210
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
211
+ end
212
+ end
213
+ else # model
214
+ # models (e.g. Pet) or oneOf
215
+ klass = Fastly.const_get(type)
216
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
217
+ end
218
+ end
219
+
220
+ # Returns the string representation of the object
221
+ # @return [String] String presentation of the object
222
+ def to_s
223
+ to_hash.to_s
224
+ end
225
+
226
+ # to_body is an alias to to_hash (backward compatibility)
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_body
229
+ to_hash
230
+ end
231
+
232
+ # Returns the object in the form of hash
233
+ # @return [Hash] Returns the object in the form of hash
234
+ def to_hash
235
+ hash = {}
236
+ self.class.attribute_map.each_pair do |attr, param|
237
+ value = self.send(attr)
238
+ if value.nil?
239
+ is_nullable = self.class.fastly_nullable.include?(attr)
240
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
241
+ end
242
+
243
+ hash[param] = _to_hash(value)
244
+ end
245
+ hash
246
+ end
247
+
248
+ # Outputs non-array value in the form of hash
249
+ # For object, use to_hash. Otherwise, just return the value
250
+ # @param [Object] value Any valid value
251
+ # @return [Hash] Returns the value in the form of hash
252
+ def _to_hash(value)
253
+ if value.is_a?(Array)
254
+ value.compact.map { |v| _to_hash(v) }
255
+ elsif value.is_a?(Hash)
256
+ {}.tap do |hash|
257
+ value.each { |k, v| hash[k] = _to_hash(v) }
258
+ end
259
+ elsif value.respond_to? :to_hash
260
+ value.to_hash
261
+ else
262
+ value
263
+ end
264
+ end
265
+
266
+ end
267
+
268
+ end
@@ -0,0 +1,297 @@
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 Mtdlineitems
16
+ # Invoice line item transaction name.
17
+ attr_accessor :description
18
+
19
+ # Billed amount for line item.
20
+ attr_accessor :amount
21
+
22
+ # Price per unit.
23
+ attr_accessor :rate
24
+
25
+ # Total number of units of usage.
26
+ attr_accessor :units
27
+
28
+ # The name of the product.
29
+ attr_accessor :product_name
30
+
31
+ # The broader classification of the product (e.g., `Compute` or `Full-Site Delivery`).
32
+ attr_accessor :product_group
33
+
34
+ # The broader classification of the product (e.g., `Network Services` or `Security`).
35
+ attr_accessor :product_line
36
+
37
+ # The geographical area applicable for regionally based products.
38
+ attr_accessor :region
39
+
40
+ # The unit of measure (e.g., `requests` or `bandwidth`).
41
+ attr_accessor :usage_type
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ :'description' => :'description',
47
+ :'amount' => :'amount',
48
+ :'rate' => :'rate',
49
+ :'units' => :'units',
50
+ :'product_name' => :'product_name',
51
+ :'product_group' => :'product_group',
52
+ :'product_line' => :'product_line',
53
+ :'region' => :'region',
54
+ :'usage_type' => :'usage_type'
55
+ }
56
+ end
57
+
58
+ # Returns all the JSON keys this model knows about
59
+ def self.acceptable_attributes
60
+ attribute_map.values
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.fastly_types
65
+ {
66
+ :'description' => :'String',
67
+ :'amount' => :'Float',
68
+ :'rate' => :'Float',
69
+ :'units' => :'Float',
70
+ :'product_name' => :'String',
71
+ :'product_group' => :'String',
72
+ :'product_line' => :'String',
73
+ :'region' => :'String',
74
+ :'usage_type' => :'String'
75
+ }
76
+ end
77
+
78
+ # List of attributes with nullable: true
79
+ def self.fastly_nullable
80
+ Set.new([
81
+ ])
82
+ end
83
+
84
+ # Initializes the object
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ def initialize(attributes = {})
87
+ if (!attributes.is_a?(Hash))
88
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::Mtdlineitems` initialize method"
89
+ end
90
+
91
+ # check to see if the attribute exists and convert string to symbol for hash key
92
+ attributes = attributes.each_with_object({}) { |(k, v), h|
93
+ if (!self.class.attribute_map.key?(k.to_sym))
94
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::Mtdlineitems`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
95
+ end
96
+ h[k.to_sym] = v
97
+ }
98
+
99
+ if attributes.key?(:'description')
100
+ self.description = attributes[:'description']
101
+ end
102
+
103
+ if attributes.key?(:'amount')
104
+ self.amount = attributes[:'amount']
105
+ end
106
+
107
+ if attributes.key?(:'rate')
108
+ self.rate = attributes[:'rate']
109
+ end
110
+
111
+ if attributes.key?(:'units')
112
+ self.units = attributes[:'units']
113
+ end
114
+
115
+ if attributes.key?(:'product_name')
116
+ self.product_name = attributes[:'product_name']
117
+ end
118
+
119
+ if attributes.key?(:'product_group')
120
+ self.product_group = attributes[:'product_group']
121
+ end
122
+
123
+ if attributes.key?(:'product_line')
124
+ self.product_line = attributes[:'product_line']
125
+ end
126
+
127
+ if attributes.key?(:'region')
128
+ self.region = attributes[:'region']
129
+ end
130
+
131
+ if attributes.key?(:'usage_type')
132
+ self.usage_type = attributes[:'usage_type']
133
+ end
134
+ end
135
+
136
+ # Show invalid properties with the reasons. Usually used together with valid?
137
+ # @return Array for valid properties with the reasons
138
+ def list_invalid_properties
139
+ invalid_properties = Array.new
140
+ invalid_properties
141
+ end
142
+
143
+ # Check to see if the all the properties in the model are valid
144
+ # @return true if the model is valid
145
+ def valid?
146
+ true
147
+ end
148
+
149
+ # Checks equality by comparing each attribute.
150
+ # @param [Object] Object to be compared
151
+ def ==(o)
152
+ return true if self.equal?(o)
153
+ self.class == o.class &&
154
+ description == o.description &&
155
+ amount == o.amount &&
156
+ rate == o.rate &&
157
+ units == o.units &&
158
+ product_name == o.product_name &&
159
+ product_group == o.product_group &&
160
+ product_line == o.product_line &&
161
+ region == o.region &&
162
+ usage_type == o.usage_type
163
+ end
164
+
165
+ # @see the `==` method
166
+ # @param [Object] Object to be compared
167
+ def eql?(o)
168
+ self == o
169
+ end
170
+
171
+ # Calculates hash code according to all attributes.
172
+ # @return [Integer] Hash code
173
+ def hash
174
+ [description, amount, rate, units, product_name, product_group, product_line, region, usage_type].hash
175
+ end
176
+
177
+ # Builds the object from hash
178
+ # @param [Hash] attributes Model attributes in the form of hash
179
+ # @return [Object] Returns the model itself
180
+ def self.build_from_hash(attributes)
181
+ new.build_from_hash(attributes)
182
+ end
183
+
184
+ # Builds the object from hash
185
+ # @param [Hash] attributes Model attributes in the form of hash
186
+ # @return [Object] Returns the model itself
187
+ def build_from_hash(attributes)
188
+ return nil unless attributes.is_a?(Hash)
189
+ self.class.fastly_types.each_pair do |key, type|
190
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
191
+ self.send("#{key}=", nil)
192
+ elsif type =~ /\AArray<(.*)>/i
193
+ # check to ensure the input is an array given that the attribute
194
+ # is documented as an array but the input is not
195
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
196
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
197
+ end
198
+ elsif !attributes[self.class.attribute_map[key]].nil?
199
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
200
+ end
201
+ end
202
+
203
+ self
204
+ end
205
+
206
+ # Deserializes the data based on type
207
+ # @param string type Data type
208
+ # @param string value Value to be deserialized
209
+ # @return [Object] Deserialized data
210
+ def _deserialize(type, value)
211
+ case type.to_sym
212
+ when :Time
213
+ Time.parse(value)
214
+ when :Date
215
+ Date.parse(value)
216
+ when :String
217
+ value.to_s
218
+ when :Integer
219
+ value.to_i
220
+ when :Float
221
+ value.to_f
222
+ when :Boolean
223
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
224
+ true
225
+ else
226
+ false
227
+ end
228
+ when :Object
229
+ # generic object (usually a Hash), return directly
230
+ value
231
+ when /\AArray<(?<inner_type>.+)>\z/
232
+ inner_type = Regexp.last_match[:inner_type]
233
+ value.map { |v| _deserialize(inner_type, v) }
234
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
235
+ k_type = Regexp.last_match[:k_type]
236
+ v_type = Regexp.last_match[:v_type]
237
+ {}.tap do |hash|
238
+ value.each do |k, v|
239
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
240
+ end
241
+ end
242
+ else # model
243
+ # models (e.g. Pet) or oneOf
244
+ klass = Fastly.const_get(type)
245
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
246
+ end
247
+ end
248
+
249
+ # Returns the string representation of the object
250
+ # @return [String] String presentation of the object
251
+ def to_s
252
+ to_hash.to_s
253
+ end
254
+
255
+ # to_body is an alias to to_hash (backward compatibility)
256
+ # @return [Hash] Returns the object in the form of hash
257
+ def to_body
258
+ to_hash
259
+ end
260
+
261
+ # Returns the object in the form of hash
262
+ # @return [Hash] Returns the object in the form of hash
263
+ def to_hash
264
+ hash = {}
265
+ self.class.attribute_map.each_pair do |attr, param|
266
+ value = self.send(attr)
267
+ if value.nil?
268
+ is_nullable = self.class.fastly_nullable.include?(attr)
269
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
270
+ end
271
+
272
+ hash[param] = _to_hash(value)
273
+ end
274
+ hash
275
+ end
276
+
277
+ # Outputs non-array value in the form of hash
278
+ # For object, use to_hash. Otherwise, just return the value
279
+ # @param [Object] value Any valid value
280
+ # @return [Hash] Returns the value in the form of hash
281
+ def _to_hash(value)
282
+ if value.is_a?(Array)
283
+ value.compact.map { |v| _to_hash(v) }
284
+ elsif value.is_a?(Hash)
285
+ {}.tap do |hash|
286
+ value.each { |k, v| hash[k] = _to_hash(v) }
287
+ end
288
+ elsif value.respond_to? :to_hash
289
+ value.to_hash
290
+ else
291
+ value
292
+ end
293
+ end
294
+
295
+ end
296
+
297
+ end
@@ -758,6 +758,9 @@ module Fastly
758
758
  # Number of \"Server Error\" codes delivered for all sources.
759
759
  attr_accessor :all_status_5xx
760
760
 
761
+ # Origin Offload measures the ratio of bytes served to end users that were cached by Fastly, over the bytes served to end users, between 0 and 1. ((`edge_resp_body_bytes` + `edge_resp_header_bytes`) - (`origin_fetch_resp_body_bytes` + `origin_fetch_resp_header_bytes`)) / (`edge_resp_body_bytes` + `edge_resp_header_bytes`).
762
+ attr_accessor :origin_offload
763
+
761
764
  # Attribute mapping from ruby-style variable name to JSON key.
762
765
  def self.attribute_map
763
766
  {
@@ -1008,7 +1011,8 @@ module Fastly
1008
1011
  :'all_status_2xx' => :'all_status_2xx',
1009
1012
  :'all_status_3xx' => :'all_status_3xx',
1010
1013
  :'all_status_4xx' => :'all_status_4xx',
1011
- :'all_status_5xx' => :'all_status_5xx'
1014
+ :'all_status_5xx' => :'all_status_5xx',
1015
+ :'origin_offload' => :'origin_offload'
1012
1016
  }
1013
1017
  end
1014
1018
 
@@ -1267,7 +1271,8 @@ module Fastly
1267
1271
  :'all_status_2xx' => :'Integer',
1268
1272
  :'all_status_3xx' => :'Integer',
1269
1273
  :'all_status_4xx' => :'Integer',
1270
- :'all_status_5xx' => :'Integer'
1274
+ :'all_status_5xx' => :'Integer',
1275
+ :'origin_offload' => :'Float'
1271
1276
  }
1272
1277
  end
1273
1278
 
@@ -2292,6 +2297,10 @@ module Fastly
2292
2297
  if attributes.key?(:'all_status_5xx')
2293
2298
  self.all_status_5xx = attributes[:'all_status_5xx']
2294
2299
  end
2300
+
2301
+ if attributes.key?(:'origin_offload')
2302
+ self.origin_offload = attributes[:'origin_offload']
2303
+ end
2295
2304
  end
2296
2305
 
2297
2306
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -2559,7 +2568,8 @@ module Fastly
2559
2568
  all_status_2xx == o.all_status_2xx &&
2560
2569
  all_status_3xx == o.all_status_3xx &&
2561
2570
  all_status_4xx == o.all_status_4xx &&
2562
- all_status_5xx == o.all_status_5xx
2571
+ all_status_5xx == o.all_status_5xx &&
2572
+ origin_offload == o.origin_offload
2563
2573
  end
2564
2574
 
2565
2575
  # @see the `==` method
@@ -2571,7 +2581,7 @@ module Fastly
2571
2581
  # Calculates hash code according to all attributes.
2572
2582
  # @return [Integer] Hash code
2573
2583
  def hash
2574
- [requests, logging, log, resp_header_bytes, header_size, resp_body_bytes, body_size, hits, miss, pass, synth, errors, hits_time, miss_time, miss_histogram, compute_requests, compute_execution_time_ms, compute_ram_used, compute_request_time_ms, compute_request_time_billed_ms, shield, ipv6, imgopto, imgopto_shield, imgopto_transforms, otfp, otfp_shield, otfp_manifests, video, pci, http2, http3, restarts, req_header_bytes, req_body_bytes, bereq_header_bytes, bereq_body_bytes, waf_blocked, waf_logged, waf_passed, attack_req_header_bytes, attack_req_body_bytes, attack_resp_synth_bytes, attack_logged_req_header_bytes, attack_logged_req_body_bytes, attack_blocked_req_header_bytes, attack_blocked_req_body_bytes, attack_passed_req_header_bytes, attack_passed_req_body_bytes, shield_resp_header_bytes, shield_resp_body_bytes, otfp_resp_header_bytes, otfp_resp_body_bytes, otfp_shield_resp_header_bytes, otfp_shield_resp_body_bytes, otfp_shield_time, otfp_deliver_time, imgopto_resp_header_bytes, imgopto_resp_body_bytes, imgopto_shield_resp_header_bytes, imgopto_shield_resp_body_bytes, status_1xx, status_2xx, status_3xx, status_4xx, status_5xx, status_200, status_204, status_206, status_301, status_302, status_304, status_400, status_401, status_403, status_404, status_406, status_416, status_429, status_500, status_501, status_502, status_503, status_504, status_505, uncacheable, pass_time, tls, tls_v10, tls_v11, tls_v12, tls_v13, object_size_1k, object_size_10k, object_size_100k, object_size_1m, object_size_10m, object_size_100m, object_size_1g, object_size_other, recv_sub_time, recv_sub_count, hash_sub_time, hash_sub_count, miss_sub_time, miss_sub_count, fetch_sub_time, fetch_sub_count, pass_sub_time, pass_sub_count, pipe_sub_time, pipe_sub_count, deliver_sub_time, deliver_sub_count, error_sub_time, error_sub_count, hit_sub_time, hit_sub_count, prehash_sub_time, prehash_sub_count, predeliver_sub_time, predeliver_sub_count, hit_resp_body_bytes, miss_resp_body_bytes, pass_resp_body_bytes, compute_req_header_bytes, compute_req_body_bytes, compute_resp_header_bytes, compute_resp_body_bytes, imgvideo, imgvideo_frames, imgvideo_resp_header_bytes, imgvideo_resp_body_bytes, imgvideo_shield, imgvideo_shield_frames, imgvideo_shield_resp_header_bytes, imgvideo_shield_resp_body_bytes, log_bytes, edge_requests, edge_resp_header_bytes, edge_resp_body_bytes, origin_revalidations, origin_fetches, origin_fetch_header_bytes, origin_fetch_body_bytes, origin_fetch_resp_header_bytes, origin_fetch_resp_body_bytes, shield_revalidations, shield_fetches, shield_fetch_header_bytes, shield_fetch_body_bytes, shield_fetch_resp_header_bytes, shield_fetch_resp_body_bytes, segblock_origin_fetches, segblock_shield_fetches, compute_resp_status_1xx, compute_resp_status_2xx, compute_resp_status_3xx, compute_resp_status_4xx, compute_resp_status_5xx, edge_hit_requests, edge_miss_requests, compute_bereq_header_bytes, compute_bereq_body_bytes, compute_beresp_header_bytes, compute_beresp_body_bytes, origin_cache_fetches, shield_cache_fetches, compute_bereqs, compute_bereq_errors, compute_resource_limit_exceeded, compute_heap_limit_exceeded, compute_stack_limit_exceeded, compute_globals_limit_exceeded, compute_guest_errors, compute_runtime_errors, edge_hit_resp_body_bytes, edge_hit_resp_header_bytes, edge_miss_resp_body_bytes, edge_miss_resp_header_bytes, origin_cache_fetch_resp_body_bytes, origin_cache_fetch_resp_header_bytes, shield_hit_requests, shield_miss_requests, shield_hit_resp_header_bytes, shield_hit_resp_body_bytes, shield_miss_resp_header_bytes, shield_miss_resp_body_bytes, websocket_req_header_bytes, websocket_req_body_bytes, websocket_resp_header_bytes, websocket_bereq_header_bytes, websocket_bereq_body_bytes, websocket_beresp_header_bytes, websocket_beresp_body_bytes, websocket_conn_time_ms, websocket_resp_body_bytes, fanout_recv_publishes, fanout_send_publishes, kv_store_class_a_operations, kv_store_class_b_operations, object_store_class_a_operations, object_store_class_b_operations, fanout_req_header_bytes, fanout_req_body_bytes, fanout_resp_header_bytes, fanout_resp_body_bytes, fanout_bereq_header_bytes, fanout_bereq_body_bytes, fanout_beresp_header_bytes, fanout_beresp_body_bytes, fanout_conn_time_ms, ddos_action_limit_streams_connections, ddos_action_limit_streams_requests, ddos_action_tarpit_accept, ddos_action_tarpit, ddos_action_close, ddos_action_blackhole, bot_challenge_starts, bot_challenge_complete_tokens_passed, bot_challenge_complete_tokens_failed, bot_challenge_complete_tokens_checked, bot_challenge_complete_tokens_disabled, bot_challenges_issued, bot_challenges_succeeded, bot_challenges_failed, bot_challenge_complete_tokens_issued, ddos_action_downgrade, ddos_action_downgraded_connections, vcl_on_compute_hit_requests, vcl_on_compute_miss_requests, vcl_on_compute_pass_requests, vcl_on_compute_error_requests, vcl_on_compute_synth_requests, vcl_on_compute_edge_hit_requests, vcl_on_compute_edge_miss_requests, all_hit_requests, all_miss_requests, all_pass_requests, all_error_requests, all_synth_requests, all_edge_hit_requests, all_edge_miss_requests, all_status_1xx, all_status_2xx, all_status_3xx, all_status_4xx, all_status_5xx].hash
2584
+ [requests, logging, log, resp_header_bytes, header_size, resp_body_bytes, body_size, hits, miss, pass, synth, errors, hits_time, miss_time, miss_histogram, compute_requests, compute_execution_time_ms, compute_ram_used, compute_request_time_ms, compute_request_time_billed_ms, shield, ipv6, imgopto, imgopto_shield, imgopto_transforms, otfp, otfp_shield, otfp_manifests, video, pci, http2, http3, restarts, req_header_bytes, req_body_bytes, bereq_header_bytes, bereq_body_bytes, waf_blocked, waf_logged, waf_passed, attack_req_header_bytes, attack_req_body_bytes, attack_resp_synth_bytes, attack_logged_req_header_bytes, attack_logged_req_body_bytes, attack_blocked_req_header_bytes, attack_blocked_req_body_bytes, attack_passed_req_header_bytes, attack_passed_req_body_bytes, shield_resp_header_bytes, shield_resp_body_bytes, otfp_resp_header_bytes, otfp_resp_body_bytes, otfp_shield_resp_header_bytes, otfp_shield_resp_body_bytes, otfp_shield_time, otfp_deliver_time, imgopto_resp_header_bytes, imgopto_resp_body_bytes, imgopto_shield_resp_header_bytes, imgopto_shield_resp_body_bytes, status_1xx, status_2xx, status_3xx, status_4xx, status_5xx, status_200, status_204, status_206, status_301, status_302, status_304, status_400, status_401, status_403, status_404, status_406, status_416, status_429, status_500, status_501, status_502, status_503, status_504, status_505, uncacheable, pass_time, tls, tls_v10, tls_v11, tls_v12, tls_v13, object_size_1k, object_size_10k, object_size_100k, object_size_1m, object_size_10m, object_size_100m, object_size_1g, object_size_other, recv_sub_time, recv_sub_count, hash_sub_time, hash_sub_count, miss_sub_time, miss_sub_count, fetch_sub_time, fetch_sub_count, pass_sub_time, pass_sub_count, pipe_sub_time, pipe_sub_count, deliver_sub_time, deliver_sub_count, error_sub_time, error_sub_count, hit_sub_time, hit_sub_count, prehash_sub_time, prehash_sub_count, predeliver_sub_time, predeliver_sub_count, hit_resp_body_bytes, miss_resp_body_bytes, pass_resp_body_bytes, compute_req_header_bytes, compute_req_body_bytes, compute_resp_header_bytes, compute_resp_body_bytes, imgvideo, imgvideo_frames, imgvideo_resp_header_bytes, imgvideo_resp_body_bytes, imgvideo_shield, imgvideo_shield_frames, imgvideo_shield_resp_header_bytes, imgvideo_shield_resp_body_bytes, log_bytes, edge_requests, edge_resp_header_bytes, edge_resp_body_bytes, origin_revalidations, origin_fetches, origin_fetch_header_bytes, origin_fetch_body_bytes, origin_fetch_resp_header_bytes, origin_fetch_resp_body_bytes, shield_revalidations, shield_fetches, shield_fetch_header_bytes, shield_fetch_body_bytes, shield_fetch_resp_header_bytes, shield_fetch_resp_body_bytes, segblock_origin_fetches, segblock_shield_fetches, compute_resp_status_1xx, compute_resp_status_2xx, compute_resp_status_3xx, compute_resp_status_4xx, compute_resp_status_5xx, edge_hit_requests, edge_miss_requests, compute_bereq_header_bytes, compute_bereq_body_bytes, compute_beresp_header_bytes, compute_beresp_body_bytes, origin_cache_fetches, shield_cache_fetches, compute_bereqs, compute_bereq_errors, compute_resource_limit_exceeded, compute_heap_limit_exceeded, compute_stack_limit_exceeded, compute_globals_limit_exceeded, compute_guest_errors, compute_runtime_errors, edge_hit_resp_body_bytes, edge_hit_resp_header_bytes, edge_miss_resp_body_bytes, edge_miss_resp_header_bytes, origin_cache_fetch_resp_body_bytes, origin_cache_fetch_resp_header_bytes, shield_hit_requests, shield_miss_requests, shield_hit_resp_header_bytes, shield_hit_resp_body_bytes, shield_miss_resp_header_bytes, shield_miss_resp_body_bytes, websocket_req_header_bytes, websocket_req_body_bytes, websocket_resp_header_bytes, websocket_bereq_header_bytes, websocket_bereq_body_bytes, websocket_beresp_header_bytes, websocket_beresp_body_bytes, websocket_conn_time_ms, websocket_resp_body_bytes, fanout_recv_publishes, fanout_send_publishes, kv_store_class_a_operations, kv_store_class_b_operations, object_store_class_a_operations, object_store_class_b_operations, fanout_req_header_bytes, fanout_req_body_bytes, fanout_resp_header_bytes, fanout_resp_body_bytes, fanout_bereq_header_bytes, fanout_bereq_body_bytes, fanout_beresp_header_bytes, fanout_beresp_body_bytes, fanout_conn_time_ms, ddos_action_limit_streams_connections, ddos_action_limit_streams_requests, ddos_action_tarpit_accept, ddos_action_tarpit, ddos_action_close, ddos_action_blackhole, bot_challenge_starts, bot_challenge_complete_tokens_passed, bot_challenge_complete_tokens_failed, bot_challenge_complete_tokens_checked, bot_challenge_complete_tokens_disabled, bot_challenges_issued, bot_challenges_succeeded, bot_challenges_failed, bot_challenge_complete_tokens_issued, ddos_action_downgrade, ddos_action_downgraded_connections, vcl_on_compute_hit_requests, vcl_on_compute_miss_requests, vcl_on_compute_pass_requests, vcl_on_compute_error_requests, vcl_on_compute_synth_requests, vcl_on_compute_edge_hit_requests, vcl_on_compute_edge_miss_requests, all_hit_requests, all_miss_requests, all_pass_requests, all_error_requests, all_synth_requests, all_edge_hit_requests, all_edge_miss_requests, all_status_1xx, all_status_2xx, all_status_3xx, all_status_4xx, all_status_5xx, origin_offload].hash
2575
2585
  end
2576
2586
 
2577
2587
  # Builds the object from hash