primary_connect_client 1.9.0 → 1.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.openapi-generator/FILES +12 -3
- data/CHANGELOG.md +4 -0
- data/README.md +8 -5
- data/docs/Meta.md +3 -1
- data/docs/MetaDestination.md +22 -0
- data/docs/MetaProvenances.md +22 -0
- data/docs/Order.md +1 -1
- data/docs/OrderPatient.md +24 -0
- data/docs/OrderPatientContacts.md +28 -0
- data/docs/Patient.md +1 -1
- data/docs/Result.md +3 -1
- data/lib/primary_connect_client/models/meta.rb +15 -4
- data/lib/primary_connect_client/models/meta_destination.rb +237 -0
- data/lib/primary_connect_client/models/meta_provenances.rb +237 -0
- data/lib/primary_connect_client/models/order.rb +1 -1
- data/lib/primary_connect_client/models/order_patient.rb +254 -0
- data/lib/primary_connect_client/models/order_patient_contacts.rb +305 -0
- data/lib/primary_connect_client/models/patient.rb +1 -1
- data/lib/primary_connect_client/models/result.rb +13 -4
- data/lib/primary_connect_client/version.rb +1 -1
- data/lib/primary_connect_client.rb +4 -1
- data/spec/models/meta_destination_spec.rb +46 -0
- data/spec/models/meta_provenances_spec.rb +46 -0
- data/spec/models/meta_spec.rb +6 -0
- data/spec/models/order_patient_contacts_spec.rb +68 -0
- data/spec/models/order_patient_spec.rb +52 -0
- data/spec/models/result_spec.rb +6 -0
- metadata +23 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd7391c6b1517f3521294db427b0e52c5330d5b3f1a1cbf2914f5bc961a21cff
|
4
|
+
data.tar.gz: d37eeaeee176c2fef882ad3ac89bcd71cb75d278bac08bb66f2149b92e4fc1ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad22731bab6615ceda33f0f4d4142fc943d13cbb15540072d216fefc3804c6a45ad7060b9af72c79e5479214cd7888e83ef5577bb642cf24e4a48aa98c040cef
|
7
|
+
data.tar.gz: 655925c17ae2edf5c65c35db48bf7df97860753225335800654a108541db20ae2458e2b26c2a46a38a1c56a737e71fbbdd61ce8e7c98bec43c32d1c0a09eec64
|
data/.openapi-generator/FILES
CHANGED
@@ -24,8 +24,10 @@ docs/Measurement.md
|
|
24
24
|
docs/Medication.md
|
25
25
|
docs/MedicationAdministration.md
|
26
26
|
docs/Meta.md
|
27
|
+
docs/MetaDestination.md
|
27
28
|
docs/MetaDestinations.md
|
28
29
|
docs/MetaMessage.md
|
30
|
+
docs/MetaProvenances.md
|
29
31
|
docs/MetaSource.md
|
30
32
|
docs/MetaTransmission.md
|
31
33
|
docs/Name.md
|
@@ -35,11 +37,12 @@ docs/OrderOrder.md
|
|
35
37
|
docs/OrderOrderClinicalInfo.md
|
36
38
|
docs/OrderOrderDiagnoses.md
|
37
39
|
docs/OrderOrderOrderingFacility.md
|
40
|
+
docs/OrderPatient.md
|
41
|
+
docs/OrderPatientContacts.md
|
38
42
|
docs/OrderWithEventErrors.md
|
39
43
|
docs/Orders.md
|
40
44
|
docs/OrdersOrders.md
|
41
45
|
docs/Patient.md
|
42
|
-
docs/PatientContacts.md
|
43
46
|
docs/PhoneNumber.md
|
44
47
|
docs/Provider.md
|
45
48
|
docs/Result.md
|
@@ -83,8 +86,10 @@ lib/primary_connect_client/models/measurement.rb
|
|
83
86
|
lib/primary_connect_client/models/medication.rb
|
84
87
|
lib/primary_connect_client/models/medication_administration.rb
|
85
88
|
lib/primary_connect_client/models/meta.rb
|
89
|
+
lib/primary_connect_client/models/meta_destination.rb
|
86
90
|
lib/primary_connect_client/models/meta_destinations.rb
|
87
91
|
lib/primary_connect_client/models/meta_message.rb
|
92
|
+
lib/primary_connect_client/models/meta_provenances.rb
|
88
93
|
lib/primary_connect_client/models/meta_source.rb
|
89
94
|
lib/primary_connect_client/models/meta_transmission.rb
|
90
95
|
lib/primary_connect_client/models/name.rb
|
@@ -94,11 +99,12 @@ lib/primary_connect_client/models/order_order.rb
|
|
94
99
|
lib/primary_connect_client/models/order_order_clinical_info.rb
|
95
100
|
lib/primary_connect_client/models/order_order_diagnoses.rb
|
96
101
|
lib/primary_connect_client/models/order_order_ordering_facility.rb
|
102
|
+
lib/primary_connect_client/models/order_patient.rb
|
103
|
+
lib/primary_connect_client/models/order_patient_contacts.rb
|
97
104
|
lib/primary_connect_client/models/order_with_event_errors.rb
|
98
105
|
lib/primary_connect_client/models/orders.rb
|
99
106
|
lib/primary_connect_client/models/orders_orders.rb
|
100
107
|
lib/primary_connect_client/models/patient.rb
|
101
|
-
lib/primary_connect_client/models/patient_contacts.rb
|
102
108
|
lib/primary_connect_client/models/phone_number.rb
|
103
109
|
lib/primary_connect_client/models/provider.rb
|
104
110
|
lib/primary_connect_client/models/result.rb
|
@@ -140,8 +146,10 @@ spec/models/location_spec.rb
|
|
140
146
|
spec/models/measurement_spec.rb
|
141
147
|
spec/models/medication_administration_spec.rb
|
142
148
|
spec/models/medication_spec.rb
|
149
|
+
spec/models/meta_destination_spec.rb
|
143
150
|
spec/models/meta_destinations_spec.rb
|
144
151
|
spec/models/meta_message_spec.rb
|
152
|
+
spec/models/meta_provenances_spec.rb
|
145
153
|
spec/models/meta_source_spec.rb
|
146
154
|
spec/models/meta_spec.rb
|
147
155
|
spec/models/meta_transmission_spec.rb
|
@@ -151,11 +159,12 @@ spec/models/order_order_clinical_info_spec.rb
|
|
151
159
|
spec/models/order_order_diagnoses_spec.rb
|
152
160
|
spec/models/order_order_ordering_facility_spec.rb
|
153
161
|
spec/models/order_order_spec.rb
|
162
|
+
spec/models/order_patient_contacts_spec.rb
|
163
|
+
spec/models/order_patient_spec.rb
|
154
164
|
spec/models/order_spec.rb
|
155
165
|
spec/models/order_with_event_errors_spec.rb
|
156
166
|
spec/models/orders_orders_spec.rb
|
157
167
|
spec/models/orders_spec.rb
|
158
|
-
spec/models/patient_contacts_spec.rb
|
159
168
|
spec/models/patient_spec.rb
|
160
169
|
spec/models/phone_number_spec.rb
|
161
170
|
spec/models/provider_spec.rb
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -7,7 +7,7 @@ Client Library to interface with Primary Connect
|
|
7
7
|
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
8
8
|
|
9
9
|
- API version: v1
|
10
|
-
- Package version: 1.
|
10
|
+
- Package version: 1.10.0
|
11
11
|
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
12
12
|
|
13
13
|
## Installation
|
@@ -23,16 +23,16 @@ gem build primary_connect_client.gemspec
|
|
23
23
|
Then either install the gem locally:
|
24
24
|
|
25
25
|
```shell
|
26
|
-
gem install ./primary_connect_client-1.
|
26
|
+
gem install ./primary_connect_client-1.10.0.gem
|
27
27
|
```
|
28
28
|
|
29
|
-
(for development, run `gem install --dev ./primary_connect_client-1.
|
29
|
+
(for development, run `gem install --dev ./primary_connect_client-1.10.0.gem` to install the development dependencies)
|
30
30
|
|
31
31
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
32
32
|
|
33
33
|
Finally add this to the Gemfile:
|
34
34
|
|
35
|
-
gem 'primary_connect_client', '~> 1.
|
35
|
+
gem 'primary_connect_client', '~> 1.10.0'
|
36
36
|
|
37
37
|
### Install from Git
|
38
38
|
|
@@ -117,8 +117,10 @@ Class | Method | HTTP request | Description
|
|
117
117
|
- [PrimaryConnectClient::Medication](docs/Medication.md)
|
118
118
|
- [PrimaryConnectClient::MedicationAdministration](docs/MedicationAdministration.md)
|
119
119
|
- [PrimaryConnectClient::Meta](docs/Meta.md)
|
120
|
+
- [PrimaryConnectClient::MetaDestination](docs/MetaDestination.md)
|
120
121
|
- [PrimaryConnectClient::MetaDestinations](docs/MetaDestinations.md)
|
121
122
|
- [PrimaryConnectClient::MetaMessage](docs/MetaMessage.md)
|
123
|
+
- [PrimaryConnectClient::MetaProvenances](docs/MetaProvenances.md)
|
122
124
|
- [PrimaryConnectClient::MetaSource](docs/MetaSource.md)
|
123
125
|
- [PrimaryConnectClient::MetaTransmission](docs/MetaTransmission.md)
|
124
126
|
- [PrimaryConnectClient::Name](docs/Name.md)
|
@@ -128,11 +130,12 @@ Class | Method | HTTP request | Description
|
|
128
130
|
- [PrimaryConnectClient::OrderOrderClinicalInfo](docs/OrderOrderClinicalInfo.md)
|
129
131
|
- [PrimaryConnectClient::OrderOrderDiagnoses](docs/OrderOrderDiagnoses.md)
|
130
132
|
- [PrimaryConnectClient::OrderOrderOrderingFacility](docs/OrderOrderOrderingFacility.md)
|
133
|
+
- [PrimaryConnectClient::OrderPatient](docs/OrderPatient.md)
|
134
|
+
- [PrimaryConnectClient::OrderPatientContacts](docs/OrderPatientContacts.md)
|
131
135
|
- [PrimaryConnectClient::OrderWithEventErrors](docs/OrderWithEventErrors.md)
|
132
136
|
- [PrimaryConnectClient::Orders](docs/Orders.md)
|
133
137
|
- [PrimaryConnectClient::OrdersOrders](docs/OrdersOrders.md)
|
134
138
|
- [PrimaryConnectClient::Patient](docs/Patient.md)
|
135
|
-
- [PrimaryConnectClient::PatientContacts](docs/PatientContacts.md)
|
136
139
|
- [PrimaryConnectClient::PhoneNumber](docs/PhoneNumber.md)
|
137
140
|
- [PrimaryConnectClient::Provider](docs/Provider.md)
|
138
141
|
- [PrimaryConnectClient::Result](docs/Result.md)
|
data/docs/Meta.md
CHANGED
@@ -13,6 +13,7 @@
|
|
13
13
|
| **transmission** | [**MetaTransmission**](MetaTransmission.md) | | [optional] |
|
14
14
|
| **facility_code** | **String** | | [optional] |
|
15
15
|
| **echo** | **Object** | Arbitrary key/value pairs to store with the Order | [optional] |
|
16
|
+
| **provenances** | [**Array<MetaProvenances>**](MetaProvenances.md) | | [optional] |
|
16
17
|
|
17
18
|
## Example
|
18
19
|
|
@@ -28,7 +29,8 @@ instance = PrimaryConnectClient::Meta.new(
|
|
28
29
|
message: null,
|
29
30
|
transmission: null,
|
30
31
|
facility_code: 123,
|
31
|
-
echo: null
|
32
|
+
echo: null,
|
33
|
+
provenances: null
|
32
34
|
)
|
33
35
|
```
|
34
36
|
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# PrimaryConnectClient::MetaDestination
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **id** | **String** | | [optional] |
|
8
|
+
| **name** | **String** | | [optional] |
|
9
|
+
| **config** | **Object** | Arbitrary key/value pairs for Lab specific use | [optional] |
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'primary_connect_client'
|
15
|
+
|
16
|
+
instance = PrimaryConnectClient::MetaDestination.new(
|
17
|
+
id: 01FXNPV4TCTGRSV4EGTJMW0D0Y,
|
18
|
+
name: Sample Lab,
|
19
|
+
config: {"key1":"value1","key2":"value2"}
|
20
|
+
)
|
21
|
+
```
|
22
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# PrimaryConnectClient::MetaProvenances
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **destination** | [**MetaDestination**](MetaDestination.md) | | [optional] |
|
8
|
+
| **placer_id** | **String** | | [optional] |
|
9
|
+
| **rerouted_at** | **Time** | ISO-8601 | [optional] |
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'primary_connect_client'
|
15
|
+
|
16
|
+
instance = PrimaryConnectClient::MetaProvenances.new(
|
17
|
+
destination: null,
|
18
|
+
placer_id: ABC123,
|
19
|
+
rerouted_at: 2021-07-30T20:27:55Z
|
20
|
+
)
|
21
|
+
```
|
22
|
+
|
data/docs/Order.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **patient** | [**
|
7
|
+
| **patient** | [**OrderPatient**](OrderPatient.md) | | [optional] |
|
8
8
|
| **subject** | [**Subject**](Subject.md) | | [optional] |
|
9
9
|
| **visit** | [**Visit**](Visit.md) | | [optional] |
|
10
10
|
| **meta** | [**Meta**](Meta.md) | | [optional] |
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# PrimaryConnectClient::OrderPatient
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **identifiers** | [**Array<Identifier>**](Identifier.md) | List of IDs and types that identify the patient | [optional] |
|
8
|
+
| **demographics** | [**Demographics**](Demographics.md) | | [optional] |
|
9
|
+
| **notes** | **Array<String>** | Patient-level notes | [optional] |
|
10
|
+
| **contacts** | [**Array<OrderPatientContacts>**](OrderPatientContacts.md) | | [optional] |
|
11
|
+
|
12
|
+
## Example
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
require 'primary_connect_client'
|
16
|
+
|
17
|
+
instance = PrimaryConnectClient::OrderPatient.new(
|
18
|
+
identifiers: null,
|
19
|
+
demographics: null,
|
20
|
+
notes: null,
|
21
|
+
contacts: null
|
22
|
+
)
|
23
|
+
```
|
24
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# PrimaryConnectClient::OrderPatientContacts
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **name** | [**Name**](Name.md) | | [optional] |
|
8
|
+
| **address** | [**Address**](Address.md) | | [optional] |
|
9
|
+
| **phone_numbers** | [**Array<PhoneNumber>**](PhoneNumber.md) | | [optional] |
|
10
|
+
| **relation_to_patient** | **String** | Personal relationship to the patient | [optional] |
|
11
|
+
| **email_addresses** | **Array<String>** | | [optional] |
|
12
|
+
| **roles** | **Array<String>** | e.g. Employer, Emergency Contact | [optional] |
|
13
|
+
|
14
|
+
## Example
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
require 'primary_connect_client'
|
18
|
+
|
19
|
+
instance = PrimaryConnectClient::OrderPatientContacts.new(
|
20
|
+
name: null,
|
21
|
+
address: null,
|
22
|
+
phone_numbers: null,
|
23
|
+
relation_to_patient: null,
|
24
|
+
email_addresses: null,
|
25
|
+
roles: null
|
26
|
+
)
|
27
|
+
```
|
28
|
+
|
data/docs/Patient.md
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
| **identifiers** | [**Array<Identifier>**](Identifier.md) | List of IDs and types that identify the patient | [optional] |
|
8
8
|
| **demographics** | [**Demographics**](Demographics.md) | | [optional] |
|
9
9
|
| **notes** | **Array<String>** | Patient-level notes | [optional] |
|
10
|
-
| **contacts** | [**Array<
|
10
|
+
| **contacts** | [**Array<OrderPatientContacts>**](OrderPatientContacts.md) | | [optional] |
|
11
11
|
|
12
12
|
## Example
|
13
13
|
|
data/docs/Result.md
CHANGED
@@ -23,6 +23,7 @@
|
|
23
23
|
| **producer_order_id** | **String** | Unique ID generated by resulting entity | [optional] |
|
24
24
|
| **finding_value** | [**CodedValue**](CodedValue.md) | | [optional] |
|
25
25
|
| **resulting_device** | [**Device**](Device.md) | | [optional] |
|
26
|
+
| **procedure** | [**CodedValue**](CodedValue.md) | | [optional] |
|
26
27
|
|
27
28
|
## Example
|
28
29
|
|
@@ -48,7 +49,8 @@ instance = PrimaryConnectClient::Result.new(
|
|
48
49
|
observation_method: null,
|
49
50
|
producer_order_id: 12345678,
|
50
51
|
finding_value: null,
|
51
|
-
resulting_device: null
|
52
|
+
resulting_device: null,
|
53
|
+
procedure: null
|
52
54
|
)
|
53
55
|
```
|
54
56
|
|
@@ -35,6 +35,8 @@ module PrimaryConnectClient
|
|
35
35
|
# Arbitrary key/value pairs to store with the Order
|
36
36
|
attr_accessor :echo
|
37
37
|
|
38
|
+
attr_accessor :provenances
|
39
|
+
|
38
40
|
class EnumAttributeValidator
|
39
41
|
attr_reader :datatype
|
40
42
|
attr_reader :allowable_values
|
@@ -68,7 +70,8 @@ module PrimaryConnectClient
|
|
68
70
|
:'message' => :'message',
|
69
71
|
:'transmission' => :'transmission',
|
70
72
|
:'facility_code' => :'facilityCode',
|
71
|
-
:'echo' => :'echo'
|
73
|
+
:'echo' => :'echo',
|
74
|
+
:'provenances' => :'provenances'
|
72
75
|
}
|
73
76
|
end
|
74
77
|
|
@@ -88,7 +91,8 @@ module PrimaryConnectClient
|
|
88
91
|
:'message' => :'MetaMessage',
|
89
92
|
:'transmission' => :'MetaTransmission',
|
90
93
|
:'facility_code' => :'String',
|
91
|
-
:'echo' => :'Object'
|
94
|
+
:'echo' => :'Object',
|
95
|
+
:'provenances' => :'Array<MetaProvenances>'
|
92
96
|
}
|
93
97
|
end
|
94
98
|
|
@@ -150,6 +154,12 @@ module PrimaryConnectClient
|
|
150
154
|
if attributes.key?(:'echo')
|
151
155
|
self.echo = attributes[:'echo']
|
152
156
|
end
|
157
|
+
|
158
|
+
if attributes.key?(:'provenances')
|
159
|
+
if (value = attributes[:'provenances']).is_a?(Array)
|
160
|
+
self.provenances = value
|
161
|
+
end
|
162
|
+
end
|
153
163
|
end
|
154
164
|
|
155
165
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -190,7 +200,8 @@ module PrimaryConnectClient
|
|
190
200
|
message == o.message &&
|
191
201
|
transmission == o.transmission &&
|
192
202
|
facility_code == o.facility_code &&
|
193
|
-
echo == o.echo
|
203
|
+
echo == o.echo &&
|
204
|
+
provenances == o.provenances
|
194
205
|
end
|
195
206
|
|
196
207
|
# @see the `==` method
|
@@ -202,7 +213,7 @@ module PrimaryConnectClient
|
|
202
213
|
# Calculates hash code according to all attributes.
|
203
214
|
# @return [Integer] Hash code
|
204
215
|
def hash
|
205
|
-
[event_type, event_date_and_time, test, source, destinations, message, transmission, facility_code, echo].hash
|
216
|
+
[event_type, event_date_and_time, test, source, destinations, message, transmission, facility_code, echo, provenances].hash
|
206
217
|
end
|
207
218
|
|
208
219
|
# Builds the object from hash
|
@@ -0,0 +1,237 @@
|
|
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 MetaDestination
|
18
|
+
attr_accessor :id
|
19
|
+
|
20
|
+
attr_accessor :name
|
21
|
+
|
22
|
+
# Arbitrary key/value pairs for Lab specific use
|
23
|
+
attr_accessor :config
|
24
|
+
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
26
|
+
def self.attribute_map
|
27
|
+
{
|
28
|
+
:'id' => :'id',
|
29
|
+
:'name' => :'name',
|
30
|
+
:'config' => :'config'
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# Returns all the JSON keys this model knows about
|
35
|
+
def self.acceptable_attributes
|
36
|
+
attribute_map.values
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute type mapping.
|
40
|
+
def self.openapi_types
|
41
|
+
{
|
42
|
+
:'id' => :'String',
|
43
|
+
:'name' => :'String',
|
44
|
+
:'config' => :'Object'
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# List of attributes with nullable: true
|
49
|
+
def self.openapi_nullable
|
50
|
+
Set.new([
|
51
|
+
])
|
52
|
+
end
|
53
|
+
|
54
|
+
# Initializes the object
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
56
|
+
def initialize(attributes = {})
|
57
|
+
if (!attributes.is_a?(Hash))
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PrimaryConnectClient::MetaDestination` initialize method"
|
59
|
+
end
|
60
|
+
|
61
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
62
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
63
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
64
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PrimaryConnectClient::MetaDestination`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
65
|
+
end
|
66
|
+
h[k.to_sym] = v
|
67
|
+
}
|
68
|
+
|
69
|
+
if attributes.key?(:'id')
|
70
|
+
self.id = attributes[:'id']
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.key?(:'name')
|
74
|
+
self.name = attributes[:'name']
|
75
|
+
end
|
76
|
+
|
77
|
+
if attributes.key?(:'config')
|
78
|
+
self.config = attributes[:'config']
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
83
|
+
# @return Array for valid properties with the reasons
|
84
|
+
def list_invalid_properties
|
85
|
+
invalid_properties = Array.new
|
86
|
+
invalid_properties
|
87
|
+
end
|
88
|
+
|
89
|
+
# Check to see if the all the properties in the model are valid
|
90
|
+
# @return true if the model is valid
|
91
|
+
def valid?
|
92
|
+
true
|
93
|
+
end
|
94
|
+
|
95
|
+
# Checks equality by comparing each attribute.
|
96
|
+
# @param [Object] Object to be compared
|
97
|
+
def ==(o)
|
98
|
+
return true if self.equal?(o)
|
99
|
+
self.class == o.class &&
|
100
|
+
id == o.id &&
|
101
|
+
name == o.name &&
|
102
|
+
config == o.config
|
103
|
+
end
|
104
|
+
|
105
|
+
# @see the `==` method
|
106
|
+
# @param [Object] Object to be compared
|
107
|
+
def eql?(o)
|
108
|
+
self == o
|
109
|
+
end
|
110
|
+
|
111
|
+
# Calculates hash code according to all attributes.
|
112
|
+
# @return [Integer] Hash code
|
113
|
+
def hash
|
114
|
+
[id, name, config].hash
|
115
|
+
end
|
116
|
+
|
117
|
+
# Builds the object from hash
|
118
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
119
|
+
# @return [Object] Returns the model itself
|
120
|
+
def self.build_from_hash(attributes)
|
121
|
+
new.build_from_hash(attributes)
|
122
|
+
end
|
123
|
+
|
124
|
+
# Builds the object from hash
|
125
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
126
|
+
# @return [Object] Returns the model itself
|
127
|
+
def build_from_hash(attributes)
|
128
|
+
return nil unless attributes.is_a?(Hash)
|
129
|
+
self.class.openapi_types.each_pair do |key, type|
|
130
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
131
|
+
self.send("#{key}=", nil)
|
132
|
+
elsif type =~ /\AArray<(.*)>/i
|
133
|
+
# check to ensure the input is an array given that the attribute
|
134
|
+
# is documented as an array but the input is not
|
135
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
136
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
137
|
+
end
|
138
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
139
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
self
|
144
|
+
end
|
145
|
+
|
146
|
+
# Deserializes the data based on type
|
147
|
+
# @param string type Data type
|
148
|
+
# @param string value Value to be deserialized
|
149
|
+
# @return [Object] Deserialized data
|
150
|
+
def _deserialize(type, value)
|
151
|
+
case type.to_sym
|
152
|
+
when :Time
|
153
|
+
Time.parse(value)
|
154
|
+
when :Date
|
155
|
+
Date.parse(value)
|
156
|
+
when :String
|
157
|
+
value.to_s
|
158
|
+
when :Integer
|
159
|
+
value.to_i
|
160
|
+
when :Float
|
161
|
+
value.to_f
|
162
|
+
when :Boolean
|
163
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
164
|
+
true
|
165
|
+
else
|
166
|
+
false
|
167
|
+
end
|
168
|
+
when :Object
|
169
|
+
# generic object (usually a Hash), return directly
|
170
|
+
value
|
171
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
172
|
+
inner_type = Regexp.last_match[:inner_type]
|
173
|
+
value.map { |v| _deserialize(inner_type, v) }
|
174
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
175
|
+
k_type = Regexp.last_match[:k_type]
|
176
|
+
v_type = Regexp.last_match[:v_type]
|
177
|
+
{}.tap do |hash|
|
178
|
+
value.each do |k, v|
|
179
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
180
|
+
end
|
181
|
+
end
|
182
|
+
else # model
|
183
|
+
# models (e.g. Pet) or oneOf
|
184
|
+
klass = PrimaryConnectClient.const_get(type)
|
185
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
# Returns the string representation of the object
|
190
|
+
# @return [String] String presentation of the object
|
191
|
+
def to_s
|
192
|
+
to_hash.to_s
|
193
|
+
end
|
194
|
+
|
195
|
+
# to_body is an alias to to_hash (backward compatibility)
|
196
|
+
# @return [Hash] Returns the object in the form of hash
|
197
|
+
def to_body
|
198
|
+
to_hash
|
199
|
+
end
|
200
|
+
|
201
|
+
# Returns the object in the form of hash
|
202
|
+
# @return [Hash] Returns the object in the form of hash
|
203
|
+
def to_hash
|
204
|
+
hash = {}
|
205
|
+
self.class.attribute_map.each_pair do |attr, param|
|
206
|
+
value = self.send(attr)
|
207
|
+
if value.nil?
|
208
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
209
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
210
|
+
end
|
211
|
+
|
212
|
+
hash[param] = _to_hash(value)
|
213
|
+
end
|
214
|
+
hash
|
215
|
+
end
|
216
|
+
|
217
|
+
# Outputs non-array value in the form of hash
|
218
|
+
# For object, use to_hash. Otherwise, just return the value
|
219
|
+
# @param [Object] value Any valid value
|
220
|
+
# @return [Hash] Returns the value in the form of hash
|
221
|
+
def _to_hash(value)
|
222
|
+
if value.is_a?(Array)
|
223
|
+
value.compact.map { |v| _to_hash(v) }
|
224
|
+
elsif value.is_a?(Hash)
|
225
|
+
{}.tap do |hash|
|
226
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
227
|
+
end
|
228
|
+
elsif value.respond_to? :to_hash
|
229
|
+
value.to_hash
|
230
|
+
else
|
231
|
+
value
|
232
|
+
end
|
233
|
+
end
|
234
|
+
|
235
|
+
end
|
236
|
+
|
237
|
+
end
|