Class: CandidApiClient::ServiceLines::V2::AsyncV2Client
- Inherits:
-
Object
- Object
- CandidApiClient::ServiceLines::V2::AsyncV2Client
- Defined in:
- lib/candidhealth/service_lines/v_2/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
- #create(request:, request_options: nil) ⇒ CandidApiClient::ServiceLines::V2::Types::ServiceLine
- #delete(service_line_id:, request_options: nil) ⇒ Void
- #initialize(request_client:) ⇒ CandidApiClient::ServiceLines::V2::AsyncV2Client constructor
- #update(service_line_id:, request:, request_options: nil) ⇒ CandidApiClient::ServiceLines::V2::Types::ServiceLine
Constructor Details
#initialize(request_client:) ⇒ CandidApiClient::ServiceLines::V2::AsyncV2Client
159 160 161 |
# File 'lib/candidhealth/service_lines/v_2/client.rb', line 159 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ CandidApiClient::AsyncRequestClient (readonly)
155 156 157 |
# File 'lib/candidhealth/service_lines/v_2/client.rb', line 155 def request_client @request_client end |
Instance Method Details
#create(request:, request_options: nil) ⇒ CandidApiClient::ServiceLines::V2::Types::ServiceLine
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 |
# File 'lib/candidhealth/service_lines/v_2/client.rb', line 208 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/service-lines/v2" end CandidApiClient::ServiceLines::V2::Types::ServiceLine.from_json(json_object: response.body) end end |
#delete(service_line_id:, request_options: nil) ⇒ Void
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 |
# File 'lib/candidhealth/service_lines/v_2/client.rb', line 283 def delete(service_line_id:, request_options: nil) Async do @request_client.conn.delete 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/service-lines/v2/#{service_line_id}" end end end |
#update(service_line_id:, request:, request_options: nil) ⇒ CandidApiClient::ServiceLines::V2::Types::ServiceLine
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 |
# File 'lib/candidhealth/service_lines/v_2/client.rb', line 259 def update(service_line_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/service-lines/v2/#{service_line_id}" end CandidApiClient::ServiceLines::V2::Types::ServiceLine.from_json(json_object: response.body) end end |