Class: CandidApiClient::Payers::V3::V3Client
- Inherits:
-
Object
- Object
- CandidApiClient::Payers::V3::V3Client
- Defined in:
- lib/candidhealth/payers/v_3/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
- #get(payer_uuid:, request_options: nil) ⇒ CandidApiClient::Payers::V3::Types::Payer
- #get_all(limit: nil, search_term: nil, page_token: nil, request_options: nil) ⇒ CandidApiClient::Payers::V3::Types::PayerPage
- #initialize(request_client:) ⇒ CandidApiClient::Payers::V3::V3Client constructor
Constructor Details
#initialize(request_client:) ⇒ CandidApiClient::Payers::V3::V3Client
17 18 19 |
# File 'lib/candidhealth/payers/v_3/client.rb', line 17 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ CandidApiClient::RequestClient (readonly)
13 14 15 |
# File 'lib/candidhealth/payers/v_3/client.rb', line 13 def request_client @request_client end |
Instance Method Details
#get(payer_uuid:, request_options: nil) ⇒ CandidApiClient::Payers::V3::Types::Payer
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/candidhealth/payers/v_3/client.rb', line 27 def get(payer_uuid:, request_options: nil) 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/payers/v3/#{payer_uuid}" end CandidApiClient::Payers::V3::Types::Payer.from_json(json_object: response.body) end |
#get_all(limit: nil, search_term: nil, page_token: nil, request_options: nil) ⇒ CandidApiClient::Payers::V3::Types::PayerPage
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/candidhealth/payers/v_3/client.rb', line 54 def get_all(limit: nil, search_term: nil, page_token: nil, request_options: nil) 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 || {}), "limit": limit, "search_term": search_term, "page_token": page_token }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/payers/v3" end CandidApiClient::Payers::V3::Types::PayerPage.from_json(json_object: response.body) end |