# BookingHint.UserApi

All URIs are relative to *http://localhost:8081*

Method | HTTP request | Description
------------- | ------------- | -------------
[**usersGET**](UserApi.md#usersGET) | **GET** /users | 
[**usersUsernameAdminGET**](UserApi.md#usersUsernameAdminGET) | **GET** /users/{username}/admin | 
[**usersUsernameAdminPUT**](UserApi.md#usersUsernameAdminPUT) | **PUT** /users/{username}/admin | 
[**usersUsernameDELETE**](UserApi.md#usersUsernameDELETE) | **DELETE** /users/{username} | 
[**usersUsernamePOST**](UserApi.md#usersUsernamePOST) | **POST** /users/{username} | 
[**usersUsernamePasswordPUT**](UserApi.md#usersUsernamePasswordPUT) | **PUT** /users/{username}/password | 
[**usersUsernameSettingsDELETE**](UserApi.md#usersUsernameSettingsDELETE) | **DELETE** /users/{username}/settings | 
[**usersUsernameSettingsGET**](UserApi.md#usersUsernameSettingsGET) | **GET** /users/{username}/settings | 
[**usersUsernameSettingsSettingkeyGET**](UserApi.md#usersUsernameSettingsSettingkeyGET) | **GET** /users/{username}/settings/{settingkey} | 
[**usersUsernameSettingsSettingkeyPUT**](UserApi.md#usersUsernameSettingsSettingkeyPUT) | **PUT** /users/{username}/settings/{settingkey} | 


<a name="usersGET"></a>
# **usersGET**
> Usernames usersGET()



Get the usernames of all existing users. Must be admin. 

### Example
```javascript
var BookingHint = require('booking_hint');
var defaultClient = BookingHint.ApiClient.default;

// Configure API key authorization: authKey
var authKey = defaultClient.authentications['authKey'];
authKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//authKey.apiKeyPrefix = 'Token';

var apiInstance = new BookingHint.UserApi();

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.usersGET(callback);
```

### Parameters
This endpoint does not need any parameter.

### Return type

[**Usernames**](Usernames.md)

### Authorization

[authKey](../README.md#authKey)

### HTTP request headers

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

<a name="usersUsernameAdminGET"></a>
# **usersUsernameAdminGET**
> UserIsAdmin usersUsernameAdminGET(username)



Gets whether the user is admin or not.  Must be logged in to the account, or a admin. 

### Example
```javascript
var BookingHint = require('booking_hint');
var defaultClient = BookingHint.ApiClient.default;

// Configure API key authorization: authKey
var authKey = defaultClient.authentications['authKey'];
authKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//authKey.apiKeyPrefix = 'Token';

var apiInstance = new BookingHint.UserApi();

var username = "username_example"; // String | The username of the user. 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.usersUsernameAdminGET(username, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **username** | **String**| The username of the user.  | 

### Return type

[**UserIsAdmin**](UserIsAdmin.md)

### Authorization

[authKey](../README.md#authKey)

### HTTP request headers

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

<a name="usersUsernameAdminPUT"></a>
# **usersUsernameAdminPUT**
> usersUsernameAdminPUT(username, body)



Set the user as admin or not.  Requires admin account. You cannot remove administrator from yourself. 

### Example
```javascript
var BookingHint = require('booking_hint');
var defaultClient = BookingHint.ApiClient.default;

// Configure API key authorization: authKey
var authKey = defaultClient.authentications['authKey'];
authKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//authKey.apiKeyPrefix = 'Token';

var apiInstance = new BookingHint.UserApi();

var username = "username_example"; // String | The username of the user. 

var body = new BookingHint.Body3(); // Body3 | Set the property admin to true or false. 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.usersUsernameAdminPUT(username, body, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **username** | **String**| The username of the user.  | 
 **body** | [**Body3**](Body3.md)| Set the property admin to true or false.  | 

### Return type

null (empty response body)

### Authorization

[authKey](../README.md#authKey)

### HTTP request headers

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

<a name="usersUsernameDELETE"></a>
# **usersUsernameDELETE**
> usersUsernameDELETE(username)



Deletes a user.  Requires admin account.  Will return a 404 if you attempt to delete your own account, or a if otherwise unable to delete the account specified. 

### Example
```javascript
var BookingHint = require('booking_hint');
var defaultClient = BookingHint.ApiClient.default;

// Configure API key authorization: authKey
var authKey = defaultClient.authentications['authKey'];
authKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//authKey.apiKeyPrefix = 'Token';

var apiInstance = new BookingHint.UserApi();

var username = "username_example"; // String | The username that we are trying to delete. 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.usersUsernameDELETE(username, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **username** | **String**| The username that we are trying to delete.  | 

### Return type

null (empty response body)

### Authorization

[authKey](../README.md#authKey)

### HTTP request headers

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

<a name="usersUsernamePOST"></a>
# **usersUsernamePOST**
> usersUsernamePOST(username, body)



Creates a new user.  Must be admin.  Usernames must only contain letters and numbers, and are not case sensitive. A error 400 indicates a bad or existing username. 

### Example
```javascript
var BookingHint = require('booking_hint');
var defaultClient = BookingHint.ApiClient.default;

// Configure API key authorization: authKey
var authKey = defaultClient.authentications['authKey'];
authKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//authKey.apiKeyPrefix = 'Token';

var apiInstance = new BookingHint.UserApi();

var username = "username_example"; // String | The username that we are trying to create. 

var body = new BookingHint.Body2(); // Body2 | Set the property \"password\" to the new password. 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.usersUsernamePOST(username, body, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **username** | **String**| The username that we are trying to create.  | 
 **body** | [**Body2**](Body2.md)| Set the property \&quot;password\&quot; to the new password.  | 

### Return type

null (empty response body)

### Authorization

[authKey](../README.md#authKey)

### HTTP request headers

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

<a name="usersUsernamePasswordPUT"></a>
# **usersUsernamePasswordPUT**
> usersUsernamePasswordPUT(username, body)



Set the user&#39;s password.  Requires being logged in, or admin. 

### Example
```javascript
var BookingHint = require('booking_hint');
var defaultClient = BookingHint.ApiClient.default;

// Configure API key authorization: authKey
var authKey = defaultClient.authentications['authKey'];
authKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//authKey.apiKeyPrefix = 'Token';

var apiInstance = new BookingHint.UserApi();

var username = "username_example"; // String | The username of the user. 

var body = new BookingHint.Body4(); // Body4 | Set the property \"password\" to the new password to use. 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.usersUsernamePasswordPUT(username, body, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **username** | **String**| The username of the user.  | 
 **body** | [**Body4**](Body4.md)| Set the property \&quot;password\&quot; to the new password to use.  | 

### Return type

null (empty response body)

### Authorization

[authKey](../README.md#authKey)

### HTTP request headers

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

<a name="usersUsernameSettingsDELETE"></a>
# **usersUsernameSettingsDELETE**
> usersUsernameSettingsDELETE(username)



Deletes all settings for this user, resetting them to default.  Requires being logged in, or admin. 

### Example
```javascript
var BookingHint = require('booking_hint');
var defaultClient = BookingHint.ApiClient.default;

// Configure API key authorization: authKey
var authKey = defaultClient.authentications['authKey'];
authKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//authKey.apiKeyPrefix = 'Token';

var apiInstance = new BookingHint.UserApi();

var username = "username_example"; // String | The username of the user. 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.usersUsernameSettingsDELETE(username, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **username** | **String**| The username of the user.  | 

### Return type

null (empty response body)

### Authorization

[authKey](../README.md#authKey)

### HTTP request headers

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

<a name="usersUsernameSettingsGET"></a>
# **usersUsernameSettingsGET**
> PropertyObjects usersUsernameSettingsGET(username)



Gets all individual user settings and their values.  Requires being logged in, or admin. 

### Example
```javascript
var BookingHint = require('booking_hint');
var defaultClient = BookingHint.ApiClient.default;

// Configure API key authorization: authKey
var authKey = defaultClient.authentications['authKey'];
authKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//authKey.apiKeyPrefix = 'Token';

var apiInstance = new BookingHint.UserApi();

var username = "username_example"; // String | The username of the user. 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.usersUsernameSettingsGET(username, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **username** | **String**| The username of the user.  | 

### Return type

[**PropertyObjects**](PropertyObjects.md)

### Authorization

[authKey](../README.md#authKey)

### HTTP request headers

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

<a name="usersUsernameSettingsSettingkeyGET"></a>
# **usersUsernameSettingsSettingkeyGET**
> PropertyObject usersUsernameSettingsSettingkeyGET(username, settingkey)



Get a individual user setting.  Requires being logged in, or admin. 

### Example
```javascript
var BookingHint = require('booking_hint');
var defaultClient = BookingHint.ApiClient.default;

// Configure API key authorization: authKey
var authKey = defaultClient.authentications['authKey'];
authKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//authKey.apiKeyPrefix = 'Token';

var apiInstance = new BookingHint.UserApi();

var username = "username_example"; // String | The username of the user. 

var settingkey = "settingkey_example"; // String | The key denoting the setting we wish to work with. 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.usersUsernameSettingsSettingkeyGET(username, settingkey, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **username** | **String**| The username of the user.  | 
 **settingkey** | **String**| The key denoting the setting we wish to work with.  | 

### Return type

[**PropertyObject**](PropertyObject.md)

### Authorization

[authKey](../README.md#authKey)

### HTTP request headers

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

<a name="usersUsernameSettingsSettingkeyPUT"></a>
# **usersUsernameSettingsSettingkeyPUT**
> usersUsernameSettingsSettingkeyPUT(username, settingkey, body)



Set a individual user setting. May fail due to validation, or if the property is not editable (400).  Will also fail if the setting doesn&#39;t exist (404).  Requires being logged in, or admin. 

### Example
```javascript
var BookingHint = require('booking_hint');
var defaultClient = BookingHint.ApiClient.default;

// Configure API key authorization: authKey
var authKey = defaultClient.authentications['authKey'];
authKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//authKey.apiKeyPrefix = 'Token';

var apiInstance = new BookingHint.UserApi();

var username = "username_example"; // String | The username of the user. 

var settingkey = "settingkey_example"; // String | The key denoting the setting we wish to work with. 

var body = null; // Object | Set the property \"value\" to the new value for this. 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.usersUsernameSettingsSettingkeyPUT(username, settingkey, body, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **username** | **String**| The username of the user.  | 
 **settingkey** | **String**| The key denoting the setting we wish to work with.  | 
 **body** | **Object**| Set the property \&quot;value\&quot; to the new value for this.  | 

### Return type

null (empty response body)

### Authorization

[authKey](../README.md#authKey)

### HTTP request headers

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

