mirror of
https://github.com/thousandeyes/thousandeyes-sdk-python.git
synced 2025-12-06 07:55:31 +00:00
Merge pull request #1 from shahid-te/main
CP-2060 Add Python SDK generated from thousandeyes-python-generator
This commit is contained in:
commit
465664c6c1
@ -1,6 +1,4 @@
|
|||||||
# thousandeyes-python-sdk
|
# thousandeyes-sdk-python
|
||||||
|
|
||||||
## Owners: api-team-admin
|
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
|
|||||||
0
admin_api/.gitignore → admin/.gitignore
vendored
0
admin_api/.gitignore → admin/.gitignore
vendored
220
admin/.openapi-generator/FILES
Normal file
220
admin/.openapi-generator/FILES
Normal file
@ -0,0 +1,220 @@
|
|||||||
|
.gitignore
|
||||||
|
.openapi-generator-ignore
|
||||||
|
README.md
|
||||||
|
admin/__init__.py
|
||||||
|
admin/api/__init__.py
|
||||||
|
admin/api/account_groups_api.py
|
||||||
|
admin/api/permissions_api.py
|
||||||
|
admin/api/roles_api.py
|
||||||
|
admin/api/user_events_api.py
|
||||||
|
admin/api/users_api.py
|
||||||
|
admin/api_client.py
|
||||||
|
admin/api_response.py
|
||||||
|
admin/configuration.py
|
||||||
|
admin/exceptions.py
|
||||||
|
admin/models/__init__.py
|
||||||
|
admin/models/account_group.py
|
||||||
|
admin/models/account_group1.py
|
||||||
|
admin/models/account_group_detail.py
|
||||||
|
admin/models/account_group_id.py
|
||||||
|
admin/models/account_group_request_body.py
|
||||||
|
admin/models/account_group_roles.py
|
||||||
|
admin/models/account_group_roles_account_group_roles_inner.py
|
||||||
|
admin/models/account_group_roles_request_body_inner.py
|
||||||
|
admin/models/account_groups.py
|
||||||
|
admin/models/agent.py
|
||||||
|
admin/models/agent_base.py
|
||||||
|
admin/models/all_account_group_roles.py
|
||||||
|
admin/models/base_role.py
|
||||||
|
admin/models/cloud_enterprise_agent_type.py
|
||||||
|
admin/models/cluster_member.py
|
||||||
|
admin/models/create_account_group201_response.py
|
||||||
|
admin/models/create_role201_response.py
|
||||||
|
admin/models/create_user201_response.py
|
||||||
|
admin/models/created_user.py
|
||||||
|
admin/models/enterprise_agent.py
|
||||||
|
admin/models/enterprise_agent_data.py
|
||||||
|
admin/models/enterprise_agent_ipv6_policy.py
|
||||||
|
admin/models/enterprise_agent_state.py
|
||||||
|
admin/models/enterprise_agents.py
|
||||||
|
admin/models/error.py
|
||||||
|
admin/models/error_detail.py
|
||||||
|
admin/models/error_detail_code.py
|
||||||
|
admin/models/expand.py
|
||||||
|
admin/models/extended_user.py
|
||||||
|
admin/models/get_account_group200_response.py
|
||||||
|
admin/models/get_account_groups200_response.py
|
||||||
|
admin/models/get_permissions200_response.py
|
||||||
|
admin/models/get_roles200_response.py
|
||||||
|
admin/models/get_user200_response.py
|
||||||
|
admin/models/get_user_events200_response.py
|
||||||
|
admin/models/get_users200_response.py
|
||||||
|
admin/models/interface_ip_mapping.py
|
||||||
|
admin/models/link.py
|
||||||
|
admin/models/login_account_group.py
|
||||||
|
admin/models/new_account_group_response.py
|
||||||
|
admin/models/pagination_links.py
|
||||||
|
admin/models/pagination_links_links.py
|
||||||
|
admin/models/permission.py
|
||||||
|
admin/models/permissions.py
|
||||||
|
admin/models/query_window.py
|
||||||
|
admin/models/role.py
|
||||||
|
admin/models/role_detail.py
|
||||||
|
admin/models/role_request_body.py
|
||||||
|
admin/models/roles.py
|
||||||
|
admin/models/self_links.py
|
||||||
|
admin/models/self_links_links.py
|
||||||
|
admin/models/simple_agent.py
|
||||||
|
admin/models/unauthorized_error.py
|
||||||
|
admin/models/user.py
|
||||||
|
admin/models/user_account_group.py
|
||||||
|
admin/models/user_account_groups.py
|
||||||
|
admin/models/user_detail.py
|
||||||
|
admin/models/user_event.py
|
||||||
|
admin/models/user_event_all_of_resources_inner.py
|
||||||
|
admin/models/user_events.py
|
||||||
|
admin/models/user_request_body.py
|
||||||
|
admin/models/users.py
|
||||||
|
admin/models/validation_error.py
|
||||||
|
admin/models/validation_error_all_of_errors.py
|
||||||
|
admin/py.typed
|
||||||
|
admin/rest.py
|
||||||
|
docs/AccountGroup.md
|
||||||
|
docs/AccountGroup1.md
|
||||||
|
docs/AccountGroupDetail.md
|
||||||
|
docs/AccountGroupId.md
|
||||||
|
docs/AccountGroupRequestBody.md
|
||||||
|
docs/AccountGroupRoles.md
|
||||||
|
docs/AccountGroupRolesAccountGroupRolesInner.md
|
||||||
|
docs/AccountGroupRolesRequestBodyInner.md
|
||||||
|
docs/AccountGroups.md
|
||||||
|
docs/AccountGroupsApi.md
|
||||||
|
docs/Agent.md
|
||||||
|
docs/AgentBase.md
|
||||||
|
docs/AllAccountGroupRoles.md
|
||||||
|
docs/BaseRole.md
|
||||||
|
docs/CloudEnterpriseAgentType.md
|
||||||
|
docs/ClusterMember.md
|
||||||
|
docs/CreateAccountGroup201Response.md
|
||||||
|
docs/CreateRole201Response.md
|
||||||
|
docs/CreateUser201Response.md
|
||||||
|
docs/CreatedUser.md
|
||||||
|
docs/EnterpriseAgent.md
|
||||||
|
docs/EnterpriseAgentData.md
|
||||||
|
docs/EnterpriseAgentIpv6Policy.md
|
||||||
|
docs/EnterpriseAgentState.md
|
||||||
|
docs/EnterpriseAgents.md
|
||||||
|
docs/Error.md
|
||||||
|
docs/ErrorDetail.md
|
||||||
|
docs/ErrorDetailCode.md
|
||||||
|
docs/Expand.md
|
||||||
|
docs/ExtendedUser.md
|
||||||
|
docs/GetAccountGroup200Response.md
|
||||||
|
docs/GetAccountGroups200Response.md
|
||||||
|
docs/GetPermissions200Response.md
|
||||||
|
docs/GetRoles200Response.md
|
||||||
|
docs/GetUser200Response.md
|
||||||
|
docs/GetUserEvents200Response.md
|
||||||
|
docs/GetUsers200Response.md
|
||||||
|
docs/InterfaceIpMapping.md
|
||||||
|
docs/Link.md
|
||||||
|
docs/LoginAccountGroup.md
|
||||||
|
docs/NewAccountGroupResponse.md
|
||||||
|
docs/PaginationLinks.md
|
||||||
|
docs/PaginationLinksLinks.md
|
||||||
|
docs/Permission.md
|
||||||
|
docs/Permissions.md
|
||||||
|
docs/PermissionsApi.md
|
||||||
|
docs/QueryWindow.md
|
||||||
|
docs/Role.md
|
||||||
|
docs/RoleDetail.md
|
||||||
|
docs/RoleRequestBody.md
|
||||||
|
docs/Roles.md
|
||||||
|
docs/RolesApi.md
|
||||||
|
docs/SelfLinks.md
|
||||||
|
docs/SelfLinksLinks.md
|
||||||
|
docs/SimpleAgent.md
|
||||||
|
docs/UnauthorizedError.md
|
||||||
|
docs/User.md
|
||||||
|
docs/UserAccountGroup.md
|
||||||
|
docs/UserAccountGroups.md
|
||||||
|
docs/UserDetail.md
|
||||||
|
docs/UserEvent.md
|
||||||
|
docs/UserEventAllOfResourcesInner.md
|
||||||
|
docs/UserEvents.md
|
||||||
|
docs/UserEventsApi.md
|
||||||
|
docs/UserRequestBody.md
|
||||||
|
docs/Users.md
|
||||||
|
docs/UsersApi.md
|
||||||
|
docs/ValidationError.md
|
||||||
|
docs/ValidationErrorAllOfErrors.md
|
||||||
|
pyproject.toml
|
||||||
|
requirements.txt
|
||||||
|
setup.cfg
|
||||||
|
setup.py
|
||||||
|
test-requirements.txt
|
||||||
|
test/__init__.py
|
||||||
|
test/test_account_group.py
|
||||||
|
test/test_account_group1.py
|
||||||
|
test/test_account_group_detail.py
|
||||||
|
test/test_account_group_id.py
|
||||||
|
test/test_account_group_request_body.py
|
||||||
|
test/test_account_group_roles.py
|
||||||
|
test/test_account_group_roles_account_group_roles_inner.py
|
||||||
|
test/test_account_group_roles_request_body_inner.py
|
||||||
|
test/test_account_groups.py
|
||||||
|
test/test_agent.py
|
||||||
|
test/test_agent_base.py
|
||||||
|
test/test_all_account_group_roles.py
|
||||||
|
test/test_base_role.py
|
||||||
|
test/test_cloud_enterprise_agent_type.py
|
||||||
|
test/test_cluster_member.py
|
||||||
|
test/test_create_account_group201_response.py
|
||||||
|
test/test_create_role201_response.py
|
||||||
|
test/test_create_user201_response.py
|
||||||
|
test/test_created_user.py
|
||||||
|
test/test_enterprise_agent.py
|
||||||
|
test/test_enterprise_agent_data.py
|
||||||
|
test/test_enterprise_agent_ipv6_policy.py
|
||||||
|
test/test_enterprise_agent_state.py
|
||||||
|
test/test_enterprise_agents.py
|
||||||
|
test/test_error.py
|
||||||
|
test/test_error_detail.py
|
||||||
|
test/test_error_detail_code.py
|
||||||
|
test/test_expand.py
|
||||||
|
test/test_extended_user.py
|
||||||
|
test/test_get_account_group200_response.py
|
||||||
|
test/test_get_account_groups200_response.py
|
||||||
|
test/test_get_permissions200_response.py
|
||||||
|
test/test_get_roles200_response.py
|
||||||
|
test/test_get_user200_response.py
|
||||||
|
test/test_get_user_events200_response.py
|
||||||
|
test/test_get_users200_response.py
|
||||||
|
test/test_interface_ip_mapping.py
|
||||||
|
test/test_link.py
|
||||||
|
test/test_login_account_group.py
|
||||||
|
test/test_new_account_group_response.py
|
||||||
|
test/test_pagination_links.py
|
||||||
|
test/test_pagination_links_links.py
|
||||||
|
test/test_permission.py
|
||||||
|
test/test_permissions.py
|
||||||
|
test/test_query_window.py
|
||||||
|
test/test_role.py
|
||||||
|
test/test_role_detail.py
|
||||||
|
test/test_role_request_body.py
|
||||||
|
test/test_roles.py
|
||||||
|
test/test_self_links.py
|
||||||
|
test/test_self_links_links.py
|
||||||
|
test/test_simple_agent.py
|
||||||
|
test/test_unauthorized_error.py
|
||||||
|
test/test_user.py
|
||||||
|
test/test_user_account_group.py
|
||||||
|
test/test_user_account_groups.py
|
||||||
|
test/test_user_detail.py
|
||||||
|
test/test_user_event.py
|
||||||
|
test/test_user_event_all_of_resources_inner.py
|
||||||
|
test/test_user_events.py
|
||||||
|
test/test_user_request_body.py
|
||||||
|
test/test_users.py
|
||||||
|
test/test_validation_error.py
|
||||||
|
test/test_validation_error_all_of_errors.py
|
||||||
1
admin/.openapi-generator/VERSION
Normal file
1
admin/.openapi-generator/VERSION
Normal file
@ -0,0 +1 @@
|
|||||||
|
7.5.0
|
||||||
210
admin/README.md
Normal file
210
admin/README.md
Normal file
@ -0,0 +1,210 @@
|
|||||||
|
# admin
|
||||||
|
## Overview
|
||||||
|
Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API.
|
||||||
|
This API provides the following endpoints that define the operations to manage your organization:
|
||||||
|
|
||||||
|
* `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups.
|
||||||
|
* `/users`: Create, retrieve, update and delete users within an organization.
|
||||||
|
* `/roles`: Create, retrieve and update roles for the current user.
|
||||||
|
* `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles.
|
||||||
|
* `/audit-user-events`: Retrieve all activity log events.
|
||||||
|
|
||||||
|
For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
||||||
|
|
||||||
|
- API version: 7.0.2
|
||||||
|
- Package version: 1.0.0
|
||||||
|
- Generator version: 7.5.0
|
||||||
|
- Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator
|
||||||
|
|
||||||
|
## Requirements.
|
||||||
|
|
||||||
|
Python 3.7+
|
||||||
|
|
||||||
|
## Installation & Usage
|
||||||
|
### pip install
|
||||||
|
|
||||||
|
If the python package is hosted on a repository, you can install directly using:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
|
||||||
|
```
|
||||||
|
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)
|
||||||
|
|
||||||
|
Then import the package:
|
||||||
|
```python
|
||||||
|
import admin
|
||||||
|
```
|
||||||
|
|
||||||
|
### Setuptools
|
||||||
|
|
||||||
|
Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
|
||||||
|
|
||||||
|
```sh
|
||||||
|
python setup.py install --user
|
||||||
|
```
|
||||||
|
(or `sudo python setup.py install` to install the package for all users)
|
||||||
|
|
||||||
|
Then import the package:
|
||||||
|
```python
|
||||||
|
import admin
|
||||||
|
```
|
||||||
|
|
||||||
|
### Tests
|
||||||
|
|
||||||
|
Execute `pytest` to run the tests.
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
Please follow the [installation procedure](#installation--usage) and then run the following:
|
||||||
|
|
||||||
|
```python
|
||||||
|
|
||||||
|
import admin
|
||||||
|
from admin.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# Defining the host is optional and defaults to https://api.thousandeyes.com
|
||||||
|
# See configuration.py for a list of all supported configuration parameters.
|
||||||
|
configuration = admin.Configuration(
|
||||||
|
host = "https://api.thousandeyes.com"
|
||||||
|
)
|
||||||
|
|
||||||
|
# The client must configure the authentication and authorization parameters
|
||||||
|
# in accordance with the API server security policy.
|
||||||
|
# Examples for each auth method are provided below, use the example that
|
||||||
|
# satisfies your auth use case.
|
||||||
|
|
||||||
|
# Configure Bearer authorization: BearerAuth
|
||||||
|
configuration = admin.Configuration(
|
||||||
|
access_token = os.environ["BEARER_TOKEN"]
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# Enter a context with an instance of the API client
|
||||||
|
with admin.ApiClient(configuration) as api_client:
|
||||||
|
# Create an instance of the API class
|
||||||
|
api_instance = admin.AccountGroupsApi(api_client)
|
||||||
|
account_group_request_body = admin.AccountGroupRequestBody() # AccountGroupRequestBody |
|
||||||
|
expand = [admin.Expand()] # List[Expand] | Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. (optional)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Create account group
|
||||||
|
api_response = api_instance.create_account_group(account_group_request_body, expand=expand)
|
||||||
|
print("The response of AccountGroupsApi->create_account_group:\n")
|
||||||
|
pprint(api_response)
|
||||||
|
except ApiException as e:
|
||||||
|
print("Exception when calling AccountGroupsApi->create_account_group: %s\n" % e)
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
|
All URIs are relative to *https://api.thousandeyes.com*
|
||||||
|
|
||||||
|
Class | Method | HTTP request | Description
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
*AccountGroupsApi* | [**create_account_group**](docs/AccountGroupsApi.md#create_account_group) | **POST** /v7/account-groups | Create account group
|
||||||
|
*AccountGroupsApi* | [**delete_account_group**](docs/AccountGroupsApi.md#delete_account_group) | **DELETE** /v7/account-groups/{id} | Delete account group
|
||||||
|
*AccountGroupsApi* | [**get_account_group**](docs/AccountGroupsApi.md#get_account_group) | **GET** /v7/account-groups/{id} | Retrieve account group
|
||||||
|
*AccountGroupsApi* | [**get_account_groups**](docs/AccountGroupsApi.md#get_account_groups) | **GET** /v7/account-groups | List account groups
|
||||||
|
*AccountGroupsApi* | [**update_account_group**](docs/AccountGroupsApi.md#update_account_group) | **PUT** /v7/account-groups/{id} | Update account group
|
||||||
|
*PermissionsApi* | [**get_permissions**](docs/PermissionsApi.md#get_permissions) | **GET** /v7/permissions | List assignable permissions
|
||||||
|
*RolesApi* | [**create_role**](docs/RolesApi.md#create_role) | **POST** /v7/roles | Create role
|
||||||
|
*RolesApi* | [**delete_role**](docs/RolesApi.md#delete_role) | **DELETE** /v7/roles/{id} | Delete role
|
||||||
|
*RolesApi* | [**get_role**](docs/RolesApi.md#get_role) | **GET** /v7/roles/{id} | Retrieve role
|
||||||
|
*RolesApi* | [**get_roles**](docs/RolesApi.md#get_roles) | **GET** /v7/roles | List roles
|
||||||
|
*RolesApi* | [**update_role**](docs/RolesApi.md#update_role) | **PUT** /v7/roles/{id} | Update role
|
||||||
|
*UserEventsApi* | [**get_user_events**](docs/UserEventsApi.md#get_user_events) | **GET** /v7/audit-user-events | List activity log events
|
||||||
|
*UsersApi* | [**create_user**](docs/UsersApi.md#create_user) | **POST** /v7/users | Create user
|
||||||
|
*UsersApi* | [**delete_user**](docs/UsersApi.md#delete_user) | **DELETE** /v7/users/{id} | Delete user
|
||||||
|
*UsersApi* | [**get_user**](docs/UsersApi.md#get_user) | **GET** /v7/users/{id} | Retrieve user
|
||||||
|
*UsersApi* | [**get_users**](docs/UsersApi.md#get_users) | **GET** /v7/users | List users
|
||||||
|
*UsersApi* | [**update_user**](docs/UsersApi.md#update_user) | **PUT** /v7/users/{id} | Update user
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation For Models
|
||||||
|
|
||||||
|
- [AccountGroup](docs/AccountGroup.md)
|
||||||
|
- [AccountGroup1](docs/AccountGroup1.md)
|
||||||
|
- [AccountGroupDetail](docs/AccountGroupDetail.md)
|
||||||
|
- [AccountGroupId](docs/AccountGroupId.md)
|
||||||
|
- [AccountGroupRequestBody](docs/AccountGroupRequestBody.md)
|
||||||
|
- [AccountGroupRoles](docs/AccountGroupRoles.md)
|
||||||
|
- [AccountGroupRolesAccountGroupRolesInner](docs/AccountGroupRolesAccountGroupRolesInner.md)
|
||||||
|
- [AccountGroupRolesRequestBodyInner](docs/AccountGroupRolesRequestBodyInner.md)
|
||||||
|
- [AccountGroups](docs/AccountGroups.md)
|
||||||
|
- [Agent](docs/Agent.md)
|
||||||
|
- [AgentBase](docs/AgentBase.md)
|
||||||
|
- [AllAccountGroupRoles](docs/AllAccountGroupRoles.md)
|
||||||
|
- [BaseRole](docs/BaseRole.md)
|
||||||
|
- [CloudEnterpriseAgentType](docs/CloudEnterpriseAgentType.md)
|
||||||
|
- [ClusterMember](docs/ClusterMember.md)
|
||||||
|
- [CreateAccountGroup201Response](docs/CreateAccountGroup201Response.md)
|
||||||
|
- [CreateRole201Response](docs/CreateRole201Response.md)
|
||||||
|
- [CreateUser201Response](docs/CreateUser201Response.md)
|
||||||
|
- [CreatedUser](docs/CreatedUser.md)
|
||||||
|
- [EnterpriseAgent](docs/EnterpriseAgent.md)
|
||||||
|
- [EnterpriseAgentData](docs/EnterpriseAgentData.md)
|
||||||
|
- [EnterpriseAgentIpv6Policy](docs/EnterpriseAgentIpv6Policy.md)
|
||||||
|
- [EnterpriseAgentState](docs/EnterpriseAgentState.md)
|
||||||
|
- [EnterpriseAgents](docs/EnterpriseAgents.md)
|
||||||
|
- [Error](docs/Error.md)
|
||||||
|
- [ErrorDetail](docs/ErrorDetail.md)
|
||||||
|
- [ErrorDetailCode](docs/ErrorDetailCode.md)
|
||||||
|
- [Expand](docs/Expand.md)
|
||||||
|
- [ExtendedUser](docs/ExtendedUser.md)
|
||||||
|
- [GetAccountGroup200Response](docs/GetAccountGroup200Response.md)
|
||||||
|
- [GetAccountGroups200Response](docs/GetAccountGroups200Response.md)
|
||||||
|
- [GetPermissions200Response](docs/GetPermissions200Response.md)
|
||||||
|
- [GetRoles200Response](docs/GetRoles200Response.md)
|
||||||
|
- [GetUser200Response](docs/GetUser200Response.md)
|
||||||
|
- [GetUserEvents200Response](docs/GetUserEvents200Response.md)
|
||||||
|
- [GetUsers200Response](docs/GetUsers200Response.md)
|
||||||
|
- [InterfaceIpMapping](docs/InterfaceIpMapping.md)
|
||||||
|
- [Link](docs/Link.md)
|
||||||
|
- [LoginAccountGroup](docs/LoginAccountGroup.md)
|
||||||
|
- [NewAccountGroupResponse](docs/NewAccountGroupResponse.md)
|
||||||
|
- [PaginationLinks](docs/PaginationLinks.md)
|
||||||
|
- [PaginationLinksLinks](docs/PaginationLinksLinks.md)
|
||||||
|
- [Permission](docs/Permission.md)
|
||||||
|
- [Permissions](docs/Permissions.md)
|
||||||
|
- [QueryWindow](docs/QueryWindow.md)
|
||||||
|
- [Role](docs/Role.md)
|
||||||
|
- [RoleDetail](docs/RoleDetail.md)
|
||||||
|
- [RoleRequestBody](docs/RoleRequestBody.md)
|
||||||
|
- [Roles](docs/Roles.md)
|
||||||
|
- [SelfLinks](docs/SelfLinks.md)
|
||||||
|
- [SelfLinksLinks](docs/SelfLinksLinks.md)
|
||||||
|
- [SimpleAgent](docs/SimpleAgent.md)
|
||||||
|
- [UnauthorizedError](docs/UnauthorizedError.md)
|
||||||
|
- [User](docs/User.md)
|
||||||
|
- [UserAccountGroup](docs/UserAccountGroup.md)
|
||||||
|
- [UserAccountGroups](docs/UserAccountGroups.md)
|
||||||
|
- [UserDetail](docs/UserDetail.md)
|
||||||
|
- [UserEvent](docs/UserEvent.md)
|
||||||
|
- [UserEventAllOfResourcesInner](docs/UserEventAllOfResourcesInner.md)
|
||||||
|
- [UserEvents](docs/UserEvents.md)
|
||||||
|
- [UserRequestBody](docs/UserRequestBody.md)
|
||||||
|
- [Users](docs/Users.md)
|
||||||
|
- [ValidationError](docs/ValidationError.md)
|
||||||
|
- [ValidationErrorAllOfErrors](docs/ValidationErrorAllOfErrors.md)
|
||||||
|
|
||||||
|
|
||||||
|
<a id="documentation-for-authorization"></a>
|
||||||
|
## Documentation For Authorization
|
||||||
|
|
||||||
|
|
||||||
|
Authentication schemes defined for the API:
|
||||||
|
<a id="BearerAuth"></a>
|
||||||
|
### BearerAuth
|
||||||
|
|
||||||
|
- **Type**: Bearer authentication
|
||||||
|
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
101
admin/admin/__init__.py
Normal file
101
admin/admin/__init__.py
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
# flake8: noqa
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
__version__ = "1.0.0"
|
||||||
|
|
||||||
|
# import apis into sdk package
|
||||||
|
from admin.api.account_groups_api import AccountGroupsApi
|
||||||
|
from admin.api.permissions_api import PermissionsApi
|
||||||
|
from admin.api.roles_api import RolesApi
|
||||||
|
from admin.api.user_events_api import UserEventsApi
|
||||||
|
from admin.api.users_api import UsersApi
|
||||||
|
|
||||||
|
# import ApiClient
|
||||||
|
from admin.api_response import ApiResponse
|
||||||
|
from admin.api_client import ApiClient
|
||||||
|
from admin.configuration import Configuration
|
||||||
|
from admin.exceptions import OpenApiException
|
||||||
|
from admin.exceptions import ApiTypeError
|
||||||
|
from admin.exceptions import ApiValueError
|
||||||
|
from admin.exceptions import ApiKeyError
|
||||||
|
from admin.exceptions import ApiAttributeError
|
||||||
|
from admin.exceptions import ApiException
|
||||||
|
|
||||||
|
# import models into sdk package
|
||||||
|
from admin.models.account_group import AccountGroup
|
||||||
|
from admin.models.account_group1 import AccountGroup1
|
||||||
|
from admin.models.account_group_detail import AccountGroupDetail
|
||||||
|
from admin.models.account_group_id import AccountGroupId
|
||||||
|
from admin.models.account_group_request_body import AccountGroupRequestBody
|
||||||
|
from admin.models.account_group_roles import AccountGroupRoles
|
||||||
|
from admin.models.account_group_roles_account_group_roles_inner import AccountGroupRolesAccountGroupRolesInner
|
||||||
|
from admin.models.account_group_roles_request_body_inner import AccountGroupRolesRequestBodyInner
|
||||||
|
from admin.models.account_groups import AccountGroups
|
||||||
|
from admin.models.agent import Agent
|
||||||
|
from admin.models.agent_base import AgentBase
|
||||||
|
from admin.models.all_account_group_roles import AllAccountGroupRoles
|
||||||
|
from admin.models.base_role import BaseRole
|
||||||
|
from admin.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType
|
||||||
|
from admin.models.cluster_member import ClusterMember
|
||||||
|
from admin.models.create_account_group201_response import CreateAccountGroup201Response
|
||||||
|
from admin.models.create_role201_response import CreateRole201Response
|
||||||
|
from admin.models.create_user201_response import CreateUser201Response
|
||||||
|
from admin.models.created_user import CreatedUser
|
||||||
|
from admin.models.enterprise_agent import EnterpriseAgent
|
||||||
|
from admin.models.enterprise_agent_data import EnterpriseAgentData
|
||||||
|
from admin.models.enterprise_agent_ipv6_policy import EnterpriseAgentIpv6Policy
|
||||||
|
from admin.models.enterprise_agent_state import EnterpriseAgentState
|
||||||
|
from admin.models.enterprise_agents import EnterpriseAgents
|
||||||
|
from admin.models.error import Error
|
||||||
|
from admin.models.error_detail import ErrorDetail
|
||||||
|
from admin.models.error_detail_code import ErrorDetailCode
|
||||||
|
from admin.models.expand import Expand
|
||||||
|
from admin.models.extended_user import ExtendedUser
|
||||||
|
from admin.models.get_account_group200_response import GetAccountGroup200Response
|
||||||
|
from admin.models.get_account_groups200_response import GetAccountGroups200Response
|
||||||
|
from admin.models.get_permissions200_response import GetPermissions200Response
|
||||||
|
from admin.models.get_roles200_response import GetRoles200Response
|
||||||
|
from admin.models.get_user200_response import GetUser200Response
|
||||||
|
from admin.models.get_user_events200_response import GetUserEvents200Response
|
||||||
|
from admin.models.get_users200_response import GetUsers200Response
|
||||||
|
from admin.models.interface_ip_mapping import InterfaceIpMapping
|
||||||
|
from admin.models.link import Link
|
||||||
|
from admin.models.login_account_group import LoginAccountGroup
|
||||||
|
from admin.models.new_account_group_response import NewAccountGroupResponse
|
||||||
|
from admin.models.pagination_links import PaginationLinks
|
||||||
|
from admin.models.pagination_links_links import PaginationLinksLinks
|
||||||
|
from admin.models.permission import Permission
|
||||||
|
from admin.models.permissions import Permissions
|
||||||
|
from admin.models.query_window import QueryWindow
|
||||||
|
from admin.models.role import Role
|
||||||
|
from admin.models.role_detail import RoleDetail
|
||||||
|
from admin.models.role_request_body import RoleRequestBody
|
||||||
|
from admin.models.roles import Roles
|
||||||
|
from admin.models.self_links import SelfLinks
|
||||||
|
from admin.models.self_links_links import SelfLinksLinks
|
||||||
|
from admin.models.simple_agent import SimpleAgent
|
||||||
|
from admin.models.unauthorized_error import UnauthorizedError
|
||||||
|
from admin.models.user import User
|
||||||
|
from admin.models.user_account_group import UserAccountGroup
|
||||||
|
from admin.models.user_account_groups import UserAccountGroups
|
||||||
|
from admin.models.user_detail import UserDetail
|
||||||
|
from admin.models.user_event import UserEvent
|
||||||
|
from admin.models.user_event_all_of_resources_inner import UserEventAllOfResourcesInner
|
||||||
|
from admin.models.user_events import UserEvents
|
||||||
|
from admin.models.user_request_body import UserRequestBody
|
||||||
|
from admin.models.users import Users
|
||||||
|
from admin.models.validation_error import ValidationError
|
||||||
|
from admin.models.validation_error_all_of_errors import ValidationErrorAllOfErrors
|
||||||
9
admin/admin/api/__init__.py
Normal file
9
admin/admin/api/__init__.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# flake8: noqa
|
||||||
|
|
||||||
|
# import apis into api package
|
||||||
|
from admin.api.account_groups_api import AccountGroupsApi
|
||||||
|
from admin.api.permissions_api import PermissionsApi
|
||||||
|
from admin.api.roles_api import RolesApi
|
||||||
|
from admin.api.user_events_api import UserEventsApi
|
||||||
|
from admin.api.users_api import UsersApi
|
||||||
|
|
||||||
@ -3,41 +3,31 @@
|
|||||||
"""
|
"""
|
||||||
Administrative API
|
Administrative API
|
||||||
|
|
||||||
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events.
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
The version of the OpenAPI document: 7.0.0
|
The version of the OpenAPI document: 7.0.2
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
""" # noqa: E501
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
import io
|
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
||||||
from typing import Dict, List, Optional, Tuple, Union, Any
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||||
|
|
||||||
try:
|
|
||||||
from typing import Annotated
|
|
||||||
except ImportError:
|
|
||||||
from typing_extensions import Annotated
|
|
||||||
|
|
||||||
from pydantic import Field
|
|
||||||
from typing_extensions import Annotated
|
from typing_extensions import Annotated
|
||||||
from pydantic import StrictStr
|
|
||||||
|
|
||||||
|
from pydantic import Field, StrictStr
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
from typing_extensions import Annotated
|
||||||
|
from admin.models.account_group_request_body import AccountGroupRequestBody
|
||||||
|
from admin.models.create_account_group201_response import CreateAccountGroup201Response
|
||||||
|
from admin.models.expand import Expand
|
||||||
|
from admin.models.get_account_group200_response import GetAccountGroup200Response
|
||||||
|
from admin.models.get_account_groups200_response import GetAccountGroups200Response
|
||||||
|
|
||||||
from admin_api.models.account_group_request_body import AccountGroupRequestBody
|
from admin.api_client import ApiClient, RequestSerialized
|
||||||
from admin_api.models.create_account_group201_response import CreateAccountGroup201Response
|
from admin.api_response import ApiResponse
|
||||||
from admin_api.models.expand import Expand
|
from admin.rest import RESTResponseType
|
||||||
from admin_api.models.get_account_group200_response import GetAccountGroup200Response
|
|
||||||
from admin_api.models.get_account_groups200_response import GetAccountGroups200Response
|
|
||||||
|
|
||||||
from admin_api.api_client import ApiClient
|
|
||||||
from admin_api.api_response import ApiResponse
|
|
||||||
from admin_api.rest import RESTResponseType
|
|
||||||
|
|
||||||
|
|
||||||
class AccountGroupsApi:
|
class AccountGroupsApi:
|
||||||
@ -112,13 +102,12 @@ class AccountGroupsApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'201': "CreateAccountGroup201Response",
|
'201': "CreateAccountGroup201Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -190,13 +179,12 @@ class AccountGroupsApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'201': "CreateAccountGroup201Response",
|
'201': "CreateAccountGroup201Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -268,13 +256,12 @@ class AccountGroupsApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'201': "CreateAccountGroup201Response",
|
'201': "CreateAccountGroup201Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -291,12 +278,11 @@ class AccountGroupsApi:
|
|||||||
_content_type,
|
_content_type,
|
||||||
_headers,
|
_headers,
|
||||||
_host_index,
|
_host_index,
|
||||||
) -> Tuple:
|
) -> RequestSerialized:
|
||||||
|
|
||||||
_host = None
|
_host = None
|
||||||
|
|
||||||
_collection_formats: Dict[str, str] = {
|
_collection_formats: Dict[str, str] = {
|
||||||
|
|
||||||
'expand': 'csv',
|
'expand': 'csv',
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -304,7 +290,7 @@ class AccountGroupsApi:
|
|||||||
_query_params: List[Tuple[str, str]] = []
|
_query_params: List[Tuple[str, str]] = []
|
||||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||||
_form_params: List[Tuple[str, str]] = []
|
_form_params: List[Tuple[str, str]] = []
|
||||||
_files: Dict[str, str] = {}
|
_files: Dict[str, Union[str, bytes]] = {}
|
||||||
_body_params: Optional[bytes] = None
|
_body_params: Optional[bytes] = None
|
||||||
|
|
||||||
# process the path parameters
|
# process the path parameters
|
||||||
@ -419,7 +405,13 @@ class AccountGroupsApi:
|
|||||||
)
|
)
|
||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
|
'204': None,
|
||||||
|
'400': "ValidationError",
|
||||||
|
'401': "UnauthorizedError",
|
||||||
|
'403': "Error",
|
||||||
|
'404': "Error",
|
||||||
|
'429': "Error",
|
||||||
|
'500': "Error",
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -486,7 +478,13 @@ class AccountGroupsApi:
|
|||||||
)
|
)
|
||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
|
'204': None,
|
||||||
|
'400': "ValidationError",
|
||||||
|
'401': "UnauthorizedError",
|
||||||
|
'403': "Error",
|
||||||
|
'404': "Error",
|
||||||
|
'429': "Error",
|
||||||
|
'500': "Error",
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -553,7 +551,13 @@ class AccountGroupsApi:
|
|||||||
)
|
)
|
||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
|
'204': None,
|
||||||
|
'400': "ValidationError",
|
||||||
|
'401': "UnauthorizedError",
|
||||||
|
'403': "Error",
|
||||||
|
'404': "Error",
|
||||||
|
'429': "Error",
|
||||||
|
'500': "Error",
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -569,19 +573,18 @@ class AccountGroupsApi:
|
|||||||
_content_type,
|
_content_type,
|
||||||
_headers,
|
_headers,
|
||||||
_host_index,
|
_host_index,
|
||||||
) -> Tuple:
|
) -> RequestSerialized:
|
||||||
|
|
||||||
_host = None
|
_host = None
|
||||||
|
|
||||||
_collection_formats: Dict[str, str] = {
|
_collection_formats: Dict[str, str] = {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_path_params: Dict[str, str] = {}
|
_path_params: Dict[str, str] = {}
|
||||||
_query_params: List[Tuple[str, str]] = []
|
_query_params: List[Tuple[str, str]] = []
|
||||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||||
_form_params: List[Tuple[str, str]] = []
|
_form_params: List[Tuple[str, str]] = []
|
||||||
_files: Dict[str, str] = {}
|
_files: Dict[str, Union[str, bytes]] = {}
|
||||||
_body_params: Optional[bytes] = None
|
_body_params: Optional[bytes] = None
|
||||||
|
|
||||||
# process the path parameters
|
# process the path parameters
|
||||||
@ -596,7 +599,6 @@ class AccountGroupsApi:
|
|||||||
# set the HTTP header `Accept`
|
# set the HTTP header `Accept`
|
||||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||||
[
|
[
|
||||||
'application/json',
|
|
||||||
'application/problem+json'
|
'application/problem+json'
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@ -684,13 +686,12 @@ class AccountGroupsApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetAccountGroup200Response",
|
'200': "GetAccountGroup200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -762,13 +763,12 @@ class AccountGroupsApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetAccountGroup200Response",
|
'200': "GetAccountGroup200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -840,13 +840,12 @@ class AccountGroupsApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetAccountGroup200Response",
|
'200': "GetAccountGroup200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -863,12 +862,11 @@ class AccountGroupsApi:
|
|||||||
_content_type,
|
_content_type,
|
||||||
_headers,
|
_headers,
|
||||||
_host_index,
|
_host_index,
|
||||||
) -> Tuple:
|
) -> RequestSerialized:
|
||||||
|
|
||||||
_host = None
|
_host = None
|
||||||
|
|
||||||
_collection_formats: Dict[str, str] = {
|
_collection_formats: Dict[str, str] = {
|
||||||
|
|
||||||
'expand': 'csv',
|
'expand': 'csv',
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -876,7 +874,7 @@ class AccountGroupsApi:
|
|||||||
_query_params: List[Tuple[str, str]] = []
|
_query_params: List[Tuple[str, str]] = []
|
||||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||||
_form_params: List[Tuple[str, str]] = []
|
_form_params: List[Tuple[str, str]] = []
|
||||||
_files: Dict[str, str] = {}
|
_files: Dict[str, Union[str, bytes]] = {}
|
||||||
_body_params: Optional[bytes] = None
|
_body_params: Optional[bytes] = None
|
||||||
|
|
||||||
# process the path parameters
|
# process the path parameters
|
||||||
@ -979,13 +977,12 @@ class AccountGroupsApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetAccountGroups200Response",
|
'200': "GetAccountGroups200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -1053,13 +1050,12 @@ class AccountGroupsApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetAccountGroups200Response",
|
'200': "GetAccountGroups200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -1127,13 +1123,12 @@ class AccountGroupsApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetAccountGroups200Response",
|
'200': "GetAccountGroups200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -1149,19 +1144,18 @@ class AccountGroupsApi:
|
|||||||
_content_type,
|
_content_type,
|
||||||
_headers,
|
_headers,
|
||||||
_host_index,
|
_host_index,
|
||||||
) -> Tuple:
|
) -> RequestSerialized:
|
||||||
|
|
||||||
_host = None
|
_host = None
|
||||||
|
|
||||||
_collection_formats: Dict[str, str] = {
|
_collection_formats: Dict[str, str] = {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_path_params: Dict[str, str] = {}
|
_path_params: Dict[str, str] = {}
|
||||||
_query_params: List[Tuple[str, str]] = []
|
_query_params: List[Tuple[str, str]] = []
|
||||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||||
_form_params: List[Tuple[str, str]] = []
|
_form_params: List[Tuple[str, str]] = []
|
||||||
_files: Dict[str, str] = {}
|
_files: Dict[str, Union[str, bytes]] = {}
|
||||||
_body_params: Optional[bytes] = None
|
_body_params: Optional[bytes] = None
|
||||||
|
|
||||||
# process the path parameters
|
# process the path parameters
|
||||||
@ -1270,13 +1264,12 @@ class AccountGroupsApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetAccountGroup200Response",
|
'200': "GetAccountGroup200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -1352,13 +1345,12 @@ class AccountGroupsApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetAccountGroup200Response",
|
'200': "GetAccountGroup200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -1434,13 +1426,12 @@ class AccountGroupsApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetAccountGroup200Response",
|
'200': "GetAccountGroup200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -1458,12 +1449,11 @@ class AccountGroupsApi:
|
|||||||
_content_type,
|
_content_type,
|
||||||
_headers,
|
_headers,
|
||||||
_host_index,
|
_host_index,
|
||||||
) -> Tuple:
|
) -> RequestSerialized:
|
||||||
|
|
||||||
_host = None
|
_host = None
|
||||||
|
|
||||||
_collection_formats: Dict[str, str] = {
|
_collection_formats: Dict[str, str] = {
|
||||||
|
|
||||||
'expand': 'csv',
|
'expand': 'csv',
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1471,7 +1461,7 @@ class AccountGroupsApi:
|
|||||||
_query_params: List[Tuple[str, str]] = []
|
_query_params: List[Tuple[str, str]] = []
|
||||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||||
_form_params: List[Tuple[str, str]] = []
|
_form_params: List[Tuple[str, str]] = []
|
||||||
_files: Dict[str, str] = {}
|
_files: Dict[str, Union[str, bytes]] = {}
|
||||||
_body_params: Optional[bytes] = None
|
_body_params: Optional[bytes] = None
|
||||||
|
|
||||||
# process the path parameters
|
# process the path parameters
|
||||||
@ -3,37 +3,27 @@
|
|||||||
"""
|
"""
|
||||||
Administrative API
|
Administrative API
|
||||||
|
|
||||||
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events.
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
The version of the OpenAPI document: 7.0.0
|
The version of the OpenAPI document: 7.0.2
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
""" # noqa: E501
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
import io
|
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
||||||
from typing import Dict, List, Optional, Tuple, Union, Any
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||||
|
|
||||||
try:
|
|
||||||
from typing import Annotated
|
|
||||||
except ImportError:
|
|
||||||
from typing_extensions import Annotated
|
|
||||||
|
|
||||||
from pydantic import Field
|
|
||||||
from typing_extensions import Annotated
|
from typing_extensions import Annotated
|
||||||
from pydantic import StrictStr
|
|
||||||
|
|
||||||
|
from pydantic import Field, StrictStr
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
from typing_extensions import Annotated
|
||||||
|
from admin.models.get_permissions200_response import GetPermissions200Response
|
||||||
|
|
||||||
from admin_api.models.get_permissions200_response import GetPermissions200Response
|
from admin.api_client import ApiClient, RequestSerialized
|
||||||
|
from admin.api_response import ApiResponse
|
||||||
from admin_api.api_client import ApiClient
|
from admin.rest import RESTResponseType
|
||||||
from admin_api.api_response import ApiResponse
|
|
||||||
from admin_api.rest import RESTResponseType
|
|
||||||
|
|
||||||
|
|
||||||
class PermissionsApi:
|
class PermissionsApi:
|
||||||
@ -104,13 +94,12 @@ class PermissionsApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetPermissions200Response",
|
'200': "GetPermissions200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -178,13 +167,12 @@ class PermissionsApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetPermissions200Response",
|
'200': "GetPermissions200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -252,13 +240,12 @@ class PermissionsApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetPermissions200Response",
|
'200': "GetPermissions200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -274,19 +261,18 @@ class PermissionsApi:
|
|||||||
_content_type,
|
_content_type,
|
||||||
_headers,
|
_headers,
|
||||||
_host_index,
|
_host_index,
|
||||||
) -> Tuple:
|
) -> RequestSerialized:
|
||||||
|
|
||||||
_host = None
|
_host = None
|
||||||
|
|
||||||
_collection_formats: Dict[str, str] = {
|
_collection_formats: Dict[str, str] = {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_path_params: Dict[str, str] = {}
|
_path_params: Dict[str, str] = {}
|
||||||
_query_params: List[Tuple[str, str]] = []
|
_query_params: List[Tuple[str, str]] = []
|
||||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||||
_form_params: List[Tuple[str, str]] = []
|
_form_params: List[Tuple[str, str]] = []
|
||||||
_files: Dict[str, str] = {}
|
_files: Dict[str, Union[str, bytes]] = {}
|
||||||
_body_params: Optional[bytes] = None
|
_body_params: Optional[bytes] = None
|
||||||
|
|
||||||
# process the path parameters
|
# process the path parameters
|
||||||
@ -3,39 +3,29 @@
|
|||||||
"""
|
"""
|
||||||
Administrative API
|
Administrative API
|
||||||
|
|
||||||
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events.
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
The version of the OpenAPI document: 7.0.0
|
The version of the OpenAPI document: 7.0.2
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
""" # noqa: E501
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
import io
|
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
||||||
from typing import Dict, List, Optional, Tuple, Union, Any
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||||
|
|
||||||
try:
|
|
||||||
from typing import Annotated
|
|
||||||
except ImportError:
|
|
||||||
from typing_extensions import Annotated
|
|
||||||
|
|
||||||
from pydantic import Field
|
|
||||||
from typing_extensions import Annotated
|
from typing_extensions import Annotated
|
||||||
from pydantic import StrictStr
|
|
||||||
|
|
||||||
|
from pydantic import Field, StrictStr
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
from typing_extensions import Annotated
|
||||||
|
from admin.models.create_role201_response import CreateRole201Response
|
||||||
|
from admin.models.get_roles200_response import GetRoles200Response
|
||||||
|
from admin.models.role_request_body import RoleRequestBody
|
||||||
|
|
||||||
from admin_api.models.create_role201_response import CreateRole201Response
|
from admin.api_client import ApiClient, RequestSerialized
|
||||||
from admin_api.models.get_roles200_response import GetRoles200Response
|
from admin.api_response import ApiResponse
|
||||||
from admin_api.models.role_request_body import RoleRequestBody
|
from admin.rest import RESTResponseType
|
||||||
|
|
||||||
from admin_api.api_client import ApiClient
|
|
||||||
from admin_api.api_response import ApiResponse
|
|
||||||
from admin_api.rest import RESTResponseType
|
|
||||||
|
|
||||||
|
|
||||||
class RolesApi:
|
class RolesApi:
|
||||||
@ -110,13 +100,12 @@ class RolesApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'201': "CreateRole201Response",
|
'201': "CreateRole201Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -188,13 +177,12 @@ class RolesApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'201': "CreateRole201Response",
|
'201': "CreateRole201Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -266,13 +254,12 @@ class RolesApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'201': "CreateRole201Response",
|
'201': "CreateRole201Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -289,19 +276,18 @@ class RolesApi:
|
|||||||
_content_type,
|
_content_type,
|
||||||
_headers,
|
_headers,
|
||||||
_host_index,
|
_host_index,
|
||||||
) -> Tuple:
|
) -> RequestSerialized:
|
||||||
|
|
||||||
_host = None
|
_host = None
|
||||||
|
|
||||||
_collection_formats: Dict[str, str] = {
|
_collection_formats: Dict[str, str] = {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_path_params: Dict[str, str] = {}
|
_path_params: Dict[str, str] = {}
|
||||||
_query_params: List[Tuple[str, str]] = []
|
_query_params: List[Tuple[str, str]] = []
|
||||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||||
_form_params: List[Tuple[str, str]] = []
|
_form_params: List[Tuple[str, str]] = []
|
||||||
_files: Dict[str, str] = {}
|
_files: Dict[str, Union[str, bytes]] = {}
|
||||||
_body_params: Optional[bytes] = None
|
_body_params: Optional[bytes] = None
|
||||||
|
|
||||||
# process the path parameters
|
# process the path parameters
|
||||||
@ -420,7 +406,13 @@ class RolesApi:
|
|||||||
)
|
)
|
||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
|
'204': None,
|
||||||
|
'400': "ValidationError",
|
||||||
|
'401': "UnauthorizedError",
|
||||||
|
'403': "Error",
|
||||||
|
'404': "Error",
|
||||||
|
'429': "Error",
|
||||||
|
'500': "Error",
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -491,7 +483,13 @@ class RolesApi:
|
|||||||
)
|
)
|
||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
|
'204': None,
|
||||||
|
'400': "ValidationError",
|
||||||
|
'401': "UnauthorizedError",
|
||||||
|
'403': "Error",
|
||||||
|
'404': "Error",
|
||||||
|
'429': "Error",
|
||||||
|
'500': "Error",
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -562,7 +560,13 @@ class RolesApi:
|
|||||||
)
|
)
|
||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
|
'204': None,
|
||||||
|
'400': "ValidationError",
|
||||||
|
'401': "UnauthorizedError",
|
||||||
|
'403': "Error",
|
||||||
|
'404': "Error",
|
||||||
|
'429': "Error",
|
||||||
|
'500': "Error",
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -579,19 +583,18 @@ class RolesApi:
|
|||||||
_content_type,
|
_content_type,
|
||||||
_headers,
|
_headers,
|
||||||
_host_index,
|
_host_index,
|
||||||
) -> Tuple:
|
) -> RequestSerialized:
|
||||||
|
|
||||||
_host = None
|
_host = None
|
||||||
|
|
||||||
_collection_formats: Dict[str, str] = {
|
_collection_formats: Dict[str, str] = {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_path_params: Dict[str, str] = {}
|
_path_params: Dict[str, str] = {}
|
||||||
_query_params: List[Tuple[str, str]] = []
|
_query_params: List[Tuple[str, str]] = []
|
||||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||||
_form_params: List[Tuple[str, str]] = []
|
_form_params: List[Tuple[str, str]] = []
|
||||||
_files: Dict[str, str] = {}
|
_files: Dict[str, Union[str, bytes]] = {}
|
||||||
_body_params: Optional[bytes] = None
|
_body_params: Optional[bytes] = None
|
||||||
|
|
||||||
# process the path parameters
|
# process the path parameters
|
||||||
@ -610,7 +613,6 @@ class RolesApi:
|
|||||||
# set the HTTP header `Accept`
|
# set the HTTP header `Accept`
|
||||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||||
[
|
[
|
||||||
'application/json',
|
|
||||||
'application/problem+json'
|
'application/problem+json'
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@ -698,13 +700,12 @@ class RolesApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "CreateRole201Response",
|
'200': "CreateRole201Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -776,13 +777,12 @@ class RolesApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "CreateRole201Response",
|
'200': "CreateRole201Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -854,13 +854,12 @@ class RolesApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "CreateRole201Response",
|
'200': "CreateRole201Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -877,19 +876,18 @@ class RolesApi:
|
|||||||
_content_type,
|
_content_type,
|
||||||
_headers,
|
_headers,
|
||||||
_host_index,
|
_host_index,
|
||||||
) -> Tuple:
|
) -> RequestSerialized:
|
||||||
|
|
||||||
_host = None
|
_host = None
|
||||||
|
|
||||||
_collection_formats: Dict[str, str] = {
|
_collection_formats: Dict[str, str] = {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_path_params: Dict[str, str] = {}
|
_path_params: Dict[str, str] = {}
|
||||||
_query_params: List[Tuple[str, str]] = []
|
_query_params: List[Tuple[str, str]] = []
|
||||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||||
_form_params: List[Tuple[str, str]] = []
|
_form_params: List[Tuple[str, str]] = []
|
||||||
_files: Dict[str, str] = {}
|
_files: Dict[str, Union[str, bytes]] = {}
|
||||||
_body_params: Optional[bytes] = None
|
_body_params: Optional[bytes] = None
|
||||||
|
|
||||||
# process the path parameters
|
# process the path parameters
|
||||||
@ -992,13 +990,12 @@ class RolesApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetRoles200Response",
|
'200': "GetRoles200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -1066,13 +1063,12 @@ class RolesApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetRoles200Response",
|
'200': "GetRoles200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -1140,13 +1136,12 @@ class RolesApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetRoles200Response",
|
'200': "GetRoles200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -1162,19 +1157,18 @@ class RolesApi:
|
|||||||
_content_type,
|
_content_type,
|
||||||
_headers,
|
_headers,
|
||||||
_host_index,
|
_host_index,
|
||||||
) -> Tuple:
|
) -> RequestSerialized:
|
||||||
|
|
||||||
_host = None
|
_host = None
|
||||||
|
|
||||||
_collection_formats: Dict[str, str] = {
|
_collection_formats: Dict[str, str] = {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_path_params: Dict[str, str] = {}
|
_path_params: Dict[str, str] = {}
|
||||||
_query_params: List[Tuple[str, str]] = []
|
_query_params: List[Tuple[str, str]] = []
|
||||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||||
_form_params: List[Tuple[str, str]] = []
|
_form_params: List[Tuple[str, str]] = []
|
||||||
_files: Dict[str, str] = {}
|
_files: Dict[str, Union[str, bytes]] = {}
|
||||||
_body_params: Optional[bytes] = None
|
_body_params: Optional[bytes] = None
|
||||||
|
|
||||||
# process the path parameters
|
# process the path parameters
|
||||||
@ -1283,13 +1277,12 @@ class RolesApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "CreateRole201Response",
|
'200': "CreateRole201Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -1365,13 +1358,12 @@ class RolesApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "CreateRole201Response",
|
'200': "CreateRole201Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -1447,13 +1439,12 @@ class RolesApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "CreateRole201Response",
|
'200': "CreateRole201Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -1471,19 +1462,18 @@ class RolesApi:
|
|||||||
_content_type,
|
_content_type,
|
||||||
_headers,
|
_headers,
|
||||||
_host_index,
|
_host_index,
|
||||||
) -> Tuple:
|
) -> RequestSerialized:
|
||||||
|
|
||||||
_host = None
|
_host = None
|
||||||
|
|
||||||
_collection_formats: Dict[str, str] = {
|
_collection_formats: Dict[str, str] = {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_path_params: Dict[str, str] = {}
|
_path_params: Dict[str, str] = {}
|
||||||
_query_params: List[Tuple[str, str]] = []
|
_query_params: List[Tuple[str, str]] = []
|
||||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||||
_form_params: List[Tuple[str, str]] = []
|
_form_params: List[Tuple[str, str]] = []
|
||||||
_files: Dict[str, str] = {}
|
_files: Dict[str, Union[str, bytes]] = {}
|
||||||
_body_params: Optional[bytes] = None
|
_body_params: Optional[bytes] = None
|
||||||
|
|
||||||
# process the path parameters
|
# process the path parameters
|
||||||
@ -3,39 +3,28 @@
|
|||||||
"""
|
"""
|
||||||
Administrative API
|
Administrative API
|
||||||
|
|
||||||
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events.
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
The version of the OpenAPI document: 7.0.0
|
The version of the OpenAPI document: 7.0.2
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
""" # noqa: E501
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
import io
|
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
||||||
from typing import Dict, List, Optional, Tuple, Union, Any
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||||
|
|
||||||
try:
|
|
||||||
from typing import Annotated
|
|
||||||
except ImportError:
|
|
||||||
from typing_extensions import Annotated
|
|
||||||
|
|
||||||
from pydantic import Field
|
|
||||||
from typing_extensions import Annotated
|
from typing_extensions import Annotated
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
from pydantic import Field, StrictBool, StrictStr, field_validator
|
||||||
from pydantic import StrictStr, field_validator
|
|
||||||
|
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
from typing_extensions import Annotated
|
||||||
|
from admin.models.get_user_events200_response import GetUserEvents200Response
|
||||||
|
|
||||||
from admin_api.models.get_user_events200_response import GetUserEvents200Response
|
from admin.api_client import ApiClient, RequestSerialized
|
||||||
|
from admin.api_response import ApiResponse
|
||||||
from admin_api.api_client import ApiClient
|
from admin.rest import RESTResponseType
|
||||||
from admin_api.api_response import ApiResponse
|
|
||||||
from admin_api.rest import RESTResponseType
|
|
||||||
|
|
||||||
|
|
||||||
class UserEventsApi:
|
class UserEventsApi:
|
||||||
@ -55,10 +44,11 @@ class UserEventsApi:
|
|||||||
def get_user_events(
|
def get_user_events(
|
||||||
self,
|
self,
|
||||||
aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None,
|
aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None,
|
||||||
|
use_all_permitted_aids: Annotated[Optional[StrictBool], Field(description="Set to `true` to load data from all accounts the user has access to.")] = None,
|
||||||
window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None,
|
window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None,
|
||||||
start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None,
|
start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None,
|
||||||
end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None,
|
end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None,
|
||||||
cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None,
|
cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None,
|
||||||
_request_timeout: Union[
|
_request_timeout: Union[
|
||||||
None,
|
None,
|
||||||
Annotated[StrictFloat, Field(gt=0)],
|
Annotated[StrictFloat, Field(gt=0)],
|
||||||
@ -74,17 +64,19 @@ class UserEventsApi:
|
|||||||
) -> GetUserEvents200Response:
|
) -> GetUserEvents200Response:
|
||||||
"""List activity log events
|
"""List activity log events
|
||||||
|
|
||||||
Returns a list of activity log events. Users with the `View activity log for all users in account group` permission can see all activity log events in the current account group. Users with the `View own activity log` permission can see their own activity log events in the current account group. For more information about changing the account group context, see [Account Context](https://developer.thousandeyes.com/v7/#/accountcontext).
|
Returns a list of activity log events in the current account group. If `useAllPermittedAids=true` query parameter is passed and the user has permission `View activity log for all users in account group` the logs returned include events across all the account groups they belong to. For more information about changing the account group context, see [Account Context](https://developer.thousandeyes.com/v7/#/accountcontext).
|
||||||
|
|
||||||
:param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
|
:param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
|
||||||
:type aid: str
|
:type aid: str
|
||||||
|
:param use_all_permitted_aids: Set to `true` to load data from all accounts the user has access to.
|
||||||
|
:type use_all_permitted_aids: bool
|
||||||
:param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.
|
:param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.
|
||||||
:type window: str
|
:type window: str
|
||||||
:param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.
|
:param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.
|
||||||
:type start_date: datetime
|
:type start_date: datetime
|
||||||
:param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.
|
:param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.
|
||||||
:type end_date: datetime
|
:type end_date: datetime
|
||||||
:param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.
|
:param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.
|
||||||
:type cursor: str
|
:type cursor: str
|
||||||
:param _request_timeout: timeout setting for this request. If one
|
:param _request_timeout: timeout setting for this request. If one
|
||||||
number provided, it will be total request
|
number provided, it will be total request
|
||||||
@ -110,6 +102,7 @@ class UserEventsApi:
|
|||||||
|
|
||||||
_param = self._get_user_events_serialize(
|
_param = self._get_user_events_serialize(
|
||||||
aid=aid,
|
aid=aid,
|
||||||
|
use_all_permitted_aids=use_all_permitted_aids,
|
||||||
window=window,
|
window=window,
|
||||||
start_date=start_date,
|
start_date=start_date,
|
||||||
end_date=end_date,
|
end_date=end_date,
|
||||||
@ -122,13 +115,12 @@ class UserEventsApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetUserEvents200Response",
|
'200': "GetUserEvents200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -145,10 +137,11 @@ class UserEventsApi:
|
|||||||
def get_user_events_with_http_info(
|
def get_user_events_with_http_info(
|
||||||
self,
|
self,
|
||||||
aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None,
|
aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None,
|
||||||
|
use_all_permitted_aids: Annotated[Optional[StrictBool], Field(description="Set to `true` to load data from all accounts the user has access to.")] = None,
|
||||||
window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None,
|
window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None,
|
||||||
start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None,
|
start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None,
|
||||||
end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None,
|
end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None,
|
||||||
cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None,
|
cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None,
|
||||||
_request_timeout: Union[
|
_request_timeout: Union[
|
||||||
None,
|
None,
|
||||||
Annotated[StrictFloat, Field(gt=0)],
|
Annotated[StrictFloat, Field(gt=0)],
|
||||||
@ -164,17 +157,19 @@ class UserEventsApi:
|
|||||||
) -> ApiResponse[GetUserEvents200Response]:
|
) -> ApiResponse[GetUserEvents200Response]:
|
||||||
"""List activity log events
|
"""List activity log events
|
||||||
|
|
||||||
Returns a list of activity log events. Users with the `View activity log for all users in account group` permission can see all activity log events in the current account group. Users with the `View own activity log` permission can see their own activity log events in the current account group. For more information about changing the account group context, see [Account Context](https://developer.thousandeyes.com/v7/#/accountcontext).
|
Returns a list of activity log events in the current account group. If `useAllPermittedAids=true` query parameter is passed and the user has permission `View activity log for all users in account group` the logs returned include events across all the account groups they belong to. For more information about changing the account group context, see [Account Context](https://developer.thousandeyes.com/v7/#/accountcontext).
|
||||||
|
|
||||||
:param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
|
:param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
|
||||||
:type aid: str
|
:type aid: str
|
||||||
|
:param use_all_permitted_aids: Set to `true` to load data from all accounts the user has access to.
|
||||||
|
:type use_all_permitted_aids: bool
|
||||||
:param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.
|
:param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.
|
||||||
:type window: str
|
:type window: str
|
||||||
:param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.
|
:param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.
|
||||||
:type start_date: datetime
|
:type start_date: datetime
|
||||||
:param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.
|
:param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.
|
||||||
:type end_date: datetime
|
:type end_date: datetime
|
||||||
:param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.
|
:param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.
|
||||||
:type cursor: str
|
:type cursor: str
|
||||||
:param _request_timeout: timeout setting for this request. If one
|
:param _request_timeout: timeout setting for this request. If one
|
||||||
number provided, it will be total request
|
number provided, it will be total request
|
||||||
@ -200,6 +195,7 @@ class UserEventsApi:
|
|||||||
|
|
||||||
_param = self._get_user_events_serialize(
|
_param = self._get_user_events_serialize(
|
||||||
aid=aid,
|
aid=aid,
|
||||||
|
use_all_permitted_aids=use_all_permitted_aids,
|
||||||
window=window,
|
window=window,
|
||||||
start_date=start_date,
|
start_date=start_date,
|
||||||
end_date=end_date,
|
end_date=end_date,
|
||||||
@ -212,13 +208,12 @@ class UserEventsApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetUserEvents200Response",
|
'200': "GetUserEvents200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -235,10 +230,11 @@ class UserEventsApi:
|
|||||||
def get_user_events_without_preload_content(
|
def get_user_events_without_preload_content(
|
||||||
self,
|
self,
|
||||||
aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None,
|
aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None,
|
||||||
|
use_all_permitted_aids: Annotated[Optional[StrictBool], Field(description="Set to `true` to load data from all accounts the user has access to.")] = None,
|
||||||
window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None,
|
window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None,
|
||||||
start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None,
|
start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None,
|
||||||
end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None,
|
end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None,
|
||||||
cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.")] = None,
|
cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None,
|
||||||
_request_timeout: Union[
|
_request_timeout: Union[
|
||||||
None,
|
None,
|
||||||
Annotated[StrictFloat, Field(gt=0)],
|
Annotated[StrictFloat, Field(gt=0)],
|
||||||
@ -254,17 +250,19 @@ class UserEventsApi:
|
|||||||
) -> RESTResponseType:
|
) -> RESTResponseType:
|
||||||
"""List activity log events
|
"""List activity log events
|
||||||
|
|
||||||
Returns a list of activity log events. Users with the `View activity log for all users in account group` permission can see all activity log events in the current account group. Users with the `View own activity log` permission can see their own activity log events in the current account group. For more information about changing the account group context, see [Account Context](https://developer.thousandeyes.com/v7/#/accountcontext).
|
Returns a list of activity log events in the current account group. If `useAllPermittedAids=true` query parameter is passed and the user has permission `View activity log for all users in account group` the logs returned include events across all the account groups they belong to. For more information about changing the account group context, see [Account Context](https://developer.thousandeyes.com/v7/#/accountcontext).
|
||||||
|
|
||||||
:param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
|
:param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
|
||||||
:type aid: str
|
:type aid: str
|
||||||
|
:param use_all_permitted_aids: Set to `true` to load data from all accounts the user has access to.
|
||||||
|
:type use_all_permitted_aids: bool
|
||||||
:param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.
|
:param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.
|
||||||
:type window: str
|
:type window: str
|
||||||
:param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.
|
:param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.
|
||||||
:type start_date: datetime
|
:type start_date: datetime
|
||||||
:param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.
|
:param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.
|
||||||
:type end_date: datetime
|
:type end_date: datetime
|
||||||
:param cursor: (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter.
|
:param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.
|
||||||
:type cursor: str
|
:type cursor: str
|
||||||
:param _request_timeout: timeout setting for this request. If one
|
:param _request_timeout: timeout setting for this request. If one
|
||||||
number provided, it will be total request
|
number provided, it will be total request
|
||||||
@ -290,6 +288,7 @@ class UserEventsApi:
|
|||||||
|
|
||||||
_param = self._get_user_events_serialize(
|
_param = self._get_user_events_serialize(
|
||||||
aid=aid,
|
aid=aid,
|
||||||
|
use_all_permitted_aids=use_all_permitted_aids,
|
||||||
window=window,
|
window=window,
|
||||||
start_date=start_date,
|
start_date=start_date,
|
||||||
end_date=end_date,
|
end_date=end_date,
|
||||||
@ -302,13 +301,12 @@ class UserEventsApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetUserEvents200Response",
|
'200': "GetUserEvents200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -320,6 +318,7 @@ class UserEventsApi:
|
|||||||
def _get_user_events_serialize(
|
def _get_user_events_serialize(
|
||||||
self,
|
self,
|
||||||
aid,
|
aid,
|
||||||
|
use_all_permitted_aids,
|
||||||
window,
|
window,
|
||||||
start_date,
|
start_date,
|
||||||
end_date,
|
end_date,
|
||||||
@ -328,19 +327,18 @@ class UserEventsApi:
|
|||||||
_content_type,
|
_content_type,
|
||||||
_headers,
|
_headers,
|
||||||
_host_index,
|
_host_index,
|
||||||
) -> Tuple:
|
) -> RequestSerialized:
|
||||||
|
|
||||||
_host = None
|
_host = None
|
||||||
|
|
||||||
_collection_formats: Dict[str, str] = {
|
_collection_formats: Dict[str, str] = {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_path_params: Dict[str, str] = {}
|
_path_params: Dict[str, str] = {}
|
||||||
_query_params: List[Tuple[str, str]] = []
|
_query_params: List[Tuple[str, str]] = []
|
||||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||||
_form_params: List[Tuple[str, str]] = []
|
_form_params: List[Tuple[str, str]] = []
|
||||||
_files: Dict[str, str] = {}
|
_files: Dict[str, Union[str, bytes]] = {}
|
||||||
_body_params: Optional[bytes] = None
|
_body_params: Optional[bytes] = None
|
||||||
|
|
||||||
# process the path parameters
|
# process the path parameters
|
||||||
@ -349,6 +347,10 @@ class UserEventsApi:
|
|||||||
|
|
||||||
_query_params.append(('aid', aid))
|
_query_params.append(('aid', aid))
|
||||||
|
|
||||||
|
if use_all_permitted_aids is not None:
|
||||||
|
|
||||||
|
_query_params.append(('useAllPermittedAids', use_all_permitted_aids))
|
||||||
|
|
||||||
if window is not None:
|
if window is not None:
|
||||||
|
|
||||||
_query_params.append(('window', window))
|
_query_params.append(('window', window))
|
||||||
@ -3,40 +3,30 @@
|
|||||||
"""
|
"""
|
||||||
Administrative API
|
Administrative API
|
||||||
|
|
||||||
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events.
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
The version of the OpenAPI document: 7.0.0
|
The version of the OpenAPI document: 7.0.2
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
""" # noqa: E501
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
import io
|
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
||||||
from typing import Dict, List, Optional, Tuple, Union, Any
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||||
|
|
||||||
try:
|
|
||||||
from typing import Annotated
|
|
||||||
except ImportError:
|
|
||||||
from typing_extensions import Annotated
|
|
||||||
|
|
||||||
from pydantic import Field
|
|
||||||
from typing_extensions import Annotated
|
from typing_extensions import Annotated
|
||||||
from pydantic import StrictStr
|
|
||||||
|
|
||||||
|
from pydantic import Field, StrictStr
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
from typing_extensions import Annotated
|
||||||
|
from admin.models.create_user201_response import CreateUser201Response
|
||||||
|
from admin.models.get_user200_response import GetUser200Response
|
||||||
|
from admin.models.get_users200_response import GetUsers200Response
|
||||||
|
from admin.models.user_request_body import UserRequestBody
|
||||||
|
|
||||||
from admin_api.models.create_user201_response import CreateUser201Response
|
from admin.api_client import ApiClient, RequestSerialized
|
||||||
from admin_api.models.get_user200_response import GetUser200Response
|
from admin.api_response import ApiResponse
|
||||||
from admin_api.models.get_users200_response import GetUsers200Response
|
from admin.rest import RESTResponseType
|
||||||
from admin_api.models.user_request_body import UserRequestBody
|
|
||||||
|
|
||||||
from admin_api.api_client import ApiClient
|
|
||||||
from admin_api.api_response import ApiResponse
|
|
||||||
from admin_api.rest import RESTResponseType
|
|
||||||
|
|
||||||
|
|
||||||
class UsersApi:
|
class UsersApi:
|
||||||
@ -111,13 +101,12 @@ class UsersApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'201': "CreateUser201Response",
|
'201': "CreateUser201Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -189,13 +178,12 @@ class UsersApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'201': "CreateUser201Response",
|
'201': "CreateUser201Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -267,13 +255,12 @@ class UsersApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'201': "CreateUser201Response",
|
'201': "CreateUser201Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -290,19 +277,18 @@ class UsersApi:
|
|||||||
_content_type,
|
_content_type,
|
||||||
_headers,
|
_headers,
|
||||||
_host_index,
|
_host_index,
|
||||||
) -> Tuple:
|
) -> RequestSerialized:
|
||||||
|
|
||||||
_host = None
|
_host = None
|
||||||
|
|
||||||
_collection_formats: Dict[str, str] = {
|
_collection_formats: Dict[str, str] = {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_path_params: Dict[str, str] = {}
|
_path_params: Dict[str, str] = {}
|
||||||
_query_params: List[Tuple[str, str]] = []
|
_query_params: List[Tuple[str, str]] = []
|
||||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||||
_form_params: List[Tuple[str, str]] = []
|
_form_params: List[Tuple[str, str]] = []
|
||||||
_files: Dict[str, str] = {}
|
_files: Dict[str, Union[str, bytes]] = {}
|
||||||
_body_params: Optional[bytes] = None
|
_body_params: Optional[bytes] = None
|
||||||
|
|
||||||
# process the path parameters
|
# process the path parameters
|
||||||
@ -366,7 +352,7 @@ class UsersApi:
|
|||||||
@validate_call
|
@validate_call
|
||||||
def delete_user(
|
def delete_user(
|
||||||
self,
|
self,
|
||||||
id: Annotated[StrictStr, Field(description="Identifer for the user.")],
|
id: Annotated[StrictStr, Field(description="Identifier for the user.")],
|
||||||
aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None,
|
aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None,
|
||||||
_request_timeout: Union[
|
_request_timeout: Union[
|
||||||
None,
|
None,
|
||||||
@ -385,7 +371,7 @@ class UsersApi:
|
|||||||
|
|
||||||
Deletes a user using the user ID. This endpoint requires the `Edit users in all account groups` or `Edit users` permission.
|
Deletes a user using the user ID. This endpoint requires the `Edit users in all account groups` or `Edit users` permission.
|
||||||
|
|
||||||
:param id: Identifer for the user. (required)
|
:param id: Identifier for the user. (required)
|
||||||
:type id: str
|
:type id: str
|
||||||
:param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
|
:param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
|
||||||
:type aid: str
|
:type aid: str
|
||||||
@ -421,7 +407,13 @@ class UsersApi:
|
|||||||
)
|
)
|
||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
|
'204': None,
|
||||||
|
'400': "ValidationError",
|
||||||
|
'401': "UnauthorizedError",
|
||||||
|
'403': "Error",
|
||||||
|
'404': "Error",
|
||||||
|
'429': "Error",
|
||||||
|
'500': "Error",
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -437,7 +429,7 @@ class UsersApi:
|
|||||||
@validate_call
|
@validate_call
|
||||||
def delete_user_with_http_info(
|
def delete_user_with_http_info(
|
||||||
self,
|
self,
|
||||||
id: Annotated[StrictStr, Field(description="Identifer for the user.")],
|
id: Annotated[StrictStr, Field(description="Identifier for the user.")],
|
||||||
aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None,
|
aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None,
|
||||||
_request_timeout: Union[
|
_request_timeout: Union[
|
||||||
None,
|
None,
|
||||||
@ -456,7 +448,7 @@ class UsersApi:
|
|||||||
|
|
||||||
Deletes a user using the user ID. This endpoint requires the `Edit users in all account groups` or `Edit users` permission.
|
Deletes a user using the user ID. This endpoint requires the `Edit users in all account groups` or `Edit users` permission.
|
||||||
|
|
||||||
:param id: Identifer for the user. (required)
|
:param id: Identifier for the user. (required)
|
||||||
:type id: str
|
:type id: str
|
||||||
:param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
|
:param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
|
||||||
:type aid: str
|
:type aid: str
|
||||||
@ -492,7 +484,13 @@ class UsersApi:
|
|||||||
)
|
)
|
||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
|
'204': None,
|
||||||
|
'400': "ValidationError",
|
||||||
|
'401': "UnauthorizedError",
|
||||||
|
'403': "Error",
|
||||||
|
'404': "Error",
|
||||||
|
'429': "Error",
|
||||||
|
'500': "Error",
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -508,7 +506,7 @@ class UsersApi:
|
|||||||
@validate_call
|
@validate_call
|
||||||
def delete_user_without_preload_content(
|
def delete_user_without_preload_content(
|
||||||
self,
|
self,
|
||||||
id: Annotated[StrictStr, Field(description="Identifer for the user.")],
|
id: Annotated[StrictStr, Field(description="Identifier for the user.")],
|
||||||
aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None,
|
aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None,
|
||||||
_request_timeout: Union[
|
_request_timeout: Union[
|
||||||
None,
|
None,
|
||||||
@ -527,7 +525,7 @@ class UsersApi:
|
|||||||
|
|
||||||
Deletes a user using the user ID. This endpoint requires the `Edit users in all account groups` or `Edit users` permission.
|
Deletes a user using the user ID. This endpoint requires the `Edit users in all account groups` or `Edit users` permission.
|
||||||
|
|
||||||
:param id: Identifer for the user. (required)
|
:param id: Identifier for the user. (required)
|
||||||
:type id: str
|
:type id: str
|
||||||
:param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
|
:param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
|
||||||
:type aid: str
|
:type aid: str
|
||||||
@ -563,7 +561,13 @@ class UsersApi:
|
|||||||
)
|
)
|
||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
|
'204': None,
|
||||||
|
'400': "ValidationError",
|
||||||
|
'401': "UnauthorizedError",
|
||||||
|
'403': "Error",
|
||||||
|
'404': "Error",
|
||||||
|
'429': "Error",
|
||||||
|
'500': "Error",
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -580,19 +584,18 @@ class UsersApi:
|
|||||||
_content_type,
|
_content_type,
|
||||||
_headers,
|
_headers,
|
||||||
_host_index,
|
_host_index,
|
||||||
) -> Tuple:
|
) -> RequestSerialized:
|
||||||
|
|
||||||
_host = None
|
_host = None
|
||||||
|
|
||||||
_collection_formats: Dict[str, str] = {
|
_collection_formats: Dict[str, str] = {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_path_params: Dict[str, str] = {}
|
_path_params: Dict[str, str] = {}
|
||||||
_query_params: List[Tuple[str, str]] = []
|
_query_params: List[Tuple[str, str]] = []
|
||||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||||
_form_params: List[Tuple[str, str]] = []
|
_form_params: List[Tuple[str, str]] = []
|
||||||
_files: Dict[str, str] = {}
|
_files: Dict[str, Union[str, bytes]] = {}
|
||||||
_body_params: Optional[bytes] = None
|
_body_params: Optional[bytes] = None
|
||||||
|
|
||||||
# process the path parameters
|
# process the path parameters
|
||||||
@ -611,7 +614,6 @@ class UsersApi:
|
|||||||
# set the HTTP header `Accept`
|
# set the HTTP header `Accept`
|
||||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||||
[
|
[
|
||||||
'application/json',
|
|
||||||
'application/problem+json'
|
'application/problem+json'
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@ -643,7 +645,7 @@ class UsersApi:
|
|||||||
@validate_call
|
@validate_call
|
||||||
def get_user(
|
def get_user(
|
||||||
self,
|
self,
|
||||||
id: Annotated[StrictStr, Field(description="Identifer for the user.")],
|
id: Annotated[StrictStr, Field(description="Identifier for the user.")],
|
||||||
aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None,
|
aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None,
|
||||||
_request_timeout: Union[
|
_request_timeout: Union[
|
||||||
None,
|
None,
|
||||||
@ -662,7 +664,7 @@ class UsersApi:
|
|||||||
|
|
||||||
Retrieves detailed information about a user. This operation requires the `API Access` and `View All Users` permissions.
|
Retrieves detailed information about a user. This operation requires the `API Access` and `View All Users` permissions.
|
||||||
|
|
||||||
:param id: Identifer for the user. (required)
|
:param id: Identifier for the user. (required)
|
||||||
:type id: str
|
:type id: str
|
||||||
:param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
|
:param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
|
||||||
:type aid: str
|
:type aid: str
|
||||||
@ -699,13 +701,12 @@ class UsersApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetUser200Response",
|
'200': "GetUser200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -721,7 +722,7 @@ class UsersApi:
|
|||||||
@validate_call
|
@validate_call
|
||||||
def get_user_with_http_info(
|
def get_user_with_http_info(
|
||||||
self,
|
self,
|
||||||
id: Annotated[StrictStr, Field(description="Identifer for the user.")],
|
id: Annotated[StrictStr, Field(description="Identifier for the user.")],
|
||||||
aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None,
|
aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None,
|
||||||
_request_timeout: Union[
|
_request_timeout: Union[
|
||||||
None,
|
None,
|
||||||
@ -740,7 +741,7 @@ class UsersApi:
|
|||||||
|
|
||||||
Retrieves detailed information about a user. This operation requires the `API Access` and `View All Users` permissions.
|
Retrieves detailed information about a user. This operation requires the `API Access` and `View All Users` permissions.
|
||||||
|
|
||||||
:param id: Identifer for the user. (required)
|
:param id: Identifier for the user. (required)
|
||||||
:type id: str
|
:type id: str
|
||||||
:param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
|
:param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
|
||||||
:type aid: str
|
:type aid: str
|
||||||
@ -777,13 +778,12 @@ class UsersApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetUser200Response",
|
'200': "GetUser200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -799,7 +799,7 @@ class UsersApi:
|
|||||||
@validate_call
|
@validate_call
|
||||||
def get_user_without_preload_content(
|
def get_user_without_preload_content(
|
||||||
self,
|
self,
|
||||||
id: Annotated[StrictStr, Field(description="Identifer for the user.")],
|
id: Annotated[StrictStr, Field(description="Identifier for the user.")],
|
||||||
aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None,
|
aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None,
|
||||||
_request_timeout: Union[
|
_request_timeout: Union[
|
||||||
None,
|
None,
|
||||||
@ -818,7 +818,7 @@ class UsersApi:
|
|||||||
|
|
||||||
Retrieves detailed information about a user. This operation requires the `API Access` and `View All Users` permissions.
|
Retrieves detailed information about a user. This operation requires the `API Access` and `View All Users` permissions.
|
||||||
|
|
||||||
:param id: Identifer for the user. (required)
|
:param id: Identifier for the user. (required)
|
||||||
:type id: str
|
:type id: str
|
||||||
:param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
|
:param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
|
||||||
:type aid: str
|
:type aid: str
|
||||||
@ -855,13 +855,12 @@ class UsersApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetUser200Response",
|
'200': "GetUser200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -878,19 +877,18 @@ class UsersApi:
|
|||||||
_content_type,
|
_content_type,
|
||||||
_headers,
|
_headers,
|
||||||
_host_index,
|
_host_index,
|
||||||
) -> Tuple:
|
) -> RequestSerialized:
|
||||||
|
|
||||||
_host = None
|
_host = None
|
||||||
|
|
||||||
_collection_formats: Dict[str, str] = {
|
_collection_formats: Dict[str, str] = {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_path_params: Dict[str, str] = {}
|
_path_params: Dict[str, str] = {}
|
||||||
_query_params: List[Tuple[str, str]] = []
|
_query_params: List[Tuple[str, str]] = []
|
||||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||||
_form_params: List[Tuple[str, str]] = []
|
_form_params: List[Tuple[str, str]] = []
|
||||||
_files: Dict[str, str] = {}
|
_files: Dict[str, Union[str, bytes]] = {}
|
||||||
_body_params: Optional[bytes] = None
|
_body_params: Optional[bytes] = None
|
||||||
|
|
||||||
# process the path parameters
|
# process the path parameters
|
||||||
@ -993,13 +991,12 @@ class UsersApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetUsers200Response",
|
'200': "GetUsers200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -1067,13 +1064,12 @@ class UsersApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetUsers200Response",
|
'200': "GetUsers200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -1141,13 +1137,12 @@ class UsersApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetUsers200Response",
|
'200': "GetUsers200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -1163,19 +1158,18 @@ class UsersApi:
|
|||||||
_content_type,
|
_content_type,
|
||||||
_headers,
|
_headers,
|
||||||
_host_index,
|
_host_index,
|
||||||
) -> Tuple:
|
) -> RequestSerialized:
|
||||||
|
|
||||||
_host = None
|
_host = None
|
||||||
|
|
||||||
_collection_formats: Dict[str, str] = {
|
_collection_formats: Dict[str, str] = {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_path_params: Dict[str, str] = {}
|
_path_params: Dict[str, str] = {}
|
||||||
_query_params: List[Tuple[str, str]] = []
|
_query_params: List[Tuple[str, str]] = []
|
||||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||||
_form_params: List[Tuple[str, str]] = []
|
_form_params: List[Tuple[str, str]] = []
|
||||||
_files: Dict[str, str] = {}
|
_files: Dict[str, Union[str, bytes]] = {}
|
||||||
_body_params: Optional[bytes] = None
|
_body_params: Optional[bytes] = None
|
||||||
|
|
||||||
# process the path parameters
|
# process the path parameters
|
||||||
@ -1224,7 +1218,7 @@ class UsersApi:
|
|||||||
@validate_call
|
@validate_call
|
||||||
def update_user(
|
def update_user(
|
||||||
self,
|
self,
|
||||||
id: Annotated[StrictStr, Field(description="Identifer for the user.")],
|
id: Annotated[StrictStr, Field(description="Identifier for the user.")],
|
||||||
user_request_body: UserRequestBody,
|
user_request_body: UserRequestBody,
|
||||||
aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None,
|
aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None,
|
||||||
_request_timeout: Union[
|
_request_timeout: Union[
|
||||||
@ -1244,7 +1238,7 @@ class UsersApi:
|
|||||||
|
|
||||||
Updates a user using the user ID. You can update the user name, email address, account group assignments, or roles. This endpoint requires the `Edit users in all account groups` or `Edit users` permission. When updating a user, the following applies: * When updating a user's email address, the user must confirm the username change before they can subsequently log in or perform API operations. * Any update that includes `accountGroupRoles` is a replace-based update and not a delta-based update.
|
Updates a user using the user ID. You can update the user name, email address, account group assignments, or roles. This endpoint requires the `Edit users in all account groups` or `Edit users` permission. When updating a user, the following applies: * When updating a user's email address, the user must confirm the username change before they can subsequently log in or perform API operations. * Any update that includes `accountGroupRoles` is a replace-based update and not a delta-based update.
|
||||||
|
|
||||||
:param id: Identifer for the user. (required)
|
:param id: Identifier for the user. (required)
|
||||||
:type id: str
|
:type id: str
|
||||||
:param user_request_body: (required)
|
:param user_request_body: (required)
|
||||||
:type user_request_body: UserRequestBody
|
:type user_request_body: UserRequestBody
|
||||||
@ -1284,13 +1278,12 @@ class UsersApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetUser200Response",
|
'200': "GetUser200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -1306,7 +1299,7 @@ class UsersApi:
|
|||||||
@validate_call
|
@validate_call
|
||||||
def update_user_with_http_info(
|
def update_user_with_http_info(
|
||||||
self,
|
self,
|
||||||
id: Annotated[StrictStr, Field(description="Identifer for the user.")],
|
id: Annotated[StrictStr, Field(description="Identifier for the user.")],
|
||||||
user_request_body: UserRequestBody,
|
user_request_body: UserRequestBody,
|
||||||
aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None,
|
aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None,
|
||||||
_request_timeout: Union[
|
_request_timeout: Union[
|
||||||
@ -1326,7 +1319,7 @@ class UsersApi:
|
|||||||
|
|
||||||
Updates a user using the user ID. You can update the user name, email address, account group assignments, or roles. This endpoint requires the `Edit users in all account groups` or `Edit users` permission. When updating a user, the following applies: * When updating a user's email address, the user must confirm the username change before they can subsequently log in or perform API operations. * Any update that includes `accountGroupRoles` is a replace-based update and not a delta-based update.
|
Updates a user using the user ID. You can update the user name, email address, account group assignments, or roles. This endpoint requires the `Edit users in all account groups` or `Edit users` permission. When updating a user, the following applies: * When updating a user's email address, the user must confirm the username change before they can subsequently log in or perform API operations. * Any update that includes `accountGroupRoles` is a replace-based update and not a delta-based update.
|
||||||
|
|
||||||
:param id: Identifer for the user. (required)
|
:param id: Identifier for the user. (required)
|
||||||
:type id: str
|
:type id: str
|
||||||
:param user_request_body: (required)
|
:param user_request_body: (required)
|
||||||
:type user_request_body: UserRequestBody
|
:type user_request_body: UserRequestBody
|
||||||
@ -1366,13 +1359,12 @@ class UsersApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetUser200Response",
|
'200': "GetUser200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -1388,7 +1380,7 @@ class UsersApi:
|
|||||||
@validate_call
|
@validate_call
|
||||||
def update_user_without_preload_content(
|
def update_user_without_preload_content(
|
||||||
self,
|
self,
|
||||||
id: Annotated[StrictStr, Field(description="Identifer for the user.")],
|
id: Annotated[StrictStr, Field(description="Identifier for the user.")],
|
||||||
user_request_body: UserRequestBody,
|
user_request_body: UserRequestBody,
|
||||||
aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None,
|
aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None,
|
||||||
_request_timeout: Union[
|
_request_timeout: Union[
|
||||||
@ -1408,7 +1400,7 @@ class UsersApi:
|
|||||||
|
|
||||||
Updates a user using the user ID. You can update the user name, email address, account group assignments, or roles. This endpoint requires the `Edit users in all account groups` or `Edit users` permission. When updating a user, the following applies: * When updating a user's email address, the user must confirm the username change before they can subsequently log in or perform API operations. * Any update that includes `accountGroupRoles` is a replace-based update and not a delta-based update.
|
Updates a user using the user ID. You can update the user name, email address, account group assignments, or roles. This endpoint requires the `Edit users in all account groups` or `Edit users` permission. When updating a user, the following applies: * When updating a user's email address, the user must confirm the username change before they can subsequently log in or perform API operations. * Any update that includes `accountGroupRoles` is a replace-based update and not a delta-based update.
|
||||||
|
|
||||||
:param id: Identifer for the user. (required)
|
:param id: Identifier for the user. (required)
|
||||||
:type id: str
|
:type id: str
|
||||||
:param user_request_body: (required)
|
:param user_request_body: (required)
|
||||||
:type user_request_body: UserRequestBody
|
:type user_request_body: UserRequestBody
|
||||||
@ -1448,13 +1440,12 @@ class UsersApi:
|
|||||||
|
|
||||||
_response_types_map: Dict[str, Optional[str]] = {
|
_response_types_map: Dict[str, Optional[str]] = {
|
||||||
'200': "GetUser200Response",
|
'200': "GetUser200Response",
|
||||||
'400': "Error",
|
'400': "ValidationError",
|
||||||
'401': "UnauthorizedError",
|
'401': "UnauthorizedError",
|
||||||
'403': "Error",
|
'403': "Error",
|
||||||
'404': "Error",
|
'404': "Error",
|
||||||
'429': "Error",
|
'429': "Error",
|
||||||
'500': "Error"
|
'500': "Error",
|
||||||
|
|
||||||
}
|
}
|
||||||
response_data = self.api_client.call_api(
|
response_data = self.api_client.call_api(
|
||||||
*_param,
|
*_param,
|
||||||
@ -1472,19 +1463,18 @@ class UsersApi:
|
|||||||
_content_type,
|
_content_type,
|
||||||
_headers,
|
_headers,
|
||||||
_host_index,
|
_host_index,
|
||||||
) -> Tuple:
|
) -> RequestSerialized:
|
||||||
|
|
||||||
_host = None
|
_host = None
|
||||||
|
|
||||||
_collection_formats: Dict[str, str] = {
|
_collection_formats: Dict[str, str] = {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_path_params: Dict[str, str] = {}
|
_path_params: Dict[str, str] = {}
|
||||||
_query_params: List[Tuple[str, str]] = []
|
_query_params: List[Tuple[str, str]] = []
|
||||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||||
_form_params: List[Tuple[str, str]] = []
|
_form_params: List[Tuple[str, str]] = []
|
||||||
_files: Dict[str, str] = {}
|
_files: Dict[str, Union[str, bytes]] = {}
|
||||||
_body_params: Optional[bytes] = None
|
_body_params: Optional[bytes] = None
|
||||||
|
|
||||||
# process the path parameters
|
# process the path parameters
|
||||||
770
admin/admin/api_client.py
Normal file
770
admin/admin/api_client.py
Normal file
@ -0,0 +1,770 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
import datetime
|
||||||
|
from dateutil.parser import parse
|
||||||
|
from enum import Enum
|
||||||
|
import json
|
||||||
|
import mimetypes
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import tempfile
|
||||||
|
|
||||||
|
from urllib.parse import quote
|
||||||
|
from typing import Tuple, Optional, List, Dict, Union
|
||||||
|
from pydantic import SecretStr
|
||||||
|
|
||||||
|
from admin.configuration import Configuration
|
||||||
|
from admin.api_response import ApiResponse, T as ApiResponseT
|
||||||
|
import admin.models
|
||||||
|
from admin import rest
|
||||||
|
from admin.exceptions import (
|
||||||
|
ApiValueError,
|
||||||
|
ApiException,
|
||||||
|
BadRequestException,
|
||||||
|
UnauthorizedException,
|
||||||
|
ForbiddenException,
|
||||||
|
NotFoundException,
|
||||||
|
ServiceException
|
||||||
|
)
|
||||||
|
|
||||||
|
RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]]
|
||||||
|
|
||||||
|
class ApiClient:
|
||||||
|
"""Generic API client for OpenAPI client library builds.
|
||||||
|
|
||||||
|
OpenAPI generic API client. This client handles the client-
|
||||||
|
server communication, and is invariant across implementations. Specifics of
|
||||||
|
the methods and models for each application are generated from the OpenAPI
|
||||||
|
templates.
|
||||||
|
|
||||||
|
:param configuration: .Configuration object for this client
|
||||||
|
:param header_name: a header to pass when making calls to the API.
|
||||||
|
:param header_value: a header value to pass when making calls to
|
||||||
|
the API.
|
||||||
|
:param cookie: a cookie to include in the header when making calls
|
||||||
|
to the API
|
||||||
|
"""
|
||||||
|
|
||||||
|
PRIMITIVE_TYPES = (float, bool, bytes, str, int)
|
||||||
|
NATIVE_TYPES_MAPPING = {
|
||||||
|
'int': int,
|
||||||
|
'long': int, # TODO remove as only py3 is supported?
|
||||||
|
'float': float,
|
||||||
|
'str': str,
|
||||||
|
'bool': bool,
|
||||||
|
'date': datetime.date,
|
||||||
|
'datetime': datetime.datetime,
|
||||||
|
'object': object,
|
||||||
|
}
|
||||||
|
_pool = None
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
configuration=None,
|
||||||
|
header_name=None,
|
||||||
|
header_value=None,
|
||||||
|
cookie=None
|
||||||
|
) -> None:
|
||||||
|
# use default configuration if none is provided
|
||||||
|
if configuration is None:
|
||||||
|
configuration = Configuration.get_default()
|
||||||
|
self.configuration = configuration
|
||||||
|
|
||||||
|
self.rest_client = rest.RESTClientObject(configuration)
|
||||||
|
self.default_headers = {}
|
||||||
|
if header_name is not None:
|
||||||
|
self.default_headers[header_name] = header_value
|
||||||
|
self.cookie = cookie
|
||||||
|
# Set default User-Agent.
|
||||||
|
self.user_agent = 'OpenAPI-Generator/1.0.0/python'
|
||||||
|
self.client_side_validation = configuration.client_side_validation
|
||||||
|
|
||||||
|
def __enter__(self):
|
||||||
|
return self
|
||||||
|
|
||||||
|
def __exit__(self, exc_type, exc_value, traceback):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@property
|
||||||
|
def user_agent(self):
|
||||||
|
"""User agent for this API client"""
|
||||||
|
return self.default_headers['User-Agent']
|
||||||
|
|
||||||
|
@user_agent.setter
|
||||||
|
def user_agent(self, value):
|
||||||
|
self.default_headers['User-Agent'] = value
|
||||||
|
|
||||||
|
def set_default_header(self, header_name, header_value):
|
||||||
|
self.default_headers[header_name] = header_value
|
||||||
|
|
||||||
|
|
||||||
|
_default = None
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def get_default(cls):
|
||||||
|
"""Return new instance of ApiClient.
|
||||||
|
|
||||||
|
This method returns newly created, based on default constructor,
|
||||||
|
object of ApiClient class or returns a copy of default
|
||||||
|
ApiClient.
|
||||||
|
|
||||||
|
:return: The ApiClient object.
|
||||||
|
"""
|
||||||
|
if cls._default is None:
|
||||||
|
cls._default = ApiClient()
|
||||||
|
return cls._default
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def set_default(cls, default):
|
||||||
|
"""Set default instance of ApiClient.
|
||||||
|
|
||||||
|
It stores default ApiClient.
|
||||||
|
|
||||||
|
:param default: object of ApiClient.
|
||||||
|
"""
|
||||||
|
cls._default = default
|
||||||
|
|
||||||
|
def param_serialize(
|
||||||
|
self,
|
||||||
|
method,
|
||||||
|
resource_path,
|
||||||
|
path_params=None,
|
||||||
|
query_params=None,
|
||||||
|
header_params=None,
|
||||||
|
body=None,
|
||||||
|
post_params=None,
|
||||||
|
files=None, auth_settings=None,
|
||||||
|
collection_formats=None,
|
||||||
|
_host=None,
|
||||||
|
_request_auth=None
|
||||||
|
) -> RequestSerialized:
|
||||||
|
|
||||||
|
"""Builds the HTTP request params needed by the request.
|
||||||
|
:param method: Method to call.
|
||||||
|
:param resource_path: Path to method endpoint.
|
||||||
|
:param path_params: Path parameters in the url.
|
||||||
|
:param query_params: Query parameters in the url.
|
||||||
|
:param header_params: Header parameters to be
|
||||||
|
placed in the request header.
|
||||||
|
:param body: Request body.
|
||||||
|
:param post_params dict: Request post form parameters,
|
||||||
|
for `application/x-www-form-urlencoded`, `multipart/form-data`.
|
||||||
|
:param auth_settings list: Auth Settings names for the request.
|
||||||
|
:param files dict: key -> filename, value -> filepath,
|
||||||
|
for `multipart/form-data`.
|
||||||
|
:param collection_formats: dict of collection formats for path, query,
|
||||||
|
header, and post parameters.
|
||||||
|
:param _request_auth: set to override the auth_settings for an a single
|
||||||
|
request; this effectively ignores the authentication
|
||||||
|
in the spec for a single request.
|
||||||
|
:return: tuple of form (path, http_method, query_params, header_params,
|
||||||
|
body, post_params, files)
|
||||||
|
"""
|
||||||
|
|
||||||
|
config = self.configuration
|
||||||
|
|
||||||
|
# header parameters
|
||||||
|
header_params = header_params or {}
|
||||||
|
header_params.update(self.default_headers)
|
||||||
|
if self.cookie:
|
||||||
|
header_params['Cookie'] = self.cookie
|
||||||
|
if header_params:
|
||||||
|
header_params = self.sanitize_for_serialization(header_params)
|
||||||
|
header_params = dict(
|
||||||
|
self.parameters_to_tuples(header_params,collection_formats)
|
||||||
|
)
|
||||||
|
|
||||||
|
# path parameters
|
||||||
|
if path_params:
|
||||||
|
path_params = self.sanitize_for_serialization(path_params)
|
||||||
|
path_params = self.parameters_to_tuples(
|
||||||
|
path_params,
|
||||||
|
collection_formats
|
||||||
|
)
|
||||||
|
for k, v in path_params:
|
||||||
|
# specified safe chars, encode everything
|
||||||
|
resource_path = resource_path.replace(
|
||||||
|
'{%s}' % k,
|
||||||
|
quote(str(v), safe=config.safe_chars_for_path_param)
|
||||||
|
)
|
||||||
|
|
||||||
|
# post parameters
|
||||||
|
if post_params or files:
|
||||||
|
post_params = post_params if post_params else []
|
||||||
|
post_params = self.sanitize_for_serialization(post_params)
|
||||||
|
post_params = self.parameters_to_tuples(
|
||||||
|
post_params,
|
||||||
|
collection_formats
|
||||||
|
)
|
||||||
|
if files:
|
||||||
|
post_params.extend(self.files_parameters(files))
|
||||||
|
|
||||||
|
# auth setting
|
||||||
|
self.update_params_for_auth(
|
||||||
|
header_params,
|
||||||
|
query_params,
|
||||||
|
auth_settings,
|
||||||
|
resource_path,
|
||||||
|
method,
|
||||||
|
body,
|
||||||
|
request_auth=_request_auth
|
||||||
|
)
|
||||||
|
|
||||||
|
# body
|
||||||
|
if body:
|
||||||
|
body = self.sanitize_for_serialization(body)
|
||||||
|
|
||||||
|
# request url
|
||||||
|
if _host is None:
|
||||||
|
url = self.configuration.host + resource_path
|
||||||
|
else:
|
||||||
|
# use server/host defined in path or operation instead
|
||||||
|
url = _host + resource_path
|
||||||
|
|
||||||
|
# query parameters
|
||||||
|
if query_params:
|
||||||
|
query_params = self.sanitize_for_serialization(query_params)
|
||||||
|
url_query = self.parameters_to_url_query(
|
||||||
|
query_params,
|
||||||
|
collection_formats
|
||||||
|
)
|
||||||
|
url += "?" + url_query
|
||||||
|
|
||||||
|
return method, url, header_params, body, post_params
|
||||||
|
|
||||||
|
|
||||||
|
def call_api(
|
||||||
|
self,
|
||||||
|
method,
|
||||||
|
url,
|
||||||
|
header_params=None,
|
||||||
|
body=None,
|
||||||
|
post_params=None,
|
||||||
|
_request_timeout=None
|
||||||
|
) -> rest.RESTResponse:
|
||||||
|
"""Makes the HTTP request (synchronous)
|
||||||
|
:param method: Method to call.
|
||||||
|
:param url: Path to method endpoint.
|
||||||
|
:param header_params: Header parameters to be
|
||||||
|
placed in the request header.
|
||||||
|
:param body: Request body.
|
||||||
|
:param post_params dict: Request post form parameters,
|
||||||
|
for `application/x-www-form-urlencoded`, `multipart/form-data`.
|
||||||
|
:param _request_timeout: timeout setting for this request.
|
||||||
|
:return: RESTResponse
|
||||||
|
"""
|
||||||
|
|
||||||
|
try:
|
||||||
|
# perform request and return response
|
||||||
|
response_data = self.rest_client.request(
|
||||||
|
method, url,
|
||||||
|
headers=header_params,
|
||||||
|
body=body, post_params=post_params,
|
||||||
|
_request_timeout=_request_timeout
|
||||||
|
)
|
||||||
|
|
||||||
|
except ApiException as e:
|
||||||
|
raise e
|
||||||
|
|
||||||
|
return response_data
|
||||||
|
|
||||||
|
def response_deserialize(
|
||||||
|
self,
|
||||||
|
response_data: rest.RESTResponse,
|
||||||
|
response_types_map: Optional[Dict[str, ApiResponseT]]=None
|
||||||
|
) -> ApiResponse[ApiResponseT]:
|
||||||
|
"""Deserializes response into an object.
|
||||||
|
:param response_data: RESTResponse object to be deserialized.
|
||||||
|
:param response_types_map: dict of response types.
|
||||||
|
:return: ApiResponse
|
||||||
|
"""
|
||||||
|
|
||||||
|
msg = "RESTResponse.read() must be called before passing it to response_deserialize()"
|
||||||
|
assert response_data.data is not None, msg
|
||||||
|
|
||||||
|
response_type = response_types_map.get(str(response_data.status), None)
|
||||||
|
if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599:
|
||||||
|
# if not found, look for '1XX', '2XX', etc.
|
||||||
|
response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)
|
||||||
|
|
||||||
|
# deserialize response data
|
||||||
|
response_text = None
|
||||||
|
return_data = None
|
||||||
|
try:
|
||||||
|
if response_type == "bytearray":
|
||||||
|
return_data = response_data.data
|
||||||
|
elif response_type == "file":
|
||||||
|
return_data = self.__deserialize_file(response_data)
|
||||||
|
elif response_type is not None:
|
||||||
|
match = None
|
||||||
|
content_type = response_data.getheader('content-type')
|
||||||
|
if content_type is not None:
|
||||||
|
match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
|
||||||
|
encoding = match.group(1) if match else "utf-8"
|
||||||
|
response_text = response_data.data.decode(encoding)
|
||||||
|
if response_type in ["bytearray", "str"]:
|
||||||
|
return_data = self.__deserialize_primitive(response_text, response_type)
|
||||||
|
else:
|
||||||
|
return_data = self.deserialize(response_text, response_type)
|
||||||
|
finally:
|
||||||
|
if not 200 <= response_data.status <= 299:
|
||||||
|
raise ApiException.from_response(
|
||||||
|
http_resp=response_data,
|
||||||
|
body=response_text,
|
||||||
|
data=return_data,
|
||||||
|
)
|
||||||
|
|
||||||
|
return ApiResponse(
|
||||||
|
status_code = response_data.status,
|
||||||
|
data = return_data,
|
||||||
|
headers = response_data.getheaders(),
|
||||||
|
raw_data = response_data.data
|
||||||
|
)
|
||||||
|
|
||||||
|
def sanitize_for_serialization(self, obj):
|
||||||
|
"""Builds a JSON POST object.
|
||||||
|
|
||||||
|
If obj is None, return None.
|
||||||
|
If obj is SecretStr, return obj.get_secret_value()
|
||||||
|
If obj is str, int, long, float, bool, return directly.
|
||||||
|
If obj is datetime.datetime, datetime.date
|
||||||
|
convert to string in iso8601 format.
|
||||||
|
If obj is list, sanitize each element in the list.
|
||||||
|
If obj is dict, return the dict.
|
||||||
|
If obj is OpenAPI model, return the properties dict.
|
||||||
|
|
||||||
|
:param obj: The data to serialize.
|
||||||
|
:return: The serialized form of data.
|
||||||
|
"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
elif isinstance(obj, Enum):
|
||||||
|
return obj.value
|
||||||
|
elif isinstance(obj, SecretStr):
|
||||||
|
return obj.get_secret_value()
|
||||||
|
elif isinstance(obj, self.PRIMITIVE_TYPES):
|
||||||
|
return obj
|
||||||
|
elif isinstance(obj, list):
|
||||||
|
return [
|
||||||
|
self.sanitize_for_serialization(sub_obj) for sub_obj in obj
|
||||||
|
]
|
||||||
|
elif isinstance(obj, tuple):
|
||||||
|
return tuple(
|
||||||
|
self.sanitize_for_serialization(sub_obj) for sub_obj in obj
|
||||||
|
)
|
||||||
|
elif isinstance(obj, (datetime.datetime, datetime.date)):
|
||||||
|
return obj.isoformat()
|
||||||
|
|
||||||
|
elif isinstance(obj, dict):
|
||||||
|
obj_dict = obj
|
||||||
|
else:
|
||||||
|
# Convert model obj to dict except
|
||||||
|
# attributes `openapi_types`, `attribute_map`
|
||||||
|
# and attributes which value is not None.
|
||||||
|
# Convert attribute name to json key in
|
||||||
|
# model definition for request.
|
||||||
|
if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')):
|
||||||
|
obj_dict = obj.to_dict()
|
||||||
|
else:
|
||||||
|
obj_dict = obj.__dict__
|
||||||
|
|
||||||
|
return {
|
||||||
|
key: self.sanitize_for_serialization(val)
|
||||||
|
for key, val in obj_dict.items()
|
||||||
|
}
|
||||||
|
|
||||||
|
def deserialize(self, response_text, response_type):
|
||||||
|
"""Deserializes response into an object.
|
||||||
|
|
||||||
|
:param response: RESTResponse object to be deserialized.
|
||||||
|
:param response_type: class literal for
|
||||||
|
deserialized object, or string of class name.
|
||||||
|
|
||||||
|
:return: deserialized object.
|
||||||
|
"""
|
||||||
|
|
||||||
|
# fetch data from response object
|
||||||
|
try:
|
||||||
|
data = json.loads(response_text)
|
||||||
|
except ValueError:
|
||||||
|
data = response_text
|
||||||
|
|
||||||
|
return self.__deserialize(data, response_type)
|
||||||
|
|
||||||
|
def __deserialize(self, data, klass):
|
||||||
|
"""Deserializes dict, list, str into an object.
|
||||||
|
|
||||||
|
:param data: dict, list or str.
|
||||||
|
:param klass: class literal, or string of class name.
|
||||||
|
|
||||||
|
:return: object.
|
||||||
|
"""
|
||||||
|
if data is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if isinstance(klass, str):
|
||||||
|
if klass.startswith('List['):
|
||||||
|
m = re.match(r'List\[(.*)]', klass)
|
||||||
|
assert m is not None, "Malformed List type definition"
|
||||||
|
sub_kls = m.group(1)
|
||||||
|
return [self.__deserialize(sub_data, sub_kls)
|
||||||
|
for sub_data in data]
|
||||||
|
|
||||||
|
if klass.startswith('Dict['):
|
||||||
|
m = re.match(r'Dict\[([^,]*), (.*)]', klass)
|
||||||
|
assert m is not None, "Malformed Dict type definition"
|
||||||
|
sub_kls = m.group(2)
|
||||||
|
return {k: self.__deserialize(v, sub_kls)
|
||||||
|
for k, v in data.items()}
|
||||||
|
|
||||||
|
# convert str to class
|
||||||
|
if klass in self.NATIVE_TYPES_MAPPING:
|
||||||
|
klass = self.NATIVE_TYPES_MAPPING[klass]
|
||||||
|
else:
|
||||||
|
klass = getattr(admin.models, klass)
|
||||||
|
|
||||||
|
if klass in self.PRIMITIVE_TYPES:
|
||||||
|
return self.__deserialize_primitive(data, klass)
|
||||||
|
elif klass == object:
|
||||||
|
return self.__deserialize_object(data)
|
||||||
|
elif klass == datetime.date:
|
||||||
|
return self.__deserialize_date(data)
|
||||||
|
elif klass == datetime.datetime:
|
||||||
|
return self.__deserialize_datetime(data)
|
||||||
|
elif issubclass(klass, Enum):
|
||||||
|
return self.__deserialize_enum(data, klass)
|
||||||
|
else:
|
||||||
|
return self.__deserialize_model(data, klass)
|
||||||
|
|
||||||
|
def parameters_to_tuples(self, params, collection_formats):
|
||||||
|
"""Get parameters as list of tuples, formatting collections.
|
||||||
|
|
||||||
|
:param params: Parameters as dict or list of two-tuples
|
||||||
|
:param dict collection_formats: Parameter collection formats
|
||||||
|
:return: Parameters as list of tuples, collections formatted
|
||||||
|
"""
|
||||||
|
new_params: List[Tuple[str, str]] = []
|
||||||
|
if collection_formats is None:
|
||||||
|
collection_formats = {}
|
||||||
|
for k, v in params.items() if isinstance(params, dict) else params:
|
||||||
|
if k in collection_formats:
|
||||||
|
collection_format = collection_formats[k]
|
||||||
|
if collection_format == 'multi':
|
||||||
|
new_params.extend((k, value) for value in v)
|
||||||
|
else:
|
||||||
|
if collection_format == 'ssv':
|
||||||
|
delimiter = ' '
|
||||||
|
elif collection_format == 'tsv':
|
||||||
|
delimiter = '\t'
|
||||||
|
elif collection_format == 'pipes':
|
||||||
|
delimiter = '|'
|
||||||
|
else: # csv is the default
|
||||||
|
delimiter = ','
|
||||||
|
new_params.append(
|
||||||
|
(k, delimiter.join(str(value) for value in v)))
|
||||||
|
else:
|
||||||
|
new_params.append((k, v))
|
||||||
|
return new_params
|
||||||
|
|
||||||
|
def parameters_to_url_query(self, params, collection_formats):
|
||||||
|
"""Get parameters as list of tuples, formatting collections.
|
||||||
|
|
||||||
|
:param params: Parameters as dict or list of two-tuples
|
||||||
|
:param dict collection_formats: Parameter collection formats
|
||||||
|
:return: URL query string (e.g. a=Hello%20World&b=123)
|
||||||
|
"""
|
||||||
|
new_params: List[Tuple[str, str]] = []
|
||||||
|
if collection_formats is None:
|
||||||
|
collection_formats = {}
|
||||||
|
for k, v in params.items() if isinstance(params, dict) else params:
|
||||||
|
if isinstance(v, bool):
|
||||||
|
v = str(v).lower()
|
||||||
|
if isinstance(v, (int, float)):
|
||||||
|
v = str(v)
|
||||||
|
if isinstance(v, dict):
|
||||||
|
v = json.dumps(v)
|
||||||
|
|
||||||
|
if k in collection_formats:
|
||||||
|
collection_format = collection_formats[k]
|
||||||
|
if collection_format == 'multi':
|
||||||
|
new_params.extend((k, str(value)) for value in v)
|
||||||
|
else:
|
||||||
|
if collection_format == 'ssv':
|
||||||
|
delimiter = ' '
|
||||||
|
elif collection_format == 'tsv':
|
||||||
|
delimiter = '\t'
|
||||||
|
elif collection_format == 'pipes':
|
||||||
|
delimiter = '|'
|
||||||
|
else: # csv is the default
|
||||||
|
delimiter = ','
|
||||||
|
new_params.append(
|
||||||
|
(k, delimiter.join(quote(str(value)) for value in v))
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
new_params.append((k, quote(str(v))))
|
||||||
|
|
||||||
|
return "&".join(["=".join(map(str, item)) for item in new_params])
|
||||||
|
|
||||||
|
def files_parameters(self, files: Dict[str, Union[str, bytes]]):
|
||||||
|
"""Builds form parameters.
|
||||||
|
|
||||||
|
:param files: File parameters.
|
||||||
|
:return: Form parameters with files.
|
||||||
|
"""
|
||||||
|
params = []
|
||||||
|
for k, v in files.items():
|
||||||
|
if isinstance(v, str):
|
||||||
|
with open(v, 'rb') as f:
|
||||||
|
filename = os.path.basename(f.name)
|
||||||
|
filedata = f.read()
|
||||||
|
elif isinstance(v, bytes):
|
||||||
|
filename = k
|
||||||
|
filedata = v
|
||||||
|
else:
|
||||||
|
raise ValueError("Unsupported file value")
|
||||||
|
mimetype = (
|
||||||
|
mimetypes.guess_type(filename)[0]
|
||||||
|
or 'application/octet-stream'
|
||||||
|
)
|
||||||
|
params.append(
|
||||||
|
tuple([k, tuple([filename, filedata, mimetype])])
|
||||||
|
)
|
||||||
|
return params
|
||||||
|
|
||||||
|
def select_header_accept(self, accepts: List[str]) -> Optional[str]:
|
||||||
|
"""Returns `Accept` based on an array of accepts provided.
|
||||||
|
|
||||||
|
:param accepts: List of headers.
|
||||||
|
:return: Accept (e.g. application/json).
|
||||||
|
"""
|
||||||
|
if not accepts:
|
||||||
|
return None
|
||||||
|
|
||||||
|
for accept in accepts:
|
||||||
|
if re.search('json', accept, re.IGNORECASE):
|
||||||
|
return accept
|
||||||
|
|
||||||
|
return accepts[0]
|
||||||
|
|
||||||
|
def select_header_content_type(self, content_types):
|
||||||
|
"""Returns `Content-Type` based on an array of content_types provided.
|
||||||
|
|
||||||
|
:param content_types: List of content-types.
|
||||||
|
:return: Content-Type (e.g. application/json).
|
||||||
|
"""
|
||||||
|
if not content_types:
|
||||||
|
return None
|
||||||
|
|
||||||
|
for content_type in content_types:
|
||||||
|
if re.search('json', content_type, re.IGNORECASE):
|
||||||
|
return content_type
|
||||||
|
|
||||||
|
return content_types[0]
|
||||||
|
|
||||||
|
def update_params_for_auth(
|
||||||
|
self,
|
||||||
|
headers,
|
||||||
|
queries,
|
||||||
|
auth_settings,
|
||||||
|
resource_path,
|
||||||
|
method,
|
||||||
|
body,
|
||||||
|
request_auth=None
|
||||||
|
) -> None:
|
||||||
|
"""Updates header and query params based on authentication setting.
|
||||||
|
|
||||||
|
:param headers: Header parameters dict to be updated.
|
||||||
|
:param queries: Query parameters tuple list to be updated.
|
||||||
|
:param auth_settings: Authentication setting identifiers list.
|
||||||
|
:resource_path: A string representation of the HTTP request resource path.
|
||||||
|
:method: A string representation of the HTTP request method.
|
||||||
|
:body: A object representing the body of the HTTP request.
|
||||||
|
The object type is the return value of sanitize_for_serialization().
|
||||||
|
:param request_auth: if set, the provided settings will
|
||||||
|
override the token in the configuration.
|
||||||
|
"""
|
||||||
|
if not auth_settings:
|
||||||
|
return
|
||||||
|
|
||||||
|
if request_auth:
|
||||||
|
self._apply_auth_params(
|
||||||
|
headers,
|
||||||
|
queries,
|
||||||
|
resource_path,
|
||||||
|
method,
|
||||||
|
body,
|
||||||
|
request_auth
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
for auth in auth_settings:
|
||||||
|
auth_setting = self.configuration.auth_settings().get(auth)
|
||||||
|
if auth_setting:
|
||||||
|
self._apply_auth_params(
|
||||||
|
headers,
|
||||||
|
queries,
|
||||||
|
resource_path,
|
||||||
|
method,
|
||||||
|
body,
|
||||||
|
auth_setting
|
||||||
|
)
|
||||||
|
|
||||||
|
def _apply_auth_params(
|
||||||
|
self,
|
||||||
|
headers,
|
||||||
|
queries,
|
||||||
|
resource_path,
|
||||||
|
method,
|
||||||
|
body,
|
||||||
|
auth_setting
|
||||||
|
) -> None:
|
||||||
|
"""Updates the request parameters based on a single auth_setting
|
||||||
|
|
||||||
|
:param headers: Header parameters dict to be updated.
|
||||||
|
:param queries: Query parameters tuple list to be updated.
|
||||||
|
:resource_path: A string representation of the HTTP request resource path.
|
||||||
|
:method: A string representation of the HTTP request method.
|
||||||
|
:body: A object representing the body of the HTTP request.
|
||||||
|
The object type is the return value of sanitize_for_serialization().
|
||||||
|
:param auth_setting: auth settings for the endpoint
|
||||||
|
"""
|
||||||
|
if auth_setting['in'] == 'cookie':
|
||||||
|
headers['Cookie'] = auth_setting['value']
|
||||||
|
elif auth_setting['in'] == 'header':
|
||||||
|
if auth_setting['type'] != 'http-signature':
|
||||||
|
headers[auth_setting['key']] = auth_setting['value']
|
||||||
|
elif auth_setting['in'] == 'query':
|
||||||
|
queries.append((auth_setting['key'], auth_setting['value']))
|
||||||
|
else:
|
||||||
|
raise ApiValueError(
|
||||||
|
'Authentication token must be in `query` or `header`'
|
||||||
|
)
|
||||||
|
|
||||||
|
def __deserialize_file(self, response):
|
||||||
|
"""Deserializes body to file
|
||||||
|
|
||||||
|
Saves response body into a file in a temporary folder,
|
||||||
|
using the filename from the `Content-Disposition` header if provided.
|
||||||
|
|
||||||
|
handle file downloading
|
||||||
|
save response body into a tmp file and return the instance
|
||||||
|
|
||||||
|
:param response: RESTResponse.
|
||||||
|
:return: file path.
|
||||||
|
"""
|
||||||
|
fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path)
|
||||||
|
os.close(fd)
|
||||||
|
os.remove(path)
|
||||||
|
|
||||||
|
content_disposition = response.getheader("Content-Disposition")
|
||||||
|
if content_disposition:
|
||||||
|
m = re.search(
|
||||||
|
r'filename=[\'"]?([^\'"\s]+)[\'"]?',
|
||||||
|
content_disposition
|
||||||
|
)
|
||||||
|
assert m is not None, "Unexpected 'content-disposition' header value"
|
||||||
|
filename = m.group(1)
|
||||||
|
path = os.path.join(os.path.dirname(path), filename)
|
||||||
|
|
||||||
|
with open(path, "wb") as f:
|
||||||
|
f.write(response.data)
|
||||||
|
|
||||||
|
return path
|
||||||
|
|
||||||
|
def __deserialize_primitive(self, data, klass):
|
||||||
|
"""Deserializes string to primitive type.
|
||||||
|
|
||||||
|
:param data: str.
|
||||||
|
:param klass: class literal.
|
||||||
|
|
||||||
|
:return: int, long, float, str, bool.
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
return klass(data)
|
||||||
|
except UnicodeEncodeError:
|
||||||
|
return str(data)
|
||||||
|
except TypeError:
|
||||||
|
return data
|
||||||
|
|
||||||
|
def __deserialize_object(self, value):
|
||||||
|
"""Return an original value.
|
||||||
|
|
||||||
|
:return: object.
|
||||||
|
"""
|
||||||
|
return value
|
||||||
|
|
||||||
|
def __deserialize_date(self, string):
|
||||||
|
"""Deserializes string to date.
|
||||||
|
|
||||||
|
:param string: str.
|
||||||
|
:return: date.
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
return parse(string).date()
|
||||||
|
except ImportError:
|
||||||
|
return string
|
||||||
|
except ValueError:
|
||||||
|
raise rest.ApiException(
|
||||||
|
status=0,
|
||||||
|
reason="Failed to parse `{0}` as date object".format(string)
|
||||||
|
)
|
||||||
|
|
||||||
|
def __deserialize_datetime(self, string):
|
||||||
|
"""Deserializes string to datetime.
|
||||||
|
|
||||||
|
The string should be in iso8601 datetime format.
|
||||||
|
|
||||||
|
:param string: str.
|
||||||
|
:return: datetime.
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
return parse(string)
|
||||||
|
except ImportError:
|
||||||
|
return string
|
||||||
|
except ValueError:
|
||||||
|
raise rest.ApiException(
|
||||||
|
status=0,
|
||||||
|
reason=(
|
||||||
|
"Failed to parse `{0}` as datetime object"
|
||||||
|
.format(string)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
def __deserialize_enum(self, data, klass):
|
||||||
|
"""Deserializes primitive type to enum.
|
||||||
|
|
||||||
|
:param data: primitive type.
|
||||||
|
:param klass: class literal.
|
||||||
|
:return: enum value.
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
return klass(data)
|
||||||
|
except ValueError:
|
||||||
|
raise rest.ApiException(
|
||||||
|
status=0,
|
||||||
|
reason=(
|
||||||
|
"Failed to parse `{0}` as `{1}`"
|
||||||
|
.format(data, klass)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
def __deserialize_model(self, data, klass):
|
||||||
|
"""Deserializes list or dict to model.
|
||||||
|
|
||||||
|
:param data: dict, list.
|
||||||
|
:param klass: class literal.
|
||||||
|
:return: model object.
|
||||||
|
"""
|
||||||
|
|
||||||
|
return klass.from_dict(data)
|
||||||
21
admin/admin/api_response.py
Normal file
21
admin/admin/api_response.py
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
"""API response object."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from typing import Optional, Generic, Mapping, TypeVar
|
||||||
|
from pydantic import Field, StrictInt, StrictBytes, BaseModel
|
||||||
|
|
||||||
|
T = TypeVar("T")
|
||||||
|
|
||||||
|
class ApiResponse(BaseModel, Generic[T]):
|
||||||
|
"""
|
||||||
|
API response object
|
||||||
|
"""
|
||||||
|
|
||||||
|
status_code: StrictInt = Field(description="HTTP status code")
|
||||||
|
headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers")
|
||||||
|
data: T = Field(description="Deserialized data given the data type")
|
||||||
|
raw_data: StrictBytes = Field(description="Raw data (HTTP response body)")
|
||||||
|
|
||||||
|
model_config = {
|
||||||
|
"arbitrary_types_allowed": True
|
||||||
|
}
|
||||||
444
admin/admin/configuration.py
Normal file
444
admin/admin/configuration.py
Normal file
@ -0,0 +1,444 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
import copy
|
||||||
|
import logging
|
||||||
|
from logging import FileHandler
|
||||||
|
import multiprocessing
|
||||||
|
import sys
|
||||||
|
from typing import Optional
|
||||||
|
import urllib3
|
||||||
|
|
||||||
|
import http.client as httplib
|
||||||
|
|
||||||
|
JSON_SCHEMA_VALIDATION_KEYWORDS = {
|
||||||
|
'multipleOf', 'maximum', 'exclusiveMaximum',
|
||||||
|
'minimum', 'exclusiveMinimum', 'maxLength',
|
||||||
|
'minLength', 'pattern', 'maxItems', 'minItems'
|
||||||
|
}
|
||||||
|
|
||||||
|
class Configuration:
|
||||||
|
"""This class contains various settings of the API client.
|
||||||
|
|
||||||
|
:param host: Base url.
|
||||||
|
:param api_key: Dict to store API key(s).
|
||||||
|
Each entry in the dict specifies an API key.
|
||||||
|
The dict key is the name of the security scheme in the OAS specification.
|
||||||
|
The dict value is the API key secret.
|
||||||
|
:param api_key_prefix: Dict to store API prefix (e.g. Bearer).
|
||||||
|
The dict key is the name of the security scheme in the OAS specification.
|
||||||
|
The dict value is an API key prefix when generating the auth data.
|
||||||
|
:param username: Username for HTTP basic authentication.
|
||||||
|
:param password: Password for HTTP basic authentication.
|
||||||
|
:param access_token: Access token.
|
||||||
|
:param server_index: Index to servers configuration.
|
||||||
|
:param server_variables: Mapping with string values to replace variables in
|
||||||
|
templated server configuration. The validation of enums is performed for
|
||||||
|
variables with defined enum values before.
|
||||||
|
:param server_operation_index: Mapping from operation ID to an index to server
|
||||||
|
configuration.
|
||||||
|
:param server_operation_variables: Mapping from operation ID to a mapping with
|
||||||
|
string values to replace variables in templated server configuration.
|
||||||
|
The validation of enums is performed for variables with defined enum
|
||||||
|
values before.
|
||||||
|
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
||||||
|
in PEM format.
|
||||||
|
|
||||||
|
:Example:
|
||||||
|
"""
|
||||||
|
|
||||||
|
_default = None
|
||||||
|
|
||||||
|
def __init__(self, host=None,
|
||||||
|
api_key=None, api_key_prefix=None,
|
||||||
|
username=None, password=None,
|
||||||
|
access_token=None,
|
||||||
|
server_index=None, server_variables=None,
|
||||||
|
server_operation_index=None, server_operation_variables=None,
|
||||||
|
ssl_ca_cert=None,
|
||||||
|
) -> None:
|
||||||
|
"""Constructor
|
||||||
|
"""
|
||||||
|
self._base_path = "https://api.thousandeyes.com" if host is None else host
|
||||||
|
"""Default Base url
|
||||||
|
"""
|
||||||
|
self.server_index = 0 if server_index is None and host is None else server_index
|
||||||
|
self.server_operation_index = server_operation_index or {}
|
||||||
|
"""Default server index
|
||||||
|
"""
|
||||||
|
self.server_variables = server_variables or {}
|
||||||
|
self.server_operation_variables = server_operation_variables or {}
|
||||||
|
"""Default server variables
|
||||||
|
"""
|
||||||
|
self.temp_folder_path = None
|
||||||
|
"""Temp file folder for downloading files
|
||||||
|
"""
|
||||||
|
# Authentication Settings
|
||||||
|
self.api_key = {}
|
||||||
|
if api_key:
|
||||||
|
self.api_key = api_key
|
||||||
|
"""dict to store API key(s)
|
||||||
|
"""
|
||||||
|
self.api_key_prefix = {}
|
||||||
|
if api_key_prefix:
|
||||||
|
self.api_key_prefix = api_key_prefix
|
||||||
|
"""dict to store API prefix (e.g. Bearer)
|
||||||
|
"""
|
||||||
|
self.refresh_api_key_hook = None
|
||||||
|
"""function hook to refresh API key if expired
|
||||||
|
"""
|
||||||
|
self.username = username
|
||||||
|
"""Username for HTTP basic authentication
|
||||||
|
"""
|
||||||
|
self.password = password
|
||||||
|
"""Password for HTTP basic authentication
|
||||||
|
"""
|
||||||
|
self.access_token = access_token
|
||||||
|
"""Access token
|
||||||
|
"""
|
||||||
|
self.logger = {}
|
||||||
|
"""Logging Settings
|
||||||
|
"""
|
||||||
|
self.logger["package_logger"] = logging.getLogger("admin")
|
||||||
|
self.logger["urllib3_logger"] = logging.getLogger("urllib3")
|
||||||
|
self.logger_format = '%(asctime)s %(levelname)s %(message)s'
|
||||||
|
"""Log format
|
||||||
|
"""
|
||||||
|
self.logger_stream_handler = None
|
||||||
|
"""Log stream handler
|
||||||
|
"""
|
||||||
|
self.logger_file_handler: Optional[FileHandler] = None
|
||||||
|
"""Log file handler
|
||||||
|
"""
|
||||||
|
self.logger_file = None
|
||||||
|
"""Debug file location
|
||||||
|
"""
|
||||||
|
self.debug = False
|
||||||
|
"""Debug switch
|
||||||
|
"""
|
||||||
|
|
||||||
|
self.verify_ssl = True
|
||||||
|
"""SSL/TLS verification
|
||||||
|
Set this to false to skip verifying SSL certificate when calling API
|
||||||
|
from https server.
|
||||||
|
"""
|
||||||
|
self.ssl_ca_cert = ssl_ca_cert
|
||||||
|
"""Set this to customize the certificate file to verify the peer.
|
||||||
|
"""
|
||||||
|
self.cert_file = None
|
||||||
|
"""client certificate file
|
||||||
|
"""
|
||||||
|
self.key_file = None
|
||||||
|
"""client key file
|
||||||
|
"""
|
||||||
|
self.assert_hostname = None
|
||||||
|
"""Set this to True/False to enable/disable SSL hostname verification.
|
||||||
|
"""
|
||||||
|
self.tls_server_name = None
|
||||||
|
"""SSL/TLS Server Name Indication (SNI)
|
||||||
|
Set this to the SNI value expected by the server.
|
||||||
|
"""
|
||||||
|
|
||||||
|
self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
|
||||||
|
"""urllib3 connection pool's maximum number of connections saved
|
||||||
|
per pool. urllib3 uses 1 connection as default value, but this is
|
||||||
|
not the best value when you are making a lot of possibly parallel
|
||||||
|
requests to the same host, which is often the case here.
|
||||||
|
cpu_count * 5 is used as default value to increase performance.
|
||||||
|
"""
|
||||||
|
|
||||||
|
self.proxy: Optional[str] = None
|
||||||
|
"""Proxy URL
|
||||||
|
"""
|
||||||
|
self.proxy_headers = None
|
||||||
|
"""Proxy headers
|
||||||
|
"""
|
||||||
|
self.safe_chars_for_path_param = ''
|
||||||
|
"""Safe chars for path_param
|
||||||
|
"""
|
||||||
|
self.retries = None
|
||||||
|
"""Adding retries to override urllib3 default value 3
|
||||||
|
"""
|
||||||
|
# Enable client side validation
|
||||||
|
self.client_side_validation = True
|
||||||
|
|
||||||
|
self.socket_options = None
|
||||||
|
"""Options to pass down to the underlying urllib3 socket
|
||||||
|
"""
|
||||||
|
|
||||||
|
self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z"
|
||||||
|
"""datetime format
|
||||||
|
"""
|
||||||
|
|
||||||
|
self.date_format = "%Y-%m-%d"
|
||||||
|
"""date format
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __deepcopy__(self, memo):
|
||||||
|
cls = self.__class__
|
||||||
|
result = cls.__new__(cls)
|
||||||
|
memo[id(self)] = result
|
||||||
|
for k, v in self.__dict__.items():
|
||||||
|
if k not in ('logger', 'logger_file_handler'):
|
||||||
|
setattr(result, k, copy.deepcopy(v, memo))
|
||||||
|
# shallow copy of loggers
|
||||||
|
result.logger = copy.copy(self.logger)
|
||||||
|
# use setters to configure loggers
|
||||||
|
result.logger_file = self.logger_file
|
||||||
|
result.debug = self.debug
|
||||||
|
return result
|
||||||
|
|
||||||
|
def __setattr__(self, name, value):
|
||||||
|
object.__setattr__(self, name, value)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def set_default(cls, default):
|
||||||
|
"""Set default instance of configuration.
|
||||||
|
|
||||||
|
It stores default configuration, which can be
|
||||||
|
returned by get_default_copy method.
|
||||||
|
|
||||||
|
:param default: object of Configuration
|
||||||
|
"""
|
||||||
|
cls._default = default
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def get_default_copy(cls):
|
||||||
|
"""Deprecated. Please use `get_default` instead.
|
||||||
|
|
||||||
|
Deprecated. Please use `get_default` instead.
|
||||||
|
|
||||||
|
:return: The configuration object.
|
||||||
|
"""
|
||||||
|
return cls.get_default()
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def get_default(cls):
|
||||||
|
"""Return the default configuration.
|
||||||
|
|
||||||
|
This method returns newly created, based on default constructor,
|
||||||
|
object of Configuration class or returns a copy of default
|
||||||
|
configuration.
|
||||||
|
|
||||||
|
:return: The configuration object.
|
||||||
|
"""
|
||||||
|
if cls._default is None:
|
||||||
|
cls._default = Configuration()
|
||||||
|
return cls._default
|
||||||
|
|
||||||
|
@property
|
||||||
|
def logger_file(self):
|
||||||
|
"""The logger file.
|
||||||
|
|
||||||
|
If the logger_file is None, then add stream handler and remove file
|
||||||
|
handler. Otherwise, add file handler and remove stream handler.
|
||||||
|
|
||||||
|
:param value: The logger_file path.
|
||||||
|
:type: str
|
||||||
|
"""
|
||||||
|
return self.__logger_file
|
||||||
|
|
||||||
|
@logger_file.setter
|
||||||
|
def logger_file(self, value):
|
||||||
|
"""The logger file.
|
||||||
|
|
||||||
|
If the logger_file is None, then add stream handler and remove file
|
||||||
|
handler. Otherwise, add file handler and remove stream handler.
|
||||||
|
|
||||||
|
:param value: The logger_file path.
|
||||||
|
:type: str
|
||||||
|
"""
|
||||||
|
self.__logger_file = value
|
||||||
|
if self.__logger_file:
|
||||||
|
# If set logging file,
|
||||||
|
# then add file handler and remove stream handler.
|
||||||
|
self.logger_file_handler = logging.FileHandler(self.__logger_file)
|
||||||
|
self.logger_file_handler.setFormatter(self.logger_formatter)
|
||||||
|
for _, logger in self.logger.items():
|
||||||
|
logger.addHandler(self.logger_file_handler)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def debug(self):
|
||||||
|
"""Debug status
|
||||||
|
|
||||||
|
:param value: The debug status, True or False.
|
||||||
|
:type: bool
|
||||||
|
"""
|
||||||
|
return self.__debug
|
||||||
|
|
||||||
|
@debug.setter
|
||||||
|
def debug(self, value):
|
||||||
|
"""Debug status
|
||||||
|
|
||||||
|
:param value: The debug status, True or False.
|
||||||
|
:type: bool
|
||||||
|
"""
|
||||||
|
self.__debug = value
|
||||||
|
if self.__debug:
|
||||||
|
# if debug status is True, turn on debug logging
|
||||||
|
for _, logger in self.logger.items():
|
||||||
|
logger.setLevel(logging.DEBUG)
|
||||||
|
# turn on httplib debug
|
||||||
|
httplib.HTTPConnection.debuglevel = 1
|
||||||
|
else:
|
||||||
|
# if debug status is False, turn off debug logging,
|
||||||
|
# setting log level to default `logging.WARNING`
|
||||||
|
for _, logger in self.logger.items():
|
||||||
|
logger.setLevel(logging.WARNING)
|
||||||
|
# turn off httplib debug
|
||||||
|
httplib.HTTPConnection.debuglevel = 0
|
||||||
|
|
||||||
|
@property
|
||||||
|
def logger_format(self):
|
||||||
|
"""The logger format.
|
||||||
|
|
||||||
|
The logger_formatter will be updated when sets logger_format.
|
||||||
|
|
||||||
|
:param value: The format string.
|
||||||
|
:type: str
|
||||||
|
"""
|
||||||
|
return self.__logger_format
|
||||||
|
|
||||||
|
@logger_format.setter
|
||||||
|
def logger_format(self, value):
|
||||||
|
"""The logger format.
|
||||||
|
|
||||||
|
The logger_formatter will be updated when sets logger_format.
|
||||||
|
|
||||||
|
:param value: The format string.
|
||||||
|
:type: str
|
||||||
|
"""
|
||||||
|
self.__logger_format = value
|
||||||
|
self.logger_formatter = logging.Formatter(self.__logger_format)
|
||||||
|
|
||||||
|
def get_api_key_with_prefix(self, identifier, alias=None):
|
||||||
|
"""Gets API key (with prefix if set).
|
||||||
|
|
||||||
|
:param identifier: The identifier of apiKey.
|
||||||
|
:param alias: The alternative identifier of apiKey.
|
||||||
|
:return: The token for api key authentication.
|
||||||
|
"""
|
||||||
|
if self.refresh_api_key_hook is not None:
|
||||||
|
self.refresh_api_key_hook(self)
|
||||||
|
key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None)
|
||||||
|
if key:
|
||||||
|
prefix = self.api_key_prefix.get(identifier)
|
||||||
|
if prefix:
|
||||||
|
return "%s %s" % (prefix, key)
|
||||||
|
else:
|
||||||
|
return key
|
||||||
|
|
||||||
|
def get_basic_auth_token(self):
|
||||||
|
"""Gets HTTP basic authentication header (string).
|
||||||
|
|
||||||
|
:return: The token for basic HTTP authentication.
|
||||||
|
"""
|
||||||
|
username = ""
|
||||||
|
if self.username is not None:
|
||||||
|
username = self.username
|
||||||
|
password = ""
|
||||||
|
if self.password is not None:
|
||||||
|
password = self.password
|
||||||
|
return urllib3.util.make_headers(
|
||||||
|
basic_auth=username + ':' + password
|
||||||
|
).get('authorization')
|
||||||
|
|
||||||
|
def auth_settings(self):
|
||||||
|
"""Gets Auth Settings dict for api client.
|
||||||
|
|
||||||
|
:return: The Auth Settings information dict.
|
||||||
|
"""
|
||||||
|
auth = {}
|
||||||
|
if self.access_token is not None:
|
||||||
|
auth['BearerAuth'] = {
|
||||||
|
'type': 'bearer',
|
||||||
|
'in': 'header',
|
||||||
|
'key': 'Authorization',
|
||||||
|
'value': 'Bearer ' + self.access_token
|
||||||
|
}
|
||||||
|
return auth
|
||||||
|
|
||||||
|
def to_debug_report(self):
|
||||||
|
"""Gets the essential information for debugging.
|
||||||
|
|
||||||
|
:return: The report for debugging.
|
||||||
|
"""
|
||||||
|
return "Python SDK Debug Report:\n"\
|
||||||
|
"OS: {env}\n"\
|
||||||
|
"Python Version: {pyversion}\n"\
|
||||||
|
"Version of the API: 7.0.2\n"\
|
||||||
|
"SDK Package Version: 1.0.0".\
|
||||||
|
format(env=sys.platform, pyversion=sys.version)
|
||||||
|
|
||||||
|
def get_host_settings(self):
|
||||||
|
"""Gets an array of host settings
|
||||||
|
|
||||||
|
:return: An array of host settings
|
||||||
|
"""
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
'url': "https://api.thousandeyes.com",
|
||||||
|
'description': "ThousandEyes API production URL",
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
def get_host_from_settings(self, index, variables=None, servers=None):
|
||||||
|
"""Gets host URL based on the index and variables
|
||||||
|
:param index: array index of the host settings
|
||||||
|
:param variables: hash of variable and the corresponding value
|
||||||
|
:param servers: an array of host settings or None
|
||||||
|
:return: URL based on host settings
|
||||||
|
"""
|
||||||
|
if index is None:
|
||||||
|
return self._base_path
|
||||||
|
|
||||||
|
variables = {} if variables is None else variables
|
||||||
|
servers = self.get_host_settings() if servers is None else servers
|
||||||
|
|
||||||
|
try:
|
||||||
|
server = servers[index]
|
||||||
|
except IndexError:
|
||||||
|
raise ValueError(
|
||||||
|
"Invalid index {0} when selecting the host settings. "
|
||||||
|
"Must be less than {1}".format(index, len(servers)))
|
||||||
|
|
||||||
|
url = server['url']
|
||||||
|
|
||||||
|
# go through variables and replace placeholders
|
||||||
|
for variable_name, variable in server.get('variables', {}).items():
|
||||||
|
used_value = variables.get(
|
||||||
|
variable_name, variable['default_value'])
|
||||||
|
|
||||||
|
if 'enum_values' in variable \
|
||||||
|
and used_value not in variable['enum_values']:
|
||||||
|
raise ValueError(
|
||||||
|
"The variable `{0}` in the host URL has invalid value "
|
||||||
|
"{1}. Must be {2}.".format(
|
||||||
|
variable_name, variables[variable_name],
|
||||||
|
variable['enum_values']))
|
||||||
|
|
||||||
|
url = url.replace("{" + variable_name + "}", used_value)
|
||||||
|
|
||||||
|
return url
|
||||||
|
|
||||||
|
@property
|
||||||
|
def host(self):
|
||||||
|
"""Return generated host."""
|
||||||
|
return self.get_host_from_settings(self.server_index, variables=self.server_variables)
|
||||||
|
|
||||||
|
@host.setter
|
||||||
|
def host(self, value):
|
||||||
|
"""Fix base path."""
|
||||||
|
self._base_path = value
|
||||||
|
self.server_index = None
|
||||||
199
admin/admin/exceptions.py
Normal file
199
admin/admin/exceptions.py
Normal file
@ -0,0 +1,199 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
from typing import Any, Optional
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class OpenApiException(Exception):
|
||||||
|
"""The base exception class for all OpenAPIExceptions"""
|
||||||
|
|
||||||
|
|
||||||
|
class ApiTypeError(OpenApiException, TypeError):
|
||||||
|
def __init__(self, msg, path_to_item=None, valid_classes=None,
|
||||||
|
key_type=None) -> None:
|
||||||
|
""" Raises an exception for TypeErrors
|
||||||
|
|
||||||
|
Args:
|
||||||
|
msg (str): the exception message
|
||||||
|
|
||||||
|
Keyword Args:
|
||||||
|
path_to_item (list): a list of keys an indices to get to the
|
||||||
|
current_item
|
||||||
|
None if unset
|
||||||
|
valid_classes (tuple): the primitive classes that current item
|
||||||
|
should be an instance of
|
||||||
|
None if unset
|
||||||
|
key_type (bool): False if our value is a value in a dict
|
||||||
|
True if it is a key in a dict
|
||||||
|
False if our item is an item in a list
|
||||||
|
None if unset
|
||||||
|
"""
|
||||||
|
self.path_to_item = path_to_item
|
||||||
|
self.valid_classes = valid_classes
|
||||||
|
self.key_type = key_type
|
||||||
|
full_msg = msg
|
||||||
|
if path_to_item:
|
||||||
|
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
||||||
|
super(ApiTypeError, self).__init__(full_msg)
|
||||||
|
|
||||||
|
|
||||||
|
class ApiValueError(OpenApiException, ValueError):
|
||||||
|
def __init__(self, msg, path_to_item=None) -> None:
|
||||||
|
"""
|
||||||
|
Args:
|
||||||
|
msg (str): the exception message
|
||||||
|
|
||||||
|
Keyword Args:
|
||||||
|
path_to_item (list) the path to the exception in the
|
||||||
|
received_data dict. None if unset
|
||||||
|
"""
|
||||||
|
|
||||||
|
self.path_to_item = path_to_item
|
||||||
|
full_msg = msg
|
||||||
|
if path_to_item:
|
||||||
|
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
||||||
|
super(ApiValueError, self).__init__(full_msg)
|
||||||
|
|
||||||
|
|
||||||
|
class ApiAttributeError(OpenApiException, AttributeError):
|
||||||
|
def __init__(self, msg, path_to_item=None) -> None:
|
||||||
|
"""
|
||||||
|
Raised when an attribute reference or assignment fails.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
msg (str): the exception message
|
||||||
|
|
||||||
|
Keyword Args:
|
||||||
|
path_to_item (None/list) the path to the exception in the
|
||||||
|
received_data dict
|
||||||
|
"""
|
||||||
|
self.path_to_item = path_to_item
|
||||||
|
full_msg = msg
|
||||||
|
if path_to_item:
|
||||||
|
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
||||||
|
super(ApiAttributeError, self).__init__(full_msg)
|
||||||
|
|
||||||
|
|
||||||
|
class ApiKeyError(OpenApiException, KeyError):
|
||||||
|
def __init__(self, msg, path_to_item=None) -> None:
|
||||||
|
"""
|
||||||
|
Args:
|
||||||
|
msg (str): the exception message
|
||||||
|
|
||||||
|
Keyword Args:
|
||||||
|
path_to_item (None/list) the path to the exception in the
|
||||||
|
received_data dict
|
||||||
|
"""
|
||||||
|
self.path_to_item = path_to_item
|
||||||
|
full_msg = msg
|
||||||
|
if path_to_item:
|
||||||
|
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
||||||
|
super(ApiKeyError, self).__init__(full_msg)
|
||||||
|
|
||||||
|
|
||||||
|
class ApiException(OpenApiException):
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
status=None,
|
||||||
|
reason=None,
|
||||||
|
http_resp=None,
|
||||||
|
*,
|
||||||
|
body: Optional[str] = None,
|
||||||
|
data: Optional[Any] = None,
|
||||||
|
) -> None:
|
||||||
|
self.status = status
|
||||||
|
self.reason = reason
|
||||||
|
self.body = body
|
||||||
|
self.data = data
|
||||||
|
self.headers = None
|
||||||
|
|
||||||
|
if http_resp:
|
||||||
|
if self.status is None:
|
||||||
|
self.status = http_resp.status
|
||||||
|
if self.reason is None:
|
||||||
|
self.reason = http_resp.reason
|
||||||
|
if self.body is None:
|
||||||
|
try:
|
||||||
|
self.body = http_resp.data.decode('utf-8')
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
self.headers = http_resp.getheaders()
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_response(
|
||||||
|
cls,
|
||||||
|
*,
|
||||||
|
http_resp,
|
||||||
|
body: Optional[str],
|
||||||
|
data: Optional[Any],
|
||||||
|
) -> Self:
|
||||||
|
if http_resp.status == 400:
|
||||||
|
raise BadRequestException(http_resp=http_resp, body=body, data=data)
|
||||||
|
|
||||||
|
if http_resp.status == 401:
|
||||||
|
raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
|
||||||
|
|
||||||
|
if http_resp.status == 403:
|
||||||
|
raise ForbiddenException(http_resp=http_resp, body=body, data=data)
|
||||||
|
|
||||||
|
if http_resp.status == 404:
|
||||||
|
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
||||||
|
|
||||||
|
if 500 <= http_resp.status <= 599:
|
||||||
|
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
||||||
|
raise ApiException(http_resp=http_resp, body=body, data=data)
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
"""Custom error messages for exception"""
|
||||||
|
error_message = "({0})\n"\
|
||||||
|
"Reason: {1}\n".format(self.status, self.reason)
|
||||||
|
if self.headers:
|
||||||
|
error_message += "HTTP response headers: {0}\n".format(
|
||||||
|
self.headers)
|
||||||
|
|
||||||
|
if self.data or self.body:
|
||||||
|
error_message += "HTTP response body: {0}\n".format(self.data or self.body)
|
||||||
|
|
||||||
|
return error_message
|
||||||
|
|
||||||
|
|
||||||
|
class BadRequestException(ApiException):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class NotFoundException(ApiException):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class UnauthorizedException(ApiException):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class ForbiddenException(ApiException):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class ServiceException(ApiException):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def render_path(path_to_item):
|
||||||
|
"""Returns a string representation of a path"""
|
||||||
|
result = ""
|
||||||
|
for pth in path_to_item:
|
||||||
|
if isinstance(pth, int):
|
||||||
|
result += "[{0}]".format(pth)
|
||||||
|
else:
|
||||||
|
result += "['{0}']".format(pth)
|
||||||
|
return result
|
||||||
80
admin/admin/models/__init__.py
Normal file
80
admin/admin/models/__init__.py
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
# flake8: noqa
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
# import models into model package
|
||||||
|
from admin.models.account_group import AccountGroup
|
||||||
|
from admin.models.account_group1 import AccountGroup1
|
||||||
|
from admin.models.account_group_detail import AccountGroupDetail
|
||||||
|
from admin.models.account_group_id import AccountGroupId
|
||||||
|
from admin.models.account_group_request_body import AccountGroupRequestBody
|
||||||
|
from admin.models.account_group_roles import AccountGroupRoles
|
||||||
|
from admin.models.account_group_roles_account_group_roles_inner import AccountGroupRolesAccountGroupRolesInner
|
||||||
|
from admin.models.account_group_roles_request_body_inner import AccountGroupRolesRequestBodyInner
|
||||||
|
from admin.models.account_groups import AccountGroups
|
||||||
|
from admin.models.agent import Agent
|
||||||
|
from admin.models.agent_base import AgentBase
|
||||||
|
from admin.models.all_account_group_roles import AllAccountGroupRoles
|
||||||
|
from admin.models.base_role import BaseRole
|
||||||
|
from admin.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType
|
||||||
|
from admin.models.cluster_member import ClusterMember
|
||||||
|
from admin.models.create_account_group201_response import CreateAccountGroup201Response
|
||||||
|
from admin.models.create_role201_response import CreateRole201Response
|
||||||
|
from admin.models.create_user201_response import CreateUser201Response
|
||||||
|
from admin.models.created_user import CreatedUser
|
||||||
|
from admin.models.enterprise_agent import EnterpriseAgent
|
||||||
|
from admin.models.enterprise_agent_data import EnterpriseAgentData
|
||||||
|
from admin.models.enterprise_agent_ipv6_policy import EnterpriseAgentIpv6Policy
|
||||||
|
from admin.models.enterprise_agent_state import EnterpriseAgentState
|
||||||
|
from admin.models.enterprise_agents import EnterpriseAgents
|
||||||
|
from admin.models.error import Error
|
||||||
|
from admin.models.error_detail import ErrorDetail
|
||||||
|
from admin.models.error_detail_code import ErrorDetailCode
|
||||||
|
from admin.models.expand import Expand
|
||||||
|
from admin.models.extended_user import ExtendedUser
|
||||||
|
from admin.models.get_account_group200_response import GetAccountGroup200Response
|
||||||
|
from admin.models.get_account_groups200_response import GetAccountGroups200Response
|
||||||
|
from admin.models.get_permissions200_response import GetPermissions200Response
|
||||||
|
from admin.models.get_roles200_response import GetRoles200Response
|
||||||
|
from admin.models.get_user200_response import GetUser200Response
|
||||||
|
from admin.models.get_user_events200_response import GetUserEvents200Response
|
||||||
|
from admin.models.get_users200_response import GetUsers200Response
|
||||||
|
from admin.models.interface_ip_mapping import InterfaceIpMapping
|
||||||
|
from admin.models.link import Link
|
||||||
|
from admin.models.login_account_group import LoginAccountGroup
|
||||||
|
from admin.models.new_account_group_response import NewAccountGroupResponse
|
||||||
|
from admin.models.pagination_links import PaginationLinks
|
||||||
|
from admin.models.pagination_links_links import PaginationLinksLinks
|
||||||
|
from admin.models.permission import Permission
|
||||||
|
from admin.models.permissions import Permissions
|
||||||
|
from admin.models.query_window import QueryWindow
|
||||||
|
from admin.models.role import Role
|
||||||
|
from admin.models.role_detail import RoleDetail
|
||||||
|
from admin.models.role_request_body import RoleRequestBody
|
||||||
|
from admin.models.roles import Roles
|
||||||
|
from admin.models.self_links import SelfLinks
|
||||||
|
from admin.models.self_links_links import SelfLinksLinks
|
||||||
|
from admin.models.simple_agent import SimpleAgent
|
||||||
|
from admin.models.unauthorized_error import UnauthorizedError
|
||||||
|
from admin.models.user import User
|
||||||
|
from admin.models.user_account_group import UserAccountGroup
|
||||||
|
from admin.models.user_account_groups import UserAccountGroups
|
||||||
|
from admin.models.user_detail import UserDetail
|
||||||
|
from admin.models.user_event import UserEvent
|
||||||
|
from admin.models.user_event_all_of_resources_inner import UserEventAllOfResourcesInner
|
||||||
|
from admin.models.user_events import UserEvents
|
||||||
|
from admin.models.user_request_body import UserRequestBody
|
||||||
|
from admin.models.users import Users
|
||||||
|
from admin.models.validation_error import ValidationError
|
||||||
|
from admin.models.validation_error_all_of_errors import ValidationErrorAllOfErrors
|
||||||
95
admin/admin/models/account_group.py
Normal file
95
admin/admin/models/account_group.py
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class AccountGroup(BaseModel):
|
||||||
|
"""
|
||||||
|
AccountGroup
|
||||||
|
""" # noqa: E501
|
||||||
|
aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.")
|
||||||
|
account_group_name: Optional[StrictStr] = Field(default=None, description="Account group name", alias="accountGroupName")
|
||||||
|
is_current_account_group: Optional[StrictBool] = Field(default=None, description="Indicates whether the requested aid is the context of the current account.", alias="isCurrentAccountGroup")
|
||||||
|
is_default_account_group: Optional[StrictBool] = Field(default=None, description="Indicates whether the aid is the default one for the requesting user.", alias="isDefaultAccountGroup")
|
||||||
|
organization_name: Optional[StrictStr] = Field(default=None, description="(Optional) Indicates whether the aid is the default one for the requesting user.", alias="organizationName")
|
||||||
|
__properties: ClassVar[List[str]] = ["aid", "accountGroupName", "isCurrentAccountGroup", "isDefaultAccountGroup", "organizationName"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of AccountGroup from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of AccountGroup from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"aid": obj.get("aid"),
|
||||||
|
"accountGroupName": obj.get("accountGroupName"),
|
||||||
|
"isCurrentAccountGroup": obj.get("isCurrentAccountGroup"),
|
||||||
|
"isDefaultAccountGroup": obj.get("isDefaultAccountGroup"),
|
||||||
|
"organizationName": obj.get("organizationName")
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
89
admin/admin/models/account_group1.py
Normal file
89
admin/admin/models/account_group1.py
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class AccountGroup1(BaseModel):
|
||||||
|
"""
|
||||||
|
AccountGroup1
|
||||||
|
""" # noqa: E501
|
||||||
|
aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.")
|
||||||
|
account_group_name: Optional[StrictStr] = Field(default=None, description="Account group name", alias="accountGroupName")
|
||||||
|
__properties: ClassVar[List[str]] = ["aid", "accountGroupName"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of AccountGroup1 from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of AccountGroup1 from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"aid": obj.get("aid"),
|
||||||
|
"accountGroupName": obj.get("accountGroupName")
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
115
admin/admin/models/account_group_detail.py
Normal file
115
admin/admin/models/account_group_detail.py
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.enterprise_agent import EnterpriseAgent
|
||||||
|
from admin.models.user_account_group import UserAccountGroup
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class AccountGroupDetail(BaseModel):
|
||||||
|
"""
|
||||||
|
AccountGroupDetail
|
||||||
|
""" # noqa: E501
|
||||||
|
aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.")
|
||||||
|
account_group_name: Optional[StrictStr] = Field(default=None, description="Account group name", alias="accountGroupName")
|
||||||
|
is_current_account_group: Optional[StrictBool] = Field(default=None, description="Indicates whether the requested aid is the context of the current account.", alias="isCurrentAccountGroup")
|
||||||
|
is_default_account_group: Optional[StrictBool] = Field(default=None, description="Indicates whether the aid is the default one for the requesting user.", alias="isDefaultAccountGroup")
|
||||||
|
organization_name: Optional[StrictStr] = Field(default=None, description="(Optional) Indicates whether the aid is the default one for the requesting user.", alias="organizationName")
|
||||||
|
users: Optional[List[UserAccountGroup]] = None
|
||||||
|
agents: Optional[List[EnterpriseAgent]] = None
|
||||||
|
__properties: ClassVar[List[str]] = ["aid", "accountGroupName", "isCurrentAccountGroup", "isDefaultAccountGroup", "organizationName", "users", "agents"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of AccountGroupDetail from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in users (list)
|
||||||
|
_items = []
|
||||||
|
if self.users:
|
||||||
|
for _item in self.users:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['users'] = _items
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in agents (list)
|
||||||
|
_items = []
|
||||||
|
if self.agents:
|
||||||
|
for _item in self.agents:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['agents'] = _items
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of AccountGroupDetail from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"aid": obj.get("aid"),
|
||||||
|
"accountGroupName": obj.get("accountGroupName"),
|
||||||
|
"isCurrentAccountGroup": obj.get("isCurrentAccountGroup"),
|
||||||
|
"isDefaultAccountGroup": obj.get("isDefaultAccountGroup"),
|
||||||
|
"organizationName": obj.get("organizationName"),
|
||||||
|
"users": [UserAccountGroup.from_dict(_item) for _item in obj["users"]] if obj.get("users") is not None else None,
|
||||||
|
"agents": [EnterpriseAgent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
87
admin/admin/models/account_group_id.py
Normal file
87
admin/admin/models/account_group_id.py
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class AccountGroupId(BaseModel):
|
||||||
|
"""
|
||||||
|
AccountGroupId
|
||||||
|
""" # noqa: E501
|
||||||
|
aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.")
|
||||||
|
__properties: ClassVar[List[str]] = ["aid"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of AccountGroupId from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of AccountGroupId from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"aid": obj.get("aid")
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
89
admin/admin/models/account_group_request_body.py
Normal file
89
admin/admin/models/account_group_request_body.py
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class AccountGroupRequestBody(BaseModel):
|
||||||
|
"""
|
||||||
|
AccountGroupRequestBody
|
||||||
|
""" # noqa: E501
|
||||||
|
account_group_name: StrictStr = Field(description="The name of the account group", alias="accountGroupName")
|
||||||
|
agents: Optional[List[StrictStr]] = Field(default=None, description="To grant access to enterprise agents, specify the agent list. Note that this is not an additive list - the full list must be specified if changing access to agents.")
|
||||||
|
__properties: ClassVar[List[str]] = ["accountGroupName", "agents"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of AccountGroupRequestBody from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of AccountGroupRequestBody from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"accountGroupName": obj.get("accountGroupName"),
|
||||||
|
"agents": obj.get("agents")
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
95
admin/admin/models/account_group_roles.py
Normal file
95
admin/admin/models/account_group_roles.py
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.account_group_roles_account_group_roles_inner import AccountGroupRolesAccountGroupRolesInner
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class AccountGroupRoles(BaseModel):
|
||||||
|
"""
|
||||||
|
AccountGroupRoles
|
||||||
|
""" # noqa: E501
|
||||||
|
account_group_roles: Optional[List[AccountGroupRolesAccountGroupRolesInner]] = Field(default=None, alias="accountGroupRoles")
|
||||||
|
__properties: ClassVar[List[str]] = ["accountGroupRoles"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of AccountGroupRoles from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in account_group_roles (list)
|
||||||
|
_items = []
|
||||||
|
if self.account_group_roles:
|
||||||
|
for _item in self.account_group_roles:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['accountGroupRoles'] = _items
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of AccountGroupRoles from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"accountGroupRoles": [AccountGroupRolesAccountGroupRolesInner.from_dict(_item) for _item in obj["accountGroupRoles"]] if obj.get("accountGroupRoles") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
@ -0,0 +1,101 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.account_group1 import AccountGroup1
|
||||||
|
from admin.models.role import Role
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class AccountGroupRolesAccountGroupRolesInner(BaseModel):
|
||||||
|
"""
|
||||||
|
AccountGroupRolesAccountGroupRolesInner
|
||||||
|
""" # noqa: E501
|
||||||
|
account_group: Optional[AccountGroup1] = Field(default=None, alias="accountGroup")
|
||||||
|
roles: Optional[List[Role]] = None
|
||||||
|
__properties: ClassVar[List[str]] = ["accountGroup", "roles"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of AccountGroupRolesAccountGroupRolesInner from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of account_group
|
||||||
|
if self.account_group:
|
||||||
|
_dict['accountGroup'] = self.account_group.to_dict()
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in roles (list)
|
||||||
|
_items = []
|
||||||
|
if self.roles:
|
||||||
|
for _item in self.roles:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['roles'] = _items
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of AccountGroupRolesAccountGroupRolesInner from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"accountGroup": AccountGroup1.from_dict(obj["accountGroup"]) if obj.get("accountGroup") is not None else None,
|
||||||
|
"roles": [Role.from_dict(_item) for _item in obj["roles"]] if obj.get("roles") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
89
admin/admin/models/account_group_roles_request_body_inner.py
Normal file
89
admin/admin/models/account_group_roles_request_body_inner.py
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class AccountGroupRolesRequestBodyInner(BaseModel):
|
||||||
|
"""
|
||||||
|
AccountGroupRolesRequestBodyInner
|
||||||
|
""" # noqa: E501
|
||||||
|
account_group_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the account group.", alias="accountGroupId")
|
||||||
|
role_ids: Optional[List[StrictStr]] = Field(default=None, description="Unique role IDs.", alias="roleIds")
|
||||||
|
__properties: ClassVar[List[str]] = ["accountGroupId", "roleIds"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of AccountGroupRolesRequestBodyInner from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of AccountGroupRolesRequestBodyInner from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"accountGroupId": obj.get("accountGroupId"),
|
||||||
|
"roleIds": obj.get("roleIds")
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
95
admin/admin/models/account_groups.py
Normal file
95
admin/admin/models/account_groups.py
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.account_group import AccountGroup
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class AccountGroups(BaseModel):
|
||||||
|
"""
|
||||||
|
AccountGroups
|
||||||
|
""" # noqa: E501
|
||||||
|
account_groups: Optional[List[AccountGroup]] = Field(default=None, alias="accountGroups")
|
||||||
|
__properties: ClassVar[List[str]] = ["accountGroups"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of AccountGroups from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in account_groups (list)
|
||||||
|
_items = []
|
||||||
|
if self.account_groups:
|
||||||
|
for _item in self.account_groups:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['accountGroups'] = _items
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of AccountGroups from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"accountGroups": [AccountGroup.from_dict(_item) for _item in obj["accountGroups"]] if obj.get("accountGroups") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
124
admin/admin/models/agent.py
Normal file
124
admin/admin/models/agent.py
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class Agent(BaseModel):
|
||||||
|
"""
|
||||||
|
Agent
|
||||||
|
""" # noqa: E501
|
||||||
|
ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of private IP addresses.", alias="ipAddresses")
|
||||||
|
public_ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of public IP addresses.", alias="publicIpAddresses")
|
||||||
|
network: Optional[StrictStr] = Field(default=None, description="Network (including ASN) of agent’s public IP.")
|
||||||
|
agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the agent.", alias="agentId")
|
||||||
|
agent_name: Optional[StrictStr] = Field(default=None, description="Name of the agent.", alias="agentName")
|
||||||
|
location: Optional[StrictStr] = Field(default=None, description="Location of the agent.")
|
||||||
|
country_id: Optional[StrictStr] = Field(default=None, description="2-digit ISO country code", alias="countryId")
|
||||||
|
enabled: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent is enabled.")
|
||||||
|
prefix: Optional[StrictStr] = Field(default=None, description="Prefix containing agents public IP address.")
|
||||||
|
verify_ssl_certificates: Optional[StrictBool] = Field(default=None, description="Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests.", alias="verifySslCertificates")
|
||||||
|
agent_type: CloudEnterpriseAgentType = Field(alias="agentType")
|
||||||
|
__properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "location", "countryId", "enabled", "prefix", "verifySslCertificates", "agentType"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of Agent from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
"ip_addresses",
|
||||||
|
"public_ip_addresses",
|
||||||
|
"network",
|
||||||
|
"agent_id",
|
||||||
|
"location",
|
||||||
|
"country_id",
|
||||||
|
"prefix",
|
||||||
|
"verify_ssl_certificates",
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of Agent from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"ipAddresses": obj.get("ipAddresses"),
|
||||||
|
"publicIpAddresses": obj.get("publicIpAddresses"),
|
||||||
|
"network": obj.get("network"),
|
||||||
|
"agentId": obj.get("agentId"),
|
||||||
|
"agentName": obj.get("agentName"),
|
||||||
|
"location": obj.get("location"),
|
||||||
|
"countryId": obj.get("countryId"),
|
||||||
|
"enabled": obj.get("enabled"),
|
||||||
|
"prefix": obj.get("prefix"),
|
||||||
|
"verifySslCertificates": obj.get("verifySslCertificates"),
|
||||||
|
"agentType": obj.get("agentType")
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
97
admin/admin/models/agent_base.py
Normal file
97
admin/admin/models/agent_base.py
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class AgentBase(BaseModel):
|
||||||
|
"""
|
||||||
|
AgentBase
|
||||||
|
""" # noqa: E501
|
||||||
|
ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of private IP addresses.", alias="ipAddresses")
|
||||||
|
public_ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of public IP addresses.", alias="publicIpAddresses")
|
||||||
|
network: Optional[StrictStr] = Field(default=None, description="Network (including ASN) of agent’s public IP.")
|
||||||
|
__properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of AgentBase from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
"ip_addresses",
|
||||||
|
"public_ip_addresses",
|
||||||
|
"network",
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of AgentBase from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"ipAddresses": obj.get("ipAddresses"),
|
||||||
|
"publicIpAddresses": obj.get("publicIpAddresses"),
|
||||||
|
"network": obj.get("network")
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
95
admin/admin/models/all_account_group_roles.py
Normal file
95
admin/admin/models/all_account_group_roles.py
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.role import Role
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class AllAccountGroupRoles(BaseModel):
|
||||||
|
"""
|
||||||
|
AllAccountGroupRoles
|
||||||
|
""" # noqa: E501
|
||||||
|
all_account_group_roles: Optional[List[Role]] = Field(default=None, alias="allAccountGroupRoles")
|
||||||
|
__properties: ClassVar[List[str]] = ["allAccountGroupRoles"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of AllAccountGroupRoles from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in all_account_group_roles (list)
|
||||||
|
_items = []
|
||||||
|
if self.all_account_group_roles:
|
||||||
|
for _item in self.all_account_group_roles:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['allAccountGroupRoles'] = _items
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of AllAccountGroupRoles from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"allAccountGroupRoles": [Role.from_dict(_item) for _item in obj["allAccountGroupRoles"]] if obj.get("allAccountGroupRoles") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
91
admin/admin/models/base_role.py
Normal file
91
admin/admin/models/base_role.py
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class BaseRole(BaseModel):
|
||||||
|
"""
|
||||||
|
BaseRole
|
||||||
|
""" # noqa: E501
|
||||||
|
name: Optional[StrictStr] = Field(default=None, description="Name of the role.")
|
||||||
|
role_id: Optional[StrictStr] = Field(default=None, description="Unique ID representing the role.", alias="roleId")
|
||||||
|
is_builtin: Optional[StrictBool] = Field(default=None, description="Flag indicating if the role is built-in (Account Admin, Organization Admin, Regular User).", alias="isBuiltin")
|
||||||
|
__properties: ClassVar[List[str]] = ["name", "roleId", "isBuiltin"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of BaseRole from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of BaseRole from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"name": obj.get("name"),
|
||||||
|
"roleId": obj.get("roleId"),
|
||||||
|
"isBuiltin": obj.get("isBuiltin")
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
38
admin/admin/models/cloud_enterprise_agent_type.py
Normal file
38
admin/admin/models/cloud_enterprise_agent_type.py
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import json
|
||||||
|
from enum import Enum
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
|
||||||
|
class CloudEnterpriseAgentType(str, Enum):
|
||||||
|
"""
|
||||||
|
Type of the agent.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
allowed enum values
|
||||||
|
"""
|
||||||
|
CLOUD = 'cloud'
|
||||||
|
ENTERPRISE_MINUS_CLUSTER = 'enterprise-cluster'
|
||||||
|
ENTERPRISE = 'enterprise'
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Self:
|
||||||
|
"""Create an instance of CloudEnterpriseAgentType from a JSON string"""
|
||||||
|
return cls(json.loads(json_str))
|
||||||
|
|
||||||
|
|
||||||
131
admin/admin/models/cluster_member.py
Normal file
131
admin/admin/models/cluster_member.py
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.enterprise_agent_state import EnterpriseAgentState
|
||||||
|
from admin.models.error_detail import ErrorDetail
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class ClusterMember(BaseModel):
|
||||||
|
"""
|
||||||
|
ClusterMember
|
||||||
|
""" # noqa: E501
|
||||||
|
ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of private IP addresses.", alias="ipAddresses")
|
||||||
|
public_ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of public IP addresses.", alias="publicIpAddresses")
|
||||||
|
network: Optional[StrictStr] = Field(default=None, description="Network (including ASN) of agent’s public IP.")
|
||||||
|
member_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the cluster member", alias="memberId")
|
||||||
|
name: Optional[StrictStr] = Field(default=None, description="Name of the cluster member")
|
||||||
|
error_details: Optional[List[ErrorDetail]] = Field(default=None, description="If an enterprise agent or a cluster member presents at least one error, the errors will be shown as an array of entries in the errorDetails field (Enterprise Agents and Enterprise Cluster members only)", alias="errorDetails")
|
||||||
|
last_seen: Optional[datetime] = Field(default=None, description="UTC last seen date (ISO date-time format).", alias="lastSeen")
|
||||||
|
agent_state: Optional[EnterpriseAgentState] = Field(default=None, alias="agentState")
|
||||||
|
target_for_tests: Optional[StrictStr] = Field(default=None, description="Test target IP address.", alias="targetForTests")
|
||||||
|
utilization: Optional[StrictInt] = Field(default=None, description="Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only).")
|
||||||
|
__properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network", "memberId", "name", "errorDetails", "lastSeen", "agentState", "targetForTests", "utilization"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of ClusterMember from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
"ip_addresses",
|
||||||
|
"public_ip_addresses",
|
||||||
|
"network",
|
||||||
|
"member_id",
|
||||||
|
"name",
|
||||||
|
"error_details",
|
||||||
|
"last_seen",
|
||||||
|
"utilization",
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in error_details (list)
|
||||||
|
_items = []
|
||||||
|
if self.error_details:
|
||||||
|
for _item in self.error_details:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['errorDetails'] = _items
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of ClusterMember from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"ipAddresses": obj.get("ipAddresses"),
|
||||||
|
"publicIpAddresses": obj.get("publicIpAddresses"),
|
||||||
|
"network": obj.get("network"),
|
||||||
|
"memberId": obj.get("memberId"),
|
||||||
|
"name": obj.get("name"),
|
||||||
|
"errorDetails": [ErrorDetail.from_dict(_item) for _item in obj["errorDetails"]] if obj.get("errorDetails") is not None else None,
|
||||||
|
"lastSeen": obj.get("lastSeen"),
|
||||||
|
"agentState": obj.get("agentState"),
|
||||||
|
"targetForTests": obj.get("targetForTests"),
|
||||||
|
"utilization": obj.get("utilization")
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
111
admin/admin/models/create_account_group201_response.py
Normal file
111
admin/admin/models/create_account_group201_response.py
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.self_links_links import SelfLinksLinks
|
||||||
|
from admin.models.user_account_group import UserAccountGroup
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class CreateAccountGroup201Response(BaseModel):
|
||||||
|
"""
|
||||||
|
CreateAccountGroup201Response
|
||||||
|
""" # noqa: E501
|
||||||
|
aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.")
|
||||||
|
account_group_name: Optional[StrictStr] = Field(default=None, description="Account group name", alias="accountGroupName")
|
||||||
|
is_current_account_group: Optional[StrictBool] = Field(default=None, description="Indicates whether the requested aid is the context of the current account.", alias="isCurrentAccountGroup")
|
||||||
|
is_default_account_group: Optional[StrictBool] = Field(default=None, description="Indicates whether the aid is the default one for the requesting user.", alias="isDefaultAccountGroup")
|
||||||
|
organization_name: Optional[StrictStr] = Field(default=None, description="(Optional) Indicates whether the aid is the default one for the requesting user.", alias="organizationName")
|
||||||
|
users: Optional[List[UserAccountGroup]] = None
|
||||||
|
links: Optional[SelfLinksLinks] = Field(default=None, alias="_links")
|
||||||
|
__properties: ClassVar[List[str]] = ["aid", "accountGroupName", "isCurrentAccountGroup", "isDefaultAccountGroup", "organizationName", "users", "_links"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of CreateAccountGroup201Response from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in users (list)
|
||||||
|
_items = []
|
||||||
|
if self.users:
|
||||||
|
for _item in self.users:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['users'] = _items
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of links
|
||||||
|
if self.links:
|
||||||
|
_dict['_links'] = self.links.to_dict()
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of CreateAccountGroup201Response from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"aid": obj.get("aid"),
|
||||||
|
"accountGroupName": obj.get("accountGroupName"),
|
||||||
|
"isCurrentAccountGroup": obj.get("isCurrentAccountGroup"),
|
||||||
|
"isDefaultAccountGroup": obj.get("isDefaultAccountGroup"),
|
||||||
|
"organizationName": obj.get("organizationName"),
|
||||||
|
"users": [UserAccountGroup.from_dict(_item) for _item in obj["users"]] if obj.get("users") is not None else None,
|
||||||
|
"_links": SelfLinksLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
107
admin/admin/models/create_role201_response.py
Normal file
107
admin/admin/models/create_role201_response.py
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.permission import Permission
|
||||||
|
from admin.models.self_links_links import SelfLinksLinks
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class CreateRole201Response(BaseModel):
|
||||||
|
"""
|
||||||
|
CreateRole201Response
|
||||||
|
""" # noqa: E501
|
||||||
|
name: Optional[StrictStr] = Field(default=None, description="Name of the role.")
|
||||||
|
role_id: Optional[StrictStr] = Field(default=None, description="Unique ID representing the role.", alias="roleId")
|
||||||
|
is_builtin: Optional[StrictBool] = Field(default=None, description="Flag indicating if the role is built-in (Account Admin, Organization Admin, Regular User).", alias="isBuiltin")
|
||||||
|
permissions: Optional[List[Permission]] = None
|
||||||
|
links: Optional[SelfLinksLinks] = Field(default=None, alias="_links")
|
||||||
|
__properties: ClassVar[List[str]] = ["name", "roleId", "isBuiltin", "permissions", "_links"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of CreateRole201Response from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in permissions (list)
|
||||||
|
_items = []
|
||||||
|
if self.permissions:
|
||||||
|
for _item in self.permissions:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['permissions'] = _items
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of links
|
||||||
|
if self.links:
|
||||||
|
_dict['_links'] = self.links.to_dict()
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of CreateRole201Response from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"name": obj.get("name"),
|
||||||
|
"roleId": obj.get("roleId"),
|
||||||
|
"isBuiltin": obj.get("isBuiltin"),
|
||||||
|
"permissions": [Permission.from_dict(_item) for _item in obj["permissions"]] if obj.get("permissions") is not None else None,
|
||||||
|
"_links": SelfLinksLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
126
admin/admin/models/create_user201_response.py
Normal file
126
admin/admin/models/create_user201_response.py
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.account_group1 import AccountGroup1
|
||||||
|
from admin.models.account_group_roles_account_group_roles_inner import AccountGroupRolesAccountGroupRolesInner
|
||||||
|
from admin.models.role import Role
|
||||||
|
from admin.models.self_links_links import SelfLinksLinks
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class CreateUser201Response(BaseModel):
|
||||||
|
"""
|
||||||
|
CreateUser201Response
|
||||||
|
""" # noqa: E501
|
||||||
|
name: Optional[StrictStr] = Field(default=None, description="User's display name.")
|
||||||
|
email: Optional[StrictStr] = Field(default=None, description="User's email address.")
|
||||||
|
uid: Optional[StrictStr] = Field(default=None, description="Unique ID of the user.")
|
||||||
|
date_registered: Optional[datetime] = Field(default=None, description="UTC date the user registered their account (ISO date-time format).", alias="dateRegistered")
|
||||||
|
login_account_group: Optional[AccountGroup1] = Field(default=None, alias="loginAccountGroup")
|
||||||
|
account_group_roles: Optional[List[AccountGroupRolesAccountGroupRolesInner]] = Field(default=None, alias="accountGroupRoles")
|
||||||
|
all_account_group_roles: Optional[List[Role]] = Field(default=None, alias="allAccountGroupRoles")
|
||||||
|
links: Optional[SelfLinksLinks] = Field(default=None, alias="_links")
|
||||||
|
__properties: ClassVar[List[str]] = ["name", "email", "uid", "dateRegistered", "loginAccountGroup", "accountGroupRoles", "allAccountGroupRoles", "_links"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of CreateUser201Response from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of login_account_group
|
||||||
|
if self.login_account_group:
|
||||||
|
_dict['loginAccountGroup'] = self.login_account_group.to_dict()
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in account_group_roles (list)
|
||||||
|
_items = []
|
||||||
|
if self.account_group_roles:
|
||||||
|
for _item in self.account_group_roles:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['accountGroupRoles'] = _items
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in all_account_group_roles (list)
|
||||||
|
_items = []
|
||||||
|
if self.all_account_group_roles:
|
||||||
|
for _item in self.all_account_group_roles:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['allAccountGroupRoles'] = _items
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of links
|
||||||
|
if self.links:
|
||||||
|
_dict['_links'] = self.links.to_dict()
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of CreateUser201Response from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"name": obj.get("name"),
|
||||||
|
"email": obj.get("email"),
|
||||||
|
"uid": obj.get("uid"),
|
||||||
|
"dateRegistered": obj.get("dateRegistered"),
|
||||||
|
"loginAccountGroup": AccountGroup1.from_dict(obj["loginAccountGroup"]) if obj.get("loginAccountGroup") is not None else None,
|
||||||
|
"accountGroupRoles": [AccountGroupRolesAccountGroupRolesInner.from_dict(_item) for _item in obj["accountGroupRoles"]] if obj.get("accountGroupRoles") is not None else None,
|
||||||
|
"allAccountGroupRoles": [Role.from_dict(_item) for _item in obj["allAccountGroupRoles"]] if obj.get("allAccountGroupRoles") is not None else None,
|
||||||
|
"_links": SelfLinksLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
120
admin/admin/models/created_user.py
Normal file
120
admin/admin/models/created_user.py
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.account_group1 import AccountGroup1
|
||||||
|
from admin.models.account_group_roles_account_group_roles_inner import AccountGroupRolesAccountGroupRolesInner
|
||||||
|
from admin.models.role import Role
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class CreatedUser(BaseModel):
|
||||||
|
"""
|
||||||
|
CreatedUser
|
||||||
|
""" # noqa: E501
|
||||||
|
name: Optional[StrictStr] = Field(default=None, description="User's display name.")
|
||||||
|
email: Optional[StrictStr] = Field(default=None, description="User's email address.")
|
||||||
|
uid: Optional[StrictStr] = Field(default=None, description="Unique ID of the user.")
|
||||||
|
date_registered: Optional[datetime] = Field(default=None, description="UTC date the user registered their account (ISO date-time format).", alias="dateRegistered")
|
||||||
|
login_account_group: Optional[AccountGroup1] = Field(default=None, alias="loginAccountGroup")
|
||||||
|
account_group_roles: Optional[List[AccountGroupRolesAccountGroupRolesInner]] = Field(default=None, alias="accountGroupRoles")
|
||||||
|
all_account_group_roles: Optional[List[Role]] = Field(default=None, alias="allAccountGroupRoles")
|
||||||
|
__properties: ClassVar[List[str]] = ["name", "email", "uid", "dateRegistered", "loginAccountGroup", "accountGroupRoles", "allAccountGroupRoles"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of CreatedUser from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of login_account_group
|
||||||
|
if self.login_account_group:
|
||||||
|
_dict['loginAccountGroup'] = self.login_account_group.to_dict()
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in account_group_roles (list)
|
||||||
|
_items = []
|
||||||
|
if self.account_group_roles:
|
||||||
|
for _item in self.account_group_roles:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['accountGroupRoles'] = _items
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in all_account_group_roles (list)
|
||||||
|
_items = []
|
||||||
|
if self.all_account_group_roles:
|
||||||
|
for _item in self.all_account_group_roles:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['allAccountGroupRoles'] = _items
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of CreatedUser from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"name": obj.get("name"),
|
||||||
|
"email": obj.get("email"),
|
||||||
|
"uid": obj.get("uid"),
|
||||||
|
"dateRegistered": obj.get("dateRegistered"),
|
||||||
|
"loginAccountGroup": AccountGroup1.from_dict(obj["loginAccountGroup"]) if obj.get("loginAccountGroup") is not None else None,
|
||||||
|
"accountGroupRoles": [AccountGroupRolesAccountGroupRolesInner.from_dict(_item) for _item in obj["accountGroupRoles"]] if obj.get("accountGroupRoles") is not None else None,
|
||||||
|
"allAccountGroupRoles": [Role.from_dict(_item) for _item in obj["allAccountGroupRoles"]] if obj.get("allAccountGroupRoles") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
199
admin/admin/models/enterprise_agent.py
Normal file
199
admin/admin/models/enterprise_agent.py
Normal file
@ -0,0 +1,199 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.account_group1 import AccountGroup1
|
||||||
|
from admin.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType
|
||||||
|
from admin.models.cluster_member import ClusterMember
|
||||||
|
from admin.models.enterprise_agent_ipv6_policy import EnterpriseAgentIpv6Policy
|
||||||
|
from admin.models.enterprise_agent_state import EnterpriseAgentState
|
||||||
|
from admin.models.error_detail import ErrorDetail
|
||||||
|
from admin.models.interface_ip_mapping import InterfaceIpMapping
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class EnterpriseAgent(BaseModel):
|
||||||
|
"""
|
||||||
|
EnterpriseAgent
|
||||||
|
""" # noqa: E501
|
||||||
|
agent_type: CloudEnterpriseAgentType = Field(alias="agentType")
|
||||||
|
ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of private IP addresses.", alias="ipAddresses")
|
||||||
|
public_ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of public IP addresses.", alias="publicIpAddresses")
|
||||||
|
network: Optional[StrictStr] = Field(default=None, description="Network (including ASN) of agent’s public IP.")
|
||||||
|
agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the agent.", alias="agentId")
|
||||||
|
agent_name: Optional[StrictStr] = Field(default=None, description="Name of the agent.", alias="agentName")
|
||||||
|
location: Optional[StrictStr] = Field(default=None, description="Location of the agent.")
|
||||||
|
country_id: Optional[StrictStr] = Field(default=None, description="2-digit ISO country code", alias="countryId")
|
||||||
|
enabled: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent is enabled.")
|
||||||
|
prefix: Optional[StrictStr] = Field(default=None, description="Prefix containing agents public IP address.")
|
||||||
|
verify_ssl_certificates: Optional[StrictBool] = Field(default=None, description="Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests.", alias="verifySslCertificates")
|
||||||
|
cluster_members: Optional[List[ClusterMember]] = Field(default=None, description="If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents.", alias="clusterMembers")
|
||||||
|
utilization: Optional[StrictInt] = Field(default=None, description="Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only).")
|
||||||
|
account_groups: Optional[List[AccountGroup1]] = Field(default=None, description="List of account groups. See /accounts-groups to pull a list of account IDs", alias="accountGroups")
|
||||||
|
ipv6_policy: Optional[EnterpriseAgentIpv6Policy] = Field(default=None, alias="ipv6Policy")
|
||||||
|
error_details: Optional[List[ErrorDetail]] = Field(default=None, description="If an enterprise agent or a cluster member presents at least one error, the errors will be shown as an array of entries in the errorDetails field (Enterprise Agents and Enterprise Cluster members only)", alias="errorDetails")
|
||||||
|
hostname: Optional[StrictStr] = Field(default=None, description="Fully qualified domain name of the agent (Enterprise Agents only)")
|
||||||
|
last_seen: Optional[datetime] = Field(default=None, description="UTC last seen date (ISO date-time format).", alias="lastSeen")
|
||||||
|
agent_state: Optional[EnterpriseAgentState] = Field(default=None, alias="agentState")
|
||||||
|
keep_browser_cache: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent retains cache.", alias="keepBrowserCache")
|
||||||
|
created_date: Optional[datetime] = Field(default=None, description="UTC Agent creation date (ISO date-time format).", alias="createdDate")
|
||||||
|
target_for_tests: Optional[StrictStr] = Field(default=None, description="Test target IP address.", alias="targetForTests")
|
||||||
|
local_resolution_prefixes: Optional[List[StrictStr]] = Field(default=None, description="To perform rDNS lookups for public IP ranges, this field represents the public IP ranges. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only).", alias="localResolutionPrefixes")
|
||||||
|
interface_ip_mappings: Optional[List[InterfaceIpMapping]] = Field(default=None, alias="interfaceIpMappings")
|
||||||
|
__properties: ClassVar[List[str]] = ["agentType", "ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "location", "countryId", "enabled", "prefix", "verifySslCertificates", "clusterMembers", "utilization", "accountGroups", "ipv6Policy", "errorDetails", "hostname", "lastSeen", "agentState", "keepBrowserCache", "createdDate", "targetForTests", "localResolutionPrefixes", "interfaceIpMappings"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of EnterpriseAgent from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
"ip_addresses",
|
||||||
|
"public_ip_addresses",
|
||||||
|
"network",
|
||||||
|
"agent_id",
|
||||||
|
"location",
|
||||||
|
"country_id",
|
||||||
|
"prefix",
|
||||||
|
"verify_ssl_certificates",
|
||||||
|
"cluster_members",
|
||||||
|
"utilization",
|
||||||
|
"error_details",
|
||||||
|
"hostname",
|
||||||
|
"last_seen",
|
||||||
|
"created_date",
|
||||||
|
"interface_ip_mappings",
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in cluster_members (list)
|
||||||
|
_items = []
|
||||||
|
if self.cluster_members:
|
||||||
|
for _item in self.cluster_members:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['clusterMembers'] = _items
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in account_groups (list)
|
||||||
|
_items = []
|
||||||
|
if self.account_groups:
|
||||||
|
for _item in self.account_groups:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['accountGroups'] = _items
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in error_details (list)
|
||||||
|
_items = []
|
||||||
|
if self.error_details:
|
||||||
|
for _item in self.error_details:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['errorDetails'] = _items
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in interface_ip_mappings (list)
|
||||||
|
_items = []
|
||||||
|
if self.interface_ip_mappings:
|
||||||
|
for _item in self.interface_ip_mappings:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['interfaceIpMappings'] = _items
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of EnterpriseAgent from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"agentType": obj.get("agentType"),
|
||||||
|
"ipAddresses": obj.get("ipAddresses"),
|
||||||
|
"publicIpAddresses": obj.get("publicIpAddresses"),
|
||||||
|
"network": obj.get("network"),
|
||||||
|
"agentId": obj.get("agentId"),
|
||||||
|
"agentName": obj.get("agentName"),
|
||||||
|
"location": obj.get("location"),
|
||||||
|
"countryId": obj.get("countryId"),
|
||||||
|
"enabled": obj.get("enabled"),
|
||||||
|
"prefix": obj.get("prefix"),
|
||||||
|
"verifySslCertificates": obj.get("verifySslCertificates"),
|
||||||
|
"clusterMembers": [ClusterMember.from_dict(_item) for _item in obj["clusterMembers"]] if obj.get("clusterMembers") is not None else None,
|
||||||
|
"utilization": obj.get("utilization"),
|
||||||
|
"accountGroups": [AccountGroup1.from_dict(_item) for _item in obj["accountGroups"]] if obj.get("accountGroups") is not None else None,
|
||||||
|
"ipv6Policy": obj.get("ipv6Policy"),
|
||||||
|
"errorDetails": [ErrorDetail.from_dict(_item) for _item in obj["errorDetails"]] if obj.get("errorDetails") is not None else None,
|
||||||
|
"hostname": obj.get("hostname"),
|
||||||
|
"lastSeen": obj.get("lastSeen"),
|
||||||
|
"agentState": obj.get("agentState"),
|
||||||
|
"keepBrowserCache": obj.get("keepBrowserCache"),
|
||||||
|
"createdDate": obj.get("createdDate"),
|
||||||
|
"targetForTests": obj.get("targetForTests"),
|
||||||
|
"localResolutionPrefixes": obj.get("localResolutionPrefixes"),
|
||||||
|
"interfaceIpMappings": [InterfaceIpMapping.from_dict(_item) for _item in obj["interfaceIpMappings"]] if obj.get("interfaceIpMappings") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
160
admin/admin/models/enterprise_agent_data.py
Normal file
160
admin/admin/models/enterprise_agent_data.py
Normal file
@ -0,0 +1,160 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.account_group1 import AccountGroup1
|
||||||
|
from admin.models.cluster_member import ClusterMember
|
||||||
|
from admin.models.enterprise_agent_ipv6_policy import EnterpriseAgentIpv6Policy
|
||||||
|
from admin.models.enterprise_agent_state import EnterpriseAgentState
|
||||||
|
from admin.models.error_detail import ErrorDetail
|
||||||
|
from admin.models.interface_ip_mapping import InterfaceIpMapping
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class EnterpriseAgentData(BaseModel):
|
||||||
|
"""
|
||||||
|
EnterpriseAgentData
|
||||||
|
""" # noqa: E501
|
||||||
|
cluster_members: Optional[List[ClusterMember]] = Field(default=None, description="If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents.", alias="clusterMembers")
|
||||||
|
utilization: Optional[StrictInt] = Field(default=None, description="Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only).")
|
||||||
|
account_groups: Optional[List[AccountGroup1]] = Field(default=None, description="List of account groups. See /accounts-groups to pull a list of account IDs", alias="accountGroups")
|
||||||
|
ipv6_policy: Optional[EnterpriseAgentIpv6Policy] = Field(default=None, alias="ipv6Policy")
|
||||||
|
error_details: Optional[List[ErrorDetail]] = Field(default=None, description="If an enterprise agent or a cluster member presents at least one error, the errors will be shown as an array of entries in the errorDetails field (Enterprise Agents and Enterprise Cluster members only)", alias="errorDetails")
|
||||||
|
hostname: Optional[StrictStr] = Field(default=None, description="Fully qualified domain name of the agent (Enterprise Agents only)")
|
||||||
|
last_seen: Optional[datetime] = Field(default=None, description="UTC last seen date (ISO date-time format).", alias="lastSeen")
|
||||||
|
agent_state: Optional[EnterpriseAgentState] = Field(default=None, alias="agentState")
|
||||||
|
keep_browser_cache: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent retains cache.", alias="keepBrowserCache")
|
||||||
|
created_date: Optional[datetime] = Field(default=None, description="UTC Agent creation date (ISO date-time format).", alias="createdDate")
|
||||||
|
target_for_tests: Optional[StrictStr] = Field(default=None, description="Test target IP address.", alias="targetForTests")
|
||||||
|
local_resolution_prefixes: Optional[List[StrictStr]] = Field(default=None, description="To perform rDNS lookups for public IP ranges, this field represents the public IP ranges. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only).", alias="localResolutionPrefixes")
|
||||||
|
interface_ip_mappings: Optional[List[InterfaceIpMapping]] = Field(default=None, alias="interfaceIpMappings")
|
||||||
|
__properties: ClassVar[List[str]] = ["clusterMembers", "utilization", "accountGroups", "ipv6Policy", "errorDetails", "hostname", "lastSeen", "agentState", "keepBrowserCache", "createdDate", "targetForTests", "localResolutionPrefixes", "interfaceIpMappings"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of EnterpriseAgentData from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
"cluster_members",
|
||||||
|
"utilization",
|
||||||
|
"error_details",
|
||||||
|
"hostname",
|
||||||
|
"last_seen",
|
||||||
|
"created_date",
|
||||||
|
"interface_ip_mappings",
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in cluster_members (list)
|
||||||
|
_items = []
|
||||||
|
if self.cluster_members:
|
||||||
|
for _item in self.cluster_members:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['clusterMembers'] = _items
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in account_groups (list)
|
||||||
|
_items = []
|
||||||
|
if self.account_groups:
|
||||||
|
for _item in self.account_groups:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['accountGroups'] = _items
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in error_details (list)
|
||||||
|
_items = []
|
||||||
|
if self.error_details:
|
||||||
|
for _item in self.error_details:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['errorDetails'] = _items
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in interface_ip_mappings (list)
|
||||||
|
_items = []
|
||||||
|
if self.interface_ip_mappings:
|
||||||
|
for _item in self.interface_ip_mappings:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['interfaceIpMappings'] = _items
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of EnterpriseAgentData from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"clusterMembers": [ClusterMember.from_dict(_item) for _item in obj["clusterMembers"]] if obj.get("clusterMembers") is not None else None,
|
||||||
|
"utilization": obj.get("utilization"),
|
||||||
|
"accountGroups": [AccountGroup1.from_dict(_item) for _item in obj["accountGroups"]] if obj.get("accountGroups") is not None else None,
|
||||||
|
"ipv6Policy": obj.get("ipv6Policy"),
|
||||||
|
"errorDetails": [ErrorDetail.from_dict(_item) for _item in obj["errorDetails"]] if obj.get("errorDetails") is not None else None,
|
||||||
|
"hostname": obj.get("hostname"),
|
||||||
|
"lastSeen": obj.get("lastSeen"),
|
||||||
|
"agentState": obj.get("agentState"),
|
||||||
|
"keepBrowserCache": obj.get("keepBrowserCache"),
|
||||||
|
"createdDate": obj.get("createdDate"),
|
||||||
|
"targetForTests": obj.get("targetForTests"),
|
||||||
|
"localResolutionPrefixes": obj.get("localResolutionPrefixes"),
|
||||||
|
"interfaceIpMappings": [InterfaceIpMapping.from_dict(_item) for _item in obj["interfaceIpMappings"]] if obj.get("interfaceIpMappings") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
38
admin/admin/models/enterprise_agent_ipv6_policy.py
Normal file
38
admin/admin/models/enterprise_agent_ipv6_policy.py
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import json
|
||||||
|
from enum import Enum
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
|
||||||
|
class EnterpriseAgentIpv6Policy(str, Enum):
|
||||||
|
"""
|
||||||
|
IP version policy, (Enterprise Agents and Enterprise Clusters only)
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
allowed enum values
|
||||||
|
"""
|
||||||
|
FORCE_MINUS_IPV4 = 'force-ipv4'
|
||||||
|
PREFER_MINUS_IPV6 = 'prefer-ipv6'
|
||||||
|
FORCE_MINUS_IPV6 = 'force-ipv6'
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Self:
|
||||||
|
"""Create an instance of EnterpriseAgentIpv6Policy from a JSON string"""
|
||||||
|
return cls(json.loads(json_str))
|
||||||
|
|
||||||
|
|
||||||
38
admin/admin/models/enterprise_agent_state.py
Normal file
38
admin/admin/models/enterprise_agent_state.py
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import json
|
||||||
|
from enum import Enum
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
|
||||||
|
class EnterpriseAgentState(str, Enum):
|
||||||
|
"""
|
||||||
|
State of the agent.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
allowed enum values
|
||||||
|
"""
|
||||||
|
ONLINE = 'online'
|
||||||
|
OFFLINE = 'offline'
|
||||||
|
DISABLED = 'disabled'
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Self:
|
||||||
|
"""Create an instance of EnterpriseAgentState from a JSON string"""
|
||||||
|
return cls(json.loads(json_str))
|
||||||
|
|
||||||
|
|
||||||
95
admin/admin/models/enterprise_agents.py
Normal file
95
admin/admin/models/enterprise_agents.py
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.enterprise_agent import EnterpriseAgent
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class EnterpriseAgents(BaseModel):
|
||||||
|
"""
|
||||||
|
EnterpriseAgents
|
||||||
|
""" # noqa: E501
|
||||||
|
agents: Optional[List[EnterpriseAgent]] = None
|
||||||
|
__properties: ClassVar[List[str]] = ["agents"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of EnterpriseAgents from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in agents (list)
|
||||||
|
_items = []
|
||||||
|
if self.agents:
|
||||||
|
for _item in self.agents:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['agents'] = _items
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of EnterpriseAgents from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"agents": [EnterpriseAgent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
95
admin/admin/models/error.py
Normal file
95
admin/admin/models/error.py
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class Error(BaseModel):
|
||||||
|
"""
|
||||||
|
Error
|
||||||
|
""" # noqa: E501
|
||||||
|
type: Optional[StrictStr] = Field(default=None, description="A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\".")
|
||||||
|
title: Optional[StrictStr] = Field(default=None, description="A short, human-readable summary of the problem type.")
|
||||||
|
status: Optional[StrictInt] = Field(default=None, description="The HTTP status code generated by the origin server for this occurrence of the problem.")
|
||||||
|
detail: Optional[StrictStr] = Field(default=None, description="A human-readable explanation specific to this occurrence of the problem.")
|
||||||
|
instance: Optional[StrictStr] = Field(default=None, description="A URI reference that identifies the specific occurrence of the problem.")
|
||||||
|
__properties: ClassVar[List[str]] = ["type", "title", "status", "detail", "instance"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of Error from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of Error from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"type": obj.get("type"),
|
||||||
|
"title": obj.get("title"),
|
||||||
|
"status": obj.get("status"),
|
||||||
|
"detail": obj.get("detail"),
|
||||||
|
"instance": obj.get("instance")
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
92
admin/admin/models/error_detail.py
Normal file
92
admin/admin/models/error_detail.py
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.error_detail_code import ErrorDetailCode
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class ErrorDetail(BaseModel):
|
||||||
|
"""
|
||||||
|
ErrorDetail
|
||||||
|
""" # noqa: E501
|
||||||
|
code: Optional[ErrorDetailCode] = None
|
||||||
|
description: Optional[StrictStr] = Field(default=None, description="Description for the agent error.")
|
||||||
|
__properties: ClassVar[List[str]] = ["code", "description"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of ErrorDetail from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
"description",
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of ErrorDetail from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"code": obj.get("code"),
|
||||||
|
"description": obj.get("description")
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
43
admin/admin/models/error_detail_code.py
Normal file
43
admin/admin/models/error_detail_code.py
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import json
|
||||||
|
from enum import Enum
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
|
||||||
|
class ErrorDetailCode(str, Enum):
|
||||||
|
"""
|
||||||
|
Code for the agent error.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
allowed enum values
|
||||||
|
"""
|
||||||
|
AGENT_MINUS_VERSION_MINUS_OUTDATED = 'agent-version-outdated'
|
||||||
|
BROWSERBOT_MINUS_VERSION_MINUS_OUTDATED = 'browserbot-version-outdated'
|
||||||
|
APPLIANCE_MINUS_VERSION_MINUS_OUTDATED = 'appliance-version-outdated'
|
||||||
|
CLOCK_MINUS_OFFSET = 'clock-offset'
|
||||||
|
OS_MINUS_END_MINUS_OF_MINUS_INSTALLATION_MINUS_SUPPORT = 'os-end-of-installation-support'
|
||||||
|
OS_MINUS_END_MINUS_OF_MINUS_SUPPORT = 'os-end-of-support'
|
||||||
|
OS_MINUS_END_MINUS_OF_MINUS_LIFE = 'os-end-of-life'
|
||||||
|
NAT_MINUS_TRAVERSAL_MINUS_ERROR = 'nat-traversal-error'
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Self:
|
||||||
|
"""Create an instance of ErrorDetailCode from a JSON string"""
|
||||||
|
return cls(json.loads(json_str))
|
||||||
|
|
||||||
|
|
||||||
37
admin/admin/models/expand.py
Normal file
37
admin/admin/models/expand.py
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import json
|
||||||
|
from enum import Enum
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
|
||||||
|
class Expand(str, Enum):
|
||||||
|
"""
|
||||||
|
Expand
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
allowed enum values
|
||||||
|
"""
|
||||||
|
USER = 'user'
|
||||||
|
AGENT = 'agent'
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Self:
|
||||||
|
"""Create an instance of Expand from a JSON string"""
|
||||||
|
return cls(json.loads(json_str))
|
||||||
|
|
||||||
|
|
||||||
102
admin/admin/models/extended_user.py
Normal file
102
admin/admin/models/extended_user.py
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.account_group1 import AccountGroup1
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class ExtendedUser(BaseModel):
|
||||||
|
"""
|
||||||
|
ExtendedUser
|
||||||
|
""" # noqa: E501
|
||||||
|
name: Optional[StrictStr] = Field(default=None, description="User's display name.")
|
||||||
|
email: Optional[StrictStr] = Field(default=None, description="User's email address.")
|
||||||
|
uid: Optional[StrictStr] = Field(default=None, description="Unique ID of the user.")
|
||||||
|
date_registered: Optional[datetime] = Field(default=None, description="UTC date the user registered their account (ISO date-time format).", alias="dateRegistered")
|
||||||
|
login_account_group: Optional[AccountGroup1] = Field(default=None, alias="loginAccountGroup")
|
||||||
|
last_login: Optional[datetime] = Field(default=None, description="UTC last login of the user (ISO date-time format).", alias="lastLogin")
|
||||||
|
__properties: ClassVar[List[str]] = ["name", "email", "uid", "dateRegistered", "loginAccountGroup", "lastLogin"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of ExtendedUser from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of login_account_group
|
||||||
|
if self.login_account_group:
|
||||||
|
_dict['loginAccountGroup'] = self.login_account_group.to_dict()
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of ExtendedUser from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"name": obj.get("name"),
|
||||||
|
"email": obj.get("email"),
|
||||||
|
"uid": obj.get("uid"),
|
||||||
|
"dateRegistered": obj.get("dateRegistered"),
|
||||||
|
"loginAccountGroup": AccountGroup1.from_dict(obj["loginAccountGroup"]) if obj.get("loginAccountGroup") is not None else None,
|
||||||
|
"lastLogin": obj.get("lastLogin")
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
121
admin/admin/models/get_account_group200_response.py
Normal file
121
admin/admin/models/get_account_group200_response.py
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.enterprise_agent import EnterpriseAgent
|
||||||
|
from admin.models.self_links_links import SelfLinksLinks
|
||||||
|
from admin.models.user_account_group import UserAccountGroup
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class GetAccountGroup200Response(BaseModel):
|
||||||
|
"""
|
||||||
|
GetAccountGroup200Response
|
||||||
|
""" # noqa: E501
|
||||||
|
aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.")
|
||||||
|
account_group_name: Optional[StrictStr] = Field(default=None, description="Account group name", alias="accountGroupName")
|
||||||
|
is_current_account_group: Optional[StrictBool] = Field(default=None, description="Indicates whether the requested aid is the context of the current account.", alias="isCurrentAccountGroup")
|
||||||
|
is_default_account_group: Optional[StrictBool] = Field(default=None, description="Indicates whether the aid is the default one for the requesting user.", alias="isDefaultAccountGroup")
|
||||||
|
organization_name: Optional[StrictStr] = Field(default=None, description="(Optional) Indicates whether the aid is the default one for the requesting user.", alias="organizationName")
|
||||||
|
users: Optional[List[UserAccountGroup]] = None
|
||||||
|
agents: Optional[List[EnterpriseAgent]] = None
|
||||||
|
links: Optional[SelfLinksLinks] = Field(default=None, alias="_links")
|
||||||
|
__properties: ClassVar[List[str]] = ["aid", "accountGroupName", "isCurrentAccountGroup", "isDefaultAccountGroup", "organizationName", "users", "agents", "_links"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of GetAccountGroup200Response from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in users (list)
|
||||||
|
_items = []
|
||||||
|
if self.users:
|
||||||
|
for _item in self.users:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['users'] = _items
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in agents (list)
|
||||||
|
_items = []
|
||||||
|
if self.agents:
|
||||||
|
for _item in self.agents:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['agents'] = _items
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of links
|
||||||
|
if self.links:
|
||||||
|
_dict['_links'] = self.links.to_dict()
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of GetAccountGroup200Response from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"aid": obj.get("aid"),
|
||||||
|
"accountGroupName": obj.get("accountGroupName"),
|
||||||
|
"isCurrentAccountGroup": obj.get("isCurrentAccountGroup"),
|
||||||
|
"isDefaultAccountGroup": obj.get("isDefaultAccountGroup"),
|
||||||
|
"organizationName": obj.get("organizationName"),
|
||||||
|
"users": [UserAccountGroup.from_dict(_item) for _item in obj["users"]] if obj.get("users") is not None else None,
|
||||||
|
"agents": [EnterpriseAgent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None,
|
||||||
|
"_links": SelfLinksLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
101
admin/admin/models/get_account_groups200_response.py
Normal file
101
admin/admin/models/get_account_groups200_response.py
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.account_group import AccountGroup
|
||||||
|
from admin.models.self_links_links import SelfLinksLinks
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class GetAccountGroups200Response(BaseModel):
|
||||||
|
"""
|
||||||
|
GetAccountGroups200Response
|
||||||
|
""" # noqa: E501
|
||||||
|
account_groups: Optional[List[AccountGroup]] = Field(default=None, alias="accountGroups")
|
||||||
|
links: Optional[SelfLinksLinks] = Field(default=None, alias="_links")
|
||||||
|
__properties: ClassVar[List[str]] = ["accountGroups", "_links"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of GetAccountGroups200Response from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in account_groups (list)
|
||||||
|
_items = []
|
||||||
|
if self.account_groups:
|
||||||
|
for _item in self.account_groups:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['accountGroups'] = _items
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of links
|
||||||
|
if self.links:
|
||||||
|
_dict['_links'] = self.links.to_dict()
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of GetAccountGroups200Response from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"accountGroups": [AccountGroup.from_dict(_item) for _item in obj["accountGroups"]] if obj.get("accountGroups") is not None else None,
|
||||||
|
"_links": SelfLinksLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
101
admin/admin/models/get_permissions200_response.py
Normal file
101
admin/admin/models/get_permissions200_response.py
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.permission import Permission
|
||||||
|
from admin.models.self_links_links import SelfLinksLinks
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class GetPermissions200Response(BaseModel):
|
||||||
|
"""
|
||||||
|
GetPermissions200Response
|
||||||
|
""" # noqa: E501
|
||||||
|
permissions: Optional[List[Permission]] = None
|
||||||
|
links: Optional[SelfLinksLinks] = Field(default=None, alias="_links")
|
||||||
|
__properties: ClassVar[List[str]] = ["permissions", "_links"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of GetPermissions200Response from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in permissions (list)
|
||||||
|
_items = []
|
||||||
|
if self.permissions:
|
||||||
|
for _item in self.permissions:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['permissions'] = _items
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of links
|
||||||
|
if self.links:
|
||||||
|
_dict['_links'] = self.links.to_dict()
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of GetPermissions200Response from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"permissions": [Permission.from_dict(_item) for _item in obj["permissions"]] if obj.get("permissions") is not None else None,
|
||||||
|
"_links": SelfLinksLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
101
admin/admin/models/get_roles200_response.py
Normal file
101
admin/admin/models/get_roles200_response.py
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.role import Role
|
||||||
|
from admin.models.self_links_links import SelfLinksLinks
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class GetRoles200Response(BaseModel):
|
||||||
|
"""
|
||||||
|
GetRoles200Response
|
||||||
|
""" # noqa: E501
|
||||||
|
roles: Optional[List[Role]] = None
|
||||||
|
links: Optional[SelfLinksLinks] = Field(default=None, alias="_links")
|
||||||
|
__properties: ClassVar[List[str]] = ["roles", "_links"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of GetRoles200Response from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in roles (list)
|
||||||
|
_items = []
|
||||||
|
if self.roles:
|
||||||
|
for _item in self.roles:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['roles'] = _items
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of links
|
||||||
|
if self.links:
|
||||||
|
_dict['_links'] = self.links.to_dict()
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of GetRoles200Response from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"roles": [Role.from_dict(_item) for _item in obj["roles"]] if obj.get("roles") is not None else None,
|
||||||
|
"_links": SelfLinksLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
128
admin/admin/models/get_user200_response.py
Normal file
128
admin/admin/models/get_user200_response.py
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.account_group1 import AccountGroup1
|
||||||
|
from admin.models.account_group_roles_account_group_roles_inner import AccountGroupRolesAccountGroupRolesInner
|
||||||
|
from admin.models.role import Role
|
||||||
|
from admin.models.self_links_links import SelfLinksLinks
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class GetUser200Response(BaseModel):
|
||||||
|
"""
|
||||||
|
GetUser200Response
|
||||||
|
""" # noqa: E501
|
||||||
|
name: Optional[StrictStr] = Field(default=None, description="User's display name.")
|
||||||
|
email: Optional[StrictStr] = Field(default=None, description="User's email address.")
|
||||||
|
uid: Optional[StrictStr] = Field(default=None, description="Unique ID of the user.")
|
||||||
|
date_registered: Optional[datetime] = Field(default=None, description="UTC date the user registered their account (ISO date-time format).", alias="dateRegistered")
|
||||||
|
login_account_group: Optional[AccountGroup1] = Field(default=None, alias="loginAccountGroup")
|
||||||
|
last_login: Optional[datetime] = Field(default=None, description="UTC last login of the user (ISO date-time format).", alias="lastLogin")
|
||||||
|
account_group_roles: Optional[List[AccountGroupRolesAccountGroupRolesInner]] = Field(default=None, alias="accountGroupRoles")
|
||||||
|
all_account_group_roles: Optional[List[Role]] = Field(default=None, alias="allAccountGroupRoles")
|
||||||
|
links: Optional[SelfLinksLinks] = Field(default=None, alias="_links")
|
||||||
|
__properties: ClassVar[List[str]] = ["name", "email", "uid", "dateRegistered", "loginAccountGroup", "lastLogin", "accountGroupRoles", "allAccountGroupRoles", "_links"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of GetUser200Response from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of login_account_group
|
||||||
|
if self.login_account_group:
|
||||||
|
_dict['loginAccountGroup'] = self.login_account_group.to_dict()
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in account_group_roles (list)
|
||||||
|
_items = []
|
||||||
|
if self.account_group_roles:
|
||||||
|
for _item in self.account_group_roles:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['accountGroupRoles'] = _items
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in all_account_group_roles (list)
|
||||||
|
_items = []
|
||||||
|
if self.all_account_group_roles:
|
||||||
|
for _item in self.all_account_group_roles:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['allAccountGroupRoles'] = _items
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of links
|
||||||
|
if self.links:
|
||||||
|
_dict['_links'] = self.links.to_dict()
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of GetUser200Response from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"name": obj.get("name"),
|
||||||
|
"email": obj.get("email"),
|
||||||
|
"uid": obj.get("uid"),
|
||||||
|
"dateRegistered": obj.get("dateRegistered"),
|
||||||
|
"loginAccountGroup": AccountGroup1.from_dict(obj["loginAccountGroup"]) if obj.get("loginAccountGroup") is not None else None,
|
||||||
|
"lastLogin": obj.get("lastLogin"),
|
||||||
|
"accountGroupRoles": [AccountGroupRolesAccountGroupRolesInner.from_dict(_item) for _item in obj["accountGroupRoles"]] if obj.get("accountGroupRoles") is not None else None,
|
||||||
|
"allAccountGroupRoles": [Role.from_dict(_item) for _item in obj["allAccountGroupRoles"]] if obj.get("allAccountGroupRoles") is not None else None,
|
||||||
|
"_links": SelfLinksLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
110
admin/admin/models/get_user_events200_response.py
Normal file
110
admin/admin/models/get_user_events200_response.py
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.pagination_links_links import PaginationLinksLinks
|
||||||
|
from admin.models.user_event import UserEvent
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class GetUserEvents200Response(BaseModel):
|
||||||
|
"""
|
||||||
|
GetUserEvents200Response
|
||||||
|
""" # noqa: E501
|
||||||
|
start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate")
|
||||||
|
end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate")
|
||||||
|
audit_events: Optional[List[UserEvent]] = Field(default=None, alias="auditEvents")
|
||||||
|
links: Optional[PaginationLinksLinks] = Field(default=None, alias="_links")
|
||||||
|
__properties: ClassVar[List[str]] = ["startDate", "endDate", "auditEvents", "_links"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of GetUserEvents200Response from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
"start_date",
|
||||||
|
"end_date",
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in audit_events (list)
|
||||||
|
_items = []
|
||||||
|
if self.audit_events:
|
||||||
|
for _item in self.audit_events:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['auditEvents'] = _items
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of links
|
||||||
|
if self.links:
|
||||||
|
_dict['_links'] = self.links.to_dict()
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of GetUserEvents200Response from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"startDate": obj.get("startDate"),
|
||||||
|
"endDate": obj.get("endDate"),
|
||||||
|
"auditEvents": [UserEvent.from_dict(_item) for _item in obj["auditEvents"]] if obj.get("auditEvents") is not None else None,
|
||||||
|
"_links": PaginationLinksLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
101
admin/admin/models/get_users200_response.py
Normal file
101
admin/admin/models/get_users200_response.py
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.extended_user import ExtendedUser
|
||||||
|
from admin.models.self_links_links import SelfLinksLinks
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class GetUsers200Response(BaseModel):
|
||||||
|
"""
|
||||||
|
GetUsers200Response
|
||||||
|
""" # noqa: E501
|
||||||
|
users: Optional[List[ExtendedUser]] = None
|
||||||
|
links: Optional[SelfLinksLinks] = Field(default=None, alias="_links")
|
||||||
|
__properties: ClassVar[List[str]] = ["users", "_links"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of GetUsers200Response from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in users (list)
|
||||||
|
_items = []
|
||||||
|
if self.users:
|
||||||
|
for _item in self.users:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['users'] = _items
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of links
|
||||||
|
if self.links:
|
||||||
|
_dict['_links'] = self.links.to_dict()
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of GetUsers200Response from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"users": [ExtendedUser.from_dict(_item) for _item in obj["users"]] if obj.get("users") is not None else None,
|
||||||
|
"_links": SelfLinksLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
93
admin/admin/models/interface_ip_mapping.py
Normal file
93
admin/admin/models/interface_ip_mapping.py
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class InterfaceIpMapping(BaseModel):
|
||||||
|
"""
|
||||||
|
InterfaceIpMapping
|
||||||
|
""" # noqa: E501
|
||||||
|
interface_name: Optional[StrictStr] = Field(default=None, description="Name of the mapping", alias="interfaceName")
|
||||||
|
ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of ipAddress entries", alias="ipAddresses")
|
||||||
|
__properties: ClassVar[List[str]] = ["interfaceName", "ipAddresses"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of InterfaceIpMapping from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
"interface_name",
|
||||||
|
"ip_addresses",
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of InterfaceIpMapping from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"interfaceName": obj.get("interfaceName"),
|
||||||
|
"ipAddresses": obj.get("ipAddresses")
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
101
admin/admin/models/link.py
Normal file
101
admin/admin/models/link.py
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class Link(BaseModel):
|
||||||
|
"""
|
||||||
|
A hyperlink from the containing resource to a URI.
|
||||||
|
""" # noqa: E501
|
||||||
|
href: StrictStr = Field(description="Its value is either a URI [RFC3986] or a URI template [RFC6570].")
|
||||||
|
templated: Optional[StrictBool] = Field(default=None, description="Should be true when the link object's \"href\" property is a URI template.")
|
||||||
|
type: Optional[StrictStr] = Field(default=None, description="Used as a hint to indicate the media type expected when dereferencing the target resource.")
|
||||||
|
deprecation: Optional[StrictStr] = Field(default=None, description="Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation.")
|
||||||
|
name: Optional[StrictStr] = Field(default=None, description="Its value may be used as a secondary key for selecting link objects that share the same relation type.")
|
||||||
|
profile: Optional[StrictStr] = Field(default=None, description="A URI that hints about the profile of the target resource.")
|
||||||
|
title: Optional[StrictStr] = Field(default=None, description="Intended for labelling the link with a human-readable identifier")
|
||||||
|
hreflang: Optional[StrictStr] = Field(default=None, description="Indicates the language of the target resource")
|
||||||
|
__properties: ClassVar[List[str]] = ["href", "templated", "type", "deprecation", "name", "profile", "title", "hreflang"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of Link from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of Link from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"href": obj.get("href"),
|
||||||
|
"templated": obj.get("templated"),
|
||||||
|
"type": obj.get("type"),
|
||||||
|
"deprecation": obj.get("deprecation"),
|
||||||
|
"name": obj.get("name"),
|
||||||
|
"profile": obj.get("profile"),
|
||||||
|
"title": obj.get("title"),
|
||||||
|
"hreflang": obj.get("hreflang")
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
91
admin/admin/models/login_account_group.py
Normal file
91
admin/admin/models/login_account_group.py
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.account_group1 import AccountGroup1
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class LoginAccountGroup(BaseModel):
|
||||||
|
"""
|
||||||
|
LoginAccountGroup
|
||||||
|
""" # noqa: E501
|
||||||
|
login_account_group: Optional[AccountGroup1] = Field(default=None, alias="loginAccountGroup")
|
||||||
|
__properties: ClassVar[List[str]] = ["loginAccountGroup"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of LoginAccountGroup from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of login_account_group
|
||||||
|
if self.login_account_group:
|
||||||
|
_dict['loginAccountGroup'] = self.login_account_group.to_dict()
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of LoginAccountGroup from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"loginAccountGroup": AccountGroup1.from_dict(obj["loginAccountGroup"]) if obj.get("loginAccountGroup") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
105
admin/admin/models/new_account_group_response.py
Normal file
105
admin/admin/models/new_account_group_response.py
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.user_account_group import UserAccountGroup
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class NewAccountGroupResponse(BaseModel):
|
||||||
|
"""
|
||||||
|
NewAccountGroupResponse
|
||||||
|
""" # noqa: E501
|
||||||
|
aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.")
|
||||||
|
account_group_name: Optional[StrictStr] = Field(default=None, description="Account group name", alias="accountGroupName")
|
||||||
|
is_current_account_group: Optional[StrictBool] = Field(default=None, description="Indicates whether the requested aid is the context of the current account.", alias="isCurrentAccountGroup")
|
||||||
|
is_default_account_group: Optional[StrictBool] = Field(default=None, description="Indicates whether the aid is the default one for the requesting user.", alias="isDefaultAccountGroup")
|
||||||
|
organization_name: Optional[StrictStr] = Field(default=None, description="(Optional) Indicates whether the aid is the default one for the requesting user.", alias="organizationName")
|
||||||
|
users: Optional[List[UserAccountGroup]] = None
|
||||||
|
__properties: ClassVar[List[str]] = ["aid", "accountGroupName", "isCurrentAccountGroup", "isDefaultAccountGroup", "organizationName", "users"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of NewAccountGroupResponse from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in users (list)
|
||||||
|
_items = []
|
||||||
|
if self.users:
|
||||||
|
for _item in self.users:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['users'] = _items
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of NewAccountGroupResponse from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"aid": obj.get("aid"),
|
||||||
|
"accountGroupName": obj.get("accountGroupName"),
|
||||||
|
"isCurrentAccountGroup": obj.get("isCurrentAccountGroup"),
|
||||||
|
"isDefaultAccountGroup": obj.get("isDefaultAccountGroup"),
|
||||||
|
"organizationName": obj.get("organizationName"),
|
||||||
|
"users": [UserAccountGroup.from_dict(_item) for _item in obj["users"]] if obj.get("users") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
91
admin/admin/models/pagination_links.py
Normal file
91
admin/admin/models/pagination_links.py
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.pagination_links_links import PaginationLinksLinks
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class PaginationLinks(BaseModel):
|
||||||
|
"""
|
||||||
|
A links object containing pagination related link(s).
|
||||||
|
""" # noqa: E501
|
||||||
|
links: Optional[PaginationLinksLinks] = Field(default=None, alias="_links")
|
||||||
|
__properties: ClassVar[List[str]] = ["_links"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of PaginationLinks from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of links
|
||||||
|
if self.links:
|
||||||
|
_dict['_links'] = self.links.to_dict()
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of PaginationLinks from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"_links": PaginationLinksLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
101
admin/admin/models/pagination_links_links.py
Normal file
101
admin/admin/models/pagination_links_links.py
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.link import Link
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class PaginationLinksLinks(BaseModel):
|
||||||
|
"""
|
||||||
|
PaginationLinksLinks
|
||||||
|
""" # noqa: E501
|
||||||
|
previous: Optional[Link] = None
|
||||||
|
next: Optional[Link] = None
|
||||||
|
var_self: Optional[Link] = Field(default=None, alias="self")
|
||||||
|
__properties: ClassVar[List[str]] = ["previous", "next", "self"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of PaginationLinksLinks from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of previous
|
||||||
|
if self.previous:
|
||||||
|
_dict['previous'] = self.previous.to_dict()
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of next
|
||||||
|
if self.next:
|
||||||
|
_dict['next'] = self.next.to_dict()
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of var_self
|
||||||
|
if self.var_self:
|
||||||
|
_dict['self'] = self.var_self.to_dict()
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of PaginationLinksLinks from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"previous": Link.from_dict(obj["previous"]) if obj.get("previous") is not None else None,
|
||||||
|
"next": Link.from_dict(obj["next"]) if obj.get("next") is not None else None,
|
||||||
|
"self": Link.from_dict(obj["self"]) if obj.get("self") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
93
admin/admin/models/permission.py
Normal file
93
admin/admin/models/permission.py
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class Permission(BaseModel):
|
||||||
|
"""
|
||||||
|
Permission
|
||||||
|
""" # noqa: E501
|
||||||
|
label: Optional[StrictStr] = Field(default=None, description="Label corresponding to the permission.")
|
||||||
|
permission_id: Optional[StrictStr] = Field(default=None, description="Unique ID representing the permission.", alias="permissionId")
|
||||||
|
is_management_permission: Optional[StrictBool] = Field(default=None, description="Flag indicating whether the permission is classified as a management permission.", alias="isManagementPermission")
|
||||||
|
permission: Optional[StrictStr] = Field(default=None, description="Permission name")
|
||||||
|
__properties: ClassVar[List[str]] = ["label", "permissionId", "isManagementPermission", "permission"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of Permission from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of Permission from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"label": obj.get("label"),
|
||||||
|
"permissionId": obj.get("permissionId"),
|
||||||
|
"isManagementPermission": obj.get("isManagementPermission"),
|
||||||
|
"permission": obj.get("permission")
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
95
admin/admin/models/permissions.py
Normal file
95
admin/admin/models/permissions.py
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.permission import Permission
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class Permissions(BaseModel):
|
||||||
|
"""
|
||||||
|
Permissions
|
||||||
|
""" # noqa: E501
|
||||||
|
permissions: Optional[List[Permission]] = None
|
||||||
|
__properties: ClassVar[List[str]] = ["permissions"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of Permissions from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in permissions (list)
|
||||||
|
_items = []
|
||||||
|
if self.permissions:
|
||||||
|
for _item in self.permissions:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['permissions'] = _items
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of Permissions from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"permissions": [Permission.from_dict(_item) for _item in obj["permissions"]] if obj.get("permissions") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
94
admin/admin/models/query_window.py
Normal file
94
admin/admin/models/query_window.py
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class QueryWindow(BaseModel):
|
||||||
|
"""
|
||||||
|
QueryWindow
|
||||||
|
""" # noqa: E501
|
||||||
|
start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate")
|
||||||
|
end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate")
|
||||||
|
__properties: ClassVar[List[str]] = ["startDate", "endDate"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of QueryWindow from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
"start_date",
|
||||||
|
"end_date",
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of QueryWindow from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"startDate": obj.get("startDate"),
|
||||||
|
"endDate": obj.get("endDate")
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
93
admin/admin/models/role.py
Normal file
93
admin/admin/models/role.py
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class Role(BaseModel):
|
||||||
|
"""
|
||||||
|
Role
|
||||||
|
""" # noqa: E501
|
||||||
|
name: Optional[StrictStr] = Field(default=None, description="Name of the role.")
|
||||||
|
role_id: Optional[StrictStr] = Field(default=None, description="Unique ID representing the role.", alias="roleId")
|
||||||
|
is_builtin: Optional[StrictBool] = Field(default=None, description="Flag indicating if the role is built-in (Account Admin, Organization Admin, Regular User).", alias="isBuiltin")
|
||||||
|
has_management_permissions: Optional[StrictBool] = Field(default=None, description="Flag indicating whether the user has management permissions.", alias="hasManagementPermissions")
|
||||||
|
__properties: ClassVar[List[str]] = ["name", "roleId", "isBuiltin", "hasManagementPermissions"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of Role from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of Role from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"name": obj.get("name"),
|
||||||
|
"roleId": obj.get("roleId"),
|
||||||
|
"isBuiltin": obj.get("isBuiltin"),
|
||||||
|
"hasManagementPermissions": obj.get("hasManagementPermissions")
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
101
admin/admin/models/role_detail.py
Normal file
101
admin/admin/models/role_detail.py
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.permission import Permission
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class RoleDetail(BaseModel):
|
||||||
|
"""
|
||||||
|
RoleDetail
|
||||||
|
""" # noqa: E501
|
||||||
|
name: Optional[StrictStr] = Field(default=None, description="Name of the role.")
|
||||||
|
role_id: Optional[StrictStr] = Field(default=None, description="Unique ID representing the role.", alias="roleId")
|
||||||
|
is_builtin: Optional[StrictBool] = Field(default=None, description="Flag indicating if the role is built-in (Account Admin, Organization Admin, Regular User).", alias="isBuiltin")
|
||||||
|
permissions: Optional[List[Permission]] = None
|
||||||
|
__properties: ClassVar[List[str]] = ["name", "roleId", "isBuiltin", "permissions"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of RoleDetail from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in permissions (list)
|
||||||
|
_items = []
|
||||||
|
if self.permissions:
|
||||||
|
for _item in self.permissions:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['permissions'] = _items
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of RoleDetail from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"name": obj.get("name"),
|
||||||
|
"roleId": obj.get("roleId"),
|
||||||
|
"isBuiltin": obj.get("isBuiltin"),
|
||||||
|
"permissions": [Permission.from_dict(_item) for _item in obj["permissions"]] if obj.get("permissions") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
89
admin/admin/models/role_request_body.py
Normal file
89
admin/admin/models/role_request_body.py
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class RoleRequestBody(BaseModel):
|
||||||
|
"""
|
||||||
|
RoleRequestBody
|
||||||
|
""" # noqa: E501
|
||||||
|
name: Optional[StrictStr] = Field(default=None, description="Name of the role.")
|
||||||
|
permissions: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test permission IDs (get `permissionId` from `/permissions` endpoint)")
|
||||||
|
__properties: ClassVar[List[str]] = ["name", "permissions"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of RoleRequestBody from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of RoleRequestBody from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"name": obj.get("name"),
|
||||||
|
"permissions": obj.get("permissions")
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
95
admin/admin/models/roles.py
Normal file
95
admin/admin/models/roles.py
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.role import Role
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class Roles(BaseModel):
|
||||||
|
"""
|
||||||
|
Roles
|
||||||
|
""" # noqa: E501
|
||||||
|
roles: Optional[List[Role]] = None
|
||||||
|
__properties: ClassVar[List[str]] = ["roles"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of Roles from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in roles (list)
|
||||||
|
_items = []
|
||||||
|
if self.roles:
|
||||||
|
for _item in self.roles:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['roles'] = _items
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of Roles from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"roles": [Role.from_dict(_item) for _item in obj["roles"]] if obj.get("roles") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
91
admin/admin/models/self_links.py
Normal file
91
admin/admin/models/self_links.py
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.self_links_links import SelfLinksLinks
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class SelfLinks(BaseModel):
|
||||||
|
"""
|
||||||
|
SelfLinks
|
||||||
|
""" # noqa: E501
|
||||||
|
links: Optional[SelfLinksLinks] = Field(default=None, alias="_links")
|
||||||
|
__properties: ClassVar[List[str]] = ["_links"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of SelfLinks from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of links
|
||||||
|
if self.links:
|
||||||
|
_dict['_links'] = self.links.to_dict()
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of SelfLinks from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"_links": SelfLinksLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
91
admin/admin/models/self_links_links.py
Normal file
91
admin/admin/models/self_links_links.py
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.link import Link
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class SelfLinksLinks(BaseModel):
|
||||||
|
"""
|
||||||
|
A links object containing the self link.
|
||||||
|
""" # noqa: E501
|
||||||
|
var_self: Optional[Link] = Field(default=None, alias="self")
|
||||||
|
__properties: ClassVar[List[str]] = ["self"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of SelfLinksLinks from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of var_self
|
||||||
|
if self.var_self:
|
||||||
|
_dict['self'] = self.var_self.to_dict()
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of SelfLinksLinks from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"self": Link.from_dict(obj["self"]) if obj.get("self") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
121
admin/admin/models/simple_agent.py
Normal file
121
admin/admin/models/simple_agent.py
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class SimpleAgent(BaseModel):
|
||||||
|
"""
|
||||||
|
SimpleAgent
|
||||||
|
""" # noqa: E501
|
||||||
|
ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of private IP addresses.", alias="ipAddresses")
|
||||||
|
public_ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of public IP addresses.", alias="publicIpAddresses")
|
||||||
|
network: Optional[StrictStr] = Field(default=None, description="Network (including ASN) of agent’s public IP.")
|
||||||
|
agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the agent.", alias="agentId")
|
||||||
|
agent_name: Optional[StrictStr] = Field(default=None, description="Name of the agent.", alias="agentName")
|
||||||
|
location: Optional[StrictStr] = Field(default=None, description="Location of the agent.")
|
||||||
|
country_id: Optional[StrictStr] = Field(default=None, description="2-digit ISO country code", alias="countryId")
|
||||||
|
enabled: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent is enabled.")
|
||||||
|
prefix: Optional[StrictStr] = Field(default=None, description="Prefix containing agents public IP address.")
|
||||||
|
verify_ssl_certificates: Optional[StrictBool] = Field(default=None, description="Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests.", alias="verifySslCertificates")
|
||||||
|
__properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "location", "countryId", "enabled", "prefix", "verifySslCertificates"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of SimpleAgent from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
* OpenAPI `readOnly` fields are excluded.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
"ip_addresses",
|
||||||
|
"public_ip_addresses",
|
||||||
|
"network",
|
||||||
|
"agent_id",
|
||||||
|
"location",
|
||||||
|
"country_id",
|
||||||
|
"prefix",
|
||||||
|
"verify_ssl_certificates",
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of SimpleAgent from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"ipAddresses": obj.get("ipAddresses"),
|
||||||
|
"publicIpAddresses": obj.get("publicIpAddresses"),
|
||||||
|
"network": obj.get("network"),
|
||||||
|
"agentId": obj.get("agentId"),
|
||||||
|
"agentName": obj.get("agentName"),
|
||||||
|
"location": obj.get("location"),
|
||||||
|
"countryId": obj.get("countryId"),
|
||||||
|
"enabled": obj.get("enabled"),
|
||||||
|
"prefix": obj.get("prefix"),
|
||||||
|
"verifySslCertificates": obj.get("verifySslCertificates")
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
89
admin/admin/models/unauthorized_error.py
Normal file
89
admin/admin/models/unauthorized_error.py
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class UnauthorizedError(BaseModel):
|
||||||
|
"""
|
||||||
|
UnauthorizedError
|
||||||
|
""" # noqa: E501
|
||||||
|
error: Optional[StrictStr] = None
|
||||||
|
error_description: Optional[StrictStr] = None
|
||||||
|
__properties: ClassVar[List[str]] = ["error", "error_description"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of UnauthorizedError from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of UnauthorizedError from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"error": obj.get("error"),
|
||||||
|
"error_description": obj.get("error_description")
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
100
admin/admin/models/user.py
Normal file
100
admin/admin/models/user.py
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.account_group1 import AccountGroup1
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class User(BaseModel):
|
||||||
|
"""
|
||||||
|
User
|
||||||
|
""" # noqa: E501
|
||||||
|
name: Optional[StrictStr] = Field(default=None, description="User's display name.")
|
||||||
|
email: Optional[StrictStr] = Field(default=None, description="User's email address.")
|
||||||
|
uid: Optional[StrictStr] = Field(default=None, description="Unique ID of the user.")
|
||||||
|
date_registered: Optional[datetime] = Field(default=None, description="UTC date the user registered their account (ISO date-time format).", alias="dateRegistered")
|
||||||
|
login_account_group: Optional[AccountGroup1] = Field(default=None, alias="loginAccountGroup")
|
||||||
|
__properties: ClassVar[List[str]] = ["name", "email", "uid", "dateRegistered", "loginAccountGroup"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of User from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of login_account_group
|
||||||
|
if self.login_account_group:
|
||||||
|
_dict['loginAccountGroup'] = self.login_account_group.to_dict()
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of User from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"name": obj.get("name"),
|
||||||
|
"email": obj.get("email"),
|
||||||
|
"uid": obj.get("uid"),
|
||||||
|
"dateRegistered": obj.get("dateRegistered"),
|
||||||
|
"loginAccountGroup": AccountGroup1.from_dict(obj["loginAccountGroup"]) if obj.get("loginAccountGroup") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
106
admin/admin/models/user_account_group.py
Normal file
106
admin/admin/models/user_account_group.py
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.role import Role
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class UserAccountGroup(BaseModel):
|
||||||
|
"""
|
||||||
|
UserAccountGroup
|
||||||
|
""" # noqa: E501
|
||||||
|
name: Optional[StrictStr] = Field(default=None, description="User's display name.")
|
||||||
|
email: Optional[StrictStr] = Field(default=None, description="User's email address.")
|
||||||
|
uid: Optional[StrictStr] = Field(default=None, description="Unique ID representing the user.")
|
||||||
|
last_login: Optional[datetime] = Field(default=None, description="User's UTC last login date (ISO date-time format).", alias="lastLogin")
|
||||||
|
date_registered: Optional[datetime] = Field(default=None, description="User's UTC registration date (ISO date-time format).", alias="dateRegistered")
|
||||||
|
roles: Optional[List[Role]] = None
|
||||||
|
__properties: ClassVar[List[str]] = ["name", "email", "uid", "lastLogin", "dateRegistered", "roles"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of UserAccountGroup from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in roles (list)
|
||||||
|
_items = []
|
||||||
|
if self.roles:
|
||||||
|
for _item in self.roles:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['roles'] = _items
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of UserAccountGroup from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"name": obj.get("name"),
|
||||||
|
"email": obj.get("email"),
|
||||||
|
"uid": obj.get("uid"),
|
||||||
|
"lastLogin": obj.get("lastLogin"),
|
||||||
|
"dateRegistered": obj.get("dateRegistered"),
|
||||||
|
"roles": [Role.from_dict(_item) for _item in obj["roles"]] if obj.get("roles") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
95
admin/admin/models/user_account_groups.py
Normal file
95
admin/admin/models/user_account_groups.py
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.user_account_group import UserAccountGroup
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class UserAccountGroups(BaseModel):
|
||||||
|
"""
|
||||||
|
UserAccountGroups
|
||||||
|
""" # noqa: E501
|
||||||
|
users: Optional[List[UserAccountGroup]] = None
|
||||||
|
__properties: ClassVar[List[str]] = ["users"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of UserAccountGroups from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in users (list)
|
||||||
|
_items = []
|
||||||
|
if self.users:
|
||||||
|
for _item in self.users:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['users'] = _items
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of UserAccountGroups from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"users": [UserAccountGroup.from_dict(_item) for _item in obj["users"]] if obj.get("users") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
122
admin/admin/models/user_detail.py
Normal file
122
admin/admin/models/user_detail.py
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.account_group1 import AccountGroup1
|
||||||
|
from admin.models.account_group_roles_account_group_roles_inner import AccountGroupRolesAccountGroupRolesInner
|
||||||
|
from admin.models.role import Role
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class UserDetail(BaseModel):
|
||||||
|
"""
|
||||||
|
UserDetail
|
||||||
|
""" # noqa: E501
|
||||||
|
name: Optional[StrictStr] = Field(default=None, description="User's display name.")
|
||||||
|
email: Optional[StrictStr] = Field(default=None, description="User's email address.")
|
||||||
|
uid: Optional[StrictStr] = Field(default=None, description="Unique ID of the user.")
|
||||||
|
date_registered: Optional[datetime] = Field(default=None, description="UTC date the user registered their account (ISO date-time format).", alias="dateRegistered")
|
||||||
|
login_account_group: Optional[AccountGroup1] = Field(default=None, alias="loginAccountGroup")
|
||||||
|
last_login: Optional[datetime] = Field(default=None, description="UTC last login of the user (ISO date-time format).", alias="lastLogin")
|
||||||
|
account_group_roles: Optional[List[AccountGroupRolesAccountGroupRolesInner]] = Field(default=None, alias="accountGroupRoles")
|
||||||
|
all_account_group_roles: Optional[List[Role]] = Field(default=None, alias="allAccountGroupRoles")
|
||||||
|
__properties: ClassVar[List[str]] = ["name", "email", "uid", "dateRegistered", "loginAccountGroup", "lastLogin", "accountGroupRoles", "allAccountGroupRoles"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of UserDetail from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of login_account_group
|
||||||
|
if self.login_account_group:
|
||||||
|
_dict['loginAccountGroup'] = self.login_account_group.to_dict()
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in account_group_roles (list)
|
||||||
|
_items = []
|
||||||
|
if self.account_group_roles:
|
||||||
|
for _item in self.account_group_roles:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['accountGroupRoles'] = _items
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in all_account_group_roles (list)
|
||||||
|
_items = []
|
||||||
|
if self.all_account_group_roles:
|
||||||
|
for _item in self.all_account_group_roles:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['allAccountGroupRoles'] = _items
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of UserDetail from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"name": obj.get("name"),
|
||||||
|
"email": obj.get("email"),
|
||||||
|
"uid": obj.get("uid"),
|
||||||
|
"dateRegistered": obj.get("dateRegistered"),
|
||||||
|
"loginAccountGroup": AccountGroup1.from_dict(obj["loginAccountGroup"]) if obj.get("loginAccountGroup") is not None else None,
|
||||||
|
"lastLogin": obj.get("lastLogin"),
|
||||||
|
"accountGroupRoles": [AccountGroupRolesAccountGroupRolesInner.from_dict(_item) for _item in obj["accountGroupRoles"]] if obj.get("accountGroupRoles") is not None else None,
|
||||||
|
"allAccountGroupRoles": [Role.from_dict(_item) for _item in obj["allAccountGroupRoles"]] if obj.get("allAccountGroupRoles") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
110
admin/admin/models/user_event.py
Normal file
110
admin/admin/models/user_event.py
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.user_event_all_of_resources_inner import UserEventAllOfResourcesInner
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class UserEvent(BaseModel):
|
||||||
|
"""
|
||||||
|
UserEvent
|
||||||
|
""" # noqa: E501
|
||||||
|
aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.")
|
||||||
|
account_group_name: Optional[StrictStr] = Field(default=None, description="Account group name", alias="accountGroupName")
|
||||||
|
var_date: Optional[datetime] = Field(default=None, description="UTC event date (ISO date-time format).", alias="date")
|
||||||
|
event: Optional[StrictStr] = Field(default=None, description="Event type.")
|
||||||
|
ip_address: Optional[StrictStr] = Field(default=None, description="Source IP address of the user.", alias="ipAddress")
|
||||||
|
uid: Optional[StrictStr] = Field(default=None, description="Unique id representing the user.")
|
||||||
|
user: Optional[StrictStr] = Field(default=None, description="The name and email address of the user.")
|
||||||
|
resources: Optional[List[UserEventAllOfResourcesInner]] = None
|
||||||
|
__properties: ClassVar[List[str]] = ["aid", "accountGroupName", "date", "event", "ipAddress", "uid", "user", "resources"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of UserEvent from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in resources (list)
|
||||||
|
_items = []
|
||||||
|
if self.resources:
|
||||||
|
for _item in self.resources:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['resources'] = _items
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of UserEvent from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"aid": obj.get("aid"),
|
||||||
|
"accountGroupName": obj.get("accountGroupName"),
|
||||||
|
"date": obj.get("date"),
|
||||||
|
"event": obj.get("event"),
|
||||||
|
"ipAddress": obj.get("ipAddress"),
|
||||||
|
"uid": obj.get("uid"),
|
||||||
|
"user": obj.get("user"),
|
||||||
|
"resources": [UserEventAllOfResourcesInner.from_dict(_item) for _item in obj["resources"]] if obj.get("resources") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
89
admin/admin/models/user_event_all_of_resources_inner.py
Normal file
89
admin/admin/models/user_event_all_of_resources_inner.py
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class UserEventAllOfResourcesInner(BaseModel):
|
||||||
|
"""
|
||||||
|
UserEventAllOfResourcesInner
|
||||||
|
""" # noqa: E501
|
||||||
|
type: Optional[StrictStr] = Field(default=None, description="Type of resource affected. Can be “testName”, “reportTitle”, “userDisplayName”, “alertRuleName”, etc.")
|
||||||
|
name: Optional[StrictStr] = Field(default=None, description="Name of the affected resource.")
|
||||||
|
__properties: ClassVar[List[str]] = ["type", "name"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of UserEventAllOfResourcesInner from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of UserEventAllOfResourcesInner from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"type": obj.get("type"),
|
||||||
|
"name": obj.get("name")
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
95
admin/admin/models/user_events.py
Normal file
95
admin/admin/models/user_events.py
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.user_event import UserEvent
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class UserEvents(BaseModel):
|
||||||
|
"""
|
||||||
|
UserEvents
|
||||||
|
""" # noqa: E501
|
||||||
|
audit_events: Optional[List[UserEvent]] = Field(default=None, alias="auditEvents")
|
||||||
|
__properties: ClassVar[List[str]] = ["auditEvents"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of UserEvents from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in audit_events (list)
|
||||||
|
_items = []
|
||||||
|
if self.audit_events:
|
||||||
|
for _item in self.audit_events:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['auditEvents'] = _items
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of UserEvents from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"auditEvents": [UserEvent.from_dict(_item) for _item in obj["auditEvents"]] if obj.get("auditEvents") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
103
admin/admin/models/user_request_body.py
Normal file
103
admin/admin/models/user_request_body.py
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.account_group_roles_request_body_inner import AccountGroupRolesRequestBodyInner
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class UserRequestBody(BaseModel):
|
||||||
|
"""
|
||||||
|
UserRequestBody
|
||||||
|
""" # noqa: E501
|
||||||
|
name: Optional[StrictStr] = Field(default=None, description="User's display name.")
|
||||||
|
email: Optional[StrictStr] = Field(default=None, description="User's email address.")
|
||||||
|
login_account_group_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the login account group.", alias="loginAccountGroupId")
|
||||||
|
account_group_roles: Optional[List[AccountGroupRolesRequestBodyInner]] = Field(default=None, alias="accountGroupRoles")
|
||||||
|
all_account_group_role_ids: Optional[List[StrictStr]] = Field(default=None, description="Unique IDs representing the roles.", alias="allAccountGroupRoleIds")
|
||||||
|
__properties: ClassVar[List[str]] = ["name", "email", "loginAccountGroupId", "accountGroupRoles", "allAccountGroupRoleIds"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of UserRequestBody from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in account_group_roles (list)
|
||||||
|
_items = []
|
||||||
|
if self.account_group_roles:
|
||||||
|
for _item in self.account_group_roles:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['accountGroupRoles'] = _items
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of UserRequestBody from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"name": obj.get("name"),
|
||||||
|
"email": obj.get("email"),
|
||||||
|
"loginAccountGroupId": obj.get("loginAccountGroupId"),
|
||||||
|
"accountGroupRoles": [AccountGroupRolesRequestBodyInner.from_dict(_item) for _item in obj["accountGroupRoles"]] if obj.get("accountGroupRoles") is not None else None,
|
||||||
|
"allAccountGroupRoleIds": obj.get("allAccountGroupRoleIds")
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
95
admin/admin/models/users.py
Normal file
95
admin/admin/models/users.py
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.extended_user import ExtendedUser
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class Users(BaseModel):
|
||||||
|
"""
|
||||||
|
Users
|
||||||
|
""" # noqa: E501
|
||||||
|
users: Optional[List[ExtendedUser]] = None
|
||||||
|
__properties: ClassVar[List[str]] = ["users"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of Users from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in users (list)
|
||||||
|
_items = []
|
||||||
|
if self.users:
|
||||||
|
for _item in self.users:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['users'] = _items
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of Users from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"users": [ExtendedUser.from_dict(_item) for _item in obj["users"]] if obj.get("users") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
110
admin/admin/models/validation_error.py
Normal file
110
admin/admin/models/validation_error.py
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from admin.models.validation_error_all_of_errors import ValidationErrorAllOfErrors
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class ValidationError(BaseModel):
|
||||||
|
"""
|
||||||
|
ValidationError
|
||||||
|
""" # noqa: E501
|
||||||
|
type: Optional[StrictStr] = Field(default=None, description="A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\".")
|
||||||
|
title: Optional[StrictStr] = Field(default=None, description="A short, human-readable summary of the problem type.")
|
||||||
|
status: Optional[StrictInt] = Field(default=None, description="The HTTP status code generated by the origin server for this occurrence of the problem.")
|
||||||
|
detail: Optional[StrictStr] = Field(default=None, description="A human-readable explanation specific to this occurrence of the problem.")
|
||||||
|
instance: Optional[StrictStr] = Field(default=None, description="A URI reference that identifies the specific occurrence of the problem.")
|
||||||
|
errors: Optional[List[ValidationErrorAllOfErrors]] = Field(default=None, description="(Optional) When multiple errors occur, the details for each error are listed.")
|
||||||
|
__properties: ClassVar[List[str]] = ["type", "title", "status", "detail", "instance", "errors"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of ValidationError from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
# override the default output from pydantic by calling `to_dict()` of each item in errors (list)
|
||||||
|
_items = []
|
||||||
|
if self.errors:
|
||||||
|
for _item in self.errors:
|
||||||
|
if _item:
|
||||||
|
_items.append(_item.to_dict())
|
||||||
|
_dict['errors'] = _items
|
||||||
|
# set to None if errors (nullable) is None
|
||||||
|
# and model_fields_set contains the field
|
||||||
|
if self.errors is None and "errors" in self.model_fields_set:
|
||||||
|
_dict['errors'] = None
|
||||||
|
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of ValidationError from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"type": obj.get("type"),
|
||||||
|
"title": obj.get("title"),
|
||||||
|
"status": obj.get("status"),
|
||||||
|
"detail": obj.get("detail"),
|
||||||
|
"instance": obj.get("instance"),
|
||||||
|
"errors": [ValidationErrorAllOfErrors.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
91
admin/admin/models/validation_error_all_of_errors.py
Normal file
91
admin/admin/models/validation_error_all_of_errors.py
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
import json
|
||||||
|
|
||||||
|
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
||||||
|
from typing import Any, ClassVar, Dict, List, Optional
|
||||||
|
from typing import Optional, Set
|
||||||
|
from typing_extensions import Self
|
||||||
|
|
||||||
|
class ValidationErrorAllOfErrors(BaseModel):
|
||||||
|
"""
|
||||||
|
ValidationErrorAllOfErrors
|
||||||
|
""" # noqa: E501
|
||||||
|
code: Optional[StrictStr] = Field(default=None, description="(Optional) A unique error type/code that can be referenced in the documentation for further details.")
|
||||||
|
var_field: Optional[StrictInt] = Field(default=None, description="Identifies the field that triggered this particular error.", alias="field")
|
||||||
|
message: Optional[StrictStr] = Field(default=None, description="A short, human-readable summary of the error.")
|
||||||
|
__properties: ClassVar[List[str]] = ["code", "field", "message"]
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True,
|
||||||
|
validate_assignment=True,
|
||||||
|
protected_namespaces=(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def to_str(self) -> str:
|
||||||
|
"""Returns the string representation of the model using alias"""
|
||||||
|
return pprint.pformat(self.model_dump(by_alias=True))
|
||||||
|
|
||||||
|
def to_json(self) -> str:
|
||||||
|
"""Returns the JSON representation of the model using alias"""
|
||||||
|
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||||
|
return json.dumps(self.to_dict())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||||
|
"""Create an instance of ValidationErrorAllOfErrors from a JSON string"""
|
||||||
|
return cls.from_dict(json.loads(json_str))
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
"""Return the dictionary representation of the model using alias.
|
||||||
|
|
||||||
|
This has the following differences from calling pydantic's
|
||||||
|
`self.model_dump(by_alias=True)`:
|
||||||
|
|
||||||
|
* `None` is only added to the output dict for nullable fields that
|
||||||
|
were set at model initialization. Other fields with value `None`
|
||||||
|
are ignored.
|
||||||
|
"""
|
||||||
|
excluded_fields: Set[str] = set([
|
||||||
|
])
|
||||||
|
|
||||||
|
_dict = self.model_dump(
|
||||||
|
by_alias=True,
|
||||||
|
exclude=excluded_fields,
|
||||||
|
exclude_none=True,
|
||||||
|
)
|
||||||
|
return _dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||||
|
"""Create an instance of ValidationErrorAllOfErrors from a dict"""
|
||||||
|
if obj is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not isinstance(obj, dict):
|
||||||
|
return cls.model_validate(obj)
|
||||||
|
|
||||||
|
_obj = cls.model_validate({
|
||||||
|
"code": obj.get("code"),
|
||||||
|
"field": obj.get("field"),
|
||||||
|
"message": obj.get("message")
|
||||||
|
})
|
||||||
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
257
admin/admin/rest.py
Normal file
257
admin/admin/rest.py
Normal file
@ -0,0 +1,257 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
Administrative API
|
||||||
|
|
||||||
|
## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management).
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 7.0.2
|
||||||
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
import io
|
||||||
|
import json
|
||||||
|
import re
|
||||||
|
import ssl
|
||||||
|
|
||||||
|
import urllib3
|
||||||
|
|
||||||
|
from admin.exceptions import ApiException, ApiValueError
|
||||||
|
|
||||||
|
SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"}
|
||||||
|
RESTResponseType = urllib3.HTTPResponse
|
||||||
|
|
||||||
|
|
||||||
|
def is_socks_proxy_url(url):
|
||||||
|
if url is None:
|
||||||
|
return False
|
||||||
|
split_section = url.split("://")
|
||||||
|
if len(split_section) < 2:
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES
|
||||||
|
|
||||||
|
|
||||||
|
class RESTResponse(io.IOBase):
|
||||||
|
|
||||||
|
def __init__(self, resp) -> None:
|
||||||
|
self.response = resp
|
||||||
|
self.status = resp.status
|
||||||
|
self.reason = resp.reason
|
||||||
|
self.data = None
|
||||||
|
|
||||||
|
def read(self):
|
||||||
|
if self.data is None:
|
||||||
|
self.data = self.response.data
|
||||||
|
return self.data
|
||||||
|
|
||||||
|
def getheaders(self):
|
||||||
|
"""Returns a dictionary of the response headers."""
|
||||||
|
return self.response.headers
|
||||||
|
|
||||||
|
def getheader(self, name, default=None):
|
||||||
|
"""Returns a given response header."""
|
||||||
|
return self.response.headers.get(name, default)
|
||||||
|
|
||||||
|
|
||||||
|
class RESTClientObject:
|
||||||
|
|
||||||
|
def __init__(self, configuration) -> None:
|
||||||
|
# urllib3.PoolManager will pass all kw parameters to connectionpool
|
||||||
|
# https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501
|
||||||
|
# https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501
|
||||||
|
# Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501
|
||||||
|
|
||||||
|
# cert_reqs
|
||||||
|
if configuration.verify_ssl:
|
||||||
|
cert_reqs = ssl.CERT_REQUIRED
|
||||||
|
else:
|
||||||
|
cert_reqs = ssl.CERT_NONE
|
||||||
|
|
||||||
|
pool_args = {
|
||||||
|
"cert_reqs": cert_reqs,
|
||||||
|
"ca_certs": configuration.ssl_ca_cert,
|
||||||
|
"cert_file": configuration.cert_file,
|
||||||
|
"key_file": configuration.key_file,
|
||||||
|
}
|
||||||
|
if configuration.assert_hostname is not None:
|
||||||
|
pool_args['assert_hostname'] = (
|
||||||
|
configuration.assert_hostname
|
||||||
|
)
|
||||||
|
|
||||||
|
if configuration.retries is not None:
|
||||||
|
pool_args['retries'] = configuration.retries
|
||||||
|
|
||||||
|
if configuration.tls_server_name:
|
||||||
|
pool_args['server_hostname'] = configuration.tls_server_name
|
||||||
|
|
||||||
|
|
||||||
|
if configuration.socket_options is not None:
|
||||||
|
pool_args['socket_options'] = configuration.socket_options
|
||||||
|
|
||||||
|
if configuration.connection_pool_maxsize is not None:
|
||||||
|
pool_args['maxsize'] = configuration.connection_pool_maxsize
|
||||||
|
|
||||||
|
# https pool manager
|
||||||
|
self.pool_manager: urllib3.PoolManager
|
||||||
|
|
||||||
|
if configuration.proxy:
|
||||||
|
if is_socks_proxy_url(configuration.proxy):
|
||||||
|
from urllib3.contrib.socks import SOCKSProxyManager
|
||||||
|
pool_args["proxy_url"] = configuration.proxy
|
||||||
|
pool_args["headers"] = configuration.proxy_headers
|
||||||
|
self.pool_manager = SOCKSProxyManager(**pool_args)
|
||||||
|
else:
|
||||||
|
pool_args["proxy_url"] = configuration.proxy
|
||||||
|
pool_args["proxy_headers"] = configuration.proxy_headers
|
||||||
|
self.pool_manager = urllib3.ProxyManager(**pool_args)
|
||||||
|
else:
|
||||||
|
self.pool_manager = urllib3.PoolManager(**pool_args)
|
||||||
|
|
||||||
|
def request(
|
||||||
|
self,
|
||||||
|
method,
|
||||||
|
url,
|
||||||
|
headers=None,
|
||||||
|
body=None,
|
||||||
|
post_params=None,
|
||||||
|
_request_timeout=None
|
||||||
|
):
|
||||||
|
"""Perform requests.
|
||||||
|
|
||||||
|
:param method: http request method
|
||||||
|
:param url: http request url
|
||||||
|
:param headers: http request headers
|
||||||
|
:param body: request json body, for `application/json`
|
||||||
|
:param post_params: request post parameters,
|
||||||
|
`application/x-www-form-urlencoded`
|
||||||
|
and `multipart/form-data`
|
||||||
|
:param _request_timeout: timeout setting for this request. If one
|
||||||
|
number provided, it will be total request
|
||||||
|
timeout. It can also be a pair (tuple) of
|
||||||
|
(connection, read) timeouts.
|
||||||
|
"""
|
||||||
|
method = method.upper()
|
||||||
|
assert method in [
|
||||||
|
'GET',
|
||||||
|
'HEAD',
|
||||||
|
'DELETE',
|
||||||
|
'POST',
|
||||||
|
'PUT',
|
||||||
|
'PATCH',
|
||||||
|
'OPTIONS'
|
||||||
|
]
|
||||||
|
|
||||||
|
if post_params and body:
|
||||||
|
raise ApiValueError(
|
||||||
|
"body parameter cannot be used with post_params parameter."
|
||||||
|
)
|
||||||
|
|
||||||
|
post_params = post_params or {}
|
||||||
|
headers = headers or {}
|
||||||
|
|
||||||
|
timeout = None
|
||||||
|
if _request_timeout:
|
||||||
|
if isinstance(_request_timeout, (int, float)):
|
||||||
|
timeout = urllib3.Timeout(total=_request_timeout)
|
||||||
|
elif (
|
||||||
|
isinstance(_request_timeout, tuple)
|
||||||
|
and len(_request_timeout) == 2
|
||||||
|
):
|
||||||
|
timeout = urllib3.Timeout(
|
||||||
|
connect=_request_timeout[0],
|
||||||
|
read=_request_timeout[1]
|
||||||
|
)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
|
||||||
|
if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
|
||||||
|
|
||||||
|
# no content type provided or payload is json
|
||||||
|
content_type = headers.get('Content-Type')
|
||||||
|
if (
|
||||||
|
not content_type
|
||||||
|
or re.search('json', content_type, re.IGNORECASE)
|
||||||
|
):
|
||||||
|
request_body = None
|
||||||
|
if body is not None:
|
||||||
|
request_body = json.dumps(body)
|
||||||
|
r = self.pool_manager.request(
|
||||||
|
method,
|
||||||
|
url,
|
||||||
|
body=request_body,
|
||||||
|
timeout=timeout,
|
||||||
|
headers=headers,
|
||||||
|
preload_content=False
|
||||||
|
)
|
||||||
|
elif content_type == 'application/x-www-form-urlencoded':
|
||||||
|
r = self.pool_manager.request(
|
||||||
|
method,
|
||||||
|
url,
|
||||||
|
fields=post_params,
|
||||||
|
encode_multipart=False,
|
||||||
|
timeout=timeout,
|
||||||
|
headers=headers,
|
||||||
|
preload_content=False
|
||||||
|
)
|
||||||
|
elif content_type == 'multipart/form-data':
|
||||||
|
# must del headers['Content-Type'], or the correct
|
||||||
|
# Content-Type which generated by urllib3 will be
|
||||||
|
# overwritten.
|
||||||
|
del headers['Content-Type']
|
||||||
|
# Ensures that dict objects are serialized
|
||||||
|
post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params]
|
||||||
|
r = self.pool_manager.request(
|
||||||
|
method,
|
||||||
|
url,
|
||||||
|
fields=post_params,
|
||||||
|
encode_multipart=True,
|
||||||
|
timeout=timeout,
|
||||||
|
headers=headers,
|
||||||
|
preload_content=False
|
||||||
|
)
|
||||||
|
# Pass a `string` parameter directly in the body to support
|
||||||
|
# other content types than JSON when `body` argument is
|
||||||
|
# provided in serialized form.
|
||||||
|
elif isinstance(body, str) or isinstance(body, bytes):
|
||||||
|
r = self.pool_manager.request(
|
||||||
|
method,
|
||||||
|
url,
|
||||||
|
body=body,
|
||||||
|
timeout=timeout,
|
||||||
|
headers=headers,
|
||||||
|
preload_content=False
|
||||||
|
)
|
||||||
|
elif headers['Content-Type'] == 'text/plain' and isinstance(body, bool):
|
||||||
|
request_body = "true" if body else "false"
|
||||||
|
r = self.pool_manager.request(
|
||||||
|
method,
|
||||||
|
url,
|
||||||
|
body=request_body,
|
||||||
|
preload_content=False,
|
||||||
|
timeout=timeout,
|
||||||
|
headers=headers)
|
||||||
|
else:
|
||||||
|
# Cannot generate the request from given parameters
|
||||||
|
msg = """Cannot prepare a request message for provided
|
||||||
|
arguments. Please check that your arguments match
|
||||||
|
declared content type."""
|
||||||
|
raise ApiException(status=0, reason=msg)
|
||||||
|
# For `GET`, `HEAD`
|
||||||
|
else:
|
||||||
|
r = self.pool_manager.request(
|
||||||
|
method,
|
||||||
|
url,
|
||||||
|
fields={},
|
||||||
|
timeout=timeout,
|
||||||
|
headers=headers,
|
||||||
|
preload_content=False
|
||||||
|
)
|
||||||
|
except urllib3.exceptions.SSLError as e:
|
||||||
|
msg = "\n".join([type(e).__name__, str(e)])
|
||||||
|
raise ApiException(status=0, reason=msg)
|
||||||
|
|
||||||
|
return RESTResponse(r)
|
||||||
33
admin/docs/AccountGroup.md
Normal file
33
admin/docs/AccountGroup.md
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# AccountGroup
|
||||||
|
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional]
|
||||||
|
**account_group_name** | **str** | Account group name | [optional]
|
||||||
|
**is_current_account_group** | **bool** | Indicates whether the requested aid is the context of the current account. | [optional]
|
||||||
|
**is_default_account_group** | **bool** | Indicates whether the aid is the default one for the requesting user. | [optional]
|
||||||
|
**organization_name** | **str** | (Optional) Indicates whether the aid is the default one for the requesting user. | [optional]
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
from admin.models.account_group import AccountGroup
|
||||||
|
|
||||||
|
# TODO update the JSON string below
|
||||||
|
json = "{}"
|
||||||
|
# create an instance of AccountGroup from a JSON string
|
||||||
|
account_group_instance = AccountGroup.from_json(json)
|
||||||
|
# print the JSON string representation of the object
|
||||||
|
print(AccountGroup.to_json())
|
||||||
|
|
||||||
|
# convert the object into a dict
|
||||||
|
account_group_dict = account_group_instance.to_dict()
|
||||||
|
# create an instance of AccountGroup from a dict
|
||||||
|
account_group_from_dict = AccountGroup.from_dict(account_group_dict)
|
||||||
|
```
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional]
|
**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional]
|
||||||
@ -10,19 +11,19 @@ Name | Type | Description | Notes
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from admin_api.models.account_group1 import AccountGroup1
|
from admin.models.account_group1 import AccountGroup1
|
||||||
|
|
||||||
# TODO update the JSON string below
|
# TODO update the JSON string below
|
||||||
json = "{}"
|
json = "{}"
|
||||||
# create an instance of AccountGroup1 from a JSON string
|
# create an instance of AccountGroup1 from a JSON string
|
||||||
account_group1_instance = AccountGroup1.from_json(json)
|
account_group1_instance = AccountGroup1.from_json(json)
|
||||||
# print the JSON string representation of the object
|
# print the JSON string representation of the object
|
||||||
print AccountGroup1.to_json()
|
print(AccountGroup1.to_json())
|
||||||
|
|
||||||
# convert the object into a dict
|
# convert the object into a dict
|
||||||
account_group1_dict = account_group1_instance.to_dict()
|
account_group1_dict = account_group1_instance.to_dict()
|
||||||
# create an instance of AccountGroup1 from a dict
|
# create an instance of AccountGroup1 from a dict
|
||||||
account_group1_form_dict = account_group1.from_dict(account_group1_dict)
|
account_group1_from_dict = AccountGroup1.from_dict(account_group1_dict)
|
||||||
```
|
```
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional]
|
**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional]
|
||||||
@ -15,19 +16,19 @@ Name | Type | Description | Notes
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from admin_api.models.account_group_detail import AccountGroupDetail
|
from admin.models.account_group_detail import AccountGroupDetail
|
||||||
|
|
||||||
# TODO update the JSON string below
|
# TODO update the JSON string below
|
||||||
json = "{}"
|
json = "{}"
|
||||||
# create an instance of AccountGroupDetail from a JSON string
|
# create an instance of AccountGroupDetail from a JSON string
|
||||||
account_group_detail_instance = AccountGroupDetail.from_json(json)
|
account_group_detail_instance = AccountGroupDetail.from_json(json)
|
||||||
# print the JSON string representation of the object
|
# print the JSON string representation of the object
|
||||||
print AccountGroupDetail.to_json()
|
print(AccountGroupDetail.to_json())
|
||||||
|
|
||||||
# convert the object into a dict
|
# convert the object into a dict
|
||||||
account_group_detail_dict = account_group_detail_instance.to_dict()
|
account_group_detail_dict = account_group_detail_instance.to_dict()
|
||||||
# create an instance of AccountGroupDetail from a dict
|
# create an instance of AccountGroupDetail from a dict
|
||||||
account_group_detail_form_dict = account_group_detail.from_dict(account_group_detail_dict)
|
account_group_detail_from_dict = AccountGroupDetail.from_dict(account_group_detail_dict)
|
||||||
```
|
```
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
29
admin/docs/AccountGroupId.md
Normal file
29
admin/docs/AccountGroupId.md
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# AccountGroupId
|
||||||
|
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional]
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
from admin.models.account_group_id import AccountGroupId
|
||||||
|
|
||||||
|
# TODO update the JSON string below
|
||||||
|
json = "{}"
|
||||||
|
# create an instance of AccountGroupId from a JSON string
|
||||||
|
account_group_id_instance = AccountGroupId.from_json(json)
|
||||||
|
# print the JSON string representation of the object
|
||||||
|
print(AccountGroupId.to_json())
|
||||||
|
|
||||||
|
# convert the object into a dict
|
||||||
|
account_group_id_dict = account_group_id_instance.to_dict()
|
||||||
|
# create an instance of AccountGroupId from a dict
|
||||||
|
account_group_id_from_dict = AccountGroupId.from_dict(account_group_id_dict)
|
||||||
|
```
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**account_group_name** | **str** | The name of the account group |
|
**account_group_name** | **str** | The name of the account group |
|
||||||
@ -10,19 +11,19 @@ Name | Type | Description | Notes
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from admin_api.models.account_group_request_body import AccountGroupRequestBody
|
from admin.models.account_group_request_body import AccountGroupRequestBody
|
||||||
|
|
||||||
# TODO update the JSON string below
|
# TODO update the JSON string below
|
||||||
json = "{}"
|
json = "{}"
|
||||||
# create an instance of AccountGroupRequestBody from a JSON string
|
# create an instance of AccountGroupRequestBody from a JSON string
|
||||||
account_group_request_body_instance = AccountGroupRequestBody.from_json(json)
|
account_group_request_body_instance = AccountGroupRequestBody.from_json(json)
|
||||||
# print the JSON string representation of the object
|
# print the JSON string representation of the object
|
||||||
print AccountGroupRequestBody.to_json()
|
print(AccountGroupRequestBody.to_json())
|
||||||
|
|
||||||
# convert the object into a dict
|
# convert the object into a dict
|
||||||
account_group_request_body_dict = account_group_request_body_instance.to_dict()
|
account_group_request_body_dict = account_group_request_body_instance.to_dict()
|
||||||
# create an instance of AccountGroupRequestBody from a dict
|
# create an instance of AccountGroupRequestBody from a dict
|
||||||
account_group_request_body_form_dict = account_group_request_body.from_dict(account_group_request_body_dict)
|
account_group_request_body_from_dict = AccountGroupRequestBody.from_dict(account_group_request_body_dict)
|
||||||
```
|
```
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**account_group_roles** | [**List[AccountGroupRolesAccountGroupRolesInner]**](AccountGroupRolesAccountGroupRolesInner.md) | | [optional]
|
**account_group_roles** | [**List[AccountGroupRolesAccountGroupRolesInner]**](AccountGroupRolesAccountGroupRolesInner.md) | | [optional]
|
||||||
@ -9,19 +10,19 @@ Name | Type | Description | Notes
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from admin_api.models.account_group_roles import AccountGroupRoles
|
from admin.models.account_group_roles import AccountGroupRoles
|
||||||
|
|
||||||
# TODO update the JSON string below
|
# TODO update the JSON string below
|
||||||
json = "{}"
|
json = "{}"
|
||||||
# create an instance of AccountGroupRoles from a JSON string
|
# create an instance of AccountGroupRoles from a JSON string
|
||||||
account_group_roles_instance = AccountGroupRoles.from_json(json)
|
account_group_roles_instance = AccountGroupRoles.from_json(json)
|
||||||
# print the JSON string representation of the object
|
# print the JSON string representation of the object
|
||||||
print AccountGroupRoles.to_json()
|
print(AccountGroupRoles.to_json())
|
||||||
|
|
||||||
# convert the object into a dict
|
# convert the object into a dict
|
||||||
account_group_roles_dict = account_group_roles_instance.to_dict()
|
account_group_roles_dict = account_group_roles_instance.to_dict()
|
||||||
# create an instance of AccountGroupRoles from a dict
|
# create an instance of AccountGroupRoles from a dict
|
||||||
account_group_roles_form_dict = account_group_roles.from_dict(account_group_roles_dict)
|
account_group_roles_from_dict = AccountGroupRoles.from_dict(account_group_roles_dict)
|
||||||
```
|
```
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
30
admin/docs/AccountGroupRolesAccountGroupRolesInner.md
Normal file
30
admin/docs/AccountGroupRolesAccountGroupRolesInner.md
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
# AccountGroupRolesAccountGroupRolesInner
|
||||||
|
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**account_group** | [**AccountGroup1**](AccountGroup1.md) | | [optional]
|
||||||
|
**roles** | [**List[Role]**](Role.md) | | [optional]
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
from admin.models.account_group_roles_account_group_roles_inner import AccountGroupRolesAccountGroupRolesInner
|
||||||
|
|
||||||
|
# TODO update the JSON string below
|
||||||
|
json = "{}"
|
||||||
|
# create an instance of AccountGroupRolesAccountGroupRolesInner from a JSON string
|
||||||
|
account_group_roles_account_group_roles_inner_instance = AccountGroupRolesAccountGroupRolesInner.from_json(json)
|
||||||
|
# print the JSON string representation of the object
|
||||||
|
print(AccountGroupRolesAccountGroupRolesInner.to_json())
|
||||||
|
|
||||||
|
# convert the object into a dict
|
||||||
|
account_group_roles_account_group_roles_inner_dict = account_group_roles_account_group_roles_inner_instance.to_dict()
|
||||||
|
# create an instance of AccountGroupRolesAccountGroupRolesInner from a dict
|
||||||
|
account_group_roles_account_group_roles_inner_from_dict = AccountGroupRolesAccountGroupRolesInner.from_dict(account_group_roles_account_group_roles_inner_dict)
|
||||||
|
```
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**account_group_id** | **str** | Unique ID of the account group. | [optional]
|
**account_group_id** | **str** | Unique ID of the account group. | [optional]
|
||||||
@ -10,19 +11,19 @@ Name | Type | Description | Notes
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from admin_api.models.account_group_roles_request_body_inner import AccountGroupRolesRequestBodyInner
|
from admin.models.account_group_roles_request_body_inner import AccountGroupRolesRequestBodyInner
|
||||||
|
|
||||||
# TODO update the JSON string below
|
# TODO update the JSON string below
|
||||||
json = "{}"
|
json = "{}"
|
||||||
# create an instance of AccountGroupRolesRequestBodyInner from a JSON string
|
# create an instance of AccountGroupRolesRequestBodyInner from a JSON string
|
||||||
account_group_roles_request_body_inner_instance = AccountGroupRolesRequestBodyInner.from_json(json)
|
account_group_roles_request_body_inner_instance = AccountGroupRolesRequestBodyInner.from_json(json)
|
||||||
# print the JSON string representation of the object
|
# print the JSON string representation of the object
|
||||||
print AccountGroupRolesRequestBodyInner.to_json()
|
print(AccountGroupRolesRequestBodyInner.to_json())
|
||||||
|
|
||||||
# convert the object into a dict
|
# convert the object into a dict
|
||||||
account_group_roles_request_body_inner_dict = account_group_roles_request_body_inner_instance.to_dict()
|
account_group_roles_request_body_inner_dict = account_group_roles_request_body_inner_instance.to_dict()
|
||||||
# create an instance of AccountGroupRolesRequestBodyInner from a dict
|
# create an instance of AccountGroupRolesRequestBodyInner from a dict
|
||||||
account_group_roles_request_body_inner_form_dict = account_group_roles_request_body_inner.from_dict(account_group_roles_request_body_inner_dict)
|
account_group_roles_request_body_inner_from_dict = AccountGroupRolesRequestBodyInner.from_dict(account_group_roles_request_body_inner_dict)
|
||||||
```
|
```
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**account_groups** | [**List[AccountGroup]**](AccountGroup.md) | | [optional]
|
**account_groups** | [**List[AccountGroup]**](AccountGroup.md) | | [optional]
|
||||||
@ -9,19 +10,19 @@ Name | Type | Description | Notes
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from admin_api.models.account_groups import AccountGroups
|
from admin.models.account_groups import AccountGroups
|
||||||
|
|
||||||
# TODO update the JSON string below
|
# TODO update the JSON string below
|
||||||
json = "{}"
|
json = "{}"
|
||||||
# create an instance of AccountGroups from a JSON string
|
# create an instance of AccountGroups from a JSON string
|
||||||
account_groups_instance = AccountGroups.from_json(json)
|
account_groups_instance = AccountGroups.from_json(json)
|
||||||
# print the JSON string representation of the object
|
# print the JSON string representation of the object
|
||||||
print AccountGroups.to_json()
|
print(AccountGroups.to_json())
|
||||||
|
|
||||||
# convert the object into a dict
|
# convert the object into a dict
|
||||||
account_groups_dict = account_groups_instance.to_dict()
|
account_groups_dict = account_groups_instance.to_dict()
|
||||||
# create an instance of AccountGroups from a dict
|
# create an instance of AccountGroups from a dict
|
||||||
account_groups_form_dict = account_groups.from_dict(account_groups_dict)
|
account_groups_from_dict = AccountGroups.from_dict(account_groups_dict)
|
||||||
```
|
```
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
# admin_api.AccountGroupsApi
|
# admin.AccountGroupsApi
|
||||||
|
|
||||||
All URIs are relative to *https://api.thousandeyes.com*
|
All URIs are relative to *https://api.thousandeyes.com*
|
||||||
|
|
||||||
@ -21,19 +21,18 @@ Creates a new account group. This operation requires the `Edit all account group
|
|||||||
### Example
|
### Example
|
||||||
|
|
||||||
* Bearer Authentication (BearerAuth):
|
* Bearer Authentication (BearerAuth):
|
||||||
|
|
||||||
```python
|
```python
|
||||||
import time
|
import admin
|
||||||
import os
|
from admin.models.account_group_request_body import AccountGroupRequestBody
|
||||||
import admin_api
|
from admin.models.create_account_group201_response import CreateAccountGroup201Response
|
||||||
from admin_api.models.account_group_request_body import AccountGroupRequestBody
|
from admin.models.expand import Expand
|
||||||
from admin_api.models.create_account_group201_response import CreateAccountGroup201Response
|
from admin.rest import ApiException
|
||||||
from admin_api.models.expand import Expand
|
|
||||||
from admin_api.rest import ApiException
|
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
|
|
||||||
# Defining the host is optional and defaults to https://api.thousandeyes.com
|
# Defining the host is optional and defaults to https://api.thousandeyes.com
|
||||||
# See configuration.py for a list of all supported configuration parameters.
|
# See configuration.py for a list of all supported configuration parameters.
|
||||||
configuration = admin_api.Configuration(
|
configuration = admin.Configuration(
|
||||||
host = "https://api.thousandeyes.com"
|
host = "https://api.thousandeyes.com"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -43,16 +42,16 @@ configuration = admin_api.Configuration(
|
|||||||
# satisfies your auth use case.
|
# satisfies your auth use case.
|
||||||
|
|
||||||
# Configure Bearer authorization: BearerAuth
|
# Configure Bearer authorization: BearerAuth
|
||||||
configuration = admin_api.Configuration(
|
configuration = admin.Configuration(
|
||||||
access_token = os.environ["BEARER_TOKEN"]
|
access_token = os.environ["BEARER_TOKEN"]
|
||||||
)
|
)
|
||||||
|
|
||||||
# Enter a context with an instance of the API client
|
# Enter a context with an instance of the API client
|
||||||
with admin_api.ApiClient(configuration) as api_client:
|
with admin.ApiClient(configuration) as api_client:
|
||||||
# Create an instance of the API class
|
# Create an instance of the API class
|
||||||
api_instance = admin_api.AccountGroupsApi(api_client)
|
api_instance = admin.AccountGroupsApi(api_client)
|
||||||
account_group_request_body = admin_api.AccountGroupRequestBody() # AccountGroupRequestBody |
|
account_group_request_body = admin.AccountGroupRequestBody() # AccountGroupRequestBody |
|
||||||
expand = [admin_api.Expand()] # List[Expand] | Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. (optional)
|
expand = [admin.Expand()] # List[Expand] | Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. (optional)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Create account group
|
# Create account group
|
||||||
@ -67,6 +66,7 @@ with admin_api.ApiClient(configuration) as api_client:
|
|||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**account_group_request_body** | [**AccountGroupRequestBody**](AccountGroupRequestBody.md)| |
|
**account_group_request_body** | [**AccountGroupRequestBody**](AccountGroupRequestBody.md)| |
|
||||||
@ -86,6 +86,7 @@ Name | Type | Description | Notes
|
|||||||
- **Accept**: application/hal+json, application/problem+json
|
- **Accept**: application/hal+json, application/problem+json
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
|-------------|-------------|------------------|
|
|-------------|-------------|------------------|
|
||||||
**201** | Created | * Location - <br> |
|
**201** | Created | * Location - <br> |
|
||||||
@ -108,16 +109,15 @@ Deletes an account group using its ID. This operation requires the following per
|
|||||||
### Example
|
### Example
|
||||||
|
|
||||||
* Bearer Authentication (BearerAuth):
|
* Bearer Authentication (BearerAuth):
|
||||||
|
|
||||||
```python
|
```python
|
||||||
import time
|
import admin
|
||||||
import os
|
from admin.rest import ApiException
|
||||||
import admin_api
|
|
||||||
from admin_api.rest import ApiException
|
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
|
|
||||||
# Defining the host is optional and defaults to https://api.thousandeyes.com
|
# Defining the host is optional and defaults to https://api.thousandeyes.com
|
||||||
# See configuration.py for a list of all supported configuration parameters.
|
# See configuration.py for a list of all supported configuration parameters.
|
||||||
configuration = admin_api.Configuration(
|
configuration = admin.Configuration(
|
||||||
host = "https://api.thousandeyes.com"
|
host = "https://api.thousandeyes.com"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -127,15 +127,15 @@ configuration = admin_api.Configuration(
|
|||||||
# satisfies your auth use case.
|
# satisfies your auth use case.
|
||||||
|
|
||||||
# Configure Bearer authorization: BearerAuth
|
# Configure Bearer authorization: BearerAuth
|
||||||
configuration = admin_api.Configuration(
|
configuration = admin.Configuration(
|
||||||
access_token = os.environ["BEARER_TOKEN"]
|
access_token = os.environ["BEARER_TOKEN"]
|
||||||
)
|
)
|
||||||
|
|
||||||
# Enter a context with an instance of the API client
|
# Enter a context with an instance of the API client
|
||||||
with admin_api.ApiClient(configuration) as api_client:
|
with admin.ApiClient(configuration) as api_client:
|
||||||
# Create an instance of the API class
|
# Create an instance of the API class
|
||||||
api_instance = admin_api.AccountGroupsApi(api_client)
|
api_instance = admin.AccountGroupsApi(api_client)
|
||||||
id = '2067' # str | Identifier for the account group.
|
id = '1234' # str | Identifier for the account group.
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Delete account group
|
# Delete account group
|
||||||
@ -148,6 +148,7 @@ with admin_api.ApiClient(configuration) as api_client:
|
|||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**id** | **str**| Identifier for the account group. |
|
**id** | **str**| Identifier for the account group. |
|
||||||
@ -163,9 +164,10 @@ void (empty response body)
|
|||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: application/json, application/problem+json
|
- **Accept**: application/problem+json
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
|-------------|-------------|------------------|
|
|-------------|-------------|------------------|
|
||||||
**204** | No content | - |
|
**204** | No content | - |
|
||||||
@ -188,18 +190,17 @@ Retrieves detailed information about an account group using its ID. This operat
|
|||||||
### Example
|
### Example
|
||||||
|
|
||||||
* Bearer Authentication (BearerAuth):
|
* Bearer Authentication (BearerAuth):
|
||||||
|
|
||||||
```python
|
```python
|
||||||
import time
|
import admin
|
||||||
import os
|
from admin.models.expand import Expand
|
||||||
import admin_api
|
from admin.models.get_account_group200_response import GetAccountGroup200Response
|
||||||
from admin_api.models.expand import Expand
|
from admin.rest import ApiException
|
||||||
from admin_api.models.get_account_group200_response import GetAccountGroup200Response
|
|
||||||
from admin_api.rest import ApiException
|
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
|
|
||||||
# Defining the host is optional and defaults to https://api.thousandeyes.com
|
# Defining the host is optional and defaults to https://api.thousandeyes.com
|
||||||
# See configuration.py for a list of all supported configuration parameters.
|
# See configuration.py for a list of all supported configuration parameters.
|
||||||
configuration = admin_api.Configuration(
|
configuration = admin.Configuration(
|
||||||
host = "https://api.thousandeyes.com"
|
host = "https://api.thousandeyes.com"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -209,16 +210,16 @@ configuration = admin_api.Configuration(
|
|||||||
# satisfies your auth use case.
|
# satisfies your auth use case.
|
||||||
|
|
||||||
# Configure Bearer authorization: BearerAuth
|
# Configure Bearer authorization: BearerAuth
|
||||||
configuration = admin_api.Configuration(
|
configuration = admin.Configuration(
|
||||||
access_token = os.environ["BEARER_TOKEN"]
|
access_token = os.environ["BEARER_TOKEN"]
|
||||||
)
|
)
|
||||||
|
|
||||||
# Enter a context with an instance of the API client
|
# Enter a context with an instance of the API client
|
||||||
with admin_api.ApiClient(configuration) as api_client:
|
with admin.ApiClient(configuration) as api_client:
|
||||||
# Create an instance of the API class
|
# Create an instance of the API class
|
||||||
api_instance = admin_api.AccountGroupsApi(api_client)
|
api_instance = admin.AccountGroupsApi(api_client)
|
||||||
id = '2067' # str | Identifier for the account group.
|
id = '1234' # str | Identifier for the account group.
|
||||||
expand = [admin_api.Expand()] # List[Expand] | Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. (optional)
|
expand = [admin.Expand()] # List[Expand] | Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. (optional)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Retrieve account group
|
# Retrieve account group
|
||||||
@ -233,6 +234,7 @@ with admin_api.ApiClient(configuration) as api_client:
|
|||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**id** | **str**| Identifier for the account group. |
|
**id** | **str**| Identifier for the account group. |
|
||||||
@ -252,6 +254,7 @@ Name | Type | Description | Notes
|
|||||||
- **Accept**: application/hal+json, application/problem+json
|
- **Accept**: application/hal+json, application/problem+json
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
|-------------|-------------|------------------|
|
|-------------|-------------|------------------|
|
||||||
**200** | OK | - |
|
**200** | OK | - |
|
||||||
@ -274,17 +277,16 @@ Retrieves a list of account groups available to the current user.
|
|||||||
### Example
|
### Example
|
||||||
|
|
||||||
* Bearer Authentication (BearerAuth):
|
* Bearer Authentication (BearerAuth):
|
||||||
|
|
||||||
```python
|
```python
|
||||||
import time
|
import admin
|
||||||
import os
|
from admin.models.get_account_groups200_response import GetAccountGroups200Response
|
||||||
import admin_api
|
from admin.rest import ApiException
|
||||||
from admin_api.models.get_account_groups200_response import GetAccountGroups200Response
|
|
||||||
from admin_api.rest import ApiException
|
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
|
|
||||||
# Defining the host is optional and defaults to https://api.thousandeyes.com
|
# Defining the host is optional and defaults to https://api.thousandeyes.com
|
||||||
# See configuration.py for a list of all supported configuration parameters.
|
# See configuration.py for a list of all supported configuration parameters.
|
||||||
configuration = admin_api.Configuration(
|
configuration = admin.Configuration(
|
||||||
host = "https://api.thousandeyes.com"
|
host = "https://api.thousandeyes.com"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -294,15 +296,15 @@ configuration = admin_api.Configuration(
|
|||||||
# satisfies your auth use case.
|
# satisfies your auth use case.
|
||||||
|
|
||||||
# Configure Bearer authorization: BearerAuth
|
# Configure Bearer authorization: BearerAuth
|
||||||
configuration = admin_api.Configuration(
|
configuration = admin.Configuration(
|
||||||
access_token = os.environ["BEARER_TOKEN"]
|
access_token = os.environ["BEARER_TOKEN"]
|
||||||
)
|
)
|
||||||
|
|
||||||
# Enter a context with an instance of the API client
|
# Enter a context with an instance of the API client
|
||||||
with admin_api.ApiClient(configuration) as api_client:
|
with admin.ApiClient(configuration) as api_client:
|
||||||
# Create an instance of the API class
|
# Create an instance of the API class
|
||||||
api_instance = admin_api.AccountGroupsApi(api_client)
|
api_instance = admin.AccountGroupsApi(api_client)
|
||||||
aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional)
|
aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# List account groups
|
# List account groups
|
||||||
@ -317,6 +319,7 @@ with admin_api.ApiClient(configuration) as api_client:
|
|||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional]
|
**aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional]
|
||||||
@ -335,6 +338,7 @@ Name | Type | Description | Notes
|
|||||||
- **Accept**: application/hal+json, application/problem+json
|
- **Accept**: application/hal+json, application/problem+json
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
|-------------|-------------|------------------|
|
|-------------|-------------|------------------|
|
||||||
**200** | OK | - |
|
**200** | OK | - |
|
||||||
@ -357,19 +361,18 @@ Updates an account group using its ID. You can modify the account group’s name
|
|||||||
### Example
|
### Example
|
||||||
|
|
||||||
* Bearer Authentication (BearerAuth):
|
* Bearer Authentication (BearerAuth):
|
||||||
|
|
||||||
```python
|
```python
|
||||||
import time
|
import admin
|
||||||
import os
|
from admin.models.account_group_request_body import AccountGroupRequestBody
|
||||||
import admin_api
|
from admin.models.expand import Expand
|
||||||
from admin_api.models.account_group_request_body import AccountGroupRequestBody
|
from admin.models.get_account_group200_response import GetAccountGroup200Response
|
||||||
from admin_api.models.expand import Expand
|
from admin.rest import ApiException
|
||||||
from admin_api.models.get_account_group200_response import GetAccountGroup200Response
|
|
||||||
from admin_api.rest import ApiException
|
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
|
|
||||||
# Defining the host is optional and defaults to https://api.thousandeyes.com
|
# Defining the host is optional and defaults to https://api.thousandeyes.com
|
||||||
# See configuration.py for a list of all supported configuration parameters.
|
# See configuration.py for a list of all supported configuration parameters.
|
||||||
configuration = admin_api.Configuration(
|
configuration = admin.Configuration(
|
||||||
host = "https://api.thousandeyes.com"
|
host = "https://api.thousandeyes.com"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -379,17 +382,17 @@ configuration = admin_api.Configuration(
|
|||||||
# satisfies your auth use case.
|
# satisfies your auth use case.
|
||||||
|
|
||||||
# Configure Bearer authorization: BearerAuth
|
# Configure Bearer authorization: BearerAuth
|
||||||
configuration = admin_api.Configuration(
|
configuration = admin.Configuration(
|
||||||
access_token = os.environ["BEARER_TOKEN"]
|
access_token = os.environ["BEARER_TOKEN"]
|
||||||
)
|
)
|
||||||
|
|
||||||
# Enter a context with an instance of the API client
|
# Enter a context with an instance of the API client
|
||||||
with admin_api.ApiClient(configuration) as api_client:
|
with admin.ApiClient(configuration) as api_client:
|
||||||
# Create an instance of the API class
|
# Create an instance of the API class
|
||||||
api_instance = admin_api.AccountGroupsApi(api_client)
|
api_instance = admin.AccountGroupsApi(api_client)
|
||||||
id = '2067' # str | Identifier for the account group.
|
id = '1234' # str | Identifier for the account group.
|
||||||
account_group_request_body = admin_api.AccountGroupRequestBody() # AccountGroupRequestBody |
|
account_group_request_body = admin.AccountGroupRequestBody() # AccountGroupRequestBody |
|
||||||
expand = [admin_api.Expand()] # List[Expand] | Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. (optional)
|
expand = [admin.Expand()] # List[Expand] | Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. (optional)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Update account group
|
# Update account group
|
||||||
@ -404,6 +407,7 @@ with admin_api.ApiClient(configuration) as api_client:
|
|||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**id** | **str**| Identifier for the account group. |
|
**id** | **str**| Identifier for the account group. |
|
||||||
@ -424,6 +428,7 @@ Name | Type | Description | Notes
|
|||||||
- **Accept**: application/hal+json, application/problem+json
|
- **Accept**: application/hal+json, application/problem+json
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
|
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
|-------------|-------------|------------------|
|
|-------------|-------------|------------------|
|
||||||
**200** | OK | - |
|
**200** | OK | - |
|
||||||
39
admin/docs/Agent.md
Normal file
39
admin/docs/Agent.md
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
# Agent
|
||||||
|
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**ip_addresses** | **List[str]** | Array of private IP addresses. | [optional] [readonly]
|
||||||
|
**public_ip_addresses** | **List[str]** | Array of public IP addresses. | [optional] [readonly]
|
||||||
|
**network** | **str** | Network (including ASN) of agent’s public IP. | [optional] [readonly]
|
||||||
|
**agent_id** | **str** | Unique ID of the agent. | [optional] [readonly]
|
||||||
|
**agent_name** | **str** | Name of the agent. | [optional]
|
||||||
|
**location** | **str** | Location of the agent. | [optional] [readonly]
|
||||||
|
**country_id** | **str** | 2-digit ISO country code | [optional] [readonly]
|
||||||
|
**enabled** | **bool** | Flag indicating if the agent is enabled. | [optional]
|
||||||
|
**prefix** | **str** | Prefix containing agents public IP address. | [optional] [readonly]
|
||||||
|
**verify_ssl_certificates** | **bool** | Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests. | [optional] [readonly]
|
||||||
|
**agent_type** | [**CloudEnterpriseAgentType**](CloudEnterpriseAgentType.md) | |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
from admin.models.agent import Agent
|
||||||
|
|
||||||
|
# TODO update the JSON string below
|
||||||
|
json = "{}"
|
||||||
|
# create an instance of Agent from a JSON string
|
||||||
|
agent_instance = Agent.from_json(json)
|
||||||
|
# print the JSON string representation of the object
|
||||||
|
print(Agent.to_json())
|
||||||
|
|
||||||
|
# convert the object into a dict
|
||||||
|
agent_dict = agent_instance.to_dict()
|
||||||
|
# create an instance of Agent from a dict
|
||||||
|
agent_from_dict = Agent.from_dict(agent_dict)
|
||||||
|
```
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
||||||
31
admin/docs/AgentBase.md
Normal file
31
admin/docs/AgentBase.md
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
# AgentBase
|
||||||
|
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**ip_addresses** | **List[str]** | Array of private IP addresses. | [optional] [readonly]
|
||||||
|
**public_ip_addresses** | **List[str]** | Array of public IP addresses. | [optional] [readonly]
|
||||||
|
**network** | **str** | Network (including ASN) of agent’s public IP. | [optional] [readonly]
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
from admin.models.agent_base import AgentBase
|
||||||
|
|
||||||
|
# TODO update the JSON string below
|
||||||
|
json = "{}"
|
||||||
|
# create an instance of AgentBase from a JSON string
|
||||||
|
agent_base_instance = AgentBase.from_json(json)
|
||||||
|
# print the JSON string representation of the object
|
||||||
|
print(AgentBase.to_json())
|
||||||
|
|
||||||
|
# convert the object into a dict
|
||||||
|
agent_base_dict = agent_base_instance.to_dict()
|
||||||
|
# create an instance of AgentBase from a dict
|
||||||
|
agent_base_from_dict = AgentBase.from_dict(agent_base_dict)
|
||||||
|
```
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**all_account_group_roles** | [**List[Role]**](Role.md) | | [optional]
|
**all_account_group_roles** | [**List[Role]**](Role.md) | | [optional]
|
||||||
@ -9,19 +10,19 @@ Name | Type | Description | Notes
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from admin_api.models.all_account_group_roles import AllAccountGroupRoles
|
from admin.models.all_account_group_roles import AllAccountGroupRoles
|
||||||
|
|
||||||
# TODO update the JSON string below
|
# TODO update the JSON string below
|
||||||
json = "{}"
|
json = "{}"
|
||||||
# create an instance of AllAccountGroupRoles from a JSON string
|
# create an instance of AllAccountGroupRoles from a JSON string
|
||||||
all_account_group_roles_instance = AllAccountGroupRoles.from_json(json)
|
all_account_group_roles_instance = AllAccountGroupRoles.from_json(json)
|
||||||
# print the JSON string representation of the object
|
# print the JSON string representation of the object
|
||||||
print AllAccountGroupRoles.to_json()
|
print(AllAccountGroupRoles.to_json())
|
||||||
|
|
||||||
# convert the object into a dict
|
# convert the object into a dict
|
||||||
all_account_group_roles_dict = all_account_group_roles_instance.to_dict()
|
all_account_group_roles_dict = all_account_group_roles_instance.to_dict()
|
||||||
# create an instance of AllAccountGroupRoles from a dict
|
# create an instance of AllAccountGroupRoles from a dict
|
||||||
all_account_group_roles_form_dict = all_account_group_roles.from_dict(all_account_group_roles_dict)
|
all_account_group_roles_from_dict = AllAccountGroupRoles.from_dict(all_account_group_roles_dict)
|
||||||
```
|
```
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**name** | **str** | Name of the role. | [optional]
|
**name** | **str** | Name of the role. | [optional]
|
||||||
@ -11,19 +12,19 @@ Name | Type | Description | Notes
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from admin_api.models.base_role import BaseRole
|
from admin.models.base_role import BaseRole
|
||||||
|
|
||||||
# TODO update the JSON string below
|
# TODO update the JSON string below
|
||||||
json = "{}"
|
json = "{}"
|
||||||
# create an instance of BaseRole from a JSON string
|
# create an instance of BaseRole from a JSON string
|
||||||
base_role_instance = BaseRole.from_json(json)
|
base_role_instance = BaseRole.from_json(json)
|
||||||
# print the JSON string representation of the object
|
# print the JSON string representation of the object
|
||||||
print BaseRole.to_json()
|
print(BaseRole.to_json())
|
||||||
|
|
||||||
# convert the object into a dict
|
# convert the object into a dict
|
||||||
base_role_dict = base_role_instance.to_dict()
|
base_role_dict = base_role_instance.to_dict()
|
||||||
# create an instance of BaseRole from a dict
|
# create an instance of BaseRole from a dict
|
||||||
base_role_form_dict = base_role.from_dict(base_role_dict)
|
base_role_from_dict = BaseRole.from_dict(base_role_dict)
|
||||||
```
|
```
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
12
admin/docs/CloudEnterpriseAgentType.md
Normal file
12
admin/docs/CloudEnterpriseAgentType.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# CloudEnterpriseAgentType
|
||||||
|
|
||||||
|
Type of the agent.
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
||||||
38
admin/docs/ClusterMember.md
Normal file
38
admin/docs/ClusterMember.md
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
# ClusterMember
|
||||||
|
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**ip_addresses** | **List[str]** | Array of private IP addresses. | [optional] [readonly]
|
||||||
|
**public_ip_addresses** | **List[str]** | Array of public IP addresses. | [optional] [readonly]
|
||||||
|
**network** | **str** | Network (including ASN) of agent’s public IP. | [optional] [readonly]
|
||||||
|
**member_id** | **str** | Unique ID of the cluster member | [optional] [readonly]
|
||||||
|
**name** | **str** | Name of the cluster member | [optional] [readonly]
|
||||||
|
**error_details** | [**List[ErrorDetail]**](ErrorDetail.md) | If an enterprise agent or a cluster member presents at least one error, the errors will be shown as an array of entries in the errorDetails field (Enterprise Agents and Enterprise Cluster members only) | [optional] [readonly]
|
||||||
|
**last_seen** | **datetime** | UTC last seen date (ISO date-time format). | [optional] [readonly]
|
||||||
|
**agent_state** | [**EnterpriseAgentState**](EnterpriseAgentState.md) | | [optional]
|
||||||
|
**target_for_tests** | **str** | Test target IP address. | [optional]
|
||||||
|
**utilization** | **int** | Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only). | [optional] [readonly]
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
from admin.models.cluster_member import ClusterMember
|
||||||
|
|
||||||
|
# TODO update the JSON string below
|
||||||
|
json = "{}"
|
||||||
|
# create an instance of ClusterMember from a JSON string
|
||||||
|
cluster_member_instance = ClusterMember.from_json(json)
|
||||||
|
# print the JSON string representation of the object
|
||||||
|
print(ClusterMember.to_json())
|
||||||
|
|
||||||
|
# convert the object into a dict
|
||||||
|
cluster_member_dict = cluster_member_instance.to_dict()
|
||||||
|
# create an instance of ClusterMember from a dict
|
||||||
|
cluster_member_from_dict = ClusterMember.from_dict(cluster_member_dict)
|
||||||
|
```
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user