Class: ApiKeysClient
- Inherits:
-
Object
- Object
- ApiKeysClient
- Defined in:
- lib/lockstep_sdk/clients/api_keys.rb
Instance Method Summary collapse
-
#create_api_key ⇒ Object
Creates an API key with the specified name.
-
#initialize(lockstepsdk) ⇒ ApiKeysClient
constructor
Initialize the ApiKeysClient class with a lockstepsdk instance.
-
#query_api_keys(filter:, include_param:, order:, pageSize:, pageNumber:) ⇒ Object
Queries API Keys for this user using the specified filtering, sorting, nested fetch, and pagination rules requested.
-
#retrieve_api_key(id:, include_param:) ⇒ Object
Retrieves the API Key with this identifier.
-
#revoke_api_key(id:) ⇒ Object
Immediately revokes the API Key with the specified id so it cannot be used to call the API.
Constructor Details
#initialize(lockstepsdk) ⇒ ApiKeysClient
Initialize the ApiKeysClient class with a lockstepsdk instance.
22 23 24 |
# File 'lib/lockstep_sdk/clients/api_keys.rb', line 22 def initialize(lockstepsdk) @lockstepsdk = lockstepsdk end |
Instance Method Details
#create_api_key ⇒ 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).
55 56 57 58 |
# File 'lib/lockstep_sdk/clients/api_keys.rb', line 55 def create_api_key() path = "/api/v1/ApiKeys" @lockstepsdk.request(:post, path, body, nil) end |
#query_api_keys(filter:, include_param:, order:, pageSize:, pageNumber:) ⇒ 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).
67 68 69 70 71 |
# File 'lib/lockstep_sdk/clients/api_keys.rb', line 67 def query_api_keys(filter:, include_param:, order:, pageSize:, pageNumber:) path = "/api/v1/ApiKeys/query" params = {:filter => filter, :include => include_param, :order => order, :pageSize => pageSize, :pageNumber => pageNumber} @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).
33 34 35 36 37 |
# File 'lib/lockstep_sdk/clients/api_keys.rb', line 33 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).
44 45 46 47 48 |
# File 'lib/lockstep_sdk/clients/api_keys.rb', line 44 def revoke_api_key(id:) path = "/api/v1/ApiKeys/#{id}" params = {} @lockstepsdk.request(:delete, path, nil, params) end |