candidhealth 0.25.0 → 0.26.1

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 (35) hide show
  1. checksums.yaml +4 -4
  2. data/lib/candidhealth/service_lines/v_2/client.rb +4 -40
  3. data/lib/candidhealth/service_lines/v_2/types/service_line.rb +1 -43
  4. data/lib/candidhealth/service_lines/v_2/types/service_line_create_standalone.rb +2 -82
  5. data/lib/candidhealth/service_lines/v_2/types/service_line_update.rb +2 -82
  6. data/lib/candidhealth/third_party_payer_payments/client.rb +30 -0
  7. data/lib/candidhealth/third_party_payer_payments/v_1/client.rb +360 -0
  8. data/lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payment.rb +138 -0
  9. data/lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payment_create.rb +124 -0
  10. data/lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payment_sort_field.rb +14 -0
  11. data/lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payments_page.rb +88 -0
  12. data/lib/candidhealth/third_party_payer_refunds/client.rb +30 -0
  13. data/lib/candidhealth/third_party_payer_refunds/v_1/client.rb +385 -0
  14. data/lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refund.rb +139 -0
  15. data/lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refund_create.rb +125 -0
  16. data/lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refund_sort_field.rb +14 -0
  17. data/lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refunds_page.rb +88 -0
  18. data/lib/candidhealth/third_party_payers/client.rb +30 -0
  19. data/lib/candidhealth/third_party_payers/v_1/client.rb +375 -0
  20. data/lib/candidhealth/third_party_payers/v_1/types/create_third_party_payer_request.rb +79 -0
  21. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer.rb +100 -0
  22. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_category_update.rb +97 -0
  23. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_description_update.rb +97 -0
  24. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_page.rb +88 -0
  25. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_sort_field.rb +16 -0
  26. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_update_request.rb +92 -0
  27. data/lib/candidhealth/third_party_payers/v_1/types/toggle_third_party_payer_enablement_request.rb +61 -0
  28. data/lib/candidhealth.rb +21 -0
  29. data/lib/requests.rb +2 -2
  30. data/lib/types_export.rb +16 -4
  31. metadata +23 -5
  32. data/lib/candidhealth/invoices/types/invoice.rb +0 -169
  33. data/lib/candidhealth/invoices/types/invoice_item.rb +0 -68
  34. data/lib/candidhealth/invoices/types/invoice_status.rb +0 -16
  35. data/lib/candidhealth/service_lines/v_2/types/service_line_era_data.rb +0 -78
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "../../../commons/types/procedure_modifier"
4
- require_relative "service_line_adjustment"
5
4
  require_relative "service_line_denial_reason"
6
5
  require_relative "../../../commons/types/facility_type_code"
7
6
  require_relative "../../../commons/types/service_line_units"
@@ -20,20 +19,6 @@ module CandidApiClient
20
19
  attr_reader :modifiers
21
20
  # @return [Integer]
22
21
  attr_reader :charge_amount_cents
23
- # @return [Integer]
24
- attr_reader :allowed_amount_cents
25
- # @return [Integer]
26
- attr_reader :insurance_balance_cents
27
- # @return [Integer]
28
- attr_reader :patient_balance_cents
29
- # @return [Integer]
30
- attr_reader :primary_paid_amount_cents
31
- # @return [Integer]
32
- attr_reader :secondary_paid_amount_cents
33
- # @return [Integer]
34
- attr_reader :tertiary_paid_amount_cents
35
- # @return [Integer]
36
- attr_reader :patient_responsibility_cents
37
22
  # @return [String]
38
23
  attr_reader :diagnosis_id_zero
39
24
  # @return [String]
@@ -42,14 +27,10 @@ module CandidApiClient
42
27
  attr_reader :diagnosis_id_two
43
28
  # @return [String]
44
29
  attr_reader :diagnosis_id_three
45
- # @return [Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment>]
46
- attr_reader :service_line_manual_adjustments
47
30
  # @return [CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason]
48
31
  attr_reader :denial_reason
49
32
  # @return [CandidApiClient::Commons::Types::FacilityTypeCode]
50
33
  attr_reader :place_of_service_code
51
- # @return [CandidApiClient::Commons::Types::FacilityTypeCode]
52
- attr_reader :place_of_service_code_as_submitted
53
34
  # @return [CandidApiClient::Commons::Types::ServiceLineUnits]
54
35
  attr_reader :units
55
36
  # @return [String]
@@ -77,21 +58,12 @@ module CandidApiClient
77
58
  # @param edit_reason [String]
78
59
  # @param modifiers [Array<CandidApiClient::Commons::Types::ProcedureModifier>]
79
60
  # @param charge_amount_cents [Integer]
80
- # @param allowed_amount_cents [Integer]
81
- # @param insurance_balance_cents [Integer]
82
- # @param patient_balance_cents [Integer]
83
- # @param primary_paid_amount_cents [Integer]
84
- # @param secondary_paid_amount_cents [Integer]
85
- # @param tertiary_paid_amount_cents [Integer]
86
- # @param patient_responsibility_cents [Integer]
87
61
  # @param diagnosis_id_zero [String]
88
62
  # @param diagnosis_id_one [String]
89
63
  # @param diagnosis_id_two [String]
90
64
  # @param diagnosis_id_three [String]
91
- # @param service_line_manual_adjustments [Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment>]
92
65
  # @param denial_reason [CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason]
93
66
  # @param place_of_service_code [CandidApiClient::Commons::Types::FacilityTypeCode]
94
- # @param place_of_service_code_as_submitted [CandidApiClient::Commons::Types::FacilityTypeCode]
95
67
  # @param units [CandidApiClient::Commons::Types::ServiceLineUnits]
96
68
  # @param procedure_code [String]
97
69
  # @param quantity [String] String representation of a Decimal that can be parsed by most libraries.
@@ -104,30 +76,17 @@ module CandidApiClient
104
76
  # @param end_date_of_service [Date]
105
77
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
106
78
  # @return [CandidApiClient::ServiceLines::V2::Types::ServiceLineUpdate]
107
- def initialize(edit_reason: OMIT, modifiers: OMIT, charge_amount_cents: OMIT, allowed_amount_cents: OMIT,
108
- insurance_balance_cents: OMIT, patient_balance_cents: OMIT, primary_paid_amount_cents: OMIT, secondary_paid_amount_cents: OMIT, tertiary_paid_amount_cents: OMIT, patient_responsibility_cents: OMIT, diagnosis_id_zero: OMIT, diagnosis_id_one: OMIT, diagnosis_id_two: OMIT, diagnosis_id_three: OMIT, service_line_manual_adjustments: OMIT, denial_reason: OMIT, place_of_service_code: OMIT, place_of_service_code_as_submitted: OMIT, units: OMIT, procedure_code: OMIT, quantity: OMIT, description: OMIT, date_of_service: OMIT, end_date_of_service: OMIT, additional_properties: nil)
79
+ def initialize(edit_reason: OMIT, modifiers: OMIT, charge_amount_cents: OMIT, diagnosis_id_zero: OMIT,
80
+ diagnosis_id_one: OMIT, diagnosis_id_two: OMIT, diagnosis_id_three: OMIT, denial_reason: OMIT, place_of_service_code: OMIT, units: OMIT, procedure_code: OMIT, quantity: OMIT, description: OMIT, date_of_service: OMIT, end_date_of_service: OMIT, additional_properties: nil)
109
81
  @edit_reason = edit_reason if edit_reason != OMIT
110
82
  @modifiers = modifiers if modifiers != OMIT
111
83
  @charge_amount_cents = charge_amount_cents if charge_amount_cents != OMIT
112
- @allowed_amount_cents = allowed_amount_cents if allowed_amount_cents != OMIT
113
- @insurance_balance_cents = insurance_balance_cents if insurance_balance_cents != OMIT
114
- @patient_balance_cents = patient_balance_cents if patient_balance_cents != OMIT
115
- @primary_paid_amount_cents = primary_paid_amount_cents if primary_paid_amount_cents != OMIT
116
- @secondary_paid_amount_cents = secondary_paid_amount_cents if secondary_paid_amount_cents != OMIT
117
- @tertiary_paid_amount_cents = tertiary_paid_amount_cents if tertiary_paid_amount_cents != OMIT
118
- @patient_responsibility_cents = patient_responsibility_cents if patient_responsibility_cents != OMIT
119
84
  @diagnosis_id_zero = diagnosis_id_zero if diagnosis_id_zero != OMIT
120
85
  @diagnosis_id_one = diagnosis_id_one if diagnosis_id_one != OMIT
121
86
  @diagnosis_id_two = diagnosis_id_two if diagnosis_id_two != OMIT
122
87
  @diagnosis_id_three = diagnosis_id_three if diagnosis_id_three != OMIT
123
- if service_line_manual_adjustments != OMIT
124
- @service_line_manual_adjustments = service_line_manual_adjustments
125
- end
126
88
  @denial_reason = denial_reason if denial_reason != OMIT
127
89
  @place_of_service_code = place_of_service_code if place_of_service_code != OMIT
128
- if place_of_service_code_as_submitted != OMIT
129
- @place_of_service_code_as_submitted = place_of_service_code_as_submitted
130
- end
131
90
  @units = units if units != OMIT
132
91
  @procedure_code = procedure_code if procedure_code != OMIT
133
92
  @quantity = quantity if quantity != OMIT
@@ -139,21 +98,12 @@ module CandidApiClient
139
98
  "edit_reason": edit_reason,
140
99
  "modifiers": modifiers,
141
100
  "charge_amount_cents": charge_amount_cents,
142
- "allowed_amount_cents": allowed_amount_cents,
143
- "insurance_balance_cents": insurance_balance_cents,
144
- "patient_balance_cents": patient_balance_cents,
145
- "primary_paid_amount_cents": primary_paid_amount_cents,
146
- "secondary_paid_amount_cents": secondary_paid_amount_cents,
147
- "tertiary_paid_amount_cents": tertiary_paid_amount_cents,
148
- "patient_responsibility_cents": patient_responsibility_cents,
149
101
  "diagnosis_id_zero": diagnosis_id_zero,
150
102
  "diagnosis_id_one": diagnosis_id_one,
151
103
  "diagnosis_id_two": diagnosis_id_two,
152
104
  "diagnosis_id_three": diagnosis_id_three,
153
- "service_line_manual_adjustments": service_line_manual_adjustments,
154
105
  "denial_reason": denial_reason,
155
106
  "place_of_service_code": place_of_service_code,
156
- "place_of_service_code_as_submitted": place_of_service_code_as_submitted,
157
107
  "units": units,
158
108
  "procedure_code": procedure_code,
159
109
  "quantity": quantity,
@@ -175,21 +125,10 @@ module CandidApiClient
175
125
  edit_reason = struct["edit_reason"]
176
126
  modifiers = struct["modifiers"]
177
127
  charge_amount_cents = struct["charge_amount_cents"]
178
- allowed_amount_cents = struct["allowed_amount_cents"]
179
- insurance_balance_cents = struct["insurance_balance_cents"]
180
- patient_balance_cents = struct["patient_balance_cents"]
181
- primary_paid_amount_cents = struct["primary_paid_amount_cents"]
182
- secondary_paid_amount_cents = struct["secondary_paid_amount_cents"]
183
- tertiary_paid_amount_cents = struct["tertiary_paid_amount_cents"]
184
- patient_responsibility_cents = struct["patient_responsibility_cents"]
185
128
  diagnosis_id_zero = struct["diagnosis_id_zero"]
186
129
  diagnosis_id_one = struct["diagnosis_id_one"]
187
130
  diagnosis_id_two = struct["diagnosis_id_two"]
188
131
  diagnosis_id_three = struct["diagnosis_id_three"]
189
- service_line_manual_adjustments = parsed_json["service_line_manual_adjustments"]&.map do |item|
190
- item = item.to_json
191
- CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment.from_json(json_object: item)
192
- end
193
132
  if parsed_json["denial_reason"].nil?
194
133
  denial_reason = nil
195
134
  else
@@ -197,7 +136,6 @@ module CandidApiClient
197
136
  denial_reason = CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason.from_json(json_object: denial_reason)
198
137
  end
199
138
  place_of_service_code = struct["place_of_service_code"]
200
- place_of_service_code_as_submitted = struct["place_of_service_code_as_submitted"]
201
139
  units = struct["units"]
202
140
  procedure_code = struct["procedure_code"]
203
141
  quantity = struct["quantity"]
@@ -210,21 +148,12 @@ module CandidApiClient
210
148
  edit_reason: edit_reason,
211
149
  modifiers: modifiers,
212
150
  charge_amount_cents: charge_amount_cents,
213
- allowed_amount_cents: allowed_amount_cents,
214
- insurance_balance_cents: insurance_balance_cents,
215
- patient_balance_cents: patient_balance_cents,
216
- primary_paid_amount_cents: primary_paid_amount_cents,
217
- secondary_paid_amount_cents: secondary_paid_amount_cents,
218
- tertiary_paid_amount_cents: tertiary_paid_amount_cents,
219
- patient_responsibility_cents: patient_responsibility_cents,
220
151
  diagnosis_id_zero: diagnosis_id_zero,
221
152
  diagnosis_id_one: diagnosis_id_one,
222
153
  diagnosis_id_two: diagnosis_id_two,
223
154
  diagnosis_id_three: diagnosis_id_three,
224
- service_line_manual_adjustments: service_line_manual_adjustments,
225
155
  denial_reason: denial_reason,
226
156
  place_of_service_code: place_of_service_code,
227
- place_of_service_code_as_submitted: place_of_service_code_as_submitted,
228
157
  units: units,
229
158
  procedure_code: procedure_code,
230
159
  quantity: quantity,
@@ -252,21 +181,12 @@ module CandidApiClient
252
181
  obj.edit_reason&.is_a?(String) != false || raise("Passed value for field obj.edit_reason is not the expected type, validation failed.")
253
182
  obj.modifiers&.is_a?(Array) != false || raise("Passed value for field obj.modifiers is not the expected type, validation failed.")
254
183
  obj.charge_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.charge_amount_cents is not the expected type, validation failed.")
255
- obj.allowed_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.allowed_amount_cents is not the expected type, validation failed.")
256
- obj.insurance_balance_cents&.is_a?(Integer) != false || raise("Passed value for field obj.insurance_balance_cents is not the expected type, validation failed.")
257
- obj.patient_balance_cents&.is_a?(Integer) != false || raise("Passed value for field obj.patient_balance_cents is not the expected type, validation failed.")
258
- obj.primary_paid_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.primary_paid_amount_cents is not the expected type, validation failed.")
259
- obj.secondary_paid_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.secondary_paid_amount_cents is not the expected type, validation failed.")
260
- obj.tertiary_paid_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.tertiary_paid_amount_cents is not the expected type, validation failed.")
261
- obj.patient_responsibility_cents&.is_a?(Integer) != false || raise("Passed value for field obj.patient_responsibility_cents is not the expected type, validation failed.")
262
184
  obj.diagnosis_id_zero&.is_a?(String) != false || raise("Passed value for field obj.diagnosis_id_zero is not the expected type, validation failed.")
263
185
  obj.diagnosis_id_one&.is_a?(String) != false || raise("Passed value for field obj.diagnosis_id_one is not the expected type, validation failed.")
264
186
  obj.diagnosis_id_two&.is_a?(String) != false || raise("Passed value for field obj.diagnosis_id_two is not the expected type, validation failed.")
265
187
  obj.diagnosis_id_three&.is_a?(String) != false || raise("Passed value for field obj.diagnosis_id_three is not the expected type, validation failed.")
266
- obj.service_line_manual_adjustments&.is_a?(Array) != false || raise("Passed value for field obj.service_line_manual_adjustments is not the expected type, validation failed.")
267
188
  obj.denial_reason.nil? || CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason.validate_raw(obj: obj.denial_reason)
268
189
  obj.place_of_service_code&.is_a?(CandidApiClient::Commons::Types::FacilityTypeCode) != false || raise("Passed value for field obj.place_of_service_code is not the expected type, validation failed.")
269
- obj.place_of_service_code_as_submitted&.is_a?(CandidApiClient::Commons::Types::FacilityTypeCode) != false || raise("Passed value for field obj.place_of_service_code_as_submitted is not the expected type, validation failed.")
270
190
  obj.units&.is_a?(CandidApiClient::Commons::Types::ServiceLineUnits) != false || raise("Passed value for field obj.units is not the expected type, validation failed.")
271
191
  obj.procedure_code&.is_a?(String) != false || raise("Passed value for field obj.procedure_code is not the expected type, validation failed.")
272
192
  obj.quantity&.is_a?(String) != false || raise("Passed value for field obj.quantity is not the expected type, validation failed.")
@@ -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 ThirdPartyPayerPayments
8
+ class Client
9
+ # @return [CandidApiClient::ThirdPartyPayerPayments::V1::V1Client]
10
+ attr_reader :v_1
11
+
12
+ # @param request_client [CandidApiClient::RequestClient]
13
+ # @return [CandidApiClient::ThirdPartyPayerPayments::Client]
14
+ def initialize(request_client:)
15
+ @v_1 = CandidApiClient::ThirdPartyPayerPayments::V1::V1Client.new(request_client: request_client)
16
+ end
17
+ end
18
+
19
+ class AsyncClient
20
+ # @return [CandidApiClient::ThirdPartyPayerPayments::V1::AsyncV1Client]
21
+ attr_reader :v_1
22
+
23
+ # @param request_client [CandidApiClient::AsyncRequestClient]
24
+ # @return [CandidApiClient::ThirdPartyPayerPayments::AsyncClient]
25
+ def initialize(request_client:)
26
+ @v_1 = CandidApiClient::ThirdPartyPayerPayments::V1::AsyncV1Client.new(request_client: request_client)
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,360 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../requests"
4
+ require_relative "types/third_party_payer_payment_sort_field"
5
+ require_relative "../../commons/types/sort_direction"
6
+ require_relative "types/third_party_payer_payments_page"
7
+ require_relative "types/third_party_payer_payment"
8
+ require_relative "types/third_party_payer_payment_create"
9
+ require "date"
10
+ require_relative "../../financials/types/note_update"
11
+ require_relative "../../financials/types/invoice_update"
12
+ require "async"
13
+
14
+ module CandidApiClient
15
+ module ThirdPartyPayerPayments
16
+ module V1
17
+ class V1Client
18
+ # @return [CandidApiClient::RequestClient]
19
+ attr_reader :request_client
20
+
21
+ # @param request_client [CandidApiClient::RequestClient]
22
+ # @return [CandidApiClient::ThirdPartyPayerPayments::V1::V1Client]
23
+ def initialize(request_client:)
24
+ @request_client = request_client
25
+ end
26
+
27
+ # Returns all third party payer payments
28
+ #
29
+ # @param limit [Integer] Defaults to 100. The value must be greater than 0 and less than 1000.
30
+ # @param third_party_payer_id [String]
31
+ # @param check_number [String]
32
+ # @param invoice_id [String]
33
+ # @param sort [CandidApiClient::ThirdPartyPayerPayments::V1::Types::ThirdPartyPayerPaymentSortField] Defaults to refund_timestamp
34
+ # @param sort_direction [CandidApiClient::Commons::Types::SortDirection] Sort direction. Defaults to descending order if not provided.
35
+ # @param page_token [String]
36
+ # @param request_options [CandidApiClient::RequestOptions]
37
+ # @return [CandidApiClient::ThirdPartyPayerPayments::V1::Types::ThirdPartyPayerPaymentsPage]
38
+ # @example
39
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
40
+ # api.third_party_payer_payments.v_1.get_multi(
41
+ # limit: 1,
42
+ # third_party_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
43
+ # check_number: "string",
44
+ # invoice_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
45
+ # sort: AMOUNT_CENTS,
46
+ # sort_direction: ASC,
47
+ # page_token: "eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9"
48
+ # )
49
+ def get_multi(limit: nil, third_party_payer_id: nil, check_number: nil, invoice_id: nil, sort: nil,
50
+ sort_direction: nil, page_token: nil, request_options: nil)
51
+ response = @request_client.conn.get do |req|
52
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
53
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
54
+ req.headers = {
55
+ **(req.headers || {}),
56
+ **@request_client.get_headers,
57
+ **(request_options&.additional_headers || {})
58
+ }.compact
59
+ req.params = {
60
+ **(request_options&.additional_query_parameters || {}),
61
+ "limit": limit,
62
+ "third_party_payer_id": third_party_payer_id,
63
+ "check_number": check_number,
64
+ "invoice_id": invoice_id,
65
+ "sort": sort,
66
+ "sort_direction": sort_direction,
67
+ "page_token": page_token
68
+ }.compact
69
+ req.url "#{@request_client.get_url(environment: CandidApi,
70
+ request_options: request_options)}/api/third-party-payer-payments/v1"
71
+ end
72
+ CandidApiClient::ThirdPartyPayerPayments::V1::Types::ThirdPartyPayerPaymentsPage.from_json(json_object: response.body)
73
+ end
74
+
75
+ # Retrieves a previously created third party payer payment by its
76
+ # `third_party_payer_payment_id`.
77
+ #
78
+ # @param third_party_payer_payment_id [String]
79
+ # @param request_options [CandidApiClient::RequestOptions]
80
+ # @return [CandidApiClient::ThirdPartyPayerPayments::V1::Types::ThirdPartyPayerPayment]
81
+ # @example
82
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
83
+ # api.third_party_payer_payments.v_1.get(third_party_payer_payment_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
84
+ def get(third_party_payer_payment_id:, request_options: nil)
85
+ response = @request_client.conn.get 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.url "#{@request_client.get_url(environment: CandidApi,
94
+ request_options: request_options)}/api/third-party-payer-payments/v1/#{third_party_payer_payment_id}"
95
+ end
96
+ CandidApiClient::ThirdPartyPayerPayments::V1::Types::ThirdPartyPayerPayment.from_json(json_object: response.body)
97
+ end
98
+
99
+ # @param request [Hash] Request of type CandidApiClient::ThirdPartyPayerPayments::V1::Types::ThirdPartyPayerPaymentCreate, as a Hash
100
+ # * :third_party_payer_id (String)
101
+ # * :amount_cents (Integer)
102
+ # * :payment_timestamp (DateTime)
103
+ # * :payment_note (String)
104
+ # * :check_number (String)
105
+ # * :allocations (Array<CandidApiClient::Financials::Types::AllocationCreate>)
106
+ # * :invoice_id (String)
107
+ # @param request_options [CandidApiClient::RequestOptions]
108
+ # @return [CandidApiClient::ThirdPartyPayerPayments::V1::Types::ThirdPartyPayerPayment]
109
+ # @example
110
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
111
+ # api.third_party_payer_payments.v_1.create(request: { third_party_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", amount_cents: 1, payment_timestamp: DateTime.parse(2024-01-15T09:30:00.000Z), payment_note: "string", check_number: "string", allocations: [{ }], invoice_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32" })
112
+ def create(request:, request_options: nil)
113
+ response = @request_client.conn.post do |req|
114
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
115
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
116
+ req.headers = {
117
+ **(req.headers || {}),
118
+ **@request_client.get_headers,
119
+ **(request_options&.additional_headers || {})
120
+ }.compact
121
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
122
+ req.url "#{@request_client.get_url(environment: CandidApi,
123
+ request_options: request_options)}/api/third-party-payer-payments/v1"
124
+ end
125
+ CandidApiClient::ThirdPartyPayerPayments::V1::Types::ThirdPartyPayerPayment.from_json(json_object: response.body)
126
+ end
127
+
128
+ # @param third_party_payer_payment_id [String]
129
+ # @param payment_timestamp [DateTime]
130
+ # @param payment_note [CandidApiClient::Financials::Types::NoteUpdate]
131
+ # @param invoice_id [CandidApiClient::Financials::Types::InvoiceUpdate]
132
+ # @param request_options [CandidApiClient::RequestOptions]
133
+ # @return [CandidApiClient::ThirdPartyPayerPayments::V1::Types::ThirdPartyPayerPayment]
134
+ # @example
135
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
136
+ # api.third_party_payer_payments.v_1.update(third_party_payer_payment_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", payment_timestamp: DateTime.parse(2024-01-15T09:30:00.000Z))
137
+ def update(third_party_payer_payment_id:, payment_timestamp: nil, payment_note: nil, invoice_id: nil,
138
+ request_options: nil)
139
+ response = @request_client.conn.patch do |req|
140
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
141
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
142
+ req.headers = {
143
+ **(req.headers || {}),
144
+ **@request_client.get_headers,
145
+ **(request_options&.additional_headers || {})
146
+ }.compact
147
+ req.body = {
148
+ **(request_options&.additional_body_parameters || {}),
149
+ payment_timestamp: payment_timestamp,
150
+ payment_note: payment_note,
151
+ invoice_id: invoice_id
152
+ }.compact
153
+ req.url "#{@request_client.get_url(environment: CandidApi,
154
+ request_options: request_options)}/api/third-party-payer-payments/v1/#{third_party_payer_payment_id}"
155
+ end
156
+ CandidApiClient::ThirdPartyPayerPayments::V1::Types::ThirdPartyPayerPayment.from_json(json_object: response.body)
157
+ end
158
+
159
+ # Deletes the third party payer payment record matching the provided
160
+ # `third_party_payer_payment_id`.
161
+ #
162
+ # @param third_party_payer_payment_id [String]
163
+ # @param request_options [CandidApiClient::RequestOptions]
164
+ # @return [Void]
165
+ # @example
166
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
167
+ # api.third_party_payer_payments.v_1.delete(third_party_payer_payment_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
168
+ def delete(third_party_payer_payment_id:, request_options: nil)
169
+ @request_client.conn.delete do |req|
170
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
171
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
172
+ req.headers = {
173
+ **(req.headers || {}),
174
+ **@request_client.get_headers,
175
+ **(request_options&.additional_headers || {})
176
+ }.compact
177
+ req.url "#{@request_client.get_url(environment: CandidApi,
178
+ request_options: request_options)}/api/third-party-payer-payments/v1/#{third_party_payer_payment_id}"
179
+ end
180
+ end
181
+ end
182
+
183
+ class AsyncV1Client
184
+ # @return [CandidApiClient::AsyncRequestClient]
185
+ attr_reader :request_client
186
+
187
+ # @param request_client [CandidApiClient::AsyncRequestClient]
188
+ # @return [CandidApiClient::ThirdPartyPayerPayments::V1::AsyncV1Client]
189
+ def initialize(request_client:)
190
+ @request_client = request_client
191
+ end
192
+
193
+ # Returns all third party payer payments
194
+ #
195
+ # @param limit [Integer] Defaults to 100. The value must be greater than 0 and less than 1000.
196
+ # @param third_party_payer_id [String]
197
+ # @param check_number [String]
198
+ # @param invoice_id [String]
199
+ # @param sort [CandidApiClient::ThirdPartyPayerPayments::V1::Types::ThirdPartyPayerPaymentSortField] Defaults to refund_timestamp
200
+ # @param sort_direction [CandidApiClient::Commons::Types::SortDirection] Sort direction. Defaults to descending order if not provided.
201
+ # @param page_token [String]
202
+ # @param request_options [CandidApiClient::RequestOptions]
203
+ # @return [CandidApiClient::ThirdPartyPayerPayments::V1::Types::ThirdPartyPayerPaymentsPage]
204
+ # @example
205
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
206
+ # api.third_party_payer_payments.v_1.get_multi(
207
+ # limit: 1,
208
+ # third_party_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
209
+ # check_number: "string",
210
+ # invoice_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
211
+ # sort: AMOUNT_CENTS,
212
+ # sort_direction: ASC,
213
+ # page_token: "eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9"
214
+ # )
215
+ def get_multi(limit: nil, third_party_payer_id: nil, check_number: nil, invoice_id: nil, sort: nil,
216
+ sort_direction: nil, page_token: nil, request_options: nil)
217
+ Async do
218
+ response = @request_client.conn.get do |req|
219
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
220
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
221
+ req.headers = {
222
+ **(req.headers || {}),
223
+ **@request_client.get_headers,
224
+ **(request_options&.additional_headers || {})
225
+ }.compact
226
+ req.params = {
227
+ **(request_options&.additional_query_parameters || {}),
228
+ "limit": limit,
229
+ "third_party_payer_id": third_party_payer_id,
230
+ "check_number": check_number,
231
+ "invoice_id": invoice_id,
232
+ "sort": sort,
233
+ "sort_direction": sort_direction,
234
+ "page_token": page_token
235
+ }.compact
236
+ req.url "#{@request_client.get_url(environment: CandidApi,
237
+ request_options: request_options)}/api/third-party-payer-payments/v1"
238
+ end
239
+ CandidApiClient::ThirdPartyPayerPayments::V1::Types::ThirdPartyPayerPaymentsPage.from_json(json_object: response.body)
240
+ end
241
+ end
242
+
243
+ # Retrieves a previously created third party payer payment by its
244
+ # `third_party_payer_payment_id`.
245
+ #
246
+ # @param third_party_payer_payment_id [String]
247
+ # @param request_options [CandidApiClient::RequestOptions]
248
+ # @return [CandidApiClient::ThirdPartyPayerPayments::V1::Types::ThirdPartyPayerPayment]
249
+ # @example
250
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
251
+ # api.third_party_payer_payments.v_1.get(third_party_payer_payment_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
252
+ def get(third_party_payer_payment_id:, request_options: nil)
253
+ Async do
254
+ response = @request_client.conn.get do |req|
255
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
256
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
257
+ req.headers = {
258
+ **(req.headers || {}),
259
+ **@request_client.get_headers,
260
+ **(request_options&.additional_headers || {})
261
+ }.compact
262
+ req.url "#{@request_client.get_url(environment: CandidApi,
263
+ request_options: request_options)}/api/third-party-payer-payments/v1/#{third_party_payer_payment_id}"
264
+ end
265
+ CandidApiClient::ThirdPartyPayerPayments::V1::Types::ThirdPartyPayerPayment.from_json(json_object: response.body)
266
+ end
267
+ end
268
+
269
+ # @param request [Hash] Request of type CandidApiClient::ThirdPartyPayerPayments::V1::Types::ThirdPartyPayerPaymentCreate, as a Hash
270
+ # * :third_party_payer_id (String)
271
+ # * :amount_cents (Integer)
272
+ # * :payment_timestamp (DateTime)
273
+ # * :payment_note (String)
274
+ # * :check_number (String)
275
+ # * :allocations (Array<CandidApiClient::Financials::Types::AllocationCreate>)
276
+ # * :invoice_id (String)
277
+ # @param request_options [CandidApiClient::RequestOptions]
278
+ # @return [CandidApiClient::ThirdPartyPayerPayments::V1::Types::ThirdPartyPayerPayment]
279
+ # @example
280
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
281
+ # api.third_party_payer_payments.v_1.create(request: { third_party_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", amount_cents: 1, payment_timestamp: DateTime.parse(2024-01-15T09:30:00.000Z), payment_note: "string", check_number: "string", allocations: [{ }], invoice_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32" })
282
+ def create(request:, request_options: nil)
283
+ Async do
284
+ response = @request_client.conn.post do |req|
285
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
286
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
287
+ req.headers = {
288
+ **(req.headers || {}),
289
+ **@request_client.get_headers,
290
+ **(request_options&.additional_headers || {})
291
+ }.compact
292
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
293
+ req.url "#{@request_client.get_url(environment: CandidApi,
294
+ request_options: request_options)}/api/third-party-payer-payments/v1"
295
+ end
296
+ CandidApiClient::ThirdPartyPayerPayments::V1::Types::ThirdPartyPayerPayment.from_json(json_object: response.body)
297
+ end
298
+ end
299
+
300
+ # @param third_party_payer_payment_id [String]
301
+ # @param payment_timestamp [DateTime]
302
+ # @param payment_note [CandidApiClient::Financials::Types::NoteUpdate]
303
+ # @param invoice_id [CandidApiClient::Financials::Types::InvoiceUpdate]
304
+ # @param request_options [CandidApiClient::RequestOptions]
305
+ # @return [CandidApiClient::ThirdPartyPayerPayments::V1::Types::ThirdPartyPayerPayment]
306
+ # @example
307
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
308
+ # api.third_party_payer_payments.v_1.update(third_party_payer_payment_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", payment_timestamp: DateTime.parse(2024-01-15T09:30:00.000Z))
309
+ def update(third_party_payer_payment_id:, payment_timestamp: nil, payment_note: nil, invoice_id: nil,
310
+ request_options: nil)
311
+ Async do
312
+ response = @request_client.conn.patch do |req|
313
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
314
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
315
+ req.headers = {
316
+ **(req.headers || {}),
317
+ **@request_client.get_headers,
318
+ **(request_options&.additional_headers || {})
319
+ }.compact
320
+ req.body = {
321
+ **(request_options&.additional_body_parameters || {}),
322
+ payment_timestamp: payment_timestamp,
323
+ payment_note: payment_note,
324
+ invoice_id: invoice_id
325
+ }.compact
326
+ req.url "#{@request_client.get_url(environment: CandidApi,
327
+ request_options: request_options)}/api/third-party-payer-payments/v1/#{third_party_payer_payment_id}"
328
+ end
329
+ CandidApiClient::ThirdPartyPayerPayments::V1::Types::ThirdPartyPayerPayment.from_json(json_object: response.body)
330
+ end
331
+ end
332
+
333
+ # Deletes the third party payer payment record matching the provided
334
+ # `third_party_payer_payment_id`.
335
+ #
336
+ # @param third_party_payer_payment_id [String]
337
+ # @param request_options [CandidApiClient::RequestOptions]
338
+ # @return [Void]
339
+ # @example
340
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
341
+ # api.third_party_payer_payments.v_1.delete(third_party_payer_payment_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
342
+ def delete(third_party_payer_payment_id:, request_options: nil)
343
+ Async do
344
+ @request_client.conn.delete do |req|
345
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
346
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
347
+ req.headers = {
348
+ **(req.headers || {}),
349
+ **@request_client.get_headers,
350
+ **(request_options&.additional_headers || {})
351
+ }.compact
352
+ req.url "#{@request_client.get_url(environment: CandidApi,
353
+ request_options: request_options)}/api/third-party-payer-payments/v1/#{third_party_payer_payment_id}"
354
+ end
355
+ end
356
+ end
357
+ end
358
+ end
359
+ end
360
+ end