482 lines
15 KiB
Markdown
482 lines
15 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/v2/users | CreateUser creates a new user.
|
|
[**user_service_create_user_access_token**](UserServiceApi.md#user_service_create_user_access_token) | **POST** /api/v2/{name}/access_tokens | CreateUserAccessToken creates a new access token for a user.
|
|
[**user_service_delete_user**](UserServiceApi.md#user_service_delete_user) | **DELETE** /api/v2/{name} | DeleteUser deletes a user.
|
|
[**user_service_delete_user_access_token**](UserServiceApi.md#user_service_delete_user_access_token) | **DELETE** /api/v2/{name}/access_tokens/{accessToken} | DeleteUserAccessToken deletes an access token for a user.
|
|
[**user_service_get_user**](UserServiceApi.md#user_service_get_user) | **GET** /api/v2/{name} | GetUser gets a user by name.
|
|
[**user_service_get_user_setting**](UserServiceApi.md#user_service_get_user_setting) | **GET** /api/v2/{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/v2/{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/v2/users | ListUsers returns a list of users.
|
|
[**user_service_update_user**](UserServiceApi.md#user_service_update_user) | **PATCH** /api/v2/{user.name} | UpdateUser updates a user.
|
|
[**user_service_update_user_setting**](UserServiceApi.md#user_service_update_user_setting) | **PATCH** /api/v2/{setting.name} | UpdateUserSetting updates the setting of a user.
|
|
|
|
# **user_service_create_user**
|
|
> V2CreateUserResponse 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.V2User() # V2User |
|
|
|
|
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** | [**V2User**](V2User.md)| |
|
|
|
|
### Return type
|
|
|
|
[**V2CreateUserResponse**](V2CreateUserResponse.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**
|
|
> V2CreateUserAccessTokenResponse 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/{username}
|
|
|
|
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/{username} |
|
|
|
|
### Return type
|
|
|
|
[**V2CreateUserAccessTokenResponse**](V2CreateUserAccessTokenResponse.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**
|
|
> V2DeleteUserResponse 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/{username}
|
|
|
|
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/{username} |
|
|
|
|
### Return type
|
|
|
|
[**V2DeleteUserResponse**](V2DeleteUserResponse.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_delete_user_access_token**
|
|
> V2DeleteUserAccessTokenResponse 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/{username}
|
|
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/{username} |
|
|
**access_token** | **str**| access_token is the access token to delete. |
|
|
|
|
### Return type
|
|
|
|
[**V2DeleteUserAccessTokenResponse**](V2DeleteUserAccessTokenResponse.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**
|
|
> V2GetUserResponse 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/{username}
|
|
|
|
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/{username} |
|
|
|
|
### Return type
|
|
|
|
[**V2GetUserResponse**](V2GetUserResponse.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**
|
|
> V2GetUserSettingResponse 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/{username}
|
|
|
|
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/{username} |
|
|
|
|
### Return type
|
|
|
|
[**V2GetUserSettingResponse**](V2GetUserSettingResponse.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**
|
|
> V2ListUserAccessTokensResponse 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/{username}
|
|
|
|
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/{username} |
|
|
|
|
### Return type
|
|
|
|
[**V2ListUserAccessTokensResponse**](V2ListUserAccessTokensResponse.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**
|
|
> V2ListUsersResponse 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
|
|
|
|
[**V2ListUsersResponse**](V2ListUsersResponse.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**
|
|
> V2UpdateUserResponse 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.V2UserNameBody() # V2UserNameBody |
|
|
user_name = 'user_name_example' # str | The name of the user. Format: users/{username}
|
|
|
|
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** | [**V2UserNameBody**](V2UserNameBody.md)| |
|
|
**user_name** | **str**| The name of the user. Format: users/{username} |
|
|
|
|
### Return type
|
|
|
|
[**V2UpdateUserResponse**](V2UpdateUserResponse.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**
|
|
> V2UpdateUserSettingResponse 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.V2SettingNameBody() # V2SettingNameBody |
|
|
setting_name = 'setting_name_example' # str | The name of the user. Format: users/{username}
|
|
|
|
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** | [**V2SettingNameBody**](V2SettingNameBody.md)| |
|
|
**setting_name** | **str**| The name of the user. Format: users/{username} |
|
|
|
|
### Return type
|
|
|
|
[**V2UpdateUserSettingResponse**](V2UpdateUserSettingResponse.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)
|
|
|