Class: CandidApiClient::Tasks::V3::AsyncV3Client
- Inherits:
-
Object
- Object
- CandidApiClient::Tasks::V3::AsyncV3Client
- Defined in:
- lib/candidhealth/tasks/v_3/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
- #create(request:, request_options: nil) ⇒ CandidApiClient::Tasks::V3::Types::Task
- #get(task_id:, request_options: nil) ⇒ CandidApiClient::Tasks::V3::Types::Task
- #get_actions(task_id:, request_options: nil) ⇒ CandidApiClient::Tasks::V3::Types::TaskActions
- #get_multi(limit: nil, page_token: nil, status: nil, task_type: nil, categories: nil, updated_since: nil, encounter_id: nil, search_term: nil, assigned_to_id: nil, date_of_service_min: nil, date_of_service_max: nil, billing_provider_npi: nil, sort: nil, request_options: nil) ⇒ CandidApiClient::Tasks::V3::Types::TaskPage
- #initialize(request_client:) ⇒ CandidApiClient::Tasks::V3::AsyncV3Client constructor
- #update(task_id:, request:, request_options: nil) ⇒ CandidApiClient::Tasks::V3::Types::Task
Constructor Details
#initialize(request_client:) ⇒ CandidApiClient::Tasks::V3::AsyncV3Client
194 195 196 |
# File 'lib/candidhealth/tasks/v_3/client.rb', line 194 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ CandidApiClient::AsyncRequestClient (readonly)
190 191 192 |
# File 'lib/candidhealth/tasks/v_3/client.rb', line 190 def request_client @request_client end |
Instance Method Details
#create(request:, request_options: nil) ⇒ CandidApiClient::Tasks::V3::Types::Task
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 |
# File 'lib/candidhealth/tasks/v_3/client.rb', line 323 def create(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/tasks/v3" end CandidApiClient::Tasks::V3::Types::Task.from_json(json_object: response.body) end end |
#get(task_id:, request_options: nil) ⇒ CandidApiClient::Tasks::V3::Types::Task
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 |
# File 'lib/candidhealth/tasks/v_3/client.rb', line 293 def get(task_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/tasks/v3/#{task_id}" end CandidApiClient::Tasks::V3::Types::Task.from_json(json_object: response.body) end end |
#get_actions(task_id:, request_options: nil) ⇒ CandidApiClient::Tasks::V3::Types::TaskActions
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/candidhealth/tasks/v_3/client.rb', line 204 def get_actions(task_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/tasks/v3/#{task_id}/actions" end CandidApiClient::Tasks::V3::Types::TaskActions.from_json(json_object: response.body) end end |
#get_multi(limit: nil, page_token: nil, status: nil, task_type: nil, categories: nil, updated_since: nil, encounter_id: nil, search_term: nil, assigned_to_id: nil, date_of_service_min: nil, date_of_service_max: nil, billing_provider_npi: nil, sort: nil, request_options: nil) ⇒ CandidApiClient::Tasks::V3::Types::TaskPage
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
# File 'lib/candidhealth/tasks/v_3/client.rb', line 253 def get_multi(limit: nil, page_token: nil, status: nil, task_type: nil, categories: nil, updated_since: nil, encounter_id: nil, search_term: nil, assigned_to_id: nil, date_of_service_min: nil, date_of_service_max: nil, billing_provider_npi: nil, sort: 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, "page_token": page_token, "status": status, "task_type": task_type, "categories": categories, "updated_since": updated_since, "encounter_id": encounter_id, "search_term": search_term, "assigned_to_id": assigned_to_id, "date_of_service_min": date_of_service_min, "date_of_service_max": date_of_service_max, "billing_provider_npi": billing_provider_npi, "sort": sort }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/tasks/v3" end CandidApiClient::Tasks::V3::Types::TaskPage.from_json(json_object: response.body) end end |
#update(task_id:, request:, request_options: nil) ⇒ CandidApiClient::Tasks::V3::Types::Task
351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 |
# File 'lib/candidhealth/tasks/v_3/client.rb', line 351 def update(task_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/tasks/v3/#{task_id}" end CandidApiClient::Tasks::V3::Types::Task.from_json(json_object: response.body) end end |