kendama 0.2.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8b9aa30136b6cfb42a6e826a663613b8d9b0e00091c626e2abea3c618a472420
4
- data.tar.gz: 66eb62ba4ddb11d3ae74a1dc54e5a2f1ed1e7e416b69b0d3d47f1e10fd5237f1
3
+ metadata.gz: db9e5407f8a698baa415703bf947e0d187b9cdacaec0084f00a3871eec6cfff5
4
+ data.tar.gz: 2392913c34823811597d0203c84150874e5773f49919457499242896a5c55967
5
5
  SHA512:
6
- metadata.gz: f6583fbb37c574e56d2ca2620cf6967ce9fe96f672f19b45045e818c4d4047e8c1d2df2a24b9724de37e84d1dbf69e580ddbe8a05e049b66797998b6ce1d3851
7
- data.tar.gz: 3432a937af274ac0631630bae66383a4715d86d4215305b16e44d403d3e818a0a15238cd5f5afd8be97e60e62b3d1d2e7b7dfa8de7b89c12428ea826cd9ccf1e
6
+ metadata.gz: 9fe936629d4dc33f3980fa7886834a321577fa80525541908db715b090f5e98fd4f1b2a6c05acbc21fd96f628d2168931f3d14194f1eb41640178a51a68347cd
7
+ data.tar.gz: 7e32fe4cb8340a329acd8a683b1677cfaabfd66824fa1d4155d1a935b3ebf88162f40ccb0983e48afee8a80a2b00dd031385cdbd50ba40d385232a7f90c466c8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # [1.0.0] - 2023-09-12
2
+ - openapi-generator 7.0.0でクライアントAPIを生成
3
+
1
4
  # [0.2.3] - 2023-06-18
2
5
  - Dependabotのtarget-branchをmainに変更
3
6
  - changelog_uriをmainブランチに向ける
data/Gemfile CHANGED
@@ -2,7 +2,8 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem "rake", "~> 13.0"
6
- gem "rspec", "~> 3.0"
7
- gem "rubocop", "~> 1.52"
8
- gem 'pry-byebug'
5
+ group :development, :test do
6
+ gem 'rake', '~> 13.0.1'
7
+ gem 'pry-byebug'
8
+ gem 'rubocop', '~> 0.66.0'
9
+ end
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kendama (0.2.3)
4
+ kendama (1.0.0)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
@@ -14,7 +14,7 @@ GEM
14
14
  ethon (0.16.0)
15
15
  ffi (>= 1.15.0)
16
16
  ffi (1.15.5)
17
- json (2.6.3)
17
+ jaro_winkler (1.5.6)
18
18
  method_source (1.0.0)
19
19
  parallel (1.23.0)
20
20
  parser (3.2.2.3)
@@ -26,11 +26,11 @@ GEM
26
26
  pry-byebug (3.10.1)
27
27
  byebug (~> 11.0)
28
28
  pry (>= 0.13, < 0.15)
29
+ psych (5.1.0)
30
+ stringio
29
31
  racc (1.7.1)
30
32
  rainbow (3.1.1)
31
33
  rake (13.0.6)
32
- regexp_parser (2.8.1)
33
- rexml (3.2.5)
34
34
  rspec (3.12.0)
35
35
  rspec-core (~> 3.12.0)
36
36
  rspec-expectations (~> 3.12.0)
@@ -44,22 +44,19 @@ GEM
44
44
  diff-lcs (>= 1.2.0, < 2.0)
45
45
  rspec-support (~> 3.12.0)
46
46
  rspec-support (3.12.0)
47
- rubocop (1.52.1)
48
- json (~> 2.3)
47
+ rubocop (0.66.0)
48
+ jaro_winkler (~> 1.5.1)
49
49
  parallel (~> 1.10)
50
- parser (>= 3.2.2.3)
50
+ parser (>= 2.5, != 2.5.1.1)
51
+ psych (>= 3.1.0)
51
52
  rainbow (>= 2.2.2, < 4.0)
52
- regexp_parser (>= 1.8, < 3.0)
53
- rexml (>= 3.2.5, < 4.0)
54
- rubocop-ast (>= 1.28.0, < 2.0)
55
53
  ruby-progressbar (~> 1.7)
56
- unicode-display_width (>= 2.4.0, < 3.0)
57
- rubocop-ast (1.29.0)
58
- parser (>= 3.2.1.0)
54
+ unicode-display_width (>= 1.4.0, < 1.6)
59
55
  ruby-progressbar (1.13.0)
56
+ stringio (3.0.8)
60
57
  typhoeus (1.4.0)
61
58
  ethon (>= 0.9.0)
62
- unicode-display_width (2.4.2)
59
+ unicode-display_width (1.5.0)
63
60
 
64
61
  PLATFORMS
65
62
  x86_64-darwin-22
@@ -68,9 +65,9 @@ PLATFORMS
68
65
  DEPENDENCIES
69
66
  kendama!
70
67
  pry-byebug
71
- rake (~> 13.0)
72
- rspec (~> 3.0)
73
- rubocop (~> 1.52)
68
+ rake (~> 13.0.1)
69
+ rspec (~> 3.6, >= 3.6.0)
70
+ rubocop (~> 0.66.0)
74
71
 
75
72
  BUNDLED WITH
76
73
  2.4.12
data/README.md CHANGED
@@ -7,7 +7,7 @@ Kendama - the Ruby gem for the 国税庁API
7
7
  This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
8
8
 
9
9
  - API version: 1.0.0
10
- - Package version: 0.2.3
10
+ - Package version: 1.0.0
11
11
  - Build package: org.openapitools.codegen.languages.RubyClientCodegen
12
12
 
13
13
  ## Installation
@@ -23,16 +23,16 @@ gem build kendama.gemspec
23
23
  Then either install the gem locally:
24
24
 
25
25
  ```shell
26
- gem install ./kendama-0.2.3.gem
26
+ gem install ./kendama-1.0.0.gem
27
27
  ```
28
28
 
29
- (for development, run `gem install --dev ./kendama-0.2.3.gem` to install the development dependencies)
29
+ (for development, run `gem install --dev ./kendama-1.0.0.gem` to install the development dependencies)
30
30
 
31
31
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
32
32
 
33
33
  Finally add this to the Gemfile:
34
34
 
35
- gem 'kendama', '~> 0.2.3'
35
+ gem 'kendama', '~> 1.0.0'
36
36
 
37
37
  ### Install from Git
38
38
 
data/Rakefile CHANGED
@@ -4,12 +4,7 @@ begin
4
4
  require 'rspec/core/rake_task'
5
5
 
6
6
  RSpec::Core::RakeTask.new(:spec)
7
-
8
- require "rubocop/rake_task"
9
-
10
- RuboCop::RakeTask.new
11
-
12
- task default: %i[spec rubocop]
7
+ task default: :spec
13
8
  rescue LoadError
14
9
  # no rspec available
15
10
  end
data/bin/console ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "kendama"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ require "irb"
11
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/kendama.gemspec ADDED
@@ -0,0 +1,46 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ =begin
4
+ #国税庁API
5
+
6
+ #国税庁が提供するインボイス制度適格請求書発行事業者公表システムWeb-APIを使用するためのクライアントAPI(https://www.invoice-kohyo.nta.go.jp/web-api/index.html)
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+
10
+ Generated by: https://openapi-generator.tech
11
+ OpenAPI Generator version: 7.0.0
12
+
13
+ =end
14
+
15
+ $:.push File.expand_path("../lib", __FILE__)
16
+ require "kendama/version"
17
+
18
+ Gem::Specification.new do |s|
19
+ s.name = "kendama"
20
+ s.version = Kendama::VERSION
21
+ s.platform = Gem::Platform::RUBY
22
+ s.authors = ["uichi"]
23
+ s.email = ["37263474+uichi@users.noreply.github.com"]
24
+ s.homepage = "https://rubygems.org/gems/kendama"
25
+ s.summary = "適格請求書発行事業者公表システムWeb-APIのラッパー"
26
+ s.description = "国税庁が提供するインボイス制度適格請求書発行事業者公表システムWeb-APIを使用するためのRuby向けラッパーです。"
27
+ s.license = "MIT"
28
+ s.required_ruby_version = ">= 2.7"
29
+
30
+ # s.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
31
+
32
+ s.metadata["homepage_uri"] = s.homepage
33
+ s.metadata["source_code_uri"] = "https://github.com/uichi/kendama"
34
+ s.metadata["changelog_uri"] = "https://github.com/uichi/kendama/blob/main/CHANGELOG.md"
35
+
36
+ s.required_ruby_version = ">= 2.7"
37
+
38
+ s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
39
+
40
+ s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
41
+
42
+ s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
43
+ s.test_files = `find spec/*`.split("\n")
44
+ s.executables = []
45
+ s.require_paths = ["lib"]
46
+ end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
@@ -152,7 +152,7 @@ module Kendama
152
152
  @scheme = 'https'
153
153
  @host = 'kensyo.invoice-kohyo.nta.go.jp'
154
154
  @base_path = ''
155
- @server_index = 0
155
+ @server_index = nil
156
156
  @server_operation_index = {}
157
157
  @server_variables = {}
158
158
  @server_operation_variables = {}
@@ -200,10 +200,12 @@ module Kendama
200
200
 
201
201
  # Returns base URL for specified operation based on server settings
202
202
  def base_url(operation = nil)
203
- index = server_operation_index[operation]
204
- return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil
205
-
206
- server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
203
+ if operation_server_settings.key?(operation) then
204
+ index = server_operation_index.fetch(operation, server_index)
205
+ server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
206
+ else
207
+ server_index.nil? ? "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') : server_url(server_index, server_variables, nil)
208
+ end
207
209
  end
208
210
 
209
211
  # Gets API key (with prefix if set).
@@ -262,8 +264,8 @@ module Kendama
262
264
  servers = server_settings if servers == nil
263
265
 
264
266
  # check array index out of bound
265
- if (index < 0 || index >= servers.size)
266
- fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}"
267
+ if (index.nil? || index < 0 || index >= servers.size)
268
+ fail ArgumentError, "Invalid index #{index} when selecting the server. Must not be nil and must be less than #{servers.size}"
267
269
  end
268
270
 
269
271
  server = servers[index]
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
@@ -197,82 +197,122 @@ module Kendama
197
197
 
198
198
  if attributes.key?(:'sequence_number')
199
199
  self.sequence_number = attributes[:'sequence_number']
200
+ else
201
+ self.sequence_number = nil
200
202
  end
201
203
 
202
204
  if attributes.key?(:'registrated_number')
203
205
  self.registrated_number = attributes[:'registrated_number']
206
+ else
207
+ self.registrated_number = nil
204
208
  end
205
209
 
206
210
  if attributes.key?(:'process')
207
211
  self.process = attributes[:'process']
212
+ else
213
+ self.process = nil
208
214
  end
209
215
 
210
216
  if attributes.key?(:'correct')
211
217
  self.correct = attributes[:'correct']
218
+ else
219
+ self.correct = nil
212
220
  end
213
221
 
214
222
  if attributes.key?(:'kind')
215
223
  self.kind = attributes[:'kind']
224
+ else
225
+ self.kind = nil
216
226
  end
217
227
 
218
228
  if attributes.key?(:'country')
219
229
  self.country = attributes[:'country']
230
+ else
231
+ self.country = nil
220
232
  end
221
233
 
222
234
  if attributes.key?(:'latest')
223
235
  self.latest = attributes[:'latest']
236
+ else
237
+ self.latest = nil
224
238
  end
225
239
 
226
240
  if attributes.key?(:'registration_date')
227
241
  self.registration_date = attributes[:'registration_date']
242
+ else
243
+ self.registration_date = nil
228
244
  end
229
245
 
230
246
  if attributes.key?(:'update_date')
231
247
  self.update_date = attributes[:'update_date']
248
+ else
249
+ self.update_date = nil
232
250
  end
233
251
 
234
252
  if attributes.key?(:'disposal_date')
235
253
  self.disposal_date = attributes[:'disposal_date']
254
+ else
255
+ self.disposal_date = nil
236
256
  end
237
257
 
238
258
  if attributes.key?(:'expire_date')
239
259
  self.expire_date = attributes[:'expire_date']
260
+ else
261
+ self.expire_date = nil
240
262
  end
241
263
 
242
264
  if attributes.key?(:'address')
243
265
  self.address = attributes[:'address']
266
+ else
267
+ self.address = nil
244
268
  end
245
269
 
246
270
  if attributes.key?(:'address_prefecture_code')
247
271
  self.address_prefecture_code = attributes[:'address_prefecture_code']
272
+ else
273
+ self.address_prefecture_code = nil
248
274
  end
249
275
 
250
276
  if attributes.key?(:'address_city_code')
251
277
  self.address_city_code = attributes[:'address_city_code']
278
+ else
279
+ self.address_city_code = nil
252
280
  end
253
281
 
254
282
  if attributes.key?(:'address_request')
255
283
  self.address_request = attributes[:'address_request']
284
+ else
285
+ self.address_request = nil
256
286
  end
257
287
 
258
288
  if attributes.key?(:'address_request_prefecture_code')
259
289
  self.address_request_prefecture_code = attributes[:'address_request_prefecture_code']
290
+ else
291
+ self.address_request_prefecture_code = nil
260
292
  end
261
293
 
262
294
  if attributes.key?(:'address_request_city_code')
263
295
  self.address_request_city_code = attributes[:'address_request_city_code']
296
+ else
297
+ self.address_request_city_code = nil
264
298
  end
265
299
 
266
300
  if attributes.key?(:'kana')
267
301
  self.kana = attributes[:'kana']
302
+ else
303
+ self.kana = nil
268
304
  end
269
305
 
270
306
  if attributes.key?(:'name')
271
307
  self.name = attributes[:'name']
308
+ else
309
+ self.name = nil
272
310
  end
273
311
 
274
312
  if attributes.key?(:'address_inside')
275
313
  self.address_inside = attributes[:'address_inside']
314
+ else
315
+ self.address_inside = nil
276
316
  end
277
317
 
278
318
  if attributes.key?(:'address_inside_prefecture_code')
@@ -281,20 +321,27 @@ module Kendama
281
321
 
282
322
  if attributes.key?(:'address_inside_city_code')
283
323
  self.address_inside_city_code = attributes[:'address_inside_city_code']
324
+ else
325
+ self.address_inside_city_code = nil
284
326
  end
285
327
 
286
328
  if attributes.key?(:'trade_name')
287
329
  self.trade_name = attributes[:'trade_name']
330
+ else
331
+ self.trade_name = nil
288
332
  end
289
333
 
290
334
  if attributes.key?(:'popular_name_previous_name')
291
335
  self.popular_name_previous_name = attributes[:'popular_name_previous_name']
336
+ else
337
+ self.popular_name_previous_name = nil
292
338
  end
293
339
  end
294
340
 
295
341
  # Show invalid properties with the reasons. Usually used together with valid?
296
342
  # @return Array for valid properties with the reasons
297
343
  def list_invalid_properties
344
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
298
345
  invalid_properties = Array.new
299
346
  if @sequence_number.nil?
300
347
  invalid_properties.push('invalid value for "sequence_number", sequence_number cannot be nil.')
@@ -430,6 +477,7 @@ module Kendama
430
477
  # Check to see if the all the properties in the model are valid
431
478
  # @return true if the model is valid
432
479
  def valid?
480
+ warn '[DEPRECATED] the `valid?` method is obsolete'
433
481
  return false if @sequence_number.nil?
434
482
  return false if @sequence_number.to_s.length > 8
435
483
  return false if @sequence_number.to_s.length < 1
@@ -688,37 +736,30 @@ module Kendama
688
736
  # @param [Hash] attributes Model attributes in the form of hash
689
737
  # @return [Object] Returns the model itself
690
738
  def self.build_from_hash(attributes)
691
- new.build_from_hash(attributes)
692
- end
693
-
694
- # Builds the object from hash
695
- # @param [Hash] attributes Model attributes in the form of hash
696
- # @return [Object] Returns the model itself
697
- def build_from_hash(attributes)
698
739
  return nil unless attributes.is_a?(Hash)
699
740
  attributes = attributes.transform_keys(&:to_sym)
700
- self.class.openapi_types.each_pair do |key, type|
701
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
702
- self.send("#{key}=", nil)
741
+ transformed_hash = {}
742
+ openapi_types.each_pair do |key, type|
743
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
744
+ transformed_hash["#{key}"] = nil
703
745
  elsif type =~ /\AArray<(.*)>/i
704
746
  # check to ensure the input is an array given that the attribute
705
747
  # is documented as an array but the input is not
706
- if attributes[self.class.attribute_map[key]].is_a?(Array)
707
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
748
+ if attributes[attribute_map[key]].is_a?(Array)
749
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
708
750
  end
709
- elsif !attributes[self.class.attribute_map[key]].nil?
710
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
751
+ elsif !attributes[attribute_map[key]].nil?
752
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
711
753
  end
712
754
  end
713
-
714
- self
755
+ new(transformed_hash)
715
756
  end
716
757
 
717
758
  # Deserializes the data based on type
718
759
  # @param string type Data type
719
760
  # @param string value Value to be deserialized
720
761
  # @return [Object] Deserialized data
721
- def _deserialize(type, value)
762
+ def self._deserialize(type, value)
722
763
  case type.to_sym
723
764
  when :Time
724
765
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
@@ -103,6 +103,7 @@ module Kendama
103
103
  # Show invalid properties with the reasons. Usually used together with valid?
104
104
  # @return Array for valid properties with the reasons
105
105
  def list_invalid_properties
106
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
106
107
  invalid_properties = Array.new
107
108
  if !@count.nil? && @count.to_s.length > 8
108
109
  invalid_properties.push('invalid value for "count", the character length must be smaller than or equal to 8.')
@@ -134,6 +135,7 @@ module Kendama
134
135
  # Check to see if the all the properties in the model are valid
135
136
  # @return true if the model is valid
136
137
  def valid?
138
+ warn '[DEPRECATED] the `valid?` method is obsolete'
137
139
  return false if !@count.nil? && @count.to_s.length > 8
138
140
  return false if !@count.nil? && @count.to_s.length < 1
139
141
  return false if !@divide_number.nil? && @divide_number.to_s.length > 6
@@ -146,11 +148,15 @@ module Kendama
146
148
  # Custom attribute writer method with validation
147
149
  # @param [Object] count Value to be assigned
148
150
  def count=(count)
149
- if !count.nil? && count.to_s.length > 8
151
+ if count.nil?
152
+ fail ArgumentError, 'count cannot be nil'
153
+ end
154
+
155
+ if count.to_s.length > 8
150
156
  fail ArgumentError, 'invalid value for "count", the character length must be smaller than or equal to 8.'
151
157
  end
152
158
 
153
- if !count.nil? && count.to_s.length < 1
159
+ if count.to_s.length < 1
154
160
  fail ArgumentError, 'invalid value for "count", the character length must be great than or equal to 1.'
155
161
  end
156
162
 
@@ -160,11 +166,15 @@ module Kendama
160
166
  # Custom attribute writer method with validation
161
167
  # @param [Object] divide_number Value to be assigned
162
168
  def divide_number=(divide_number)
163
- if !divide_number.nil? && divide_number.to_s.length > 6
169
+ if divide_number.nil?
170
+ fail ArgumentError, 'divide_number cannot be nil'
171
+ end
172
+
173
+ if divide_number.to_s.length > 6
164
174
  fail ArgumentError, 'invalid value for "divide_number", the character length must be smaller than or equal to 6.'
165
175
  end
166
176
 
167
- if !divide_number.nil? && divide_number.to_s.length < 1
177
+ if divide_number.to_s.length < 1
168
178
  fail ArgumentError, 'invalid value for "divide_number", the character length must be great than or equal to 1.'
169
179
  end
170
180
 
@@ -174,11 +184,15 @@ module Kendama
174
184
  # Custom attribute writer method with validation
175
185
  # @param [Object] divide_size Value to be assigned
176
186
  def divide_size=(divide_size)
177
- if !divide_size.nil? && divide_size.to_s.length > 6
187
+ if divide_size.nil?
188
+ fail ArgumentError, 'divide_size cannot be nil'
189
+ end
190
+
191
+ if divide_size.to_s.length > 6
178
192
  fail ArgumentError, 'invalid value for "divide_size", the character length must be smaller than or equal to 6.'
179
193
  end
180
194
 
181
- if !divide_size.nil? && divide_size.to_s.length < 1
195
+ if divide_size.to_s.length < 1
182
196
  fail ArgumentError, 'invalid value for "divide_size", the character length must be great than or equal to 1.'
183
197
  end
184
198
 
@@ -213,37 +227,30 @@ module Kendama
213
227
  # @param [Hash] attributes Model attributes in the form of hash
214
228
  # @return [Object] Returns the model itself
215
229
  def self.build_from_hash(attributes)
216
- new.build_from_hash(attributes)
217
- end
218
-
219
- # Builds the object from hash
220
- # @param [Hash] attributes Model attributes in the form of hash
221
- # @return [Object] Returns the model itself
222
- def build_from_hash(attributes)
223
230
  return nil unless attributes.is_a?(Hash)
224
231
  attributes = attributes.transform_keys(&:to_sym)
225
- self.class.openapi_types.each_pair do |key, type|
226
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
227
- self.send("#{key}=", nil)
232
+ transformed_hash = {}
233
+ openapi_types.each_pair do |key, type|
234
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
235
+ transformed_hash["#{key}"] = nil
228
236
  elsif type =~ /\AArray<(.*)>/i
229
237
  # check to ensure the input is an array given that the attribute
230
238
  # is documented as an array but the input is not
231
- if attributes[self.class.attribute_map[key]].is_a?(Array)
232
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
239
+ if attributes[attribute_map[key]].is_a?(Array)
240
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
233
241
  end
234
- elsif !attributes[self.class.attribute_map[key]].nil?
235
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
242
+ elsif !attributes[attribute_map[key]].nil?
243
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
236
244
  end
237
245
  end
238
-
239
- self
246
+ new(transformed_hash)
240
247
  end
241
248
 
242
249
  # Deserializes the data based on type
243
250
  # @param string type Data type
244
251
  # @param string value Value to be deserialized
245
252
  # @return [Object] Deserialized data
246
- def _deserialize(type, value)
253
+ def self._deserialize(type, value)
247
254
  case type.to_sym
248
255
  when :Time
249
256
  Time.parse(value)
@@ -6,10 +6,10 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12
 
13
13
  module Kendama
14
- VERSION = '0.2.3'
14
+ VERSION = '1.0.0'
15
15
  end
data/lib/kendama.rb CHANGED
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ OpenAPI Generator version: 7.0.0
10
10
 
11
11
  =end
12
12