@space-cow-media/spellbook-client
Version:
An Open Api generated client for the Commander Spellbook backend REST API.
393 lines (273 loc) • 9.78 kB
Markdown
# UsersApi
All URIs are relative to *http://localhost*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**usersDestroy**](UsersApi.md#usersdestroy) | **DELETE** /users/{id}/ | |
| [**usersList**](UsersApi.md#userslist) | **GET** /users/ | |
| [**usersPartialUpdate**](UsersApi.md#userspartialupdate) | **PATCH** /users/{id}/ | |
| [**usersRetrieve**](UsersApi.md#usersretrieve) | **GET** /users/{id}/ | |
| [**usersUpdate**](UsersApi.md#usersupdate) | **PUT** /users/{id}/ | |
## usersDestroy
> usersDestroy(id)
### Example
```ts
import {
Configuration,
UsersApi,
} from '';
import type { UsersDestroyRequest } from '';
async function example() {
console.log("🚀 Testing SDK...");
const config = new Configuration({
// To configure HTTP basic authorization: basicAuth
username: "YOUR USERNAME",
password: "YOUR PASSWORD",
// To configure API key authorization: cookieAuth
apiKey: "YOUR API KEY",
// Configure HTTP bearer authorization: jwtAuth
accessToken: "YOUR BEARER TOKEN",
});
const api = new UsersApi(config);
const body = {
// number | A unique integer value identifying this user.
id: 56,
} satisfies UsersDestroyRequest;
try {
const data = await api.usersDestroy(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **id** | `number` | A unique integer value identifying this user. | [Defaults to `undefined`] |
### Return type
`void` (Empty response body)
### Authorization
[basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [jwtAuth](../README.md#jwtAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **204** | No response body | - |
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
## usersList
> PaginatedUserDetailList usersList(limit, offset)
### Example
```ts
import {
Configuration,
UsersApi,
} from '';
import type { UsersListRequest } from '';
async function example() {
console.log("🚀 Testing SDK...");
const config = new Configuration({
// To configure HTTP basic authorization: basicAuth
username: "YOUR USERNAME",
password: "YOUR PASSWORD",
// To configure API key authorization: cookieAuth
apiKey: "YOUR API KEY",
// Configure HTTP bearer authorization: jwtAuth
accessToken: "YOUR BEARER TOKEN",
});
const api = new UsersApi(config);
const body = {
// number | Number of results to return per page. (optional)
limit: 56,
// number | The initial index from which to return the results. (optional)
offset: 56,
} satisfies UsersListRequest;
try {
const data = await api.usersList(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **limit** | `number` | Number of results to return per page. | [Optional] [Defaults to `undefined`] |
| **offset** | `number` | The initial index from which to return the results. | [Optional] [Defaults to `undefined`] |
### Return type
[**PaginatedUserDetailList**](PaginatedUserDetailList.md)
### Authorization
[basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [jwtAuth](../README.md#jwtAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: `application/json`
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | | - |
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
## usersPartialUpdate
> UserDetail usersPartialUpdate(id, patchedUserDetailRequest)
### Example
```ts
import {
Configuration,
UsersApi,
} from '';
import type { UsersPartialUpdateRequest } from '';
async function example() {
console.log("🚀 Testing SDK...");
const config = new Configuration({
// To configure HTTP basic authorization: basicAuth
username: "YOUR USERNAME",
password: "YOUR PASSWORD",
// To configure API key authorization: cookieAuth
apiKey: "YOUR API KEY",
// Configure HTTP bearer authorization: jwtAuth
accessToken: "YOUR BEARER TOKEN",
});
const api = new UsersApi(config);
const body = {
// number | A unique integer value identifying this user.
id: 56,
// PatchedUserDetailRequest (optional)
patchedUserDetailRequest: ...,
} satisfies UsersPartialUpdateRequest;
try {
const data = await api.usersPartialUpdate(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **id** | `number` | A unique integer value identifying this user. | [Defaults to `undefined`] |
| **patchedUserDetailRequest** | [PatchedUserDetailRequest](PatchedUserDetailRequest.md) | | [Optional] |
### Return type
[**UserDetail**](UserDetail.md)
### Authorization
[basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [jwtAuth](../README.md#jwtAuth)
### HTTP request headers
- **Content-Type**: `application/json`, `application/x-www-form-urlencoded`, `multipart/form-data`
- **Accept**: `application/json`
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | | - |
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
## usersRetrieve
> UserDetail usersRetrieve(id)
### Example
```ts
import {
Configuration,
UsersApi,
} from '';
import type { UsersRetrieveRequest } from '';
async function example() {
console.log("🚀 Testing SDK...");
const config = new Configuration({
// To configure HTTP basic authorization: basicAuth
username: "YOUR USERNAME",
password: "YOUR PASSWORD",
// To configure API key authorization: cookieAuth
apiKey: "YOUR API KEY",
// Configure HTTP bearer authorization: jwtAuth
accessToken: "YOUR BEARER TOKEN",
});
const api = new UsersApi(config);
const body = {
// number | A unique integer value identifying this user.
id: 56,
} satisfies UsersRetrieveRequest;
try {
const data = await api.usersRetrieve(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **id** | `number` | A unique integer value identifying this user. | [Defaults to `undefined`] |
### Return type
[**UserDetail**](UserDetail.md)
### Authorization
[basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [jwtAuth](../README.md#jwtAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: `application/json`
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | | - |
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
## usersUpdate
> UserDetail usersUpdate(id, userDetailRequest)
### Example
```ts
import {
Configuration,
UsersApi,
} from '';
import type { UsersUpdateRequest } from '';
async function example() {
console.log("🚀 Testing SDK...");
const config = new Configuration({
// To configure HTTP basic authorization: basicAuth
username: "YOUR USERNAME",
password: "YOUR PASSWORD",
// To configure API key authorization: cookieAuth
apiKey: "YOUR API KEY",
// Configure HTTP bearer authorization: jwtAuth
accessToken: "YOUR BEARER TOKEN",
});
const api = new UsersApi(config);
const body = {
// number | A unique integer value identifying this user.
id: 56,
// UserDetailRequest
userDetailRequest: ...,
} satisfies UsersUpdateRequest;
try {
const data = await api.usersUpdate(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **id** | `number` | A unique integer value identifying this user. | [Defaults to `undefined`] |
| **userDetailRequest** | [UserDetailRequest](UserDetailRequest.md) | | |
### Return type
[**UserDetail**](UserDetail.md)
### Authorization
[basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [jwtAuth](../README.md#jwtAuth)
### HTTP request headers
- **Content-Type**: `application/json`, `application/x-www-form-urlencoded`, `multipart/form-data`
- **Accept**: `application/json`
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | | - |
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)