Class: CandidApiClient::ServiceFacilityClient
- Inherits:
-
Object
- Object
- CandidApiClient::ServiceFacilityClient
- Defined in:
- lib/candidhealth/service_facility/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
- #initialize(request_client:) ⇒ CandidApiClient::ServiceFacilityClient constructor
- #update(service_facility_id:, request:, request_options: nil) ⇒ CandidApiClient::ServiceFacility::Types::EncounterServiceFacility
Constructor Details
#initialize(request_client:) ⇒ CandidApiClient::ServiceFacilityClient
15 16 17 |
# File 'lib/candidhealth/service_facility/client.rb', line 15 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ CandidApiClient::RequestClient (readonly)
11 12 13 |
# File 'lib/candidhealth/service_facility/client.rb', line 11 def request_client @request_client end |
Instance Method Details
#update(service_facility_id:, request:, request_options: nil) ⇒ CandidApiClient::ServiceFacility::Types::EncounterServiceFacility
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/candidhealth/service_facility/client.rb', line 35 def update(service_facility_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/service_facility/v2/#{service_facility_id}" end CandidApiClient::ServiceFacility::Types::EncounterServiceFacility.from_json(json_object: response.body) end |