Class: CandidApiClient::OrganizationServiceFacilities::V2::AsyncV2Client

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/organization_service_facilities/v_2/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_client:) ⇒ CandidApiClient::OrganizationServiceFacilities::V2::AsyncV2Client

Parameters:



183
184
185
# File 'lib/candidhealth/organization_service_facilities/v_2/client.rb', line 183

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientCandidApiClient::AsyncRequestClient (readonly)



179
180
181
# File 'lib/candidhealth/organization_service_facilities/v_2/client.rb', line 179

def request_client
  @request_client
end

Instance Method Details

#create(request:, request_options: nil) ⇒ CandidApiClient::OrganizationServiceFacilities::V2::Types::OrganizationServiceFacility

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.organization_service_facilities.v_2.create(request: { name: "Test Service Facility", aliases: ["Test Service Facility Alias"], description: "Test Service Facility Description", status: ACTIVE, operational_status: CLOSED, mode: INSTANCE, type: DIAGNOSTICS_OR_THERAPEUTICS_UNIT, physical_type: SITE, telecoms: ["555-555-5555"], address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" } })

Parameters:

  • request (Hash)

    Request of type CandidApiClient::OrganizationServiceFacilities::V2::Types::OrganizationServiceFacilityCreate, as a Hash

    • :name (String)

    • :aliases (Array<String>)

    • :description (String)

    • :npi (String)

    • :status (CandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityStatus)

    • :operational_status (CandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityOperationalStatus)

    • :mode (CandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityMode)

    • :type (CandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityType)

    • :physical_type (CandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityPhysicalType)

    • :telecoms (Array<String>)

    • :address (Hash)

      • :zip_plus_four_code (String)

      • :address_1 (String)

      • :address_2 (String)

      • :city (String)

      • :state (CandidApiClient::Commons::Types::State)

      • :zip_code (String)

  • request_options (CandidApiClient::RequestOptions) (defaults to: nil)

Returns:



268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
# File 'lib/candidhealth/organization_service_facilities/v_2/client.rb', line 268

def create(request:, request_options: nil)
  Async do
    response = @request_client.conn.post do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/organization-service-facilities/v2"
    end
    CandidApiClient::OrganizationServiceFacilities::V2::Types::OrganizationServiceFacility.from_json(json_object: response.body)
  end
end

#delete(organization_service_facility_id:, request_options: nil) ⇒ Void

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.organization_service_facilities.v_2.delete(organization_service_facility_id: "30F55EE6-8C0E-43FC-A7FC-DAC00D5BF569")

Parameters:

Returns:

  • (Void)


334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
# File 'lib/candidhealth/organization_service_facilities/v_2/client.rb', line 334

def delete(organization_service_facility_id:, request_options: nil)
  Async do
    @request_client.conn.delete do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/organization-service-facilities/v2/#{organization_service_facility_id}"
    end
  end
end

#get(organization_service_facility_id:, request_options: nil) ⇒ CandidApiClient::OrganizationServiceFacilities::V2::Types::OrganizationServiceFacility

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.organization_service_facilities.v_2.get(organization_service_facility_id: "30F55EE6-8C0E-43FC-A7FC-DAC00D5BF569")

Parameters:

Returns:



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/candidhealth/organization_service_facilities/v_2/client.rb', line 193

def get(organization_service_facility_id:, request_options: nil)
  Async do
    response = @request_client.conn.get do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/organization-service-facilities/v2/#{organization_service_facility_id}"
    end
    CandidApiClient::OrganizationServiceFacilities::V2::Types::OrganizationServiceFacility.from_json(json_object: response.body)
  end
end

#get_multi(limit: nil, name: nil, page_token: nil, request_options: nil) ⇒ CandidApiClient::OrganizationServiceFacilities::V2::Types::OrganizationServiceFacilityPage

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.organization_service_facilities.v_2.get_multi(
  limit: 100,
  name: "Test Service Facility",
  page_token: "eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9"
)

Parameters:

  • limit (Integer) (defaults to: nil)

    Limit the number of results returned. Defaults to 100.

  • name (String) (defaults to: nil)

    Filter to a name or a part of a name.

  • page_token (String) (defaults to: nil)

    The page token to continue paging through a previous request.

  • request_options (CandidApiClient::RequestOptions) (defaults to: nil)

Returns:



222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/candidhealth/organization_service_facilities/v_2/client.rb', line 222

def get_multi(limit: nil, name: nil, page_token: nil, request_options: nil)
  Async do
    response = @request_client.conn.get do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      req.params = {
        **(request_options&.additional_query_parameters || {}),
        "limit": limit,
        "name": name,
        "page_token": page_token
      }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/organization-service-facilities/v2"
    end
    CandidApiClient::OrganizationServiceFacilities::V2::Types::OrganizationServiceFacilityPage.from_json(json_object: response.body)
  end
end

#update(organization_service_facility_id:, request:, request_options: nil) ⇒ CandidApiClient::OrganizationServiceFacilities::V2::Types::OrganizationServiceFacility

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.organization_service_facilities.v_2.update(organization_service_facility_id: "30F55EE6-8C0E-43FC-A7FC-DAC00D5BF569", request: { name: "Test Service Facility", aliases: ["Test Service Facility Alias"], description: "Test Service Facility Description", status: ACTIVE, operational_status: CLOSED, mode: INSTANCE, type: DIAGNOSTICS_OR_THERAPEUTICS_UNIT, physical_type: SITE, telecoms: ["555-555-5555"], address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" } })

Parameters:

  • organization_service_facility_id (String)
  • request (Hash)

    Request of type CandidApiClient::OrganizationServiceFacilities::V2::Types::OrganizationServiceFacilityUpdate, as a Hash

    • :name (String)

    • :aliases (Array<String>)

    • :description (String)

    • :npi (String)

    • :status (CandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityStatus)

    • :operational_status (CandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityOperationalStatus)

    • :mode (CandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityMode)

    • :type (CandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityType)

    • :physical_type (CandidApiClient::OrganizationServiceFacilities::V2::Types::ServiceFacilityPhysicalType)

    • :telecoms (Array<String>)

    • :address (Hash)

      • :zip_plus_four_code (String)

      • :address_1 (String)

      • :address_2 (String)

      • :city (String)

      • :state (CandidApiClient::Commons::Types::State)

      • :zip_code (String)

  • request_options (CandidApiClient::RequestOptions) (defaults to: nil)

Returns:



310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/candidhealth/organization_service_facilities/v_2/client.rb', line 310

def update(organization_service_facility_id:, request:, request_options: nil)
  Async do
    response = @request_client.conn.patch do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/organization-service-facilities/v2/#{organization_service_facility_id}"
    end
    CandidApiClient::OrganizationServiceFacilities::V2::Types::OrganizationServiceFacility.from_json(json_object: response.body)
  end
end