Class: CandidApiClient::NonInsurancePayers::V1::AsyncV1Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Parameters:



203
204
205
# File 'lib/candidhealth/non_insurance_payers/v_1/client.rb', line 203

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientCandidApiClient::AsyncRequestClient (readonly)



199
200
201
# File 'lib/candidhealth/non_insurance_payers/v_1/client.rb', line 199

def request_client
  @request_client
end

Instance Method Details

#create(request:, request_options: nil) ⇒ CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayer

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.non_insurance_payers.v_1.create(request: { name: "string", description: "string", category: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" } })

Parameters:

  • request (Hash)

    Request of type CandidApiClient::NonInsurancePayers::V1::Types::CreateNonInsurancePayerRequest, as a Hash

    • :name (String)

    • :description (String)

    • :category (String)

    • :address (Hash)

      • :zip_plus_four_code (String)

      • :address_1 (String)

      • :address_2 (String)

      • :city (String)

      • :state (CandidApiClient::Commons::Types::State)

      • :zip_code (String)

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

Returns:



223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# File 'lib/candidhealth/non_insurance_payers/v_1/client.rb', line 223

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-payers/v1"
    end
    CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayer.from_json(json_object: response.body)
  end
end

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

Examples:

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

Parameters:

Returns:

  • (Void)


373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
# File 'lib/candidhealth/non_insurance_payers/v_1/client.rb', line 373

def delete(non_insurance_payer_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-payers/v1/#{non_insurance_payer_id}"
    end
  end
end

#get(non_insurance_payer_id:, request_options: nil) ⇒ CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayer

Examples:

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

Parameters:

Returns:



321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
# File 'lib/candidhealth/non_insurance_payers/v_1/client.rb', line 321

def get(non_insurance_payer_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-payers/v1/#{non_insurance_payer_id}"
    end
    CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayer.from_json(json_object: response.body)
  end
end

#get_multi(name: nil, category: nil, enabled: nil, sort: nil, sort_direction: nil, limit: nil, page_token: nil, request_options: nil) ⇒ CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayerPage

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.non_insurance_payers.v_1.get_multi(
  name: "string",
  category: "string",
  enabled: true,
  sort: NAME,
  sort_direction: ASC,
  limit: 1,
  page_token: "eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9"
)

Parameters:

Returns:



287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# File 'lib/candidhealth/non_insurance_payers/v_1/client.rb', line 287

def get_multi(name: nil, category: nil, enabled: nil, sort: nil, sort_direction: nil, limit: 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 || {}),
        "name": name,
        "category": category,
        "enabled": enabled,
        "sort": sort,
        "sort_direction": sort_direction,
        "limit": limit,
        "page_token": page_token
      }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/non-insurance-payers/v1"
    end
    CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayerPage.from_json(json_object: response.body)
  end
end

#toggle_enablement(non_insurance_payer_id:, request:, request_options: nil) ⇒ CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayer

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.non_insurance_payers.v_1.toggle_enablement(non_insurance_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", request: { enabled: true })

Parameters:

  • non_insurance_payer_id (String)
  • request (Hash)

    Request of type CandidApiClient::NonInsurancePayers::V1::Types::ToggleNonInsurancePayerEnablementRequest, as a Hash

    • :enabled (Boolean)

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

Returns:



249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# File 'lib/candidhealth/non_insurance_payers/v_1/client.rb', line 249

def toggle_enablement(non_insurance_payer_id:, request:, 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 || {}), **(request_options&.additional_body_parameters || {}) }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/non-insurance-payers/v1/#{non_insurance_payer_id}/toggle_enablement"
    end
    CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayer.from_json(json_object: response.body)
  end
end

#update(non_insurance_payer_id:, request:, request_options: nil) ⇒ CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayer

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.non_insurance_payers.v_1.update(non_insurance_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", request: { name: "string" })

Parameters:

  • non_insurance_payer_id (String)
  • request (Hash)

    Request of type CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayerUpdateRequest, as a Hash

    • :name (String)

    • :description (Hash)

    • :category (Hash)

    • :address (Hash)

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

Returns:



349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
# File 'lib/candidhealth/non_insurance_payers/v_1/client.rb', line 349

def update(non_insurance_payer_id:, request:, 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 || {}), **(request_options&.additional_body_parameters || {}) }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/non-insurance-payers/v1/#{non_insurance_payer_id}"
    end
    CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayer.from_json(json_object: response.body)
  end
end