Module: ApiKeys

Included in:
Config
Defined in:
lib/user/config/api_keys.rb

Instance Method Summary collapse

Instance Method Details

#create_api_key(data) ⇒ Object

Create api key.

Create an api key with data.

Parameters

data

(Hash) – Data to be submited.

Example

data = {
  "description": "New Api Key Description"
}
@data = @mints_user.create_api_key(data)


50
51
52
# File 'lib/user/config/api_keys.rb', line 50

def create_api_key(data)
    return @client.raw("post", "/config/api-keys", nil, data_transform(data))
end

#delete_api_key(id) ⇒ Object

Delete api key.

Delete an api key.

Parameters

id

(Integer) – Api key id.

Example

@data = @mints_user.delete_api_key(2)


62
63
64
# File 'lib/user/config/api_keys.rb', line 62

def delete_api_key(id)
    return @client.raw("delete", "/config/api-keys/#{id}")
end

#get_api_key(id, options = nil) ⇒ Object

Get api key.

Get an api key info.

Parameters

id

(Integer) – Api key id.

options

(Hash) – List of Resource Collection Options shown above can be used as parameter.

First Example

@data = @mints_user.get_api_key(2)

Second Example

options = { "fields": "id" }
@data = @mints_user.get_api_key(2, options)


35
36
37
# File 'lib/user/config/api_keys.rb', line 35

def get_api_key(id, options = nil)
    return @client.raw("get", "/config/api-keys/#{id}", options)
end

#get_api_keys(options = nil) ⇒ Object

Get api keys.

Get a collection of api keys.

Parameters

options

(Hash) – List of Resource Collection Options shown above can be used as parameter.

First Example

@data = @mints_user.get_api_keys

Second Example

options = { "fields": "id" }
@data = @mints_user.get_api_keys(options)


18
19
20
# File 'lib/user/config/api_keys.rb', line 18

def get_api_keys(options = nil)
    return @client.raw("get", "/config/api-keys", options)
end