Class: CandidApiClient::Guarantor::V1::AsyncV1Client
- Inherits:
-
Object
- Object
- CandidApiClient::Guarantor::V1::AsyncV1Client
- Defined in:
- lib/candidhealth/guarantor/v_1/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(encounter_id:, request:, request_options: nil) ⇒ CandidApiClient::Guarantor::V1::Types::Guarantor
Creates a new guarantor and returns the newly created Guarantor object.
-
#get(guarantor_id:, request_options: nil) ⇒ CandidApiClient::Guarantor::V1::Types::Guarantor
Retrieves a guarantor by its ‘guarantor_id`.
- #initialize(request_client:) ⇒ CandidApiClient::Guarantor::V1::AsyncV1Client constructor
-
#update(guarantor_id:, request:, request_options: nil) ⇒ CandidApiClient::Guarantor::V1::Types::Guarantor
Updates a guarantor by its ‘guarantor_id`.
Constructor Details
#initialize(request_client:) ⇒ CandidApiClient::Guarantor::V1::AsyncV1Client
132 133 134 |
# File 'lib/candidhealth/guarantor/v_1/client.rb', line 132 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ CandidApiClient::AsyncRequestClient (readonly)
128 129 130 |
# File 'lib/candidhealth/guarantor/v_1/client.rb', line 128 def request_client @request_client end |
Instance Method Details
#create(encounter_id:, request:, request_options: nil) ⇒ CandidApiClient::Guarantor::V1::Types::Guarantor
Creates a new guarantor and returns the newly created Guarantor object.
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
# File 'lib/candidhealth/guarantor/v_1/client.rb', line 160 def create(encounter_id:, request:, 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 = { **(request || {}), **(&.additional_body_parameters || {}) }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/guarantors/v1/#{encounter_id}" end CandidApiClient::Guarantor::V1::Types::Guarantor.from_json(json_object: response.body) end end |
#get(guarantor_id:, request_options: nil) ⇒ CandidApiClient::Guarantor::V1::Types::Guarantor
Retrieves a guarantor by its ‘guarantor_id`.
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 |
# File 'lib/candidhealth/guarantor/v_1/client.rb', line 186 def get(guarantor_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/guarantors/v1/#{guarantor_id}" end CandidApiClient::Guarantor::V1::Types::Guarantor.from_json(json_object: response.body) end end |
#update(guarantor_id:, request:, request_options: nil) ⇒ CandidApiClient::Guarantor::V1::Types::Guarantor
Updates a guarantor by its ‘guarantor_id`.
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
# File 'lib/candidhealth/guarantor/v_1/client.rb', line 227 def update(guarantor_id:, request:, 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 = { **(request || {}), **(&.additional_body_parameters || {}) }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/guarantors/v1/#{guarantor_id}" end CandidApiClient::Guarantor::V1::Types::Guarantor.from_json(json_object: response.body) end end |