Class: CandidApiClient::Contracts::V2::AsyncV2Client
- Inherits:
-
Object
- Object
- CandidApiClient::Contracts::V2::AsyncV2Client
- Defined in:
- lib/candidhealth/contracts/v_2/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(effective_date:, regions:, commercial_insurance_types:, medicare_insurance_types:, medicaid_insurance_types:, contracting_provider_id:, rendering_provider_ids:, payer_uuid:, expiration_date: nil, contract_status: nil, authorized_signatory: nil, additional_properties: nil, _field_set: nil, request_options: nil) ⇒ CandidApiClient::Contracts::V2::Types::ContractWithProviders
Creates a new contract within the user’s current organization.
- #delete(contract_id:, request_options: nil) ⇒ Void
- #get(contract_id:, request_options: nil) ⇒ CandidApiClient::Contracts::V2::Types::ContractWithProviders
- #get_multi(page_token: nil, limit: nil, contracting_provider_id: nil, rendering_provider_ids: nil, payer_names: nil, states: nil, contract_status: nil, request_options: nil) ⇒ CandidApiClient::Contracts::V2::Types::ContractsPage
- #initialize(request_client:) ⇒ CandidApiClient::Contracts::V2::AsyncV2Client constructor
- #update(contract_id:, rendering_provider_ids: nil, effective_date: nil, expiration_date: nil, regions: nil, contract_status: nil, authorized_signatory: nil, commercial_insurance_types: nil, medicare_insurance_types: nil, medicaid_insurance_types: nil, request_options: nil) ⇒ CandidApiClient::Contracts::V2::Types::ContractWithProviders
Constructor Details
#initialize(request_client:) ⇒ CandidApiClient::Contracts::V2::AsyncV2Client
241 242 243 |
# File 'lib/candidhealth/contracts/v_2/client.rb', line 241 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ CandidApiClient::AsyncRequestClient (readonly)
237 238 239 |
# File 'lib/candidhealth/contracts/v_2/client.rb', line 237 def request_client @request_client end |
Instance Method Details
#create(effective_date:, regions:, commercial_insurance_types:, medicare_insurance_types:, medicaid_insurance_types:, contracting_provider_id:, rendering_provider_ids:, payer_uuid:, expiration_date: nil, contract_status: nil, authorized_signatory: nil, additional_properties: nil, _field_set: nil, request_options: nil) ⇒ CandidApiClient::Contracts::V2::Types::ContractWithProviders
Creates a new contract within the user’s current organization
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 |
# File 'lib/candidhealth/contracts/v_2/client.rb', line 349 def create(effective_date:, regions:, commercial_insurance_types:, medicare_insurance_types:, medicaid_insurance_types:, contracting_provider_id:, rendering_provider_ids:, payer_uuid:, expiration_date: nil, contract_status: nil, authorized_signatory: nil, additional_properties: nil, _field_set: nil, request_options: nil) Async do response = @request_client.conn.post do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.body = { **(&.additional_body_parameters || {}), effective_date: effective_date, expiration_date: expiration_date, regions: regions, contract_status: contract_status, authorized_signatory: , commercial_insurance_types: commercial_insurance_types, medicare_insurance_types: medicare_insurance_types, medicaid_insurance_types: medicaid_insurance_types, additional_properties: additional_properties, _field_set: _field_set, contracting_provider_id: contracting_provider_id, rendering_provider_ids: rendering_provider_ids, payer_uuid: payer_uuid }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/contracts/v2" end CandidApiClient::Contracts::V2::Types::ContractWithProviders.from_json(json_object: response.body) end end |
#delete(contract_id:, request_options: nil) ⇒ Void
389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 |
# File 'lib/candidhealth/contracts/v_2/client.rb', line 389 def delete(contract_id:, request_options: nil) Async do @request_client.conn.delete do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/contracts/v2/#{contract_id}" end end end |
#get(contract_id:, request_options: nil) ⇒ CandidApiClient::Contracts::V2::Types::ContractWithProviders
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 |
# File 'lib/candidhealth/contracts/v_2/client.rb', line 251 def get(contract_id:, request_options: nil) Async do response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/contracts/v2/#{contract_id}" end CandidApiClient::Contracts::V2::Types::ContractWithProviders.from_json(json_object: response.body) end end |
#get_multi(page_token: nil, limit: nil, contracting_provider_id: nil, rendering_provider_ids: nil, payer_names: nil, states: nil, contract_status: nil, request_options: nil) ⇒ CandidApiClient::Contracts::V2::Types::ContractsPage
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 314 |
# File 'lib/candidhealth/contracts/v_2/client.rb', line 288 def get_multi(page_token: nil, limit: nil, contracting_provider_id: nil, rendering_provider_ids: nil, payer_names: nil, states: nil, contract_status: nil, request_options: nil) Async do response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "page_token": page_token, "limit": limit, "contracting_provider_id": contracting_provider_id, "rendering_provider_ids": rendering_provider_ids, "payer_names": payer_names, "states": states, "contract_status": contract_status }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/contracts/v2" end CandidApiClient::Contracts::V2::Types::ContractsPage.from_json(json_object: response.body) end end |
#update(contract_id:, rendering_provider_ids: nil, effective_date: nil, expiration_date: nil, regions: nil, contract_status: nil, authorized_signatory: nil, commercial_insurance_types: nil, medicare_insurance_types: nil, medicaid_insurance_types: nil, request_options: nil) ⇒ CandidApiClient::Contracts::V2::Types::ContractWithProviders
428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 |
# File 'lib/candidhealth/contracts/v_2/client.rb', line 428 def update(contract_id:, rendering_provider_ids: nil, effective_date: nil, expiration_date: nil, regions: nil, contract_status: nil, authorized_signatory: nil, commercial_insurance_types: nil, medicare_insurance_types: nil, medicaid_insurance_types: nil, request_options: nil) Async do response = @request_client.conn.patch do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.body = { **(&.additional_body_parameters || {}), rendering_provider_ids: rendering_provider_ids, effective_date: effective_date, expiration_date: expiration_date, regions: regions, contract_status: contract_status, authorized_signatory: , commercial_insurance_types: commercial_insurance_types, medicare_insurance_types: medicare_insurance_types, medicaid_insurance_types: medicaid_insurance_types }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/contracts/v2/#{contract_id}" end CandidApiClient::Contracts::V2::Types::ContractWithProviders.from_json(json_object: response.body) end end |