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,252 @@
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 BillingBandwidthTiers
16
+ attr_accessor :name
17
+
18
+ attr_accessor :units
19
+
20
+ attr_accessor :price
21
+
22
+ attr_accessor :discounted_price
23
+
24
+ attr_accessor :total
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'name' => :'name',
30
+ :'units' => :'units',
31
+ :'price' => :'price',
32
+ :'discounted_price' => :'discounted_price',
33
+ :'total' => :'total'
34
+ }
35
+ end
36
+
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.fastly_types
44
+ {
45
+ :'name' => :'String',
46
+ :'units' => :'Float',
47
+ :'price' => :'Float',
48
+ :'discounted_price' => :'Float',
49
+ :'total' => :'Float'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.fastly_nullable
55
+ Set.new([
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::BillingBandwidthTiers` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!self.class.attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::BillingBandwidthTiers`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'name')
75
+ self.name = attributes[:'name']
76
+ end
77
+
78
+ if attributes.key?(:'units')
79
+ self.units = attributes[:'units']
80
+ end
81
+
82
+ if attributes.key?(:'price')
83
+ self.price = attributes[:'price']
84
+ end
85
+
86
+ if attributes.key?(:'discounted_price')
87
+ self.discounted_price = attributes[:'discounted_price']
88
+ end
89
+
90
+ if attributes.key?(:'total')
91
+ self.total = attributes[:'total']
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ invalid_properties = Array.new
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ true
106
+ end
107
+
108
+ # Checks equality by comparing each attribute.
109
+ # @param [Object] Object to be compared
110
+ def ==(o)
111
+ return true if self.equal?(o)
112
+ self.class == o.class &&
113
+ name == o.name &&
114
+ units == o.units &&
115
+ price == o.price &&
116
+ discounted_price == o.discounted_price &&
117
+ total == o.total
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] Object to be compared
122
+ def eql?(o)
123
+ self == o
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Integer] Hash code
128
+ def hash
129
+ [name, units, price, discounted_price, total].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def self.build_from_hash(attributes)
136
+ new.build_from_hash(attributes)
137
+ end
138
+
139
+ # Builds the object from hash
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ # @return [Object] Returns the model itself
142
+ def build_from_hash(attributes)
143
+ return nil unless attributes.is_a?(Hash)
144
+ self.class.fastly_types.each_pair do |key, type|
145
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
146
+ self.send("#{key}=", nil)
147
+ elsif type =~ /\AArray<(.*)>/i
148
+ # check to ensure the input is an array given that the attribute
149
+ # is documented as an array but the input is not
150
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
151
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
152
+ end
153
+ elsif !attributes[self.class.attribute_map[key]].nil?
154
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
155
+ end
156
+ end
157
+
158
+ self
159
+ end
160
+
161
+ # Deserializes the data based on type
162
+ # @param string type Data type
163
+ # @param string value Value to be deserialized
164
+ # @return [Object] Deserialized data
165
+ def _deserialize(type, value)
166
+ case type.to_sym
167
+ when :Time
168
+ Time.parse(value)
169
+ when :Date
170
+ Date.parse(value)
171
+ when :String
172
+ value.to_s
173
+ when :Integer
174
+ value.to_i
175
+ when :Float
176
+ value.to_f
177
+ when :Boolean
178
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
179
+ true
180
+ else
181
+ false
182
+ end
183
+ when :Object
184
+ # generic object (usually a Hash), return directly
185
+ value
186
+ when /\AArray<(?<inner_type>.+)>\z/
187
+ inner_type = Regexp.last_match[:inner_type]
188
+ value.map { |v| _deserialize(inner_type, v) }
189
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
190
+ k_type = Regexp.last_match[:k_type]
191
+ v_type = Regexp.last_match[:v_type]
192
+ {}.tap do |hash|
193
+ value.each do |k, v|
194
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
195
+ end
196
+ end
197
+ else # model
198
+ # models (e.g. Pet) or oneOf
199
+ klass = Fastly.const_get(type)
200
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
201
+ end
202
+ end
203
+
204
+ # Returns the string representation of the object
205
+ # @return [String] String presentation of the object
206
+ def to_s
207
+ to_hash.to_s
208
+ end
209
+
210
+ # to_body is an alias to to_hash (backward compatibility)
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_body
213
+ to_hash
214
+ end
215
+
216
+ # Returns the object in the form of hash
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_hash
219
+ hash = {}
220
+ self.class.attribute_map.each_pair do |attr, param|
221
+ value = self.send(attr)
222
+ if value.nil?
223
+ is_nullable = self.class.fastly_nullable.include?(attr)
224
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
225
+ end
226
+
227
+ hash[param] = _to_hash(value)
228
+ end
229
+ hash
230
+ end
231
+
232
+ # Outputs non-array value in the form of hash
233
+ # For object, use to_hash. Otherwise, just return the value
234
+ # @param [Object] value Any valid value
235
+ # @return [Hash] Returns the value in the form of hash
236
+ def _to_hash(value)
237
+ if value.is_a?(Array)
238
+ value.compact.map { |v| _to_hash(v) }
239
+ elsif value.is_a?(Hash)
240
+ {}.tap do |hash|
241
+ value.each { |k, v| hash[k] = _to_hash(v) }
242
+ end
243
+ elsif value.respond_to? :to_hash
244
+ value.to_hash
245
+ else
246
+ value
247
+ end
248
+ end
249
+
250
+ end
251
+
252
+ end
@@ -12,13 +12,13 @@ require 'date'
12
12
  require 'time'
13
13
 
14
14
  module Fastly
15
- class RelationshipTlsDnsRecord
16
- attr_accessor :dns_record
15
+ class BillingEstimateInvoiceId
16
+ attr_accessor :invoice_id
17
17
 
18
18
  # Attribute mapping from ruby-style variable name to JSON key.
19
19
  def self.attribute_map
20
20
  {
21
- :'dns_record' => :'dns_record'
21
+ :'invoice_id' => :'invoice_id'
22
22
  }
23
23
  end
24
24
 
@@ -30,7 +30,7 @@ module Fastly
30
30
  # Attribute type mapping.
31
31
  def self.fastly_types
32
32
  {
33
- :'dns_record' => :'RelationshipTlsDnsRecordDnsRecord'
33
+ :'invoice_id' => :'String'
34
34
  }
35
35
  end
36
36
 
@@ -44,19 +44,19 @@ module Fastly
44
44
  # @param [Hash] attributes Model attributes in the form of hash
45
45
  def initialize(attributes = {})
46
46
  if (!attributes.is_a?(Hash))
47
- fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::RelationshipTlsDnsRecord` initialize method"
47
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::BillingEstimateInvoiceId` initialize method"
48
48
  end
49
49
 
50
50
  # check to see if the attribute exists and convert string to symbol for hash key
51
51
  attributes = attributes.each_with_object({}) { |(k, v), h|
52
52
  if (!self.class.attribute_map.key?(k.to_sym))
53
- fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::RelationshipTlsDnsRecord`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
53
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::BillingEstimateInvoiceId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
54
54
  end
55
55
  h[k.to_sym] = v
56
56
  }
57
57
 
58
- if attributes.key?(:'dns_record')
59
- self.dns_record = attributes[:'dns_record']
58
+ if attributes.key?(:'invoice_id')
59
+ self.invoice_id = attributes[:'invoice_id']
60
60
  end
61
61
  end
62
62
 
@@ -78,7 +78,7 @@ module Fastly
78
78
  def ==(o)
79
79
  return true if self.equal?(o)
80
80
  self.class == o.class &&
81
- dns_record == o.dns_record
81
+ invoice_id == o.invoice_id
82
82
  end
83
83
 
84
84
  # @see the `==` method
@@ -90,7 +90,7 @@ module Fastly
90
90
  # Calculates hash code according to all attributes.
91
91
  # @return [Integer] Hash code
92
92
  def hash
93
- [dns_record].hash
93
+ [invoice_id].hash
94
94
  end
95
95
 
96
96
  # Builds the object from hash
@@ -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' => :'String',
69
69
  :'line_items' => :'Array<BillingEstimateLinesLineItems>'
70
70
  }
71
71
  end
@@ -82,6 +82,7 @@ module Fastly
82
82
  def self.fastly_all_of
83
83
  [
84
84
  :'Billing',
85
+ :'BillingEstimateInvoiceId',
85
86
  :'BillingEstimateLines'
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
@@ -0,0 +1,216 @@
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 BillingInvoiceId
16
+ attr_accessor :invoice_id
17
+
18
+ # Attribute mapping from ruby-style variable name to JSON key.
19
+ def self.attribute_map
20
+ {
21
+ :'invoice_id' => :'invoice_id'
22
+ }
23
+ end
24
+
25
+ # Returns all the JSON keys this model knows about
26
+ def self.acceptable_attributes
27
+ attribute_map.values
28
+ end
29
+
30
+ # Attribute type mapping.
31
+ def self.fastly_types
32
+ {
33
+ :'invoice_id' => :'Integer'
34
+ }
35
+ end
36
+
37
+ # List of attributes with nullable: true
38
+ def self.fastly_nullable
39
+ Set.new([
40
+ ])
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ if (!attributes.is_a?(Hash))
47
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::BillingInvoiceId` initialize method"
48
+ end
49
+
50
+ # check to see if the attribute exists and convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h|
52
+ if (!self.class.attribute_map.key?(k.to_sym))
53
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::BillingInvoiceId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
54
+ end
55
+ h[k.to_sym] = v
56
+ }
57
+
58
+ if attributes.key?(:'invoice_id')
59
+ self.invoice_id = attributes[:'invoice_id']
60
+ end
61
+ end
62
+
63
+ # Show invalid properties with the reasons. Usually used together with valid?
64
+ # @return Array for valid properties with the reasons
65
+ def list_invalid_properties
66
+ invalid_properties = Array.new
67
+ invalid_properties
68
+ end
69
+
70
+ # Check to see if the all the properties in the model are valid
71
+ # @return true if the model is valid
72
+ def valid?
73
+ true
74
+ end
75
+
76
+ # Checks equality by comparing each attribute.
77
+ # @param [Object] Object to be compared
78
+ def ==(o)
79
+ return true if self.equal?(o)
80
+ self.class == o.class &&
81
+ invoice_id == o.invoice_id
82
+ end
83
+
84
+ # @see the `==` method
85
+ # @param [Object] Object to be compared
86
+ def eql?(o)
87
+ self == o
88
+ end
89
+
90
+ # Calculates hash code according to all attributes.
91
+ # @return [Integer] Hash code
92
+ def hash
93
+ [invoice_id].hash
94
+ end
95
+
96
+ # Builds the object from hash
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ # @return [Object] Returns the model itself
99
+ def self.build_from_hash(attributes)
100
+ new.build_from_hash(attributes)
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ def build_from_hash(attributes)
107
+ return nil unless attributes.is_a?(Hash)
108
+ self.class.fastly_types.each_pair do |key, type|
109
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
110
+ self.send("#{key}=", nil)
111
+ elsif type =~ /\AArray<(.*)>/i
112
+ # check to ensure the input is an array given that the attribute
113
+ # is documented as an array but the input is not
114
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
115
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
116
+ end
117
+ elsif !attributes[self.class.attribute_map[key]].nil?
118
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
119
+ end
120
+ end
121
+
122
+ self
123
+ end
124
+
125
+ # Deserializes the data based on type
126
+ # @param string type Data type
127
+ # @param string value Value to be deserialized
128
+ # @return [Object] Deserialized data
129
+ def _deserialize(type, value)
130
+ case type.to_sym
131
+ when :Time
132
+ Time.parse(value)
133
+ when :Date
134
+ Date.parse(value)
135
+ when :String
136
+ value.to_s
137
+ when :Integer
138
+ value.to_i
139
+ when :Float
140
+ value.to_f
141
+ when :Boolean
142
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
143
+ true
144
+ else
145
+ false
146
+ end
147
+ when :Object
148
+ # generic object (usually a Hash), return directly
149
+ value
150
+ when /\AArray<(?<inner_type>.+)>\z/
151
+ inner_type = Regexp.last_match[:inner_type]
152
+ value.map { |v| _deserialize(inner_type, v) }
153
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
154
+ k_type = Regexp.last_match[:k_type]
155
+ v_type = Regexp.last_match[:v_type]
156
+ {}.tap do |hash|
157
+ value.each do |k, v|
158
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
159
+ end
160
+ end
161
+ else # model
162
+ # models (e.g. Pet) or oneOf
163
+ klass = Fastly.const_get(type)
164
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
165
+ end
166
+ end
167
+
168
+ # Returns the string representation of the object
169
+ # @return [String] String presentation of the object
170
+ def to_s
171
+ to_hash.to_s
172
+ end
173
+
174
+ # to_body is an alias to to_hash (backward compatibility)
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_body
177
+ to_hash
178
+ end
179
+
180
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ if value.nil?
187
+ is_nullable = self.class.fastly_nullable.include?(attr)
188
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
189
+ end
190
+
191
+ hash[param] = _to_hash(value)
192
+ end
193
+ hash
194
+ end
195
+
196
+ # Outputs non-array value in the form of hash
197
+ # For object, use to_hash. Otherwise, just return the value
198
+ # @param [Object] value Any valid value
199
+ # @return [Hash] Returns the value in the form of hash
200
+ def _to_hash(value)
201
+ if value.is_a?(Array)
202
+ value.compact.map { |v| _to_hash(v) }
203
+ elsif value.is_a?(Hash)
204
+ {}.tap do |hash|
205
+ value.each { |k, v| hash[k] = _to_hash(v) }
206
+ end
207
+ elsif value.respond_to? :to_hash
208
+ value.to_hash
209
+ else
210
+ value
211
+ end
212
+ end
213
+
214
+ end
215
+
216
+ end