Class: CandidApiClient::Tasks::V3::V3Client
- Inherits:
-
Object
- Object
- CandidApiClient::Tasks::V3::V3Client
- 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::V3Client constructor
- #update(task_id:, request:, request_options: nil) ⇒ CandidApiClient::Tasks::V3::Types::Task
Constructor Details
#initialize(request_client:) ⇒ CandidApiClient::Tasks::V3::V3Client
24 25 26 |
# File 'lib/candidhealth/tasks/v_3/client.rb', line 24 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ CandidApiClient::RequestClient (readonly)
20 21 22 |
# File 'lib/candidhealth/tasks/v_3/client.rb', line 20 def request_client @request_client end |
Instance Method Details
#create(request:, request_options: nil) ⇒ CandidApiClient::Tasks::V3::Types::Task
146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/candidhealth/tasks/v_3/client.rb', line 146 def create(request:, request_options: nil) 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 |
#get(task_id:, request_options: nil) ⇒ CandidApiClient::Tasks::V3::Types::Task
118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/candidhealth/tasks/v_3/client.rb', line 118 def get(task_id:, 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/tasks/v3/#{task_id}" end CandidApiClient::Tasks::V3::Types::Task.from_json(json_object: response.body) end |
#get_actions(task_id:, request_options: nil) ⇒ CandidApiClient::Tasks::V3::Types::TaskActions
34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/candidhealth/tasks/v_3/client.rb', line 34 def get_actions(task_id:, 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/tasks/v3/#{task_id}/actions" end CandidApiClient::Tasks::V3::Types::TaskActions.from_json(json_object: response.body) 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
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/candidhealth/tasks/v_3/client.rb', line 81 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) 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 |
#update(task_id:, request:, request_options: nil) ⇒ CandidApiClient::Tasks::V3::Types::Task
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/candidhealth/tasks/v_3/client.rb', line 171 def update(task_id:, request:, request_options: nil) 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 |