candidhealth 0.24.7 → 0.26.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.
- checksums.yaml +4 -4
- data/lib/candidhealth/financials/types/allocation_target.rb +13 -0
- data/lib/candidhealth/financials/types/allocation_target_create.rb +12 -0
- data/lib/candidhealth/financials/types/appointment_allocation_target.rb +58 -0
- data/lib/candidhealth/service_lines/client.rb +30 -0
- data/lib/candidhealth/service_lines/v_2/client.rb +229 -0
- data/lib/candidhealth/service_lines/v_2/types/service_line_create_standalone.rb +279 -0
- data/lib/candidhealth/service_lines/v_2/types/service_line_update.rb +281 -0
- data/lib/candidhealth/third_party_payer_payments/client.rb +30 -0
- data/lib/candidhealth/third_party_payer_payments/v_1/client.rb +360 -0
- data/lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payment.rb +138 -0
- data/lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payment_create.rb +124 -0
- data/lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payment_sort_field.rb +14 -0
- data/lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payments_page.rb +88 -0
- data/lib/candidhealth/third_party_payer_refunds/client.rb +30 -0
- data/lib/candidhealth/third_party_payer_refunds/v_1/client.rb +385 -0
- data/lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refund.rb +139 -0
- data/lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refund_create.rb +125 -0
- data/lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refund_sort_field.rb +14 -0
- data/lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refunds_page.rb +88 -0
- data/lib/candidhealth/third_party_payers/client.rb +30 -0
- data/lib/candidhealth/third_party_payers/v_1/client.rb +375 -0
- data/lib/candidhealth/third_party_payers/v_1/types/create_third_party_payer_request.rb +79 -0
- data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer.rb +100 -0
- data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_category_update.rb +97 -0
- data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_description_update.rb +97 -0
- data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_page.rb +88 -0
- data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_sort_field.rb +16 -0
- data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_update_request.rb +92 -0
- data/lib/candidhealth/third_party_payers/v_1/types/toggle_third_party_payer_enablement_request.rb +61 -0
- data/lib/candidhealth/write_offs/v_1/types/patient_write_off.rb +18 -2
- data/lib/candidhealth.rb +28 -0
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +19 -0
- metadata +29 -2
@@ -0,0 +1,125 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "date"
|
4
|
+
require_relative "../../../financials/types/allocation_create"
|
5
|
+
require_relative "../../../financials/types/refund_reason"
|
6
|
+
require "ostruct"
|
7
|
+
require "json"
|
8
|
+
|
9
|
+
module CandidApiClient
|
10
|
+
module ThirdPartyPayerRefunds
|
11
|
+
module V1
|
12
|
+
module Types
|
13
|
+
class ThirdPartyPayerRefundCreate
|
14
|
+
# @return [String]
|
15
|
+
attr_reader :third_party_payer_id
|
16
|
+
# @return [String]
|
17
|
+
attr_reader :invoice_id
|
18
|
+
# @return [Integer]
|
19
|
+
attr_reader :amount_cents
|
20
|
+
# @return [DateTime]
|
21
|
+
attr_reader :refund_timestamp
|
22
|
+
# @return [String]
|
23
|
+
attr_reader :refund_note
|
24
|
+
# @return [Array<CandidApiClient::Financials::Types::AllocationCreate>]
|
25
|
+
attr_reader :allocations
|
26
|
+
# @return [CandidApiClient::Financials::Types::RefundReason]
|
27
|
+
attr_reader :refund_reason
|
28
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
29
|
+
attr_reader :additional_properties
|
30
|
+
# @return [Object]
|
31
|
+
attr_reader :_field_set
|
32
|
+
protected :_field_set
|
33
|
+
|
34
|
+
OMIT = Object.new
|
35
|
+
|
36
|
+
# @param third_party_payer_id [String]
|
37
|
+
# @param invoice_id [String]
|
38
|
+
# @param amount_cents [Integer]
|
39
|
+
# @param refund_timestamp [DateTime]
|
40
|
+
# @param refund_note [String]
|
41
|
+
# @param allocations [Array<CandidApiClient::Financials::Types::AllocationCreate>]
|
42
|
+
# @param refund_reason [CandidApiClient::Financials::Types::RefundReason]
|
43
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
44
|
+
# @return [CandidApiClient::ThirdPartyPayerRefunds::V1::Types::ThirdPartyPayerRefundCreate]
|
45
|
+
def initialize(third_party_payer_id:, amount_cents:, allocations:, invoice_id: OMIT, refund_timestamp: OMIT,
|
46
|
+
refund_note: OMIT, refund_reason: OMIT, additional_properties: nil)
|
47
|
+
@third_party_payer_id = third_party_payer_id
|
48
|
+
@invoice_id = invoice_id if invoice_id != OMIT
|
49
|
+
@amount_cents = amount_cents
|
50
|
+
@refund_timestamp = refund_timestamp if refund_timestamp != OMIT
|
51
|
+
@refund_note = refund_note if refund_note != OMIT
|
52
|
+
@allocations = allocations
|
53
|
+
@refund_reason = refund_reason if refund_reason != OMIT
|
54
|
+
@additional_properties = additional_properties
|
55
|
+
@_field_set = {
|
56
|
+
"third_party_payer_id": third_party_payer_id,
|
57
|
+
"invoice_id": invoice_id,
|
58
|
+
"amount_cents": amount_cents,
|
59
|
+
"refund_timestamp": refund_timestamp,
|
60
|
+
"refund_note": refund_note,
|
61
|
+
"allocations": allocations,
|
62
|
+
"refund_reason": refund_reason
|
63
|
+
}.reject do |_k, v|
|
64
|
+
v == OMIT
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# Deserialize a JSON object to an instance of ThirdPartyPayerRefundCreate
|
69
|
+
#
|
70
|
+
# @param json_object [String]
|
71
|
+
# @return [CandidApiClient::ThirdPartyPayerRefunds::V1::Types::ThirdPartyPayerRefundCreate]
|
72
|
+
def self.from_json(json_object:)
|
73
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
74
|
+
parsed_json = JSON.parse(json_object)
|
75
|
+
third_party_payer_id = struct["third_party_payer_id"]
|
76
|
+
invoice_id = struct["invoice_id"]
|
77
|
+
amount_cents = struct["amount_cents"]
|
78
|
+
refund_timestamp = unless parsed_json["refund_timestamp"].nil?
|
79
|
+
DateTime.parse(parsed_json["refund_timestamp"])
|
80
|
+
end
|
81
|
+
refund_note = struct["refund_note"]
|
82
|
+
allocations = parsed_json["allocations"]&.map do |item|
|
83
|
+
item = item.to_json
|
84
|
+
CandidApiClient::Financials::Types::AllocationCreate.from_json(json_object: item)
|
85
|
+
end
|
86
|
+
refund_reason = struct["refund_reason"]
|
87
|
+
new(
|
88
|
+
third_party_payer_id: third_party_payer_id,
|
89
|
+
invoice_id: invoice_id,
|
90
|
+
amount_cents: amount_cents,
|
91
|
+
refund_timestamp: refund_timestamp,
|
92
|
+
refund_note: refund_note,
|
93
|
+
allocations: allocations,
|
94
|
+
refund_reason: refund_reason,
|
95
|
+
additional_properties: struct
|
96
|
+
)
|
97
|
+
end
|
98
|
+
|
99
|
+
# Serialize an instance of ThirdPartyPayerRefundCreate to a JSON object
|
100
|
+
#
|
101
|
+
# @return [String]
|
102
|
+
def to_json(*_args)
|
103
|
+
@_field_set&.to_json
|
104
|
+
end
|
105
|
+
|
106
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
107
|
+
# hash and check each fields type against the current object's property
|
108
|
+
# definitions.
|
109
|
+
#
|
110
|
+
# @param obj [Object]
|
111
|
+
# @return [Void]
|
112
|
+
def self.validate_raw(obj:)
|
113
|
+
obj.third_party_payer_id.is_a?(String) != false || raise("Passed value for field obj.third_party_payer_id is not the expected type, validation failed.")
|
114
|
+
obj.invoice_id&.is_a?(String) != false || raise("Passed value for field obj.invoice_id is not the expected type, validation failed.")
|
115
|
+
obj.amount_cents.is_a?(Integer) != false || raise("Passed value for field obj.amount_cents is not the expected type, validation failed.")
|
116
|
+
obj.refund_timestamp&.is_a?(DateTime) != false || raise("Passed value for field obj.refund_timestamp is not the expected type, validation failed.")
|
117
|
+
obj.refund_note&.is_a?(String) != false || raise("Passed value for field obj.refund_note is not the expected type, validation failed.")
|
118
|
+
obj.allocations.is_a?(Array) != false || raise("Passed value for field obj.allocations is not the expected type, validation failed.")
|
119
|
+
obj.refund_reason&.is_a?(CandidApiClient::Financials::Types::RefundReason) != false || raise("Passed value for field obj.refund_reason is not the expected type, validation failed.")
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
data/lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refund_sort_field.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CandidApiClient
|
4
|
+
module ThirdPartyPayerRefunds
|
5
|
+
module V1
|
6
|
+
module Types
|
7
|
+
class ThirdPartyPayerRefundSortField
|
8
|
+
AMOUNT_CENTS = "amount_cents"
|
9
|
+
REFUND_TIMESTAMP = "refund_timestamp"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "third_party_payer_refund"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module CandidApiClient
|
8
|
+
module ThirdPartyPayerRefunds
|
9
|
+
module V1
|
10
|
+
module Types
|
11
|
+
class ThirdPartyPayerRefundsPage
|
12
|
+
# @return [Array<CandidApiClient::ThirdPartyPayerRefunds::V1::Types::ThirdPartyPayerRefund>]
|
13
|
+
attr_reader :items
|
14
|
+
# @return [String]
|
15
|
+
attr_reader :prev_page_token
|
16
|
+
# @return [String]
|
17
|
+
attr_reader :next_page_token
|
18
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
19
|
+
attr_reader :additional_properties
|
20
|
+
# @return [Object]
|
21
|
+
attr_reader :_field_set
|
22
|
+
protected :_field_set
|
23
|
+
|
24
|
+
OMIT = Object.new
|
25
|
+
|
26
|
+
# @param items [Array<CandidApiClient::ThirdPartyPayerRefunds::V1::Types::ThirdPartyPayerRefund>]
|
27
|
+
# @param prev_page_token [String]
|
28
|
+
# @param next_page_token [String]
|
29
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
30
|
+
# @return [CandidApiClient::ThirdPartyPayerRefunds::V1::Types::ThirdPartyPayerRefundsPage]
|
31
|
+
def initialize(items:, prev_page_token: OMIT, next_page_token: OMIT, additional_properties: nil)
|
32
|
+
@items = items
|
33
|
+
@prev_page_token = prev_page_token if prev_page_token != OMIT
|
34
|
+
@next_page_token = next_page_token if next_page_token != OMIT
|
35
|
+
@additional_properties = additional_properties
|
36
|
+
@_field_set = {
|
37
|
+
"items": items,
|
38
|
+
"prev_page_token": prev_page_token,
|
39
|
+
"next_page_token": next_page_token
|
40
|
+
}.reject do |_k, v|
|
41
|
+
v == OMIT
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# Deserialize a JSON object to an instance of ThirdPartyPayerRefundsPage
|
46
|
+
#
|
47
|
+
# @param json_object [String]
|
48
|
+
# @return [CandidApiClient::ThirdPartyPayerRefunds::V1::Types::ThirdPartyPayerRefundsPage]
|
49
|
+
def self.from_json(json_object:)
|
50
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
51
|
+
parsed_json = JSON.parse(json_object)
|
52
|
+
items = parsed_json["items"]&.map do |item|
|
53
|
+
item = item.to_json
|
54
|
+
CandidApiClient::ThirdPartyPayerRefunds::V1::Types::ThirdPartyPayerRefund.from_json(json_object: item)
|
55
|
+
end
|
56
|
+
prev_page_token = struct["prev_page_token"]
|
57
|
+
next_page_token = struct["next_page_token"]
|
58
|
+
new(
|
59
|
+
items: items,
|
60
|
+
prev_page_token: prev_page_token,
|
61
|
+
next_page_token: next_page_token,
|
62
|
+
additional_properties: struct
|
63
|
+
)
|
64
|
+
end
|
65
|
+
|
66
|
+
# Serialize an instance of ThirdPartyPayerRefundsPage to a JSON object
|
67
|
+
#
|
68
|
+
# @return [String]
|
69
|
+
def to_json(*_args)
|
70
|
+
@_field_set&.to_json
|
71
|
+
end
|
72
|
+
|
73
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
74
|
+
# hash and check each fields type against the current object's property
|
75
|
+
# definitions.
|
76
|
+
#
|
77
|
+
# @param obj [Object]
|
78
|
+
# @return [Void]
|
79
|
+
def self.validate_raw(obj:)
|
80
|
+
obj.items.is_a?(Array) != false || raise("Passed value for field obj.items is not the expected type, validation failed.")
|
81
|
+
obj.prev_page_token&.is_a?(String) != false || raise("Passed value for field obj.prev_page_token is not the expected type, validation failed.")
|
82
|
+
obj.next_page_token&.is_a?(String) != false || raise("Passed value for field obj.next_page_token is not the expected type, validation failed.")
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
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 ThirdPartyPayers
|
8
|
+
class Client
|
9
|
+
# @return [CandidApiClient::ThirdPartyPayers::V1::V1Client]
|
10
|
+
attr_reader :v_1
|
11
|
+
|
12
|
+
# @param request_client [CandidApiClient::RequestClient]
|
13
|
+
# @return [CandidApiClient::ThirdPartyPayers::Client]
|
14
|
+
def initialize(request_client:)
|
15
|
+
@v_1 = CandidApiClient::ThirdPartyPayers::V1::V1Client.new(request_client: request_client)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
class AsyncClient
|
20
|
+
# @return [CandidApiClient::ThirdPartyPayers::V1::AsyncV1Client]
|
21
|
+
attr_reader :v_1
|
22
|
+
|
23
|
+
# @param request_client [CandidApiClient::AsyncRequestClient]
|
24
|
+
# @return [CandidApiClient::ThirdPartyPayers::AsyncClient]
|
25
|
+
def initialize(request_client:)
|
26
|
+
@v_1 = CandidApiClient::ThirdPartyPayers::V1::AsyncV1Client.new(request_client: request_client)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,375 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../../requests"
|
4
|
+
require_relative "types/create_third_party_payer_request"
|
5
|
+
require_relative "types/third_party_payer"
|
6
|
+
require_relative "types/toggle_third_party_payer_enablement_request"
|
7
|
+
require_relative "types/third_party_payer_sort_field"
|
8
|
+
require_relative "../../commons/types/sort_direction"
|
9
|
+
require_relative "types/third_party_payer_page"
|
10
|
+
require_relative "types/third_party_payer_update_request"
|
11
|
+
require "async"
|
12
|
+
|
13
|
+
module CandidApiClient
|
14
|
+
module ThirdPartyPayers
|
15
|
+
module V1
|
16
|
+
class V1Client
|
17
|
+
# @return [CandidApiClient::RequestClient]
|
18
|
+
attr_reader :request_client
|
19
|
+
|
20
|
+
# @param request_client [CandidApiClient::RequestClient]
|
21
|
+
# @return [CandidApiClient::ThirdPartyPayers::V1::V1Client]
|
22
|
+
def initialize(request_client:)
|
23
|
+
@request_client = request_client
|
24
|
+
end
|
25
|
+
|
26
|
+
# @param request [Hash] Request of type CandidApiClient::ThirdPartyPayers::V1::Types::CreateThirdPartyPayerRequest, as a Hash
|
27
|
+
# * :name (String)
|
28
|
+
# * :description (String)
|
29
|
+
# * :category (String)
|
30
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
31
|
+
# @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer]
|
32
|
+
# @example
|
33
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
34
|
+
# api.third_party_payers.v_1.create(request: { name: "string", description: "string", category: "string" })
|
35
|
+
def create(request:, request_options: nil)
|
36
|
+
response = @request_client.conn.post do |req|
|
37
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
38
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
39
|
+
req.headers = {
|
40
|
+
**(req.headers || {}),
|
41
|
+
**@request_client.get_headers,
|
42
|
+
**(request_options&.additional_headers || {})
|
43
|
+
}.compact
|
44
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
45
|
+
req.url "#{@request_client.get_url(environment: CandidApi,
|
46
|
+
request_options: request_options)}/api/third-party-payers/v1"
|
47
|
+
end
|
48
|
+
CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer.from_json(json_object: response.body)
|
49
|
+
end
|
50
|
+
|
51
|
+
# @param third_party_payer_id [String]
|
52
|
+
# @param request [Hash] Request of type CandidApiClient::ThirdPartyPayers::V1::Types::ToggleThirdPartyPayerEnablementRequest, as a Hash
|
53
|
+
# * :enabled (Boolean)
|
54
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
55
|
+
# @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer]
|
56
|
+
# @example
|
57
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
58
|
+
# api.third_party_payers.v_1.toggle_enablement(third_party_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", request: { enabled: true })
|
59
|
+
def toggle_enablement(third_party_payer_id:, request:, request_options: nil)
|
60
|
+
response = @request_client.conn.patch 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 = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
69
|
+
req.url "#{@request_client.get_url(environment: CandidApi,
|
70
|
+
request_options: request_options)}/api/third-party-payers/v1/#{third_party_payer_id}/toggle_enablement"
|
71
|
+
end
|
72
|
+
CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer.from_json(json_object: response.body)
|
73
|
+
end
|
74
|
+
|
75
|
+
# @param name [String]
|
76
|
+
# @param category [String]
|
77
|
+
# @param enabled [Boolean]
|
78
|
+
# @param sort [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerSortField]
|
79
|
+
# @param sort_direction [CandidApiClient::Commons::Types::SortDirection]
|
80
|
+
# @param limit [Integer] Defaults to 100
|
81
|
+
# @param page_token [String]
|
82
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
83
|
+
# @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerPage]
|
84
|
+
# @example
|
85
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
86
|
+
# api.third_party_payers.v_1.get_multi(
|
87
|
+
# name: "string",
|
88
|
+
# category: "string",
|
89
|
+
# enabled: true,
|
90
|
+
# sort: NAME,
|
91
|
+
# sort_direction: ASC,
|
92
|
+
# limit: 1,
|
93
|
+
# page_token: "eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9"
|
94
|
+
# )
|
95
|
+
def get_multi(name: nil, category: nil, enabled: nil, sort: nil, sort_direction: nil, limit: nil,
|
96
|
+
page_token: nil, request_options: nil)
|
97
|
+
response = @request_client.conn.get do |req|
|
98
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
99
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
100
|
+
req.headers = {
|
101
|
+
**(req.headers || {}),
|
102
|
+
**@request_client.get_headers,
|
103
|
+
**(request_options&.additional_headers || {})
|
104
|
+
}.compact
|
105
|
+
req.params = {
|
106
|
+
**(request_options&.additional_query_parameters || {}),
|
107
|
+
"name": name,
|
108
|
+
"category": category,
|
109
|
+
"enabled": enabled,
|
110
|
+
"sort": sort,
|
111
|
+
"sort_direction": sort_direction,
|
112
|
+
"limit": limit,
|
113
|
+
"page_token": page_token
|
114
|
+
}.compact
|
115
|
+
req.url "#{@request_client.get_url(environment: CandidApi,
|
116
|
+
request_options: request_options)}/api/third-party-payers/v1"
|
117
|
+
end
|
118
|
+
CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerPage.from_json(json_object: response.body)
|
119
|
+
end
|
120
|
+
|
121
|
+
# @param third_party_payer_id [String]
|
122
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
123
|
+
# @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer]
|
124
|
+
# @example
|
125
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
126
|
+
# api.third_party_payers.v_1.get(third_party_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
|
127
|
+
def get(third_party_payer_id:, request_options: nil)
|
128
|
+
response = @request_client.conn.get do |req|
|
129
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
130
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
131
|
+
req.headers = {
|
132
|
+
**(req.headers || {}),
|
133
|
+
**@request_client.get_headers,
|
134
|
+
**(request_options&.additional_headers || {})
|
135
|
+
}.compact
|
136
|
+
req.url "#{@request_client.get_url(environment: CandidApi,
|
137
|
+
request_options: request_options)}/api/third-party-payers/v1/#{third_party_payer_id}"
|
138
|
+
end
|
139
|
+
CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer.from_json(json_object: response.body)
|
140
|
+
end
|
141
|
+
|
142
|
+
# @param third_party_payer_id [String]
|
143
|
+
# @param request [Hash] Request of type CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerUpdateRequest, as a Hash
|
144
|
+
# * :name (String)
|
145
|
+
# * :description (Hash)
|
146
|
+
# * :category (Hash)
|
147
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
148
|
+
# @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer]
|
149
|
+
# @example
|
150
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
151
|
+
# api.third_party_payers.v_1.update(third_party_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", request: { name: "string" })
|
152
|
+
def update(third_party_payer_id:, request:, request_options: nil)
|
153
|
+
response = @request_client.conn.patch do |req|
|
154
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
155
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
156
|
+
req.headers = {
|
157
|
+
**(req.headers || {}),
|
158
|
+
**@request_client.get_headers,
|
159
|
+
**(request_options&.additional_headers || {})
|
160
|
+
}.compact
|
161
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
162
|
+
req.url "#{@request_client.get_url(environment: CandidApi,
|
163
|
+
request_options: request_options)}/api/third-party-payers/v1/#{third_party_payer_id}"
|
164
|
+
end
|
165
|
+
CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer.from_json(json_object: response.body)
|
166
|
+
end
|
167
|
+
|
168
|
+
# @param third_party_payer_id [String]
|
169
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
170
|
+
# @return [Void]
|
171
|
+
# @example
|
172
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
173
|
+
# api.third_party_payers.v_1.delete(third_party_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
|
174
|
+
def delete(third_party_payer_id:, request_options: nil)
|
175
|
+
@request_client.conn.delete do |req|
|
176
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
177
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
178
|
+
req.headers = {
|
179
|
+
**(req.headers || {}),
|
180
|
+
**@request_client.get_headers,
|
181
|
+
**(request_options&.additional_headers || {})
|
182
|
+
}.compact
|
183
|
+
req.url "#{@request_client.get_url(environment: CandidApi,
|
184
|
+
request_options: request_options)}/api/third-party-payers/v1/#{third_party_payer_id}"
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
class AsyncV1Client
|
190
|
+
# @return [CandidApiClient::AsyncRequestClient]
|
191
|
+
attr_reader :request_client
|
192
|
+
|
193
|
+
# @param request_client [CandidApiClient::AsyncRequestClient]
|
194
|
+
# @return [CandidApiClient::ThirdPartyPayers::V1::AsyncV1Client]
|
195
|
+
def initialize(request_client:)
|
196
|
+
@request_client = request_client
|
197
|
+
end
|
198
|
+
|
199
|
+
# @param request [Hash] Request of type CandidApiClient::ThirdPartyPayers::V1::Types::CreateThirdPartyPayerRequest, as a Hash
|
200
|
+
# * :name (String)
|
201
|
+
# * :description (String)
|
202
|
+
# * :category (String)
|
203
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
204
|
+
# @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer]
|
205
|
+
# @example
|
206
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
207
|
+
# api.third_party_payers.v_1.create(request: { name: "string", description: "string", category: "string" })
|
208
|
+
def create(request:, request_options: nil)
|
209
|
+
Async do
|
210
|
+
response = @request_client.conn.post do |req|
|
211
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
212
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
213
|
+
req.headers = {
|
214
|
+
**(req.headers || {}),
|
215
|
+
**@request_client.get_headers,
|
216
|
+
**(request_options&.additional_headers || {})
|
217
|
+
}.compact
|
218
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
219
|
+
req.url "#{@request_client.get_url(environment: CandidApi,
|
220
|
+
request_options: request_options)}/api/third-party-payers/v1"
|
221
|
+
end
|
222
|
+
CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer.from_json(json_object: response.body)
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
226
|
+
# @param third_party_payer_id [String]
|
227
|
+
# @param request [Hash] Request of type CandidApiClient::ThirdPartyPayers::V1::Types::ToggleThirdPartyPayerEnablementRequest, as a Hash
|
228
|
+
# * :enabled (Boolean)
|
229
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
230
|
+
# @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer]
|
231
|
+
# @example
|
232
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
233
|
+
# api.third_party_payers.v_1.toggle_enablement(third_party_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", request: { enabled: true })
|
234
|
+
def toggle_enablement(third_party_payer_id:, request:, request_options: nil)
|
235
|
+
Async do
|
236
|
+
response = @request_client.conn.patch do |req|
|
237
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
238
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
239
|
+
req.headers = {
|
240
|
+
**(req.headers || {}),
|
241
|
+
**@request_client.get_headers,
|
242
|
+
**(request_options&.additional_headers || {})
|
243
|
+
}.compact
|
244
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
245
|
+
req.url "#{@request_client.get_url(environment: CandidApi,
|
246
|
+
request_options: request_options)}/api/third-party-payers/v1/#{third_party_payer_id}/toggle_enablement"
|
247
|
+
end
|
248
|
+
CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer.from_json(json_object: response.body)
|
249
|
+
end
|
250
|
+
end
|
251
|
+
|
252
|
+
# @param name [String]
|
253
|
+
# @param category [String]
|
254
|
+
# @param enabled [Boolean]
|
255
|
+
# @param sort [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerSortField]
|
256
|
+
# @param sort_direction [CandidApiClient::Commons::Types::SortDirection]
|
257
|
+
# @param limit [Integer] Defaults to 100
|
258
|
+
# @param page_token [String]
|
259
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
260
|
+
# @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerPage]
|
261
|
+
# @example
|
262
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
263
|
+
# api.third_party_payers.v_1.get_multi(
|
264
|
+
# name: "string",
|
265
|
+
# category: "string",
|
266
|
+
# enabled: true,
|
267
|
+
# sort: NAME,
|
268
|
+
# sort_direction: ASC,
|
269
|
+
# limit: 1,
|
270
|
+
# page_token: "eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9"
|
271
|
+
# )
|
272
|
+
def get_multi(name: nil, category: nil, enabled: nil, sort: nil, sort_direction: nil, limit: nil,
|
273
|
+
page_token: nil, request_options: nil)
|
274
|
+
Async do
|
275
|
+
response = @request_client.conn.get do |req|
|
276
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
277
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
278
|
+
req.headers = {
|
279
|
+
**(req.headers || {}),
|
280
|
+
**@request_client.get_headers,
|
281
|
+
**(request_options&.additional_headers || {})
|
282
|
+
}.compact
|
283
|
+
req.params = {
|
284
|
+
**(request_options&.additional_query_parameters || {}),
|
285
|
+
"name": name,
|
286
|
+
"category": category,
|
287
|
+
"enabled": enabled,
|
288
|
+
"sort": sort,
|
289
|
+
"sort_direction": sort_direction,
|
290
|
+
"limit": limit,
|
291
|
+
"page_token": page_token
|
292
|
+
}.compact
|
293
|
+
req.url "#{@request_client.get_url(environment: CandidApi,
|
294
|
+
request_options: request_options)}/api/third-party-payers/v1"
|
295
|
+
end
|
296
|
+
CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerPage.from_json(json_object: response.body)
|
297
|
+
end
|
298
|
+
end
|
299
|
+
|
300
|
+
# @param third_party_payer_id [String]
|
301
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
302
|
+
# @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer]
|
303
|
+
# @example
|
304
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
305
|
+
# api.third_party_payers.v_1.get(third_party_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
|
306
|
+
def get(third_party_payer_id:, request_options: nil)
|
307
|
+
Async do
|
308
|
+
response = @request_client.conn.get do |req|
|
309
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
310
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
311
|
+
req.headers = {
|
312
|
+
**(req.headers || {}),
|
313
|
+
**@request_client.get_headers,
|
314
|
+
**(request_options&.additional_headers || {})
|
315
|
+
}.compact
|
316
|
+
req.url "#{@request_client.get_url(environment: CandidApi,
|
317
|
+
request_options: request_options)}/api/third-party-payers/v1/#{third_party_payer_id}"
|
318
|
+
end
|
319
|
+
CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer.from_json(json_object: response.body)
|
320
|
+
end
|
321
|
+
end
|
322
|
+
|
323
|
+
# @param third_party_payer_id [String]
|
324
|
+
# @param request [Hash] Request of type CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayerUpdateRequest, as a Hash
|
325
|
+
# * :name (String)
|
326
|
+
# * :description (Hash)
|
327
|
+
# * :category (Hash)
|
328
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
329
|
+
# @return [CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer]
|
330
|
+
# @example
|
331
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
332
|
+
# api.third_party_payers.v_1.update(third_party_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", request: { name: "string" })
|
333
|
+
def update(third_party_payer_id:, request:, request_options: nil)
|
334
|
+
Async do
|
335
|
+
response = @request_client.conn.patch do |req|
|
336
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
337
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
338
|
+
req.headers = {
|
339
|
+
**(req.headers || {}),
|
340
|
+
**@request_client.get_headers,
|
341
|
+
**(request_options&.additional_headers || {})
|
342
|
+
}.compact
|
343
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
344
|
+
req.url "#{@request_client.get_url(environment: CandidApi,
|
345
|
+
request_options: request_options)}/api/third-party-payers/v1/#{third_party_payer_id}"
|
346
|
+
end
|
347
|
+
CandidApiClient::ThirdPartyPayers::V1::Types::ThirdPartyPayer.from_json(json_object: response.body)
|
348
|
+
end
|
349
|
+
end
|
350
|
+
|
351
|
+
# @param third_party_payer_id [String]
|
352
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
353
|
+
# @return [Void]
|
354
|
+
# @example
|
355
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
356
|
+
# api.third_party_payers.v_1.delete(third_party_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
|
357
|
+
def delete(third_party_payer_id:, request_options: nil)
|
358
|
+
Async do
|
359
|
+
@request_client.conn.delete do |req|
|
360
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
361
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
362
|
+
req.headers = {
|
363
|
+
**(req.headers || {}),
|
364
|
+
**@request_client.get_headers,
|
365
|
+
**(request_options&.additional_headers || {})
|
366
|
+
}.compact
|
367
|
+
req.url "#{@request_client.get_url(environment: CandidApi,
|
368
|
+
request_options: request_options)}/api/third-party-payers/v1/#{third_party_payer_id}"
|
369
|
+
end
|
370
|
+
end
|
371
|
+
end
|
372
|
+
end
|
373
|
+
end
|
374
|
+
end
|
375
|
+
end
|