candidhealth 0.35.2 → 0.35.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,311 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../../requests"
4
+ require_relative "types/tag"
5
+ require_relative "types/tag_page"
6
+ require_relative "types/mutable_tag"
7
+ require "async"
8
+
9
+ module CandidApiClient
10
+ module PreEncounter
11
+ module Tags
12
+ module V1
13
+ class V1Client
14
+ # @return [CandidApiClient::RequestClient]
15
+ attr_reader :request_client
16
+
17
+ # @param request_client [CandidApiClient::RequestClient]
18
+ # @return [CandidApiClient::PreEncounter::Tags::V1::V1Client]
19
+ def initialize(request_client:)
20
+ @request_client = request_client
21
+ end
22
+
23
+ # Gets a tag by TagId.
24
+ #
25
+ # @param id [String]
26
+ # @param request_options [CandidApiClient::RequestOptions]
27
+ # @return [CandidApiClient::PreEncounter::Tags::V1::Types::Tag]
28
+ # @example
29
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
30
+ # api.pre_encounter.tags.v_1.get(id: "string")
31
+ def get(id:, request_options: nil)
32
+ response = @request_client.conn.get do |req|
33
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
34
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
35
+ req.headers = {
36
+ **(req.headers || {}),
37
+ **@request_client.get_headers,
38
+ **(request_options&.additional_headers || {})
39
+ }.compact
40
+ req.url "#{@request_client.get_url(environment: PreEncounter,
41
+ request_options: request_options)}/tags/v1/#{id}"
42
+ end
43
+ CandidApiClient::PreEncounter::Tags::V1::Types::Tag.from_json(json_object: response.body)
44
+ end
45
+
46
+ # Gets all tags. Defaults to page size of 1000.
47
+ #
48
+ # @param limit [Integer]
49
+ # @param page_token [String]
50
+ # @param request_options [CandidApiClient::RequestOptions]
51
+ # @return [CandidApiClient::PreEncounter::Tags::V1::Types::TagPage]
52
+ # @example
53
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
54
+ # api.pre_encounter.tags.v_1.get_all(limit: 1, page_token: "string")
55
+ def get_all(limit: nil, page_token: nil, request_options: nil)
56
+ response = @request_client.conn.get do |req|
57
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
58
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
59
+ req.headers = {
60
+ **(req.headers || {}),
61
+ **@request_client.get_headers,
62
+ **(request_options&.additional_headers || {})
63
+ }.compact
64
+ req.params = {
65
+ **(request_options&.additional_query_parameters || {}),
66
+ "limit": limit,
67
+ "page_token": page_token
68
+ }.compact
69
+ req.url "#{@request_client.get_url(environment: PreEncounter, request_options: request_options)}/tags/v1"
70
+ end
71
+ CandidApiClient::PreEncounter::Tags::V1::Types::TagPage.from_json(json_object: response.body)
72
+ end
73
+
74
+ # Adds a new tag if it does not already exist, otherwise, returns the existing
75
+ # tag.
76
+ #
77
+ # @param request [Hash] Request of type CandidApiClient::PreEncounter::Tags::V1::Types::MutableTag, as a Hash
78
+ # * :value (String)
79
+ # @param request_options [CandidApiClient::RequestOptions]
80
+ # @return [CandidApiClient::PreEncounter::Tags::V1::Types::Tag]
81
+ # @example
82
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
83
+ # api.pre_encounter.tags.v_1.create(request: { value: "string" })
84
+ def create(request:, request_options: nil)
85
+ response = @request_client.conn.post do |req|
86
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
87
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
88
+ req.headers = {
89
+ **(req.headers || {}),
90
+ **@request_client.get_headers,
91
+ **(request_options&.additional_headers || {})
92
+ }.compact
93
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
94
+ req.url "#{@request_client.get_url(environment: PreEncounter, request_options: request_options)}/tags/v1"
95
+ end
96
+ CandidApiClient::PreEncounter::Tags::V1::Types::Tag.from_json(json_object: response.body)
97
+ end
98
+
99
+ # Updates a tag. The path must contain the most recent version to prevent races.
100
+ #
101
+ # @param id [String]
102
+ # @param version [String]
103
+ # @param request [Hash] Request of type CandidApiClient::PreEncounter::Tags::V1::Types::MutableTag, as a Hash
104
+ # * :value (String)
105
+ # @param request_options [CandidApiClient::RequestOptions]
106
+ # @return [CandidApiClient::PreEncounter::Tags::V1::Types::Tag]
107
+ # @example
108
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
109
+ # api.pre_encounter.tags.v_1.update(
110
+ # id: "string",
111
+ # version: "string",
112
+ # request: { value: "string" }
113
+ # )
114
+ def update(id:, version:, request:, request_options: nil)
115
+ response = @request_client.conn.put 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.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
124
+ req.url "#{@request_client.get_url(environment: PreEncounter,
125
+ request_options: request_options)}/tags/v1/#{id}/#{version}"
126
+ end
127
+ CandidApiClient::PreEncounter::Tags::V1::Types::Tag.from_json(json_object: response.body)
128
+ end
129
+
130
+ # Sets a tag as deactivated. The path must contain the most recent version to
131
+ # prevent races.
132
+ #
133
+ # @param id [String]
134
+ # @param version [String]
135
+ # @param request_options [CandidApiClient::RequestOptions]
136
+ # @return [Void]
137
+ # @example
138
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
139
+ # api.pre_encounter.tags.v_1.deactivate(id: "string", version: "string")
140
+ def deactivate(id:, version:, request_options: nil)
141
+ @request_client.conn.delete do |req|
142
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
143
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
144
+ req.headers = {
145
+ **(req.headers || {}),
146
+ **@request_client.get_headers,
147
+ **(request_options&.additional_headers || {})
148
+ }.compact
149
+ req.url "#{@request_client.get_url(environment: PreEncounter,
150
+ request_options: request_options)}/tags/v1/#{id}/#{version}"
151
+ end
152
+ end
153
+ end
154
+
155
+ class AsyncV1Client
156
+ # @return [CandidApiClient::AsyncRequestClient]
157
+ attr_reader :request_client
158
+
159
+ # @param request_client [CandidApiClient::AsyncRequestClient]
160
+ # @return [CandidApiClient::PreEncounter::Tags::V1::AsyncV1Client]
161
+ def initialize(request_client:)
162
+ @request_client = request_client
163
+ end
164
+
165
+ # Gets a tag by TagId.
166
+ #
167
+ # @param id [String]
168
+ # @param request_options [CandidApiClient::RequestOptions]
169
+ # @return [CandidApiClient::PreEncounter::Tags::V1::Types::Tag]
170
+ # @example
171
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
172
+ # api.pre_encounter.tags.v_1.get(id: "string")
173
+ def get(id:, request_options: nil)
174
+ Async do
175
+ response = @request_client.conn.get do |req|
176
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
177
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
178
+ req.headers = {
179
+ **(req.headers || {}),
180
+ **@request_client.get_headers,
181
+ **(request_options&.additional_headers || {})
182
+ }.compact
183
+ req.url "#{@request_client.get_url(environment: PreEncounter,
184
+ request_options: request_options)}/tags/v1/#{id}"
185
+ end
186
+ CandidApiClient::PreEncounter::Tags::V1::Types::Tag.from_json(json_object: response.body)
187
+ end
188
+ end
189
+
190
+ # Gets all tags. Defaults to page size of 1000.
191
+ #
192
+ # @param limit [Integer]
193
+ # @param page_token [String]
194
+ # @param request_options [CandidApiClient::RequestOptions]
195
+ # @return [CandidApiClient::PreEncounter::Tags::V1::Types::TagPage]
196
+ # @example
197
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
198
+ # api.pre_encounter.tags.v_1.get_all(limit: 1, page_token: "string")
199
+ def get_all(limit: nil, page_token: nil, request_options: nil)
200
+ Async do
201
+ response = @request_client.conn.get do |req|
202
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
203
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
204
+ req.headers = {
205
+ **(req.headers || {}),
206
+ **@request_client.get_headers,
207
+ **(request_options&.additional_headers || {})
208
+ }.compact
209
+ req.params = {
210
+ **(request_options&.additional_query_parameters || {}),
211
+ "limit": limit,
212
+ "page_token": page_token
213
+ }.compact
214
+ req.url "#{@request_client.get_url(environment: PreEncounter,
215
+ request_options: request_options)}/tags/v1"
216
+ end
217
+ CandidApiClient::PreEncounter::Tags::V1::Types::TagPage.from_json(json_object: response.body)
218
+ end
219
+ end
220
+
221
+ # Adds a new tag if it does not already exist, otherwise, returns the existing
222
+ # tag.
223
+ #
224
+ # @param request [Hash] Request of type CandidApiClient::PreEncounter::Tags::V1::Types::MutableTag, as a Hash
225
+ # * :value (String)
226
+ # @param request_options [CandidApiClient::RequestOptions]
227
+ # @return [CandidApiClient::PreEncounter::Tags::V1::Types::Tag]
228
+ # @example
229
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
230
+ # api.pre_encounter.tags.v_1.create(request: { value: "string" })
231
+ def create(request:, request_options: nil)
232
+ Async do
233
+ response = @request_client.conn.post do |req|
234
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
235
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
236
+ req.headers = {
237
+ **(req.headers || {}),
238
+ **@request_client.get_headers,
239
+ **(request_options&.additional_headers || {})
240
+ }.compact
241
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
242
+ req.url "#{@request_client.get_url(environment: PreEncounter,
243
+ request_options: request_options)}/tags/v1"
244
+ end
245
+ CandidApiClient::PreEncounter::Tags::V1::Types::Tag.from_json(json_object: response.body)
246
+ end
247
+ end
248
+
249
+ # Updates a tag. The path must contain the most recent version to prevent races.
250
+ #
251
+ # @param id [String]
252
+ # @param version [String]
253
+ # @param request [Hash] Request of type CandidApiClient::PreEncounter::Tags::V1::Types::MutableTag, as a Hash
254
+ # * :value (String)
255
+ # @param request_options [CandidApiClient::RequestOptions]
256
+ # @return [CandidApiClient::PreEncounter::Tags::V1::Types::Tag]
257
+ # @example
258
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
259
+ # api.pre_encounter.tags.v_1.update(
260
+ # id: "string",
261
+ # version: "string",
262
+ # request: { value: "string" }
263
+ # )
264
+ def update(id:, version:, request:, request_options: nil)
265
+ Async do
266
+ response = @request_client.conn.put do |req|
267
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
268
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
269
+ req.headers = {
270
+ **(req.headers || {}),
271
+ **@request_client.get_headers,
272
+ **(request_options&.additional_headers || {})
273
+ }.compact
274
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
275
+ req.url "#{@request_client.get_url(environment: PreEncounter,
276
+ request_options: request_options)}/tags/v1/#{id}/#{version}"
277
+ end
278
+ CandidApiClient::PreEncounter::Tags::V1::Types::Tag.from_json(json_object: response.body)
279
+ end
280
+ end
281
+
282
+ # Sets a tag as deactivated. The path must contain the most recent version to
283
+ # prevent races.
284
+ #
285
+ # @param id [String]
286
+ # @param version [String]
287
+ # @param request_options [CandidApiClient::RequestOptions]
288
+ # @return [Void]
289
+ # @example
290
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
291
+ # api.pre_encounter.tags.v_1.deactivate(id: "string", version: "string")
292
+ def deactivate(id:, version:, request_options: nil)
293
+ Async do
294
+ @request_client.conn.delete do |req|
295
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
296
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
297
+ req.headers = {
298
+ **(req.headers || {}),
299
+ **@request_client.get_headers,
300
+ **(request_options&.additional_headers || {})
301
+ }.compact
302
+ req.url "#{@request_client.get_url(environment: PreEncounter,
303
+ request_options: request_options)}/tags/v1/#{id}/#{version}"
304
+ end
305
+ end
306
+ end
307
+ end
308
+ end
309
+ end
310
+ end
311
+ end
@@ -0,0 +1,63 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module CandidApiClient
7
+ module PreEncounter
8
+ module Tags
9
+ module V1
10
+ module Types
11
+ # An object representing a Tag.
12
+ class MutableTag
13
+ # @return [String]
14
+ attr_reader :value
15
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
16
+ attr_reader :additional_properties
17
+ # @return [Object]
18
+ attr_reader :_field_set
19
+ protected :_field_set
20
+
21
+ OMIT = Object.new
22
+
23
+ # @param value [String]
24
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
25
+ # @return [CandidApiClient::PreEncounter::Tags::V1::Types::MutableTag]
26
+ def initialize(value:, additional_properties: nil)
27
+ @value = value
28
+ @additional_properties = additional_properties
29
+ @_field_set = { "value": value }
30
+ end
31
+
32
+ # Deserialize a JSON object to an instance of MutableTag
33
+ #
34
+ # @param json_object [String]
35
+ # @return [CandidApiClient::PreEncounter::Tags::V1::Types::MutableTag]
36
+ def self.from_json(json_object:)
37
+ struct = JSON.parse(json_object, object_class: OpenStruct)
38
+ value = struct["value"]
39
+ new(value: value, additional_properties: struct)
40
+ end
41
+
42
+ # Serialize an instance of MutableTag to a JSON object
43
+ #
44
+ # @return [String]
45
+ def to_json(*_args)
46
+ @_field_set&.to_json
47
+ end
48
+
49
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
50
+ # hash and check each fields type against the current object's property
51
+ # definitions.
52
+ #
53
+ # @param obj [Object]
54
+ # @return [Void]
55
+ def self.validate_raw(obj:)
56
+ obj.value.is_a?(String) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,123 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "date"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module CandidApiClient
8
+ module PreEncounter
9
+ module Tags
10
+ module V1
11
+ module Types
12
+ # A Tag object with immutable server-owned properties.
13
+ class Tag
14
+ # @return [String]
15
+ attr_reader :id
16
+ # @return [String] The organization that owns this object.
17
+ attr_reader :organization_id
18
+ # @return [Boolean] True if the object is deactivated. Deactivated objects are not returned in
19
+ # search results but are returned in all other endpoints including scan.
20
+ attr_reader :deactivated
21
+ # @return [Integer] The version of the object. Any update to any property of an object object will
22
+ # create a new version.
23
+ attr_reader :version
24
+ # @return [DateTime]
25
+ attr_reader :updated_at
26
+ # @return [String] The user ID of the user who last updated the object.
27
+ attr_reader :updating_user_id
28
+ # @return [String]
29
+ attr_reader :value
30
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
31
+ attr_reader :additional_properties
32
+ # @return [Object]
33
+ attr_reader :_field_set
34
+ protected :_field_set
35
+
36
+ OMIT = Object.new
37
+
38
+ # @param id [String]
39
+ # @param organization_id [String] The organization that owns this object.
40
+ # @param deactivated [Boolean] True if the object is deactivated. Deactivated objects are not returned in
41
+ # search results but are returned in all other endpoints including scan.
42
+ # @param version [Integer] The version of the object. Any update to any property of an object object will
43
+ # create a new version.
44
+ # @param updated_at [DateTime]
45
+ # @param updating_user_id [String] The user ID of the user who last updated the object.
46
+ # @param value [String]
47
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
48
+ # @return [CandidApiClient::PreEncounter::Tags::V1::Types::Tag]
49
+ def initialize(id:, organization_id:, deactivated:, version:, updated_at:, updating_user_id:, value:,
50
+ additional_properties: nil)
51
+ @id = id
52
+ @organization_id = organization_id
53
+ @deactivated = deactivated
54
+ @version = version
55
+ @updated_at = updated_at
56
+ @updating_user_id = updating_user_id
57
+ @value = value
58
+ @additional_properties = additional_properties
59
+ @_field_set = {
60
+ "id": id,
61
+ "organization_id": organization_id,
62
+ "deactivated": deactivated,
63
+ "version": version,
64
+ "updated_at": updated_at,
65
+ "updating_user_id": updating_user_id,
66
+ "value": value
67
+ }
68
+ end
69
+
70
+ # Deserialize a JSON object to an instance of Tag
71
+ #
72
+ # @param json_object [String]
73
+ # @return [CandidApiClient::PreEncounter::Tags::V1::Types::Tag]
74
+ def self.from_json(json_object:)
75
+ struct = JSON.parse(json_object, object_class: OpenStruct)
76
+ parsed_json = JSON.parse(json_object)
77
+ id = struct["id"]
78
+ organization_id = struct["organization_id"]
79
+ deactivated = struct["deactivated"]
80
+ version = struct["version"]
81
+ updated_at = (DateTime.parse(parsed_json["updated_at"]) unless parsed_json["updated_at"].nil?)
82
+ updating_user_id = struct["updating_user_id"]
83
+ value = struct["value"]
84
+ new(
85
+ id: id,
86
+ organization_id: organization_id,
87
+ deactivated: deactivated,
88
+ version: version,
89
+ updated_at: updated_at,
90
+ updating_user_id: updating_user_id,
91
+ value: value,
92
+ additional_properties: struct
93
+ )
94
+ end
95
+
96
+ # Serialize an instance of Tag to a JSON object
97
+ #
98
+ # @return [String]
99
+ def to_json(*_args)
100
+ @_field_set&.to_json
101
+ end
102
+
103
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
104
+ # hash and check each fields type against the current object's property
105
+ # definitions.
106
+ #
107
+ # @param obj [Object]
108
+ # @return [Void]
109
+ def self.validate_raw(obj:)
110
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
111
+ obj.organization_id.is_a?(String) != false || raise("Passed value for field obj.organization_id is not the expected type, validation failed.")
112
+ obj.deactivated.is_a?(Boolean) != false || raise("Passed value for field obj.deactivated is not the expected type, validation failed.")
113
+ obj.version.is_a?(Integer) != false || raise("Passed value for field obj.version is not the expected type, validation failed.")
114
+ obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
115
+ obj.updating_user_id.is_a?(String) != false || raise("Passed value for field obj.updating_user_id is not the expected type, validation failed.")
116
+ obj.value.is_a?(String) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
117
+ end
118
+ end
119
+ end
120
+ end
121
+ end
122
+ end
123
+ end
@@ -0,0 +1,90 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "tag"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module CandidApiClient
8
+ module PreEncounter
9
+ module Tags
10
+ module V1
11
+ module Types
12
+ class TagPage
13
+ # @return [Array<CandidApiClient::PreEncounter::Tags::V1::Types::Tag>]
14
+ attr_reader :items
15
+ # @return [String]
16
+ attr_reader :next_page_token
17
+ # @return [String]
18
+ attr_reader :prev_page_token
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 items [Array<CandidApiClient::PreEncounter::Tags::V1::Types::Tag>]
28
+ # @param next_page_token [String]
29
+ # @param prev_page_token [String]
30
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
31
+ # @return [CandidApiClient::PreEncounter::Tags::V1::Types::TagPage]
32
+ def initialize(items:, next_page_token: OMIT, prev_page_token: OMIT, additional_properties: nil)
33
+ @items = items
34
+ @next_page_token = next_page_token if next_page_token != OMIT
35
+ @prev_page_token = prev_page_token if prev_page_token != OMIT
36
+ @additional_properties = additional_properties
37
+ @_field_set = {
38
+ "items": items,
39
+ "next_page_token": next_page_token,
40
+ "prev_page_token": prev_page_token
41
+ }.reject do |_k, v|
42
+ v == OMIT
43
+ end
44
+ end
45
+
46
+ # Deserialize a JSON object to an instance of TagPage
47
+ #
48
+ # @param json_object [String]
49
+ # @return [CandidApiClient::PreEncounter::Tags::V1::Types::TagPage]
50
+ def self.from_json(json_object:)
51
+ struct = JSON.parse(json_object, object_class: OpenStruct)
52
+ parsed_json = JSON.parse(json_object)
53
+ items = parsed_json["items"]&.map do |item|
54
+ item = item.to_json
55
+ CandidApiClient::PreEncounter::Tags::V1::Types::Tag.from_json(json_object: item)
56
+ end
57
+ next_page_token = struct["next_page_token"]
58
+ prev_page_token = struct["prev_page_token"]
59
+ new(
60
+ items: items,
61
+ next_page_token: next_page_token,
62
+ prev_page_token: prev_page_token,
63
+ additional_properties: struct
64
+ )
65
+ end
66
+
67
+ # Serialize an instance of TagPage to a JSON object
68
+ #
69
+ # @return [String]
70
+ def to_json(*_args)
71
+ @_field_set&.to_json
72
+ end
73
+
74
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
75
+ # hash and check each fields type against the current object's property
76
+ # definitions.
77
+ #
78
+ # @param obj [Object]
79
+ # @return [Void]
80
+ def self.validate_raw(obj:)
81
+ obj.items.is_a?(Array) != false || raise("Passed value for field obj.items is not the expected type, validation failed.")
82
+ obj.next_page_token&.is_a?(String) != false || raise("Passed value for field obj.next_page_token is not the expected type, validation failed.")
83
+ obj.prev_page_token&.is_a?(String) != false || raise("Passed value for field obj.prev_page_token is not the expected type, validation failed.")
84
+ end
85
+ end
86
+ end
87
+ end
88
+ end
89
+ end
90
+ end
data/lib/requests.rb CHANGED
@@ -43,7 +43,7 @@ module CandidApiClient
43
43
 
44
44
  # @return [Hash{String => String}]
45
45
  def get_headers
46
- headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "candidhealth", "X-Fern-SDK-Version": "0.35.2" }
46
+ headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "candidhealth", "X-Fern-SDK-Version": "0.35.3" }
47
47
  headers["Authorization"] = ((@token.is_a? Method) ? @token.call : @token) unless token.nil?
48
48
  headers
49
49
  end
@@ -87,7 +87,7 @@ module CandidApiClient
87
87
 
88
88
  # @return [Hash{String => String}]
89
89
  def get_headers
90
- headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "candidhealth", "X-Fern-SDK-Version": "0.35.2" }
90
+ headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "candidhealth", "X-Fern-SDK-Version": "0.35.3" }
91
91
  headers["Authorization"] = ((@token.is_a? Method) ? @token.call : @token) unless token.nil?
92
92
  headers
93
93
  end
data/lib/types_export.rb CHANGED
@@ -303,6 +303,8 @@ require_relative "candidhealth/pre_encounter/lists/v_1/types/patient_list_item"
303
303
  require_relative "candidhealth/pre_encounter/lists/v_1/types/patient_list_page"
304
304
  require_relative "candidhealth/pre_encounter/lists/v_1/types/appointment_list_item"
305
305
  require_relative "candidhealth/pre_encounter/lists/v_1/types/appointment_list_page"
306
+ require_relative "candidhealth/pre_encounter/notes/v_1/types/mutable_note"
307
+ require_relative "candidhealth/pre_encounter/notes/v_1/types/note"
306
308
  require_relative "candidhealth/pre_encounter/patients/v_1/types/marital_status"
307
309
  require_relative "candidhealth/pre_encounter/patients/v_1/types/external_provenance"
308
310
  require_relative "candidhealth/pre_encounter/patients/v_1/types/contact"
@@ -316,6 +318,9 @@ require_relative "candidhealth/pre_encounter/patients/v_1/types/authorization_un
316
318
  require_relative "candidhealth/pre_encounter/patients/v_1/types/authorization"
317
319
  require_relative "candidhealth/pre_encounter/patients/v_1/types/referral"
318
320
  require_relative "candidhealth/pre_encounter/patients/v_1/types/guarantor"
321
+ require_relative "candidhealth/pre_encounter/tags/v_1/types/mutable_tag"
322
+ require_relative "candidhealth/pre_encounter/tags/v_1/types/tag"
323
+ require_relative "candidhealth/pre_encounter/tags/v_1/types/tag_page"
319
324
  require_relative "candidhealth/claims/types/claim"
320
325
  require_relative "candidhealth/claims/types/claim_status"
321
326
  require_relative "candidhealth/commons/types/primitive"
@@ -409,6 +414,7 @@ require_relative "candidhealth/tags/types/tag_color_enum"
409
414
  require_relative "candidhealth/tasks/commons/types/task_status"
410
415
  require_relative "candidhealth/tasks/commons/types/task_type"
411
416
  require_relative "candidhealth/tasks/commons/types/task_category"
417
+ require_relative "candidhealth/pre_encounter/common/types/base_model"
412
418
  require_relative "candidhealth/pre_encounter/common/types/canonical_non_insurance_payer_association"
413
419
  require_relative "candidhealth/pre_encounter/common/types/relationship"
414
420
  require_relative "candidhealth/pre_encounter/common/types/gender"