Skip to content

Latest commit

 

History

History
285 lines (202 loc) · 7.55 KB

UsersApi.md

File metadata and controls

285 lines (202 loc) · 7.55 KB

UsersApi

All URIs are relative to http://localhost/api/v1

Method HTTP request Description
createUser POST /users
deleteUser DELETE /users/{id}
getUser GET /users/{id}
listUsers GET /users
updateUser PATCH /users/{id}

createUser

UserResponse createUser(user)

Creates a new user in the store

Example

// Import classes:
//import io.github.triglav_dataflow.client.ApiClient;
//import io.github.triglav_dataflow.client.ApiException;
//import io.github.triglav_dataflow.client.Configuration;
//import io.github.triglav_dataflow.client.auth.*;
//import io.github.triglav_dataflow.client.api.UsersApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");

UsersApi apiInstance = new UsersApi();
UserRequest user = new UserRequest(); // UserRequest | User to add to the store
try {
    UserResponse result = apiInstance.createUser(user);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling UsersApi#createUser");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
user UserRequest User to add to the store

Return type

UserResponse

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

deleteUser

deleteUser(id)

Deletes single user

Example

// Import classes:
//import io.github.triglav_dataflow.client.ApiClient;
//import io.github.triglav_dataflow.client.ApiException;
//import io.github.triglav_dataflow.client.Configuration;
//import io.github.triglav_dataflow.client.auth.*;
//import io.github.triglav_dataflow.client.api.UsersApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");

UsersApi apiInstance = new UsersApi();
Long id = 789L; // Long | ID of user to fetch
try {
    apiInstance.deleteUser(id);
} catch (ApiException e) {
    System.err.println("Exception when calling UsersApi#deleteUser");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id Long ID of user to fetch

Return type

null (empty response body)

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

getUser

UserResponse getUser(id)

Returns a single user

Example

// Import classes:
//import io.github.triglav_dataflow.client.ApiClient;
//import io.github.triglav_dataflow.client.ApiException;
//import io.github.triglav_dataflow.client.Configuration;
//import io.github.triglav_dataflow.client.auth.*;
//import io.github.triglav_dataflow.client.api.UsersApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");

UsersApi apiInstance = new UsersApi();
Long id = 789L; // Long | ID of user to fetch
try {
    UserResponse result = apiInstance.getUser(id);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling UsersApi#getUser");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id Long ID of user to fetch

Return type

UserResponse

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

listUsers

List<UserEachResponse> listUsers()

Returns all users from the system that the user has access to

Example

// Import classes:
//import io.github.triglav_dataflow.client.ApiClient;
//import io.github.triglav_dataflow.client.ApiException;
//import io.github.triglav_dataflow.client.Configuration;
//import io.github.triglav_dataflow.client.auth.*;
//import io.github.triglav_dataflow.client.api.UsersApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");

UsersApi apiInstance = new UsersApi();
try {
    List<UserEachResponse> result = apiInstance.listUsers();
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling UsersApi#listUsers");
    e.printStackTrace();
}

Parameters

This endpoint does not need any parameter.

Return type

List<UserEachResponse>

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

updateUser

UserResponse updateUser(id, user)

Updates a single user

Example

// Import classes:
//import io.github.triglav_dataflow.client.ApiClient;
//import io.github.triglav_dataflow.client.ApiException;
//import io.github.triglav_dataflow.client.Configuration;
//import io.github.triglav_dataflow.client.auth.*;
//import io.github.triglav_dataflow.client.api.UsersApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");

UsersApi apiInstance = new UsersApi();
Long id = 789L; // Long | ID of user to fetch
UserRequest user = new UserRequest(); // UserRequest | User parameters to update
try {
    UserResponse result = apiInstance.updateUser(id, user);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling UsersApi#updateUser");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id Long ID of user to fetch
user UserRequest User parameters to update

Return type

UserResponse

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json