change_healthcare-professional_claims 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +12 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yml +30 -0
  5. data/.travis.yml +6 -0
  6. data/.yardopts +1 -0
  7. data/CHANGELOG.md +0 -0
  8. data/Gemfile +6 -0
  9. data/Gemfile.lock +118 -0
  10. data/LICENSE.txt +21 -0
  11. data/README.md +39 -0
  12. data/Rakefile +8 -0
  13. data/TODO.md +8 -0
  14. data/bin/console +15 -0
  15. data/bin/rspec +29 -0
  16. data/bin/setup +8 -0
  17. data/change_healthcare-professional_claims.gemspec +43 -0
  18. data/lib/change_healthcare/professional_claims.rb +16 -0
  19. data/lib/change_healthcare/professional_claims/swagger_client.rb +106 -0
  20. data/lib/change_healthcare/professional_claims/swagger_client/api_client.rb +390 -0
  21. data/lib/change_healthcare/professional_claims/swagger_client/api_error.rb +42 -0
  22. data/lib/change_healthcare/professional_claims/swagger_client/configuration.rb +204 -0
  23. data/lib/change_healthcare/professional_claims/swagger_client/models/address.rb +219 -0
  24. data/lib/change_healthcare/professional_claims/swagger_client/models/ambulance_certification.rb +247 -0
  25. data/lib/change_healthcare/professional_claims/swagger_client/models/ambulance_transport_information.rb +259 -0
  26. data/lib/change_healthcare/professional_claims/swagger_client/models/clai_request.rb +283 -0
  27. data/lib/change_healthcare/professional_claims/swagger_client/models/claim_adjustment.rb +244 -0
  28. data/lib/change_healthcare/professional_claims/swagger_client/models/claim_adjustment_details.rb +199 -0
  29. data/lib/change_healthcare/professional_claims/swagger_client/models/claim_contract_information.rb +265 -0
  30. data/lib/change_healthcare/professional_claims/swagger_client/models/claim_date_information.rb +298 -0
  31. data/lib/change_healthcare/professional_claims/swagger_client/models/claim_information.rb +579 -0
  32. data/lib/change_healthcare/professional_claims/swagger_client/models/claim_note.rb +216 -0
  33. data/lib/change_healthcare/professional_claims/swagger_client/models/claim_pricing_repricing_information.rb +363 -0
  34. data/lib/change_healthcare/professional_claims/swagger_client/models/claim_reference.rb +231 -0
  35. data/lib/change_healthcare/professional_claims/swagger_client/models/claim_submission_request.rb +278 -0
  36. data/lib/change_healthcare/professional_claims/swagger_client/models/claim_supplemental_information.rb +315 -0
  37. data/lib/change_healthcare/professional_claims/swagger_client/models/composite_diagnosis_code_pointers.rb +191 -0
  38. data/lib/change_healthcare/professional_claims/swagger_client/models/condition_indicator_durable_medical_equipment.rb +281 -0
  39. data/lib/change_healthcare/professional_claims/swagger_client/models/condition_information.rb +190 -0
  40. data/lib/change_healthcare/professional_claims/swagger_client/models/contact_information.rb +209 -0
  41. data/lib/change_healthcare/professional_claims/swagger_client/models/contract_information.rb +255 -0
  42. data/lib/change_healthcare/professional_claims/swagger_client/models/dependent.rb +294 -0
  43. data/lib/change_healthcare/professional_claims/swagger_client/models/drug_identification.rb +278 -0
  44. data/lib/change_healthcare/professional_claims/swagger_client/models/durable_medical_equipment_certificate_of_medical_necessity.rb +226 -0
  45. data/lib/change_healthcare/professional_claims/swagger_client/models/durable_medical_equipment_certification.rb +233 -0
  46. data/lib/change_healthcare/professional_claims/swagger_client/models/durable_medical_equipment_service.rb +243 -0
  47. data/lib/change_healthcare/professional_claims/swagger_client/models/edit_response.rb +251 -0
  48. data/lib/change_healthcare/professional_claims/swagger_client/models/epsdt_referral.rb +236 -0
  49. data/lib/change_healthcare/professional_claims/swagger_client/models/error.rb +214 -0
  50. data/lib/change_healthcare/professional_claims/swagger_client/models/failure.rb +194 -0
  51. data/lib/change_healthcare/professional_claims/swagger_client/models/form_identification.rb +240 -0
  52. data/lib/change_healthcare/professional_claims/swagger_client/models/health_care_information.rb +233 -0
  53. data/lib/change_healthcare/professional_claims/swagger_client/models/line_adjudication_information.rb +284 -0
  54. data/lib/change_healthcare/professional_claims/swagger_client/models/measurements.rb +256 -0
  55. data/lib/change_healthcare/professional_claims/swagger_client/models/medicare_outpatient_adjudication.rb +213 -0
  56. data/lib/change_healthcare/professional_claims/swagger_client/models/other_payer_billing_provider.rb +236 -0
  57. data/lib/change_healthcare/professional_claims/swagger_client/models/other_payer_name.rb +285 -0
  58. data/lib/change_healthcare/professional_claims/swagger_client/models/other_payer_referring_provider.rb +192 -0
  59. data/lib/change_healthcare/professional_claims/swagger_client/models/other_payer_rendering_provider.rb +236 -0
  60. data/lib/change_healthcare/professional_claims/swagger_client/models/other_payer_service_facility_location.rb +192 -0
  61. data/lib/change_healthcare/professional_claims/swagger_client/models/other_payer_supervising_provider.rb +192 -0
  62. data/lib/change_healthcare/professional_claims/swagger_client/models/other_subscriber_information.rb +430 -0
  63. data/lib/change_healthcare/professional_claims/swagger_client/models/other_subscriber_name.rb +288 -0
  64. data/lib/change_healthcare/professional_claims/swagger_client/models/patient_condition_information_vision.rb +259 -0
  65. data/lib/change_healthcare/professional_claims/swagger_client/models/pay_to_plan.rb +278 -0
  66. data/lib/change_healthcare/professional_claims/swagger_client/models/payer.rb +194 -0
  67. data/lib/change_healthcare/professional_claims/swagger_client/models/prior_authorization.rb +194 -0
  68. data/lib/change_healthcare/professional_claims/swagger_client/models/professional_service.rb +290 -0
  69. data/lib/change_healthcare/professional_claims/swagger_client/models/provider.rb +281 -0
  70. data/lib/change_healthcare/professional_claims/swagger_client/models/purchased_service_information.rb +194 -0
  71. data/lib/change_healthcare/professional_claims/swagger_client/models/raw_x12_request.rb +194 -0
  72. data/lib/change_healthcare/professional_claims/swagger_client/models/receiver.rb +189 -0
  73. data/lib/change_healthcare/professional_claims/swagger_client/models/reference_identification.rb +199 -0
  74. data/lib/change_healthcare/professional_claims/swagger_client/models/report_information.rb +261 -0
  75. data/lib/change_healthcare/professional_claims/swagger_client/models/response.rb +240 -0
  76. data/lib/change_healthcare/professional_claims/swagger_client/models/service_facility_location.rb +224 -0
  77. data/lib/change_healthcare/professional_claims/swagger_client/models/service_line.rb +388 -0
  78. data/lib/change_healthcare/professional_claims/swagger_client/models/service_line_date_information.rb +236 -0
  79. data/lib/change_healthcare/professional_claims/swagger_client/models/service_line_provider.rb +293 -0
  80. data/lib/change_healthcare/professional_claims/swagger_client/models/service_line_reference_information.rb +230 -0
  81. data/lib/change_healthcare/professional_claims/swagger_client/models/spinal_manipulation_service_information.rb +238 -0
  82. data/lib/change_healthcare/professional_claims/swagger_client/models/submitter.rb +209 -0
  83. data/lib/change_healthcare/professional_claims/swagger_client/models/subscriber.rb +309 -0
  84. data/lib/change_healthcare/professional_claims/swagger_client/models/supporting_documentation.rb +249 -0
  85. data/lib/change_healthcare/professional_claims/swagger_client/professional_claims_api.rb +361 -0
  86. data/lib/change_healthcare/professional_claims/swagger_client/version.rb +19 -0
  87. data/lib/change_healthcare/professional_claims/version.rb +7 -0
  88. data/lib/change_healthcare/professional_claims/wrapper.rb +141 -0
  89. metadata +274 -0
@@ -0,0 +1,288 @@
1
+ # frozen_string_literal: true
2
+
3
+ # #Medical Network Professional Claims v3
4
+ #
5
+ # Reference for developers
6
+ #
7
+ # OpenAPI spec version: v3
8
+ #
9
+ # Generated by: https://github.com/swagger-api/swagger-codegen.git
10
+ # Swagger Codegen version: 2.4.19
11
+ #
12
+
13
+ require 'date'
14
+
15
+ module ChangeHealthcare
16
+ module ProfessionalClaims
17
+ module SwaggerClient
18
+ class OtherSubscriberName
19
+ attr_accessor :other_insured_additional_identifier, :other_insured_address, :other_insured_first_name,
20
+ :other_insured_identifier, :other_insured_last_name, :other_insured_middle_name, :other_insured_name_suffix
21
+
22
+ # Allowed Values are: 'II' Standard Unique Health Identifier for each Individual in the United States, 'MI' Member Identification Number
23
+ attr_accessor :other_insured_identifier_type_code
24
+
25
+ # Allowed Values are: '1' Person, '2' Non-Person Entity
26
+ attr_accessor :other_insured_qualifier
27
+
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype, :allowable_values
30
+
31
+ def initialize(datatype, allowable_values)
32
+ @allowable_values = allowable_values.map do |value|
33
+ case datatype.to_s
34
+ when /Integer/i
35
+ value.to_i
36
+ when /Float/i
37
+ value.to_f
38
+ else
39
+ value
40
+ end
41
+ end
42
+ end
43
+
44
+ def valid?(value)
45
+ !value || allowable_values.include?(value)
46
+ end
47
+ end
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ other_insured_additional_identifier: :otherInsuredAdditionalIdentifier,
53
+ other_insured_address: :otherInsuredAddress,
54
+ other_insured_first_name: :otherInsuredFirstName,
55
+ other_insured_identifier: :otherInsuredIdentifier,
56
+ other_insured_identifier_type_code: :otherInsuredIdentifierTypeCode,
57
+ other_insured_last_name: :otherInsuredLastName,
58
+ other_insured_middle_name: :otherInsuredMiddleName,
59
+ other_insured_name_suffix: :otherInsuredNameSuffix,
60
+ other_insured_qualifier: :otherInsuredQualifier
61
+ }
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.swagger_types
66
+ {
67
+ other_insured_additional_identifier: :String,
68
+ other_insured_address: :Address,
69
+ other_insured_first_name: :String,
70
+ other_insured_identifier: :String,
71
+ other_insured_identifier_type_code: :String,
72
+ other_insured_last_name: :String,
73
+ other_insured_middle_name: :String,
74
+ other_insured_name_suffix: :String,
75
+ other_insured_qualifier: :String
76
+ }
77
+ end
78
+
79
+ # Initializes the object
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ def initialize(attributes = {})
82
+ return unless attributes.is_a?(Hash)
83
+
84
+ # convert string to symbol for hash key
85
+ attributes = attributes.transform_keys(&:to_sym)
86
+
87
+ self.other_insured_additional_identifier = attributes[:otherInsuredAdditionalIdentifier] if attributes.key?(:otherInsuredAdditionalIdentifier)
88
+
89
+ self.other_insured_address = attributes[:otherInsuredAddress] if attributes.key?(:otherInsuredAddress)
90
+
91
+ self.other_insured_first_name = attributes[:otherInsuredFirstName] if attributes.key?(:otherInsuredFirstName)
92
+
93
+ self.other_insured_identifier = attributes[:otherInsuredIdentifier] if attributes.key?(:otherInsuredIdentifier)
94
+
95
+ self.other_insured_identifier_type_code = attributes[:otherInsuredIdentifierTypeCode] if attributes.key?(:otherInsuredIdentifierTypeCode)
96
+
97
+ self.other_insured_last_name = attributes[:otherInsuredLastName] if attributes.key?(:otherInsuredLastName)
98
+
99
+ self.other_insured_middle_name = attributes[:otherInsuredMiddleName] if attributes.key?(:otherInsuredMiddleName)
100
+
101
+ self.other_insured_name_suffix = attributes[:otherInsuredNameSuffix] if attributes.key?(:otherInsuredNameSuffix)
102
+
103
+ self.other_insured_qualifier = attributes[:otherInsuredQualifier] if attributes.key?(:otherInsuredQualifier)
104
+ end
105
+
106
+ # Show invalid properties with the reasons. Usually used together with valid?
107
+ # @return Array for valid properties with the reasons
108
+ def list_invalid_properties
109
+ []
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
+ other_insured_identifier_type_code_validator = EnumAttributeValidator.new('String', %w[1 2])
116
+ return false unless other_insured_identifier_type_code_validator.valid?(@other_insured_identifier_type_code)
117
+
118
+ other_insured_qualifier_validator = EnumAttributeValidator.new('String', %w[1 2])
119
+ return false unless other_insured_qualifier_validator.valid?(@other_insured_qualifier)
120
+
121
+ true
122
+ end
123
+
124
+ # Custom attribute writer method checking allowed values (enum).
125
+ # @param [Object] other_insured_identifier_type_code Object to be assigned
126
+ def other_insured_identifier_type_code=(other_insured_identifier_type_code)
127
+ validator = EnumAttributeValidator.new('String', %w[1 2])
128
+ unless validator.valid?(other_insured_identifier_type_code)
129
+ raise ArgumentError,
130
+ %(invalid value for "other_insured_identifier_type_code", must be one of #{validator.allowable_values}.)
131
+ end
132
+
133
+ @other_insured_identifier_type_code = other_insured_identifier_type_code
134
+ end
135
+
136
+ # Custom attribute writer method checking allowed values (enum).
137
+ # @param [Object] other_insured_qualifier Object to be assigned
138
+ def other_insured_qualifier=(other_insured_qualifier)
139
+ validator = EnumAttributeValidator.new('String', %w[1 2])
140
+ unless validator.valid?(other_insured_qualifier)
141
+ raise ArgumentError,
142
+ %(invalid value for "other_insured_qualifier", must be one of #{validator.allowable_values}.)
143
+ end
144
+
145
+ @other_insured_qualifier = other_insured_qualifier
146
+ end
147
+
148
+ # Checks equality by comparing each attribute.
149
+ # @param [Object] Object to be compared
150
+ def ==(other)
151
+ return true if equal?(other)
152
+
153
+ self.class == other.class &&
154
+ other_insured_additional_identifier == other.other_insured_additional_identifier &&
155
+ other_insured_address == other.other_insured_address &&
156
+ other_insured_first_name == other.other_insured_first_name &&
157
+ other_insured_identifier == other.other_insured_identifier &&
158
+ other_insured_identifier_type_code == other.other_insured_identifier_type_code &&
159
+ other_insured_last_name == other.other_insured_last_name &&
160
+ other_insured_middle_name == other.other_insured_middle_name &&
161
+ other_insured_name_suffix == other.other_insured_name_suffix &&
162
+ other_insured_qualifier == other.other_insured_qualifier
163
+ end
164
+
165
+ # @see the `==` method
166
+ # @param [Object] Object to be compared
167
+ def eql?(other)
168
+ self == other
169
+ end
170
+
171
+ # Calculates hash code according to all attributes.
172
+ # @return [Fixnum] Hash code
173
+ def hash
174
+ [other_insured_additional_identifier, other_insured_address, other_insured_first_name, other_insured_identifier,
175
+ other_insured_identifier_type_code, other_insured_last_name, other_insured_middle_name, other_insured_name_suffix, other_insured_qualifier].hash
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+
184
+ self.class.swagger_types.each_pair do |key, type|
185
+ if type =~ /\AArray<(.*)>/i
186
+ # check to ensure the input is an array given that the attribute
187
+ # is documented as an array but the input is not
188
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
189
+ send("#{key}=", attributes[self.class.attribute_map[key]].map do |v|
190
+ _deserialize(Regexp.last_match(1), v)
191
+ end)
192
+ end
193
+ elsif !attributes[self.class.attribute_map[key]].nil?
194
+ send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
195
+ end
196
+ end
197
+
198
+ self
199
+ end
200
+
201
+ # Deserializes the data based on type
202
+ # @param string type Data type
203
+ # @param string value Value to be deserialized
204
+ # @return [Object] Deserialized data
205
+ def _deserialize(type, value)
206
+ case type.to_sym
207
+ when :DateTime
208
+ DateTime.parse(value)
209
+ when :Date
210
+ Date.parse(value)
211
+ when :String
212
+ value.to_s
213
+ when :Integer
214
+ value.to_i
215
+ when :Float
216
+ value.to_f
217
+ when :BOOLEAN
218
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
219
+ true
220
+ else
221
+ false
222
+ end
223
+ when :Object
224
+ # generic object (usually a Hash), return directly
225
+ value
226
+ when /\AArray<(?<inner_type>.+)>\z/
227
+ inner_type = Regexp.last_match[:inner_type]
228
+ value.map { |v| _deserialize(inner_type, v) }
229
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
230
+ k_type = Regexp.last_match[:k_type]
231
+ v_type = Regexp.last_match[:v_type]
232
+ {}.tap do |hash|
233
+ value.each do |k, v|
234
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
235
+ end
236
+ end
237
+ else # model
238
+ temp_model = SwaggerClient.const_get(type).new
239
+ temp_model.build_from_hash(value)
240
+ end
241
+ end
242
+
243
+ # Returns the string representation of the object
244
+ # @return [String] String presentation of the object
245
+ def to_s
246
+ to_hash.to_s
247
+ end
248
+
249
+ # to_body is an alias to to_hash (backward compatibility)
250
+ # @return [Hash] Returns the object in the form of hash
251
+ def to_body
252
+ to_hash
253
+ end
254
+
255
+ # Returns the object in the form of hash
256
+ # @return [Hash] Returns the object in the form of hash
257
+ def to_hash
258
+ hash = {}
259
+ self.class.attribute_map.each_pair do |attr, param|
260
+ value = send(attr)
261
+ next if value.nil?
262
+
263
+ hash[param] = _to_hash(value)
264
+ end
265
+ hash
266
+ end
267
+
268
+ # Outputs non-array value in the form of hash
269
+ # For object, use to_hash. Otherwise, just return the value
270
+ # @param [Object] value Any valid value
271
+ # @return [Hash] Returns the value in the form of hash
272
+ def _to_hash(value)
273
+ if value.is_a?(Array)
274
+ value.compact.map { |v| _to_hash(v) }
275
+ elsif value.is_a?(Hash)
276
+ {}.tap do |hash|
277
+ value.each { |k, v| hash[k] = _to_hash(v) }
278
+ end
279
+ elsif value.respond_to? :to_hash
280
+ value.to_hash
281
+ else
282
+ value
283
+ end
284
+ end
285
+ end
286
+ end
287
+ end
288
+ end
@@ -0,0 +1,259 @@
1
+ # frozen_string_literal: true
2
+
3
+ # #Medical Network Professional Claims v3
4
+ #
5
+ # Reference for developers
6
+ #
7
+ # OpenAPI spec version: v3
8
+ #
9
+ # Generated by: https://github.com/swagger-api/swagger-codegen.git
10
+ # Swagger Codegen version: 2.4.19
11
+ #
12
+
13
+ require 'date'
14
+
15
+ module ChangeHealthcare
16
+ module ProfessionalClaims
17
+ module SwaggerClient
18
+ class PatientConditionInformationVision
19
+ # Allowed Values are: 'N' No, 'Y' Yes
20
+ attr_accessor :certification_condition_indicator
21
+
22
+ # Allowed Values are: 'E1' Spectacle Lenses, 'E2' Contact Lenses, 'E3' Spectacle Frames
23
+ attr_accessor :code_category
24
+
25
+ # Allowed Values are: 'L1' General Standard of 20 Degree or .5 Diopter Sphere or Cylinder Change Met, 'L2' Replacement Due to Loss or Theft, 'L3' Replacement Due to Breakage or Damage, 'L4' Replacement Due to Patient Preference, 'L5' Replacement Due to Medical Reason
26
+ attr_accessor :condition_codes
27
+
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype, :allowable_values
30
+
31
+ def initialize(datatype, allowable_values)
32
+ @allowable_values = allowable_values.map do |value|
33
+ case datatype.to_s
34
+ when /Integer/i
35
+ value.to_i
36
+ when /Float/i
37
+ value.to_f
38
+ else
39
+ value
40
+ end
41
+ end
42
+ end
43
+
44
+ def valid?(value)
45
+ !value || allowable_values.include?(value)
46
+ end
47
+ end
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ certification_condition_indicator: :certificationConditionIndicator,
53
+ code_category: :codeCategory,
54
+ condition_codes: :conditionCodes
55
+ }
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.swagger_types
60
+ {
61
+ certification_condition_indicator: :String,
62
+ code_category: :String,
63
+ condition_codes: :'Array<String>'
64
+ }
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ return unless attributes.is_a?(Hash)
71
+
72
+ # convert string to symbol for hash key
73
+ attributes = attributes.transform_keys(&:to_sym)
74
+
75
+ self.certification_condition_indicator = attributes[:certificationConditionIndicator] if attributes.key?(:certificationConditionIndicator)
76
+
77
+ self.code_category = attributes[:codeCategory] if attributes.key?(:codeCategory)
78
+
79
+ if attributes.key?(:conditionCodes) && (value = attributes[:conditionCodes]).is_a?(Array)
80
+ self.condition_codes = value
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ []
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ certification_condition_indicator_validator = EnumAttributeValidator.new('String', %w[N Y])
94
+ return false unless certification_condition_indicator_validator.valid?(@certification_condition_indicator)
95
+
96
+ code_category_validator = EnumAttributeValidator.new('String', %w[E1 E2 E3])
97
+ return false unless code_category_validator.valid?(@code_category)
98
+
99
+ true
100
+ end
101
+
102
+ # Custom attribute writer method checking allowed values (enum).
103
+ # @param [Object] certification_condition_indicator Object to be assigned
104
+ def certification_condition_indicator=(certification_condition_indicator)
105
+ validator = EnumAttributeValidator.new('String', %w[N Y])
106
+ unless validator.valid?(certification_condition_indicator)
107
+ raise ArgumentError,
108
+ %(invalid value for "certification_condition_indicator", must be one of #{validator.allowable_values}.)
109
+ end
110
+
111
+ @certification_condition_indicator = certification_condition_indicator
112
+ end
113
+
114
+ # Custom attribute writer method checking allowed values (enum).
115
+ # @param [Object] code_category Object to be assigned
116
+ def code_category=(code_category)
117
+ validator = EnumAttributeValidator.new('String', %w[E1 E2 E3])
118
+ unless validator.valid?(code_category)
119
+ raise ArgumentError,
120
+ %(invalid value for "code_category", must be one of #{validator.allowable_values}.)
121
+ end
122
+
123
+ @code_category = code_category
124
+ end
125
+
126
+ # Checks equality by comparing each attribute.
127
+ # @param [Object] Object to be compared
128
+ def ==(other)
129
+ return true if equal?(other)
130
+
131
+ self.class == other.class &&
132
+ certification_condition_indicator == other.certification_condition_indicator &&
133
+ code_category == other.code_category &&
134
+ condition_codes == other.condition_codes
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(other)
140
+ self == other
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Fixnum] Hash code
145
+ def hash
146
+ [certification_condition_indicator, code_category, condition_codes].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+
155
+ self.class.swagger_types.each_pair do |key, type|
156
+ if type =~ /\AArray<(.*)>/i
157
+ # check to ensure the input is an array given that the attribute
158
+ # is documented as an array but the input is not
159
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
160
+ send("#{key}=", attributes[self.class.attribute_map[key]].map do |v|
161
+ _deserialize(Regexp.last_match(1), v)
162
+ end)
163
+ end
164
+ elsif !attributes[self.class.attribute_map[key]].nil?
165
+ send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
166
+ end
167
+ end
168
+
169
+ self
170
+ end
171
+
172
+ # Deserializes the data based on type
173
+ # @param string type Data type
174
+ # @param string value Value to be deserialized
175
+ # @return [Object] Deserialized data
176
+ def _deserialize(type, value)
177
+ case type.to_sym
178
+ when :DateTime
179
+ DateTime.parse(value)
180
+ when :Date
181
+ Date.parse(value)
182
+ when :String
183
+ value.to_s
184
+ when :Integer
185
+ value.to_i
186
+ when :Float
187
+ value.to_f
188
+ when :BOOLEAN
189
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
190
+ true
191
+ else
192
+ false
193
+ end
194
+ when :Object
195
+ # generic object (usually a Hash), return directly
196
+ value
197
+ when /\AArray<(?<inner_type>.+)>\z/
198
+ inner_type = Regexp.last_match[:inner_type]
199
+ value.map { |v| _deserialize(inner_type, v) }
200
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
201
+ k_type = Regexp.last_match[:k_type]
202
+ v_type = Regexp.last_match[:v_type]
203
+ {}.tap do |hash|
204
+ value.each do |k, v|
205
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
206
+ end
207
+ end
208
+ else # model
209
+ temp_model = SwaggerClient.const_get(type).new
210
+ temp_model.build_from_hash(value)
211
+ end
212
+ end
213
+
214
+ # Returns the string representation of the object
215
+ # @return [String] String presentation of the object
216
+ def to_s
217
+ to_hash.to_s
218
+ end
219
+
220
+ # to_body is an alias to to_hash (backward compatibility)
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_body
223
+ to_hash
224
+ end
225
+
226
+ # Returns the object in the form of hash
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_hash
229
+ hash = {}
230
+ self.class.attribute_map.each_pair do |attr, param|
231
+ value = send(attr)
232
+ next if value.nil?
233
+
234
+ hash[param] = _to_hash(value)
235
+ end
236
+ hash
237
+ end
238
+
239
+ # Outputs non-array value in the form of hash
240
+ # For object, use to_hash. Otherwise, just return the value
241
+ # @param [Object] value Any valid value
242
+ # @return [Hash] Returns the value in the form of hash
243
+ def _to_hash(value)
244
+ if value.is_a?(Array)
245
+ value.compact.map { |v| _to_hash(v) }
246
+ elsif value.is_a?(Hash)
247
+ {}.tap do |hash|
248
+ value.each { |k, v| hash[k] = _to_hash(v) }
249
+ end
250
+ elsif value.respond_to? :to_hash
251
+ value.to_hash
252
+ else
253
+ value
254
+ end
255
+ end
256
+ end
257
+ end
258
+ end
259
+ end