change_healthcare-eligibility 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/.gitignore +11 -0
- data/.rspec +3 -0
- data/.rubocop.yml +130 -0
- data/.ruby-version +1 -0
- data/.travis.yml +7 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +59 -0
- data/LICENSE.txt +21 -0
- data/README.md +64 -0
- data/Rakefile +6 -0
- data/bin/console +11 -0
- data/bin/rspec +29 -0
- data/bin/setup +8 -0
- data/change_healthcare-eligibility.gemspec +44 -0
- data/lib/change_healthcare/eligibility.rb +13 -0
- data/lib/change_healthcare/eligibility/inspector.rb +82 -0
- data/lib/change_healthcare/eligibility/swagger_client.rb +81 -0
- data/lib/change_healthcare/eligibility/swagger_client/api_client.rb +388 -0
- data/lib/change_healthcare/eligibility/swagger_client/api_error.rb +40 -0
- data/lib/change_healthcare/eligibility/swagger_client/configuration.rb +202 -0
- data/lib/change_healthcare/eligibility/swagger_client/eligibility_api.rb +198 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/additional_identification.rb +266 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/additional_information.rb +185 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/address.rb +218 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/benefits_additional_information.rb +376 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/benefits_date_information.rb +340 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb +338 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/benefits_related_entity.rb +240 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/benefits_service_delivery.rb +220 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/composite_medical_procedure_identifier.rb +218 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/eligibility_additional_information.rb +200 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/encounter.rb +359 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/error.rb +205 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/health_care_diagnosis_code.rb +190 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/health_care_information.rb +229 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/health_check.rb +190 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/information_receiver_name.rb +303 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/loop_2000_cd2100_cd_segment_nm1_ref_dmg_ins_mpi_prv_notes_response_member.rb +429 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/loop_2100_a_segments_nm1_and_per_notes_information_source_name.rb +293 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/loop_2100_a_segments_per_element_per03_8_notes_communication.rb +194 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/loop_2100_a_segments_per_notes_information_source_contact_information.rb +198 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/loop_2100_bcd_segment_nm1_prv_notes_provider.rb +322 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/loop_2100_cd_segment_trn_notes_subscriber_trace_numbers.rb +218 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/loop_2110_cd_segments_ref_notes_subscriber_dependent_additional_identification.rb +488 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/medical_eligibility.rb +272 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/medical_procedure.rb +254 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/plan_date_information.rb +340 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/plan_status.rb +204 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/provider.rb +304 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/provider_information.rb +190 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/raw_x12_request.rb +190 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/request_dependent.rb +452 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/request_subscriber.rb +456 -0
- data/lib/change_healthcare/eligibility/swagger_client/models/response.rb +322 -0
- data/lib/change_healthcare/eligibility/swagger_client/version.rb +17 -0
- data/lib/change_healthcare/eligibility/version.rb +5 -0
- data/lib/change_healthcare/eligibility/wrapper.rb +124 -0
- metadata +214 -0
@@ -0,0 +1,240 @@
|
|
1
|
+
# #Eligibility
|
2
|
+
#
|
3
|
+
# Reference for developers
|
4
|
+
#
|
5
|
+
# OpenAPI spec version: v3
|
6
|
+
#
|
7
|
+
# Generated by: https://github.com/swagger-api/swagger-codegen.git
|
8
|
+
# Swagger Codegen version: 2.4.17
|
9
|
+
#
|
10
|
+
|
11
|
+
require 'date'
|
12
|
+
|
13
|
+
module ChangeHealthcare
|
14
|
+
module Eligibility
|
15
|
+
module SwaggerClient
|
16
|
+
class BenefitsRelatedEntity
|
17
|
+
attr_accessor :address, :contact_information, :entity_firstname, :entity_identification, :entity_identification_value, :entity_identifier, :entity_middlename, :entity_name, :entity_relationship, :entity_suffix, :entity_type, :provider_information
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
'address': :address,
|
23
|
+
'contact_information': :contactInformation,
|
24
|
+
'entity_firstname': :entityFirstname,
|
25
|
+
'entity_identification': :entityIdentification,
|
26
|
+
'entity_identification_value': :entityIdentificationValue,
|
27
|
+
'entity_identifier': :entityIdentifier,
|
28
|
+
'entity_middlename': :entityMiddlename,
|
29
|
+
'entity_name': :entityName,
|
30
|
+
'entity_relationship': :entityRelationship,
|
31
|
+
'entity_suffix': :entitySuffix,
|
32
|
+
'entity_type': :entityType,
|
33
|
+
'provider_information': :providerInformation
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Attribute type mapping.
|
38
|
+
def self.swagger_types
|
39
|
+
{
|
40
|
+
'address': :Address,
|
41
|
+
'contact_information': :Loop2100ASegmentsPERNotesInformationSourceContactInformation,
|
42
|
+
'entity_firstname': :String,
|
43
|
+
'entity_identification': :String,
|
44
|
+
'entity_identification_value': :String,
|
45
|
+
'entity_identifier': :String,
|
46
|
+
'entity_middlename': :String,
|
47
|
+
'entity_name': :String,
|
48
|
+
'entity_relationship': :String,
|
49
|
+
'entity_suffix': :String,
|
50
|
+
'entity_type': :String,
|
51
|
+
'provider_information': :ProviderInformation
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
# Initializes the object
|
56
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
57
|
+
def initialize(attributes = {})
|
58
|
+
return unless attributes.is_a?(Hash)
|
59
|
+
|
60
|
+
# convert string to symbol for hash key
|
61
|
+
attributes = attributes.transform_keys(&:to_sym)
|
62
|
+
|
63
|
+
self.address = attributes[:address] if attributes.key?(:address)
|
64
|
+
|
65
|
+
self.contact_information = attributes[:contactInformation] if attributes.key?(:contactInformation)
|
66
|
+
|
67
|
+
self.entity_firstname = attributes[:entityFirstname] if attributes.key?(:entityFirstname)
|
68
|
+
|
69
|
+
self.entity_identification = attributes[:entityIdentification] if attributes.key?(:entityIdentification)
|
70
|
+
|
71
|
+
self.entity_identification_value = attributes[:entityIdentificationValue] if attributes.key?(:entityIdentificationValue)
|
72
|
+
|
73
|
+
self.entity_identifier = attributes[:entityIdentifier] if attributes.key?(:entityIdentifier)
|
74
|
+
|
75
|
+
self.entity_middlename = attributes[:entityMiddlename] if attributes.key?(:entityMiddlename)
|
76
|
+
|
77
|
+
self.entity_name = attributes[:entityName] if attributes.key?(:entityName)
|
78
|
+
|
79
|
+
self.entity_relationship = attributes[:entityRelationship] if attributes.key?(:entityRelationship)
|
80
|
+
|
81
|
+
self.entity_suffix = attributes[:entitySuffix] if attributes.key?(:entitySuffix)
|
82
|
+
|
83
|
+
self.entity_type = attributes[:entityType] if attributes.key?(:entityType)
|
84
|
+
|
85
|
+
self.provider_information = attributes[:providerInformation] if attributes.key?(:providerInformation)
|
86
|
+
end
|
87
|
+
|
88
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
89
|
+
# @return Array for valid properties with the reasons
|
90
|
+
def list_invalid_properties
|
91
|
+
[]
|
92
|
+
end
|
93
|
+
|
94
|
+
# Check to see if the all the properties in the model are valid
|
95
|
+
# @return true if the model is valid
|
96
|
+
def valid?
|
97
|
+
true
|
98
|
+
end
|
99
|
+
|
100
|
+
# Checks equality by comparing each attribute.
|
101
|
+
# @param [Object] Object to be compared
|
102
|
+
def ==(o)
|
103
|
+
return true if equal?(o)
|
104
|
+
|
105
|
+
self.class == o.class &&
|
106
|
+
address == o.address &&
|
107
|
+
contact_information == o.contact_information &&
|
108
|
+
entity_firstname == o.entity_firstname &&
|
109
|
+
entity_identification == o.entity_identification &&
|
110
|
+
entity_identification_value == o.entity_identification_value &&
|
111
|
+
entity_identifier == o.entity_identifier &&
|
112
|
+
entity_middlename == o.entity_middlename &&
|
113
|
+
entity_name == o.entity_name &&
|
114
|
+
entity_relationship == o.entity_relationship &&
|
115
|
+
entity_suffix == o.entity_suffix &&
|
116
|
+
entity_type == o.entity_type &&
|
117
|
+
provider_information == o.provider_information
|
118
|
+
end
|
119
|
+
|
120
|
+
# @see the `==` method
|
121
|
+
# @param [Object] Object to be compared
|
122
|
+
def eql?(o)
|
123
|
+
self == o
|
124
|
+
end
|
125
|
+
|
126
|
+
# Calculates hash code according to all attributes.
|
127
|
+
# @return [Fixnum] Hash code
|
128
|
+
def hash
|
129
|
+
[address, contact_information, entity_firstname, entity_identification, entity_identification_value, entity_identifier, entity_middlename, entity_name, entity_relationship, entity_suffix, entity_type, provider_information].hash
|
130
|
+
end
|
131
|
+
|
132
|
+
# Builds the object from hash
|
133
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
134
|
+
# @return [Object] Returns the model itself
|
135
|
+
def build_from_hash(attributes)
|
136
|
+
return nil unless attributes.is_a?(Hash)
|
137
|
+
|
138
|
+
self.class.swagger_types.each_pair do |key, type|
|
139
|
+
if type =~ /\AArray<(.*)>/i
|
140
|
+
# check to ensure the input is an array given that the attribute
|
141
|
+
# is documented as an array but the input is not
|
142
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
143
|
+
send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(Regexp.last_match(1), v) })
|
144
|
+
end
|
145
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
146
|
+
send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
147
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
148
|
+
end
|
149
|
+
|
150
|
+
self
|
151
|
+
end
|
152
|
+
|
153
|
+
# Deserializes the data based on type
|
154
|
+
# @param string type Data type
|
155
|
+
# @param string value Value to be deserialized
|
156
|
+
# @return [Object] Deserialized data
|
157
|
+
def _deserialize(type, value)
|
158
|
+
case type.to_sym
|
159
|
+
when :DateTime
|
160
|
+
DateTime.parse(value)
|
161
|
+
when :Date
|
162
|
+
Date.parse(value)
|
163
|
+
when :String
|
164
|
+
value.to_s
|
165
|
+
when :Integer
|
166
|
+
value.to_i
|
167
|
+
when :Float
|
168
|
+
value.to_f
|
169
|
+
when :BOOLEAN
|
170
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
171
|
+
true
|
172
|
+
else
|
173
|
+
false
|
174
|
+
end
|
175
|
+
when :Object
|
176
|
+
# generic object (usually a Hash), return directly
|
177
|
+
value
|
178
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
179
|
+
inner_type = Regexp.last_match[:inner_type]
|
180
|
+
value.map { |v| _deserialize(inner_type, v) }
|
181
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
182
|
+
k_type = Regexp.last_match[:k_type]
|
183
|
+
v_type = Regexp.last_match[:v_type]
|
184
|
+
{}.tap do |hash|
|
185
|
+
value.each do |k, v|
|
186
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
else # model
|
190
|
+
temp_model = SwaggerClient.const_get(type).new
|
191
|
+
temp_model.build_from_hash(value)
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
# Returns the string representation of the object
|
196
|
+
# @return [String] String presentation of the object
|
197
|
+
def to_s
|
198
|
+
to_hash.to_s
|
199
|
+
end
|
200
|
+
|
201
|
+
# to_body is an alias to to_hash (backward compatibility)
|
202
|
+
# @return [Hash] Returns the object in the form of hash
|
203
|
+
def to_body
|
204
|
+
to_hash
|
205
|
+
end
|
206
|
+
|
207
|
+
# Returns the object in the form of hash
|
208
|
+
# @return [Hash] Returns the object in the form of hash
|
209
|
+
def to_hash
|
210
|
+
hash = {}
|
211
|
+
self.class.attribute_map.each_pair do |attr, param|
|
212
|
+
value = send(attr)
|
213
|
+
next if value.nil?
|
214
|
+
|
215
|
+
hash[param] = _to_hash(value)
|
216
|
+
end
|
217
|
+
hash
|
218
|
+
end
|
219
|
+
|
220
|
+
# Outputs non-array value in the form of hash
|
221
|
+
# For object, use to_hash. Otherwise, just return the value
|
222
|
+
# @param [Object] value Any valid value
|
223
|
+
# @return [Hash] Returns the value in the form of hash
|
224
|
+
def _to_hash(value)
|
225
|
+
if value.is_a?(Array)
|
226
|
+
value.compact.map { |v| _to_hash(v) }
|
227
|
+
elsif value.is_a?(Hash)
|
228
|
+
{}.tap do |hash|
|
229
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
230
|
+
end
|
231
|
+
elsif value.respond_to? :to_hash
|
232
|
+
value.to_hash
|
233
|
+
else
|
234
|
+
value
|
235
|
+
end
|
236
|
+
end
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
240
|
+
end
|
@@ -0,0 +1,220 @@
|
|
1
|
+
# #Eligibility
|
2
|
+
#
|
3
|
+
# Reference for developers
|
4
|
+
#
|
5
|
+
# OpenAPI spec version: v3
|
6
|
+
#
|
7
|
+
# Generated by: https://github.com/swagger-api/swagger-codegen.git
|
8
|
+
# Swagger Codegen version: 2.4.17
|
9
|
+
#
|
10
|
+
|
11
|
+
require 'date'
|
12
|
+
|
13
|
+
module ChangeHealthcare
|
14
|
+
module Eligibility
|
15
|
+
module SwaggerClient
|
16
|
+
class BenefitsServiceDelivery
|
17
|
+
attr_accessor :delivery_or_calendar_pattern_code, :delivery_pattern_time_code, :num_of_periods, :quantity, :quantity_qualifier, :sample_selection_modulus, :time_period_qualifier, :unit_for_measurement_code
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
'delivery_or_calendar_pattern_code': :deliveryOrCalendarPatternCode,
|
23
|
+
'delivery_pattern_time_code': :deliveryPatternTimeCode,
|
24
|
+
'num_of_periods': :numOfPeriods,
|
25
|
+
'quantity': :quantity,
|
26
|
+
'quantity_qualifier': :quantityQualifier,
|
27
|
+
'sample_selection_modulus': :sampleSelectionModulus,
|
28
|
+
'time_period_qualifier': :timePeriodQualifier,
|
29
|
+
'unit_for_measurement_code': :unitForMeasurementCode
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Attribute type mapping.
|
34
|
+
def self.swagger_types
|
35
|
+
{
|
36
|
+
'delivery_or_calendar_pattern_code': :String,
|
37
|
+
'delivery_pattern_time_code': :String,
|
38
|
+
'num_of_periods': :String,
|
39
|
+
'quantity': :String,
|
40
|
+
'quantity_qualifier': :String,
|
41
|
+
'sample_selection_modulus': :String,
|
42
|
+
'time_period_qualifier': :String,
|
43
|
+
'unit_for_measurement_code': :String
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
# Initializes the object
|
48
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
49
|
+
def initialize(attributes = {})
|
50
|
+
return unless attributes.is_a?(Hash)
|
51
|
+
|
52
|
+
# convert string to symbol for hash key
|
53
|
+
attributes = attributes.transform_keys(&:to_sym)
|
54
|
+
|
55
|
+
self.delivery_or_calendar_pattern_code = attributes[:deliveryOrCalendarPatternCode] if attributes.key?(:deliveryOrCalendarPatternCode)
|
56
|
+
|
57
|
+
self.delivery_pattern_time_code = attributes[:deliveryPatternTimeCode] if attributes.key?(:deliveryPatternTimeCode)
|
58
|
+
|
59
|
+
self.num_of_periods = attributes[:numOfPeriods] if attributes.key?(:numOfPeriods)
|
60
|
+
|
61
|
+
self.quantity = attributes[:quantity] if attributes.key?(:quantity)
|
62
|
+
|
63
|
+
self.quantity_qualifier = attributes[:quantityQualifier] if attributes.key?(:quantityQualifier)
|
64
|
+
|
65
|
+
self.sample_selection_modulus = attributes[:sampleSelectionModulus] if attributes.key?(:sampleSelectionModulus)
|
66
|
+
|
67
|
+
self.time_period_qualifier = attributes[:timePeriodQualifier] if attributes.key?(:timePeriodQualifier)
|
68
|
+
|
69
|
+
self.unit_for_measurement_code = attributes[:unitForMeasurementCode] if attributes.key?(:unitForMeasurementCode)
|
70
|
+
end
|
71
|
+
|
72
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
73
|
+
# @return Array for valid properties with the reasons
|
74
|
+
def list_invalid_properties
|
75
|
+
[]
|
76
|
+
end
|
77
|
+
|
78
|
+
# Check to see if the all the properties in the model are valid
|
79
|
+
# @return true if the model is valid
|
80
|
+
def valid?
|
81
|
+
true
|
82
|
+
end
|
83
|
+
|
84
|
+
# Checks equality by comparing each attribute.
|
85
|
+
# @param [Object] Object to be compared
|
86
|
+
def ==(o)
|
87
|
+
return true if equal?(o)
|
88
|
+
|
89
|
+
self.class == o.class &&
|
90
|
+
delivery_or_calendar_pattern_code == o.delivery_or_calendar_pattern_code &&
|
91
|
+
delivery_pattern_time_code == o.delivery_pattern_time_code &&
|
92
|
+
num_of_periods == o.num_of_periods &&
|
93
|
+
quantity == o.quantity &&
|
94
|
+
quantity_qualifier == o.quantity_qualifier &&
|
95
|
+
sample_selection_modulus == o.sample_selection_modulus &&
|
96
|
+
time_period_qualifier == o.time_period_qualifier &&
|
97
|
+
unit_for_measurement_code == o.unit_for_measurement_code
|
98
|
+
end
|
99
|
+
|
100
|
+
# @see the `==` method
|
101
|
+
# @param [Object] Object to be compared
|
102
|
+
def eql?(o)
|
103
|
+
self == o
|
104
|
+
end
|
105
|
+
|
106
|
+
# Calculates hash code according to all attributes.
|
107
|
+
# @return [Fixnum] Hash code
|
108
|
+
def hash
|
109
|
+
[delivery_or_calendar_pattern_code, delivery_pattern_time_code, num_of_periods, quantity, quantity_qualifier, sample_selection_modulus, time_period_qualifier, unit_for_measurement_code].hash
|
110
|
+
end
|
111
|
+
|
112
|
+
# Builds the object from hash
|
113
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
114
|
+
# @return [Object] Returns the model itself
|
115
|
+
def build_from_hash(attributes)
|
116
|
+
return nil unless attributes.is_a?(Hash)
|
117
|
+
|
118
|
+
self.class.swagger_types.each_pair do |key, type|
|
119
|
+
if type =~ /\AArray<(.*)>/i
|
120
|
+
# check to ensure the input is an array given that the attribute
|
121
|
+
# is documented as an array but the input is not
|
122
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
123
|
+
send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(Regexp.last_match(1), v) })
|
124
|
+
end
|
125
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
126
|
+
send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
127
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
128
|
+
end
|
129
|
+
|
130
|
+
self
|
131
|
+
end
|
132
|
+
|
133
|
+
# Deserializes the data based on type
|
134
|
+
# @param string type Data type
|
135
|
+
# @param string value Value to be deserialized
|
136
|
+
# @return [Object] Deserialized data
|
137
|
+
def _deserialize(type, value)
|
138
|
+
case type.to_sym
|
139
|
+
when :DateTime
|
140
|
+
DateTime.parse(value)
|
141
|
+
when :Date
|
142
|
+
Date.parse(value)
|
143
|
+
when :String
|
144
|
+
value.to_s
|
145
|
+
when :Integer
|
146
|
+
value.to_i
|
147
|
+
when :Float
|
148
|
+
value.to_f
|
149
|
+
when :BOOLEAN
|
150
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
151
|
+
true
|
152
|
+
else
|
153
|
+
false
|
154
|
+
end
|
155
|
+
when :Object
|
156
|
+
# generic object (usually a Hash), return directly
|
157
|
+
value
|
158
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
159
|
+
inner_type = Regexp.last_match[:inner_type]
|
160
|
+
value.map { |v| _deserialize(inner_type, v) }
|
161
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
162
|
+
k_type = Regexp.last_match[:k_type]
|
163
|
+
v_type = Regexp.last_match[:v_type]
|
164
|
+
{}.tap do |hash|
|
165
|
+
value.each do |k, v|
|
166
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
167
|
+
end
|
168
|
+
end
|
169
|
+
else # model
|
170
|
+
temp_model = SwaggerClient.const_get(type).new
|
171
|
+
temp_model.build_from_hash(value)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
# Returns the string representation of the object
|
176
|
+
# @return [String] String presentation of the object
|
177
|
+
def to_s
|
178
|
+
to_hash.to_s
|
179
|
+
end
|
180
|
+
|
181
|
+
# to_body is an alias to to_hash (backward compatibility)
|
182
|
+
# @return [Hash] Returns the object in the form of hash
|
183
|
+
def to_body
|
184
|
+
to_hash
|
185
|
+
end
|
186
|
+
|
187
|
+
# Returns the object in the form of hash
|
188
|
+
# @return [Hash] Returns the object in the form of hash
|
189
|
+
def to_hash
|
190
|
+
hash = {}
|
191
|
+
self.class.attribute_map.each_pair do |attr, param|
|
192
|
+
value = send(attr)
|
193
|
+
next if value.nil?
|
194
|
+
|
195
|
+
hash[param] = _to_hash(value)
|
196
|
+
end
|
197
|
+
hash
|
198
|
+
end
|
199
|
+
|
200
|
+
# Outputs non-array value in the form of hash
|
201
|
+
# For object, use to_hash. Otherwise, just return the value
|
202
|
+
# @param [Object] value Any valid value
|
203
|
+
# @return [Hash] Returns the value in the form of hash
|
204
|
+
def _to_hash(value)
|
205
|
+
if value.is_a?(Array)
|
206
|
+
value.compact.map { |v| _to_hash(v) }
|
207
|
+
elsif value.is_a?(Hash)
|
208
|
+
{}.tap do |hash|
|
209
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
210
|
+
end
|
211
|
+
elsif value.respond_to? :to_hash
|
212
|
+
value.to_hash
|
213
|
+
else
|
214
|
+
value
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|