Class: CandidApiClient::AsyncServiceFacilityClient
- Inherits:
-
Object
- Object
- CandidApiClient::AsyncServiceFacilityClient
- Defined in:
- lib/candidhealth/service_facility/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
- #initialize(request_client:) ⇒ CandidApiClient::AsyncServiceFacilityClient constructor
- #update(service_facility_id:, request:, request_options: nil) ⇒ CandidApiClient::ServiceFacility::Types::EncounterServiceFacility
Constructor Details
#initialize(request_client:) ⇒ CandidApiClient::AsyncServiceFacilityClient
58 59 60 |
# File 'lib/candidhealth/service_facility/client.rb', line 58 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ CandidApiClient::AsyncRequestClient (readonly)
54 55 56 |
# File 'lib/candidhealth/service_facility/client.rb', line 54 def request_client @request_client end |
Instance Method Details
#update(service_facility_id:, request:, request_options: nil) ⇒ CandidApiClient::ServiceFacility::Types::EncounterServiceFacility
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/candidhealth/service_facility/client.rb', line 78 def update(service_facility_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_facility/v2/#{service_facility_id}" end CandidApiClient::ServiceFacility::Types::EncounterServiceFacility.from_json(json_object: response.body) end end |