fastly 8.6.0 → 8.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +1 -1
  5. data/docs/Billing.md +1 -2
  6. data/docs/BillingApi.md +2 -2
  7. data/docs/BillingBandwidth.md +11 -0
  8. data/docs/BillingBandwidthTiers.md +14 -0
  9. data/docs/BillingEstimateInvoiceId.md +10 -0
  10. data/docs/BillingEstimateResponse.md +2 -2
  11. data/docs/{LineItemDataReadOnlyInvoiceId.md → BillingInvoiceId.md} +2 -1
  12. data/docs/BillingInvoicesApi.md +2 -2
  13. data/docs/BillingRegions.md +13 -0
  14. data/docs/BillingResponse.md +2 -2
  15. data/docs/BillingResponseLineItem.md +1 -1
  16. data/docs/EomInvoiceResponse.md +1 -1
  17. data/docs/Invoice.md +1 -1
  18. data/docs/LineItemData.md +1 -1
  19. data/lib/fastly/api/billing_api.rb +2 -2
  20. data/lib/fastly/api/billing_invoices_api.rb +2 -2
  21. data/lib/fastly/models/billing.rb +2 -11
  22. data/lib/fastly/models/billing_bandwidth.rb +227 -0
  23. data/lib/fastly/models/billing_bandwidth_tiers.rb +252 -0
  24. data/lib/fastly/models/billing_estimate_invoice_id.rb +216 -0
  25. data/lib/fastly/models/billing_estimate_response.rb +12 -11
  26. data/lib/fastly/models/{line_item_data_read_only_invoice_id.rb → billing_invoice_id.rb} +14 -5
  27. data/lib/fastly/models/billing_regions.rb +243 -0
  28. data/lib/fastly/models/billing_response.rb +12 -11
  29. data/lib/fastly/models/billing_response_line_item.rb +2 -1
  30. data/lib/fastly/models/eom_invoice_response.rb +1 -1
  31. data/lib/fastly/models/invoice.rb +1 -1
  32. data/lib/fastly/models/line_item_data.rb +2 -1
  33. data/lib/fastly/version.rb +1 -1
  34. data/lib/fastly.rb +5 -1
  35. data/sig.json +1 -1
  36. metadata +12 -4
@@ -0,0 +1,243 @@
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 BillingRegions
16
+ attr_accessor :cost
17
+
18
+ attr_accessor :bandwidth
19
+
20
+ attr_accessor :percentile
21
+
22
+ attr_accessor :requests
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'cost' => :'cost',
28
+ :'bandwidth' => :'bandwidth',
29
+ :'percentile' => :'percentile',
30
+ :'requests' => :'requests'
31
+ }
32
+ end
33
+
34
+ # Returns all the JSON keys this model knows about
35
+ def self.acceptable_attributes
36
+ attribute_map.values
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.fastly_types
41
+ {
42
+ :'cost' => :'Float',
43
+ :'bandwidth' => :'BillingBandwidth',
44
+ :'percentile' => :'BillingBandwidth',
45
+ :'requests' => :'BillingBandwidth'
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::BillingRegions` 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::BillingRegions`. 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?(:'cost')
71
+ self.cost = attributes[:'cost']
72
+ end
73
+
74
+ if attributes.key?(:'bandwidth')
75
+ self.bandwidth = attributes[:'bandwidth']
76
+ end
77
+
78
+ if attributes.key?(:'percentile')
79
+ self.percentile = attributes[:'percentile']
80
+ end
81
+
82
+ if attributes.key?(:'requests')
83
+ self.requests = attributes[:'requests']
84
+ end
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properties with the reasons
89
+ def list_invalid_properties
90
+ invalid_properties = Array.new
91
+ invalid_properties
92
+ end
93
+
94
+ # Check to see if the all the properties in the model are valid
95
+ # @return true if the model is valid
96
+ def valid?
97
+ true
98
+ end
99
+
100
+ # Checks equality by comparing each attribute.
101
+ # @param [Object] Object to be compared
102
+ def ==(o)
103
+ return true if self.equal?(o)
104
+ self.class == o.class &&
105
+ cost == o.cost &&
106
+ bandwidth == o.bandwidth &&
107
+ percentile == o.percentile &&
108
+ requests == o.requests
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [cost, bandwidth, percentile, requests].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ new.build_from_hash(attributes)
128
+ end
129
+
130
+ # Builds the object from hash
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ # @return [Object] Returns the model itself
133
+ def build_from_hash(attributes)
134
+ return nil unless attributes.is_a?(Hash)
135
+ self.class.fastly_types.each_pair do |key, type|
136
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
137
+ self.send("#{key}=", nil)
138
+ elsif type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
142
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
143
+ end
144
+ elsif !attributes[self.class.attribute_map[key]].nil?
145
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
146
+ end
147
+ end
148
+
149
+ self
150
+ end
151
+
152
+ # Deserializes the data based on type
153
+ # @param string type Data type
154
+ # @param string value Value to be deserialized
155
+ # @return [Object] Deserialized data
156
+ def _deserialize(type, value)
157
+ case type.to_sym
158
+ when :Time
159
+ Time.parse(value)
160
+ when :Date
161
+ Date.parse(value)
162
+ when :String
163
+ value.to_s
164
+ when :Integer
165
+ value.to_i
166
+ when :Float
167
+ value.to_f
168
+ when :Boolean
169
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
170
+ true
171
+ else
172
+ false
173
+ end
174
+ when :Object
175
+ # generic object (usually a Hash), return directly
176
+ value
177
+ when /\AArray<(?<inner_type>.+)>\z/
178
+ inner_type = Regexp.last_match[:inner_type]
179
+ value.map { |v| _deserialize(inner_type, v) }
180
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
181
+ k_type = Regexp.last_match[:k_type]
182
+ v_type = Regexp.last_match[:v_type]
183
+ {}.tap do |hash|
184
+ value.each do |k, v|
185
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
186
+ end
187
+ end
188
+ else # model
189
+ # models (e.g. Pet) or oneOf
190
+ klass = Fastly.const_get(type)
191
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
192
+ end
193
+ end
194
+
195
+ # Returns the string representation of the object
196
+ # @return [String] String presentation of the object
197
+ def to_s
198
+ to_hash.to_s
199
+ end
200
+
201
+ # to_body is an alias to to_hash (backward compatibility)
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_body
204
+ to_hash
205
+ end
206
+
207
+ # Returns the object in the form of hash
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_hash
210
+ hash = {}
211
+ self.class.attribute_map.each_pair do |attr, param|
212
+ value = self.send(attr)
213
+ if value.nil?
214
+ is_nullable = self.class.fastly_nullable.include?(attr)
215
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
216
+ end
217
+
218
+ hash[param] = _to_hash(value)
219
+ end
220
+ hash
221
+ end
222
+
223
+ # Outputs non-array value in the form of hash
224
+ # For object, use to_hash. Otherwise, just return the value
225
+ # @param [Object] value Any valid value
226
+ # @return [Hash] Returns the value in the form of hash
227
+ def _to_hash(value)
228
+ if value.is_a?(Array)
229
+ value.compact.map { |v| _to_hash(v) }
230
+ elsif value.is_a?(Hash)
231
+ {}.tap do |hash|
232
+ value.each { |k, v| hash[k] = _to_hash(v) }
233
+ end
234
+ elsif value.respond_to? :to_hash
235
+ value.to_hash
236
+ else
237
+ value
238
+ end
239
+ end
240
+
241
+ end
242
+
243
+ end
@@ -19,8 +19,6 @@ module Fastly
19
19
  # Date and time in ISO 8601 format.
20
20
  attr_accessor :start_time
21
21
 
22
- attr_accessor :invoice_id
23
-
24
22
  attr_accessor :customer_id
25
23
 
26
24
  # The current state of our third-party billing vendor. One of `up` or `down`.
@@ -33,6 +31,8 @@ module Fastly
33
31
  # Breakdown of regional data for products that are region based.
34
32
  attr_accessor :regions
35
33
 
34
+ attr_accessor :invoice_id
35
+
36
36
  attr_accessor :line_items
37
37
 
38
38
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -40,12 +40,12 @@ module Fastly
40
40
  {
41
41
  :'end_time' => :'end_time',
42
42
  :'start_time' => :'start_time',
43
- :'invoice_id' => :'invoice_id',
44
43
  :'customer_id' => :'customer_id',
45
44
  :'vendor_state' => :'vendor_state',
46
45
  :'status' => :'status',
47
46
  :'total' => :'total',
48
47
  :'regions' => :'regions',
48
+ :'invoice_id' => :'invoice_id',
49
49
  :'line_items' => :'line_items'
50
50
  }
51
51
  end
@@ -60,12 +60,12 @@ module Fastly
60
60
  {
61
61
  :'end_time' => :'Time',
62
62
  :'start_time' => :'Time',
63
- :'invoice_id' => :'String',
64
63
  :'customer_id' => :'String',
65
64
  :'vendor_state' => :'String',
66
65
  :'status' => :'BillingStatus',
67
66
  :'total' => :'BillingTotal',
68
- :'regions' => :'Hash<String, Hash<String, Object>>',
67
+ :'regions' => :'Hash<String, BillingRegions>',
68
+ :'invoice_id' => :'Integer',
69
69
  :'line_items' => :'Array<BillingResponseLineItem>'
70
70
  }
71
71
  end
@@ -82,6 +82,7 @@ module Fastly
82
82
  def self.fastly_all_of
83
83
  [
84
84
  :'Billing',
85
+ :'BillingInvoiceId',
85
86
  :'BillingResponseItemItemsData'
86
87
  ]
87
88
  end
@@ -109,10 +110,6 @@ module Fastly
109
110
  self.start_time = attributes[:'start_time']
110
111
  end
111
112
 
112
- if attributes.key?(:'invoice_id')
113
- self.invoice_id = attributes[:'invoice_id']
114
- end
115
-
116
113
  if attributes.key?(:'customer_id')
117
114
  self.customer_id = attributes[:'customer_id']
118
115
  end
@@ -135,6 +132,10 @@ module Fastly
135
132
  end
136
133
  end
137
134
 
135
+ if attributes.key?(:'invoice_id')
136
+ self.invoice_id = attributes[:'invoice_id']
137
+ end
138
+
138
139
  if attributes.key?(:'line_items')
139
140
  if (value = attributes[:'line_items']).is_a?(Array)
140
141
  self.line_items = value
@@ -162,12 +163,12 @@ module Fastly
162
163
  self.class == o.class &&
163
164
  end_time == o.end_time &&
164
165
  start_time == o.start_time &&
165
- invoice_id == o.invoice_id &&
166
166
  customer_id == o.customer_id &&
167
167
  vendor_state == o.vendor_state &&
168
168
  status == o.status &&
169
169
  total == o.total &&
170
170
  regions == o.regions &&
171
+ invoice_id == o.invoice_id &&
171
172
  line_items == o.line_items
172
173
  end
173
174
 
@@ -180,7 +181,7 @@ module Fastly
180
181
  # Calculates hash code according to all attributes.
181
182
  # @return [Integer] Hash code
182
183
  def hash
183
- [end_time, start_time, invoice_id, customer_id, vendor_state, status, total, regions, line_items].hash
184
+ [end_time, start_time, customer_id, vendor_state, status, total, regions, invoice_id, line_items].hash
184
185
  end
185
186
 
186
187
  # Builds the object from hash
@@ -24,6 +24,7 @@ module Fastly
24
24
 
25
25
  attr_accessor :amount
26
26
 
27
+ # An alphanumeric string identifying the invoice.
27
28
  attr_accessor :aria_invoice_id
28
29
 
29
30
  attr_accessor :client_service_id
@@ -94,7 +95,7 @@ module Fastly
94
95
  :'deleted_at' => :'Time',
95
96
  :'updated_at' => :'Time',
96
97
  :'amount' => :'Float',
97
- :'aria_invoice_id' => :'LineItemDataReadOnlyInvoiceId',
98
+ :'aria_invoice_id' => :'String',
98
99
  :'client_service_id' => :'String',
99
100
  :'credit_coupon_code' => :'String',
100
101
  :'description' => :'String',
@@ -16,7 +16,7 @@ module Fastly
16
16
  # Customer ID associated with the invoice.
17
17
  attr_accessor :customer_id
18
18
 
19
- # Alphanumeric string identifying the invoice.
19
+ # Numeric string identifying the invoice.
20
20
  attr_accessor :invoice_id
21
21
 
22
22
  # Date and time invoice was posted on, in ISO 8601 format.
@@ -16,7 +16,7 @@ module Fastly
16
16
  # Customer ID associated with the invoice.
17
17
  attr_accessor :customer_id
18
18
 
19
- # Alphanumeric string identifying the invoice.
19
+ # Numeric string identifying the invoice.
20
20
  attr_accessor :invoice_id
21
21
 
22
22
  # Date and time invoice was posted on, in ISO 8601 format.
@@ -15,6 +15,7 @@ module Fastly
15
15
  class LineItemData
16
16
  attr_accessor :amount
17
17
 
18
+ # An alphanumeric string identifying the invoice.
18
19
  attr_accessor :aria_invoice_id
19
20
 
20
21
  attr_accessor :client_service_id
@@ -79,7 +80,7 @@ module Fastly
79
80
  def self.fastly_types
80
81
  {
81
82
  :'amount' => :'Float',
82
- :'aria_invoice_id' => :'LineItemDataReadOnlyInvoiceId',
83
+ :'aria_invoice_id' => :'String',
83
84
  :'client_service_id' => :'String',
84
85
  :'credit_coupon_code' => :'String',
85
86
  :'description' => :'String',
@@ -9,5 +9,5 @@ Contact: oss@fastly.com
9
9
  =end
10
10
 
11
11
  module Fastly
12
- VERSION = '8.6.0'
12
+ VERSION = '8.7.0'
13
13
  end
data/lib/fastly.rb CHANGED
@@ -46,9 +46,14 @@ require 'fastly/models/billing_address_response'
46
46
  require 'fastly/models/billing_address_response_data'
47
47
  require 'fastly/models/billing_address_verification_error_response'
48
48
  require 'fastly/models/billing_address_verification_error_response_errors'
49
+ require 'fastly/models/billing_bandwidth'
50
+ require 'fastly/models/billing_bandwidth_tiers'
51
+ require 'fastly/models/billing_estimate_invoice_id'
49
52
  require 'fastly/models/billing_estimate_lines'
50
53
  require 'fastly/models/billing_estimate_lines_line_items'
51
54
  require 'fastly/models/billing_estimate_response'
55
+ require 'fastly/models/billing_invoice_id'
56
+ require 'fastly/models/billing_regions'
52
57
  require 'fastly/models/billing_response'
53
58
  require 'fastly/models/billing_response_item_items_data'
54
59
  require 'fastly/models/billing_response_line_item'
@@ -214,7 +219,6 @@ require 'fastly/models/legacy_waf_ruleset'
214
219
  require 'fastly/models/legacy_waf_tag'
215
220
  require 'fastly/models/legacy_waf_update_status'
216
221
  require 'fastly/models/line_item_data'
217
- require 'fastly/models/line_item_data_read_only_invoice_id'
218
222
  require 'fastly/models/list_dashboards_response'
219
223
  require 'fastly/models/list_eom_invoices_response'
220
224
  require 'fastly/models/listinvoices'
data/sig.json CHANGED
@@ -1 +1 @@
1
- {"G": "01161630", "D": "e05af2db"}
1
+ {"G": "01161630", "D": "80b361d0"}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastly
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.6.0
4
+ version: 8.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fastly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-05 00:00:00.000000000 Z
11
+ date: 2024-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -90,10 +90,15 @@ files:
90
90
  - docs/BillingAddressVerificationErrorResponse.md
91
91
  - docs/BillingAddressVerificationErrorResponseErrors.md
92
92
  - docs/BillingApi.md
93
+ - docs/BillingBandwidth.md
94
+ - docs/BillingBandwidthTiers.md
95
+ - docs/BillingEstimateInvoiceId.md
93
96
  - docs/BillingEstimateLines.md
94
97
  - docs/BillingEstimateLinesLineItems.md
95
98
  - docs/BillingEstimateResponse.md
99
+ - docs/BillingInvoiceId.md
96
100
  - docs/BillingInvoicesApi.md
101
+ - docs/BillingRegions.md
97
102
  - docs/BillingResponse.md
98
103
  - docs/BillingResponseItemItemsData.md
99
104
  - docs/BillingResponseLineItem.md
@@ -300,7 +305,6 @@ files:
300
305
  - docs/LegacyWafUpdateStatus.md
301
306
  - docs/LegacyWafUpdateStatusApi.md
302
307
  - docs/LineItemData.md
303
- - docs/LineItemDataReadOnlyInvoiceId.md
304
308
  - docs/ListDashboardsResponse.md
305
309
  - docs/ListEomInvoicesResponse.md
306
310
  - docs/Listinvoices.md
@@ -1052,9 +1056,14 @@ files:
1052
1056
  - lib/fastly/models/billing_address_response_data.rb
1053
1057
  - lib/fastly/models/billing_address_verification_error_response.rb
1054
1058
  - lib/fastly/models/billing_address_verification_error_response_errors.rb
1059
+ - lib/fastly/models/billing_bandwidth.rb
1060
+ - lib/fastly/models/billing_bandwidth_tiers.rb
1061
+ - lib/fastly/models/billing_estimate_invoice_id.rb
1055
1062
  - lib/fastly/models/billing_estimate_lines.rb
1056
1063
  - lib/fastly/models/billing_estimate_lines_line_items.rb
1057
1064
  - lib/fastly/models/billing_estimate_response.rb
1065
+ - lib/fastly/models/billing_invoice_id.rb
1066
+ - lib/fastly/models/billing_regions.rb
1058
1067
  - lib/fastly/models/billing_response.rb
1059
1068
  - lib/fastly/models/billing_response_item_items_data.rb
1060
1069
  - lib/fastly/models/billing_response_line_item.rb
@@ -1220,7 +1229,6 @@ files:
1220
1229
  - lib/fastly/models/legacy_waf_tag.rb
1221
1230
  - lib/fastly/models/legacy_waf_update_status.rb
1222
1231
  - lib/fastly/models/line_item_data.rb
1223
- - lib/fastly/models/line_item_data_read_only_invoice_id.rb
1224
1232
  - lib/fastly/models/list_dashboards_response.rb
1225
1233
  - lib/fastly/models/list_eom_invoices_response.rb
1226
1234
  - lib/fastly/models/listinvoices.rb