Class: CryptomateApi::Management::Credential
- Defined in:
- lib/cryptomate_api/management/credential.rb
Overview
Manage the access you give to each key and the permissions you will have for each blockchain, such as only receiving transactions or only accessing one of the blockchains.
Instance Method Summary collapse
-
#create_credential(api_key, operation_id) ⇒ Object
Creates a credential for a API-Key and operation.
-
#delete_credential(credential_id) ⇒ Object
Deletes a credential by ID.
-
#get_all_credentials(api_key) ⇒ Object
Get all credentials for an API-Key cryptomate.me/docs/management#get-all-credentials-for-a-api-key TODO: check response if it’s an array or a hash Response: { “id”: “string”, “key”: { “api_key”: “string”, “name”: “string” }, “operation”: { “id”: “string”, “description”: “string” } }.
-
#get_credential(credential_id) ⇒ Object
Get a credential information by id cryptomate.me/docs/management#get-a-credential-information Response: { “id”: “string”, “key”: { “api_key”: “string”, “name”: “string” }, “operation”: { “id”: “string”, “description”: “string” } }.
-
#update_credential(credential_id, api_key, operation_id) ⇒ Object
Modifies a credential by ID.
Methods inherited from Base
Constructor Details
This class inherits a constructor from CryptomateApi::Base
Instance Method Details
#create_credential(api_key, operation_id) ⇒ Object
Creates a credential for a API-Key and operation. cryptomate.me/docs/management#create-a-credential Response: {
"id": "string",
"key": {
"api_key": "string",
"name": "string"
},
"operation": {
"id": "string",
"description": "string"
}
}
63 64 65 |
# File 'lib/cryptomate_api/management/credential.rb', line 63 def create_credential(api_key, operation_id) self.class.post('/management/credentials', body: { api_key:, operation_id: }.to_json) end |
#delete_credential(credential_id) ⇒ Object
Deletes a credential by ID. cryptomate.me/docs/management#delete-a-credential
91 92 93 |
# File 'lib/cryptomate_api/management/credential.rb', line 91 def delete_credential(credential_id) self.class.delete("/management/credentials/#{credential_id}") end |
#get_all_credentials(api_key) ⇒ Object
Get all credentials for an API-Key cryptomate.me/docs/management#get-all-credentials-for-a-api-key TODO: check response if it’s an array or a hash Response: {
"id": "string",
"key": {
"api_key": "string",
"name": "string"
},
"operation": {
"id": "string",
"description": "string"
}
}
24 25 26 |
# File 'lib/cryptomate_api/management/credential.rb', line 24 def get_all_credentials(api_key) self.class.get("/management/credentials/api-key/#{api_key}") end |
#get_credential(credential_id) ⇒ Object
Get a credential information by id cryptomate.me/docs/management#get-a-credential-information Response: {
"id": "string",
"key": {
"api_key": "string",
"name": "string"
},
"operation": {
"id": "string",
"description": "string"
}
}
43 44 45 |
# File 'lib/cryptomate_api/management/credential.rb', line 43 def get_credential(credential_id) self.class.get("/management/credentials/#{credential_id}") end |
#update_credential(credential_id, api_key, operation_id) ⇒ Object
Modifies a credential by ID. cryptomate.me/docs/management#update-a-credential Response: {
"id": "string",
"key": {
"api_key": "string",
"name": "string"
},
"operation": {
"id": "string",
"description": "string"
}
}
84 85 86 |
# File 'lib/cryptomate_api/management/credential.rb', line 84 def update_credential(credential_id, api_key, operation_id) self.class.put("/management/credentials/#{credential_id}", body: { api_key:, operation_id: }.to_json) end |