candidhealth 0.35.1 → 0.35.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/candidhealth/credentialing/v_2/client.rb +18 -6
- data/lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb +12 -14
- data/lib/candidhealth/pre_encounter/client.rb +5 -5
- data/lib/candidhealth/pre_encounter/common/types/base_model.rb +104 -0
- data/lib/candidhealth/pre_encounter/common/types/{not_found_error_body.rb → error_base_4_xx.rb} +16 -14
- data/lib/candidhealth/pre_encounter/common/types/version_conflict_error_body.rb +13 -11
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverage.rb +10 -10
- data/lib/candidhealth/pre_encounter/notes/client.rb +32 -0
- data/lib/candidhealth/pre_encounter/notes/v_1/client.rb +257 -0
- data/lib/candidhealth/pre_encounter/notes/v_1/types/mutable_note.rb +86 -0
- data/lib/candidhealth/pre_encounter/notes/v_1/types/note.rb +149 -0
- data/lib/candidhealth/pre_encounter/patients/v_1/client.rb +20 -8
- data/lib/candidhealth/pre_encounter/patients/v_1/types/mutable_patient.rb +18 -2
- data/lib/candidhealth/pre_encounter/patients/v_1/types/mutable_patient_with_mrn.rb +18 -2
- data/lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb +26 -10
- data/lib/candidhealth/pre_encounter/tags/client.rb +32 -0
- data/lib/candidhealth/pre_encounter/tags/v_1/client.rb +311 -0
- data/lib/candidhealth/pre_encounter/{patients/v_1/types/invalid_mrn_error_body.rb → tags/v_1/types/mutable_tag.rb} +15 -24
- data/lib/candidhealth/pre_encounter/tags/v_1/types/tag.rb +123 -0
- data/lib/candidhealth/pre_encounter/tags/v_1/types/tag_page.rb +90 -0
- data/lib/candidhealth/x_12/v_1/types/rarc.rb +1 -0
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +7 -5
- metadata +13 -7
- data/lib/candidhealth/pre_encounter/common/types/error_base.rb +0 -60
- data/lib/candidhealth/pre_encounter/patients/v_1/types/potential_duplicate_patient.rb +0 -72
- data/lib/candidhealth/pre_encounter/patients/v_1/types/potential_duplicate_patients_error_body.rb +0 -84
@@ -0,0 +1,257 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../../../requests"
|
4
|
+
require_relative "types/note"
|
5
|
+
require_relative "types/mutable_note"
|
6
|
+
require "async"
|
7
|
+
|
8
|
+
module CandidApiClient
|
9
|
+
module PreEncounter
|
10
|
+
module Notes
|
11
|
+
module V1
|
12
|
+
class V1Client
|
13
|
+
# @return [CandidApiClient::RequestClient]
|
14
|
+
attr_reader :request_client
|
15
|
+
|
16
|
+
# @param request_client [CandidApiClient::RequestClient]
|
17
|
+
# @return [CandidApiClient::PreEncounter::Notes::V1::V1Client]
|
18
|
+
def initialize(request_client:)
|
19
|
+
@request_client = request_client
|
20
|
+
end
|
21
|
+
|
22
|
+
# Gets a note by NoteId.
|
23
|
+
#
|
24
|
+
# @param id [String]
|
25
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
26
|
+
# @return [CandidApiClient::PreEncounter::Notes::V1::Types::Note]
|
27
|
+
# @example
|
28
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
29
|
+
# api.pre_encounter.notes.v_1.get(id: "string")
|
30
|
+
def get(id:, request_options: nil)
|
31
|
+
response = @request_client.conn.get do |req|
|
32
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
33
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
34
|
+
req.headers = {
|
35
|
+
**(req.headers || {}),
|
36
|
+
**@request_client.get_headers,
|
37
|
+
**(request_options&.additional_headers || {})
|
38
|
+
}.compact
|
39
|
+
req.url "#{@request_client.get_url(environment: PreEncounter,
|
40
|
+
request_options: request_options)}/notes/v1/#{id}"
|
41
|
+
end
|
42
|
+
CandidApiClient::PreEncounter::Notes::V1::Types::Note.from_json(json_object: response.body)
|
43
|
+
end
|
44
|
+
|
45
|
+
# Adds a new note.
|
46
|
+
#
|
47
|
+
# @param request [Hash] Request of type CandidApiClient::PreEncounter::Notes::V1::Types::MutableNote, as a Hash
|
48
|
+
# * :value (String)
|
49
|
+
# * :author_email (String)
|
50
|
+
# * :author_name (String)
|
51
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
52
|
+
# @return [CandidApiClient::PreEncounter::Notes::V1::Types::Note]
|
53
|
+
# @example
|
54
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
55
|
+
# api.pre_encounter.notes.v_1.create(request: { value: "string", author_email: "string", author_name: "string" })
|
56
|
+
def create(request:, request_options: nil)
|
57
|
+
response = @request_client.conn.post do |req|
|
58
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
59
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
60
|
+
req.headers = {
|
61
|
+
**(req.headers || {}),
|
62
|
+
**@request_client.get_headers,
|
63
|
+
**(request_options&.additional_headers || {})
|
64
|
+
}.compact
|
65
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
66
|
+
req.url "#{@request_client.get_url(environment: PreEncounter, request_options: request_options)}/notes/v1"
|
67
|
+
end
|
68
|
+
CandidApiClient::PreEncounter::Notes::V1::Types::Note.from_json(json_object: response.body)
|
69
|
+
end
|
70
|
+
|
71
|
+
# Updates a note. The path must contain the most recent version to prevent races.
|
72
|
+
#
|
73
|
+
# @param id [String]
|
74
|
+
# @param version [String]
|
75
|
+
# @param request [Hash] Request of type CandidApiClient::PreEncounter::Notes::V1::Types::MutableNote, as a Hash
|
76
|
+
# * :value (String)
|
77
|
+
# * :author_email (String)
|
78
|
+
# * :author_name (String)
|
79
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
80
|
+
# @return [CandidApiClient::PreEncounter::Notes::V1::Types::Note]
|
81
|
+
# @example
|
82
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
83
|
+
# api.pre_encounter.notes.v_1.update(
|
84
|
+
# id: "string",
|
85
|
+
# version: "string",
|
86
|
+
# request: { value: "string", author_email: "string", author_name: "string" }
|
87
|
+
# )
|
88
|
+
def update(id:, version:, request:, request_options: nil)
|
89
|
+
response = @request_client.conn.put do |req|
|
90
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
91
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
92
|
+
req.headers = {
|
93
|
+
**(req.headers || {}),
|
94
|
+
**@request_client.get_headers,
|
95
|
+
**(request_options&.additional_headers || {})
|
96
|
+
}.compact
|
97
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
98
|
+
req.url "#{@request_client.get_url(environment: PreEncounter,
|
99
|
+
request_options: request_options)}/notes/v1/#{id}/#{version}"
|
100
|
+
end
|
101
|
+
CandidApiClient::PreEncounter::Notes::V1::Types::Note.from_json(json_object: response.body)
|
102
|
+
end
|
103
|
+
|
104
|
+
# Sets a note as deactivated. The path must contain the most recent version to
|
105
|
+
# prevent races.
|
106
|
+
#
|
107
|
+
# @param id [String]
|
108
|
+
# @param version [String]
|
109
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
110
|
+
# @return [Void]
|
111
|
+
# @example
|
112
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
113
|
+
# api.pre_encounter.notes.v_1.deactivate(id: "string", version: "string")
|
114
|
+
def deactivate(id:, version:, request_options: nil)
|
115
|
+
@request_client.conn.delete do |req|
|
116
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
117
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
118
|
+
req.headers = {
|
119
|
+
**(req.headers || {}),
|
120
|
+
**@request_client.get_headers,
|
121
|
+
**(request_options&.additional_headers || {})
|
122
|
+
}.compact
|
123
|
+
req.url "#{@request_client.get_url(environment: PreEncounter,
|
124
|
+
request_options: request_options)}/notes/v1/#{id}/#{version}"
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
class AsyncV1Client
|
130
|
+
# @return [CandidApiClient::AsyncRequestClient]
|
131
|
+
attr_reader :request_client
|
132
|
+
|
133
|
+
# @param request_client [CandidApiClient::AsyncRequestClient]
|
134
|
+
# @return [CandidApiClient::PreEncounter::Notes::V1::AsyncV1Client]
|
135
|
+
def initialize(request_client:)
|
136
|
+
@request_client = request_client
|
137
|
+
end
|
138
|
+
|
139
|
+
# Gets a note by NoteId.
|
140
|
+
#
|
141
|
+
# @param id [String]
|
142
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
143
|
+
# @return [CandidApiClient::PreEncounter::Notes::V1::Types::Note]
|
144
|
+
# @example
|
145
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
146
|
+
# api.pre_encounter.notes.v_1.get(id: "string")
|
147
|
+
def get(id:, request_options: nil)
|
148
|
+
Async do
|
149
|
+
response = @request_client.conn.get do |req|
|
150
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
151
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
152
|
+
req.headers = {
|
153
|
+
**(req.headers || {}),
|
154
|
+
**@request_client.get_headers,
|
155
|
+
**(request_options&.additional_headers || {})
|
156
|
+
}.compact
|
157
|
+
req.url "#{@request_client.get_url(environment: PreEncounter,
|
158
|
+
request_options: request_options)}/notes/v1/#{id}"
|
159
|
+
end
|
160
|
+
CandidApiClient::PreEncounter::Notes::V1::Types::Note.from_json(json_object: response.body)
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
# Adds a new note.
|
165
|
+
#
|
166
|
+
# @param request [Hash] Request of type CandidApiClient::PreEncounter::Notes::V1::Types::MutableNote, as a Hash
|
167
|
+
# * :value (String)
|
168
|
+
# * :author_email (String)
|
169
|
+
# * :author_name (String)
|
170
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
171
|
+
# @return [CandidApiClient::PreEncounter::Notes::V1::Types::Note]
|
172
|
+
# @example
|
173
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
174
|
+
# api.pre_encounter.notes.v_1.create(request: { value: "string", author_email: "string", author_name: "string" })
|
175
|
+
def create(request:, request_options: nil)
|
176
|
+
Async do
|
177
|
+
response = @request_client.conn.post do |req|
|
178
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
179
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
180
|
+
req.headers = {
|
181
|
+
**(req.headers || {}),
|
182
|
+
**@request_client.get_headers,
|
183
|
+
**(request_options&.additional_headers || {})
|
184
|
+
}.compact
|
185
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
186
|
+
req.url "#{@request_client.get_url(environment: PreEncounter,
|
187
|
+
request_options: request_options)}/notes/v1"
|
188
|
+
end
|
189
|
+
CandidApiClient::PreEncounter::Notes::V1::Types::Note.from_json(json_object: response.body)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
# Updates a note. The path must contain the most recent version to prevent races.
|
194
|
+
#
|
195
|
+
# @param id [String]
|
196
|
+
# @param version [String]
|
197
|
+
# @param request [Hash] Request of type CandidApiClient::PreEncounter::Notes::V1::Types::MutableNote, as a Hash
|
198
|
+
# * :value (String)
|
199
|
+
# * :author_email (String)
|
200
|
+
# * :author_name (String)
|
201
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
202
|
+
# @return [CandidApiClient::PreEncounter::Notes::V1::Types::Note]
|
203
|
+
# @example
|
204
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
205
|
+
# api.pre_encounter.notes.v_1.update(
|
206
|
+
# id: "string",
|
207
|
+
# version: "string",
|
208
|
+
# request: { value: "string", author_email: "string", author_name: "string" }
|
209
|
+
# )
|
210
|
+
def update(id:, version:, request:, request_options: nil)
|
211
|
+
Async do
|
212
|
+
response = @request_client.conn.put do |req|
|
213
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
214
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
215
|
+
req.headers = {
|
216
|
+
**(req.headers || {}),
|
217
|
+
**@request_client.get_headers,
|
218
|
+
**(request_options&.additional_headers || {})
|
219
|
+
}.compact
|
220
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
221
|
+
req.url "#{@request_client.get_url(environment: PreEncounter,
|
222
|
+
request_options: request_options)}/notes/v1/#{id}/#{version}"
|
223
|
+
end
|
224
|
+
CandidApiClient::PreEncounter::Notes::V1::Types::Note.from_json(json_object: response.body)
|
225
|
+
end
|
226
|
+
end
|
227
|
+
|
228
|
+
# Sets a note as deactivated. The path must contain the most recent version to
|
229
|
+
# prevent races.
|
230
|
+
#
|
231
|
+
# @param id [String]
|
232
|
+
# @param version [String]
|
233
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
234
|
+
# @return [Void]
|
235
|
+
# @example
|
236
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
237
|
+
# api.pre_encounter.notes.v_1.deactivate(id: "string", version: "string")
|
238
|
+
def deactivate(id:, version:, request_options: nil)
|
239
|
+
Async do
|
240
|
+
@request_client.conn.delete do |req|
|
241
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
242
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
243
|
+
req.headers = {
|
244
|
+
**(req.headers || {}),
|
245
|
+
**@request_client.get_headers,
|
246
|
+
**(request_options&.additional_headers || {})
|
247
|
+
}.compact
|
248
|
+
req.url "#{@request_client.get_url(environment: PreEncounter,
|
249
|
+
request_options: request_options)}/notes/v1/#{id}/#{version}"
|
250
|
+
end
|
251
|
+
end
|
252
|
+
end
|
253
|
+
end
|
254
|
+
end
|
255
|
+
end
|
256
|
+
end
|
257
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module CandidApiClient
|
7
|
+
module PreEncounter
|
8
|
+
module Notes
|
9
|
+
module V1
|
10
|
+
module Types
|
11
|
+
# An object representing a Note.
|
12
|
+
class MutableNote
|
13
|
+
# @return [String]
|
14
|
+
attr_reader :value
|
15
|
+
# @return [String]
|
16
|
+
attr_reader :author_email
|
17
|
+
# @return [String]
|
18
|
+
attr_reader :author_name
|
19
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
20
|
+
attr_reader :additional_properties
|
21
|
+
# @return [Object]
|
22
|
+
attr_reader :_field_set
|
23
|
+
protected :_field_set
|
24
|
+
|
25
|
+
OMIT = Object.new
|
26
|
+
|
27
|
+
# @param value [String]
|
28
|
+
# @param author_email [String]
|
29
|
+
# @param author_name [String]
|
30
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
31
|
+
# @return [CandidApiClient::PreEncounter::Notes::V1::Types::MutableNote]
|
32
|
+
def initialize(value:, author_email: OMIT, author_name: OMIT, additional_properties: nil)
|
33
|
+
@value = value
|
34
|
+
@author_email = author_email if author_email != OMIT
|
35
|
+
@author_name = author_name if author_name != OMIT
|
36
|
+
@additional_properties = additional_properties
|
37
|
+
@_field_set = {
|
38
|
+
"value": value,
|
39
|
+
"author_email": author_email,
|
40
|
+
"author_name": author_name
|
41
|
+
}.reject do |_k, v|
|
42
|
+
v == OMIT
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# Deserialize a JSON object to an instance of MutableNote
|
47
|
+
#
|
48
|
+
# @param json_object [String]
|
49
|
+
# @return [CandidApiClient::PreEncounter::Notes::V1::Types::MutableNote]
|
50
|
+
def self.from_json(json_object:)
|
51
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
52
|
+
value = struct["value"]
|
53
|
+
author_email = struct["author_email"]
|
54
|
+
author_name = struct["author_name"]
|
55
|
+
new(
|
56
|
+
value: value,
|
57
|
+
author_email: author_email,
|
58
|
+
author_name: author_name,
|
59
|
+
additional_properties: struct
|
60
|
+
)
|
61
|
+
end
|
62
|
+
|
63
|
+
# Serialize an instance of MutableNote to a JSON object
|
64
|
+
#
|
65
|
+
# @return [String]
|
66
|
+
def to_json(*_args)
|
67
|
+
@_field_set&.to_json
|
68
|
+
end
|
69
|
+
|
70
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
71
|
+
# hash and check each fields type against the current object's property
|
72
|
+
# definitions.
|
73
|
+
#
|
74
|
+
# @param obj [Object]
|
75
|
+
# @return [Void]
|
76
|
+
def self.validate_raw(obj:)
|
77
|
+
obj.value.is_a?(String) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
|
78
|
+
obj.author_email&.is_a?(String) != false || raise("Passed value for field obj.author_email is not the expected type, validation failed.")
|
79
|
+
obj.author_name&.is_a?(String) != false || raise("Passed value for field obj.author_name is not the expected type, validation failed.")
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -0,0 +1,149 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "date"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module CandidApiClient
|
8
|
+
module PreEncounter
|
9
|
+
module Notes
|
10
|
+
module V1
|
11
|
+
module Types
|
12
|
+
# A Note object with immutable server-owned properties.
|
13
|
+
class Note
|
14
|
+
# @return [String]
|
15
|
+
attr_reader :id
|
16
|
+
# @return [DateTime]
|
17
|
+
attr_reader :created_at
|
18
|
+
# @return [String] The organization that owns this object.
|
19
|
+
attr_reader :organization_id
|
20
|
+
# @return [Boolean] True if the object is deactivated. Deactivated objects are not returned in
|
21
|
+
# search results but are returned in all other endpoints including scan.
|
22
|
+
attr_reader :deactivated
|
23
|
+
# @return [Integer] The version of the object. Any update to any property of an object object will
|
24
|
+
# create a new version.
|
25
|
+
attr_reader :version
|
26
|
+
# @return [DateTime]
|
27
|
+
attr_reader :updated_at
|
28
|
+
# @return [String] The user ID of the user who last updated the object.
|
29
|
+
attr_reader :updating_user_id
|
30
|
+
# @return [String]
|
31
|
+
attr_reader :value
|
32
|
+
# @return [String]
|
33
|
+
attr_reader :author_email
|
34
|
+
# @return [String]
|
35
|
+
attr_reader :author_name
|
36
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
37
|
+
attr_reader :additional_properties
|
38
|
+
# @return [Object]
|
39
|
+
attr_reader :_field_set
|
40
|
+
protected :_field_set
|
41
|
+
|
42
|
+
OMIT = Object.new
|
43
|
+
|
44
|
+
# @param id [String]
|
45
|
+
# @param created_at [DateTime]
|
46
|
+
# @param organization_id [String] The organization that owns this object.
|
47
|
+
# @param deactivated [Boolean] True if the object is deactivated. Deactivated objects are not returned in
|
48
|
+
# search results but are returned in all other endpoints including scan.
|
49
|
+
# @param version [Integer] The version of the object. Any update to any property of an object object will
|
50
|
+
# create a new version.
|
51
|
+
# @param updated_at [DateTime]
|
52
|
+
# @param updating_user_id [String] The user ID of the user who last updated the object.
|
53
|
+
# @param value [String]
|
54
|
+
# @param author_email [String]
|
55
|
+
# @param author_name [String]
|
56
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
57
|
+
# @return [CandidApiClient::PreEncounter::Notes::V1::Types::Note]
|
58
|
+
def initialize(id:, created_at:, organization_id:, deactivated:, version:, updated_at:, updating_user_id:,
|
59
|
+
value:, author_email: OMIT, author_name: OMIT, additional_properties: nil)
|
60
|
+
@id = id
|
61
|
+
@created_at = created_at
|
62
|
+
@organization_id = organization_id
|
63
|
+
@deactivated = deactivated
|
64
|
+
@version = version
|
65
|
+
@updated_at = updated_at
|
66
|
+
@updating_user_id = updating_user_id
|
67
|
+
@value = value
|
68
|
+
@author_email = author_email if author_email != OMIT
|
69
|
+
@author_name = author_name if author_name != OMIT
|
70
|
+
@additional_properties = additional_properties
|
71
|
+
@_field_set = {
|
72
|
+
"id": id,
|
73
|
+
"created_at": created_at,
|
74
|
+
"organization_id": organization_id,
|
75
|
+
"deactivated": deactivated,
|
76
|
+
"version": version,
|
77
|
+
"updated_at": updated_at,
|
78
|
+
"updating_user_id": updating_user_id,
|
79
|
+
"value": value,
|
80
|
+
"author_email": author_email,
|
81
|
+
"author_name": author_name
|
82
|
+
}.reject do |_k, v|
|
83
|
+
v == OMIT
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
# Deserialize a JSON object to an instance of Note
|
88
|
+
#
|
89
|
+
# @param json_object [String]
|
90
|
+
# @return [CandidApiClient::PreEncounter::Notes::V1::Types::Note]
|
91
|
+
def self.from_json(json_object:)
|
92
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
93
|
+
parsed_json = JSON.parse(json_object)
|
94
|
+
id = struct["id"]
|
95
|
+
created_at = (DateTime.parse(parsed_json["created_at"]) unless parsed_json["created_at"].nil?)
|
96
|
+
organization_id = struct["organization_id"]
|
97
|
+
deactivated = struct["deactivated"]
|
98
|
+
version = struct["version"]
|
99
|
+
updated_at = (DateTime.parse(parsed_json["updated_at"]) unless parsed_json["updated_at"].nil?)
|
100
|
+
updating_user_id = struct["updating_user_id"]
|
101
|
+
value = struct["value"]
|
102
|
+
author_email = struct["author_email"]
|
103
|
+
author_name = struct["author_name"]
|
104
|
+
new(
|
105
|
+
id: id,
|
106
|
+
created_at: created_at,
|
107
|
+
organization_id: organization_id,
|
108
|
+
deactivated: deactivated,
|
109
|
+
version: version,
|
110
|
+
updated_at: updated_at,
|
111
|
+
updating_user_id: updating_user_id,
|
112
|
+
value: value,
|
113
|
+
author_email: author_email,
|
114
|
+
author_name: author_name,
|
115
|
+
additional_properties: struct
|
116
|
+
)
|
117
|
+
end
|
118
|
+
|
119
|
+
# Serialize an instance of Note to a JSON object
|
120
|
+
#
|
121
|
+
# @return [String]
|
122
|
+
def to_json(*_args)
|
123
|
+
@_field_set&.to_json
|
124
|
+
end
|
125
|
+
|
126
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
127
|
+
# hash and check each fields type against the current object's property
|
128
|
+
# definitions.
|
129
|
+
#
|
130
|
+
# @param obj [Object]
|
131
|
+
# @return [Void]
|
132
|
+
def self.validate_raw(obj:)
|
133
|
+
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
134
|
+
obj.created_at.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
|
135
|
+
obj.organization_id.is_a?(String) != false || raise("Passed value for field obj.organization_id is not the expected type, validation failed.")
|
136
|
+
obj.deactivated.is_a?(Boolean) != false || raise("Passed value for field obj.deactivated is not the expected type, validation failed.")
|
137
|
+
obj.version.is_a?(Integer) != false || raise("Passed value for field obj.version is not the expected type, validation failed.")
|
138
|
+
obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
|
139
|
+
obj.updating_user_id.is_a?(String) != false || raise("Passed value for field obj.updating_user_id is not the expected type, validation failed.")
|
140
|
+
obj.value.is_a?(String) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
|
141
|
+
obj.author_email&.is_a?(String) != false || raise("Passed value for field obj.author_email is not the expected type, validation failed.")
|
142
|
+
obj.author_name&.is_a?(String) != false || raise("Passed value for field obj.author_name is not the expected type, validation failed.")
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|