candidhealth 0.42.5 → 0.43.0

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.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/lib/candidhealth/charge_capture/v_1/client.rb +18 -24
  3. data/lib/candidhealth/charge_capture/v_1/types/charge_capture.rb +8 -8
  4. data/lib/candidhealth/charge_capture/v_1/types/charge_capture_error.rb +21 -19
  5. data/lib/candidhealth/charge_capture_bundles/v_1/client.rb +85 -129
  6. data/lib/candidhealth/charge_capture_bundles/v_1/types/{charge_capture_bundle.rb → charge_capture_claim_creation.rb} +18 -30
  7. data/lib/candidhealth/charge_capture_bundles/v_1/types/{charge_capture_bundle_page.rb → charge_capture_claim_creation_page.rb} +9 -9
  8. data/lib/candidhealth/charge_capture_bundles/v_1/types/{charge_capture_bundle_sort_field.rb → charge_capture_claim_creation_sort_field.rb} +1 -1
  9. data/lib/candidhealth/charge_capture_bundles/v_1/types/{charge_capture_bundle_status.rb → charge_capture_claim_creation_status.rb} +1 -1
  10. data/lib/candidhealth/charge_capture_bundles/v_1/types/charge_capture_claim_creation_summary.rb +100 -0
  11. data/lib/candidhealth/encounter_attachments/client.rb +30 -0
  12. data/lib/candidhealth/encounter_attachments/v_1/client.rb +199 -0
  13. data/lib/candidhealth/encounter_attachments/v_1/types/base_attachment.rb +98 -0
  14. data/lib/candidhealth/encounter_attachments/v_1/types/encounter_attachment.rb +115 -0
  15. data/lib/candidhealth/encounter_attachments/v_1/types/encounter_attachment_type.rb +13 -0
  16. data/lib/candidhealth/encounter_providers/v_2/client.rb +16 -16
  17. data/lib/candidhealth/encounters/v_4/client.rb +20 -20
  18. data/lib/candidhealth/guarantor/v_1/client.rb +2 -2
  19. data/lib/candidhealth/service_lines/v_2/client.rb +2 -2
  20. data/lib/candidhealth.rb +7 -0
  21. data/lib/core/file_utilities.rb +26 -0
  22. data/lib/requests.rb +5 -2
  23. data/lib/types_export.rb +8 -6
  24. metadata +46 -7
  25. data/lib/candidhealth/charge_capture_bundles/v_1/types/charge_capture_bundle_summary.rb +0 -94
  26. data/lib/candidhealth/commons/types/not_implemented_error_message.rb +0 -60
@@ -0,0 +1,100 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module CandidApiClient
7
+ module ChargeCaptureBundles
8
+ module V1
9
+ module Types
10
+ class ChargeCaptureClaimCreationSummary
11
+ # @return [Integer] The count of charge captures which are not part of a Claim Creation.
12
+ attr_reader :charge_capture_charges_not_linked_to_claims_count
13
+ # @return [Integer] The count of charge capture claim_creations that have a Claim Creation status of
14
+ # NOT_STARTED.
15
+ attr_reader :charge_capture_claim_creations_not_started_count
16
+ # @return [Integer] The count of charge capture claim_creations that have a Claim Creation status of
17
+ # HELD.
18
+ attr_reader :charge_capture_held_claim_creations_count
19
+ # @return [Integer] The count of charge capture claim_creations that have a Claim Creation status of
20
+ # IN_ERROR.
21
+ attr_reader :charge_capture_claim_creations_in_error_count
22
+ # @return [Integer] The number of ChargeCapturePostBilledChange items that are unresolved.
23
+ attr_reader :charge_capture_unresolved_change_count
24
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
25
+ attr_reader :additional_properties
26
+ # @return [Object]
27
+ attr_reader :_field_set
28
+ protected :_field_set
29
+
30
+ OMIT = Object.new
31
+
32
+ # @param charge_capture_charges_not_linked_to_claims_count [Integer] The count of charge captures which are not part of a Claim Creation.
33
+ # @param charge_capture_claim_creations_not_started_count [Integer] The count of charge capture claim_creations that have a Claim Creation status of
34
+ # NOT_STARTED.
35
+ # @param charge_capture_held_claim_creations_count [Integer] The count of charge capture claim_creations that have a Claim Creation status of
36
+ # HELD.
37
+ # @param charge_capture_claim_creations_in_error_count [Integer] The count of charge capture claim_creations that have a Claim Creation status of
38
+ # IN_ERROR.
39
+ # @param charge_capture_unresolved_change_count [Integer] The number of ChargeCapturePostBilledChange items that are unresolved.
40
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
41
+ # @return [CandidApiClient::ChargeCaptureBundles::V1::Types::ChargeCaptureClaimCreationSummary]
42
+ def initialize(charge_capture_charges_not_linked_to_claims_count:,
43
+ charge_capture_claim_creations_not_started_count:, charge_capture_held_claim_creations_count:, charge_capture_claim_creations_in_error_count:, charge_capture_unresolved_change_count:, additional_properties: nil)
44
+ @charge_capture_charges_not_linked_to_claims_count = charge_capture_charges_not_linked_to_claims_count
45
+ @charge_capture_claim_creations_not_started_count = charge_capture_claim_creations_not_started_count
46
+ @charge_capture_held_claim_creations_count = charge_capture_held_claim_creations_count
47
+ @charge_capture_claim_creations_in_error_count = charge_capture_claim_creations_in_error_count
48
+ @charge_capture_unresolved_change_count = charge_capture_unresolved_change_count
49
+ @additional_properties = additional_properties
50
+ @_field_set = {
51
+ "charge_capture_charges_not_linked_to_claims_count": charge_capture_charges_not_linked_to_claims_count, "charge_capture_claim_creations_not_started_count": charge_capture_claim_creations_not_started_count, "charge_capture_held_claim_creations_count": charge_capture_held_claim_creations_count, "charge_capture_claim_creations_in_error_count": charge_capture_claim_creations_in_error_count, "charge_capture_unresolved_change_count": charge_capture_unresolved_change_count
52
+ }
53
+ end
54
+
55
+ # Deserialize a JSON object to an instance of ChargeCaptureClaimCreationSummary
56
+ #
57
+ # @param json_object [String]
58
+ # @return [CandidApiClient::ChargeCaptureBundles::V1::Types::ChargeCaptureClaimCreationSummary]
59
+ def self.from_json(json_object:)
60
+ struct = JSON.parse(json_object, object_class: OpenStruct)
61
+ charge_capture_charges_not_linked_to_claims_count = struct["charge_capture_charges_not_linked_to_claims_count"]
62
+ charge_capture_claim_creations_not_started_count = struct["charge_capture_claim_creations_not_started_count"]
63
+ charge_capture_held_claim_creations_count = struct["charge_capture_held_claim_creations_count"]
64
+ charge_capture_claim_creations_in_error_count = struct["charge_capture_claim_creations_in_error_count"]
65
+ charge_capture_unresolved_change_count = struct["charge_capture_unresolved_change_count"]
66
+ new(
67
+ charge_capture_charges_not_linked_to_claims_count: charge_capture_charges_not_linked_to_claims_count,
68
+ charge_capture_claim_creations_not_started_count: charge_capture_claim_creations_not_started_count,
69
+ charge_capture_held_claim_creations_count: charge_capture_held_claim_creations_count,
70
+ charge_capture_claim_creations_in_error_count: charge_capture_claim_creations_in_error_count,
71
+ charge_capture_unresolved_change_count: charge_capture_unresolved_change_count,
72
+ additional_properties: struct
73
+ )
74
+ end
75
+
76
+ # Serialize an instance of ChargeCaptureClaimCreationSummary to a JSON object
77
+ #
78
+ # @return [String]
79
+ def to_json(*_args)
80
+ @_field_set&.to_json
81
+ end
82
+
83
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
84
+ # hash and check each fields type against the current object's property
85
+ # definitions.
86
+ #
87
+ # @param obj [Object]
88
+ # @return [Void]
89
+ def self.validate_raw(obj:)
90
+ obj.charge_capture_charges_not_linked_to_claims_count.is_a?(Integer) != false || raise("Passed value for field obj.charge_capture_charges_not_linked_to_claims_count is not the expected type, validation failed.")
91
+ obj.charge_capture_claim_creations_not_started_count.is_a?(Integer) != false || raise("Passed value for field obj.charge_capture_claim_creations_not_started_count is not the expected type, validation failed.")
92
+ obj.charge_capture_held_claim_creations_count.is_a?(Integer) != false || raise("Passed value for field obj.charge_capture_held_claim_creations_count is not the expected type, validation failed.")
93
+ obj.charge_capture_claim_creations_in_error_count.is_a?(Integer) != false || raise("Passed value for field obj.charge_capture_claim_creations_in_error_count is not the expected type, validation failed.")
94
+ obj.charge_capture_unresolved_change_count.is_a?(Integer) != false || raise("Passed value for field obj.charge_capture_unresolved_change_count is not the expected type, validation failed.")
95
+ end
96
+ end
97
+ end
98
+ end
99
+ end
100
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../requests"
4
+ require_relative "v_1/client"
5
+
6
+ module CandidApiClient
7
+ module EncounterAttachments
8
+ class Client
9
+ # @return [CandidApiClient::EncounterAttachments::V1::V1Client]
10
+ attr_reader :v_1
11
+
12
+ # @param request_client [CandidApiClient::RequestClient]
13
+ # @return [CandidApiClient::EncounterAttachments::Client]
14
+ def initialize(request_client:)
15
+ @v_1 = CandidApiClient::EncounterAttachments::V1::V1Client.new(request_client: request_client)
16
+ end
17
+ end
18
+
19
+ class AsyncClient
20
+ # @return [CandidApiClient::EncounterAttachments::V1::AsyncV1Client]
21
+ attr_reader :v_1
22
+
23
+ # @param request_client [CandidApiClient::AsyncRequestClient]
24
+ # @return [CandidApiClient::EncounterAttachments::AsyncClient]
25
+ def initialize(request_client:)
26
+ @v_1 = CandidApiClient::EncounterAttachments::V1::AsyncV1Client.new(request_client: request_client)
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,199 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../requests"
4
+ require_relative "types/encounter_attachment"
5
+ require "json"
6
+ require_relative "types/encounter_attachment_type"
7
+ require_relative "../../../core/file_utilities"
8
+ require "async"
9
+
10
+ module CandidApiClient
11
+ module EncounterAttachments
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::EncounterAttachments::V1::V1Client]
19
+ def initialize(request_client:)
20
+ @request_client = request_client
21
+ end
22
+
23
+ # @param encounter_id [String]
24
+ # @param request_options [CandidApiClient::RequestOptions]
25
+ # @return [Array<CandidApiClient::EncounterAttachments::V1::Types::EncounterAttachment>]
26
+ # @example
27
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
28
+ # api.encounter_attachments.v_1.get(encounter_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
29
+ def get(encounter_id:, request_options: nil)
30
+ response = @request_client.conn.get do |req|
31
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
32
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
33
+ req.headers = {
34
+ **(req.headers || {}),
35
+ **@request_client.get_headers,
36
+ **(request_options&.additional_headers || {})
37
+ }.compact
38
+ req.url "#{@request_client.get_url(environment: CandidApi,
39
+ request_options: request_options)}/api/encounter-attachments/v1/#{encounter_id}"
40
+ end
41
+ parsed_json = JSON.parse(response.body)
42
+ parsed_json&.map do |item|
43
+ item = item.to_json
44
+ CandidApiClient::EncounterAttachments::V1::Types::EncounterAttachment.from_json(json_object: item)
45
+ end
46
+ end
47
+
48
+ # Uploads a file to the encounter. The file will be stored in the
49
+ # encounter's attachments. The maximum file size is 25MB.
50
+ #
51
+ # @param encounter_id [String]
52
+ # @param attachment_file [String, IO]
53
+ # @param attachment_type [CandidApiClient::EncounterAttachments::V1::Types::EncounterAttachmentType]
54
+ # @param request_options [CandidApiClient::RequestOptions]
55
+ # @return [String]
56
+ # @example
57
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
58
+ # api.encounter_attachments.v_1.create(encounter_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", attachment_file: my_file.txt)
59
+ def create(encounter_id:, attachment_file:, attachment_type:, request_options: nil)
60
+ response = @request_client.conn.put do |req|
61
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
62
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
63
+ req.headers = {
64
+ **(req.headers || {}),
65
+ **@request_client.get_headers,
66
+ **(request_options&.additional_headers || {})
67
+ }.compact
68
+ req.body = {
69
+ **(request_options&.additional_body_parameters || {}),
70
+ attachment_file: CandidApiClient::FileUtilities.as_faraday_multipart(file_like: attachment_file),
71
+ attachment_type: attachment_type
72
+ }.compact
73
+ req.url "#{@request_client.get_url(environment: CandidApi,
74
+ request_options: request_options)}/api/encounter-attachments/v1/#{encounter_id}"
75
+ end
76
+ JSON.parse(response.body)
77
+ end
78
+
79
+ # @param encounter_id [String]
80
+ # @param attachment_id [String]
81
+ # @param request_options [CandidApiClient::RequestOptions]
82
+ # @return [Void]
83
+ # @example
84
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
85
+ # api.encounter_attachments.v_1.delete(encounter_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", attachment_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
86
+ def delete(encounter_id:, attachment_id:, request_options: nil)
87
+ @request_client.conn.delete do |req|
88
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
89
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
90
+ req.headers = {
91
+ **(req.headers || {}),
92
+ **@request_client.get_headers,
93
+ **(request_options&.additional_headers || {})
94
+ }.compact
95
+ req.body = { **(request_options&.additional_body_parameters || {}), attachment_id: attachment_id }.compact
96
+ req.url "#{@request_client.get_url(environment: CandidApi,
97
+ request_options: request_options)}/api/encounter-attachments/v1/#{encounter_id}"
98
+ end
99
+ end
100
+ end
101
+
102
+ class AsyncV1Client
103
+ # @return [CandidApiClient::AsyncRequestClient]
104
+ attr_reader :request_client
105
+
106
+ # @param request_client [CandidApiClient::AsyncRequestClient]
107
+ # @return [CandidApiClient::EncounterAttachments::V1::AsyncV1Client]
108
+ def initialize(request_client:)
109
+ @request_client = request_client
110
+ end
111
+
112
+ # @param encounter_id [String]
113
+ # @param request_options [CandidApiClient::RequestOptions]
114
+ # @return [Array<CandidApiClient::EncounterAttachments::V1::Types::EncounterAttachment>]
115
+ # @example
116
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
117
+ # api.encounter_attachments.v_1.get(encounter_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
118
+ def get(encounter_id:, request_options: nil)
119
+ Async do
120
+ response = @request_client.conn.get do |req|
121
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
122
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
123
+ req.headers = {
124
+ **(req.headers || {}),
125
+ **@request_client.get_headers,
126
+ **(request_options&.additional_headers || {})
127
+ }.compact
128
+ req.url "#{@request_client.get_url(environment: CandidApi,
129
+ request_options: request_options)}/api/encounter-attachments/v1/#{encounter_id}"
130
+ end
131
+ parsed_json = JSON.parse(response.body)
132
+ parsed_json&.map do |item|
133
+ item = item.to_json
134
+ CandidApiClient::EncounterAttachments::V1::Types::EncounterAttachment.from_json(json_object: item)
135
+ end
136
+ end
137
+ end
138
+
139
+ # Uploads a file to the encounter. The file will be stored in the
140
+ # encounter's attachments. The maximum file size is 25MB.
141
+ #
142
+ # @param encounter_id [String]
143
+ # @param attachment_file [String, IO]
144
+ # @param attachment_type [CandidApiClient::EncounterAttachments::V1::Types::EncounterAttachmentType]
145
+ # @param request_options [CandidApiClient::RequestOptions]
146
+ # @return [String]
147
+ # @example
148
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
149
+ # api.encounter_attachments.v_1.create(encounter_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", attachment_file: my_file.txt)
150
+ def create(encounter_id:, attachment_file:, attachment_type:, request_options: nil)
151
+ Async do
152
+ response = @request_client.conn.put do |req|
153
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
154
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
155
+ req.headers = {
156
+ **(req.headers || {}),
157
+ **@request_client.get_headers,
158
+ **(request_options&.additional_headers || {})
159
+ }.compact
160
+ req.body = {
161
+ **(request_options&.additional_body_parameters || {}),
162
+ attachment_file: CandidApiClient::FileUtilities.as_faraday_multipart(file_like: attachment_file),
163
+ attachment_type: attachment_type
164
+ }.compact
165
+ req.url "#{@request_client.get_url(environment: CandidApi,
166
+ request_options: request_options)}/api/encounter-attachments/v1/#{encounter_id}"
167
+ end
168
+ parsed_json = JSON.parse(response.body)
169
+ parsed_json
170
+ end
171
+ end
172
+
173
+ # @param encounter_id [String]
174
+ # @param attachment_id [String]
175
+ # @param request_options [CandidApiClient::RequestOptions]
176
+ # @return [Void]
177
+ # @example
178
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
179
+ # api.encounter_attachments.v_1.delete(encounter_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", attachment_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
180
+ def delete(encounter_id:, attachment_id:, request_options: nil)
181
+ Async do
182
+ @request_client.conn.delete do |req|
183
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
184
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
185
+ req.headers = {
186
+ **(req.headers || {}),
187
+ **@request_client.get_headers,
188
+ **(request_options&.additional_headers || {})
189
+ }.compact
190
+ req.body = { **(request_options&.additional_body_parameters || {}), attachment_id: attachment_id }.compact
191
+ req.url "#{@request_client.get_url(environment: CandidApi,
192
+ request_options: request_options)}/api/encounter-attachments/v1/#{encounter_id}"
193
+ end
194
+ end
195
+ end
196
+ end
197
+ end
198
+ end
199
+ end
@@ -0,0 +1,98 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module CandidApiClient
7
+ module EncounterAttachments
8
+ module V1
9
+ module Types
10
+ class BaseAttachment
11
+ # @return [String]
12
+ attr_reader :attachment_id
13
+ # @return [String]
14
+ attr_reader :file_name
15
+ # @return [String]
16
+ attr_reader :description
17
+ # @return [String]
18
+ attr_reader :content_type
19
+ # @return [String]
20
+ attr_reader :authed_url
21
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
22
+ attr_reader :additional_properties
23
+ # @return [Object]
24
+ attr_reader :_field_set
25
+ protected :_field_set
26
+
27
+ OMIT = Object.new
28
+
29
+ # @param attachment_id [String]
30
+ # @param file_name [String]
31
+ # @param description [String]
32
+ # @param content_type [String]
33
+ # @param authed_url [String]
34
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
35
+ # @return [CandidApiClient::EncounterAttachments::V1::Types::BaseAttachment]
36
+ def initialize(attachment_id:, file_name:, description:, content_type:, authed_url:,
37
+ additional_properties: nil)
38
+ @attachment_id = attachment_id
39
+ @file_name = file_name
40
+ @description = description
41
+ @content_type = content_type
42
+ @authed_url = authed_url
43
+ @additional_properties = additional_properties
44
+ @_field_set = {
45
+ "attachment_id": attachment_id,
46
+ "file_name": file_name,
47
+ "description": description,
48
+ "content_type": content_type,
49
+ "authed_url": authed_url
50
+ }
51
+ end
52
+
53
+ # Deserialize a JSON object to an instance of BaseAttachment
54
+ #
55
+ # @param json_object [String]
56
+ # @return [CandidApiClient::EncounterAttachments::V1::Types::BaseAttachment]
57
+ def self.from_json(json_object:)
58
+ struct = JSON.parse(json_object, object_class: OpenStruct)
59
+ attachment_id = struct["attachment_id"]
60
+ file_name = struct["file_name"]
61
+ description = struct["description"]
62
+ content_type = struct["content_type"]
63
+ authed_url = struct["authed_url"]
64
+ new(
65
+ attachment_id: attachment_id,
66
+ file_name: file_name,
67
+ description: description,
68
+ content_type: content_type,
69
+ authed_url: authed_url,
70
+ additional_properties: struct
71
+ )
72
+ end
73
+
74
+ # Serialize an instance of BaseAttachment to a JSON object
75
+ #
76
+ # @return [String]
77
+ def to_json(*_args)
78
+ @_field_set&.to_json
79
+ end
80
+
81
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
82
+ # hash and check each fields type against the current object's property
83
+ # definitions.
84
+ #
85
+ # @param obj [Object]
86
+ # @return [Void]
87
+ def self.validate_raw(obj:)
88
+ obj.attachment_id.is_a?(String) != false || raise("Passed value for field obj.attachment_id is not the expected type, validation failed.")
89
+ obj.file_name.is_a?(String) != false || raise("Passed value for field obj.file_name is not the expected type, validation failed.")
90
+ obj.description.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
91
+ obj.content_type.is_a?(String) != false || raise("Passed value for field obj.content_type is not the expected type, validation failed.")
92
+ obj.authed_url.is_a?(String) != false || raise("Passed value for field obj.authed_url is not the expected type, validation failed.")
93
+ end
94
+ end
95
+ end
96
+ end
97
+ end
98
+ end
@@ -0,0 +1,115 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "encounter_attachment_type"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module CandidApiClient
8
+ module EncounterAttachments
9
+ module V1
10
+ module Types
11
+ class EncounterAttachment
12
+ # @return [String]
13
+ attr_reader :encounter_id
14
+ # @return [CandidApiClient::EncounterAttachments::V1::Types::EncounterAttachmentType]
15
+ attr_reader :attachment_type
16
+ # @return [String]
17
+ attr_reader :attachment_id
18
+ # @return [String]
19
+ attr_reader :file_name
20
+ # @return [String]
21
+ attr_reader :description
22
+ # @return [String]
23
+ attr_reader :content_type
24
+ # @return [String]
25
+ attr_reader :authed_url
26
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
27
+ attr_reader :additional_properties
28
+ # @return [Object]
29
+ attr_reader :_field_set
30
+ protected :_field_set
31
+
32
+ OMIT = Object.new
33
+
34
+ # @param encounter_id [String]
35
+ # @param attachment_type [CandidApiClient::EncounterAttachments::V1::Types::EncounterAttachmentType]
36
+ # @param attachment_id [String]
37
+ # @param file_name [String]
38
+ # @param description [String]
39
+ # @param content_type [String]
40
+ # @param authed_url [String]
41
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
42
+ # @return [CandidApiClient::EncounterAttachments::V1::Types::EncounterAttachment]
43
+ def initialize(encounter_id:, attachment_type:, attachment_id:, file_name:, description:, content_type:,
44
+ authed_url:, additional_properties: nil)
45
+ @encounter_id = encounter_id
46
+ @attachment_type = attachment_type
47
+ @attachment_id = attachment_id
48
+ @file_name = file_name
49
+ @description = description
50
+ @content_type = content_type
51
+ @authed_url = authed_url
52
+ @additional_properties = additional_properties
53
+ @_field_set = {
54
+ "encounter_id": encounter_id,
55
+ "attachment_type": attachment_type,
56
+ "attachment_id": attachment_id,
57
+ "file_name": file_name,
58
+ "description": description,
59
+ "content_type": content_type,
60
+ "authed_url": authed_url
61
+ }
62
+ end
63
+
64
+ # Deserialize a JSON object to an instance of EncounterAttachment
65
+ #
66
+ # @param json_object [String]
67
+ # @return [CandidApiClient::EncounterAttachments::V1::Types::EncounterAttachment]
68
+ def self.from_json(json_object:)
69
+ struct = JSON.parse(json_object, object_class: OpenStruct)
70
+ encounter_id = struct["encounter_id"]
71
+ attachment_type = struct["attachment_type"]
72
+ attachment_id = struct["attachment_id"]
73
+ file_name = struct["file_name"]
74
+ description = struct["description"]
75
+ content_type = struct["content_type"]
76
+ authed_url = struct["authed_url"]
77
+ new(
78
+ encounter_id: encounter_id,
79
+ attachment_type: attachment_type,
80
+ attachment_id: attachment_id,
81
+ file_name: file_name,
82
+ description: description,
83
+ content_type: content_type,
84
+ authed_url: authed_url,
85
+ additional_properties: struct
86
+ )
87
+ end
88
+
89
+ # Serialize an instance of EncounterAttachment to a JSON object
90
+ #
91
+ # @return [String]
92
+ def to_json(*_args)
93
+ @_field_set&.to_json
94
+ end
95
+
96
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
97
+ # hash and check each fields type against the current object's property
98
+ # definitions.
99
+ #
100
+ # @param obj [Object]
101
+ # @return [Void]
102
+ def self.validate_raw(obj:)
103
+ obj.encounter_id.is_a?(String) != false || raise("Passed value for field obj.encounter_id is not the expected type, validation failed.")
104
+ obj.attachment_type.is_a?(CandidApiClient::EncounterAttachments::V1::Types::EncounterAttachmentType) != false || raise("Passed value for field obj.attachment_type is not the expected type, validation failed.")
105
+ obj.attachment_id.is_a?(String) != false || raise("Passed value for field obj.attachment_id is not the expected type, validation failed.")
106
+ obj.file_name.is_a?(String) != false || raise("Passed value for field obj.file_name is not the expected type, validation failed.")
107
+ obj.description.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
108
+ obj.content_type.is_a?(String) != false || raise("Passed value for field obj.content_type is not the expected type, validation failed.")
109
+ obj.authed_url.is_a?(String) != false || raise("Passed value for field obj.authed_url is not the expected type, validation failed.")
110
+ end
111
+ end
112
+ end
113
+ end
114
+ end
115
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CandidApiClient
4
+ module EncounterAttachments
5
+ module V1
6
+ module Types
7
+ class EncounterAttachmentType
8
+ DOCUMENTATION = "DOCUMENTATION"
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end