Class: CandidApiClient::NonInsurancePayerPayments::V1::AsyncV1Client

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/non_insurance_payer_payments/v_1/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_client:) ⇒ CandidApiClient::NonInsurancePayerPayments::V1::AsyncV1Client

Parameters:



189
190
191
# File 'lib/candidhealth/non_insurance_payer_payments/v_1/client.rb', line 189

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientCandidApiClient::AsyncRequestClient (readonly)



185
186
187
# File 'lib/candidhealth/non_insurance_payer_payments/v_1/client.rb', line 185

def request_client
  @request_client
end

Instance Method Details

#create(request:, request_options: nil) ⇒ CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.non_insurance_payer_payments.v_1.create(request: { non_insurance_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" })

Parameters:

  • request (Hash)

    Request of type CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPaymentCreate, as a Hash

    • :non_insurance_payer_id (String)

    • :amount_cents (Integer)

    • :payment_timestamp (DateTime)

    • :payment_note (String)

    • :check_number (String)

    • :allocations (Array<CandidApiClient::Financials::Types::AllocationCreate>)

    • :invoice_id (String)

  • request_options (CandidApiClient::RequestOptions) (defaults to: nil)

Returns:



282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
# File 'lib/candidhealth/non_insurance_payer_payments/v_1/client.rb', line 282

def create(request:, request_options: nil)
  Async do
    response = @request_client.conn.post do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/non-insurance-payer-payments/v1"
    end
    CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment.from_json(json_object: response.body)
  end
end

#delete(non_insurance_payer_payment_id:, request_options: nil) ⇒ Void

Deletes the non-insurance payer payment record matching the provided

`non_insurance_payer_payment_id`.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.non_insurance_payer_payments.v_1.delete(non_insurance_payer_payment_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")

Parameters:

Returns:

  • (Void)


342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
# File 'lib/candidhealth/non_insurance_payer_payments/v_1/client.rb', line 342

def delete(non_insurance_payer_payment_id:, request_options: nil)
  Async do
    @request_client.conn.delete do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/non-insurance-payer-payments/v1/#{non_insurance_payer_payment_id}"
    end
  end
end

#get(non_insurance_payer_payment_id:, request_options: nil) ⇒ CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment

Retrieves a previously created non-insurance payer payment by its

`non_insurance_payer_payment_id`.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.non_insurance_payer_payments.v_1.get(non_insurance_payer_payment_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")

Parameters:

Returns:



252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/candidhealth/non_insurance_payer_payments/v_1/client.rb', line 252

def get(non_insurance_payer_payment_id:, request_options: nil)
  Async do
    response = @request_client.conn.get do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/non-insurance-payer-payments/v1/#{non_insurance_payer_payment_id}"
    end
    CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment.from_json(json_object: response.body)
  end
end

#get_multi(limit: nil, non_insurance_payer_id: nil, check_number: nil, invoice_id: nil, sort: nil, sort_direction: nil, page_token: nil, request_options: nil) ⇒ CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPaymentsPage

Returns all non-insurance payer payments

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.non_insurance_payer_payments.v_1.get_multi(
  limit: 1,
  non_insurance_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
  check_number: "string",
  invoice_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
  sort: AMOUNT_CENTS,
  sort_direction: ASC,
  page_token: "eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9"
)

Parameters:

Returns:



215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# File 'lib/candidhealth/non_insurance_payer_payments/v_1/client.rb', line 215

def get_multi(limit: nil, non_insurance_payer_id: nil, check_number: nil, invoice_id: nil, sort: nil,
              sort_direction: nil, page_token: nil, request_options: nil)
  Async do
    response = @request_client.conn.get do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      req.params = {
        **(request_options&.additional_query_parameters || {}),
        "limit": limit,
        "non_insurance_payer_id": non_insurance_payer_id,
        "check_number": check_number,
        "invoice_id": invoice_id,
        "sort": sort,
        "sort_direction": sort_direction,
        "page_token": page_token
      }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/non-insurance-payer-payments/v1"
    end
    CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPaymentsPage.from_json(json_object: response.body)
  end
end

#update(non_insurance_payer_payment_id:, payment_timestamp: nil, payment_note: nil, invoice_id: nil, request_options: nil) ⇒ CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.non_insurance_payer_payments.v_1.update(non_insurance_payer_payment_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", payment_timestamp: DateTime.parse(2024-01-15T09:30:00.000Z))

Parameters:

Returns:



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
# File 'lib/candidhealth/non_insurance_payer_payments/v_1/client.rb', line 309

def update(non_insurance_payer_payment_id:, payment_timestamp: nil, payment_note: nil, invoice_id: nil,
           request_options: nil)
  Async do
    response = @request_client.conn.patch do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      req.body = {
        **(request_options&.additional_body_parameters || {}),
        payment_timestamp: payment_timestamp,
        payment_note: payment_note,
        invoice_id: invoice_id
      }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/non-insurance-payer-payments/v1/#{non_insurance_payer_payment_id}"
    end
    CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment.from_json(json_object: response.body)
  end
end