All URIs are relative to http://localhost/api/v1
Method | HTTP request | Description |
---|---|---|
create_user | POST /users | |
delete_user | DELETE /users/{id} | |
get_user | GET /users/{id} | |
list_users | GET /users | |
update_user | PATCH /users/{id} |
UserResponse create_user(user)
Creates a new user in the store
# load the gem
require 'triglav_client'
# setup authorization
TriglavClient.configure do |config|
# Configure API key authorization: api_key
config.api_key['Authorization'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Authorization'] = 'Bearer'
end
api_instance = TriglavClient::UsersApi.new
user = TriglavClient::UserRequest.new # UserRequest | User to add to the store
begin
result = api_instance.create_user(user)
p result
rescue TriglavClient::ApiError => e
puts "Exception when calling UsersApi->create_user: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
user | UserRequest | User to add to the store |
- Content-Type: application/json
- Accept: application/json
delete_user(id)
Deletes single user
# load the gem
require 'triglav_client'
# setup authorization
TriglavClient.configure do |config|
# Configure API key authorization: api_key
config.api_key['Authorization'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Authorization'] = 'Bearer'
end
api_instance = TriglavClient::UsersApi.new
id = 789 # Integer | ID of user to fetch
begin
api_instance.delete_user(id)
rescue TriglavClient::ApiError => e
puts "Exception when calling UsersApi->delete_user: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
id | Integer | ID of user to fetch |
nil (empty response body)
- Content-Type: application/json
- Accept: application/json
UserResponse get_user(id)
Returns a single user
# load the gem
require 'triglav_client'
# setup authorization
TriglavClient.configure do |config|
# Configure API key authorization: api_key
config.api_key['Authorization'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Authorization'] = 'Bearer'
end
api_instance = TriglavClient::UsersApi.new
id = 789 # Integer | ID of user to fetch
begin
result = api_instance.get_user(id)
p result
rescue TriglavClient::ApiError => e
puts "Exception when calling UsersApi->get_user: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
id | Integer | ID of user to fetch |
- Content-Type: application/json
- Accept: application/json
Array<UserEachResponse> list_users
Returns all users from the system that the user has access to
# load the gem
require 'triglav_client'
# setup authorization
TriglavClient.configure do |config|
# Configure API key authorization: api_key
config.api_key['Authorization'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Authorization'] = 'Bearer'
end
api_instance = TriglavClient::UsersApi.new
begin
result = api_instance.list_users
p result
rescue TriglavClient::ApiError => e
puts "Exception when calling UsersApi->list_users: #{e}"
end
This endpoint does not need any parameter.
- Content-Type: application/json
- Accept: application/json
UserResponse update_user(id, user)
Updates a single user
# load the gem
require 'triglav_client'
# setup authorization
TriglavClient.configure do |config|
# Configure API key authorization: api_key
config.api_key['Authorization'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Authorization'] = 'Bearer'
end
api_instance = TriglavClient::UsersApi.new
id = 789 # Integer | ID of user to fetch
user = TriglavClient::UserRequest.new # UserRequest | User parameters to update
begin
result = api_instance.update_user(id, user)
p result
rescue TriglavClient::ApiError => e
puts "Exception when calling UsersApi->update_user: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
id | Integer | ID of user to fetch | |
user | UserRequest | User parameters to update |
- Content-Type: application/json
- Accept: application/json