pnap_invoicing_api 1.0.4 → 1.0.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a5e8752786c8c6b9812c1a55513618d1bee9536f9d37221246ac2a653dd90461
4
- data.tar.gz: fd6573deb9243970b023b461c58cdc2d9abbe3a46f3ae716cb5fdfae46e6f662
3
+ metadata.gz: 48cdb383e6a6c9aeac42e5cdd8fd7c6dc84c457ff7d9f5727f52c1ee45e5d21e
4
+ data.tar.gz: 4c425d70e937a4f35243b8492611adf92474cbd13f235de0b7a048e6268f7a1a
5
5
  SHA512:
6
- metadata.gz: 1131257a4435d97f1c533b533ab2165fa74a12be4b1de48e343b0978c3abedb36209a407ff4875095ce228f5fea2bd566c3e7d9a7a212a47fa4f0cff9c40974d
7
- data.tar.gz: f87d555a9d343272ec0cccc732d098ce14643479cfb62a3b5fc0e83d5d0cf366be36fea440a9605236b10258a7a96a9b06b3322276f34a64ff04a09e0ddbb2bc
6
+ metadata.gz: ae60372f9b7e998c9fa18e92a0843b6fe1fa799914ae12ebc2a7753675254a22bf12159d9a86db1ac656305fd2cfb1e1d51a163a8229f699a705241df6b3bfb7
7
+ data.tar.gz: 5d3f33a02cf726d7502ef8ae897b750015856fe0b0010efa31374107b3b02cb6860050f62d23cd85220aba3f6bfff6e5c51f9ff05945fd9948dfbe2f90a39664
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.4
1
+ 1.0.5
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -93,7 +93,7 @@ module InvoicingApi
93
93
  # header parameters
94
94
  header_params = opts[:header_params] || {}
95
95
  # HTTP header 'Accept' (if needed)
96
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
96
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
97
97
 
98
98
  # form parameters
99
99
  form_params = opts[:form_params] || {}
@@ -156,7 +156,7 @@ module InvoicingApi
156
156
  # header parameters
157
157
  header_params = opts[:header_params] || {}
158
158
  # HTTP header 'Accept' (if needed)
159
- header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/json'])
159
+ header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/json']) unless header_params['Accept']
160
160
 
161
161
  # form parameters
162
162
  form_params = opts[:form_params] || {}
@@ -219,7 +219,7 @@ module InvoicingApi
219
219
  # header parameters
220
220
  header_params = opts[:header_params] || {}
221
221
  # HTTP header 'Accept' (if needed)
222
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
222
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
223
223
 
224
224
  # form parameters
225
225
  form_params = opts[:form_params] || {}
@@ -284,7 +284,7 @@ module InvoicingApi
284
284
  # header parameters
285
285
  header_params = opts[:header_params] || {}
286
286
  # HTTP header 'Accept' (if needed)
287
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
287
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
288
288
  # HTTP header 'Content-Type'
289
289
  content_type = @api_client.select_header_content_type(['application/json'])
290
290
  if !content_type.nil?
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -52,7 +52,8 @@ module InvoicingApi
52
52
  # the data deserialized from response body (may be a Tempfile or nil), response status code and response headers.
53
53
  def call_api(http_method, path, opts = {})
54
54
  request = build_request(http_method, path, opts)
55
- tempfile = download_file(request) if opts[:return_type] == 'File'
55
+ tempfile = nil
56
+ (download_file(request) { tempfile = _1 }) if opts[:return_type] == 'File'
56
57
  response = request.run
57
58
 
58
59
  if @config.debugging
@@ -191,19 +192,17 @@ module InvoicingApi
191
192
  chunk.force_encoding(encoding)
192
193
  tempfile.write(chunk)
193
194
  end
194
- # run the request to ensure the tempfile is created successfully before returning it
195
- request.run
196
- if tempfile
195
+ request.on_complete do
196
+ if !tempfile
197
+ fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
198
+ end
197
199
  tempfile.close
198
200
  @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
199
201
  "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
200
202
  "will be deleted automatically with GC. It's also recommended to delete the temp file "\
201
203
  "explicitly with `tempfile.delete`"
202
- else
203
- fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
204
+ yield tempfile if block_given?
204
205
  end
205
-
206
- tempfile
207
206
  end
208
207
 
209
208
  # Check if the given MIME is a JSON MIME.
@@ -215,7 +214,7 @@ module InvoicingApi
215
214
  # @param [String] mime MIME
216
215
  # @return [Boolean] True if the MIME is application/json
217
216
  def json_mime?(mime)
218
- (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
217
+ (mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil?
219
218
  end
220
219
 
221
220
  # Deserialize the response to the given return type.
@@ -282,9 +281,13 @@ module InvoicingApi
282
281
  data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
283
282
  end
284
283
  else
285
- # models (e.g. Pet) or oneOf
284
+ # models (e.g. Pet) or oneOf/anyOf
286
285
  klass = InvoicingApi.const_get(return_type)
287
- klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data)
286
+ if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of)
287
+ klass.build(data)
288
+ else
289
+ klass.build_from_hash(data)
290
+ end
288
291
  end
289
292
  end
290
293
 
@@ -294,7 +297,7 @@ module InvoicingApi
294
297
  # @param [String] filename the filename to be sanitized
295
298
  # @return [String] the sanitized filename
296
299
  def sanitize_filename(filename)
297
- filename.gsub(/.*[\/\\]/, '')
300
+ filename.split(/[\/\\]/).last
298
301
  end
299
302
 
300
303
  def build_request_url(path, opts = {})
@@ -394,4 +397,4 @@ module InvoicingApi
394
397
  end
395
398
  end
396
399
  end
397
- end
400
+ end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -0,0 +1,88 @@
1
+ =begin
2
+ #Invoicing API
3
+
4
+ #List, fetch and pay invoices with the Invoicing API.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@phoenixnap.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.20.0
10
+
11
+ =end
12
+
13
+ module InvoicingApi
14
+ class ApiModelBase
15
+ # Deserializes the data based on type
16
+ # @param string type Data type
17
+ # @param string value Value to be deserialized
18
+ # @return [Object] Deserialized data
19
+ def self._deserialize(type, value)
20
+ case type.to_sym
21
+ when :Time
22
+ Time.parse(value)
23
+ when :Date
24
+ Date.parse(value)
25
+ when :String
26
+ value.to_s
27
+ when :Integer
28
+ value.to_i
29
+ when :Float
30
+ value.to_f
31
+ when :Boolean
32
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
33
+ true
34
+ else
35
+ false
36
+ end
37
+ when :Object
38
+ # generic object (usually a Hash), return directly
39
+ value
40
+ when /\AArray<(?<inner_type>.+)>\z/
41
+ inner_type = Regexp.last_match[:inner_type]
42
+ value.map { |v| _deserialize(inner_type, v) }
43
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
44
+ k_type = Regexp.last_match[:k_type]
45
+ v_type = Regexp.last_match[:v_type]
46
+ {}.tap do |hash|
47
+ value.each do |k, v|
48
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
49
+ end
50
+ end
51
+ else # model
52
+ # models (e.g. Pet) or oneOf
53
+ klass = InvoicingApi.const_get(type)
54
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
55
+ end
56
+ end
57
+
58
+ # Returns the string representation of the object
59
+ # @return [String] String presentation of the object
60
+ def to_s
61
+ to_hash.to_s
62
+ end
63
+
64
+ # to_body is an alias to to_hash (backward compatibility)
65
+ # @return [Hash] Returns the object in the form of hash
66
+ def to_body
67
+ to_hash
68
+ end
69
+
70
+ # Outputs non-array value in the form of hash
71
+ # For object, use to_hash. Otherwise, just return the value
72
+ # @param [Object] value Any valid value
73
+ # @return [Hash] Returns the value in the form of hash
74
+ def _to_hash(value)
75
+ if value.is_a?(Array)
76
+ value.compact.map { |v| _to_hash(v) }
77
+ elsif value.is_a?(Hash)
78
+ {}.tap do |hash|
79
+ value.each { |k, v| hash[k] = _to_hash(v) }
80
+ end
81
+ elsif value.respond_to? :to_hash
82
+ value.to_hash
83
+ else
84
+ value
85
+ end
86
+ end
87
+ end
88
+ end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -79,6 +79,14 @@ module InvoicingApi
79
79
  # @return [true, false]
80
80
  attr_accessor :debugging
81
81
 
82
+ # Set this to ignore operation servers for the API client. This is useful when you need to
83
+ # send requests to a different server than the one specified in the OpenAPI document.
84
+ # Will default to the base url defined in the spec but can be overridden by setting
85
+ # `scheme`, `host`, `base_path` directly.
86
+ # Default to false.
87
+ # @return [true, false]
88
+ attr_accessor :ignore_operation_servers
89
+
82
90
  # Defines the logger used for debugging.
83
91
  # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
84
92
  #
@@ -166,6 +174,7 @@ module InvoicingApi
166
174
  @timeout = 0
167
175
  @params_encoding = nil
168
176
  @debugging = false
177
+ @ignore_operation_servers = false
169
178
  @inject_format = false
170
179
  @force_ending_format = false
171
180
  @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
@@ -200,6 +209,7 @@ module InvoicingApi
200
209
 
201
210
  # Returns base URL for specified operation based on server settings
202
211
  def base_url(operation = nil)
212
+ return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
203
213
  if operation_server_settings.key?(operation) then
204
214
  index = server_operation_index.fetch(operation, server_index)
205
215
  server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module InvoicingApi
17
- class Error
17
+ class Error < ApiModelBase
18
18
  # The description detailing the cause of the error code.
19
19
  attr_accessor :message
20
20
 
@@ -29,9 +29,14 @@ module InvoicingApi
29
29
  }
30
30
  end
31
31
 
32
+ # Returns attribute mapping this model knows about
33
+ def self.acceptable_attribute_map
34
+ attribute_map
35
+ end
36
+
32
37
  # Returns all the JSON keys this model knows about
33
38
  def self.acceptable_attributes
34
- attribute_map.values
39
+ acceptable_attribute_map.values
35
40
  end
36
41
 
37
42
  # Attribute type mapping.
@@ -56,9 +61,10 @@ module InvoicingApi
56
61
  end
57
62
 
58
63
  # check to see if the attribute exists and convert string to symbol for hash key
64
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
65
  attributes = attributes.each_with_object({}) { |(k, v), h|
60
- if (!self.class.attribute_map.key?(k.to_sym))
61
- fail ArgumentError, "`#{k}` is not a valid attribute in `InvoicingApi::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ if (!acceptable_attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `InvoicingApi::Error`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
68
  end
63
69
  h[k.to_sym] = v
64
70
  }
@@ -96,6 +102,16 @@ module InvoicingApi
96
102
  true
97
103
  end
98
104
 
105
+ # Custom attribute writer method with validation
106
+ # @param [Object] message Value to be assigned
107
+ def message=(message)
108
+ if message.nil?
109
+ fail ArgumentError, 'message cannot be nil'
110
+ end
111
+
112
+ @message = message
113
+ end
114
+
99
115
  # Checks equality by comparing each attribute.
100
116
  # @param [Object] Object to be compared
101
117
  def ==(o)
@@ -140,61 +156,6 @@ module InvoicingApi
140
156
  new(transformed_hash)
141
157
  end
142
158
 
143
- # Deserializes the data based on type
144
- # @param string type Data type
145
- # @param string value Value to be deserialized
146
- # @return [Object] Deserialized data
147
- def self._deserialize(type, value)
148
- case type.to_sym
149
- when :Time
150
- Time.parse(value)
151
- when :Date
152
- Date.parse(value)
153
- when :String
154
- value.to_s
155
- when :Integer
156
- value.to_i
157
- when :Float
158
- value.to_f
159
- when :Boolean
160
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
161
- true
162
- else
163
- false
164
- end
165
- when :Object
166
- # generic object (usually a Hash), return directly
167
- value
168
- when /\AArray<(?<inner_type>.+)>\z/
169
- inner_type = Regexp.last_match[:inner_type]
170
- value.map { |v| _deserialize(inner_type, v) }
171
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
172
- k_type = Regexp.last_match[:k_type]
173
- v_type = Regexp.last_match[:v_type]
174
- {}.tap do |hash|
175
- value.each do |k, v|
176
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
177
- end
178
- end
179
- else # model
180
- # models (e.g. Pet) or oneOf
181
- klass = InvoicingApi.const_get(type)
182
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
183
- end
184
- end
185
-
186
- # Returns the string representation of the object
187
- # @return [String] String presentation of the object
188
- def to_s
189
- to_hash.to_s
190
- end
191
-
192
- # to_body is an alias to to_hash (backward compatibility)
193
- # @return [Hash] Returns the object in the form of hash
194
- def to_body
195
- to_hash
196
- end
197
-
198
159
  # Returns the object in the form of hash
199
160
  # @return [Hash] Returns the object in the form of hash
200
161
  def to_hash
@@ -211,24 +172,6 @@ module InvoicingApi
211
172
  hash
212
173
  end
213
174
 
214
- # Outputs non-array value in the form of hash
215
- # For object, use to_hash. Otherwise, just return the value
216
- # @param [Object] value Any valid value
217
- # @return [Hash] Returns the value in the form of hash
218
- def _to_hash(value)
219
- if value.is_a?(Array)
220
- value.compact.map { |v| _to_hash(v) }
221
- elsif value.is_a?(Hash)
222
- {}.tap do |hash|
223
- value.each { |k, v| hash[k] = _to_hash(v) }
224
- end
225
- elsif value.respond_to? :to_hash
226
- value.to_hash
227
- else
228
- value
229
- end
230
- end
231
-
232
175
  end
233
176
 
234
177
  end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module InvoicingApi
17
- class Invoice
17
+ class Invoice < ApiModelBase
18
18
  # The unique resource identifier of the Invoice.
19
19
  attr_accessor :id
20
20
 
@@ -53,9 +53,14 @@ module InvoicingApi
53
53
  }
54
54
  end
55
55
 
56
+ # Returns attribute mapping this model knows about
57
+ def self.acceptable_attribute_map
58
+ attribute_map
59
+ end
60
+
56
61
  # Returns all the JSON keys this model knows about
57
62
  def self.acceptable_attributes
58
- attribute_map.values
63
+ acceptable_attribute_map.values
59
64
  end
60
65
 
61
66
  # Attribute type mapping.
@@ -86,9 +91,10 @@ module InvoicingApi
86
91
  end
87
92
 
88
93
  # check to see if the attribute exists and convert string to symbol for hash key
94
+ acceptable_attribute_map = self.class.acceptable_attribute_map
89
95
  attributes = attributes.each_with_object({}) { |(k, v), h|
90
- if (!self.class.attribute_map.key?(k.to_sym))
91
- fail ArgumentError, "`#{k}` is not a valid attribute in `InvoicingApi::Invoice`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
96
+ if (!acceptable_attribute_map.key?(k.to_sym))
97
+ fail ArgumentError, "`#{k}` is not a valid attribute in `InvoicingApi::Invoice`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
92
98
  end
93
99
  h[k.to_sym] = v
94
100
  }
@@ -197,6 +203,86 @@ module InvoicingApi
197
203
  true
198
204
  end
199
205
 
206
+ # Custom attribute writer method with validation
207
+ # @param [Object] id Value to be assigned
208
+ def id=(id)
209
+ if id.nil?
210
+ fail ArgumentError, 'id cannot be nil'
211
+ end
212
+
213
+ @id = id
214
+ end
215
+
216
+ # Custom attribute writer method with validation
217
+ # @param [Object] number Value to be assigned
218
+ def number=(number)
219
+ if number.nil?
220
+ fail ArgumentError, 'number cannot be nil'
221
+ end
222
+
223
+ @number = number
224
+ end
225
+
226
+ # Custom attribute writer method with validation
227
+ # @param [Object] currency Value to be assigned
228
+ def currency=(currency)
229
+ if currency.nil?
230
+ fail ArgumentError, 'currency cannot be nil'
231
+ end
232
+
233
+ @currency = currency
234
+ end
235
+
236
+ # Custom attribute writer method with validation
237
+ # @param [Object] amount Value to be assigned
238
+ def amount=(amount)
239
+ if amount.nil?
240
+ fail ArgumentError, 'amount cannot be nil'
241
+ end
242
+
243
+ @amount = amount
244
+ end
245
+
246
+ # Custom attribute writer method with validation
247
+ # @param [Object] outstanding_amount Value to be assigned
248
+ def outstanding_amount=(outstanding_amount)
249
+ if outstanding_amount.nil?
250
+ fail ArgumentError, 'outstanding_amount cannot be nil'
251
+ end
252
+
253
+ @outstanding_amount = outstanding_amount
254
+ end
255
+
256
+ # Custom attribute writer method with validation
257
+ # @param [Object] status Value to be assigned
258
+ def status=(status)
259
+ if status.nil?
260
+ fail ArgumentError, 'status cannot be nil'
261
+ end
262
+
263
+ @status = status
264
+ end
265
+
266
+ # Custom attribute writer method with validation
267
+ # @param [Object] sent_on Value to be assigned
268
+ def sent_on=(sent_on)
269
+ if sent_on.nil?
270
+ fail ArgumentError, 'sent_on cannot be nil'
271
+ end
272
+
273
+ @sent_on = sent_on
274
+ end
275
+
276
+ # Custom attribute writer method with validation
277
+ # @param [Object] due_date Value to be assigned
278
+ def due_date=(due_date)
279
+ if due_date.nil?
280
+ fail ArgumentError, 'due_date cannot be nil'
281
+ end
282
+
283
+ @due_date = due_date
284
+ end
285
+
200
286
  # Checks equality by comparing each attribute.
201
287
  # @param [Object] Object to be compared
202
288
  def ==(o)
@@ -247,61 +333,6 @@ module InvoicingApi
247
333
  new(transformed_hash)
248
334
  end
249
335
 
250
- # Deserializes the data based on type
251
- # @param string type Data type
252
- # @param string value Value to be deserialized
253
- # @return [Object] Deserialized data
254
- def self._deserialize(type, value)
255
- case type.to_sym
256
- when :Time
257
- Time.parse(value)
258
- when :Date
259
- Date.parse(value)
260
- when :String
261
- value.to_s
262
- when :Integer
263
- value.to_i
264
- when :Float
265
- value.to_f
266
- when :Boolean
267
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
268
- true
269
- else
270
- false
271
- end
272
- when :Object
273
- # generic object (usually a Hash), return directly
274
- value
275
- when /\AArray<(?<inner_type>.+)>\z/
276
- inner_type = Regexp.last_match[:inner_type]
277
- value.map { |v| _deserialize(inner_type, v) }
278
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
279
- k_type = Regexp.last_match[:k_type]
280
- v_type = Regexp.last_match[:v_type]
281
- {}.tap do |hash|
282
- value.each do |k, v|
283
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
284
- end
285
- end
286
- else # model
287
- # models (e.g. Pet) or oneOf
288
- klass = InvoicingApi.const_get(type)
289
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
290
- end
291
- end
292
-
293
- # Returns the string representation of the object
294
- # @return [String] String presentation of the object
295
- def to_s
296
- to_hash.to_s
297
- end
298
-
299
- # to_body is an alias to to_hash (backward compatibility)
300
- # @return [Hash] Returns the object in the form of hash
301
- def to_body
302
- to_hash
303
- end
304
-
305
336
  # Returns the object in the form of hash
306
337
  # @return [Hash] Returns the object in the form of hash
307
338
  def to_hash
@@ -318,24 +349,6 @@ module InvoicingApi
318
349
  hash
319
350
  end
320
351
 
321
- # Outputs non-array value in the form of hash
322
- # For object, use to_hash. Otherwise, just return the value
323
- # @param [Object] value Any valid value
324
- # @return [Hash] Returns the value in the form of hash
325
- def _to_hash(value)
326
- if value.is_a?(Array)
327
- value.compact.map { |v| _to_hash(v) }
328
- elsif value.is_a?(Hash)
329
- {}.tap do |hash|
330
- value.each { |k, v| hash[k] = _to_hash(v) }
331
- end
332
- elsif value.respond_to? :to_hash
333
- value.to_hash
334
- else
335
- value
336
- end
337
- end
338
-
339
352
  end
340
353
 
341
354
  end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module InvoicingApi
17
- class PaginatedInvoices
17
+ class PaginatedInvoices < ApiModelBase
18
18
  # Maximum number of items in the page (actual returned length can be less).
19
19
  attr_accessor :limit
20
20
 
@@ -36,9 +36,14 @@ module InvoicingApi
36
36
  }
37
37
  end
38
38
 
39
+ # Returns attribute mapping this model knows about
40
+ def self.acceptable_attribute_map
41
+ attribute_map
42
+ end
43
+
39
44
  # Returns all the JSON keys this model knows about
40
45
  def self.acceptable_attributes
41
- attribute_map.values
46
+ acceptable_attribute_map.values
42
47
  end
43
48
 
44
49
  # Attribute type mapping.
@@ -72,9 +77,10 @@ module InvoicingApi
72
77
  end
73
78
 
74
79
  # check to see if the attribute exists and convert string to symbol for hash key
80
+ acceptable_attribute_map = self.class.acceptable_attribute_map
75
81
  attributes = attributes.each_with_object({}) { |(k, v), h|
76
- if (!self.class.attribute_map.key?(k.to_sym))
77
- fail ArgumentError, "`#{k}` is not a valid attribute in `InvoicingApi::PaginatedInvoices`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ if (!acceptable_attribute_map.key?(k.to_sym))
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `InvoicingApi::PaginatedInvoices`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
78
84
  end
79
85
  h[k.to_sym] = v
80
86
  }
@@ -141,6 +147,46 @@ module InvoicingApi
141
147
  true
142
148
  end
143
149
 
150
+ # Custom attribute writer method with validation
151
+ # @param [Object] limit Value to be assigned
152
+ def limit=(limit)
153
+ if limit.nil?
154
+ fail ArgumentError, 'limit cannot be nil'
155
+ end
156
+
157
+ @limit = limit
158
+ end
159
+
160
+ # Custom attribute writer method with validation
161
+ # @param [Object] offset Value to be assigned
162
+ def offset=(offset)
163
+ if offset.nil?
164
+ fail ArgumentError, 'offset cannot be nil'
165
+ end
166
+
167
+ @offset = offset
168
+ end
169
+
170
+ # Custom attribute writer method with validation
171
+ # @param [Object] total Value to be assigned
172
+ def total=(total)
173
+ if total.nil?
174
+ fail ArgumentError, 'total cannot be nil'
175
+ end
176
+
177
+ @total = total
178
+ end
179
+
180
+ # Custom attribute writer method with validation
181
+ # @param [Object] results Value to be assigned
182
+ def results=(results)
183
+ if results.nil?
184
+ fail ArgumentError, 'results cannot be nil'
185
+ end
186
+
187
+ @results = results
188
+ end
189
+
144
190
  # Checks equality by comparing each attribute.
145
191
  # @param [Object] Object to be compared
146
192
  def ==(o)
@@ -187,61 +233,6 @@ module InvoicingApi
187
233
  new(transformed_hash)
188
234
  end
189
235
 
190
- # Deserializes the data based on type
191
- # @param string type Data type
192
- # @param string value Value to be deserialized
193
- # @return [Object] Deserialized data
194
- def self._deserialize(type, value)
195
- case type.to_sym
196
- when :Time
197
- Time.parse(value)
198
- when :Date
199
- Date.parse(value)
200
- when :String
201
- value.to_s
202
- when :Integer
203
- value.to_i
204
- when :Float
205
- value.to_f
206
- when :Boolean
207
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
208
- true
209
- else
210
- false
211
- end
212
- when :Object
213
- # generic object (usually a Hash), return directly
214
- value
215
- when /\AArray<(?<inner_type>.+)>\z/
216
- inner_type = Regexp.last_match[:inner_type]
217
- value.map { |v| _deserialize(inner_type, v) }
218
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
219
- k_type = Regexp.last_match[:k_type]
220
- v_type = Regexp.last_match[:v_type]
221
- {}.tap do |hash|
222
- value.each do |k, v|
223
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
224
- end
225
- end
226
- else # model
227
- # models (e.g. Pet) or oneOf
228
- klass = InvoicingApi.const_get(type)
229
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
230
- end
231
- end
232
-
233
- # Returns the string representation of the object
234
- # @return [String] String presentation of the object
235
- def to_s
236
- to_hash.to_s
237
- end
238
-
239
- # to_body is an alias to to_hash (backward compatibility)
240
- # @return [Hash] Returns the object in the form of hash
241
- def to_body
242
- to_hash
243
- end
244
-
245
236
  # Returns the object in the form of hash
246
237
  # @return [Hash] Returns the object in the form of hash
247
238
  def to_hash
@@ -258,24 +249,6 @@ module InvoicingApi
258
249
  hash
259
250
  end
260
251
 
261
- # Outputs non-array value in the form of hash
262
- # For object, use to_hash. Otherwise, just return the value
263
- # @param [Object] value Any valid value
264
- # @return [Hash] Returns the value in the form of hash
265
- def _to_hash(value)
266
- if value.is_a?(Array)
267
- value.compact.map { |v| _to_hash(v) }
268
- elsif value.is_a?(Hash)
269
- {}.tap do |hash|
270
- value.each { |k, v| hash[k] = _to_hash(v) }
271
- end
272
- elsif value.respond_to? :to_hash
273
- value.to_hash
274
- else
275
- value
276
- end
277
- end
278
-
279
252
  end
280
253
 
281
254
  end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module InvoicingApi
17
- class PaginatedResponse
17
+ class PaginatedResponse < ApiModelBase
18
18
  # Maximum number of items in the page (actual returned length can be less).
19
19
  attr_accessor :limit
20
20
 
@@ -33,9 +33,14 @@ module InvoicingApi
33
33
  }
34
34
  end
35
35
 
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
36
41
  # Returns all the JSON keys this model knows about
37
42
  def self.acceptable_attributes
38
- attribute_map.values
43
+ acceptable_attribute_map.values
39
44
  end
40
45
 
41
46
  # Attribute type mapping.
@@ -61,9 +66,10 @@ module InvoicingApi
61
66
  end
62
67
 
63
68
  # check to see if the attribute exists and convert string to symbol for hash key
69
+ acceptable_attribute_map = self.class.acceptable_attribute_map
64
70
  attributes = attributes.each_with_object({}) { |(k, v), h|
65
- if (!self.class.attribute_map.key?(k.to_sym))
66
- fail ArgumentError, "`#{k}` is not a valid attribute in `InvoicingApi::PaginatedResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
71
+ if (!acceptable_attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `InvoicingApi::PaginatedResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
73
  end
68
74
  h[k.to_sym] = v
69
75
  }
@@ -117,6 +123,36 @@ module InvoicingApi
117
123
  true
118
124
  end
119
125
 
126
+ # Custom attribute writer method with validation
127
+ # @param [Object] limit Value to be assigned
128
+ def limit=(limit)
129
+ if limit.nil?
130
+ fail ArgumentError, 'limit cannot be nil'
131
+ end
132
+
133
+ @limit = limit
134
+ end
135
+
136
+ # Custom attribute writer method with validation
137
+ # @param [Object] offset Value to be assigned
138
+ def offset=(offset)
139
+ if offset.nil?
140
+ fail ArgumentError, 'offset cannot be nil'
141
+ end
142
+
143
+ @offset = offset
144
+ end
145
+
146
+ # Custom attribute writer method with validation
147
+ # @param [Object] total Value to be assigned
148
+ def total=(total)
149
+ if total.nil?
150
+ fail ArgumentError, 'total cannot be nil'
151
+ end
152
+
153
+ @total = total
154
+ end
155
+
120
156
  # Checks equality by comparing each attribute.
121
157
  # @param [Object] Object to be compared
122
158
  def ==(o)
@@ -162,61 +198,6 @@ module InvoicingApi
162
198
  new(transformed_hash)
163
199
  end
164
200
 
165
- # Deserializes the data based on type
166
- # @param string type Data type
167
- # @param string value Value to be deserialized
168
- # @return [Object] Deserialized data
169
- def self._deserialize(type, value)
170
- case type.to_sym
171
- when :Time
172
- Time.parse(value)
173
- when :Date
174
- Date.parse(value)
175
- when :String
176
- value.to_s
177
- when :Integer
178
- value.to_i
179
- when :Float
180
- value.to_f
181
- when :Boolean
182
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
183
- true
184
- else
185
- false
186
- end
187
- when :Object
188
- # generic object (usually a Hash), return directly
189
- value
190
- when /\AArray<(?<inner_type>.+)>\z/
191
- inner_type = Regexp.last_match[:inner_type]
192
- value.map { |v| _deserialize(inner_type, v) }
193
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
194
- k_type = Regexp.last_match[:k_type]
195
- v_type = Regexp.last_match[:v_type]
196
- {}.tap do |hash|
197
- value.each do |k, v|
198
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
199
- end
200
- end
201
- else # model
202
- # models (e.g. Pet) or oneOf
203
- klass = InvoicingApi.const_get(type)
204
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
205
- end
206
- end
207
-
208
- # Returns the string representation of the object
209
- # @return [String] String presentation of the object
210
- def to_s
211
- to_hash.to_s
212
- end
213
-
214
- # to_body is an alias to to_hash (backward compatibility)
215
- # @return [Hash] Returns the object in the form of hash
216
- def to_body
217
- to_hash
218
- end
219
-
220
201
  # Returns the object in the form of hash
221
202
  # @return [Hash] Returns the object in the form of hash
222
203
  def to_hash
@@ -233,24 +214,6 @@ module InvoicingApi
233
214
  hash
234
215
  end
235
216
 
236
- # Outputs non-array value in the form of hash
237
- # For object, use to_hash. Otherwise, just return the value
238
- # @param [Object] value Any valid value
239
- # @return [Hash] Returns the value in the form of hash
240
- def _to_hash(value)
241
- if value.is_a?(Array)
242
- value.compact.map { |v| _to_hash(v) }
243
- elsif value.is_a?(Hash)
244
- {}.tap do |hash|
245
- value.each { |k, v| hash[k] = _to_hash(v) }
246
- end
247
- elsif value.respond_to? :to_hash
248
- value.to_hash
249
- else
250
- value
251
- end
252
- end
253
-
254
217
  end
255
218
 
256
219
  end
@@ -6,8 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
10
-
9
+ Generator version: 7.20.0
11
10
  =end
12
11
 
13
12
  def get_version()
@@ -6,13 +6,14 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
13
13
  # Common files
14
14
  require 'pnap_invoicing_api/api_client'
15
15
  require 'pnap_invoicing_api/api_error'
16
+ require 'pnap_invoicing_api/api_model_base'
16
17
  require 'pnap_invoicing_api/version'
17
18
  require 'pnap_invoicing_api/configuration'
18
19
 
@@ -8,7 +8,7 @@
8
8
  The version of the OpenAPI document: 1.0
9
9
  Contact: support@phoenixnap.com
10
10
  Generated by: https://openapi-generator.tech
11
- OpenAPI Generator version: 7.2.0
11
+ Generator version: 7.20.0
12
12
 
13
13
  =end
14
14
 
@@ -19,14 +19,14 @@ Gem::Specification.new do |s|
19
19
  s.name = "pnap_invoicing_api"
20
20
  s.version = InvoicingApi::VERSION
21
21
  s.platform = Gem::Platform::RUBY
22
- s.authors = ["PhoenixNAP"]
22
+ s.authors = ["OpenAPI-Generator"]
23
23
  s.email = ["support@phoenixnap.com"]
24
- s.homepage = "https://phoenixnap.com/bare-metal-cloud"
24
+ s.homepage = "https://openapi-generator.tech"
25
25
  s.summary = "Invoicing API Ruby Gem"
26
- s.description = "Invoicing API Ruby Gem"
26
+ s.description = "List, fetch and pay invoices with the Invoicing API. "
27
27
  s.license = "MPL-2.0"
28
28
  s.required_ruby_version = ">= 2.7"
29
- s.metadata = { "source_code_uri" => "https://github.com/phoenixnap/ruby-sdk-bmc" }
29
+ s.metadata = {}
30
30
 
31
31
  s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
32
32
 
@@ -36,4 +36,4 @@ Gem::Specification.new do |s|
36
36
  s.test_files = `find spec/*`.split("\n")
37
37
  s.executables = []
38
38
  s.require_paths = ["lib"]
39
- end
39
+ end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -18,7 +18,7 @@ require 'date'
18
18
  # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
19
  # Please update as you see appropriate
20
20
  describe InvoicingApi::Error do
21
- let(:instance) { InvoicingApi::Error.new }
21
+ #let(:instance) { InvoicingApi::Error.new }
22
22
 
23
23
  describe 'test an instance of Error' do
24
24
  it 'should create an instance of Error' do
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -18,7 +18,7 @@ require 'date'
18
18
  # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
19
  # Please update as you see appropriate
20
20
  describe InvoicingApi::Invoice do
21
- let(:instance) { InvoicingApi::Invoice.new }
21
+ #let(:instance) { InvoicingApi::Invoice.new }
22
22
 
23
23
  describe 'test an instance of Invoice' do
24
24
  it 'should create an instance of Invoice' do
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -18,7 +18,7 @@ require 'date'
18
18
  # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
19
  # Please update as you see appropriate
20
20
  describe InvoicingApi::PaginatedInvoices do
21
- let(:instance) { InvoicingApi::PaginatedInvoices.new }
21
+ #let(:instance) { InvoicingApi::PaginatedInvoices.new }
22
22
 
23
23
  describe 'test an instance of PaginatedInvoices' do
24
24
  it 'should create an instance of PaginatedInvoices' do
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -18,7 +18,7 @@ require 'date'
18
18
  # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
19
  # Please update as you see appropriate
20
20
  describe InvoicingApi::PaginatedResponse do
21
- let(:instance) { InvoicingApi::PaginatedResponse.new }
21
+ #let(:instance) { InvoicingApi::PaginatedResponse.new }
22
22
 
23
23
  describe 'test an instance of PaginatedResponse' do
24
24
  it 'should create an instance of PaginatedResponse' do
data/spec/spec_helper.rb CHANGED
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pnap_invoicing_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
- - PhoenixNAP
7
+ - OpenAPI-Generator
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-15 00:00:00.000000000 Z
11
+ date: 2026-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -50,7 +50,7 @@ dependencies:
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
52
  version: 3.6.0
53
- description: Invoicing API Ruby Gem
53
+ description: 'List, fetch and pay invoices with the Invoicing API. '
54
54
  email:
55
55
  - support@phoenixnap.com
56
56
  executables: []
@@ -70,6 +70,7 @@ files:
70
70
  - lib/pnap_invoicing_api/api/invoices_api.rb
71
71
  - lib/pnap_invoicing_api/api_client.rb
72
72
  - lib/pnap_invoicing_api/api_error.rb
73
+ - lib/pnap_invoicing_api/api_model_base.rb
73
74
  - lib/pnap_invoicing_api/configuration.rb
74
75
  - lib/pnap_invoicing_api/models/error.rb
75
76
  - lib/pnap_invoicing_api/models/invoice.rb
@@ -83,11 +84,10 @@ files:
83
84
  - spec/models/paginated_invoices_spec.rb
84
85
  - spec/models/paginated_response_spec.rb
85
86
  - spec/spec_helper.rb
86
- homepage: https://phoenixnap.com/bare-metal-cloud
87
+ homepage: https://openapi-generator.tech
87
88
  licenses:
88
89
  - MPL-2.0
89
- metadata:
90
- source_code_uri: https://github.com/phoenixnap/ruby-sdk-bmc
90
+ metadata: {}
91
91
  post_install_message:
92
92
  rdoc_options: []
93
93
  require_paths: