Class: CandidApiClient::Payers::V3::AsyncV3Client
- Inherits:
-
Object
- Object
- CandidApiClient::Payers::V3::AsyncV3Client
- 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::AsyncV3Client constructor
Constructor Details
#initialize(request_client:) ⇒ CandidApiClient::Payers::V3::AsyncV3Client
81 82 83 |
# File 'lib/candidhealth/payers/v_3/client.rb', line 81 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ CandidApiClient::AsyncRequestClient (readonly)
77 78 79 |
# File 'lib/candidhealth/payers/v_3/client.rb', line 77 def request_client @request_client end |
Instance Method Details
#get(payer_uuid:, request_options: nil) ⇒ CandidApiClient::Payers::V3::Types::Payer
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/candidhealth/payers/v_3/client.rb', line 91 def get(payer_uuid:, 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/payers/v3/#{payer_uuid}" end CandidApiClient::Payers::V3::Types::Payer.from_json(json_object: response.body) end end |
#get_all(limit: nil, search_term: nil, page_token: nil, request_options: nil) ⇒ CandidApiClient::Payers::V3::Types::PayerPage
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/candidhealth/payers/v_3/client.rb', line 120 def get_all(limit: nil, search_term: nil, page_token: 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 || {}), "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 end |