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.
- checksums.yaml +7 -0
- data/.openapi-generator/FILES +48 -0
- data/.openapi-generator/VERSION +1 -0
- data/.openapi-generator-ignore +30 -0
- data/.rspec +3 -0
- data/.rubocop.yml +13 -0
- data/CHANGELOG.md +3 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +64 -0
- data/LICENSE.txt +21 -0
- data/README.md +121 -0
- data/Rakefile +12 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/docs/ApiError.md +20 -0
- data/docs/CertificationInfo.md +30 -0
- data/docs/CommendationInfo.md +26 -0
- data/docs/CompatibilityOfChildcareAndWork.md +24 -0
- data/docs/Finance.md +24 -0
- data/docs/GBizINFORESTAPIApi.md +678 -0
- data/docs/GBizINFORESTAPIPeriodSpecifiedSearchApi.md +591 -0
- data/docs/HojinInfo.md +76 -0
- data/docs/HojinInfoResponse.md +24 -0
- data/docs/HojinInfoUpdateInfoResponse.md +30 -0
- data/docs/MajorShareholders.md +20 -0
- data/docs/ManagementIndex.md +66 -0
- data/docs/PatentInfo.md +26 -0
- data/docs/ProcurementInfo.md +26 -0
- data/docs/SubsidyInfo.md +32 -0
- data/docs/WomenActivityInfos.md +28 -0
- data/docs/WorkplaceBaseInfos.md +28 -0
- data/docs/WorkplaceInfoBean.md +22 -0
- data/gbizinfo.gemspec +37 -0
- data/git_push.sh +57 -0
- data/lib/gbizinfo/api/g_biz_inforestapi_api.rb +748 -0
- data/lib/gbizinfo/api/g_biz_inforestapi_period_specified_search_api.rb +670 -0
- data/lib/gbizinfo/api_client.rb +391 -0
- data/lib/gbizinfo/api_error.rb +58 -0
- data/lib/gbizinfo/configuration.rb +290 -0
- data/lib/gbizinfo/models/api_error.rb +225 -0
- data/lib/gbizinfo/models/certification_info.rb +275 -0
- data/lib/gbizinfo/models/commendation_info.rb +255 -0
- data/lib/gbizinfo/models/compatibility_of_childcare_and_work.rb +245 -0
- data/lib/gbizinfo/models/finance.rb +249 -0
- data/lib/gbizinfo/models/hojin_info.rb +515 -0
- data/lib/gbizinfo/models/hojin_info_response.rb +249 -0
- data/lib/gbizinfo/models/hojin_info_update_info_response.rb +279 -0
- data/lib/gbizinfo/models/major_shareholders.rb +225 -0
- data/lib/gbizinfo/models/management_index.rb +455 -0
- data/lib/gbizinfo/models/patent_info.rb +257 -0
- data/lib/gbizinfo/models/procurement_info.rb +257 -0
- data/lib/gbizinfo/models/subsidy_info.rb +287 -0
- data/lib/gbizinfo/models/women_activity_infos.rb +265 -0
- data/lib/gbizinfo/models/workplace_base_infos.rb +265 -0
- data/lib/gbizinfo/models/workplace_info_bean.rb +232 -0
- data/lib/gbizinfo/version.rb +15 -0
- data/lib/gbizinfo.rb +57 -0
- data/openapi/root.yaml +1377 -0
- data/sig/gbizinfo.rbs +4 -0
- metadata +105 -0
@@ -0,0 +1,515 @@
|
|
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 HojinInfo
|
18
|
+
# 全省庁統一資格の営業品目
|
19
|
+
attr_accessor :business_items
|
20
|
+
|
21
|
+
# 事業概要
|
22
|
+
attr_accessor :business_summary
|
23
|
+
|
24
|
+
# 資本金
|
25
|
+
attr_accessor :capital_stock
|
26
|
+
|
27
|
+
# 届出・認定情報
|
28
|
+
attr_accessor :certification
|
29
|
+
|
30
|
+
# 登記記録の閉鎖等の事由
|
31
|
+
attr_accessor :close_cause
|
32
|
+
|
33
|
+
# 登記記録の閉鎖等年月日
|
34
|
+
attr_accessor :close_date
|
35
|
+
|
36
|
+
# 表彰情報
|
37
|
+
attr_accessor :commendation
|
38
|
+
|
39
|
+
# 企業規模詳細(女)
|
40
|
+
attr_accessor :company_size_female
|
41
|
+
|
42
|
+
# 企業規模詳細(男)
|
43
|
+
attr_accessor :company_size_male
|
44
|
+
|
45
|
+
# 企業ホームページ
|
46
|
+
attr_accessor :company_url
|
47
|
+
|
48
|
+
# 法人番号
|
49
|
+
attr_accessor :corporate_number
|
50
|
+
|
51
|
+
# 設立年月日
|
52
|
+
attr_accessor :date_of_establishment
|
53
|
+
|
54
|
+
# 従業員数
|
55
|
+
attr_accessor :employee_number
|
56
|
+
|
57
|
+
attr_accessor :finance
|
58
|
+
|
59
|
+
# 創業年
|
60
|
+
attr_accessor :founding_year
|
61
|
+
|
62
|
+
# 法人名フリガナ
|
63
|
+
attr_accessor :kana
|
64
|
+
|
65
|
+
# 本社所在地
|
66
|
+
attr_accessor :location
|
67
|
+
|
68
|
+
# 法人名
|
69
|
+
attr_accessor :name
|
70
|
+
|
71
|
+
# 法人名英語
|
72
|
+
attr_accessor :name_en
|
73
|
+
|
74
|
+
# 法人活動情報件数
|
75
|
+
attr_accessor :number_of_activity
|
76
|
+
|
77
|
+
# 特許情報
|
78
|
+
attr_accessor :patent
|
79
|
+
|
80
|
+
# 郵便番号
|
81
|
+
attr_accessor :postal_code
|
82
|
+
|
83
|
+
# 調達情報
|
84
|
+
attr_accessor :procurement
|
85
|
+
|
86
|
+
# 全省庁統一資格の資格等級(物品の製造、物品の販売、役務の提供等、物品の買受け)
|
87
|
+
attr_accessor :qualification_grade
|
88
|
+
|
89
|
+
# 法人代表者名
|
90
|
+
attr_accessor :representative_name
|
91
|
+
|
92
|
+
# 法人代表者役職
|
93
|
+
attr_accessor :representative_position
|
94
|
+
|
95
|
+
# ステータス
|
96
|
+
attr_accessor :status
|
97
|
+
|
98
|
+
# 補助金情報
|
99
|
+
attr_accessor :subsidy
|
100
|
+
|
101
|
+
# 最終更新日
|
102
|
+
attr_accessor :update_date
|
103
|
+
|
104
|
+
attr_accessor :workplace_info
|
105
|
+
|
106
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
107
|
+
def self.attribute_map
|
108
|
+
{
|
109
|
+
:'business_items' => :'business_items',
|
110
|
+
:'business_summary' => :'business_summary',
|
111
|
+
:'capital_stock' => :'capital_stock',
|
112
|
+
:'certification' => :'certification',
|
113
|
+
:'close_cause' => :'close_cause',
|
114
|
+
:'close_date' => :'close_date',
|
115
|
+
:'commendation' => :'commendation',
|
116
|
+
:'company_size_female' => :'company_size_female',
|
117
|
+
:'company_size_male' => :'company_size_male',
|
118
|
+
:'company_url' => :'company_url',
|
119
|
+
:'corporate_number' => :'corporate_number',
|
120
|
+
:'date_of_establishment' => :'date_of_establishment',
|
121
|
+
:'employee_number' => :'employee_number',
|
122
|
+
:'finance' => :'finance',
|
123
|
+
:'founding_year' => :'founding_year',
|
124
|
+
:'kana' => :'kana',
|
125
|
+
:'location' => :'location',
|
126
|
+
:'name' => :'name',
|
127
|
+
:'name_en' => :'name_en',
|
128
|
+
:'number_of_activity' => :'number_of_activity',
|
129
|
+
:'patent' => :'patent',
|
130
|
+
:'postal_code' => :'postal_code',
|
131
|
+
:'procurement' => :'procurement',
|
132
|
+
:'qualification_grade' => :'qualification_grade',
|
133
|
+
:'representative_name' => :'representative_name',
|
134
|
+
:'representative_position' => :'representative_position',
|
135
|
+
:'status' => :'status',
|
136
|
+
:'subsidy' => :'subsidy',
|
137
|
+
:'update_date' => :'update_date',
|
138
|
+
:'workplace_info' => :'workplace_info'
|
139
|
+
}
|
140
|
+
end
|
141
|
+
|
142
|
+
# Returns all the JSON keys this model knows about
|
143
|
+
def self.acceptable_attributes
|
144
|
+
attribute_map.values
|
145
|
+
end
|
146
|
+
|
147
|
+
# Attribute type mapping.
|
148
|
+
def self.openapi_types
|
149
|
+
{
|
150
|
+
:'business_items' => :'Array<String>',
|
151
|
+
:'business_summary' => :'String',
|
152
|
+
:'capital_stock' => :'Integer',
|
153
|
+
:'certification' => :'Array<CertificationInfo>',
|
154
|
+
:'close_cause' => :'String',
|
155
|
+
:'close_date' => :'String',
|
156
|
+
:'commendation' => :'Array<CommendationInfo>',
|
157
|
+
:'company_size_female' => :'Integer',
|
158
|
+
:'company_size_male' => :'Integer',
|
159
|
+
:'company_url' => :'String',
|
160
|
+
:'corporate_number' => :'String',
|
161
|
+
:'date_of_establishment' => :'String',
|
162
|
+
:'employee_number' => :'Integer',
|
163
|
+
:'finance' => :'Finance',
|
164
|
+
:'founding_year' => :'Integer',
|
165
|
+
:'kana' => :'String',
|
166
|
+
:'location' => :'String',
|
167
|
+
:'name' => :'String',
|
168
|
+
:'name_en' => :'String',
|
169
|
+
:'number_of_activity' => :'String',
|
170
|
+
:'patent' => :'Array<PatentInfo>',
|
171
|
+
:'postal_code' => :'String',
|
172
|
+
:'procurement' => :'Array<ProcurementInfo>',
|
173
|
+
:'qualification_grade' => :'String',
|
174
|
+
:'representative_name' => :'String',
|
175
|
+
:'representative_position' => :'String',
|
176
|
+
:'status' => :'String',
|
177
|
+
:'subsidy' => :'Array<SubsidyInfo>',
|
178
|
+
:'update_date' => :'String',
|
179
|
+
:'workplace_info' => :'WorkplaceInfoBean'
|
180
|
+
}
|
181
|
+
end
|
182
|
+
|
183
|
+
# List of attributes with nullable: true
|
184
|
+
def self.openapi_nullable
|
185
|
+
Set.new([
|
186
|
+
])
|
187
|
+
end
|
188
|
+
|
189
|
+
# Initializes the object
|
190
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
191
|
+
def initialize(attributes = {})
|
192
|
+
if (!attributes.is_a?(Hash))
|
193
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Gbizinfo::HojinInfo` initialize method"
|
194
|
+
end
|
195
|
+
|
196
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
197
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
198
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
199
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Gbizinfo::HojinInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
200
|
+
end
|
201
|
+
h[k.to_sym] = v
|
202
|
+
}
|
203
|
+
|
204
|
+
if attributes.key?(:'business_items')
|
205
|
+
if (value = attributes[:'business_items']).is_a?(Array)
|
206
|
+
self.business_items = value
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
if attributes.key?(:'business_summary')
|
211
|
+
self.business_summary = attributes[:'business_summary']
|
212
|
+
end
|
213
|
+
|
214
|
+
if attributes.key?(:'capital_stock')
|
215
|
+
self.capital_stock = attributes[:'capital_stock']
|
216
|
+
end
|
217
|
+
|
218
|
+
if attributes.key?(:'certification')
|
219
|
+
if (value = attributes[:'certification']).is_a?(Array)
|
220
|
+
self.certification = value
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
if attributes.key?(:'close_cause')
|
225
|
+
self.close_cause = attributes[:'close_cause']
|
226
|
+
end
|
227
|
+
|
228
|
+
if attributes.key?(:'close_date')
|
229
|
+
self.close_date = attributes[:'close_date']
|
230
|
+
end
|
231
|
+
|
232
|
+
if attributes.key?(:'commendation')
|
233
|
+
if (value = attributes[:'commendation']).is_a?(Array)
|
234
|
+
self.commendation = value
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
if attributes.key?(:'company_size_female')
|
239
|
+
self.company_size_female = attributes[:'company_size_female']
|
240
|
+
end
|
241
|
+
|
242
|
+
if attributes.key?(:'company_size_male')
|
243
|
+
self.company_size_male = attributes[:'company_size_male']
|
244
|
+
end
|
245
|
+
|
246
|
+
if attributes.key?(:'company_url')
|
247
|
+
self.company_url = attributes[:'company_url']
|
248
|
+
end
|
249
|
+
|
250
|
+
if attributes.key?(:'corporate_number')
|
251
|
+
self.corporate_number = attributes[:'corporate_number']
|
252
|
+
end
|
253
|
+
|
254
|
+
if attributes.key?(:'date_of_establishment')
|
255
|
+
self.date_of_establishment = attributes[:'date_of_establishment']
|
256
|
+
end
|
257
|
+
|
258
|
+
if attributes.key?(:'employee_number')
|
259
|
+
self.employee_number = attributes[:'employee_number']
|
260
|
+
end
|
261
|
+
|
262
|
+
if attributes.key?(:'finance')
|
263
|
+
self.finance = attributes[:'finance']
|
264
|
+
end
|
265
|
+
|
266
|
+
if attributes.key?(:'founding_year')
|
267
|
+
self.founding_year = attributes[:'founding_year']
|
268
|
+
end
|
269
|
+
|
270
|
+
if attributes.key?(:'kana')
|
271
|
+
self.kana = attributes[:'kana']
|
272
|
+
end
|
273
|
+
|
274
|
+
if attributes.key?(:'location')
|
275
|
+
self.location = attributes[:'location']
|
276
|
+
end
|
277
|
+
|
278
|
+
if attributes.key?(:'name')
|
279
|
+
self.name = attributes[:'name']
|
280
|
+
end
|
281
|
+
|
282
|
+
if attributes.key?(:'name_en')
|
283
|
+
self.name_en = attributes[:'name_en']
|
284
|
+
end
|
285
|
+
|
286
|
+
if attributes.key?(:'number_of_activity')
|
287
|
+
self.number_of_activity = attributes[:'number_of_activity']
|
288
|
+
end
|
289
|
+
|
290
|
+
if attributes.key?(:'patent')
|
291
|
+
if (value = attributes[:'patent']).is_a?(Array)
|
292
|
+
self.patent = value
|
293
|
+
end
|
294
|
+
end
|
295
|
+
|
296
|
+
if attributes.key?(:'postal_code')
|
297
|
+
self.postal_code = attributes[:'postal_code']
|
298
|
+
end
|
299
|
+
|
300
|
+
if attributes.key?(:'procurement')
|
301
|
+
if (value = attributes[:'procurement']).is_a?(Array)
|
302
|
+
self.procurement = value
|
303
|
+
end
|
304
|
+
end
|
305
|
+
|
306
|
+
if attributes.key?(:'qualification_grade')
|
307
|
+
self.qualification_grade = attributes[:'qualification_grade']
|
308
|
+
end
|
309
|
+
|
310
|
+
if attributes.key?(:'representative_name')
|
311
|
+
self.representative_name = attributes[:'representative_name']
|
312
|
+
end
|
313
|
+
|
314
|
+
if attributes.key?(:'representative_position')
|
315
|
+
self.representative_position = attributes[:'representative_position']
|
316
|
+
end
|
317
|
+
|
318
|
+
if attributes.key?(:'status')
|
319
|
+
self.status = attributes[:'status']
|
320
|
+
end
|
321
|
+
|
322
|
+
if attributes.key?(:'subsidy')
|
323
|
+
if (value = attributes[:'subsidy']).is_a?(Array)
|
324
|
+
self.subsidy = value
|
325
|
+
end
|
326
|
+
end
|
327
|
+
|
328
|
+
if attributes.key?(:'update_date')
|
329
|
+
self.update_date = attributes[:'update_date']
|
330
|
+
end
|
331
|
+
|
332
|
+
if attributes.key?(:'workplace_info')
|
333
|
+
self.workplace_info = attributes[:'workplace_info']
|
334
|
+
end
|
335
|
+
end
|
336
|
+
|
337
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
338
|
+
# @return Array for valid properties with the reasons
|
339
|
+
def list_invalid_properties
|
340
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
341
|
+
invalid_properties = Array.new
|
342
|
+
invalid_properties
|
343
|
+
end
|
344
|
+
|
345
|
+
# Check to see if the all the properties in the model are valid
|
346
|
+
# @return true if the model is valid
|
347
|
+
def valid?
|
348
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
349
|
+
true
|
350
|
+
end
|
351
|
+
|
352
|
+
# Checks equality by comparing each attribute.
|
353
|
+
# @param [Object] Object to be compared
|
354
|
+
def ==(o)
|
355
|
+
return true if self.equal?(o)
|
356
|
+
self.class == o.class &&
|
357
|
+
business_items == o.business_items &&
|
358
|
+
business_summary == o.business_summary &&
|
359
|
+
capital_stock == o.capital_stock &&
|
360
|
+
certification == o.certification &&
|
361
|
+
close_cause == o.close_cause &&
|
362
|
+
close_date == o.close_date &&
|
363
|
+
commendation == o.commendation &&
|
364
|
+
company_size_female == o.company_size_female &&
|
365
|
+
company_size_male == o.company_size_male &&
|
366
|
+
company_url == o.company_url &&
|
367
|
+
corporate_number == o.corporate_number &&
|
368
|
+
date_of_establishment == o.date_of_establishment &&
|
369
|
+
employee_number == o.employee_number &&
|
370
|
+
finance == o.finance &&
|
371
|
+
founding_year == o.founding_year &&
|
372
|
+
kana == o.kana &&
|
373
|
+
location == o.location &&
|
374
|
+
name == o.name &&
|
375
|
+
name_en == o.name_en &&
|
376
|
+
number_of_activity == o.number_of_activity &&
|
377
|
+
patent == o.patent &&
|
378
|
+
postal_code == o.postal_code &&
|
379
|
+
procurement == o.procurement &&
|
380
|
+
qualification_grade == o.qualification_grade &&
|
381
|
+
representative_name == o.representative_name &&
|
382
|
+
representative_position == o.representative_position &&
|
383
|
+
status == o.status &&
|
384
|
+
subsidy == o.subsidy &&
|
385
|
+
update_date == o.update_date &&
|
386
|
+
workplace_info == o.workplace_info
|
387
|
+
end
|
388
|
+
|
389
|
+
# @see the `==` method
|
390
|
+
# @param [Object] Object to be compared
|
391
|
+
def eql?(o)
|
392
|
+
self == o
|
393
|
+
end
|
394
|
+
|
395
|
+
# Calculates hash code according to all attributes.
|
396
|
+
# @return [Integer] Hash code
|
397
|
+
def hash
|
398
|
+
[business_items, business_summary, capital_stock, certification, close_cause, close_date, commendation, company_size_female, company_size_male, company_url, corporate_number, date_of_establishment, employee_number, finance, founding_year, kana, location, name, name_en, number_of_activity, patent, postal_code, procurement, qualification_grade, representative_name, representative_position, status, subsidy, update_date, workplace_info].hash
|
399
|
+
end
|
400
|
+
|
401
|
+
# Builds the object from hash
|
402
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
403
|
+
# @return [Object] Returns the model itself
|
404
|
+
def self.build_from_hash(attributes)
|
405
|
+
return nil unless attributes.is_a?(Hash)
|
406
|
+
attributes = attributes.transform_keys(&:to_sym)
|
407
|
+
transformed_hash = {}
|
408
|
+
openapi_types.each_pair do |key, type|
|
409
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
410
|
+
transformed_hash["#{key}"] = nil
|
411
|
+
elsif type =~ /\AArray<(.*)>/i
|
412
|
+
# check to ensure the input is an array given that the attribute
|
413
|
+
# is documented as an array but the input is not
|
414
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
415
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
416
|
+
end
|
417
|
+
elsif !attributes[attribute_map[key]].nil?
|
418
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
419
|
+
end
|
420
|
+
end
|
421
|
+
new(transformed_hash)
|
422
|
+
end
|
423
|
+
|
424
|
+
# Deserializes the data based on type
|
425
|
+
# @param string type Data type
|
426
|
+
# @param string value Value to be deserialized
|
427
|
+
# @return [Object] Deserialized data
|
428
|
+
def self._deserialize(type, value)
|
429
|
+
case type.to_sym
|
430
|
+
when :Time
|
431
|
+
Time.parse(value)
|
432
|
+
when :Date
|
433
|
+
Date.parse(value)
|
434
|
+
when :String
|
435
|
+
value.to_s
|
436
|
+
when :Integer
|
437
|
+
value.to_i
|
438
|
+
when :Float
|
439
|
+
value.to_f
|
440
|
+
when :Boolean
|
441
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
442
|
+
true
|
443
|
+
else
|
444
|
+
false
|
445
|
+
end
|
446
|
+
when :Object
|
447
|
+
# generic object (usually a Hash), return directly
|
448
|
+
value
|
449
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
450
|
+
inner_type = Regexp.last_match[:inner_type]
|
451
|
+
value.map { |v| _deserialize(inner_type, v) }
|
452
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
453
|
+
k_type = Regexp.last_match[:k_type]
|
454
|
+
v_type = Regexp.last_match[:v_type]
|
455
|
+
{}.tap do |hash|
|
456
|
+
value.each do |k, v|
|
457
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
458
|
+
end
|
459
|
+
end
|
460
|
+
else # model
|
461
|
+
# models (e.g. Pet) or oneOf
|
462
|
+
klass = Gbizinfo.const_get(type)
|
463
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
464
|
+
end
|
465
|
+
end
|
466
|
+
|
467
|
+
# Returns the string representation of the object
|
468
|
+
# @return [String] String presentation of the object
|
469
|
+
def to_s
|
470
|
+
to_hash.to_s
|
471
|
+
end
|
472
|
+
|
473
|
+
# to_body is an alias to to_hash (backward compatibility)
|
474
|
+
# @return [Hash] Returns the object in the form of hash
|
475
|
+
def to_body
|
476
|
+
to_hash
|
477
|
+
end
|
478
|
+
|
479
|
+
# Returns the object in the form of hash
|
480
|
+
# @return [Hash] Returns the object in the form of hash
|
481
|
+
def to_hash
|
482
|
+
hash = {}
|
483
|
+
self.class.attribute_map.each_pair do |attr, param|
|
484
|
+
value = self.send(attr)
|
485
|
+
if value.nil?
|
486
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
487
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
488
|
+
end
|
489
|
+
|
490
|
+
hash[param] = _to_hash(value)
|
491
|
+
end
|
492
|
+
hash
|
493
|
+
end
|
494
|
+
|
495
|
+
# Outputs non-array value in the form of hash
|
496
|
+
# For object, use to_hash. Otherwise, just return the value
|
497
|
+
# @param [Object] value Any valid value
|
498
|
+
# @return [Hash] Returns the value in the form of hash
|
499
|
+
def _to_hash(value)
|
500
|
+
if value.is_a?(Array)
|
501
|
+
value.compact.map { |v| _to_hash(v) }
|
502
|
+
elsif value.is_a?(Hash)
|
503
|
+
{}.tap do |hash|
|
504
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
505
|
+
end
|
506
|
+
elsif value.respond_to? :to_hash
|
507
|
+
value.to_hash
|
508
|
+
else
|
509
|
+
value
|
510
|
+
end
|
511
|
+
end
|
512
|
+
|
513
|
+
end
|
514
|
+
|
515
|
+
end
|