memos-script/docs/UserServiceApi.md
2024-04-30 10:31:09 +08:00

529 lines
16 KiB
Markdown

# memos.UserServiceApi
All URIs are relative to */*
Method | HTTP request | Description
------------- | ------------- | -------------
[**user_service_create_user**](UserServiceApi.md#user_service_create_user) | **POST** /api/v1/users | CreateUser creates a new user.
[**user_service_create_user_access_token**](UserServiceApi.md#user_service_create_user_access_token) | **POST** /api/v1/{name}/access_tokens | CreateUserAccessToken creates a new access token for a user.
[**user_service_delete_user**](UserServiceApi.md#user_service_delete_user) | **DELETE** /api/v1/{name} | DeleteUser deletes a user.
[**user_service_delete_user_access_token**](UserServiceApi.md#user_service_delete_user_access_token) | **DELETE** /api/v1/{name}/access_tokens/{accessToken} | DeleteUserAccessToken deletes an access token for a user.
[**user_service_get_user**](UserServiceApi.md#user_service_get_user) | **GET** /api/v1/{name} | GetUser gets a user by name.
[**user_service_get_user_setting**](UserServiceApi.md#user_service_get_user_setting) | **GET** /api/v1/{name}/setting | GetUserSetting gets the setting of a user.
[**user_service_list_user_access_tokens**](UserServiceApi.md#user_service_list_user_access_tokens) | **GET** /api/v1/{name}/access_tokens | ListUserAccessTokens returns a list of access tokens for a user.
[**user_service_list_users**](UserServiceApi.md#user_service_list_users) | **GET** /api/v1/users | ListUsers returns a list of users.
[**user_service_search_users**](UserServiceApi.md#user_service_search_users) | **GET** /api/v1/users:search | SearchUsers searches users by filter.
[**user_service_update_user**](UserServiceApi.md#user_service_update_user) | **PATCH** /api/v1/{user.name} | UpdateUser updates a user.
[**user_service_update_user_setting**](UserServiceApi.md#user_service_update_user_setting) | **PATCH** /api/v1/{setting.name} | UpdateUserSetting updates the setting of a user.
# **user_service_create_user**
> V1User user_service_create_user(body)
CreateUser creates a new user.
### Example
```python
from __future__ import print_function
import time
import memos
from memos.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = memos.UserServiceApi()
body = memos.V1User() # V1User |
try:
# CreateUser creates a new user.
api_response = api_instance.user_service_create_user(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling UserServiceApi->user_service_create_user: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**V1User**](V1User.md)| |
### Return type
[**V1User**](V1User.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[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)
# **user_service_create_user_access_token**
> V1UserAccessToken user_service_create_user_access_token(body, name)
CreateUserAccessToken creates a new access token for a user.
### Example
```python
from __future__ import print_function
import time
import memos
from memos.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = memos.UserServiceApi()
body = memos.UserServiceCreateUserAccessTokenBody() # UserServiceCreateUserAccessTokenBody |
name = 'name_example' # str | The name of the user. Format: users/{id}
try:
# CreateUserAccessToken creates a new access token for a user.
api_response = api_instance.user_service_create_user_access_token(body, name)
pprint(api_response)
except ApiException as e:
print("Exception when calling UserServiceApi->user_service_create_user_access_token: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**UserServiceCreateUserAccessTokenBody**](UserServiceCreateUserAccessTokenBody.md)| |
**name** | **str**| The name of the user. Format: users/{id} |
### Return type
[**V1UserAccessToken**](V1UserAccessToken.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[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)
# **user_service_delete_user**
> object user_service_delete_user(name)
DeleteUser deletes a user.
### Example
```python
from __future__ import print_function
import time
import memos
from memos.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = memos.UserServiceApi()
name = 'name_example' # str | The name of the user. Format: users/{id}
try:
# DeleteUser deletes a user.
api_response = api_instance.user_service_delete_user(name)
pprint(api_response)
except ApiException as e:
print("Exception when calling UserServiceApi->user_service_delete_user: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**name** | **str**| The name of the user. Format: users/{id} |
### Return type
**object**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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)
# **user_service_delete_user_access_token**
> object user_service_delete_user_access_token(name, access_token)
DeleteUserAccessToken deletes an access token for a user.
### Example
```python
from __future__ import print_function
import time
import memos
from memos.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = memos.UserServiceApi()
name = 'name_example' # str | The name of the user. Format: users/{id}
access_token = 'access_token_example' # str | access_token is the access token to delete.
try:
# DeleteUserAccessToken deletes an access token for a user.
api_response = api_instance.user_service_delete_user_access_token(name, access_token)
pprint(api_response)
except ApiException as e:
print("Exception when calling UserServiceApi->user_service_delete_user_access_token: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**name** | **str**| The name of the user. Format: users/{id} |
**access_token** | **str**| access_token is the access token to delete. |
### Return type
**object**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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)
# **user_service_get_user**
> V1User user_service_get_user(name)
GetUser gets a user by name.
### Example
```python
from __future__ import print_function
import time
import memos
from memos.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = memos.UserServiceApi()
name = 'name_example' # str | The name of the user. Format: users/{id}
try:
# GetUser gets a user by name.
api_response = api_instance.user_service_get_user(name)
pprint(api_response)
except ApiException as e:
print("Exception when calling UserServiceApi->user_service_get_user: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**name** | **str**| The name of the user. Format: users/{id} |
### Return type
[**V1User**](V1User.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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)
# **user_service_get_user_setting**
> Apiv1UserSetting user_service_get_user_setting(name)
GetUserSetting gets the setting of a user.
### Example
```python
from __future__ import print_function
import time
import memos
from memos.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = memos.UserServiceApi()
name = 'name_example' # str | The name of the user. Format: users/{id}
try:
# GetUserSetting gets the setting of a user.
api_response = api_instance.user_service_get_user_setting(name)
pprint(api_response)
except ApiException as e:
print("Exception when calling UserServiceApi->user_service_get_user_setting: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**name** | **str**| The name of the user. Format: users/{id} |
### Return type
[**Apiv1UserSetting**](Apiv1UserSetting.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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)
# **user_service_list_user_access_tokens**
> V1ListUserAccessTokensResponse user_service_list_user_access_tokens(name)
ListUserAccessTokens returns a list of access tokens for a user.
### Example
```python
from __future__ import print_function
import time
import memos
from memos.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = memos.UserServiceApi()
name = 'name_example' # str | The name of the user. Format: users/{id}
try:
# ListUserAccessTokens returns a list of access tokens for a user.
api_response = api_instance.user_service_list_user_access_tokens(name)
pprint(api_response)
except ApiException as e:
print("Exception when calling UserServiceApi->user_service_list_user_access_tokens: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**name** | **str**| The name of the user. Format: users/{id} |
### Return type
[**V1ListUserAccessTokensResponse**](V1ListUserAccessTokensResponse.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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)
# **user_service_list_users**
> V1ListUsersResponse user_service_list_users()
ListUsers returns a list of users.
### Example
```python
from __future__ import print_function
import time
import memos
from memos.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = memos.UserServiceApi()
try:
# ListUsers returns a list of users.
api_response = api_instance.user_service_list_users()
pprint(api_response)
except ApiException as e:
print("Exception when calling UserServiceApi->user_service_list_users: %s\n" % e)
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**V1ListUsersResponse**](V1ListUsersResponse.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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)
# **user_service_search_users**
> V1SearchUsersResponse user_service_search_users(filter=filter)
SearchUsers searches users by filter.
### Example
```python
from __future__ import print_function
import time
import memos
from memos.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = memos.UserServiceApi()
filter = 'filter_example' # str | Filter is used to filter users returned in the list. Format: \"username == frank\" (optional)
try:
# SearchUsers searches users by filter.
api_response = api_instance.user_service_search_users(filter=filter)
pprint(api_response)
except ApiException as e:
print("Exception when calling UserServiceApi->user_service_search_users: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**filter** | **str**| Filter is used to filter users returned in the list. Format: \"username == frank\" | [optional]
### Return type
[**V1SearchUsersResponse**](V1SearchUsersResponse.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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)
# **user_service_update_user**
> V1User user_service_update_user(body, user_name)
UpdateUser updates a user.
### Example
```python
from __future__ import print_function
import time
import memos
from memos.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = memos.UserServiceApi()
body = memos.V1UserNameBody() # V1UserNameBody |
user_name = 'user_name_example' # str | The name of the user. Format: users/{id}
try:
# UpdateUser updates a user.
api_response = api_instance.user_service_update_user(body, user_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling UserServiceApi->user_service_update_user: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**V1UserNameBody**](V1UserNameBody.md)| |
**user_name** | **str**| The name of the user. Format: users/{id} |
### Return type
[**V1User**](V1User.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[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)
# **user_service_update_user_setting**
> Apiv1UserSetting user_service_update_user_setting(body, setting_name)
UpdateUserSetting updates the setting of a user.
### Example
```python
from __future__ import print_function
import time
import memos
from memos.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = memos.UserServiceApi()
body = memos.V1SettingNameBody() # V1SettingNameBody |
setting_name = 'setting_name_example' # str | The name of the user. Format: users/{id}
try:
# UpdateUserSetting updates the setting of a user.
api_response = api_instance.user_service_update_user_setting(body, setting_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling UserServiceApi->user_service_update_user_setting: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**V1SettingNameBody**](V1SettingNameBody.md)| |
**setting_name** | **str**| The name of the user. Format: users/{id} |
### Return type
[**Apiv1UserSetting**](Apiv1UserSetting.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[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)