kendama 1.0.1 → 1.0.2

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: 12fd5a316568ab2435d39bed3f27fc0e194d58bf8cb23dc7ac6230a9e5478917
4
- data.tar.gz: 7fb467d137f0b7940f2c7ccf01421640231666db2d3b783bc517f37e143b7bc8
3
+ metadata.gz: 396e6fac3f34243eb1f4533b8ce3eb4beb046346daab7a46b966b7a728fe22fc
4
+ data.tar.gz: 0031b04f8f2eda8980324df5d4b96d90088a7970e09ddafd2aa2732af3b5cc15
5
5
  SHA512:
6
- metadata.gz: aa2d6eb5ea946b8e0734e87306bf0ce8ad750a418efc9e7ce12600db2a62cf9603df83c17783bda6d6f326c6c832eab8b99897144cc2553582e83fc978fa7882
7
- data.tar.gz: a535969fbec65a6bfcc3cb0a33e9edd20b8a9aa4a9588b51281ed0a876adc01966c9e390d500662bd78b4a68c8a0cf0dc8ffd3bf7072836b7083a34fa08f05f7
6
+ metadata.gz: 93274071c7ca9ea87681dcab3c5f63b03231c6feb5e0c8a2797f52ab04cb27d1874739f3642feaf21f3148254b438d3d6cca4f5a0d5403e1f98f7aeffe44ea35
7
+ data.tar.gz: 0a1c909a66c3aa67fad4ec994c1fa8b7e3eb4d67c61198105c13cbf1ed5c76c606f0dc1aa8cc6f813817476d43346d3b38d02ebed7c0facaded23fd2b389f5a0
data/CHANGELOG.md CHANGED
@@ -1,10 +1,18 @@
1
+ # [1.0.2] - 2026-05-04
2
+
3
+ - 依存gemのバージョンを更新
4
+ - authorの情報を更新
5
+
1
6
  # [1.0.1] - 2024-09-19
7
+
2
8
  - 依存gemのバージョンを更新
3
9
 
4
10
  # [1.0.0] - 2023-09-12
11
+
5
12
  - openapi-generator 7.0.0でクライアントAPIを生成
6
13
 
7
14
  # [0.2.3] - 2023-06-18
15
+
8
16
  - Dependabotのtarget-branchをmainに変更
9
17
  - changelog_uriをmainブランチに向ける
10
18
 
data/CODE_OF_CONDUCT.md CHANGED
@@ -10,21 +10,21 @@ We pledge to act and interact in ways that contribute to an open, welcoming, div
10
10
 
11
11
  Examples of behavior that contributes to a positive environment for our community include:
12
12
 
13
- * Demonstrating empathy and kindness toward other people
14
- * Being respectful of differing opinions, viewpoints, and experiences
15
- * Giving and gracefully accepting constructive feedback
16
- * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
- * Focusing on what is best not just for us as individuals, but for the overall community
13
+ - Demonstrating empathy and kindness toward other people
14
+ - Being respectful of differing opinions, viewpoints, and experiences
15
+ - Giving and gracefully accepting constructive feedback
16
+ - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ - Focusing on what is best not just for us as individuals, but for the overall community
18
18
 
19
19
  Examples of unacceptable behavior include:
20
20
 
21
- * The use of sexualized language or imagery, and sexual attention or
21
+ - The use of sexualized language or imagery, and sexual attention or
22
22
  advances of any kind
23
- * Trolling, insulting or derogatory comments, and personal or political attacks
24
- * Public or private harassment
25
- * Publishing others' private information, such as a physical or email
23
+ - Trolling, insulting or derogatory comments, and personal or political attacks
24
+ - Public or private harassment
25
+ - Publishing others' private information, such as a physical or email
26
26
  address, without their explicit permission
27
- * Other conduct which could reasonably be considered inappropriate in a
27
+ - Other conduct which could reasonably be considered inappropriate in a
28
28
  professional setting
29
29
 
30
30
  ## Enforcement Responsibilities
@@ -39,7 +39,7 @@ This Code of Conduct applies within all community spaces, and also applies when
39
39
 
40
40
  ## Enforcement
41
41
 
42
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at 37263474+uichi@users.noreply.github.com. All complaints will be reviewed and investigated promptly and fairly.
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at 37263474+nisyuu@users.noreply.github.com. All complaints will be reviewed and investigated promptly and fairly.
43
43
 
44
44
  All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
45
 
@@ -67,7 +67,7 @@ Community leaders will follow these Community Impact Guidelines in determining t
67
67
 
68
68
  ### 4. Permanent Ban
69
69
 
70
- **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
71
 
72
72
  **Consequence**: A permanent ban from any sort of public interaction within the community.
73
73
 
data/Gemfile CHANGED
@@ -3,7 +3,7 @@ source 'https://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  group :development, :test do
6
- gem 'rake', '~> 13.2.1'
6
+ gem 'rake', '~> 13.4'
7
7
  gem 'pry-byebug'
8
- gem 'rubocop', '~> 1.66.1'
8
+ gem 'rubocop', '~> 0.66.0'
9
9
  end
data/Gemfile.lock CHANGED
@@ -1,24 +1,28 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kendama (1.0.1)
4
+ kendama (1.0.2)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- ast (2.4.2)
10
+ ast (2.4.3)
11
11
  byebug (11.1.3)
12
12
  coderay (1.1.3)
13
- diff-lcs (1.5.1)
14
- ethon (0.16.0)
13
+ date (3.5.1)
14
+ diff-lcs (1.6.2)
15
+ ethon (0.18.0)
15
16
  ffi (>= 1.15.0)
16
- ffi (1.16.3)
17
- json (2.7.2)
18
- language_server-protocol (3.17.0.3)
17
+ logger
18
+ ffi (1.17.3-arm64-darwin)
19
+ ffi (1.17.3-x86_64-darwin)
20
+ ffi (1.17.3-x86_64-linux-gnu)
21
+ jaro_winkler (1.5.6)
22
+ logger (1.7.0)
19
23
  method_source (1.0.0)
20
- parallel (1.26.3)
21
- parser (3.3.5.0)
24
+ parallel (1.28.0)
25
+ parser (3.3.11.1)
22
26
  ast (~> 2.4.1)
23
27
  racc
24
28
  pry (0.14.2)
@@ -27,50 +31,50 @@ GEM
27
31
  pry-byebug (3.10.1)
28
32
  byebug (~> 11.0)
29
33
  pry (>= 0.13, < 0.15)
34
+ psych (5.3.1)
35
+ date
36
+ stringio
30
37
  racc (1.8.1)
31
38
  rainbow (3.1.1)
32
- rake (13.2.1)
33
- regexp_parser (2.9.2)
34
- rspec (3.13.0)
39
+ rake (13.4.2)
40
+ rspec (3.13.2)
35
41
  rspec-core (~> 3.13.0)
36
42
  rspec-expectations (~> 3.13.0)
37
43
  rspec-mocks (~> 3.13.0)
38
- rspec-core (3.13.0)
44
+ rspec-core (3.13.6)
39
45
  rspec-support (~> 3.13.0)
40
- rspec-expectations (3.13.0)
46
+ rspec-expectations (3.13.5)
41
47
  diff-lcs (>= 1.2.0, < 2.0)
42
48
  rspec-support (~> 3.13.0)
43
- rspec-mocks (3.13.0)
49
+ rspec-mocks (3.13.7)
44
50
  diff-lcs (>= 1.2.0, < 2.0)
45
51
  rspec-support (~> 3.13.0)
46
- rspec-support (3.13.0)
47
- rubocop (1.66.1)
48
- json (~> 2.3)
49
- language_server-protocol (>= 3.17.0)
52
+ rspec-support (3.13.6)
53
+ rubocop (0.66.0)
54
+ jaro_winkler (~> 1.5.1)
50
55
  parallel (~> 1.10)
51
- parser (>= 3.3.0.2)
56
+ parser (>= 2.5, != 2.5.1.1)
57
+ psych (>= 3.1.0)
52
58
  rainbow (>= 2.2.2, < 4.0)
53
- regexp_parser (>= 2.4, < 3.0)
54
- rubocop-ast (>= 1.32.2, < 2.0)
55
59
  ruby-progressbar (~> 1.7)
56
- unicode-display_width (>= 2.4.0, < 3.0)
57
- rubocop-ast (1.32.3)
58
- parser (>= 3.3.1.0)
60
+ unicode-display_width (>= 1.4.0, < 1.6)
59
61
  ruby-progressbar (1.13.0)
60
- typhoeus (1.4.1)
61
- ethon (>= 0.9.0)
62
- unicode-display_width (2.5.0)
62
+ stringio (3.2.0)
63
+ typhoeus (1.6.0)
64
+ ethon (>= 0.18.0)
65
+ unicode-display_width (1.5.0)
63
66
 
64
67
  PLATFORMS
68
+ arm64-darwin-25
65
69
  x86_64-darwin-22
66
70
  x86_64-linux
67
71
 
68
72
  DEPENDENCIES
69
73
  kendama!
70
74
  pry-byebug
71
- rake (~> 13.2.1)
75
+ rake (~> 13.4)
72
76
  rspec (~> 3.6, >= 3.6.0)
73
- rubocop (~> 1.66.1)
77
+ rubocop (~> 0.66.0)
74
78
 
75
79
  BUNDLED WITH
76
80
  2.4.12
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2023 uichi
3
+ Copyright (c) 2023 nisyuu
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -6,8 +6,9 @@ Kendama - the Ruby gem for the 国税庁API
6
6
 
7
7
  This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
8
8
 
9
- - API version: 1.0.1
10
- - Package version: 1.0.1
9
+ - API version: 1.0.2
10
+ - Package version: 1.0.2
11
+ - Generator version: 7.22.0
11
12
  - Build package: org.openapitools.codegen.languages.RubyClientCodegen
12
13
 
13
14
  ## Installation
@@ -23,22 +24,22 @@ gem build kendama.gemspec
23
24
  Then either install the gem locally:
24
25
 
25
26
  ```shell
26
- gem install ./kendama-1.0.1.gem
27
+ gem install ./kendama-1.0.2.gem
27
28
  ```
28
29
 
29
- (for development, run `gem install --dev ./kendama-1.0.1.gem` to install the development dependencies)
30
+ (for development, run `gem install --dev ./kendama-1.0.2.gem` to install the development dependencies)
30
31
 
31
32
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
32
33
 
33
34
  Finally add this to the Gemfile:
34
35
 
35
- gem 'kendama', '~> 1.0.1'
36
+ gem 'kendama', '~> 1.0.2'
36
37
 
37
38
  ### Install from Git
38
39
 
39
- If the Ruby gem is hosted at a git repository: https://github.com/uichi/kendama, then add the following in the Gemfile:
40
+ If the Ruby gem is hosted at a git repository: https://github.com/nisyuu/kendama, then add the following in the Gemfile:
40
41
 
41
- gem 'kendama', :git => 'https://github.com/uichi/kendama.git'
42
+ gem 'kendama', :git => 'https://github.com/nisyuu/kendama.git'
42
43
 
43
44
  ### Include the Ruby code directly
44
45
 
data/git_push.sh CHANGED
@@ -14,7 +14,7 @@ if [ "$git_host" = "" ]; then
14
14
  fi
15
15
 
16
16
  if [ "$git_user_id" = "" ]; then
17
- git_user_id="uichi"
17
+ git_user_id="nisyuu"
18
18
  echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
19
19
  fi
20
20
 
data/kendama.gemspec CHANGED
@@ -5,10 +5,10 @@
5
5
 
6
6
  #国税庁が提供するインボイス制度適格請求書発行事業者公表システムWeb-APIを使用するためのクライアントAPI(https://www.invoice-kohyo.nta.go.jp/web-api/index.html)
7
7
 
8
- The version of the OpenAPI document: 1.0.1
8
+ The version of the OpenAPI document: 1.0.2
9
9
 
10
10
  Generated by: https://openapi-generator.tech
11
- OpenAPI Generator version: 7.0.0
11
+ Generator version: 7.22.0
12
12
 
13
13
  =end
14
14
 
@@ -19,8 +19,8 @@ Gem::Specification.new do |s|
19
19
  s.name = "kendama"
20
20
  s.version = Kendama::VERSION
21
21
  s.platform = Gem::Platform::RUBY
22
- s.authors = ["uichi"]
23
- s.email = ["37263474+uichi@users.noreply.github.com"]
22
+ s.authors = ["nisyuu"]
23
+ s.email = ["37263474+nisyuu@users.noreply.github.com"]
24
24
  s.homepage = "https://rubygems.org/gems/kendama"
25
25
  s.summary = "適格請求書発行事業者公表システムWeb-APIのラッパー"
26
26
  s.description = "国税庁が提供するインボイス制度適格請求書発行事業者公表システムWeb-APIを使用するためのRuby向けラッパーです。"
@@ -30,11 +30,8 @@ Gem::Specification.new do |s|
30
30
  # s.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
31
31
 
32
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
-
33
+ s.metadata["source_code_uri"] = "https://github.com/nisyuu/kendama"
34
+ s.metadata["changelog_uri"] = "https://github.com/nisyuu/kendama/blob/main/CHANGELOG.md"
38
35
  s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
39
36
 
40
37
  s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
@@ -3,10 +3,10 @@
3
3
 
4
4
  #国税庁が提供するインボイス制度適格請求書発行事業者公表システムWeb-APIを使用するためのクライアントAPI(https://www.invoice-kohyo.nta.go.jp/web-api/index.html)
5
5
 
6
- The version of the OpenAPI document: 1.0.1
6
+ The version of the OpenAPI document: 1.0.2
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.0
9
+ Generator version: 7.22.0
10
10
 
11
11
  =end
12
12
 
@@ -78,7 +78,7 @@ module Kendama
78
78
  end
79
79
 
80
80
  if @api_client.config.client_side_validation && !opts[:'divide'].nil? && opts[:'divide'].to_s.length < 1
81
- fail ArgumentError, 'invalid value for "opts[:"divide"]" when calling V1Api.get_announcement_by_diff, the character length must be great than or equal to 1.'
81
+ fail ArgumentError, 'invalid value for "opts[:"divide"]" when calling V1Api.get_announcement_by_diff, the character length must be greater than or equal to 1.'
82
82
  end
83
83
 
84
84
  # resource path
@@ -96,7 +96,7 @@ module Kendama
96
96
  # header parameters
97
97
  header_params = opts[:header_params] || {}
98
98
  # HTTP header 'Accept' (if needed)
99
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
99
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
100
100
 
101
101
  # form parameters
102
102
  form_params = opts[:form_params] || {}
@@ -186,7 +186,7 @@ module Kendama
186
186
  # header parameters
187
187
  header_params = opts[:header_params] || {}
188
188
  # HTTP header 'Accept' (if needed)
189
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
189
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
190
190
 
191
191
  # form parameters
192
192
  form_params = opts[:form_params] || {}
@@ -276,7 +276,7 @@ module Kendama
276
276
  # header parameters
277
277
  header_params = opts[:header_params] || {}
278
278
  # HTTP header 'Accept' (if needed)
279
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
279
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
280
280
 
281
281
  # form parameters
282
282
  form_params = opts[:form_params] || {}
@@ -3,10 +3,10 @@
3
3
 
4
4
  #国税庁が提供するインボイス制度適格請求書発行事業者公表システムWeb-APIを使用するためのクライアントAPI(https://www.invoice-kohyo.nta.go.jp/web-api/index.html)
5
5
 
6
- The version of the OpenAPI document: 1.0.1
6
+ The version of the OpenAPI document: 1.0.2
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.0
9
+ Generator version: 7.22.0
10
10
 
11
11
  =end
12
12
 
@@ -17,6 +17,7 @@ require 'tempfile'
17
17
  require 'time'
18
18
  require 'typhoeus'
19
19
 
20
+
20
21
  module Kendama
21
22
  class ApiClient
22
23
  # The Configuration object holding settings to be used in the API client.
@@ -45,9 +46,11 @@ module Kendama
45
46
  # Call an API with given options.
46
47
  #
47
48
  # @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
48
- # the data deserialized from response body (could be nil), response status code and response headers.
49
+ # the data deserialized from response body (may be a Tempfile or nil), response status code and response headers.
49
50
  def call_api(http_method, path, opts = {})
50
51
  request = build_request(http_method, path, opts)
52
+ tempfile = nil
53
+ (download_file(request) { tempfile = _1 }) if opts[:return_type] == 'File'
51
54
  response = request.run
52
55
 
53
56
  if @config.debugging
@@ -69,7 +72,9 @@ module Kendama
69
72
  end
70
73
  end
71
74
 
72
- if opts[:return_type]
75
+ if opts[:return_type] == 'File'
76
+ data = tempfile
77
+ elsif opts[:return_type]
73
78
  data = deserialize(response, opts[:return_type])
74
79
  else
75
80
  data = nil
@@ -124,9 +129,7 @@ module Kendama
124
129
  end
125
130
  end
126
131
 
127
- request = Typhoeus::Request.new(url, req_opts)
128
- download_file(request) if opts[:return_type] == 'File'
129
- request
132
+ Typhoeus::Request.new(url, req_opts)
130
133
  end
131
134
 
132
135
  # Builds the HTTP request body
@@ -164,6 +167,8 @@ module Kendama
164
167
  # process can use.
165
168
  #
166
169
  # @see Configuration#temp_folder_path
170
+ #
171
+ # @return [Tempfile] the tempfile generated
167
172
  def download_file(request)
168
173
  tempfile = nil
169
174
  encoding = nil
@@ -178,20 +183,21 @@ module Kendama
178
183
  prefix = prefix + '-' unless prefix.end_with?('-')
179
184
  encoding = response.body.encoding
180
185
  tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
181
- @tempfile = tempfile
182
186
  end
183
187
  request.on_body do |chunk|
184
188
  chunk.force_encoding(encoding)
185
189
  tempfile.write(chunk)
186
190
  end
187
- request.on_complete do |response|
188
- if tempfile
189
- tempfile.close
190
- @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
191
- "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
192
- "will be deleted automatically with GC. It's also recommended to delete the temp file "\
193
- "explicitly with `tempfile.delete`"
191
+ request.on_complete do
192
+ if !tempfile
193
+ fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
194
194
  end
195
+ tempfile.close
196
+ @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
197
+ "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
198
+ "will be deleted automatically with GC. It's also recommended to delete the temp file "\
199
+ "explicitly with `tempfile.delete`"
200
+ yield tempfile if block_given?
195
201
  end
196
202
  end
197
203
 
@@ -204,7 +210,7 @@ module Kendama
204
210
  # @param [String] mime MIME
205
211
  # @return [Boolean] True if the MIME is application/json
206
212
  def json_mime?(mime)
207
- (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
213
+ (mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil?
208
214
  end
209
215
 
210
216
  # Deserialize the response to the given return type.
@@ -213,15 +219,10 @@ module Kendama
213
219
  # @param [String] return_type some examples: "User", "Array<User>", "Hash<String, Integer>"
214
220
  def deserialize(response, return_type)
215
221
  body = response.body
216
-
217
- # handle file downloading - return the File instance processed in request callbacks
218
- # note that response body is empty when the file is written in chunks in request on_body callback
219
- return @tempfile if return_type == 'File'
220
-
221
222
  return nil if body.nil? || body.empty?
222
223
 
223
224
  # return response body directly for String return type
224
- return body if return_type == 'String'
225
+ return body.to_s if return_type == 'String'
225
226
 
226
227
  # ensuring a default content type
227
228
  content_type = response.headers['Content-Type'] || 'application/json'
@@ -276,9 +277,13 @@ module Kendama
276
277
  data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
277
278
  end
278
279
  else
279
- # models (e.g. Pet) or oneOf
280
+ # models (e.g. Pet) or oneOf/anyOf
280
281
  klass = Kendama.const_get(return_type)
281
- klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data)
282
+ if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of)
283
+ klass.build(data)
284
+ else
285
+ klass.build_from_hash(data)
286
+ end
282
287
  end
283
288
  end
284
289
 
@@ -288,7 +293,7 @@ module Kendama
288
293
  # @param [String] filename the filename to be sanitized
289
294
  # @return [String] the sanitized filename
290
295
  def sanitize_filename(filename)
291
- filename.gsub(/.*[\/\\]/, '')
296
+ filename.split(/[\/\\]/).last
292
297
  end
293
298
 
294
299
  def build_request_url(path, opts = {})
@@ -316,7 +321,7 @@ module Kendama
316
321
 
317
322
  # Sets user agent in HTTP header
318
323
  #
319
- # @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.1)
324
+ # @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0)
320
325
  def user_agent=(user_agent)
321
326
  @user_agent = user_agent
322
327
  @default_headers['User-Agent'] = @user_agent
@@ -3,10 +3,10 @@
3
3
 
4
4
  #国税庁が提供するインボイス制度適格請求書発行事業者公表システムWeb-APIを使用するためのクライアントAPI(https://www.invoice-kohyo.nta.go.jp/web-api/index.html)
5
5
 
6
- The version of the OpenAPI document: 1.0.1
6
+ The version of the OpenAPI document: 1.0.2
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.0
9
+ Generator version: 7.22.0
10
10
 
11
11
  =end
12
12
 
@@ -0,0 +1,88 @@
1
+ =begin
2
+ #国税庁API
3
+
4
+ #国税庁が提供するインボイス制度適格請求書発行事業者公表システムWeb-APIを使用するためのクライアントAPI(https://www.invoice-kohyo.nta.go.jp/web-api/index.html)
5
+
6
+ The version of the OpenAPI document: 1.0.2
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ module Kendama
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 = Kendama.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
@@ -3,10 +3,10 @@
3
3
 
4
4
  #国税庁が提供するインボイス制度適格請求書発行事業者公表システムWeb-APIを使用するためのクライアントAPI(https://www.invoice-kohyo.nta.go.jp/web-api/index.html)
5
5
 
6
- The version of the OpenAPI document: 1.0.1
6
+ The version of the OpenAPI document: 1.0.2
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.0.0
9
+ Generator version: 7.22.0
10
10
 
11
11
  =end
12
12
 
@@ -79,6 +79,14 @@ module Kendama
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 Kendama
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 Kendama
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])
@@ -222,8 +232,8 @@ module Kendama
222
232
 
223
233
  # Gets access_token using access_token_getter or uses the static access_token
224
234
  def access_token_with_refresh
225
- return access_token if access_token_getter.nil?
226
- access_token_getter.call
235
+ return access_token if access_token_getter.nil?
236
+ access_token_getter.call
227
237
  end
228
238
 
229
239
  # Gets Basic Auth token string
@@ -290,5 +300,6 @@ module Kendama
290
300
  url
291
301
  end
292
302
 
303
+
293
304
  end
294
305
  end