gbizinfo 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- 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,257 @@
|
|
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 PatentInfo
|
18
|
+
# 出願年月日
|
19
|
+
attr_accessor :application_date
|
20
|
+
|
21
|
+
# 出願番号
|
22
|
+
attr_accessor :application_number
|
23
|
+
|
24
|
+
# 分類
|
25
|
+
attr_accessor :classifications
|
26
|
+
|
27
|
+
# 特許/意匠/商標
|
28
|
+
attr_accessor :patent_type
|
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
|
+
:'application_date' => :'application_date',
|
37
|
+
:'application_number' => :'application_number',
|
38
|
+
:'classifications' => :'classifications',
|
39
|
+
:'patent_type' => :'patent_type',
|
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
|
+
:'application_date' => :'String',
|
53
|
+
:'application_number' => :'String',
|
54
|
+
:'classifications' => :'Array<Hash>',
|
55
|
+
:'patent_type' => :'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::PatentInfo` 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::PatentInfo`. 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?(:'application_date')
|
82
|
+
self.application_date = attributes[:'application_date']
|
83
|
+
end
|
84
|
+
|
85
|
+
if attributes.key?(:'application_number')
|
86
|
+
self.application_number = attributes[:'application_number']
|
87
|
+
end
|
88
|
+
|
89
|
+
if attributes.key?(:'classifications')
|
90
|
+
if (value = attributes[:'classifications']).is_a?(Array)
|
91
|
+
self.classifications = value
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
if attributes.key?(:'patent_type')
|
96
|
+
self.patent_type = attributes[:'patent_type']
|
97
|
+
end
|
98
|
+
|
99
|
+
if attributes.key?(:'title')
|
100
|
+
self.title = attributes[:'title']
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
105
|
+
# @return Array for valid properties with the reasons
|
106
|
+
def list_invalid_properties
|
107
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
108
|
+
invalid_properties = Array.new
|
109
|
+
invalid_properties
|
110
|
+
end
|
111
|
+
|
112
|
+
# Check to see if the all the properties in the model are valid
|
113
|
+
# @return true if the model is valid
|
114
|
+
def valid?
|
115
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
116
|
+
true
|
117
|
+
end
|
118
|
+
|
119
|
+
# Checks equality by comparing each attribute.
|
120
|
+
# @param [Object] Object to be compared
|
121
|
+
def ==(o)
|
122
|
+
return true if self.equal?(o)
|
123
|
+
self.class == o.class &&
|
124
|
+
application_date == o.application_date &&
|
125
|
+
application_number == o.application_number &&
|
126
|
+
classifications == o.classifications &&
|
127
|
+
patent_type == o.patent_type &&
|
128
|
+
title == o.title
|
129
|
+
end
|
130
|
+
|
131
|
+
# @see the `==` method
|
132
|
+
# @param [Object] Object to be compared
|
133
|
+
def eql?(o)
|
134
|
+
self == o
|
135
|
+
end
|
136
|
+
|
137
|
+
# Calculates hash code according to all attributes.
|
138
|
+
# @return [Integer] Hash code
|
139
|
+
def hash
|
140
|
+
[application_date, application_number, classifications, patent_type, title].hash
|
141
|
+
end
|
142
|
+
|
143
|
+
# Builds the object from hash
|
144
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
145
|
+
# @return [Object] Returns the model itself
|
146
|
+
def self.build_from_hash(attributes)
|
147
|
+
return nil unless attributes.is_a?(Hash)
|
148
|
+
attributes = attributes.transform_keys(&:to_sym)
|
149
|
+
transformed_hash = {}
|
150
|
+
openapi_types.each_pair do |key, type|
|
151
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
152
|
+
transformed_hash["#{key}"] = nil
|
153
|
+
elsif type =~ /\AArray<(.*)>/i
|
154
|
+
# check to ensure the input is an array given that the attribute
|
155
|
+
# is documented as an array but the input is not
|
156
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
157
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
158
|
+
end
|
159
|
+
elsif !attributes[attribute_map[key]].nil?
|
160
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
161
|
+
end
|
162
|
+
end
|
163
|
+
new(transformed_hash)
|
164
|
+
end
|
165
|
+
|
166
|
+
# Deserializes the data based on type
|
167
|
+
# @param string type Data type
|
168
|
+
# @param string value Value to be deserialized
|
169
|
+
# @return [Object] Deserialized data
|
170
|
+
def self._deserialize(type, value)
|
171
|
+
case type.to_sym
|
172
|
+
when :Time
|
173
|
+
Time.parse(value)
|
174
|
+
when :Date
|
175
|
+
Date.parse(value)
|
176
|
+
when :String
|
177
|
+
value.to_s
|
178
|
+
when :Integer
|
179
|
+
value.to_i
|
180
|
+
when :Float
|
181
|
+
value.to_f
|
182
|
+
when :Boolean
|
183
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
184
|
+
true
|
185
|
+
else
|
186
|
+
false
|
187
|
+
end
|
188
|
+
when :Object
|
189
|
+
# generic object (usually a Hash), return directly
|
190
|
+
value
|
191
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
192
|
+
inner_type = Regexp.last_match[:inner_type]
|
193
|
+
value.map { |v| _deserialize(inner_type, v) }
|
194
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
195
|
+
k_type = Regexp.last_match[:k_type]
|
196
|
+
v_type = Regexp.last_match[:v_type]
|
197
|
+
{}.tap do |hash|
|
198
|
+
value.each do |k, v|
|
199
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
200
|
+
end
|
201
|
+
end
|
202
|
+
else # model
|
203
|
+
# models (e.g. Pet) or oneOf
|
204
|
+
klass = Gbizinfo.const_get(type)
|
205
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
# Returns the string representation of the object
|
210
|
+
# @return [String] String presentation of the object
|
211
|
+
def to_s
|
212
|
+
to_hash.to_s
|
213
|
+
end
|
214
|
+
|
215
|
+
# to_body is an alias to to_hash (backward compatibility)
|
216
|
+
# @return [Hash] Returns the object in the form of hash
|
217
|
+
def to_body
|
218
|
+
to_hash
|
219
|
+
end
|
220
|
+
|
221
|
+
# Returns the object in the form of hash
|
222
|
+
# @return [Hash] Returns the object in the form of hash
|
223
|
+
def to_hash
|
224
|
+
hash = {}
|
225
|
+
self.class.attribute_map.each_pair do |attr, param|
|
226
|
+
value = self.send(attr)
|
227
|
+
if value.nil?
|
228
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
229
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
230
|
+
end
|
231
|
+
|
232
|
+
hash[param] = _to_hash(value)
|
233
|
+
end
|
234
|
+
hash
|
235
|
+
end
|
236
|
+
|
237
|
+
# Outputs non-array value in the form of hash
|
238
|
+
# For object, use to_hash. Otherwise, just return the value
|
239
|
+
# @param [Object] value Any valid value
|
240
|
+
# @return [Hash] Returns the value in the form of hash
|
241
|
+
def _to_hash(value)
|
242
|
+
if value.is_a?(Array)
|
243
|
+
value.compact.map { |v| _to_hash(v) }
|
244
|
+
elsif value.is_a?(Hash)
|
245
|
+
{}.tap do |hash|
|
246
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
247
|
+
end
|
248
|
+
elsif value.respond_to? :to_hash
|
249
|
+
value.to_hash
|
250
|
+
else
|
251
|
+
value
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
end
|
256
|
+
|
257
|
+
end
|
@@ -0,0 +1,257 @@
|
|
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 ProcurementInfo
|
18
|
+
# 金額
|
19
|
+
attr_accessor :amount
|
20
|
+
|
21
|
+
# 受注日
|
22
|
+
attr_accessor :date_of_order
|
23
|
+
|
24
|
+
# 府省
|
25
|
+
attr_accessor :government_departments
|
26
|
+
|
27
|
+
# 連名
|
28
|
+
attr_accessor :joint_signatures
|
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
|
+
:'amount' => :'amount',
|
37
|
+
:'date_of_order' => :'date_of_order',
|
38
|
+
:'government_departments' => :'government_departments',
|
39
|
+
:'joint_signatures' => :'joint_signatures',
|
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
|
+
:'amount' => :'Integer',
|
53
|
+
:'date_of_order' => :'String',
|
54
|
+
:'government_departments' => :'String',
|
55
|
+
:'joint_signatures' => :'Array<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::ProcurementInfo` 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::ProcurementInfo`. 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?(:'amount')
|
82
|
+
self.amount = attributes[:'amount']
|
83
|
+
end
|
84
|
+
|
85
|
+
if attributes.key?(:'date_of_order')
|
86
|
+
self.date_of_order = attributes[:'date_of_order']
|
87
|
+
end
|
88
|
+
|
89
|
+
if attributes.key?(:'government_departments')
|
90
|
+
self.government_departments = attributes[:'government_departments']
|
91
|
+
end
|
92
|
+
|
93
|
+
if attributes.key?(:'joint_signatures')
|
94
|
+
if (value = attributes[:'joint_signatures']).is_a?(Array)
|
95
|
+
self.joint_signatures = value
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
if attributes.key?(:'title')
|
100
|
+
self.title = attributes[:'title']
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
105
|
+
# @return Array for valid properties with the reasons
|
106
|
+
def list_invalid_properties
|
107
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
108
|
+
invalid_properties = Array.new
|
109
|
+
invalid_properties
|
110
|
+
end
|
111
|
+
|
112
|
+
# Check to see if the all the properties in the model are valid
|
113
|
+
# @return true if the model is valid
|
114
|
+
def valid?
|
115
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
116
|
+
true
|
117
|
+
end
|
118
|
+
|
119
|
+
# Checks equality by comparing each attribute.
|
120
|
+
# @param [Object] Object to be compared
|
121
|
+
def ==(o)
|
122
|
+
return true if self.equal?(o)
|
123
|
+
self.class == o.class &&
|
124
|
+
amount == o.amount &&
|
125
|
+
date_of_order == o.date_of_order &&
|
126
|
+
government_departments == o.government_departments &&
|
127
|
+
joint_signatures == o.joint_signatures &&
|
128
|
+
title == o.title
|
129
|
+
end
|
130
|
+
|
131
|
+
# @see the `==` method
|
132
|
+
# @param [Object] Object to be compared
|
133
|
+
def eql?(o)
|
134
|
+
self == o
|
135
|
+
end
|
136
|
+
|
137
|
+
# Calculates hash code according to all attributes.
|
138
|
+
# @return [Integer] Hash code
|
139
|
+
def hash
|
140
|
+
[amount, date_of_order, government_departments, joint_signatures, title].hash
|
141
|
+
end
|
142
|
+
|
143
|
+
# Builds the object from hash
|
144
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
145
|
+
# @return [Object] Returns the model itself
|
146
|
+
def self.build_from_hash(attributes)
|
147
|
+
return nil unless attributes.is_a?(Hash)
|
148
|
+
attributes = attributes.transform_keys(&:to_sym)
|
149
|
+
transformed_hash = {}
|
150
|
+
openapi_types.each_pair do |key, type|
|
151
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
152
|
+
transformed_hash["#{key}"] = nil
|
153
|
+
elsif type =~ /\AArray<(.*)>/i
|
154
|
+
# check to ensure the input is an array given that the attribute
|
155
|
+
# is documented as an array but the input is not
|
156
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
157
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
158
|
+
end
|
159
|
+
elsif !attributes[attribute_map[key]].nil?
|
160
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
161
|
+
end
|
162
|
+
end
|
163
|
+
new(transformed_hash)
|
164
|
+
end
|
165
|
+
|
166
|
+
# Deserializes the data based on type
|
167
|
+
# @param string type Data type
|
168
|
+
# @param string value Value to be deserialized
|
169
|
+
# @return [Object] Deserialized data
|
170
|
+
def self._deserialize(type, value)
|
171
|
+
case type.to_sym
|
172
|
+
when :Time
|
173
|
+
Time.parse(value)
|
174
|
+
when :Date
|
175
|
+
Date.parse(value)
|
176
|
+
when :String
|
177
|
+
value.to_s
|
178
|
+
when :Integer
|
179
|
+
value.to_i
|
180
|
+
when :Float
|
181
|
+
value.to_f
|
182
|
+
when :Boolean
|
183
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
184
|
+
true
|
185
|
+
else
|
186
|
+
false
|
187
|
+
end
|
188
|
+
when :Object
|
189
|
+
# generic object (usually a Hash), return directly
|
190
|
+
value
|
191
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
192
|
+
inner_type = Regexp.last_match[:inner_type]
|
193
|
+
value.map { |v| _deserialize(inner_type, v) }
|
194
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
195
|
+
k_type = Regexp.last_match[:k_type]
|
196
|
+
v_type = Regexp.last_match[:v_type]
|
197
|
+
{}.tap do |hash|
|
198
|
+
value.each do |k, v|
|
199
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
200
|
+
end
|
201
|
+
end
|
202
|
+
else # model
|
203
|
+
# models (e.g. Pet) or oneOf
|
204
|
+
klass = Gbizinfo.const_get(type)
|
205
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
# Returns the string representation of the object
|
210
|
+
# @return [String] String presentation of the object
|
211
|
+
def to_s
|
212
|
+
to_hash.to_s
|
213
|
+
end
|
214
|
+
|
215
|
+
# to_body is an alias to to_hash (backward compatibility)
|
216
|
+
# @return [Hash] Returns the object in the form of hash
|
217
|
+
def to_body
|
218
|
+
to_hash
|
219
|
+
end
|
220
|
+
|
221
|
+
# Returns the object in the form of hash
|
222
|
+
# @return [Hash] Returns the object in the form of hash
|
223
|
+
def to_hash
|
224
|
+
hash = {}
|
225
|
+
self.class.attribute_map.each_pair do |attr, param|
|
226
|
+
value = self.send(attr)
|
227
|
+
if value.nil?
|
228
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
229
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
230
|
+
end
|
231
|
+
|
232
|
+
hash[param] = _to_hash(value)
|
233
|
+
end
|
234
|
+
hash
|
235
|
+
end
|
236
|
+
|
237
|
+
# Outputs non-array value in the form of hash
|
238
|
+
# For object, use to_hash. Otherwise, just return the value
|
239
|
+
# @param [Object] value Any valid value
|
240
|
+
# @return [Hash] Returns the value in the form of hash
|
241
|
+
def _to_hash(value)
|
242
|
+
if value.is_a?(Array)
|
243
|
+
value.compact.map { |v| _to_hash(v) }
|
244
|
+
elsif value.is_a?(Hash)
|
245
|
+
{}.tap do |hash|
|
246
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
247
|
+
end
|
248
|
+
elsif value.respond_to? :to_hash
|
249
|
+
value.to_hash
|
250
|
+
else
|
251
|
+
value
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
end
|
256
|
+
|
257
|
+
end
|