Class: Deepgram::OnPrem::Client

Inherits:
Management::Client show all
Defined in:
lib/deepgram/on_prem.rb

Overview

The Client class within the OnPrem module extends the Management::Client class to handle operations specific to on-premise deployments within the Deepgram platform.

Instance Method Summary collapse

Methods inherited from Management::Client

#balance, #balances, #create_key, #delete_invite, #delete_key, #delete_project, #fields, #get_key, #get_project, #get_request, #initialize, #invites, #keys, #leave_project, #member_scopes, #members, #projects, #remove_member, #requests, #send_invite, #update_project, #update_scope, #usage

Methods inherited from Base

#initialize, #request

Methods included from ResponseHandler

#handle_response

Constructor Details

This class inherits a constructor from Deepgram::Management::Client

Instance Method Details

#create_credential(comments:, scopes:, provider:, project_id:) ⇒ Hash

Creates a new credential within a project with the specified details.

Parameters:

  • comments (String)

    Descriptive comments about the credential.

  • scopes (Array)

    The scopes or permissions assigned to the credential.

  • provider (String)

    The provider or platform for which the credential is valid.

  • project_id (String)

    The unique identifier for the project.

Returns:

  • (Hash)

    The details of the newly created credential.



32
33
34
35
36
# File 'lib/deepgram/on_prem.rb', line 32

def create_credential(comments:, scopes:, provider:, project_id:)
  request(:post, "#{project_id}/onprem/distribution/credentials") do |request|
    request.body = JSON.generate(comments: comments, scopes: scopes, provider: provider)
  end
end

#credentials(project_id:) ⇒ Array

Retrieves a list of credentials for a given project.

Parameters:

  • project_id (String)

    The unique identifier for the project.

Returns:

  • (Array)

    A list of credentials associated with the specified project.



12
13
14
# File 'lib/deepgram/on_prem.rb', line 12

def credentials(project_id:)
  request(:get, "#{project_id}/onprem/distribution/credentials")
end

#delete_credential(id, project_id:) ⇒ nil

Deletes a specific credential by its ID from a given project.

Parameters:

  • id (String)

    The unique identifier for the credential to be deleted.

  • project_id (String)

    The unique identifier for the project.

Returns:

  • (nil)

    Indicates the credential has been successfully deleted.



43
44
45
# File 'lib/deepgram/on_prem.rb', line 43

def delete_credential(id, project_id:)
  request(:delete, "#{project_id}/onprem/distribution/credentials/#{id}")
end

#get_credential(id, project_id:) ⇒ Hash

Retrieves a specific credential by its ID within a given project.

Parameters:

  • id (String)

    The unique identifier for the credential.

  • project_id (String)

    The unique identifier for the project.

Returns:

  • (Hash)

    The details of the specified credential.



21
22
23
# File 'lib/deepgram/on_prem.rb', line 21

def get_credential(id, project_id:)
  request(:get, "#{project_id}/onprem/distribution/credentials/#{id}")
end