Class: Candid::NonInsurancePayerPayments::V1::Client
- Inherits:
-
Object
- Object
- Candid::NonInsurancePayerPayments::V1::Client
- Defined in:
- lib/candid/non_insurance_payer_payments/v_1/client.rb
Instance Method Summary collapse
- #create(request_options: {}, **params) ⇒ Candid::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment
-
#delete(request_options: {}, **params) ⇒ untyped
Deletes the non-insurance payer payment record matching the provided ‘non_insurance_payer_payment_id`.
-
#get(request_options: {}, **params) ⇒ Candid::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment
Retrieves a previously created non-insurance payer payment by its ‘non_insurance_payer_payment_id`.
-
#get_multi(request_options: {}, **params) ⇒ Candid::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPaymentsPage
Returns all non-insurance payer payments.
- #initialize(client:, base_url: nil, environment: nil) ⇒ void constructor
- #update(request_options: {}, **params) ⇒ Candid::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment
Constructor Details
#initialize(client:, base_url: nil, environment: nil) ⇒ void
12 13 14 15 16 |
# File 'lib/candid/non_insurance_payer_payments/v_1/client.rb', line 12 def initialize(client:, base_url: nil, environment: nil) @client = client @base_url = base_url @environment = environment end |
Instance Method Details
#create(request_options: {}, **params) ⇒ Candid::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/candid/non_insurance_payer_payments/v_1/client.rb', line 113 def create(request_options: {}, **params) params = Candid::Internal::Types::Utils.normalize_keys(params) request = Candid::Internal::JSON::Request.new( base_url: [:base_url] || @base_url || @environment&.dig(:candid_api), method: "POST", path: "/api/non-insurance-payer-payments/v1", body: Candid::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPaymentCreate.new(params).to_h, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Candid::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Candid::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment.load(response.body) else error_class = Candid::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#delete(request_options: {}, **params) ⇒ untyped
Deletes the non-insurance payer payment record matching the provided ‘non_insurance_payer_payment_id`.
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
# File 'lib/candid/non_insurance_payer_payments/v_1/client.rb', line 185 def delete(request_options: {}, **params) params = Candid::Internal::Types::Utils.normalize_keys(params) request = Candid::Internal::JSON::Request.new( base_url: [:base_url] || @base_url || @environment&.dig(:candid_api), method: "DELETE", path: "/api/non-insurance-payer-payments/v1/#{params[:non_insurance_payer_payment_id]}", request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Candid::Errors::TimeoutError end code = response.code.to_i return if code.between?(200, 299) error_class = Candid::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end |
#get(request_options: {}, **params) ⇒ Candid::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment
Retrieves a previously created non-insurance payer payment by its ‘non_insurance_payer_payment_id`.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/candid/non_insurance_payer_payments/v_1/client.rb', line 82 def get(request_options: {}, **params) params = Candid::Internal::Types::Utils.normalize_keys(params) request = Candid::Internal::JSON::Request.new( base_url: [:base_url] || @base_url || @environment&.dig(:candid_api), method: "GET", path: "/api/non-insurance-payer-payments/v1/#{params[:non_insurance_payer_payment_id]}", request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Candid::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Candid::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment.load(response.body) else error_class = Candid::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#get_multi(request_options: {}, **params) ⇒ Candid::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPaymentsPage
Returns all non-insurance payer payments
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/candid/non_insurance_payer_payments/v_1/client.rb', line 36 def get_multi(request_options: {}, **params) params = Candid::Internal::Types::Utils.normalize_keys(params) query_param_names = %i[limit non_insurance_payer_id check_number invoice_id sort sort_direction page_token] query_params = {} query_params["limit"] = params[:limit] if params.key?(:limit) query_params["non_insurance_payer_id"] = params[:non_insurance_payer_id] if params.key?(:non_insurance_payer_id) query_params["check_number"] = params[:check_number] if params.key?(:check_number) query_params["invoice_id"] = params[:invoice_id] if params.key?(:invoice_id) query_params["sort"] = params[:sort] if params.key?(:sort) query_params["sort_direction"] = params[:sort_direction] if params.key?(:sort_direction) query_params["page_token"] = params[:page_token] if params.key?(:page_token) params.except(*query_param_names) request = Candid::Internal::JSON::Request.new( base_url: [:base_url] || @base_url || @environment&.dig(:candid_api), method: "GET", path: "/api/non-insurance-payer-payments/v1", query: query_params, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Candid::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Candid::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPaymentsPage.load(response.body) else error_class = Candid::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#update(request_options: {}, **params) ⇒ Candid::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/candid/non_insurance_payer_payments/v_1/client.rb', line 146 def update(request_options: {}, **params) params = Candid::Internal::Types::Utils.normalize_keys(params) request_data = Candid::NonInsurancePayerPayments::V1::Types::UpdateNonInsurancePayerPaymentRequest.new(params).to_h non_body_param_names = ["non_insurance_payer_payment_id"] body = request_data.except(*non_body_param_names) request = Candid::Internal::JSON::Request.new( base_url: [:base_url] || @base_url || @environment&.dig(:candid_api), method: "PATCH", path: "/api/non-insurance-payer-payments/v1/#{params[:non_insurance_payer_payment_id]}", body: body, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Candid::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Candid::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment.load(response.body) else error_class = Candid::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |