primary_connect_client 0.8.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/README.md +61 -16
  4. data/docs/Address.md +32 -0
  5. data/docs/CodedValue.md +22 -0
  6. data/docs/DefaultApi.md +568 -0
  7. data/docs/Demographics.md +52 -0
  8. data/docs/Error.md +18 -0
  9. data/docs/Event.md +26 -0
  10. data/docs/Events.md +18 -0
  11. data/docs/Identifier.md +20 -0
  12. data/docs/Location.md +26 -0
  13. data/docs/Meta.md +34 -0
  14. data/docs/MetaDestinations.md +22 -0
  15. data/docs/MetaMessage.md +20 -0
  16. data/docs/MetaSource.md +20 -0
  17. data/docs/MetaTransmission.md +18 -0
  18. data/docs/Name.md +22 -0
  19. data/docs/Order.md +24 -0
  20. data/docs/OrderIds.md +18 -0
  21. data/docs/OrderOrder.md +58 -0
  22. data/docs/OrderOrderClinicalInfo.md +26 -0
  23. data/docs/OrderOrderDiagnoses.md +22 -0
  24. data/docs/OrderOrderOrderingFacility.md +22 -0
  25. data/docs/OrderOrderSpecimen.md +22 -0
  26. data/docs/OrderWithEventErrors.md +20 -0
  27. data/docs/Orders.md +18 -0
  28. data/docs/OrdersOrders.md +22 -0
  29. data/docs/Patient.md +24 -0
  30. data/docs/PatientContacts.md +28 -0
  31. data/docs/PatientDemographics.md +52 -0
  32. data/docs/PhoneNumber.md +20 -0
  33. data/docs/Provider.md +32 -0
  34. data/docs/Result.md +52 -0
  35. data/docs/ResultIds.md +18 -0
  36. data/docs/ResultReferenceRange.md +22 -0
  37. data/docs/ResultReport.md +22 -0
  38. data/docs/ResultSpecimen.md +22 -0
  39. data/docs/Results.md +20 -0
  40. data/docs/Specimen.md +22 -0
  41. data/docs/Visit.md +36 -0
  42. data/docs/VisitCompany.md +24 -0
  43. data/docs/VisitGuarantor.md +40 -0
  44. data/docs/VisitGuarantorEmployer.md +22 -0
  45. data/docs/VisitInsurances.md +40 -0
  46. data/docs/VisitInsured.md +30 -0
  47. data/docs/VisitPlan.md +22 -0
  48. data/git_push.sh +5 -6
  49. data/lib/primary_connect_client/api/default_api.rb +143 -67
  50. data/lib/primary_connect_client/api_client.rb +5 -6
  51. data/lib/primary_connect_client/api_error.rb +1 -1
  52. data/lib/primary_connect_client/configuration.rb +3 -2
  53. data/lib/primary_connect_client/models/address.rb +281 -0
  54. data/lib/primary_connect_client/models/coded_value.rb +238 -0
  55. data/lib/primary_connect_client/models/demographics.rb +466 -0
  56. data/lib/primary_connect_client/models/error.rb +218 -0
  57. data/lib/primary_connect_client/models/event.rb +254 -0
  58. data/lib/primary_connect_client/models/events.rb +221 -0
  59. data/lib/primary_connect_client/models/identifier.rb +228 -0
  60. data/lib/primary_connect_client/models/location.rb +255 -0
  61. data/lib/primary_connect_client/models/meta.rb +327 -0
  62. data/lib/primary_connect_client/models/meta_destinations.rb +242 -0
  63. data/lib/primary_connect_client/models/meta_message.rb +227 -0
  64. data/lib/primary_connect_client/models/meta_source.rb +227 -0
  65. data/lib/primary_connect_client/models/meta_transmission.rb +218 -0
  66. data/lib/primary_connect_client/models/name.rb +237 -0
  67. data/lib/primary_connect_client/models/order.rb +245 -0
  68. data/lib/primary_connect_client/models/order_ids.rb +221 -0
  69. data/lib/primary_connect_client/models/order_order.rb +496 -0
  70. data/lib/primary_connect_client/models/order_order_clinical_info.rb +260 -0
  71. data/lib/primary_connect_client/models/order_order_diagnoses.rb +272 -0
  72. data/lib/primary_connect_client/models/order_order_ordering_facility.rb +239 -0
  73. data/lib/primary_connect_client/models/order_order_specimen.rb +239 -0
  74. data/lib/primary_connect_client/models/order_with_event_errors.rb +229 -0
  75. data/lib/primary_connect_client/models/orders.rb +221 -0
  76. data/lib/primary_connect_client/models/orders_orders.rb +236 -0
  77. data/lib/primary_connect_client/models/patient.rb +253 -0
  78. data/lib/primary_connect_client/models/patient_contacts.rb +305 -0
  79. data/lib/primary_connect_client/models/patient_demographics.rb +466 -0
  80. data/lib/primary_connect_client/models/phone_number.rb +262 -0
  81. data/lib/primary_connect_client/models/provider.rb +288 -0
  82. data/lib/primary_connect_client/models/result.rb +443 -0
  83. data/lib/primary_connect_client/models/result_ids.rb +221 -0
  84. data/lib/primary_connect_client/models/result_reference_range.rb +240 -0
  85. data/lib/primary_connect_client/models/result_report.rb +240 -0
  86. data/lib/primary_connect_client/models/result_specimen.rb +239 -0
  87. data/lib/primary_connect_client/models/results.rb +230 -0
  88. data/lib/primary_connect_client/models/specimen.rb +239 -0
  89. data/lib/primary_connect_client/models/visit.rb +306 -0
  90. data/lib/primary_connect_client/models/visit_company.rb +248 -0
  91. data/lib/primary_connect_client/models/visit_guarantor.rb +358 -0
  92. data/lib/primary_connect_client/models/visit_guarantor_employer.rb +238 -0
  93. data/lib/primary_connect_client/models/visit_insurances.rb +386 -0
  94. data/lib/primary_connect_client/models/visit_insured.rb +322 -0
  95. data/lib/primary_connect_client/models/visit_plan.rb +238 -0
  96. data/lib/primary_connect_client/version.rb +12 -2
  97. data/lib/primary_connect_client.rb +45 -3
  98. data/primary_connect_client.gemspec +7 -5
  99. data/spec/api/default_api_spec.rb +44 -41
  100. data/spec/api_client_spec.rb +3 -3
  101. data/spec/configuration_spec.rb +1 -1
  102. data/spec/models/address_spec.rb +76 -0
  103. data/spec/models/coded_value_spec.rb +46 -0
  104. data/spec/models/demographics_spec.rb +168 -0
  105. data/spec/models/error_spec.rb +34 -0
  106. data/spec/models/event_spec.rb +58 -0
  107. data/spec/models/events_spec.rb +34 -0
  108. data/spec/models/identifier_spec.rb +40 -0
  109. data/spec/models/location_spec.rb +58 -0
  110. data/spec/models/meta_destinations_spec.rb +46 -0
  111. data/spec/models/meta_message_spec.rb +40 -0
  112. data/spec/models/meta_source_spec.rb +40 -0
  113. data/spec/models/meta_spec.rb +86 -0
  114. data/spec/models/meta_transmission_spec.rb +34 -0
  115. data/spec/models/name_spec.rb +46 -0
  116. data/spec/models/order_ids_spec.rb +34 -0
  117. data/spec/models/order_order_clinical_info_spec.rb +58 -0
  118. data/spec/models/order_order_diagnoses_spec.rb +50 -0
  119. data/spec/models/order_order_ordering_facility_spec.rb +46 -0
  120. data/spec/models/order_order_spec.rb +170 -0
  121. data/spec/models/order_order_specimen_spec.rb +46 -0
  122. data/spec/models/order_spec.rb +52 -0
  123. data/spec/models/order_with_event_errors_spec.rb +40 -0
  124. data/spec/models/orders_orders_spec.rb +46 -0
  125. data/spec/models/orders_spec.rb +34 -0
  126. data/spec/models/patient_contacts_spec.rb +68 -0
  127. data/spec/models/patient_demographics_spec.rb +168 -0
  128. data/spec/models/patient_spec.rb +52 -0
  129. data/spec/models/phone_number_spec.rb +44 -0
  130. data/spec/models/provider_spec.rb +76 -0
  131. data/spec/models/result_ids_spec.rb +34 -0
  132. data/spec/models/result_reference_range_spec.rb +46 -0
  133. data/spec/models/result_report_spec.rb +46 -0
  134. data/spec/models/result_spec.rb +148 -0
  135. data/spec/models/result_specimen_spec.rb +46 -0
  136. data/spec/models/results_spec.rb +40 -0
  137. data/spec/models/specimen_spec.rb +46 -0
  138. data/spec/models/visit_company_spec.rb +52 -0
  139. data/spec/models/visit_guarantor_employer_spec.rb +46 -0
  140. data/spec/models/visit_guarantor_spec.rb +104 -0
  141. data/spec/models/visit_insurances_spec.rb +112 -0
  142. data/spec/models/visit_insured_spec.rb +78 -0
  143. data/spec/models/visit_plan_spec.rb +46 -0
  144. data/spec/models/visit_spec.rb +88 -0
  145. data/spec/spec_helper.rb +1 -1
  146. metadata +177 -20
  147. data/Gemfile.lock +0 -74
@@ -0,0 +1,466 @@
1
+ =begin
2
+ #Primary Connect API V1
3
+
4
+ #Client Library to interface with Primary Connect
5
+
6
+ The version of the OpenAPI document: v1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module PrimaryConnectClient
17
+ class Demographics
18
+ attr_accessor :name
19
+
20
+ attr_accessor :dob
21
+
22
+ attr_accessor :ssn
23
+
24
+ attr_accessor :sex
25
+
26
+ attr_accessor :gender
27
+
28
+ attr_accessor :sexual_orientation
29
+
30
+ attr_accessor :races
31
+
32
+ attr_accessor :race_details
33
+
34
+ attr_accessor :ethnicity
35
+
36
+ attr_accessor :ethnicity_detail
37
+
38
+ attr_accessor :marital_status
39
+
40
+ attr_accessor :is_deceased
41
+
42
+ # ISO 8601
43
+ attr_accessor :death_date_time
44
+
45
+ attr_accessor :phone_numbers
46
+
47
+ attr_accessor :email_addresses
48
+
49
+ attr_accessor :language_code
50
+
51
+ attr_accessor :citizenships
52
+
53
+ attr_accessor :address
54
+
55
+ class EnumAttributeValidator
56
+ attr_reader :datatype
57
+ attr_reader :allowable_values
58
+
59
+ def initialize(datatype, allowable_values)
60
+ @allowable_values = allowable_values.map do |value|
61
+ case datatype.to_s
62
+ when /Integer/i
63
+ value.to_i
64
+ when /Float/i
65
+ value.to_f
66
+ else
67
+ value
68
+ end
69
+ end
70
+ end
71
+
72
+ def valid?(value)
73
+ !value || allowable_values.include?(value)
74
+ end
75
+ end
76
+
77
+ # Attribute mapping from ruby-style variable name to JSON key.
78
+ def self.attribute_map
79
+ {
80
+ :'name' => :'name',
81
+ :'dob' => :'dob',
82
+ :'ssn' => :'ssn',
83
+ :'sex' => :'sex',
84
+ :'gender' => :'gender',
85
+ :'sexual_orientation' => :'sexualOrientation',
86
+ :'races' => :'races',
87
+ :'race_details' => :'raceDetails',
88
+ :'ethnicity' => :'ethnicity',
89
+ :'ethnicity_detail' => :'ethnicityDetail',
90
+ :'marital_status' => :'maritalStatus',
91
+ :'is_deceased' => :'isDeceased',
92
+ :'death_date_time' => :'deathDateTime',
93
+ :'phone_numbers' => :'phoneNumbers',
94
+ :'email_addresses' => :'emailAddresses',
95
+ :'language_code' => :'languageCode',
96
+ :'citizenships' => :'citizenships',
97
+ :'address' => :'address'
98
+ }
99
+ end
100
+
101
+ # Returns all the JSON keys this model knows about
102
+ def self.acceptable_attributes
103
+ attribute_map.values
104
+ end
105
+
106
+ # Attribute type mapping.
107
+ def self.openapi_types
108
+ {
109
+ :'name' => :'Name',
110
+ :'dob' => :'String',
111
+ :'ssn' => :'String',
112
+ :'sex' => :'String',
113
+ :'gender' => :'String',
114
+ :'sexual_orientation' => :'String',
115
+ :'races' => :'Array<String>',
116
+ :'race_details' => :'Array<String>',
117
+ :'ethnicity' => :'String',
118
+ :'ethnicity_detail' => :'Array<String>',
119
+ :'marital_status' => :'String',
120
+ :'is_deceased' => :'Boolean',
121
+ :'death_date_time' => :'Time',
122
+ :'phone_numbers' => :'Array<PhoneNumber>',
123
+ :'email_addresses' => :'Array<String>',
124
+ :'language_code' => :'String',
125
+ :'citizenships' => :'Array<String>',
126
+ :'address' => :'Address'
127
+ }
128
+ end
129
+
130
+ # List of attributes with nullable: true
131
+ def self.openapi_nullable
132
+ Set.new([
133
+ ])
134
+ end
135
+
136
+ # Initializes the object
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ def initialize(attributes = {})
139
+ if (!attributes.is_a?(Hash))
140
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PrimaryConnectClient::Demographics` initialize method"
141
+ end
142
+
143
+ # check to see if the attribute exists and convert string to symbol for hash key
144
+ attributes = attributes.each_with_object({}) { |(k, v), h|
145
+ if (!self.class.attribute_map.key?(k.to_sym))
146
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PrimaryConnectClient::Demographics`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
147
+ end
148
+ h[k.to_sym] = v
149
+ }
150
+
151
+ if attributes.key?(:'name')
152
+ self.name = attributes[:'name']
153
+ end
154
+
155
+ if attributes.key?(:'dob')
156
+ self.dob = attributes[:'dob']
157
+ end
158
+
159
+ if attributes.key?(:'ssn')
160
+ self.ssn = attributes[:'ssn']
161
+ end
162
+
163
+ if attributes.key?(:'sex')
164
+ self.sex = attributes[:'sex']
165
+ end
166
+
167
+ if attributes.key?(:'gender')
168
+ self.gender = attributes[:'gender']
169
+ end
170
+
171
+ if attributes.key?(:'sexual_orientation')
172
+ self.sexual_orientation = attributes[:'sexual_orientation']
173
+ end
174
+
175
+ if attributes.key?(:'races')
176
+ if (value = attributes[:'races']).is_a?(Array)
177
+ self.races = value
178
+ end
179
+ end
180
+
181
+ if attributes.key?(:'race_details')
182
+ if (value = attributes[:'race_details']).is_a?(Array)
183
+ self.race_details = value
184
+ end
185
+ end
186
+
187
+ if attributes.key?(:'ethnicity')
188
+ self.ethnicity = attributes[:'ethnicity']
189
+ end
190
+
191
+ if attributes.key?(:'ethnicity_detail')
192
+ if (value = attributes[:'ethnicity_detail']).is_a?(Array)
193
+ self.ethnicity_detail = value
194
+ end
195
+ end
196
+
197
+ if attributes.key?(:'marital_status')
198
+ self.marital_status = attributes[:'marital_status']
199
+ end
200
+
201
+ if attributes.key?(:'is_deceased')
202
+ self.is_deceased = attributes[:'is_deceased']
203
+ end
204
+
205
+ if attributes.key?(:'death_date_time')
206
+ self.death_date_time = attributes[:'death_date_time']
207
+ end
208
+
209
+ if attributes.key?(:'phone_numbers')
210
+ if (value = attributes[:'phone_numbers']).is_a?(Array)
211
+ self.phone_numbers = value
212
+ end
213
+ end
214
+
215
+ if attributes.key?(:'email_addresses')
216
+ if (value = attributes[:'email_addresses']).is_a?(Array)
217
+ self.email_addresses = value
218
+ end
219
+ end
220
+
221
+ if attributes.key?(:'language_code')
222
+ self.language_code = attributes[:'language_code']
223
+ end
224
+
225
+ if attributes.key?(:'citizenships')
226
+ if (value = attributes[:'citizenships']).is_a?(Array)
227
+ self.citizenships = value
228
+ end
229
+ end
230
+
231
+ if attributes.key?(:'address')
232
+ self.address = attributes[:'address']
233
+ end
234
+ end
235
+
236
+ # Show invalid properties with the reasons. Usually used together with valid?
237
+ # @return Array for valid properties with the reasons
238
+ def list_invalid_properties
239
+ invalid_properties = Array.new
240
+ invalid_properties
241
+ end
242
+
243
+ # Check to see if the all the properties in the model are valid
244
+ # @return true if the model is valid
245
+ def valid?
246
+ sex_validator = EnumAttributeValidator.new('String', ["SEX_UNKNOWN", "SEX_FEMALE", "SEX_MALE", "SEX_OTHER", "SEX_NON_BINARY", "SEX_PREFER_NOT_TO_DISCLOSE"])
247
+ return false unless sex_validator.valid?(@sex)
248
+ gender_validator = EnumAttributeValidator.new('String', ["GENDER_UNKNOWN", "GENDER_FEMALE", "GENDER_MALE", "GENDER_OTHER", "GENDER_NON_BINARY", "GENDER_TRANSGENDER_MALE", "GENDER_TRANSGENDER_FEMALE", "GENDER_PREFER_NOT_TO_DISCLOSE"])
249
+ return false unless gender_validator.valid?(@gender)
250
+ sexual_orientation_validator = EnumAttributeValidator.new('String', ["ORIENTATION_UNKNOWN", "ORIENTATION_HOMOSEXUAL", "ORIENTATION_HETEROSEXUAL", "ORIENTATION_BISEXUAL", "ORIENTATION_QUESTIONING", "ORIENTATION_OTHER", "ORIENTATION_PREFER_NOT_TO_DISCLOSE"])
251
+ return false unless sexual_orientation_validator.valid?(@sexual_orientation)
252
+ ethnicity_validator = EnumAttributeValidator.new('String', ["ETHNICITY_UNKNOWN", "ETHNICITY_HISPANIC", "ETHNICITY_NON_HISPANIC", "ETHNICITY_PREFER_NOT_TO_DISCLOSE"])
253
+ return false unless ethnicity_validator.valid?(@ethnicity)
254
+ marital_status_validator = EnumAttributeValidator.new('String', ["MARITAL_STATUS_UNKNOWN", "MARITAL_STATUS_SEPARATED", "MARITAL_STATUS_UNMARRIED", "MARITAL_STATUS_COMMON_LAW", "MARITAL_STATUS_DIVORCED", "MARITAL_STATUS_LEGALLY_SEPARATED", "MARITAL_STATUS_LIVING_TOGETHER", "MARITAL_STATUS_INTERLOCUTORY", "MARITAL_STATUS_MARRIED", "MARITAL_STATUS_ANNULLED", "MARITAL_STATUS_OTHER", "MARITAL_STATUS_DOMESTIC_PARTNER", "MARITAL_STATUS_REGISTERED_DOMESTIC_PARTNER", "MARITAL_STATUS_SINGLE", "MARITAL_STATUS_UNREPORTED", "MARITAL_STATUS_WIDOWED"])
255
+ return false unless marital_status_validator.valid?(@marital_status)
256
+ true
257
+ end
258
+
259
+ # Custom attribute writer method checking allowed values (enum).
260
+ # @param [Object] sex Object to be assigned
261
+ def sex=(sex)
262
+ validator = EnumAttributeValidator.new('String', ["SEX_UNKNOWN", "SEX_FEMALE", "SEX_MALE", "SEX_OTHER", "SEX_NON_BINARY", "SEX_PREFER_NOT_TO_DISCLOSE"])
263
+ unless validator.valid?(sex)
264
+ fail ArgumentError, "invalid value for \"sex\", must be one of #{validator.allowable_values}."
265
+ end
266
+ @sex = sex
267
+ end
268
+
269
+ # Custom attribute writer method checking allowed values (enum).
270
+ # @param [Object] gender Object to be assigned
271
+ def gender=(gender)
272
+ validator = EnumAttributeValidator.new('String', ["GENDER_UNKNOWN", "GENDER_FEMALE", "GENDER_MALE", "GENDER_OTHER", "GENDER_NON_BINARY", "GENDER_TRANSGENDER_MALE", "GENDER_TRANSGENDER_FEMALE", "GENDER_PREFER_NOT_TO_DISCLOSE"])
273
+ unless validator.valid?(gender)
274
+ fail ArgumentError, "invalid value for \"gender\", must be one of #{validator.allowable_values}."
275
+ end
276
+ @gender = gender
277
+ end
278
+
279
+ # Custom attribute writer method checking allowed values (enum).
280
+ # @param [Object] sexual_orientation Object to be assigned
281
+ def sexual_orientation=(sexual_orientation)
282
+ validator = EnumAttributeValidator.new('String', ["ORIENTATION_UNKNOWN", "ORIENTATION_HOMOSEXUAL", "ORIENTATION_HETEROSEXUAL", "ORIENTATION_BISEXUAL", "ORIENTATION_QUESTIONING", "ORIENTATION_OTHER", "ORIENTATION_PREFER_NOT_TO_DISCLOSE"])
283
+ unless validator.valid?(sexual_orientation)
284
+ fail ArgumentError, "invalid value for \"sexual_orientation\", must be one of #{validator.allowable_values}."
285
+ end
286
+ @sexual_orientation = sexual_orientation
287
+ end
288
+
289
+ # Custom attribute writer method checking allowed values (enum).
290
+ # @param [Object] ethnicity Object to be assigned
291
+ def ethnicity=(ethnicity)
292
+ validator = EnumAttributeValidator.new('String', ["ETHNICITY_UNKNOWN", "ETHNICITY_HISPANIC", "ETHNICITY_NON_HISPANIC", "ETHNICITY_PREFER_NOT_TO_DISCLOSE"])
293
+ unless validator.valid?(ethnicity)
294
+ fail ArgumentError, "invalid value for \"ethnicity\", must be one of #{validator.allowable_values}."
295
+ end
296
+ @ethnicity = ethnicity
297
+ end
298
+
299
+ # Custom attribute writer method checking allowed values (enum).
300
+ # @param [Object] marital_status Object to be assigned
301
+ def marital_status=(marital_status)
302
+ validator = EnumAttributeValidator.new('String', ["MARITAL_STATUS_UNKNOWN", "MARITAL_STATUS_SEPARATED", "MARITAL_STATUS_UNMARRIED", "MARITAL_STATUS_COMMON_LAW", "MARITAL_STATUS_DIVORCED", "MARITAL_STATUS_LEGALLY_SEPARATED", "MARITAL_STATUS_LIVING_TOGETHER", "MARITAL_STATUS_INTERLOCUTORY", "MARITAL_STATUS_MARRIED", "MARITAL_STATUS_ANNULLED", "MARITAL_STATUS_OTHER", "MARITAL_STATUS_DOMESTIC_PARTNER", "MARITAL_STATUS_REGISTERED_DOMESTIC_PARTNER", "MARITAL_STATUS_SINGLE", "MARITAL_STATUS_UNREPORTED", "MARITAL_STATUS_WIDOWED"])
303
+ unless validator.valid?(marital_status)
304
+ fail ArgumentError, "invalid value for \"marital_status\", must be one of #{validator.allowable_values}."
305
+ end
306
+ @marital_status = marital_status
307
+ end
308
+
309
+ # Checks equality by comparing each attribute.
310
+ # @param [Object] Object to be compared
311
+ def ==(o)
312
+ return true if self.equal?(o)
313
+ self.class == o.class &&
314
+ name == o.name &&
315
+ dob == o.dob &&
316
+ ssn == o.ssn &&
317
+ sex == o.sex &&
318
+ gender == o.gender &&
319
+ sexual_orientation == o.sexual_orientation &&
320
+ races == o.races &&
321
+ race_details == o.race_details &&
322
+ ethnicity == o.ethnicity &&
323
+ ethnicity_detail == o.ethnicity_detail &&
324
+ marital_status == o.marital_status &&
325
+ is_deceased == o.is_deceased &&
326
+ death_date_time == o.death_date_time &&
327
+ phone_numbers == o.phone_numbers &&
328
+ email_addresses == o.email_addresses &&
329
+ language_code == o.language_code &&
330
+ citizenships == o.citizenships &&
331
+ address == o.address
332
+ end
333
+
334
+ # @see the `==` method
335
+ # @param [Object] Object to be compared
336
+ def eql?(o)
337
+ self == o
338
+ end
339
+
340
+ # Calculates hash code according to all attributes.
341
+ # @return [Integer] Hash code
342
+ def hash
343
+ [name, dob, ssn, sex, gender, sexual_orientation, races, race_details, ethnicity, ethnicity_detail, marital_status, is_deceased, death_date_time, phone_numbers, email_addresses, language_code, citizenships, address].hash
344
+ end
345
+
346
+ # Builds the object from hash
347
+ # @param [Hash] attributes Model attributes in the form of hash
348
+ # @return [Object] Returns the model itself
349
+ def self.build_from_hash(attributes)
350
+ new.build_from_hash(attributes)
351
+ end
352
+
353
+ # Builds the object from hash
354
+ # @param [Hash] attributes Model attributes in the form of hash
355
+ # @return [Object] Returns the model itself
356
+ def build_from_hash(attributes)
357
+ return nil unless attributes.is_a?(Hash)
358
+ self.class.openapi_types.each_pair do |key, type|
359
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
360
+ self.send("#{key}=", nil)
361
+ elsif type =~ /\AArray<(.*)>/i
362
+ # check to ensure the input is an array given that the attribute
363
+ # is documented as an array but the input is not
364
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
365
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
366
+ end
367
+ elsif !attributes[self.class.attribute_map[key]].nil?
368
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
369
+ end
370
+ end
371
+
372
+ self
373
+ end
374
+
375
+ # Deserializes the data based on type
376
+ # @param string type Data type
377
+ # @param string value Value to be deserialized
378
+ # @return [Object] Deserialized data
379
+ def _deserialize(type, value)
380
+ case type.to_sym
381
+ when :Time
382
+ Time.parse(value)
383
+ when :Date
384
+ Date.parse(value)
385
+ when :String
386
+ value.to_s
387
+ when :Integer
388
+ value.to_i
389
+ when :Float
390
+ value.to_f
391
+ when :Boolean
392
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
393
+ true
394
+ else
395
+ false
396
+ end
397
+ when :Object
398
+ # generic object (usually a Hash), return directly
399
+ value
400
+ when /\AArray<(?<inner_type>.+)>\z/
401
+ inner_type = Regexp.last_match[:inner_type]
402
+ value.map { |v| _deserialize(inner_type, v) }
403
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
404
+ k_type = Regexp.last_match[:k_type]
405
+ v_type = Regexp.last_match[:v_type]
406
+ {}.tap do |hash|
407
+ value.each do |k, v|
408
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
409
+ end
410
+ end
411
+ else # model
412
+ # models (e.g. Pet) or oneOf
413
+ klass = PrimaryConnectClient.const_get(type)
414
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
415
+ end
416
+ end
417
+
418
+ # Returns the string representation of the object
419
+ # @return [String] String presentation of the object
420
+ def to_s
421
+ to_hash.to_s
422
+ end
423
+
424
+ # to_body is an alias to to_hash (backward compatibility)
425
+ # @return [Hash] Returns the object in the form of hash
426
+ def to_body
427
+ to_hash
428
+ end
429
+
430
+ # Returns the object in the form of hash
431
+ # @return [Hash] Returns the object in the form of hash
432
+ def to_hash
433
+ hash = {}
434
+ self.class.attribute_map.each_pair do |attr, param|
435
+ value = self.send(attr)
436
+ if value.nil?
437
+ is_nullable = self.class.openapi_nullable.include?(attr)
438
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
439
+ end
440
+
441
+ hash[param] = _to_hash(value)
442
+ end
443
+ hash
444
+ end
445
+
446
+ # Outputs non-array value in the form of hash
447
+ # For object, use to_hash. Otherwise, just return the value
448
+ # @param [Object] value Any valid value
449
+ # @return [Hash] Returns the value in the form of hash
450
+ def _to_hash(value)
451
+ if value.is_a?(Array)
452
+ value.compact.map { |v| _to_hash(v) }
453
+ elsif value.is_a?(Hash)
454
+ {}.tap do |hash|
455
+ value.each { |k, v| hash[k] = _to_hash(v) }
456
+ end
457
+ elsif value.respond_to? :to_hash
458
+ value.to_hash
459
+ else
460
+ value
461
+ end
462
+ end
463
+
464
+ end
465
+
466
+ end
@@ -0,0 +1,218 @@
1
+ =begin
2
+ #Primary Connect API V1
3
+
4
+ #Client Library to interface with Primary Connect
5
+
6
+ The version of the OpenAPI document: v1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module PrimaryConnectClient
17
+ class Error
18
+ attr_accessor :error
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'error' => :'error'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'error' => :'String'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PrimaryConnectClient::Error` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PrimaryConnectClient::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'error')
61
+ self.error = attributes[:'error']
62
+ end
63
+ end
64
+
65
+ # Show invalid properties with the reasons. Usually used together with valid?
66
+ # @return Array for valid properties with the reasons
67
+ def list_invalid_properties
68
+ invalid_properties = Array.new
69
+ invalid_properties
70
+ end
71
+
72
+ # Check to see if the all the properties in the model are valid
73
+ # @return true if the model is valid
74
+ def valid?
75
+ true
76
+ end
77
+
78
+ # Checks equality by comparing each attribute.
79
+ # @param [Object] Object to be compared
80
+ def ==(o)
81
+ return true if self.equal?(o)
82
+ self.class == o.class &&
83
+ error == o.error
84
+ end
85
+
86
+ # @see the `==` method
87
+ # @param [Object] Object to be compared
88
+ def eql?(o)
89
+ self == o
90
+ end
91
+
92
+ # Calculates hash code according to all attributes.
93
+ # @return [Integer] Hash code
94
+ def hash
95
+ [error].hash
96
+ end
97
+
98
+ # Builds the object from hash
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ # @return [Object] Returns the model itself
101
+ def self.build_from_hash(attributes)
102
+ new.build_from_hash(attributes)
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+ self.class.openapi_types.each_pair do |key, type|
111
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
112
+ self.send("#{key}=", nil)
113
+ elsif type =~ /\AArray<(.*)>/i
114
+ # check to ensure the input is an array given that the attribute
115
+ # is documented as an array but the input is not
116
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
117
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
118
+ end
119
+ elsif !attributes[self.class.attribute_map[key]].nil?
120
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
121
+ end
122
+ end
123
+
124
+ self
125
+ end
126
+
127
+ # Deserializes the data based on type
128
+ # @param string type Data type
129
+ # @param string value Value to be deserialized
130
+ # @return [Object] Deserialized data
131
+ def _deserialize(type, value)
132
+ case type.to_sym
133
+ when :Time
134
+ Time.parse(value)
135
+ when :Date
136
+ Date.parse(value)
137
+ when :String
138
+ value.to_s
139
+ when :Integer
140
+ value.to_i
141
+ when :Float
142
+ value.to_f
143
+ when :Boolean
144
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
145
+ true
146
+ else
147
+ false
148
+ end
149
+ when :Object
150
+ # generic object (usually a Hash), return directly
151
+ value
152
+ when /\AArray<(?<inner_type>.+)>\z/
153
+ inner_type = Regexp.last_match[:inner_type]
154
+ value.map { |v| _deserialize(inner_type, v) }
155
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
156
+ k_type = Regexp.last_match[:k_type]
157
+ v_type = Regexp.last_match[:v_type]
158
+ {}.tap do |hash|
159
+ value.each do |k, v|
160
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
161
+ end
162
+ end
163
+ else # model
164
+ # models (e.g. Pet) or oneOf
165
+ klass = PrimaryConnectClient.const_get(type)
166
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
167
+ end
168
+ end
169
+
170
+ # Returns the string representation of the object
171
+ # @return [String] String presentation of the object
172
+ def to_s
173
+ to_hash.to_s
174
+ end
175
+
176
+ # to_body is an alias to to_hash (backward compatibility)
177
+ # @return [Hash] Returns the object in the form of hash
178
+ def to_body
179
+ to_hash
180
+ end
181
+
182
+ # Returns the object in the form of hash
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_hash
185
+ hash = {}
186
+ self.class.attribute_map.each_pair do |attr, param|
187
+ value = self.send(attr)
188
+ if value.nil?
189
+ is_nullable = self.class.openapi_nullable.include?(attr)
190
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
191
+ end
192
+
193
+ hash[param] = _to_hash(value)
194
+ end
195
+ hash
196
+ end
197
+
198
+ # Outputs non-array value in the form of hash
199
+ # For object, use to_hash. Otherwise, just return the value
200
+ # @param [Object] value Any valid value
201
+ # @return [Hash] Returns the value in the form of hash
202
+ def _to_hash(value)
203
+ if value.is_a?(Array)
204
+ value.compact.map { |v| _to_hash(v) }
205
+ elsif value.is_a?(Hash)
206
+ {}.tap do |hash|
207
+ value.each { |k, v| hash[k] = _to_hash(v) }
208
+ end
209
+ elsif value.respond_to? :to_hash
210
+ value.to_hash
211
+ else
212
+ value
213
+ end
214
+ end
215
+
216
+ end
217
+
218
+ end