@tennac-booking/sdk
Version:
OpenAPI client for @tennac-booking/sdk
422 lines (272 loc) • 10.4 kB
Markdown
# UsersApi
All URIs are relative to *https://api.mon-domaine.com*
|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**changePassword**](#changepassword) | **PUT** /api/users/me/password | Modifie le mot de passe de l\'utilisateur connecté|
|[**getAllUsers**](#getallusers) | **GET** /api/users | Récupère la liste des utilisateurs|
|[**getUserInfo**](#getuserinfo) | **GET** /api/users/me | Récupère les informations de l\'utilisateur connecté|
|[**getUserRolesInClubs**](#getuserrolesinclubs) | **GET** /api/users/me/roles | Récupère les rôles de l\'utilisateur dans les clubs|
|[**login**](#login) | **POST** /api/users/login | Authentifie un utilisateur|
|[**refreshToken**](#refreshtoken) | **POST** /api/users/refresh-token | Rafraîchit le token d\'accès|
|[**register**](#register) | **POST** /api/users | Crée un nouvel utilisateur|
|[**updateUser**](#updateuser) | **PUT** /api/users/me | Met à jour les données de l\'utilisateur connecté|
# **changePassword**
> ChangePasswordResponse changePassword(changePasswordRequestBody)
### Example
```typescript
import {
UsersApi,
Configuration,
ChangePasswordRequestBody
} from '@tennac-booking/sdk';
const configuration = new Configuration();
const apiInstance = new UsersApi(configuration);
let changePasswordRequestBody: ChangePasswordRequestBody; //
const { status, data } = await apiInstance.changePassword(
changePasswordRequestBody
);
```
### Parameters
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **changePasswordRequestBody** | **ChangePasswordRequestBody**| | |
### Return type
**ChangePasswordResponse**
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Mot de passe modifié | - |
|**400** | Requête invalide | - |
|**401** | Non autorisé | - |
|**500** | Erreur serveur interne | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **getAllUsers**
> Array<UserResponse> getAllUsers()
### Example
```typescript
import {
UsersApi,
Configuration
} from '@tennac-booking/sdk';
const configuration = new Configuration();
const apiInstance = new UsersApi(configuration);
const { status, data } = await apiInstance.getAllUsers();
```
### Parameters
This endpoint does not have any parameters.
### Return type
**Array<UserResponse>**
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Liste des utilisateurs | - |
|**401** | Non autorisé | - |
|**500** | Erreur serveur interne | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **getUserInfo**
> UserResponse getUserInfo()
### Example
```typescript
import {
UsersApi,
Configuration
} from '@tennac-booking/sdk';
const configuration = new Configuration();
const apiInstance = new UsersApi(configuration);
const { status, data } = await apiInstance.getUserInfo();
```
### Parameters
This endpoint does not have any parameters.
### Return type
**UserResponse**
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Informations de l\'utilisateur | - |
|**401** | Non autorisé | - |
|**500** | Erreur serveur interne | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **getUserRolesInClubs**
> GetUserRolesInClubs200Response getUserRolesInClubs()
### Example
```typescript
import {
UsersApi,
Configuration
} from '@tennac-booking/sdk';
const configuration = new Configuration();
const apiInstance = new UsersApi(configuration);
const { status, data } = await apiInstance.getUserRolesInClubs();
```
### Parameters
This endpoint does not have any parameters.
### Return type
**GetUserRolesInClubs200Response**
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Liste des rôles dans les clubs | - |
|**400** | Requête invalide | - |
|**401** | Non autorisé | - |
|**500** | Erreur serveur interne | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **login**
> LoginResponse login(loginRequestBody)
### Example
```typescript
import {
UsersApi,
Configuration,
LoginRequestBody
} from '@tennac-booking/sdk';
const configuration = new Configuration();
const apiInstance = new UsersApi(configuration);
let loginRequestBody: LoginRequestBody; //
const { status, data } = await apiInstance.login(
loginRequestBody
);
```
### Parameters
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **loginRequestBody** | **LoginRequestBody**| | |
### Return type
**LoginResponse**
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Authentification réussie | - |
|**400** | Requête invalide | - |
|**401** | Non autorisé | - |
|**500** | Erreur serveur interne | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **refreshToken**
> RefreshTokenResponse refreshToken(refreshTokenRequestBody)
### Example
```typescript
import {
UsersApi,
Configuration,
RefreshTokenRequestBody
} from '@tennac-booking/sdk';
const configuration = new Configuration();
const apiInstance = new UsersApi(configuration);
let refreshTokenRequestBody: RefreshTokenRequestBody; //
const { status, data } = await apiInstance.refreshToken(
refreshTokenRequestBody
);
```
### Parameters
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **refreshTokenRequestBody** | **RefreshTokenRequestBody**| | |
### Return type
**RefreshTokenResponse**
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Nouveaux tokens | - |
|**400** | Requête invalide | - |
|**401** | Non autorisé | - |
|**500** | Erreur serveur interne | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **register**
> UserResponse register(registerRequestBody)
### Example
```typescript
import {
UsersApi,
Configuration,
RegisterRequestBody
} from '@tennac-booking/sdk';
const configuration = new Configuration();
const apiInstance = new UsersApi(configuration);
let registerRequestBody: RegisterRequestBody; //
const { status, data } = await apiInstance.register(
registerRequestBody
);
```
### Parameters
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **registerRequestBody** | **RegisterRequestBody**| | |
### Return type
**UserResponse**
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**201** | Utilisateur créé | - |
|**400** | Requête invalide | - |
|**409** | Email déjà utilisé | - |
|**500** | Erreur serveur interne | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **updateUser**
> UserResponse updateUser(updateUserRequestBody)
### Example
```typescript
import {
UsersApi,
Configuration,
UpdateUserRequestBody
} from '@tennac-booking/sdk';
const configuration = new Configuration();
const apiInstance = new UsersApi(configuration);
let updateUserRequestBody: UpdateUserRequestBody; //
const { status, data } = await apiInstance.updateUser(
updateUserRequestBody
);
```
### Parameters
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **updateUserRequestBody** | **UpdateUserRequestBody**| | |
### Return type
**UserResponse**
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Utilisateur mis à jour | - |
|**400** | Requête invalide | - |
|**401** | Non autorisé | - |
|**500** | Erreur serveur interne | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)