Class: ApiKeysClient

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/clients/api_keys_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(lockstepsdk) ⇒ ApiKeysClient

Initialize the ApiKeysClient class with a lockstepsdk instance.

Parameters:

  • lockstepsdk (LockstepApi)

    The Lockstep API client object for this connection



25
26
27
# File 'lib/lockstep_sdk/clients/api_keys_client.rb', line 25

def initialize(lockstepsdk)
    @lockstepsdk = lockstepsdk
end

Instance Method Details

#create_api_key(body:) ⇒ Object

Creates an API key with the specified name.

An API Key is an authentication token that you may use with the Lockstep API. Because API Keys do not have an expiration date, they are well suited for unattended processes. Each API Key is associated with a user, and may be revoked to prevent it from accessing the Lockstep API. When you create an API Key, make sure to save the value in a secure location. Lockstep cannot retrieve an API Key once it is created. For more information, see [API Keys](developer.lockstep.io/docs/api-keys).

Parameters:

  • body (ApiKeyModel)

    Metadata about the API Key to create.



60
61
62
63
# File 'lib/lockstep_sdk/clients/api_keys_client.rb', line 60

def create_api_key(body:)
    path = "/api/v1/ApiKeys"
    @lockstepsdk.request(:post, path, body, nil)
end

#query_api_keys(filter:, include_param:, order:, page_size:, page_number:) ⇒ Object

Queries API Keys for this user using the specified filtering, sorting, nested fetch, and pagination rules requested. An API Key is an authentication token that you may use with the Lockstep API. Because API Keys do not have an expiration date, they are well suited for unattended processes. Each API Key is associated with a user, and may be revoked to prevent it from accessing the Lockstep API. When you create an API Key, make sure to save the value in a secure location. Lockstep cannot retrieve an API Key once it is created. For more information, see [API Keys](developer.lockstep.io/docs/api-keys).

Parameters:



73
74
75
76
77
# File 'lib/lockstep_sdk/clients/api_keys_client.rb', line 73

def query_api_keys(filter:, include_param:, order:, page_size:, page_number:)
    path = "/api/v1/ApiKeys/query"
    params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number}
    @lockstepsdk.request(:get, path, nil, params)
end

#retrieve_api_key(id:, include_param:) ⇒ Object

Retrieves the API Key with this identifier.

An API Key is an authentication token that you may use with the Lockstep API. Because API Keys do not have an expiration date, they are well suited for unattended processes. Each API Key is associated with a user, and may be revoked to prevent it from accessing the Lockstep API. When you create an API Key, make sure to save the value in a secure location. Lockstep cannot retrieve an API Key once it is created. For more information, see [API Keys](developer.lockstep.io/docs/api-keys).

Parameters:

  • id (uuid)

    The unique ID number of the API Key to retrieve

  • include_param (string)

    To fetch additional data on this object, specify the list of elements to retrieve. No collections are currently available but may be offered in the future.



37
38
39
40
41
# File 'lib/lockstep_sdk/clients/api_keys_client.rb', line 37

def retrieve_api_key(id:, include_param:)
    path = "/api/v1/ApiKeys/#{id}"
    params = {:include => include_param}
    @lockstepsdk.request(:get, path, nil, params)
end

#revoke_api_key(id:) ⇒ Object

Immediately revokes the API Key with the specified id so it cannot be used to call the API. The Lockstep Platform guarantees that revocation will be received by all servers within five minutes of revocation. API calls made using this API key after the revocation will fail. A revoked API Key cannot be un-revoked and may be removed 60 days after revocation.

An API Key is an authentication token that you may use with the Lockstep API. Because API Keys do not have an expiration date, they are well suited for unattended processes. Each API Key is associated with a user, and may be revoked to prevent it from accessing the Lockstep API. When you create an API Key, make sure to save the value in a secure location. Lockstep cannot retrieve an API Key once it is created. For more information, see [API Keys](developer.lockstep.io/docs/api-keys).

Parameters:

  • id (uuid)

    The unique Lockstep Platform ID number of this API Key



49
50
51
52
# File 'lib/lockstep_sdk/clients/api_keys_client.rb', line 49

def revoke_api_key(id:)
    path = "/api/v1/ApiKeys/#{id}"
    @lockstepsdk.request(:delete, path, nil, nil)
end