gbizinfo 0.1.0

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.
Files changed (61) hide show
  1. checksums.yaml +7 -0
  2. data/.openapi-generator/FILES +48 -0
  3. data/.openapi-generator/VERSION +1 -0
  4. data/.openapi-generator-ignore +30 -0
  5. data/.rspec +3 -0
  6. data/.rubocop.yml +13 -0
  7. data/CHANGELOG.md +3 -0
  8. data/CODE_OF_CONDUCT.md +84 -0
  9. data/Gemfile +12 -0
  10. data/Gemfile.lock +64 -0
  11. data/LICENSE.txt +21 -0
  12. data/README.md +121 -0
  13. data/Rakefile +12 -0
  14. data/bin/console +15 -0
  15. data/bin/setup +8 -0
  16. data/docs/ApiError.md +20 -0
  17. data/docs/CertificationInfo.md +30 -0
  18. data/docs/CommendationInfo.md +26 -0
  19. data/docs/CompatibilityOfChildcareAndWork.md +24 -0
  20. data/docs/Finance.md +24 -0
  21. data/docs/GBizINFORESTAPIApi.md +678 -0
  22. data/docs/GBizINFORESTAPIPeriodSpecifiedSearchApi.md +591 -0
  23. data/docs/HojinInfo.md +76 -0
  24. data/docs/HojinInfoResponse.md +24 -0
  25. data/docs/HojinInfoUpdateInfoResponse.md +30 -0
  26. data/docs/MajorShareholders.md +20 -0
  27. data/docs/ManagementIndex.md +66 -0
  28. data/docs/PatentInfo.md +26 -0
  29. data/docs/ProcurementInfo.md +26 -0
  30. data/docs/SubsidyInfo.md +32 -0
  31. data/docs/WomenActivityInfos.md +28 -0
  32. data/docs/WorkplaceBaseInfos.md +28 -0
  33. data/docs/WorkplaceInfoBean.md +22 -0
  34. data/gbizinfo.gemspec +37 -0
  35. data/git_push.sh +57 -0
  36. data/lib/gbizinfo/api/g_biz_inforestapi_api.rb +748 -0
  37. data/lib/gbizinfo/api/g_biz_inforestapi_period_specified_search_api.rb +670 -0
  38. data/lib/gbizinfo/api_client.rb +391 -0
  39. data/lib/gbizinfo/api_error.rb +58 -0
  40. data/lib/gbizinfo/configuration.rb +290 -0
  41. data/lib/gbizinfo/models/api_error.rb +225 -0
  42. data/lib/gbizinfo/models/certification_info.rb +275 -0
  43. data/lib/gbizinfo/models/commendation_info.rb +255 -0
  44. data/lib/gbizinfo/models/compatibility_of_childcare_and_work.rb +245 -0
  45. data/lib/gbizinfo/models/finance.rb +249 -0
  46. data/lib/gbizinfo/models/hojin_info.rb +515 -0
  47. data/lib/gbizinfo/models/hojin_info_response.rb +249 -0
  48. data/lib/gbizinfo/models/hojin_info_update_info_response.rb +279 -0
  49. data/lib/gbizinfo/models/major_shareholders.rb +225 -0
  50. data/lib/gbizinfo/models/management_index.rb +455 -0
  51. data/lib/gbizinfo/models/patent_info.rb +257 -0
  52. data/lib/gbizinfo/models/procurement_info.rb +257 -0
  53. data/lib/gbizinfo/models/subsidy_info.rb +287 -0
  54. data/lib/gbizinfo/models/women_activity_infos.rb +265 -0
  55. data/lib/gbizinfo/models/workplace_base_infos.rb +265 -0
  56. data/lib/gbizinfo/models/workplace_info_bean.rb +232 -0
  57. data/lib/gbizinfo/version.rb +15 -0
  58. data/lib/gbizinfo.rb +57 -0
  59. data/openapi/root.yaml +1377 -0
  60. data/sig/gbizinfo.rbs +4 -0
  61. metadata +105 -0
@@ -0,0 +1,275 @@
1
+ =begin
2
+ #gBizINFO REST API
3
+
4
+ #<div>各REST APIはHTTPリクエストヘッダX-hojinInfo-api-tokenに動作確認用のAPIトークンDTcLxzo1lZaUYaQPVdSRxdS4MzlXNCs4を指定して動作を確認することができます。</div><div>※動作確認用のAPIトークンはこのページでの動作確認でのみ使用してください。</div><div>※REST APIを利用する際は必ず、<a href='https://info.gbiz.go.jp/hojin/api_registration/form'>Web API利用申請</a>を行い、APIトークンを取得してください。</div>
5
+
6
+ The version of the OpenAPI document: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.0.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Gbizinfo
17
+ class CertificationInfo
18
+ # 部門
19
+ attr_accessor :category
20
+
21
+ # 認定日
22
+ attr_accessor :date_of_approval
23
+
24
+ # 企業規模
25
+ attr_accessor :enterprise_scale
26
+
27
+ # 有効期限
28
+ attr_accessor :expiration_date
29
+
30
+ # 府省
31
+ attr_accessor :government_departments
32
+
33
+ # 対象
34
+ attr_accessor :target
35
+
36
+ # 届出認定等
37
+ attr_accessor :title
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'category' => :'category',
43
+ :'date_of_approval' => :'date_of_approval',
44
+ :'enterprise_scale' => :'enterprise_scale',
45
+ :'expiration_date' => :'expiration_date',
46
+ :'government_departments' => :'government_departments',
47
+ :'target' => :'target',
48
+ :'title' => :'title'
49
+ }
50
+ end
51
+
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'category' => :'String',
61
+ :'date_of_approval' => :'String',
62
+ :'enterprise_scale' => :'String',
63
+ :'expiration_date' => :'String',
64
+ :'government_departments' => :'String',
65
+ :'target' => :'String',
66
+ :'title' => :'String'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Gbizinfo::CertificationInfo` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!self.class.attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Gbizinfo::CertificationInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ if attributes.key?(:'category')
92
+ self.category = attributes[:'category']
93
+ end
94
+
95
+ if attributes.key?(:'date_of_approval')
96
+ self.date_of_approval = attributes[:'date_of_approval']
97
+ end
98
+
99
+ if attributes.key?(:'enterprise_scale')
100
+ self.enterprise_scale = attributes[:'enterprise_scale']
101
+ end
102
+
103
+ if attributes.key?(:'expiration_date')
104
+ self.expiration_date = attributes[:'expiration_date']
105
+ end
106
+
107
+ if attributes.key?(:'government_departments')
108
+ self.government_departments = attributes[:'government_departments']
109
+ end
110
+
111
+ if attributes.key?(:'target')
112
+ self.target = attributes[:'target']
113
+ end
114
+
115
+ if attributes.key?(:'title')
116
+ self.title = attributes[:'title']
117
+ end
118
+ end
119
+
120
+ # Show invalid properties with the reasons. Usually used together with valid?
121
+ # @return Array for valid properties with the reasons
122
+ def list_invalid_properties
123
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
124
+ invalid_properties = Array.new
125
+ invalid_properties
126
+ end
127
+
128
+ # Check to see if the all the properties in the model are valid
129
+ # @return true if the model is valid
130
+ def valid?
131
+ warn '[DEPRECATED] the `valid?` method is obsolete'
132
+ true
133
+ end
134
+
135
+ # Checks equality by comparing each attribute.
136
+ # @param [Object] Object to be compared
137
+ def ==(o)
138
+ return true if self.equal?(o)
139
+ self.class == o.class &&
140
+ category == o.category &&
141
+ date_of_approval == o.date_of_approval &&
142
+ enterprise_scale == o.enterprise_scale &&
143
+ expiration_date == o.expiration_date &&
144
+ government_departments == o.government_departments &&
145
+ target == o.target &&
146
+ title == o.title
147
+ end
148
+
149
+ # @see the `==` method
150
+ # @param [Object] Object to be compared
151
+ def eql?(o)
152
+ self == o
153
+ end
154
+
155
+ # Calculates hash code according to all attributes.
156
+ # @return [Integer] Hash code
157
+ def hash
158
+ [category, date_of_approval, enterprise_scale, expiration_date, government_departments, target, title].hash
159
+ end
160
+
161
+ # Builds the object from hash
162
+ # @param [Hash] attributes Model attributes in the form of hash
163
+ # @return [Object] Returns the model itself
164
+ def self.build_from_hash(attributes)
165
+ return nil unless attributes.is_a?(Hash)
166
+ attributes = attributes.transform_keys(&:to_sym)
167
+ transformed_hash = {}
168
+ openapi_types.each_pair do |key, type|
169
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
170
+ transformed_hash["#{key}"] = nil
171
+ elsif type =~ /\AArray<(.*)>/i
172
+ # check to ensure the input is an array given that the attribute
173
+ # is documented as an array but the input is not
174
+ if attributes[attribute_map[key]].is_a?(Array)
175
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
176
+ end
177
+ elsif !attributes[attribute_map[key]].nil?
178
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
179
+ end
180
+ end
181
+ new(transformed_hash)
182
+ end
183
+
184
+ # Deserializes the data based on type
185
+ # @param string type Data type
186
+ # @param string value Value to be deserialized
187
+ # @return [Object] Deserialized data
188
+ def self._deserialize(type, value)
189
+ case type.to_sym
190
+ when :Time
191
+ Time.parse(value)
192
+ when :Date
193
+ Date.parse(value)
194
+ when :String
195
+ value.to_s
196
+ when :Integer
197
+ value.to_i
198
+ when :Float
199
+ value.to_f
200
+ when :Boolean
201
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
202
+ true
203
+ else
204
+ false
205
+ end
206
+ when :Object
207
+ # generic object (usually a Hash), return directly
208
+ value
209
+ when /\AArray<(?<inner_type>.+)>\z/
210
+ inner_type = Regexp.last_match[:inner_type]
211
+ value.map { |v| _deserialize(inner_type, v) }
212
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
213
+ k_type = Regexp.last_match[:k_type]
214
+ v_type = Regexp.last_match[:v_type]
215
+ {}.tap do |hash|
216
+ value.each do |k, v|
217
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
218
+ end
219
+ end
220
+ else # model
221
+ # models (e.g. Pet) or oneOf
222
+ klass = Gbizinfo.const_get(type)
223
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
224
+ end
225
+ end
226
+
227
+ # Returns the string representation of the object
228
+ # @return [String] String presentation of the object
229
+ def to_s
230
+ to_hash.to_s
231
+ end
232
+
233
+ # to_body is an alias to to_hash (backward compatibility)
234
+ # @return [Hash] Returns the object in the form of hash
235
+ def to_body
236
+ to_hash
237
+ end
238
+
239
+ # Returns the object in the form of hash
240
+ # @return [Hash] Returns the object in the form of hash
241
+ def to_hash
242
+ hash = {}
243
+ self.class.attribute_map.each_pair do |attr, param|
244
+ value = self.send(attr)
245
+ if value.nil?
246
+ is_nullable = self.class.openapi_nullable.include?(attr)
247
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
248
+ end
249
+
250
+ hash[param] = _to_hash(value)
251
+ end
252
+ hash
253
+ end
254
+
255
+ # Outputs non-array value in the form of hash
256
+ # For object, use to_hash. Otherwise, just return the value
257
+ # @param [Object] value Any valid value
258
+ # @return [Hash] Returns the value in the form of hash
259
+ def _to_hash(value)
260
+ if value.is_a?(Array)
261
+ value.compact.map { |v| _to_hash(v) }
262
+ elsif value.is_a?(Hash)
263
+ {}.tap do |hash|
264
+ value.each { |k, v| hash[k] = _to_hash(v) }
265
+ end
266
+ elsif value.respond_to? :to_hash
267
+ value.to_hash
268
+ else
269
+ value
270
+ end
271
+ end
272
+
273
+ end
274
+
275
+ end
@@ -0,0 +1,255 @@
1
+ =begin
2
+ #gBizINFO REST API
3
+
4
+ #<div>各REST APIはHTTPリクエストヘッダX-hojinInfo-api-tokenに動作確認用のAPIトークンDTcLxzo1lZaUYaQPVdSRxdS4MzlXNCs4を指定して動作を確認することができます。</div><div>※動作確認用のAPIトークンはこのページでの動作確認でのみ使用してください。</div><div>※REST APIを利用する際は必ず、<a href='https://info.gbiz.go.jp/hojin/api_registration/form'>Web API利用申請</a>を行い、APIトークンを取得してください。</div>
5
+
6
+ The version of the OpenAPI document: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.0.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Gbizinfo
17
+ class CommendationInfo
18
+ # 部門
19
+ attr_accessor :category
20
+
21
+ # 年月日
22
+ attr_accessor :date_of_commendation
23
+
24
+ # 府省
25
+ attr_accessor :government_departments
26
+
27
+ # 受賞対象
28
+ attr_accessor :target
29
+
30
+ # 表彰名
31
+ attr_accessor :title
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'category' => :'category',
37
+ :'date_of_commendation' => :'date_of_commendation',
38
+ :'government_departments' => :'government_departments',
39
+ :'target' => :'target',
40
+ :'title' => :'title'
41
+ }
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'category' => :'String',
53
+ :'date_of_commendation' => :'String',
54
+ :'government_departments' => :'String',
55
+ :'target' => :'String',
56
+ :'title' => :'String'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Gbizinfo::CommendationInfo` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Gbizinfo::CommendationInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'category')
82
+ self.category = attributes[:'category']
83
+ end
84
+
85
+ if attributes.key?(:'date_of_commendation')
86
+ self.date_of_commendation = attributes[:'date_of_commendation']
87
+ end
88
+
89
+ if attributes.key?(:'government_departments')
90
+ self.government_departments = attributes[:'government_departments']
91
+ end
92
+
93
+ if attributes.key?(:'target')
94
+ self.target = attributes[:'target']
95
+ end
96
+
97
+ if attributes.key?(:'title')
98
+ self.title = attributes[:'title']
99
+ end
100
+ end
101
+
102
+ # Show invalid properties with the reasons. Usually used together with valid?
103
+ # @return Array for valid properties with the reasons
104
+ def list_invalid_properties
105
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
106
+ invalid_properties = Array.new
107
+ invalid_properties
108
+ end
109
+
110
+ # Check to see if the all the properties in the model are valid
111
+ # @return true if the model is valid
112
+ def valid?
113
+ warn '[DEPRECATED] the `valid?` method is obsolete'
114
+ true
115
+ end
116
+
117
+ # Checks equality by comparing each attribute.
118
+ # @param [Object] Object to be compared
119
+ def ==(o)
120
+ return true if self.equal?(o)
121
+ self.class == o.class &&
122
+ category == o.category &&
123
+ date_of_commendation == o.date_of_commendation &&
124
+ government_departments == o.government_departments &&
125
+ target == o.target &&
126
+ title == o.title
127
+ end
128
+
129
+ # @see the `==` method
130
+ # @param [Object] Object to be compared
131
+ def eql?(o)
132
+ self == o
133
+ end
134
+
135
+ # Calculates hash code according to all attributes.
136
+ # @return [Integer] Hash code
137
+ def hash
138
+ [category, date_of_commendation, government_departments, target, title].hash
139
+ end
140
+
141
+ # Builds the object from hash
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @return [Object] Returns the model itself
144
+ def self.build_from_hash(attributes)
145
+ return nil unless attributes.is_a?(Hash)
146
+ attributes = attributes.transform_keys(&:to_sym)
147
+ transformed_hash = {}
148
+ openapi_types.each_pair do |key, type|
149
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
150
+ transformed_hash["#{key}"] = nil
151
+ elsif type =~ /\AArray<(.*)>/i
152
+ # check to ensure the input is an array given that the attribute
153
+ # is documented as an array but the input is not
154
+ if attributes[attribute_map[key]].is_a?(Array)
155
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
156
+ end
157
+ elsif !attributes[attribute_map[key]].nil?
158
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
159
+ end
160
+ end
161
+ new(transformed_hash)
162
+ end
163
+
164
+ # Deserializes the data based on type
165
+ # @param string type Data type
166
+ # @param string value Value to be deserialized
167
+ # @return [Object] Deserialized data
168
+ def self._deserialize(type, value)
169
+ case type.to_sym
170
+ when :Time
171
+ Time.parse(value)
172
+ when :Date
173
+ Date.parse(value)
174
+ when :String
175
+ value.to_s
176
+ when :Integer
177
+ value.to_i
178
+ when :Float
179
+ value.to_f
180
+ when :Boolean
181
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
182
+ true
183
+ else
184
+ false
185
+ end
186
+ when :Object
187
+ # generic object (usually a Hash), return directly
188
+ value
189
+ when /\AArray<(?<inner_type>.+)>\z/
190
+ inner_type = Regexp.last_match[:inner_type]
191
+ value.map { |v| _deserialize(inner_type, v) }
192
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
193
+ k_type = Regexp.last_match[:k_type]
194
+ v_type = Regexp.last_match[:v_type]
195
+ {}.tap do |hash|
196
+ value.each do |k, v|
197
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
198
+ end
199
+ end
200
+ else # model
201
+ # models (e.g. Pet) or oneOf
202
+ klass = Gbizinfo.const_get(type)
203
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
204
+ end
205
+ end
206
+
207
+ # Returns the string representation of the object
208
+ # @return [String] String presentation of the object
209
+ def to_s
210
+ to_hash.to_s
211
+ end
212
+
213
+ # to_body is an alias to to_hash (backward compatibility)
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_body
216
+ to_hash
217
+ end
218
+
219
+ # Returns the object in the form of hash
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_hash
222
+ hash = {}
223
+ self.class.attribute_map.each_pair do |attr, param|
224
+ value = self.send(attr)
225
+ if value.nil?
226
+ is_nullable = self.class.openapi_nullable.include?(attr)
227
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
228
+ end
229
+
230
+ hash[param] = _to_hash(value)
231
+ end
232
+ hash
233
+ end
234
+
235
+ # Outputs non-array value in the form of hash
236
+ # For object, use to_hash. Otherwise, just return the value
237
+ # @param [Object] value Any valid value
238
+ # @return [Hash] Returns the value in the form of hash
239
+ def _to_hash(value)
240
+ if value.is_a?(Array)
241
+ value.compact.map { |v| _to_hash(v) }
242
+ elsif value.is_a?(Hash)
243
+ {}.tap do |hash|
244
+ value.each { |k, v| hash[k] = _to_hash(v) }
245
+ end
246
+ elsif value.respond_to? :to_hash
247
+ value.to_hash
248
+ else
249
+ value
250
+ end
251
+ end
252
+
253
+ end
254
+
255
+ end