kendama 0.2.3 → 1.0.1

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.
@@ -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.0
6
+ The version of the OpenAPI document: 1.0.1
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)
@@ -3,13 +3,13 @@
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.0
6
+ The version of the OpenAPI document: 1.0.1
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.1'
15
15
  end
data/lib/kendama.rb CHANGED
@@ -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.0
6
+ The version of the OpenAPI document: 1.0.1
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
 
data/openapi/root.yaml ADDED
@@ -0,0 +1,17 @@
1
+ openapi: 3.0.3
2
+ info:
3
+ title: 国税庁API
4
+ description: 国税庁が提供するインボイス制度適格請求書発行事業者公表システムWeb-APIを使用するためのクライアントAPI(https://www.invoice-kohyo.nta.go.jp/web-api/index.html)
5
+ version: 1.0.1
6
+ servers:
7
+ - url: https://kensyo.invoice-kohyo.nta.go.jp/
8
+ description: 検証環境
9
+ - url: https://web-api.invoice-kohyo.nta.go.jp/
10
+ description: 本番環境
11
+ paths:
12
+ "/1/num":
13
+ $ref: "./v1/num.yaml#/paths/~11~1num"
14
+ "/1/diff":
15
+ $ref: "./v1/diff.yaml#/paths/~11~1diff"
16
+ "/1/valid":
17
+ $ref: "./v1/valid.yaml#/paths/~11~1valid"
@@ -0,0 +1,179 @@
1
+ components:
2
+ schemas:
3
+ ResponseBody:
4
+ type: object
5
+ properties:
6
+ lastUpdateDate:
7
+ type: string
8
+ description: 最終更新年月日
9
+ example: "2021-11-01"
10
+ format: date
11
+ count:
12
+ type: string
13
+ description: 総件数
14
+ example: 1
15
+ minLength: 1
16
+ maxLength: 8
17
+ divideNumber:
18
+ type: string
19
+ description: 分割番号
20
+ example: 1
21
+ minLength: 1
22
+ maxLength: 6
23
+ divideSize:
24
+ type: string
25
+ description: 分割数
26
+ example: 1
27
+ minLength: 1
28
+ maxLength: 6
29
+ announcement:
30
+ type: array
31
+ items:
32
+ $ref: "#/components/schemas/Announcement"
33
+
34
+ Announcement:
35
+ type: object
36
+ properties:
37
+ sequenceNumber:
38
+ type: string
39
+ description: 一連番号
40
+ example: 1
41
+ minLength: 1
42
+ maxLength: 8
43
+ registratedNumber:
44
+ type: string
45
+ description: 登録番号
46
+ example: T8040001999011
47
+ process:
48
+ type: string
49
+ description: 事業者処理区分
50
+ example: 01
51
+ enum:
52
+ - "01"
53
+ - "02"
54
+ - "03"
55
+ - "04"
56
+ - "99"
57
+ correct:
58
+ type: string
59
+ description: 訂正区分
60
+ example: 0
61
+ enum:
62
+ - 0
63
+ - 1
64
+ - ""
65
+ kind:
66
+ type: string
67
+ description: 人格区分
68
+ example: 2
69
+ enum:
70
+ - 1
71
+ - 2
72
+ country:
73
+ type: string
74
+ description: 国内外区分
75
+ example: 1
76
+ enum:
77
+ - 1
78
+ - 2
79
+ - 3
80
+ latest:
81
+ type: string
82
+ description: 最新履歴
83
+ example: 1
84
+ enum:
85
+ - 0
86
+ - 1
87
+ registrationDate:
88
+ type: string
89
+ description: 登録年月日
90
+ example: "2023-10-01"
91
+ format: date
92
+ updateDate:
93
+ type: string
94
+ description: 更新年月日
95
+ example: "2021-11-01"
96
+ format: date
97
+ disposalDate:
98
+ type: string
99
+ description: 取消年月日
100
+ expireDate:
101
+ type: string
102
+ description: 失効年月日
103
+ address:
104
+ type: string
105
+ description: 本店又は主たる事務所の所在地(法人)
106
+ example: 北海道札幌市中央区大通西10丁目
107
+ maxLength: 600
108
+ addressPrefectureCode:
109
+ type: string
110
+ description: 本店又は主たる事務所の所在地都道府県コード(法人)
111
+ example: 01
112
+ addressCityCode:
113
+ type: string
114
+ description: 本店又は主たる事務所の所在地市区町村コード(法人)
115
+ example: 101
116
+ addressRequest:
117
+ type: string
118
+ description: 本店又は主たる事務所の所在地(公表申出)
119
+ maxLength: 600
120
+ addressRequestPrefectureCode:
121
+ type: string
122
+ description: 本店又は主たる事務所の所在地都道府県コード(公表申出)
123
+ addressRequestCityCode:
124
+ type: string
125
+ description: 本店又は主たる事務所の所在地市区町村コード(公表申出)
126
+ kana:
127
+ type: string
128
+ description: 日本語(カナ)
129
+ maxLength: 500
130
+ name:
131
+ type: string
132
+ description: 氏名又は名称
133
+ example: 株式会社インボイス公表
134
+ maxLength: 300
135
+ addressInside:
136
+ type: string
137
+ description: 国内において行う資産の譲渡等に係る事務所、事業所その他これらに準ずるものの所在地
138
+ maxLength: 300
139
+ addressInsidePrefectureCode:
140
+ type: string
141
+ description: 国内において行う資産の譲渡等に係る事務所、事業所その他これらに準ずるものの所在地都道府県コード
142
+ addressInsideCityCode:
143
+ type: string
144
+ description: 国内において行う資産の譲渡等に係る事務所、事業所その他これらに準ずるものの所在地市区町村コード
145
+ tradeName:
146
+ type: string
147
+ description: 主たる屋号
148
+ maxLength: 200
149
+ popularName_previousName:
150
+ type: string
151
+ description: 通称・旧姓
152
+ maxLength: 200
153
+ required:
154
+ - sequenceNumber
155
+ - registratedNumber
156
+ - process
157
+ - correct
158
+ - kind
159
+ - country
160
+ - latest
161
+ - registrationDate
162
+ - updateDate
163
+ - disposalDate
164
+ - expireDate
165
+ - address
166
+ - addressPrefectureCode
167
+ - addressCityCode
168
+ - addressRequest
169
+ - addressRequestPrefectureCode
170
+ - addressRequestCityCode
171
+ - kana
172
+ - name
173
+ - addressInside
174
+ - addressInsidePrefectureCod
175
+ - addressInsideCityCode
176
+ - tradeName
177
+ - popularName_previousName
178
+ - required
179
+
@@ -0,0 +1,87 @@
1
+ openapi: 3.0.3
2
+ info:
3
+ title: 国税庁API
4
+ description: 国税庁が提供するインボイス制度適格請求書発行事業者公表システムWeb-APIを使用するためのクライアントAPI(https://www.invoice-kohyo.nta.go.jp/web-api/index.html)
5
+ version: 1.0.1
6
+ paths:
7
+ "/1/diff":
8
+ get:
9
+ operationId: getAnnouncementByDiff
10
+ summary: 取得期間を指定して情報を取得
11
+ description: 取得期間を指定し、当該期間内に「更新年月日」が含まれる公表情報を取得
12
+ tags:
13
+ - v1
14
+ parameters:
15
+ - $ref: "#/components/parameters/Id"
16
+ - $ref: "#/components/parameters/From"
17
+ - $ref: "#/components/parameters/To"
18
+ - $ref: "#/components/parameters/Type"
19
+ - $ref: "#/components/parameters/Division"
20
+ - $ref: "#/components/parameters/Divide"
21
+ responses:
22
+ "200":
23
+ description: 成功
24
+ content:
25
+ application/json:
26
+ schema:
27
+ $ref: "./announcement.yaml#/components/schemas/ResponseBody"
28
+
29
+ components:
30
+ parameters:
31
+ Id:
32
+ in: query
33
+ name: id
34
+ required: true
35
+ schema:
36
+ type: string
37
+ description: アプリケーションID
38
+ From:
39
+ in: query
40
+ name: from
41
+ required: true
42
+ schema:
43
+ type: string
44
+ description: 取得期間開始日
45
+ example: "2024-10-01"
46
+ format: date
47
+ To:
48
+ in: query
49
+ name: to
50
+ required: true
51
+ schema:
52
+ type: string
53
+ description: 取得期間終了日
54
+ example: "2024-10-01"
55
+ format: date
56
+ Type:
57
+ in: query
58
+ name: type
59
+ required: true
60
+ schema:
61
+ type: string
62
+ description: 応答形式
63
+ example: 21
64
+ enum:
65
+ # - 01
66
+ # - 11
67
+ - 21
68
+ default: 21
69
+ Division:
70
+ in: query
71
+ name: division
72
+ schema:
73
+ type: string
74
+ description: 人格区分
75
+ default: 1
76
+ enum:
77
+ - 1
78
+ - 2
79
+ Divide:
80
+ in: query
81
+ name: divide
82
+ schema:
83
+ type: string
84
+ description: 分割番号
85
+ default: 1
86
+ minLength: 1
87
+ maxLength: 999999
@@ -0,0 +1,66 @@
1
+ openapi: 3.0.3
2
+ info:
3
+ title: 国税庁API
4
+ description: 国税庁が提供するインボイス制度適格請求書発行事業者公表システムWeb-APIを使用するためのクライアントAPI(https://www.invoice-kohyo.nta.go.jp/web-api/index.html)
5
+ version: 1.0.1
6
+ paths:
7
+ "/1/num":
8
+ get:
9
+ operationId: getAnnouncementByNumber
10
+ summary: 登録番号を指定して情報を取得
11
+ description: 指定された登録番号に係る登録年月日、取消年月日及び失効年月日に紐づく最新情報(履歴情報は任意)を取得
12
+ tags:
13
+ - v1
14
+ parameters:
15
+ - $ref: "#/components/parameters/Id"
16
+ - $ref: "#/components/parameters/Number"
17
+ - $ref: "#/components/parameters/Type"
18
+ - $ref: "#/components/parameters/History"
19
+ responses:
20
+ "200":
21
+ description: 成功
22
+ content:
23
+ application/json:
24
+ schema:
25
+ $ref: "./announcement.yaml#/components/schemas/ResponseBody"
26
+
27
+ components:
28
+ parameters:
29
+ Id:
30
+ in: query
31
+ name: id
32
+ required: true
33
+ schema:
34
+ type: string
35
+ description: アプリケーションID
36
+ Number:
37
+ in: query
38
+ name: number
39
+ required: true
40
+ schema:
41
+ type: string
42
+ description: 登録番号
43
+ example: T8040001999011
44
+ Type:
45
+ in: query
46
+ name: type
47
+ required: true
48
+ schema:
49
+ type: string
50
+ description: 応答形式
51
+ example: 21
52
+ enum:
53
+ # - 01
54
+ # - 11
55
+ - 21
56
+ default: 21
57
+ History:
58
+ in: query
59
+ name: history
60
+ schema:
61
+ type: string
62
+ description: 履歴情報要否
63
+ example: 0
64
+ enum:
65
+ - 0
66
+ - 1
@@ -0,0 +1,65 @@
1
+ openapi: 3.0.3
2
+ info:
3
+ title: 国税庁API
4
+ description: 国税庁が提供するインボイス制度適格請求書発行事業者公表システムWeb-APIを使用するためのクライアントAPI(https://www.invoice-kohyo.nta.go.jp/web-api/index.html)
5
+ version: 1.0.1
6
+ paths:
7
+ "/1/valid":
8
+ get:
9
+ operationId: getAnnouncementByValid
10
+ summary: 登録番号と日付を指定して情報を取得
11
+ description: 登録番号及び指定された日付を基準日とした直近の登録年月日、取消年月日、失効年月日に紐づく情報を取得
12
+ tags:
13
+ - v1
14
+ parameters:
15
+ - $ref: "#/components/parameters/Id"
16
+ - $ref: "#/components/parameters/Number"
17
+ - $ref: "#/components/parameters/Day"
18
+ - $ref: "#/components/parameters/Type"
19
+ responses:
20
+ "200":
21
+ description: 成功
22
+ content:
23
+ application/json:
24
+ schema:
25
+ $ref: "./announcement.yaml#/components/schemas/ResponseBody"
26
+
27
+ components:
28
+ parameters:
29
+ Id:
30
+ in: query
31
+ name: id
32
+ required: true
33
+ schema:
34
+ type: string
35
+ description: アプリケーションID
36
+ Number:
37
+ in: query
38
+ name: number
39
+ required: true
40
+ schema:
41
+ type: string
42
+ description: 登録番号
43
+ example: T8040001999011
44
+ Day:
45
+ in: query
46
+ name: day
47
+ required: true
48
+ schema:
49
+ type: string
50
+ description: 判定基準日
51
+ example: "2023-12-01"
52
+ format: date
53
+ Type:
54
+ in: query
55
+ name: type
56
+ required: true
57
+ schema:
58
+ type: string
59
+ description: 応答形式
60
+ example: 21
61
+ enum:
62
+ # - 01
63
+ # - 11
64
+ - 21
65
+ default: 21
Binary file
Binary file
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #国税庁API
3
3
 
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ #国税庁が提供するインボイス制度適格請求書発行事業者公表システムWeb-APIを使用するためのクライアントAPI(https://www.invoice-kohyo.nta.go.jp/web-api/index.html)
5
5
 
6
- The version of the OpenAPI document: 0.1.0
6
+ The version of the OpenAPI document: 1.0.1
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
 
@@ -32,6 +32,23 @@ describe 'V1Api' do
32
32
  end
33
33
  end
34
34
 
35
+ # unit tests for get_announcement_by_diff
36
+ # 取得期間を指定して情報を取得
37
+ # 取得期間を指定し、当該期間内に「更新年月日」が含まれる公表情報を取得
38
+ # @param id
39
+ # @param from
40
+ # @param to
41
+ # @param type
42
+ # @param [Hash] opts the optional parameters
43
+ # @option opts [String] :division
44
+ # @option opts [String] :divide
45
+ # @return [ResponseBody]
46
+ describe 'get_announcement_by_diff test' do
47
+ it 'should work' do
48
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
49
+ end
50
+ end
51
+
35
52
  # unit tests for get_announcement_by_number
36
53
  # 登録番号を指定して情報を取得
37
54
  # 指定された登録番号に係る登録年月日、取消年月日及び失効年月日に紐づく最新情報(履歴情報は任意)を取得
@@ -47,4 +64,19 @@ describe 'V1Api' do
47
64
  end
48
65
  end
49
66
 
67
+ # unit tests for get_announcement_by_valid
68
+ # 登録番号と日付を指定して情報を取得
69
+ # 登録番号及び指定された日付を基準日とした直近の登録年月日、取消年月日、失効年月日に紐づく情報を取得
70
+ # @param id
71
+ # @param number
72
+ # @param day
73
+ # @param type
74
+ # @param [Hash] opts the optional parameters
75
+ # @return [ResponseBody]
76
+ describe 'get_announcement_by_valid test' do
77
+ it 'should work' do
78
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
79
+ end
80
+ end
81
+
50
82
  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.0
6
+ The version of the OpenAPI document: 1.0.1
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
 
@@ -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.0
6
+ The version of the OpenAPI document: 1.0.1
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