Class: CandidApiClient::Guarantor::V1::V1Client
- Inherits:
-
Object
- Object
- CandidApiClient::Guarantor::V1::V1Client
- Defined in:
- lib/candidhealth/guarantor/v_1/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(encounter_id:, request:, request_options: nil) ⇒ CandidApiClient::Guarantor::V1::Types::Guarantor
Creates a new guarantor and returns the newly created Guarantor object.
-
#get(guarantor_id:, request_options: nil) ⇒ CandidApiClient::Guarantor::V1::Types::Guarantor
Retrieves a guarantor by its ‘guarantor_id`.
- #initialize(request_client:) ⇒ CandidApiClient::Guarantor::V1::V1Client constructor
-
#update(guarantor_id:, request:, request_options: nil) ⇒ CandidApiClient::Guarantor::V1::Types::Guarantor
Updates a guarantor by its ‘guarantor_id`.
Constructor Details
#initialize(request_client:) ⇒ CandidApiClient::Guarantor::V1::V1Client
18 19 20 |
# File 'lib/candidhealth/guarantor/v_1/client.rb', line 18 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ CandidApiClient::RequestClient (readonly)
14 15 16 |
# File 'lib/candidhealth/guarantor/v_1/client.rb', line 14 def request_client @request_client end |
Instance Method Details
#create(encounter_id:, request:, request_options: nil) ⇒ CandidApiClient::Guarantor::V1::Types::Guarantor
Creates a new guarantor and returns the newly created Guarantor object.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/candidhealth/guarantor/v_1/client.rb', line 46 def create(encounter_id:, 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/guarantors/v1/#{encounter_id}" end CandidApiClient::Guarantor::V1::Types::Guarantor.from_json(json_object: response.body) end |
#get(guarantor_id:, request_options: nil) ⇒ CandidApiClient::Guarantor::V1::Types::Guarantor
Retrieves a guarantor by its ‘guarantor_id`.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/candidhealth/guarantor/v_1/client.rb', line 70 def get(guarantor_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/guarantors/v1/#{guarantor_id}" end CandidApiClient::Guarantor::V1::Types::Guarantor.from_json(json_object: response.body) end |
#update(guarantor_id:, request:, request_options: nil) ⇒ CandidApiClient::Guarantor::V1::Types::Guarantor
Updates a guarantor by its ‘guarantor_id`.
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/candidhealth/guarantor/v_1/client.rb', line 109 def update(guarantor_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/guarantors/v1/#{guarantor_id}" end CandidApiClient::Guarantor::V1::Types::Guarantor.from_json(json_object: response.body) end |