candidhealth 0.34.1 → 0.34.2

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 (58) hide show
  1. checksums.yaml +4 -4
  2. data/lib/candidhealth/encounter_providers/v_2/types/rendering_provider.rb +10 -10
  3. data/lib/candidhealth/encounter_providers/v_2/types/rendering_provider_update.rb +123 -0
  4. data/lib/candidhealth/encounters/v_4/client.rb +282 -32
  5. data/lib/candidhealth/encounters/v_4/types/encounter.rb +11 -11
  6. data/lib/candidhealth/encounters/v_4/types/encounter_base.rb +11 -1
  7. data/lib/candidhealth/{third_party_payers/v_1/types/toggle_third_party_payer_enablement_request.rb → encounters/v_4/types/insurance_pay_missing_primary_coverage_error_type.rb} +17 -16
  8. data/lib/candidhealth/guarantor/v_1/client.rb +39 -89
  9. data/lib/candidhealth/guarantor/v_1/types/guarantor_update.rb +144 -0
  10. data/lib/candidhealth/payers/v_3/types/payer.rb +41 -2
  11. data/lib/candidhealth/pre_encounter/appointments/v_1/client.rb +68 -4
  12. data/lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb +17 -1
  13. data/lib/candidhealth/pre_encounter/appointments/v_1/types/mutable_appointment.rb +17 -1
  14. data/lib/candidhealth/pre_encounter/common/types/additional_payer_information.rb +92 -0
  15. data/lib/candidhealth/pre_encounter/coverages/v_1/client.rb +48 -4
  16. data/lib/candidhealth/pre_encounter/coverages/v_1/types/benefit_type.rb +20 -0
  17. data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverage.rb +15 -1
  18. data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_details.rb +104 -0
  19. data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_level.rb +17 -0
  20. data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_value_unit.rb +17 -0
  21. data/lib/candidhealth/pre_encounter/coverages/v_1/types/insurance_plan.rb +16 -2
  22. data/lib/candidhealth/pre_encounter/coverages/v_1/types/latest_eligibility_check.rb +83 -0
  23. data/lib/candidhealth/pre_encounter/coverages/v_1/types/mutable_coverage.rb +15 -1
  24. data/lib/candidhealth/pre_encounter/coverages/v_1/types/plan_coverage.rb +29 -2
  25. data/lib/candidhealth/pre_encounter/coverages/v_1/types/service_coverage.rb +26 -2
  26. data/lib/candidhealth/pre_encounter/patients/v_1/client.rb +12 -4
  27. data/lib/candidhealth/pre_encounter/patients/v_1/types/authorization.rb +148 -0
  28. data/lib/candidhealth/pre_encounter/patients/v_1/types/authorization_unit.rb +15 -0
  29. data/lib/candidhealth/pre_encounter/patients/v_1/types/mutable_patient.rb +26 -2
  30. data/lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb +26 -2
  31. data/lib/candidhealth/pre_encounter/patients/v_1/types/referral.rb +106 -0
  32. data/lib/candidhealth/service_facility/client.rb +27 -51
  33. data/lib/candidhealth/service_facility/types/encounter_service_facility_update.rb +90 -0
  34. data/lib/candidhealth.rb +0 -21
  35. data/lib/requests.rb +2 -2
  36. data/lib/types_export.rb +13 -16
  37. metadata +15 -24
  38. data/lib/candidhealth/third_party_payer_payments/client.rb +0 -30
  39. data/lib/candidhealth/third_party_payer_payments/v_1/client.rb +0 -360
  40. data/lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payment.rb +0 -138
  41. data/lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payment_create.rb +0 -124
  42. data/lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payment_sort_field.rb +0 -14
  43. data/lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payments_page.rb +0 -88
  44. data/lib/candidhealth/third_party_payer_refunds/client.rb +0 -30
  45. data/lib/candidhealth/third_party_payer_refunds/v_1/client.rb +0 -385
  46. data/lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refund.rb +0 -139
  47. data/lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refund_create.rb +0 -125
  48. data/lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refund_sort_field.rb +0 -14
  49. data/lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refunds_page.rb +0 -88
  50. data/lib/candidhealth/third_party_payers/client.rb +0 -30
  51. data/lib/candidhealth/third_party_payers/v_1/client.rb +0 -375
  52. data/lib/candidhealth/third_party_payers/v_1/types/create_third_party_payer_request.rb +0 -79
  53. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer.rb +0 -100
  54. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_category_update.rb +0 -97
  55. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_description_update.rb +0 -97
  56. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_page.rb +0 -88
  57. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_sort_field.rb +0 -16
  58. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_update_request.rb +0 -92
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: candidhealth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.34.1
4
+ version: 0.34.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-22 00:00:00.000000000 Z
11
+ date: 2024-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-http-faraday
@@ -186,6 +186,7 @@ files:
186
186
  - lib/candidhealth/encounter_providers/v_2/types/referring_provider.rb
187
187
  - lib/candidhealth/encounter_providers/v_2/types/referring_provider_update.rb
188
188
  - lib/candidhealth/encounter_providers/v_2/types/rendering_provider.rb
189
+ - lib/candidhealth/encounter_providers/v_2/types/rendering_provider_update.rb
189
190
  - lib/candidhealth/encounter_providers/v_2/types/supervising_provider.rb
190
191
  - lib/candidhealth/encounter_providers/v_2/types/supervising_provider_update.rb
191
192
  - lib/candidhealth/encounters/client.rb
@@ -205,6 +206,7 @@ files:
205
206
  - lib/candidhealth/encounters/v_4/types/encounter_patient_control_number_uniqueness_error_type.rb
206
207
  - lib/candidhealth/encounters/v_4/types/encounter_sort_options.rb
207
208
  - lib/candidhealth/encounters/v_4/types/encounter_submission_origin_type.rb
209
+ - lib/candidhealth/encounters/v_4/types/insurance_pay_missing_primary_coverage_error_type.rb
208
210
  - lib/candidhealth/encounters/v_4/types/intake_follow_up.rb
209
211
  - lib/candidhealth/encounters/v_4/types/intake_question.rb
210
212
  - lib/candidhealth/encounters/v_4/types/intake_response_and_follow_ups.rb
@@ -312,6 +314,7 @@ files:
312
314
  - lib/candidhealth/guarantor/v_1/types/guarantor.rb
313
315
  - lib/candidhealth/guarantor/v_1/types/guarantor_base.rb
314
316
  - lib/candidhealth/guarantor/v_1/types/guarantor_create.rb
317
+ - lib/candidhealth/guarantor/v_1/types/guarantor_update.rb
315
318
  - lib/candidhealth/identifiers/types/identifier.rb
316
319
  - lib/candidhealth/identifiers/types/identifier_base.rb
317
320
  - lib/candidhealth/identifiers/types/identifier_code.rb
@@ -455,6 +458,7 @@ files:
455
458
  - lib/candidhealth/pre_encounter/appointments/v_1/types/service.rb
456
459
  - lib/candidhealth/pre_encounter/appointments/v_1/types/universal_service_identifier.rb
457
460
  - lib/candidhealth/pre_encounter/client.rb
461
+ - lib/candidhealth/pre_encounter/common/types/additional_payer_information.rb
458
462
  - lib/candidhealth/pre_encounter/common/types/address.rb
459
463
  - lib/candidhealth/pre_encounter/common/types/address_use.rb
460
464
  - lib/candidhealth/pre_encounter/common/types/contact_point.rb
@@ -478,17 +482,22 @@ files:
478
482
  - lib/candidhealth/pre_encounter/common/types/version_conflict_error_body.rb
479
483
  - lib/candidhealth/pre_encounter/coverages/client.rb
480
484
  - lib/candidhealth/pre_encounter/coverages/v_1/client.rb
485
+ - lib/candidhealth/pre_encounter/coverages/v_1/types/benefit_type.rb
481
486
  - lib/candidhealth/pre_encounter/coverages/v_1/types/coverage.rb
482
487
  - lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_benefits.rb
488
+ - lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_details.rb
483
489
  - lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_eligibility_check_response.rb
490
+ - lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_level.rb
484
491
  - lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_status.rb
485
492
  - lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_value.rb
493
+ - lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_value_unit.rb
486
494
  - lib/candidhealth/pre_encounter/coverages/v_1/types/eligibility_check.rb
487
495
  - lib/candidhealth/pre_encounter/coverages/v_1/types/eligibility_check_metadata.rb
488
496
  - lib/candidhealth/pre_encounter/coverages/v_1/types/eligibility_check_status.rb
489
497
  - lib/candidhealth/pre_encounter/coverages/v_1/types/eligibility_status.rb
490
498
  - lib/candidhealth/pre_encounter/coverages/v_1/types/insurance_plan.rb
491
499
  - lib/candidhealth/pre_encounter/coverages/v_1/types/insurance_type_code.rb
500
+ - lib/candidhealth/pre_encounter/coverages/v_1/types/latest_eligibility_check.rb
492
501
  - lib/candidhealth/pre_encounter/coverages/v_1/types/mutable_coverage.rb
493
502
  - lib/candidhealth/pre_encounter/coverages/v_1/types/network_type.rb
494
503
  - lib/candidhealth/pre_encounter/coverages/v_1/types/plan_coverage.rb
@@ -507,6 +516,8 @@ files:
507
516
  - lib/candidhealth/pre_encounter/lists/v_1/types/patient_list_page.rb
508
517
  - lib/candidhealth/pre_encounter/patients/client.rb
509
518
  - lib/candidhealth/pre_encounter/patients/v_1/client.rb
519
+ - lib/candidhealth/pre_encounter/patients/v_1/types/authorization.rb
520
+ - lib/candidhealth/pre_encounter/patients/v_1/types/authorization_unit.rb
510
521
  - lib/candidhealth/pre_encounter/patients/v_1/types/contact.rb
511
522
  - lib/candidhealth/pre_encounter/patients/v_1/types/external_provenance.rb
512
523
  - lib/candidhealth/pre_encounter/patients/v_1/types/filing_order.rb
@@ -517,11 +528,13 @@ files:
517
528
  - lib/candidhealth/pre_encounter/patients/v_1/types/patient_page.rb
518
529
  - lib/candidhealth/pre_encounter/patients/v_1/types/potential_duplicate_patient.rb
519
530
  - lib/candidhealth/pre_encounter/patients/v_1/types/potential_duplicate_patients_error_body.rb
531
+ - lib/candidhealth/pre_encounter/patients/v_1/types/referral.rb
520
532
  - lib/candidhealth/remits/v_1/types/payee.rb
521
533
  - lib/candidhealth/remits/v_1/types/payee_identifier.rb
522
534
  - lib/candidhealth/service_facility/client.rb
523
535
  - lib/candidhealth/service_facility/types/encounter_service_facility.rb
524
536
  - lib/candidhealth/service_facility/types/encounter_service_facility_base.rb
537
+ - lib/candidhealth/service_facility/types/encounter_service_facility_update.rb
525
538
  - lib/candidhealth/service_lines/client.rb
526
539
  - lib/candidhealth/service_lines/v_2/client.rb
527
540
  - lib/candidhealth/service_lines/v_2/types/denial_reason_content.rb
@@ -555,28 +568,6 @@ files:
555
568
  - lib/candidhealth/tasks/v_3/types/task_sort_options.rb
556
569
  - lib/candidhealth/tasks/v_3/types/task_update_v_3.rb
557
570
  - lib/candidhealth/tasks/v_3/types/task_updated_to_deprecated_status_error_type.rb
558
- - lib/candidhealth/third_party_payer_payments/client.rb
559
- - lib/candidhealth/third_party_payer_payments/v_1/client.rb
560
- - lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payment.rb
561
- - lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payment_create.rb
562
- - lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payment_sort_field.rb
563
- - lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payments_page.rb
564
- - lib/candidhealth/third_party_payer_refunds/client.rb
565
- - lib/candidhealth/third_party_payer_refunds/v_1/client.rb
566
- - lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refund.rb
567
- - lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refund_create.rb
568
- - lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refund_sort_field.rb
569
- - lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refunds_page.rb
570
- - lib/candidhealth/third_party_payers/client.rb
571
- - lib/candidhealth/third_party_payers/v_1/client.rb
572
- - lib/candidhealth/third_party_payers/v_1/types/create_third_party_payer_request.rb
573
- - lib/candidhealth/third_party_payers/v_1/types/third_party_payer.rb
574
- - lib/candidhealth/third_party_payers/v_1/types/third_party_payer_category_update.rb
575
- - lib/candidhealth/third_party_payers/v_1/types/third_party_payer_description_update.rb
576
- - lib/candidhealth/third_party_payers/v_1/types/third_party_payer_page.rb
577
- - lib/candidhealth/third_party_payers/v_1/types/third_party_payer_sort_field.rb
578
- - lib/candidhealth/third_party_payers/v_1/types/third_party_payer_update_request.rb
579
- - lib/candidhealth/third_party_payers/v_1/types/toggle_third_party_payer_enablement_request.rb
580
571
  - lib/candidhealth/write_offs/client.rb
581
572
  - lib/candidhealth/write_offs/v_1/client.rb
582
573
  - lib/candidhealth/write_offs/v_1/types/create_write_offs_response.rb
@@ -1,30 +0,0 @@
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
@@ -1,360 +0,0 @@
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: [{ amount_cents: 1 }], 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: [{ amount_cents: 1 }], 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
@@ -1,138 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "../../../third_party_payers/v_1/types/third_party_payer"
4
- require "date"
5
- require_relative "../../../financials/types/allocation"
6
- require "ostruct"
7
- require "json"
8
-
9
- module CandidApiClient
10
- module ThirdPartyPayerPayments
11
- module V1
12
- module Types
13
- class ThirdPartyPayerPayment
14
- # @return [String]
15
- attr_reader :third_party_payer_payment_id
16
- # @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer]
17
- attr_reader :third_party_payer
18
- # @return [Integer]
19
- attr_reader :amount_cents
20
- # @return [String]
21
- attr_reader :check_number
22
- # @return [DateTime]
23
- attr_reader :payment_timestamp
24
- # @return [String]
25
- attr_reader :payment_note
26
- # @return [Array<CandidApiClient::Financials::Types::Allocation>]
27
- attr_reader :allocations
28
- # @return [String]
29
- attr_reader :invoice_id
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 third_party_payer_payment_id [String]
39
- # @param third_party_payer [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer]
40
- # @param amount_cents [Integer]
41
- # @param check_number [String]
42
- # @param payment_timestamp [DateTime]
43
- # @param payment_note [String]
44
- # @param allocations [Array<CandidApiClient::Financials::Types::Allocation>]
45
- # @param invoice_id [String]
46
- # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
47
- # @return [CandidApiClient::ThirdPartyPayerPayments::V1::Types::ThirdPartyPayerPayment]
48
- def initialize(third_party_payer_payment_id:, third_party_payer:, amount_cents:, allocations:, check_number: OMIT,
49
- payment_timestamp: OMIT, payment_note: OMIT, invoice_id: OMIT, additional_properties: nil)
50
- @third_party_payer_payment_id = third_party_payer_payment_id
51
- @third_party_payer = third_party_payer
52
- @amount_cents = amount_cents
53
- @check_number = check_number if check_number != OMIT
54
- @payment_timestamp = payment_timestamp if payment_timestamp != OMIT
55
- @payment_note = payment_note if payment_note != OMIT
56
- @allocations = allocations
57
- @invoice_id = invoice_id if invoice_id != OMIT
58
- @additional_properties = additional_properties
59
- @_field_set = {
60
- "third_party_payer_payment_id": third_party_payer_payment_id,
61
- "third_party_payer": third_party_payer,
62
- "amount_cents": amount_cents,
63
- "check_number": check_number,
64
- "payment_timestamp": payment_timestamp,
65
- "payment_note": payment_note,
66
- "allocations": allocations,
67
- "invoice_id": invoice_id
68
- }.reject do |_k, v|
69
- v == OMIT
70
- end
71
- end
72
-
73
- # Deserialize a JSON object to an instance of ThirdPartyPayerPayment
74
- #
75
- # @param json_object [String]
76
- # @return [CandidApiClient::ThirdPartyPayerPayments::V1::Types::ThirdPartyPayerPayment]
77
- def self.from_json(json_object:)
78
- struct = JSON.parse(json_object, object_class: OpenStruct)
79
- parsed_json = JSON.parse(json_object)
80
- third_party_payer_payment_id = struct["third_party_payer_payment_id"]
81
- if parsed_json["third_party_payer"].nil?
82
- third_party_payer = nil
83
- else
84
- third_party_payer = parsed_json["third_party_payer"].to_json
85
- third_party_payer = CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer.from_json(json_object: third_party_payer)
86
- end
87
- amount_cents = struct["amount_cents"]
88
- check_number = struct["check_number"]
89
- payment_timestamp = unless parsed_json["payment_timestamp"].nil?
90
- DateTime.parse(parsed_json["payment_timestamp"])
91
- end
92
- payment_note = struct["payment_note"]
93
- allocations = parsed_json["allocations"]&.map do |item|
94
- item = item.to_json
95
- CandidApiClient::Financials::Types::Allocation.from_json(json_object: item)
96
- end
97
- invoice_id = struct["invoice_id"]
98
- new(
99
- third_party_payer_payment_id: third_party_payer_payment_id,
100
- third_party_payer: third_party_payer,
101
- amount_cents: amount_cents,
102
- check_number: check_number,
103
- payment_timestamp: payment_timestamp,
104
- payment_note: payment_note,
105
- allocations: allocations,
106
- invoice_id: invoice_id,
107
- additional_properties: struct
108
- )
109
- end
110
-
111
- # Serialize an instance of ThirdPartyPayerPayment to a JSON object
112
- #
113
- # @return [String]
114
- def to_json(*_args)
115
- @_field_set&.to_json
116
- end
117
-
118
- # Leveraged for Union-type generation, validate_raw attempts to parse the given
119
- # hash and check each fields type against the current object's property
120
- # definitions.
121
- #
122
- # @param obj [Object]
123
- # @return [Void]
124
- def self.validate_raw(obj:)
125
- obj.third_party_payer_payment_id.is_a?(String) != false || raise("Passed value for field obj.third_party_payer_payment_id is not the expected type, validation failed.")
126
- CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer.validate_raw(obj: obj.third_party_payer)
127
- obj.amount_cents.is_a?(Integer) != false || raise("Passed value for field obj.amount_cents is not the expected type, validation failed.")
128
- obj.check_number&.is_a?(String) != false || raise("Passed value for field obj.check_number is not the expected type, validation failed.")
129
- obj.payment_timestamp&.is_a?(DateTime) != false || raise("Passed value for field obj.payment_timestamp is not the expected type, validation failed.")
130
- obj.payment_note&.is_a?(String) != false || raise("Passed value for field obj.payment_note is not the expected type, validation failed.")
131
- obj.allocations.is_a?(Array) != false || raise("Passed value for field obj.allocations is not the expected type, validation failed.")
132
- obj.invoice_id&.is_a?(String) != false || raise("Passed value for field obj.invoice_id is not the expected type, validation failed.")
133
- end
134
- end
135
- end
136
- end
137
- end
138
- end