Class: CandidApiClient::NonInsurancePayers::V1::V1Client

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::V1Client

Parameters:



22
23
24
# File 'lib/candidhealth/non_insurance_payers/v_1/client.rb', line 22

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientCandidApiClient::RequestClient (readonly)



18
19
20
# File 'lib/candidhealth/non_insurance_payers/v_1/client.rb', line 18

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:



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/candidhealth/non_insurance_payers/v_1/client.rb', line 42

def create(request:, request_options: nil)
  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

#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)


182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/candidhealth/non_insurance_payers/v_1/client.rb', line 182

def delete(non_insurance_payer_id:, request_options: nil)
  @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

#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:



134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/candidhealth/non_insurance_payers/v_1/client.rb', line 134

def get(non_insurance_payer_id:, request_options: nil)
  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

#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:



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/candidhealth/non_insurance_payers/v_1/client.rb', line 102

def get_multi(name: nil, category: nil, enabled: nil, sort: nil, sort_direction: nil, limit: nil,
              page_token: nil, request_options: nil)
  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

#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:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/candidhealth/non_insurance_payers/v_1/client.rb', line 66

def toggle_enablement(non_insurance_payer_id:, request:, request_options: nil)
  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

#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:



160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/candidhealth/non_insurance_payers/v_1/client.rb', line 160

def update(non_insurance_payer_id:, request:, request_options: nil)
  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