diff --git a/thousandeyes-sdk-administrative/.openapi-generator/FILES b/thousandeyes-sdk-administrative/.openapi-generator/FILES index d47fcc6c..9538038e 100644 --- a/thousandeyes-sdk-administrative/.openapi-generator/FILES +++ b/thousandeyes-sdk-administrative/.openapi-generator/FILES @@ -52,60 +52,60 @@ docs/ValidationError.md docs/ValidationErrorItem.md pyproject.toml setup.cfg -src/thousandeyes_sdk/admin/__init__.py -src/thousandeyes_sdk/admin/api/__init__.py -src/thousandeyes_sdk/admin/api/account_groups_api.py -src/thousandeyes_sdk/admin/api/permissions_api.py -src/thousandeyes_sdk/admin/api/roles_api.py -src/thousandeyes_sdk/admin/api/user_events_api.py -src/thousandeyes_sdk/admin/api/users_api.py -src/thousandeyes_sdk/admin/models/__init__.py -src/thousandeyes_sdk/admin/models/account_group.py -src/thousandeyes_sdk/admin/models/account_group_detail.py -src/thousandeyes_sdk/admin/models/account_group_info.py -src/thousandeyes_sdk/admin/models/account_group_request.py -src/thousandeyes_sdk/admin/models/account_group_role.py -src/thousandeyes_sdk/admin/models/account_groups.py -src/thousandeyes_sdk/admin/models/agent.py -src/thousandeyes_sdk/admin/models/agent_base.py -src/thousandeyes_sdk/admin/models/audit_user_events.py -src/thousandeyes_sdk/admin/models/base_role.py -src/thousandeyes_sdk/admin/models/cloud_enterprise_agent_type.py -src/thousandeyes_sdk/admin/models/cluster_member.py -src/thousandeyes_sdk/admin/models/created_account_group.py -src/thousandeyes_sdk/admin/models/created_user.py -src/thousandeyes_sdk/admin/models/enterprise_agent.py -src/thousandeyes_sdk/admin/models/enterprise_agent_data.py -src/thousandeyes_sdk/admin/models/enterprise_agent_ipv6_policy.py -src/thousandeyes_sdk/admin/models/enterprise_agent_state.py -src/thousandeyes_sdk/admin/models/error.py -src/thousandeyes_sdk/admin/models/error_detail.py -src/thousandeyes_sdk/admin/models/error_detail_code.py -src/thousandeyes_sdk/admin/models/expand.py -src/thousandeyes_sdk/admin/models/extended_user.py -src/thousandeyes_sdk/admin/models/interface_ip_mapping.py -src/thousandeyes_sdk/admin/models/link.py -src/thousandeyes_sdk/admin/models/pagination_links.py -src/thousandeyes_sdk/admin/models/permission.py -src/thousandeyes_sdk/admin/models/permissions.py -src/thousandeyes_sdk/admin/models/resource.py -src/thousandeyes_sdk/admin/models/role.py -src/thousandeyes_sdk/admin/models/role_detail.py -src/thousandeyes_sdk/admin/models/role_request_body.py -src/thousandeyes_sdk/admin/models/roles.py -src/thousandeyes_sdk/admin/models/self_links.py -src/thousandeyes_sdk/admin/models/simple_agent.py -src/thousandeyes_sdk/admin/models/unauthorized_error.py -src/thousandeyes_sdk/admin/models/user.py -src/thousandeyes_sdk/admin/models/user_account_group.py -src/thousandeyes_sdk/admin/models/user_account_group_role.py -src/thousandeyes_sdk/admin/models/user_detail.py -src/thousandeyes_sdk/admin/models/user_event.py -src/thousandeyes_sdk/admin/models/user_request.py -src/thousandeyes_sdk/admin/models/users.py -src/thousandeyes_sdk/admin/models/validation_error.py -src/thousandeyes_sdk/admin/models/validation_error_item.py -src/thousandeyes_sdk/admin/py.typed +src/thousandeyes_sdk/administrative/__init__.py +src/thousandeyes_sdk/administrative/api/__init__.py +src/thousandeyes_sdk/administrative/api/account_groups_api.py +src/thousandeyes_sdk/administrative/api/permissions_api.py +src/thousandeyes_sdk/administrative/api/roles_api.py +src/thousandeyes_sdk/administrative/api/user_events_api.py +src/thousandeyes_sdk/administrative/api/users_api.py +src/thousandeyes_sdk/administrative/models/__init__.py +src/thousandeyes_sdk/administrative/models/account_group.py +src/thousandeyes_sdk/administrative/models/account_group_detail.py +src/thousandeyes_sdk/administrative/models/account_group_info.py +src/thousandeyes_sdk/administrative/models/account_group_request.py +src/thousandeyes_sdk/administrative/models/account_group_role.py +src/thousandeyes_sdk/administrative/models/account_groups.py +src/thousandeyes_sdk/administrative/models/agent.py +src/thousandeyes_sdk/administrative/models/agent_base.py +src/thousandeyes_sdk/administrative/models/audit_user_events.py +src/thousandeyes_sdk/administrative/models/base_role.py +src/thousandeyes_sdk/administrative/models/cloud_enterprise_agent_type.py +src/thousandeyes_sdk/administrative/models/cluster_member.py +src/thousandeyes_sdk/administrative/models/created_account_group.py +src/thousandeyes_sdk/administrative/models/created_user.py +src/thousandeyes_sdk/administrative/models/enterprise_agent.py +src/thousandeyes_sdk/administrative/models/enterprise_agent_data.py +src/thousandeyes_sdk/administrative/models/enterprise_agent_ipv6_policy.py +src/thousandeyes_sdk/administrative/models/enterprise_agent_state.py +src/thousandeyes_sdk/administrative/models/error.py +src/thousandeyes_sdk/administrative/models/error_detail.py +src/thousandeyes_sdk/administrative/models/error_detail_code.py +src/thousandeyes_sdk/administrative/models/expand.py +src/thousandeyes_sdk/administrative/models/extended_user.py +src/thousandeyes_sdk/administrative/models/interface_ip_mapping.py +src/thousandeyes_sdk/administrative/models/link.py +src/thousandeyes_sdk/administrative/models/pagination_links.py +src/thousandeyes_sdk/administrative/models/permission.py +src/thousandeyes_sdk/administrative/models/permissions.py +src/thousandeyes_sdk/administrative/models/resource.py +src/thousandeyes_sdk/administrative/models/role.py +src/thousandeyes_sdk/administrative/models/role_detail.py +src/thousandeyes_sdk/administrative/models/role_request_body.py +src/thousandeyes_sdk/administrative/models/roles.py +src/thousandeyes_sdk/administrative/models/self_links.py +src/thousandeyes_sdk/administrative/models/simple_agent.py +src/thousandeyes_sdk/administrative/models/unauthorized_error.py +src/thousandeyes_sdk/administrative/models/user.py +src/thousandeyes_sdk/administrative/models/user_account_group.py +src/thousandeyes_sdk/administrative/models/user_account_group_role.py +src/thousandeyes_sdk/administrative/models/user_detail.py +src/thousandeyes_sdk/administrative/models/user_event.py +src/thousandeyes_sdk/administrative/models/user_request.py +src/thousandeyes_sdk/administrative/models/users.py +src/thousandeyes_sdk/administrative/models/validation_error.py +src/thousandeyes_sdk/administrative/models/validation_error_item.py +src/thousandeyes_sdk/administrative/py.typed test/__init__.py test/test_account_groups_api.py test/test_permissions_api.py diff --git a/thousandeyes-sdk-administrative/README.md b/thousandeyes-sdk-administrative/README.md index e40f0acd..e5386711 100644 --- a/thousandeyes-sdk-administrative/README.md +++ b/thousandeyes-sdk-administrative/README.md @@ -33,7 +33,7 @@ pip install -e git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git#egg=thousandey Then import the package: ```python -import thousandeyes_sdk.admin +import thousandeyes_sdk.administrative ``` ### Setuptools @@ -47,7 +47,7 @@ python setup.py install --user Then import the package: ```python -import thousandeyes_sdk.admin +import thousandeyes_sdk.administrative ``` ### Tests @@ -61,7 +61,7 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python import thousandeyes_sdk.core -import thousandeyes_sdk.admin +import thousandeyes_sdk.administrative from thousandeyes_sdk.core.exceptions import ApiException from pprint import pprint @@ -85,9 +85,9 @@ configuration = thousandeyes_sdk.core.Configuration( # Enter a context with an instance of the API client with thousandeyes_sdk.core.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.admin.AccountGroupsApi(api_client) - account_group_request = thousandeyes_sdk.admin.AccountGroupRequest() # AccountGroupRequest | - expand = [thousandeyes_sdk.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) + api_instance = thousandeyes_sdk.administrative.AccountGroupsApi(api_client) + account_group_request = thousandeyes_sdk.administrative.AccountGroupRequest() # AccountGroupRequest | + expand = [thousandeyes_sdk.administrative.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 diff --git a/thousandeyes-sdk-administrative/docs/AccountGroup.md b/thousandeyes-sdk-administrative/docs/AccountGroup.md index fbd92583..61a8306c 100644 --- a/thousandeyes-sdk-administrative/docs/AccountGroup.md +++ b/thousandeyes-sdk-administrative/docs/AccountGroup.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.account_group import AccountGroup +from thousandeyes_sdk.administrative.models.account_group import AccountGroup # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/AccountGroupDetail.md b/thousandeyes-sdk-administrative/docs/AccountGroupDetail.md index 4a3810c0..da02182d 100644 --- a/thousandeyes-sdk-administrative/docs/AccountGroupDetail.md +++ b/thousandeyes-sdk-administrative/docs/AccountGroupDetail.md @@ -17,7 +17,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.account_group_detail import AccountGroupDetail +from thousandeyes_sdk.administrative.models.account_group_detail import AccountGroupDetail # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/AccountGroupInfo.md b/thousandeyes-sdk-administrative/docs/AccountGroupInfo.md index e69997fc..72992dd1 100644 --- a/thousandeyes-sdk-administrative/docs/AccountGroupInfo.md +++ b/thousandeyes-sdk-administrative/docs/AccountGroupInfo.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.account_group_info import AccountGroupInfo +from thousandeyes_sdk.administrative.models.account_group_info import AccountGroupInfo # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/AccountGroupRequest.md b/thousandeyes-sdk-administrative/docs/AccountGroupRequest.md index 122f12a4..92496d05 100644 --- a/thousandeyes-sdk-administrative/docs/AccountGroupRequest.md +++ b/thousandeyes-sdk-administrative/docs/AccountGroupRequest.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.account_group_request import AccountGroupRequest +from thousandeyes_sdk.administrative.models.account_group_request import AccountGroupRequest # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/AccountGroupRole.md b/thousandeyes-sdk-administrative/docs/AccountGroupRole.md index 0d8c87c8..fdea5de8 100644 --- a/thousandeyes-sdk-administrative/docs/AccountGroupRole.md +++ b/thousandeyes-sdk-administrative/docs/AccountGroupRole.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.account_group_role import AccountGroupRole +from thousandeyes_sdk.administrative.models.account_group_role import AccountGroupRole # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/AccountGroups.md b/thousandeyes-sdk-administrative/docs/AccountGroups.md index 8123d820..04a12513 100644 --- a/thousandeyes-sdk-administrative/docs/AccountGroups.md +++ b/thousandeyes-sdk-administrative/docs/AccountGroups.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.account_groups import AccountGroups +from thousandeyes_sdk.administrative.models.account_groups import AccountGroups # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/AccountGroupsApi.md b/thousandeyes-sdk-administrative/docs/AccountGroupsApi.md index 911ff035..4d70a6dc 100644 --- a/thousandeyes-sdk-administrative/docs/AccountGroupsApi.md +++ b/thousandeyes-sdk-administrative/docs/AccountGroupsApi.md @@ -1,4 +1,4 @@ -# thousandeyes_sdk.admin.AccountGroupsApi +# thousandeyes_sdk.administrative.AccountGroupsApi All URIs are relative to *https://api.thousandeyes.com* @@ -23,11 +23,11 @@ Creates a new account group. This operation requires the `Edit all account group * Bearer Authentication (BearerAuth): ```python -import thousandeyes_sdk.admin -from thousandeyes_sdk.admin.models.account_group_request import AccountGroupRequest -from thousandeyes_sdk.admin.models.created_account_group import CreatedAccountGroup -from thousandeyes_sdk.admin.models.expand import Expand -from thousandeyes_sdk.admin.rest import ApiException +import thousandeyes_sdk.administrative +from thousandeyes_sdk.administrative.models.account_group_request import AccountGroupRequest +from thousandeyes_sdk.administrative.models.created_account_group import CreatedAccountGroup +from thousandeyes_sdk.administrative.models.expand import Expand +from thousandeyes_sdk.administrative.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.thousandeyes.com @@ -47,11 +47,11 @@ configuration = thousandeyes_sdk.core.Configuration( ) # Enter a context with an instance of the API client -with thousandeyes_sdk.admin.ApiClient(configuration) as api_client: +with thousandeyes_sdk.administrative.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.admin.AccountGroupsApi(api_client) - account_group_request = thousandeyes_sdk.admin.AccountGroupRequest() # AccountGroupRequest | - expand = [thousandeyes_sdk.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) + api_instance = thousandeyes_sdk.administrative.AccountGroupsApi(api_client) + account_group_request = thousandeyes_sdk.administrative.AccountGroupRequest() # AccountGroupRequest | + expand = [thousandeyes_sdk.administrative.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 @@ -111,8 +111,8 @@ Deletes an account group using its ID. This operation requires the following per * Bearer Authentication (BearerAuth): ```python -import thousandeyes_sdk.admin -from thousandeyes_sdk.admin.rest import ApiException +import thousandeyes_sdk.administrative +from thousandeyes_sdk.administrative.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.thousandeyes.com @@ -132,9 +132,9 @@ configuration = thousandeyes_sdk.core.Configuration( ) # Enter a context with an instance of the API client -with thousandeyes_sdk.admin.ApiClient(configuration) as api_client: +with thousandeyes_sdk.administrative.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.admin.AccountGroupsApi(api_client) + api_instance = thousandeyes_sdk.administrative.AccountGroupsApi(api_client) id = '1234' # str | Identifier for the account group. try: @@ -192,10 +192,10 @@ Retrieves detailed information about an account group using its ID. This operat * Bearer Authentication (BearerAuth): ```python -import thousandeyes_sdk.admin -from thousandeyes_sdk.admin.models.account_group_detail import AccountGroupDetail -from thousandeyes_sdk.admin.models.expand import Expand -from thousandeyes_sdk.admin.rest import ApiException +import thousandeyes_sdk.administrative +from thousandeyes_sdk.administrative.models.account_group_detail import AccountGroupDetail +from thousandeyes_sdk.administrative.models.expand import Expand +from thousandeyes_sdk.administrative.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.thousandeyes.com @@ -215,11 +215,11 @@ configuration = thousandeyes_sdk.core.Configuration( ) # Enter a context with an instance of the API client -with thousandeyes_sdk.admin.ApiClient(configuration) as api_client: +with thousandeyes_sdk.administrative.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.admin.AccountGroupsApi(api_client) + api_instance = thousandeyes_sdk.administrative.AccountGroupsApi(api_client) id = '1234' # str | Identifier for the account group. - expand = [thousandeyes_sdk.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) + expand = [thousandeyes_sdk.administrative.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: # Retrieve account group @@ -279,9 +279,9 @@ Retrieves a list of account groups available to the current user. * Bearer Authentication (BearerAuth): ```python -import thousandeyes_sdk.admin -from thousandeyes_sdk.admin.models.account_groups import AccountGroups -from thousandeyes_sdk.admin.rest import ApiException +import thousandeyes_sdk.administrative +from thousandeyes_sdk.administrative.models.account_groups import AccountGroups +from thousandeyes_sdk.administrative.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.thousandeyes.com @@ -301,9 +301,9 @@ configuration = thousandeyes_sdk.core.Configuration( ) # Enter a context with an instance of the API client -with thousandeyes_sdk.admin.ApiClient(configuration) as api_client: +with thousandeyes_sdk.administrative.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.admin.AccountGroupsApi(api_client) + api_instance = thousandeyes_sdk.administrative.AccountGroupsApi(api_client) 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: @@ -363,11 +363,11 @@ Updates an account group using its ID. You can modify the account group’s name * Bearer Authentication (BearerAuth): ```python -import thousandeyes_sdk.admin -from thousandeyes_sdk.admin.models.account_group_detail import AccountGroupDetail -from thousandeyes_sdk.admin.models.account_group_request import AccountGroupRequest -from thousandeyes_sdk.admin.models.expand import Expand -from thousandeyes_sdk.admin.rest import ApiException +import thousandeyes_sdk.administrative +from thousandeyes_sdk.administrative.models.account_group_detail import AccountGroupDetail +from thousandeyes_sdk.administrative.models.account_group_request import AccountGroupRequest +from thousandeyes_sdk.administrative.models.expand import Expand +from thousandeyes_sdk.administrative.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.thousandeyes.com @@ -387,12 +387,12 @@ configuration = thousandeyes_sdk.core.Configuration( ) # Enter a context with an instance of the API client -with thousandeyes_sdk.admin.ApiClient(configuration) as api_client: +with thousandeyes_sdk.administrative.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.admin.AccountGroupsApi(api_client) + api_instance = thousandeyes_sdk.administrative.AccountGroupsApi(api_client) id = '1234' # str | Identifier for the account group. - account_group_request = thousandeyes_sdk.admin.AccountGroupRequest() # AccountGroupRequest | - expand = [thousandeyes_sdk.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) + account_group_request = thousandeyes_sdk.administrative.AccountGroupRequest() # AccountGroupRequest | + expand = [thousandeyes_sdk.administrative.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: # Update account group diff --git a/thousandeyes-sdk-administrative/docs/Agent.md b/thousandeyes-sdk-administrative/docs/Agent.md index 35c9485a..007342a4 100644 --- a/thousandeyes-sdk-administrative/docs/Agent.md +++ b/thousandeyes-sdk-administrative/docs/Agent.md @@ -20,7 +20,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.agent import Agent +from thousandeyes_sdk.administrative.models.agent import Agent # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/AgentBase.md b/thousandeyes-sdk-administrative/docs/AgentBase.md index 6944f27b..2a778374 100644 --- a/thousandeyes-sdk-administrative/docs/AgentBase.md +++ b/thousandeyes-sdk-administrative/docs/AgentBase.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.agent_base import AgentBase +from thousandeyes_sdk.administrative.models.agent_base import AgentBase # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/AuditUserEvents.md b/thousandeyes-sdk-administrative/docs/AuditUserEvents.md index da4aaebd..015ab955 100644 --- a/thousandeyes-sdk-administrative/docs/AuditUserEvents.md +++ b/thousandeyes-sdk-administrative/docs/AuditUserEvents.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.audit_user_events import AuditUserEvents +from thousandeyes_sdk.administrative.models.audit_user_events import AuditUserEvents # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/BaseRole.md b/thousandeyes-sdk-administrative/docs/BaseRole.md index 478a4aa8..16951a61 100644 --- a/thousandeyes-sdk-administrative/docs/BaseRole.md +++ b/thousandeyes-sdk-administrative/docs/BaseRole.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.base_role import BaseRole +from thousandeyes_sdk.administrative.models.base_role import BaseRole # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/ClusterMember.md b/thousandeyes-sdk-administrative/docs/ClusterMember.md index 1745a015..57c4419b 100644 --- a/thousandeyes-sdk-administrative/docs/ClusterMember.md +++ b/thousandeyes-sdk-administrative/docs/ClusterMember.md @@ -19,7 +19,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.cluster_member import ClusterMember +from thousandeyes_sdk.administrative.models.cluster_member import ClusterMember # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/CreatedAccountGroup.md b/thousandeyes-sdk-administrative/docs/CreatedAccountGroup.md index ce307a3c..08b29488 100644 --- a/thousandeyes-sdk-administrative/docs/CreatedAccountGroup.md +++ b/thousandeyes-sdk-administrative/docs/CreatedAccountGroup.md @@ -16,7 +16,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.created_account_group import CreatedAccountGroup +from thousandeyes_sdk.administrative.models.created_account_group import CreatedAccountGroup # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/CreatedUser.md b/thousandeyes-sdk-administrative/docs/CreatedUser.md index 2c5ede43..58850a32 100644 --- a/thousandeyes-sdk-administrative/docs/CreatedUser.md +++ b/thousandeyes-sdk-administrative/docs/CreatedUser.md @@ -17,7 +17,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.created_user import CreatedUser +from thousandeyes_sdk.administrative.models.created_user import CreatedUser # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/EnterpriseAgent.md b/thousandeyes-sdk-administrative/docs/EnterpriseAgent.md index 8fae02d2..3eb32c44 100644 --- a/thousandeyes-sdk-administrative/docs/EnterpriseAgent.md +++ b/thousandeyes-sdk-administrative/docs/EnterpriseAgent.md @@ -33,7 +33,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.enterprise_agent import EnterpriseAgent +from thousandeyes_sdk.administrative.models.enterprise_agent import EnterpriseAgent # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/EnterpriseAgentData.md b/thousandeyes-sdk-administrative/docs/EnterpriseAgentData.md index 8bae2244..6ca1da5f 100644 --- a/thousandeyes-sdk-administrative/docs/EnterpriseAgentData.md +++ b/thousandeyes-sdk-administrative/docs/EnterpriseAgentData.md @@ -22,7 +22,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.enterprise_agent_data import EnterpriseAgentData +from thousandeyes_sdk.administrative.models.enterprise_agent_data import EnterpriseAgentData # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/Error.md b/thousandeyes-sdk-administrative/docs/Error.md index 254ed301..64d4eace 100644 --- a/thousandeyes-sdk-administrative/docs/Error.md +++ b/thousandeyes-sdk-administrative/docs/Error.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.error import Error +from thousandeyes_sdk.administrative.models.error import Error # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/ErrorDetail.md b/thousandeyes-sdk-administrative/docs/ErrorDetail.md index 3d5192d7..83319bc3 100644 --- a/thousandeyes-sdk-administrative/docs/ErrorDetail.md +++ b/thousandeyes-sdk-administrative/docs/ErrorDetail.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.error_detail import ErrorDetail +from thousandeyes_sdk.administrative.models.error_detail import ErrorDetail # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/ExtendedUser.md b/thousandeyes-sdk-administrative/docs/ExtendedUser.md index 06de589d..6f74ef60 100644 --- a/thousandeyes-sdk-administrative/docs/ExtendedUser.md +++ b/thousandeyes-sdk-administrative/docs/ExtendedUser.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.extended_user import ExtendedUser +from thousandeyes_sdk.administrative.models.extended_user import ExtendedUser # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/InterfaceIpMapping.md b/thousandeyes-sdk-administrative/docs/InterfaceIpMapping.md index 339a78cb..62a54d5e 100644 --- a/thousandeyes-sdk-administrative/docs/InterfaceIpMapping.md +++ b/thousandeyes-sdk-administrative/docs/InterfaceIpMapping.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.interface_ip_mapping import InterfaceIpMapping +from thousandeyes_sdk.administrative.models.interface_ip_mapping import InterfaceIpMapping # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/Link.md b/thousandeyes-sdk-administrative/docs/Link.md index a29be71f..b4c133f0 100644 --- a/thousandeyes-sdk-administrative/docs/Link.md +++ b/thousandeyes-sdk-administrative/docs/Link.md @@ -18,7 +18,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.link import Link +from thousandeyes_sdk.administrative.models.link import Link # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/PaginationLinks.md b/thousandeyes-sdk-administrative/docs/PaginationLinks.md index 6522b115..50fa3ca8 100644 --- a/thousandeyes-sdk-administrative/docs/PaginationLinks.md +++ b/thousandeyes-sdk-administrative/docs/PaginationLinks.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.pagination_links import PaginationLinks +from thousandeyes_sdk.administrative.models.pagination_links import PaginationLinks # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/Permission.md b/thousandeyes-sdk-administrative/docs/Permission.md index 480966aa..a3ece4ed 100644 --- a/thousandeyes-sdk-administrative/docs/Permission.md +++ b/thousandeyes-sdk-administrative/docs/Permission.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.permission import Permission +from thousandeyes_sdk.administrative.models.permission import Permission # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/Permissions.md b/thousandeyes-sdk-administrative/docs/Permissions.md index bb825d47..f763b4d6 100644 --- a/thousandeyes-sdk-administrative/docs/Permissions.md +++ b/thousandeyes-sdk-administrative/docs/Permissions.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.permissions import Permissions +from thousandeyes_sdk.administrative.models.permissions import Permissions # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/PermissionsApi.md b/thousandeyes-sdk-administrative/docs/PermissionsApi.md index 291a10dc..e0e82f3d 100644 --- a/thousandeyes-sdk-administrative/docs/PermissionsApi.md +++ b/thousandeyes-sdk-administrative/docs/PermissionsApi.md @@ -1,4 +1,4 @@ -# thousandeyes_sdk.admin.PermissionsApi +# thousandeyes_sdk.administrative.PermissionsApi All URIs are relative to *https://api.thousandeyes.com* @@ -19,9 +19,9 @@ Users must be in a role assigned management permissions to access this endpoint. * Bearer Authentication (BearerAuth): ```python -import thousandeyes_sdk.admin -from thousandeyes_sdk.admin.models.permissions import Permissions -from thousandeyes_sdk.admin.rest import ApiException +import thousandeyes_sdk.administrative +from thousandeyes_sdk.administrative.models.permissions import Permissions +from thousandeyes_sdk.administrative.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.thousandeyes.com @@ -41,9 +41,9 @@ configuration = thousandeyes_sdk.core.Configuration( ) # Enter a context with an instance of the API client -with thousandeyes_sdk.admin.ApiClient(configuration) as api_client: +with thousandeyes_sdk.administrative.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.admin.PermissionsApi(api_client) + api_instance = thousandeyes_sdk.administrative.PermissionsApi(api_client) 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: diff --git a/thousandeyes-sdk-administrative/docs/Resource.md b/thousandeyes-sdk-administrative/docs/Resource.md index ba40d052..da59ac45 100644 --- a/thousandeyes-sdk-administrative/docs/Resource.md +++ b/thousandeyes-sdk-administrative/docs/Resource.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.resource import Resource +from thousandeyes_sdk.administrative.models.resource import Resource # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/Role.md b/thousandeyes-sdk-administrative/docs/Role.md index a16f97a7..d1e7d919 100644 --- a/thousandeyes-sdk-administrative/docs/Role.md +++ b/thousandeyes-sdk-administrative/docs/Role.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.role import Role +from thousandeyes_sdk.administrative.models.role import Role # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/RoleDetail.md b/thousandeyes-sdk-administrative/docs/RoleDetail.md index 1fae4456..2f473741 100644 --- a/thousandeyes-sdk-administrative/docs/RoleDetail.md +++ b/thousandeyes-sdk-administrative/docs/RoleDetail.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.role_detail import RoleDetail +from thousandeyes_sdk.administrative.models.role_detail import RoleDetail # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/RoleRequestBody.md b/thousandeyes-sdk-administrative/docs/RoleRequestBody.md index 5b4c4ddb..497ced76 100644 --- a/thousandeyes-sdk-administrative/docs/RoleRequestBody.md +++ b/thousandeyes-sdk-administrative/docs/RoleRequestBody.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.role_request_body import RoleRequestBody +from thousandeyes_sdk.administrative.models.role_request_body import RoleRequestBody # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/Roles.md b/thousandeyes-sdk-administrative/docs/Roles.md index 224f3de8..87fcfd2f 100644 --- a/thousandeyes-sdk-administrative/docs/Roles.md +++ b/thousandeyes-sdk-administrative/docs/Roles.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.roles import Roles +from thousandeyes_sdk.administrative.models.roles import Roles # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/RolesApi.md b/thousandeyes-sdk-administrative/docs/RolesApi.md index 064add9a..bf7ea3d5 100644 --- a/thousandeyes-sdk-administrative/docs/RolesApi.md +++ b/thousandeyes-sdk-administrative/docs/RolesApi.md @@ -1,4 +1,4 @@ -# thousandeyes_sdk.admin.RolesApi +# thousandeyes_sdk.administrative.RolesApi All URIs are relative to *https://api.thousandeyes.com* @@ -23,10 +23,10 @@ Creates a new role. * Bearer Authentication (BearerAuth): ```python -import thousandeyes_sdk.admin -from thousandeyes_sdk.admin.models.role_detail import RoleDetail -from thousandeyes_sdk.admin.models.role_request_body import RoleRequestBody -from thousandeyes_sdk.admin.rest import ApiException +import thousandeyes_sdk.administrative +from thousandeyes_sdk.administrative.models.role_detail import RoleDetail +from thousandeyes_sdk.administrative.models.role_request_body import RoleRequestBody +from thousandeyes_sdk.administrative.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.thousandeyes.com @@ -46,10 +46,10 @@ configuration = thousandeyes_sdk.core.Configuration( ) # Enter a context with an instance of the API client -with thousandeyes_sdk.admin.ApiClient(configuration) as api_client: +with thousandeyes_sdk.administrative.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.admin.RolesApi(api_client) - role_request_body = thousandeyes_sdk.admin.RoleRequestBody() # RoleRequestBody | + api_instance = thousandeyes_sdk.administrative.RolesApi(api_client) + role_request_body = thousandeyes_sdk.administrative.RoleRequestBody() # RoleRequestBody | 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: @@ -110,8 +110,8 @@ Deletes a role using its ID. The user needs appropriate permissions to successfu * Bearer Authentication (BearerAuth): ```python -import thousandeyes_sdk.admin -from thousandeyes_sdk.admin.rest import ApiException +import thousandeyes_sdk.administrative +from thousandeyes_sdk.administrative.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.thousandeyes.com @@ -131,9 +131,9 @@ configuration = thousandeyes_sdk.core.Configuration( ) # Enter a context with an instance of the API client -with thousandeyes_sdk.admin.ApiClient(configuration) as api_client: +with thousandeyes_sdk.administrative.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.admin.RolesApi(api_client) + api_instance = thousandeyes_sdk.administrative.RolesApi(api_client) id = '23' # str | The ID of the desired role. 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) @@ -193,9 +193,9 @@ Returns detailed information about a role using its ID. * Bearer Authentication (BearerAuth): ```python -import thousandeyes_sdk.admin -from thousandeyes_sdk.admin.models.role_detail import RoleDetail -from thousandeyes_sdk.admin.rest import ApiException +import thousandeyes_sdk.administrative +from thousandeyes_sdk.administrative.models.role_detail import RoleDetail +from thousandeyes_sdk.administrative.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.thousandeyes.com @@ -215,9 +215,9 @@ configuration = thousandeyes_sdk.core.Configuration( ) # Enter a context with an instance of the API client -with thousandeyes_sdk.admin.ApiClient(configuration) as api_client: +with thousandeyes_sdk.administrative.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.admin.RolesApi(api_client) + api_instance = thousandeyes_sdk.administrative.RolesApi(api_client) id = '23' # str | The ID of the desired role. 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) @@ -279,9 +279,9 @@ Retrieves a list of defined roles visible to the current user. * Bearer Authentication (BearerAuth): ```python -import thousandeyes_sdk.admin -from thousandeyes_sdk.admin.models.roles import Roles -from thousandeyes_sdk.admin.rest import ApiException +import thousandeyes_sdk.administrative +from thousandeyes_sdk.administrative.models.roles import Roles +from thousandeyes_sdk.administrative.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.thousandeyes.com @@ -301,9 +301,9 @@ configuration = thousandeyes_sdk.core.Configuration( ) # Enter a context with an instance of the API client -with thousandeyes_sdk.admin.ApiClient(configuration) as api_client: +with thousandeyes_sdk.administrative.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.admin.RolesApi(api_client) + api_instance = thousandeyes_sdk.administrative.RolesApi(api_client) 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: @@ -363,10 +363,10 @@ Updates a user-defined role using its ID. When updating a role, the following a * Bearer Authentication (BearerAuth): ```python -import thousandeyes_sdk.admin -from thousandeyes_sdk.admin.models.role_detail import RoleDetail -from thousandeyes_sdk.admin.models.role_request_body import RoleRequestBody -from thousandeyes_sdk.admin.rest import ApiException +import thousandeyes_sdk.administrative +from thousandeyes_sdk.administrative.models.role_detail import RoleDetail +from thousandeyes_sdk.administrative.models.role_request_body import RoleRequestBody +from thousandeyes_sdk.administrative.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.thousandeyes.com @@ -386,11 +386,11 @@ configuration = thousandeyes_sdk.core.Configuration( ) # Enter a context with an instance of the API client -with thousandeyes_sdk.admin.ApiClient(configuration) as api_client: +with thousandeyes_sdk.administrative.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.admin.RolesApi(api_client) + api_instance = thousandeyes_sdk.administrative.RolesApi(api_client) id = '23' # str | The ID of the desired role. - role_request_body = thousandeyes_sdk.admin.RoleRequestBody() # RoleRequestBody | + role_request_body = thousandeyes_sdk.administrative.RoleRequestBody() # RoleRequestBody | 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: diff --git a/thousandeyes-sdk-administrative/docs/SelfLinks.md b/thousandeyes-sdk-administrative/docs/SelfLinks.md index 9debde36..a167f2f8 100644 --- a/thousandeyes-sdk-administrative/docs/SelfLinks.md +++ b/thousandeyes-sdk-administrative/docs/SelfLinks.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.self_links import SelfLinks +from thousandeyes_sdk.administrative.models.self_links import SelfLinks # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/SimpleAgent.md b/thousandeyes-sdk-administrative/docs/SimpleAgent.md index 0c0bd1bf..e3f7870d 100644 --- a/thousandeyes-sdk-administrative/docs/SimpleAgent.md +++ b/thousandeyes-sdk-administrative/docs/SimpleAgent.md @@ -19,7 +19,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.simple_agent import SimpleAgent +from thousandeyes_sdk.administrative.models.simple_agent import SimpleAgent # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/UnauthorizedError.md b/thousandeyes-sdk-administrative/docs/UnauthorizedError.md index b87b2249..624b322e 100644 --- a/thousandeyes-sdk-administrative/docs/UnauthorizedError.md +++ b/thousandeyes-sdk-administrative/docs/UnauthorizedError.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.unauthorized_error import UnauthorizedError +from thousandeyes_sdk.administrative.models.unauthorized_error import UnauthorizedError # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/User.md b/thousandeyes-sdk-administrative/docs/User.md index 90f7985f..418858ce 100644 --- a/thousandeyes-sdk-administrative/docs/User.md +++ b/thousandeyes-sdk-administrative/docs/User.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.user import User +from thousandeyes_sdk.administrative.models.user import User # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/UserAccountGroup.md b/thousandeyes-sdk-administrative/docs/UserAccountGroup.md index 2112b94c..1257ff66 100644 --- a/thousandeyes-sdk-administrative/docs/UserAccountGroup.md +++ b/thousandeyes-sdk-administrative/docs/UserAccountGroup.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.user_account_group import UserAccountGroup +from thousandeyes_sdk.administrative.models.user_account_group import UserAccountGroup # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/UserAccountGroupRole.md b/thousandeyes-sdk-administrative/docs/UserAccountGroupRole.md index c0312280..20912d96 100644 --- a/thousandeyes-sdk-administrative/docs/UserAccountGroupRole.md +++ b/thousandeyes-sdk-administrative/docs/UserAccountGroupRole.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.user_account_group_role import UserAccountGroupRole +from thousandeyes_sdk.administrative.models.user_account_group_role import UserAccountGroupRole # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/UserDetail.md b/thousandeyes-sdk-administrative/docs/UserDetail.md index 367d9b6a..ad2e17a0 100644 --- a/thousandeyes-sdk-administrative/docs/UserDetail.md +++ b/thousandeyes-sdk-administrative/docs/UserDetail.md @@ -18,7 +18,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.user_detail import UserDetail +from thousandeyes_sdk.administrative.models.user_detail import UserDetail # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/UserEvent.md b/thousandeyes-sdk-administrative/docs/UserEvent.md index 9af66944..620be326 100644 --- a/thousandeyes-sdk-administrative/docs/UserEvent.md +++ b/thousandeyes-sdk-administrative/docs/UserEvent.md @@ -17,7 +17,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.user_event import UserEvent +from thousandeyes_sdk.administrative.models.user_event import UserEvent # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/UserEventsApi.md b/thousandeyes-sdk-administrative/docs/UserEventsApi.md index a08268d0..0c726743 100644 --- a/thousandeyes-sdk-administrative/docs/UserEventsApi.md +++ b/thousandeyes-sdk-administrative/docs/UserEventsApi.md @@ -1,4 +1,4 @@ -# thousandeyes_sdk.admin.UserEventsApi +# thousandeyes_sdk.administrative.UserEventsApi All URIs are relative to *https://api.thousandeyes.com* @@ -19,9 +19,9 @@ Returns a list of activity log events in the current account group. If `useAll * Bearer Authentication (BearerAuth): ```python -import thousandeyes_sdk.admin -from thousandeyes_sdk.admin.models.audit_user_events import AuditUserEvents -from thousandeyes_sdk.admin.rest import ApiException +import thousandeyes_sdk.administrative +from thousandeyes_sdk.administrative.models.audit_user_events import AuditUserEvents +from thousandeyes_sdk.administrative.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.thousandeyes.com @@ -41,9 +41,9 @@ configuration = thousandeyes_sdk.core.Configuration( ) # Enter a context with an instance of the API client -with thousandeyes_sdk.admin.ApiClient(configuration) as api_client: +with thousandeyes_sdk.administrative.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.admin.UserEventsApi(api_client) + api_instance = thousandeyes_sdk.administrative.UserEventsApi(api_client) 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) use_all_permitted_aids = False # bool | Set to `true` to load data from all accounts the user has access to. (optional) (default to False) window = '12h' # str | 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`. (optional) diff --git a/thousandeyes-sdk-administrative/docs/UserRequest.md b/thousandeyes-sdk-administrative/docs/UserRequest.md index 2b944ef7..01d29ebd 100644 --- a/thousandeyes-sdk-administrative/docs/UserRequest.md +++ b/thousandeyes-sdk-administrative/docs/UserRequest.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.user_request import UserRequest +from thousandeyes_sdk.administrative.models.user_request import UserRequest # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/Users.md b/thousandeyes-sdk-administrative/docs/Users.md index 027dafb0..bceb14cc 100644 --- a/thousandeyes-sdk-administrative/docs/Users.md +++ b/thousandeyes-sdk-administrative/docs/Users.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.users import Users +from thousandeyes_sdk.administrative.models.users import Users # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/UsersApi.md b/thousandeyes-sdk-administrative/docs/UsersApi.md index d158406a..a2cb031f 100644 --- a/thousandeyes-sdk-administrative/docs/UsersApi.md +++ b/thousandeyes-sdk-administrative/docs/UsersApi.md @@ -1,4 +1,4 @@ -# thousandeyes_sdk.admin.UsersApi +# thousandeyes_sdk.administrative.UsersApi All URIs are relative to *https://api.thousandeyes.com* @@ -23,10 +23,10 @@ Creates a new user. The following applies when creating a user: * If the user * Bearer Authentication (BearerAuth): ```python -import thousandeyes_sdk.admin -from thousandeyes_sdk.admin.models.created_user import CreatedUser -from thousandeyes_sdk.admin.models.user_request import UserRequest -from thousandeyes_sdk.admin.rest import ApiException +import thousandeyes_sdk.administrative +from thousandeyes_sdk.administrative.models.created_user import CreatedUser +from thousandeyes_sdk.administrative.models.user_request import UserRequest +from thousandeyes_sdk.administrative.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.thousandeyes.com @@ -46,10 +46,10 @@ configuration = thousandeyes_sdk.core.Configuration( ) # Enter a context with an instance of the API client -with thousandeyes_sdk.admin.ApiClient(configuration) as api_client: +with thousandeyes_sdk.administrative.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.admin.UsersApi(api_client) - user_request = thousandeyes_sdk.admin.UserRequest() # UserRequest | + api_instance = thousandeyes_sdk.administrative.UsersApi(api_client) + user_request = thousandeyes_sdk.administrative.UserRequest() # UserRequest | 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: @@ -110,8 +110,8 @@ Deletes a user using the user ID. This endpoint requires the `Edit users in all * Bearer Authentication (BearerAuth): ```python -import thousandeyes_sdk.admin -from thousandeyes_sdk.admin.rest import ApiException +import thousandeyes_sdk.administrative +from thousandeyes_sdk.administrative.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.thousandeyes.com @@ -131,9 +131,9 @@ configuration = thousandeyes_sdk.core.Configuration( ) # Enter a context with an instance of the API client -with thousandeyes_sdk.admin.ApiClient(configuration) as api_client: +with thousandeyes_sdk.administrative.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.admin.UsersApi(api_client) + api_instance = thousandeyes_sdk.administrative.UsersApi(api_client) id = '1234' # str | Identifier for the user. 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) @@ -193,9 +193,9 @@ Retrieves detailed information about a user. This operation requires the `API Ac * Bearer Authentication (BearerAuth): ```python -import thousandeyes_sdk.admin -from thousandeyes_sdk.admin.models.user_detail import UserDetail -from thousandeyes_sdk.admin.rest import ApiException +import thousandeyes_sdk.administrative +from thousandeyes_sdk.administrative.models.user_detail import UserDetail +from thousandeyes_sdk.administrative.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.thousandeyes.com @@ -215,9 +215,9 @@ configuration = thousandeyes_sdk.core.Configuration( ) # Enter a context with an instance of the API client -with thousandeyes_sdk.admin.ApiClient(configuration) as api_client: +with thousandeyes_sdk.administrative.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.admin.UsersApi(api_client) + api_instance = thousandeyes_sdk.administrative.UsersApi(api_client) id = '1234' # str | Identifier for the user. 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) @@ -279,9 +279,9 @@ Retrieves a list of users in the organization the account group ID belongs to. T * Bearer Authentication (BearerAuth): ```python -import thousandeyes_sdk.admin -from thousandeyes_sdk.admin.models.users import Users -from thousandeyes_sdk.admin.rest import ApiException +import thousandeyes_sdk.administrative +from thousandeyes_sdk.administrative.models.users import Users +from thousandeyes_sdk.administrative.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.thousandeyes.com @@ -301,9 +301,9 @@ configuration = thousandeyes_sdk.core.Configuration( ) # Enter a context with an instance of the API client -with thousandeyes_sdk.admin.ApiClient(configuration) as api_client: +with thousandeyes_sdk.administrative.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.admin.UsersApi(api_client) + api_instance = thousandeyes_sdk.administrative.UsersApi(api_client) 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: @@ -363,10 +363,10 @@ Updates a user using the user ID. You can update the user name, email address, a * Bearer Authentication (BearerAuth): ```python -import thousandeyes_sdk.admin -from thousandeyes_sdk.admin.models.user_detail import UserDetail -from thousandeyes_sdk.admin.models.user_request import UserRequest -from thousandeyes_sdk.admin.rest import ApiException +import thousandeyes_sdk.administrative +from thousandeyes_sdk.administrative.models.user_detail import UserDetail +from thousandeyes_sdk.administrative.models.user_request import UserRequest +from thousandeyes_sdk.administrative.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.thousandeyes.com @@ -386,11 +386,11 @@ configuration = thousandeyes_sdk.core.Configuration( ) # Enter a context with an instance of the API client -with thousandeyes_sdk.admin.ApiClient(configuration) as api_client: +with thousandeyes_sdk.administrative.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = thousandeyes_sdk.admin.UsersApi(api_client) + api_instance = thousandeyes_sdk.administrative.UsersApi(api_client) id = '1234' # str | Identifier for the user. - user_request = thousandeyes_sdk.admin.UserRequest() # UserRequest | + user_request = thousandeyes_sdk.administrative.UserRequest() # UserRequest | 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: diff --git a/thousandeyes-sdk-administrative/docs/ValidationError.md b/thousandeyes-sdk-administrative/docs/ValidationError.md index da7091b6..0ce26390 100644 --- a/thousandeyes-sdk-administrative/docs/ValidationError.md +++ b/thousandeyes-sdk-administrative/docs/ValidationError.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.validation_error import ValidationError +from thousandeyes_sdk.administrative.models.validation_error import ValidationError # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/docs/ValidationErrorItem.md b/thousandeyes-sdk-administrative/docs/ValidationErrorItem.md index dd105e40..4cbc5d95 100644 --- a/thousandeyes-sdk-administrative/docs/ValidationErrorItem.md +++ b/thousandeyes-sdk-administrative/docs/ValidationErrorItem.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes ## Example ```python -from thousandeyes_sdk.admin.models.validation_error_item import ValidationErrorItem +from thousandeyes_sdk.administrative.models.validation_error_item import ValidationErrorItem # TODO update the JSON string below json = "{}" diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/__init__.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/__init__.py new file mode 100644 index 00000000..8b6c3bd9 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/__init__.py @@ -0,0 +1,70 @@ +# 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.6 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +# import apis into sdk package +from thousandeyes_sdk.administrative.api.account_groups_api import AccountGroupsApi +from thousandeyes_sdk.administrative.api.permissions_api import PermissionsApi +from thousandeyes_sdk.administrative.api.roles_api import RolesApi +from thousandeyes_sdk.administrative.api.user_events_api import UserEventsApi +from thousandeyes_sdk.administrative.api.users_api import UsersApi + + +# import models into sdk package +from thousandeyes_sdk.administrative.models.account_group import AccountGroup +from thousandeyes_sdk.administrative.models.account_group_detail import AccountGroupDetail +from thousandeyes_sdk.administrative.models.account_group_info import AccountGroupInfo +from thousandeyes_sdk.administrative.models.account_group_request import AccountGroupRequest +from thousandeyes_sdk.administrative.models.account_group_role import AccountGroupRole +from thousandeyes_sdk.administrative.models.account_groups import AccountGroups +from thousandeyes_sdk.administrative.models.agent import Agent +from thousandeyes_sdk.administrative.models.agent_base import AgentBase +from thousandeyes_sdk.administrative.models.audit_user_events import AuditUserEvents +from thousandeyes_sdk.administrative.models.base_role import BaseRole +from thousandeyes_sdk.administrative.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType +from thousandeyes_sdk.administrative.models.cluster_member import ClusterMember +from thousandeyes_sdk.administrative.models.created_account_group import CreatedAccountGroup +from thousandeyes_sdk.administrative.models.created_user import CreatedUser +from thousandeyes_sdk.administrative.models.enterprise_agent import EnterpriseAgent +from thousandeyes_sdk.administrative.models.enterprise_agent_data import EnterpriseAgentData +from thousandeyes_sdk.administrative.models.enterprise_agent_ipv6_policy import EnterpriseAgentIpv6Policy +from thousandeyes_sdk.administrative.models.enterprise_agent_state import EnterpriseAgentState +from thousandeyes_sdk.administrative.models.error import Error +from thousandeyes_sdk.administrative.models.error_detail import ErrorDetail +from thousandeyes_sdk.administrative.models.error_detail_code import ErrorDetailCode +from thousandeyes_sdk.administrative.models.expand import Expand +from thousandeyes_sdk.administrative.models.extended_user import ExtendedUser +from thousandeyes_sdk.administrative.models.interface_ip_mapping import InterfaceIpMapping +from thousandeyes_sdk.administrative.models.link import Link +from thousandeyes_sdk.administrative.models.pagination_links import PaginationLinks +from thousandeyes_sdk.administrative.models.permission import Permission +from thousandeyes_sdk.administrative.models.permissions import Permissions +from thousandeyes_sdk.administrative.models.resource import Resource +from thousandeyes_sdk.administrative.models.role import Role +from thousandeyes_sdk.administrative.models.role_detail import RoleDetail +from thousandeyes_sdk.administrative.models.role_request_body import RoleRequestBody +from thousandeyes_sdk.administrative.models.roles import Roles +from thousandeyes_sdk.administrative.models.self_links import SelfLinks +from thousandeyes_sdk.administrative.models.simple_agent import SimpleAgent +from thousandeyes_sdk.administrative.models.unauthorized_error import UnauthorizedError +from thousandeyes_sdk.administrative.models.user import User +from thousandeyes_sdk.administrative.models.user_account_group import UserAccountGroup +from thousandeyes_sdk.administrative.models.user_account_group_role import UserAccountGroupRole +from thousandeyes_sdk.administrative.models.user_detail import UserDetail +from thousandeyes_sdk.administrative.models.user_event import UserEvent +from thousandeyes_sdk.administrative.models.user_request import UserRequest +from thousandeyes_sdk.administrative.models.users import Users +from thousandeyes_sdk.administrative.models.validation_error import ValidationError +from thousandeyes_sdk.administrative.models.validation_error_item import ValidationErrorItem diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/__init__.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/__init__.py new file mode 100644 index 00000000..d44d8495 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/__init__.py @@ -0,0 +1,9 @@ +# flake8: noqa + +# import apis into api package +from thousandeyes_sdk.administrative.api.account_groups_api import AccountGroupsApi +from thousandeyes_sdk.administrative.api.permissions_api import PermissionsApi +from thousandeyes_sdk.administrative.api.roles_api import RolesApi +from thousandeyes_sdk.administrative.api.user_events_api import UserEventsApi +from thousandeyes_sdk.administrative.api.users_api import UsersApi + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/account_groups_api.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/account_groups_api.py new file mode 100644 index 00000000..45512849 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/account_groups_api.py @@ -0,0 +1,1543 @@ +# 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.6 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +import thousandeyes_sdk.administrative.models + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.administrative.models.account_group_detail import AccountGroupDetail +from thousandeyes_sdk.administrative.models.account_group_request import AccountGroupRequest +from thousandeyes_sdk.administrative.models.account_groups import AccountGroups +from thousandeyes_sdk.administrative.models.created_account_group import CreatedAccountGroup +from thousandeyes_sdk.administrative.models.expand import Expand + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType +from thousandeyes_sdk.core.version import Version + + +class AccountGroupsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(Version.get()) + self.api_client = api_client + + + @validate_call + def create_account_group( + self, + account_group_request: AccountGroupRequest, + expand: Annotated[Optional[List[Expand]], Field(description="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.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CreatedAccountGroup: + """Create account group + + Creates a new account group. This operation requires the `Edit all account groups` permission. **Note:** Any user assigned to `All Account Groups` is automatically assigned to the new account group. + + :param account_group_request: (required) + :type account_group_request: AccountGroupRequest + :param 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. + :type expand: List[Expand] + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_account_group_serialize( + account_group_request=account_group_request, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreatedAccountGroup", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ).data + + + @validate_call + def create_account_group_with_http_info( + self, + account_group_request: AccountGroupRequest, + expand: Annotated[Optional[List[Expand]], Field(description="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.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CreatedAccountGroup]: + """Create account group + + Creates a new account group. This operation requires the `Edit all account groups` permission. **Note:** Any user assigned to `All Account Groups` is automatically assigned to the new account group. + + :param account_group_request: (required) + :type account_group_request: AccountGroupRequest + :param 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. + :type expand: List[Expand] + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_account_group_serialize( + account_group_request=account_group_request, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreatedAccountGroup", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ) + + + @validate_call + def create_account_group_without_preload_content( + self, + account_group_request: AccountGroupRequest, + expand: Annotated[Optional[List[Expand]], Field(description="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.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create account group + + Creates a new account group. This operation requires the `Edit all account groups` permission. **Note:** Any user assigned to `All Account Groups` is automatically assigned to the new account group. + + :param account_group_request: (required) + :type account_group_request: AccountGroupRequest + :param 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. + :type expand: List[Expand] + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_account_group_serialize( + account_group_request=account_group_request, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreatedAccountGroup", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_account_group_serialize( + self, + account_group_request, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if account_group_request is not None: + _body_params = account_group_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v7/account-groups', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_account_group( + self, + id: Annotated[StrictStr, Field(description="Identifier for the account group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete account group + + Deletes an account group using its ID. This operation requires the following permissions: * Assign management permissions * Delete account * Edit all account groups + + :param id: Identifier for the account group. (required) + :type id: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_account_group_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _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( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ).data + + + @validate_call + def delete_account_group_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Identifier for the account group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete account group + + Deletes an account group using its ID. This operation requires the following permissions: * Assign management permissions * Delete account * Edit all account groups + + :param id: Identifier for the account group. (required) + :type id: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_account_group_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _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( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ) + + + @validate_call + def delete_account_group_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Identifier for the account group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete account group + + Deletes an account group using its ID. This operation requires the following permissions: * Assign management permissions * Delete account * Edit all account groups + + :param id: Identifier for the account group. (required) + :type id: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_account_group_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _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( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_account_group_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/account-groups/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_account_group( + self, + id: Annotated[StrictStr, Field(description="Identifier for the account group.")], + expand: Annotated[Optional[List[Expand]], Field(description="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.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AccountGroupDetail: + """Retrieve account group + + Retrieves detailed information about an account group using its ID. This operation requires the `View all account groups settings` permission. + + :param id: Identifier for the account group. (required) + :type id: str + :param 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. + :type expand: List[Expand] + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_account_group_serialize( + id=id, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountGroupDetail", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ).data + + + @validate_call + def get_account_group_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Identifier for the account group.")], + expand: Annotated[Optional[List[Expand]], Field(description="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.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AccountGroupDetail]: + """Retrieve account group + + Retrieves detailed information about an account group using its ID. This operation requires the `View all account groups settings` permission. + + :param id: Identifier for the account group. (required) + :type id: str + :param 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. + :type expand: List[Expand] + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_account_group_serialize( + id=id, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountGroupDetail", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ) + + + @validate_call + def get_account_group_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Identifier for the account group.")], + expand: Annotated[Optional[List[Expand]], Field(description="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.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve account group + + Retrieves detailed information about an account group using its ID. This operation requires the `View all account groups settings` permission. + + :param id: Identifier for the account group. (required) + :type id: str + :param 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. + :type expand: List[Expand] + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_account_group_serialize( + id=id, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountGroupDetail", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_account_group_serialize( + self, + id, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/account-groups/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_account_groups( + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AccountGroups: + """List account groups + + Retrieves a list of account groups available to the current user. + + :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 + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_account_groups_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountGroups", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ).data + + + @validate_call + def get_account_groups_with_http_info( + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AccountGroups]: + """List account groups + + Retrieves a list of account groups available to the current user. + + :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 + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_account_groups_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountGroups", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ) + + + @validate_call + def get_account_groups_without_preload_content( + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List account groups + + Retrieves a list of account groups available to the current user. + + :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 + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_account_groups_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountGroups", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_account_groups_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/account-groups', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_account_group( + self, + id: Annotated[StrictStr, Field(description="Identifier for the account group.")], + account_group_request: AccountGroupRequest, + expand: Annotated[Optional[List[Expand]], Field(description="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.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AccountGroupDetail: + """Update account group + + Updates an account group using its ID. You can modify the account group’s name or the list of agents assigned to the account group. + + :param id: Identifier for the account group. (required) + :type id: str + :param account_group_request: (required) + :type account_group_request: AccountGroupRequest + :param 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. + :type expand: List[Expand] + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_account_group_serialize( + id=id, + account_group_request=account_group_request, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountGroupDetail", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ).data + + + @validate_call + def update_account_group_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Identifier for the account group.")], + account_group_request: AccountGroupRequest, + expand: Annotated[Optional[List[Expand]], Field(description="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.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AccountGroupDetail]: + """Update account group + + Updates an account group using its ID. You can modify the account group’s name or the list of agents assigned to the account group. + + :param id: Identifier for the account group. (required) + :type id: str + :param account_group_request: (required) + :type account_group_request: AccountGroupRequest + :param 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. + :type expand: List[Expand] + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_account_group_serialize( + id=id, + account_group_request=account_group_request, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountGroupDetail", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ) + + + @validate_call + def update_account_group_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Identifier for the account group.")], + account_group_request: AccountGroupRequest, + expand: Annotated[Optional[List[Expand]], Field(description="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.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update account group + + Updates an account group using its ID. You can modify the account group’s name or the list of agents assigned to the account group. + + :param id: Identifier for the account group. (required) + :type id: str + :param account_group_request: (required) + :type account_group_request: AccountGroupRequest + :param 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. + :type expand: List[Expand] + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_account_group_serialize( + id=id, + account_group_request=account_group_request, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountGroupDetail", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_account_group_serialize( + self, + id, + account_group_request, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if expand is not None: + + _query_params.append(('expand', expand)) + + # process the header parameters + # process the form parameters + # process the body parameter + if account_group_request is not None: + _body_params = account_group_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/v7/account-groups/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/permissions_api.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/permissions_api.py new file mode 100644 index 00000000..2a2546da --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/permissions_api.py @@ -0,0 +1,325 @@ +# 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.6 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +import thousandeyes_sdk.administrative.models + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.administrative.models.permissions import Permissions + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType +from thousandeyes_sdk.core.version import Version + + +class PermissionsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(Version.get()) + self.api_client = api_client + + + @validate_call + def get_permissions( + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Permissions: + """List assignable permissions + + Users must be in a role assigned management permissions to access this endpoint. Users without management permissions who attempt to access this endpoint receive an HTTP/403 response code. + + :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 + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_permissions_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Permissions", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ).data + + + @validate_call + def get_permissions_with_http_info( + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Permissions]: + """List assignable permissions + + Users must be in a role assigned management permissions to access this endpoint. Users without management permissions who attempt to access this endpoint receive an HTTP/403 response code. + + :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 + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_permissions_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Permissions", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ) + + + @validate_call + def get_permissions_without_preload_content( + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List assignable permissions + + Users must be in a role assigned management permissions to access this endpoint. Users without management permissions who attempt to access this endpoint receive an HTTP/403 response code. + + :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 + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_permissions_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Permissions", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_permissions_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/permissions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/roles_api.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/roles_api.py new file mode 100644 index 00000000..eb19cf63 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/roles_api.py @@ -0,0 +1,1555 @@ +# 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.6 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +import thousandeyes_sdk.administrative.models + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.administrative.models.role_detail import RoleDetail +from thousandeyes_sdk.administrative.models.role_request_body import RoleRequestBody +from thousandeyes_sdk.administrative.models.roles import Roles + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType +from thousandeyes_sdk.core.version import Version + + +class RolesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(Version.get()) + self.api_client = api_client + + + @validate_call + def create_role( + self, + role_request_body: RoleRequestBody, + 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[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RoleDetail: + """Create role + + Creates a new role. + + :param role_request_body: (required) + :type role_request_body: RoleRequestBody + :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 + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_role_serialize( + role_request_body=role_request_body, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "RoleDetail", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ).data + + + @validate_call + def create_role_with_http_info( + self, + role_request_body: RoleRequestBody, + 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[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RoleDetail]: + """Create role + + Creates a new role. + + :param role_request_body: (required) + :type role_request_body: RoleRequestBody + :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 + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_role_serialize( + role_request_body=role_request_body, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "RoleDetail", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ) + + + @validate_call + def create_role_without_preload_content( + self, + role_request_body: RoleRequestBody, + 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[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create role + + Creates a new role. + + :param role_request_body: (required) + :type role_request_body: RoleRequestBody + :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 + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_role_serialize( + role_request_body=role_request_body, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "RoleDetail", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_role_serialize( + self, + role_request_body, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if role_request_body is not None: + _body_params = role_request_body + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v7/roles', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_role( + self, + id: Annotated[StrictStr, Field(description="The ID of the desired role.")], + 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[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete role + + Deletes a role using its ID. The user needs appropriate permissions to successfully call this endpoint. + + :param id: The ID of the desired role. (required) + :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. + :type aid: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_role_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _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( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ).data + + + @validate_call + def delete_role_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The ID of the desired role.")], + 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[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete role + + Deletes a role using its ID. The user needs appropriate permissions to successfully call this endpoint. + + :param id: The ID of the desired role. (required) + :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. + :type aid: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_role_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _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( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ) + + + @validate_call + def delete_role_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The ID of the desired role.")], + 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[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete role + + Deletes a role using its ID. The user needs appropriate permissions to successfully call this endpoint. + + :param id: The ID of the desired role. (required) + :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. + :type aid: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_role_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _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( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_role_serialize( + self, + id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/roles/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_role( + self, + id: Annotated[StrictStr, Field(description="The ID of the desired role.")], + 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[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RoleDetail: + """Retrieve role + + Returns detailed information about a role using its ID. + + :param id: The ID of the desired role. (required) + :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. + :type aid: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_role_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RoleDetail", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ).data + + + @validate_call + def get_role_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The ID of the desired role.")], + 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[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RoleDetail]: + """Retrieve role + + Returns detailed information about a role using its ID. + + :param id: The ID of the desired role. (required) + :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. + :type aid: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_role_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RoleDetail", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ) + + + @validate_call + def get_role_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The ID of the desired role.")], + 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[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve role + + Returns detailed information about a role using its ID. + + :param id: The ID of the desired role. (required) + :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. + :type aid: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_role_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RoleDetail", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_role_serialize( + self, + id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/roles/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_roles( + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Roles: + """List roles + + Retrieves a list of defined roles visible to the current user. + + :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 + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_roles_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Roles", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ).data + + + @validate_call + def get_roles_with_http_info( + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Roles]: + """List roles + + Retrieves a list of defined roles visible to the current user. + + :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 + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_roles_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Roles", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ) + + + @validate_call + def get_roles_without_preload_content( + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List roles + + Retrieves a list of defined roles visible to the current user. + + :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 + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_roles_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Roles", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_roles_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/roles', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_role( + self, + id: Annotated[StrictStr, Field(description="The ID of the desired role.")], + role_request_body: RoleRequestBody, + 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[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RoleDetail: + """Update role + + Updates a user-defined role using its ID. When updating a role, the following applies: * The full list of permissions must be sent, This endpoint does not support delta-based grant or revoking of permissions. * Permission definitions and details can be obtained from the Permissions endpoint. + + :param id: The ID of the desired role. (required) + :type id: str + :param role_request_body: (required) + :type role_request_body: RoleRequestBody + :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 + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_role_serialize( + id=id, + role_request_body=role_request_body, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RoleDetail", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ).data + + + @validate_call + def update_role_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The ID of the desired role.")], + role_request_body: RoleRequestBody, + 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[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RoleDetail]: + """Update role + + Updates a user-defined role using its ID. When updating a role, the following applies: * The full list of permissions must be sent, This endpoint does not support delta-based grant or revoking of permissions. * Permission definitions and details can be obtained from the Permissions endpoint. + + :param id: The ID of the desired role. (required) + :type id: str + :param role_request_body: (required) + :type role_request_body: RoleRequestBody + :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 + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_role_serialize( + id=id, + role_request_body=role_request_body, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RoleDetail", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ) + + + @validate_call + def update_role_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The ID of the desired role.")], + role_request_body: RoleRequestBody, + 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[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update role + + Updates a user-defined role using its ID. When updating a role, the following applies: * The full list of permissions must be sent, This endpoint does not support delta-based grant or revoking of permissions. * Permission definitions and details can be obtained from the Permissions endpoint. + + :param id: The ID of the desired role. (required) + :type id: str + :param role_request_body: (required) + :type role_request_body: RoleRequestBody + :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 + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_role_serialize( + id=id, + role_request_body=role_request_body, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RoleDetail", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_role_serialize( + self, + id, + role_request_body, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if role_request_body is not None: + _body_params = role_request_body + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/v7/roles/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/user_events_api.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/user_events_api.py new file mode 100644 index 00000000..8625680a --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/user_events_api.py @@ -0,0 +1,429 @@ +# 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.6 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +import thousandeyes_sdk.administrative.models + +from datetime import datetime +from pydantic import Field, StrictBool, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.administrative.models.audit_user_events import AuditUserEvents + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType +from thousandeyes_sdk.core.version import Version + + +class UserEventsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(Version.get()) + self.api_client = api_client + + + @validate_call + def get_user_events( + 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, + 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, + 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, + 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[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AuditUserEvents: + """List activity log events + + 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. + :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`. + :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`. + :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`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_events_serialize( + aid=aid, + use_all_permitted_aids=use_all_permitted_aids, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuditUserEvents", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ).data + + + @validate_call + def get_user_events_with_http_info( + 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, + 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, + 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, + 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[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AuditUserEvents]: + """List activity log events + + 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. + :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`. + :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`. + :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`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_events_serialize( + aid=aid, + use_all_permitted_aids=use_all_permitted_aids, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuditUserEvents", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ) + + + @validate_call + def get_user_events_without_preload_content( + 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, + 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, + 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, + 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[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List activity log events + + 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. + :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`. + :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`. + :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`. + :type end_date: datetime + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_events_serialize( + aid=aid, + use_all_permitted_aids=use_all_permitted_aids, + window=window, + start_date=start_date, + end_date=end_date, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuditUserEvents", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_user_events_serialize( + self, + aid, + use_all_permitted_aids, + window, + start_date, + end_date, + cursor, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _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: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/audit-user-events', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/users_api.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/users_api.py new file mode 100644 index 00000000..1b4f5331 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/api/users_api.py @@ -0,0 +1,1556 @@ +# 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.6 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +import thousandeyes_sdk.administrative.models + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.administrative.models.created_user import CreatedUser +from thousandeyes_sdk.administrative.models.user_detail import UserDetail +from thousandeyes_sdk.administrative.models.user_request import UserRequest +from thousandeyes_sdk.administrative.models.users import Users + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType +from thousandeyes_sdk.core.version import Version + + +class UsersApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(Version.get()) + self.api_client = api_client + + + @validate_call + def create_user( + self, + user_request: UserRequest, + 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[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CreatedUser: + """Create user + + Creates a new user. The following applies when creating a user: * If the user is already a member of another ThousandEyes customer organization, the user must set their own login account group. * Any update that includes `accountGroupRoles` is a replace-based update and not a delta-based update. + + :param user_request: (required) + :type user_request: UserRequest + :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 + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_user_serialize( + user_request=user_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreatedUser", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ).data + + + @validate_call + def create_user_with_http_info( + self, + user_request: UserRequest, + 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[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CreatedUser]: + """Create user + + Creates a new user. The following applies when creating a user: * If the user is already a member of another ThousandEyes customer organization, the user must set their own login account group. * Any update that includes `accountGroupRoles` is a replace-based update and not a delta-based update. + + :param user_request: (required) + :type user_request: UserRequest + :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 + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_user_serialize( + user_request=user_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreatedUser", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ) + + + @validate_call + def create_user_without_preload_content( + self, + user_request: UserRequest, + 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[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create user + + Creates a new user. The following applies when creating a user: * If the user is already a member of another ThousandEyes customer organization, the user must set their own login account group. * Any update that includes `accountGroupRoles` is a replace-based update and not a delta-based update. + + :param user_request: (required) + :type user_request: UserRequest + :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 + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_user_serialize( + user_request=user_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreatedUser", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_user_serialize( + self, + user_request, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if user_request is not None: + _body_params = user_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v7/users', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_user( + self, + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete user + + Deletes a user using the user ID. This endpoint requires the `Edit users in all account groups` or `Edit users` permission. + + :param id: Identifier for the user. (required) + :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. + :type aid: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_user_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _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( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ).data + + + @validate_call + def delete_user_with_http_info( + self, + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete user + + Deletes a user using the user ID. This endpoint requires the `Edit users in all account groups` or `Edit users` permission. + + :param id: Identifier for the user. (required) + :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. + :type aid: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_user_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _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( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ) + + + @validate_call + def delete_user_without_preload_content( + self, + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete user + + Deletes a user using the user ID. This endpoint requires the `Edit users in all account groups` or `Edit users` permission. + + :param id: Identifier for the user. (required) + :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. + :type aid: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_user_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _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( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_user_serialize( + self, + id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v7/users/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_user( + self, + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UserDetail: + """Retrieve user + + Retrieves detailed information about a user. This operation requires the `API Access` and `View All Users` permissions. + + :param id: Identifier for the user. (required) + :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. + :type aid: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserDetail", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ).data + + + @validate_call + def get_user_with_http_info( + self, + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UserDetail]: + """Retrieve user + + Retrieves detailed information about a user. This operation requires the `API Access` and `View All Users` permissions. + + :param id: Identifier for the user. (required) + :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. + :type aid: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserDetail", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ) + + + @validate_call + def get_user_without_preload_content( + self, + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve user + + Retrieves detailed information about a user. This operation requires the `API Access` and `View All Users` permissions. + + :param id: Identifier for the user. (required) + :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. + :type aid: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserDetail", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_user_serialize( + self, + id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/users/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_users( + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Users: + """List users + + Retrieves a list of users in the organization the account group ID belongs to. This operation requires the `API Access` and `View all users` permissions. See [Account Context](https://developer.thousandeyes.com/v7/#/accountcontext) for more information on changing the account group context. + + :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 + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_users_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Users", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ).data + + + @validate_call + def get_users_with_http_info( + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Users]: + """List users + + Retrieves a list of users in the organization the account group ID belongs to. This operation requires the `API Access` and `View all users` permissions. See [Account Context](https://developer.thousandeyes.com/v7/#/accountcontext) for more information on changing the account group context. + + :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 + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_users_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Users", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ) + + + @validate_call + def get_users_without_preload_content( + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List users + + Retrieves a list of users in the organization the account group ID belongs to. This operation requires the `API Access` and `View all users` permissions. See [Account Context](https://developer.thousandeyes.com/v7/#/accountcontext) for more information on changing the account group context. + + :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 + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_users_serialize( + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Users", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_users_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/users', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_user( + self, + id: Annotated[StrictStr, Field(description="Identifier for the user.")], + user_request: UserRequest, + 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[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UserDetail: + """Update user + + 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: Identifier for the user. (required) + :type id: str + :param user_request: (required) + :type user_request: UserRequest + :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 + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_user_serialize( + id=id, + user_request=user_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserDetail", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ).data + + + @validate_call + def update_user_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Identifier for the user.")], + user_request: UserRequest, + 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[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UserDetail]: + """Update user + + 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: Identifier for the user. (required) + :type id: str + :param user_request: (required) + :type user_request: UserRequest + :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 + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_user_serialize( + id=id, + user_request=user_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserDetail", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.administrative.models, + ) + + + @validate_call + def update_user_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Identifier for the user.")], + user_request: UserRequest, + 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[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update user + + 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: Identifier for the user. (required) + :type id: str + :param user_request: (required) + :type user_request: UserRequest + :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 + :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. + :type _request_timeout: int, tuple(int, int), optional + :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. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_user_serialize( + id=id, + user_request=user_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserDetail", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_user_serialize( + self, + id, + user_request, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if user_request is not None: + _body_params = user_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/v7/users/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/__init__.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/__init__.py new file mode 100644 index 00000000..c82fab43 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/__init__.py @@ -0,0 +1,61 @@ +# 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.6 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +# import models into model package +from thousandeyes_sdk.administrative.models.account_group import AccountGroup +from thousandeyes_sdk.administrative.models.account_group_detail import AccountGroupDetail +from thousandeyes_sdk.administrative.models.account_group_info import AccountGroupInfo +from thousandeyes_sdk.administrative.models.account_group_request import AccountGroupRequest +from thousandeyes_sdk.administrative.models.account_group_role import AccountGroupRole +from thousandeyes_sdk.administrative.models.account_groups import AccountGroups +from thousandeyes_sdk.administrative.models.agent import Agent +from thousandeyes_sdk.administrative.models.agent_base import AgentBase +from thousandeyes_sdk.administrative.models.audit_user_events import AuditUserEvents +from thousandeyes_sdk.administrative.models.base_role import BaseRole +from thousandeyes_sdk.administrative.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType +from thousandeyes_sdk.administrative.models.cluster_member import ClusterMember +from thousandeyes_sdk.administrative.models.created_account_group import CreatedAccountGroup +from thousandeyes_sdk.administrative.models.created_user import CreatedUser +from thousandeyes_sdk.administrative.models.enterprise_agent import EnterpriseAgent +from thousandeyes_sdk.administrative.models.enterprise_agent_data import EnterpriseAgentData +from thousandeyes_sdk.administrative.models.enterprise_agent_ipv6_policy import EnterpriseAgentIpv6Policy +from thousandeyes_sdk.administrative.models.enterprise_agent_state import EnterpriseAgentState +from thousandeyes_sdk.administrative.models.error import Error +from thousandeyes_sdk.administrative.models.error_detail import ErrorDetail +from thousandeyes_sdk.administrative.models.error_detail_code import ErrorDetailCode +from thousandeyes_sdk.administrative.models.expand import Expand +from thousandeyes_sdk.administrative.models.extended_user import ExtendedUser +from thousandeyes_sdk.administrative.models.interface_ip_mapping import InterfaceIpMapping +from thousandeyes_sdk.administrative.models.link import Link +from thousandeyes_sdk.administrative.models.pagination_links import PaginationLinks +from thousandeyes_sdk.administrative.models.permission import Permission +from thousandeyes_sdk.administrative.models.permissions import Permissions +from thousandeyes_sdk.administrative.models.resource import Resource +from thousandeyes_sdk.administrative.models.role import Role +from thousandeyes_sdk.administrative.models.role_detail import RoleDetail +from thousandeyes_sdk.administrative.models.role_request_body import RoleRequestBody +from thousandeyes_sdk.administrative.models.roles import Roles +from thousandeyes_sdk.administrative.models.self_links import SelfLinks +from thousandeyes_sdk.administrative.models.simple_agent import SimpleAgent +from thousandeyes_sdk.administrative.models.unauthorized_error import UnauthorizedError +from thousandeyes_sdk.administrative.models.user import User +from thousandeyes_sdk.administrative.models.user_account_group import UserAccountGroup +from thousandeyes_sdk.administrative.models.user_account_group_role import UserAccountGroupRole +from thousandeyes_sdk.administrative.models.user_detail import UserDetail +from thousandeyes_sdk.administrative.models.user_event import UserEvent +from thousandeyes_sdk.administrative.models.user_request import UserRequest +from thousandeyes_sdk.administrative.models.users import Users +from thousandeyes_sdk.administrative.models.validation_error import ValidationError +from thousandeyes_sdk.administrative.models.validation_error_item import ValidationErrorItem diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/account_group.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/account_group.py new file mode 100644 index 00000000..230ad6ec --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/account_group.py @@ -0,0 +1,90 @@ +# 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.6 + 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 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") + __properties: ClassVar[List[str]] = ["aid", "accountGroupName"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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") + }) + return _obj + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/account_group_detail.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/account_group_detail.py new file mode 100644 index 00000000..fc6c0e20 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/account_group_detail.py @@ -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.6 + 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 thousandeyes_sdk.administrative.models.enterprise_agent import EnterpriseAgent +from thousandeyes_sdk.administrative.models.self_links import SelfLinks +from thousandeyes_sdk.administrative.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 + links: Optional[SelfLinks] = Field(default=None, alias="_links") + agents: Optional[List[EnterpriseAgent]] = None + __properties: ClassVar[List[str]] = ["aid", "accountGroupName", "isCurrentAccountGroup", "isDefaultAccountGroup", "organizationName", "users", "_links", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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 links + if self.links: + _dict['_links'] = self.links.to_dict() + # 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, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") 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 + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/account_group_info.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/account_group_info.py new file mode 100644 index 00000000..85f0febc --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/account_group_info.py @@ -0,0 +1,96 @@ +# 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.6 + 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 AccountGroupInfo(BaseModel): + """ + AccountGroupInfo + """ # 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AccountGroupInfo 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 AccountGroupInfo 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 + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/account_group_request.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/account_group_request.py new file mode 100644 index 00000000..c0144026 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/account_group_request.py @@ -0,0 +1,90 @@ +# 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.6 + 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 AccountGroupRequest(BaseModel): + """ + AccountGroupRequest + """ # 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AccountGroupRequest 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 AccountGroupRequest 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 + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/account_group_role.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/account_group_role.py new file mode 100644 index 00000000..d4426394 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/account_group_role.py @@ -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.6 + 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 thousandeyes_sdk.administrative.models.account_group import AccountGroup +from thousandeyes_sdk.administrative.models.role import Role +from typing import Optional, Set +from typing_extensions import Self + +class AccountGroupRole(BaseModel): + """ + AccountGroupRole + """ # noqa: E501 + account_group: Optional[AccountGroup] = 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AccountGroupRole 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 AccountGroupRole from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "accountGroup": AccountGroup.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 + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/account_groups.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/account_groups.py new file mode 100644 index 00000000..7e69e602 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/account_groups.py @@ -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.6 + 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 thousandeyes_sdk.administrative.models.account_group_info import AccountGroupInfo +from thousandeyes_sdk.administrative.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class AccountGroups(BaseModel): + """ + AccountGroups + """ # noqa: E501 + account_groups: Optional[List[AccountGroupInfo]] = Field(default=None, alias="accountGroups") + links: Optional[SelfLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["accountGroups", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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 + # 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 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": [AccountGroupInfo.from_dict(_item) for _item in obj["accountGroups"]] if obj.get("accountGroups") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/agent.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/agent.py new file mode 100644 index 00000000..a348e66f --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/agent.py @@ -0,0 +1,125 @@ +# 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.6 + 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 thousandeyes_sdk.administrative.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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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 + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/agent_base.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/agent_base.py new file mode 100644 index 00000000..d62e0ece --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/agent_base.py @@ -0,0 +1,98 @@ +# 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.6 + 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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 + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/audit_user_events.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/audit_user_events.py new file mode 100644 index 00000000..6d26390d --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/audit_user_events.py @@ -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.6 + 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 thousandeyes_sdk.administrative.models.pagination_links import PaginationLinks +from thousandeyes_sdk.administrative.models.user_event import UserEvent +from typing import Optional, Set +from typing_extensions import Self + +class AuditUserEvents(BaseModel): + """ + AuditUserEvents + """ # noqa: E501 + audit_events: Optional[List[UserEvent]] = Field(default=None, alias="auditEvents") + 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") + links: Optional[PaginationLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["auditEvents", "startDate", "endDate", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AuditUserEvents 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 AuditUserEvents 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, + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "_links": PaginationLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/base_role.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/base_role.py new file mode 100644 index 00000000..1b10da70 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/base_role.py @@ -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.6 + 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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 + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/cloud_enterprise_agent_type.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/cloud_enterprise_agent_type.py new file mode 100644 index 00000000..cf35f086 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/cloud_enterprise_agent_type.py @@ -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.6 + 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)) + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/cluster_member.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/cluster_member.py new file mode 100644 index 00000000..90f685eb --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/cluster_member.py @@ -0,0 +1,132 @@ +# 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.6 + 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 thousandeyes_sdk.administrative.models.enterprise_agent_state import EnterpriseAgentState +from thousandeyes_sdk.administrative.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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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 + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/created_account_group.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/created_account_group.py new file mode 100644 index 00000000..b24ec17d --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/created_account_group.py @@ -0,0 +1,112 @@ +# 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.6 + 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 thousandeyes_sdk.administrative.models.self_links import SelfLinks +from thousandeyes_sdk.administrative.models.user_account_group import UserAccountGroup +from typing import Optional, Set +from typing_extensions import Self + +class CreatedAccountGroup(BaseModel): + """ + CreatedAccountGroup + """ # 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[SelfLinks] = 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreatedAccountGroup 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 CreatedAccountGroup 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": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/created_user.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/created_user.py new file mode 100644 index 00000000..fa9e7053 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/created_user.py @@ -0,0 +1,127 @@ +# 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.6 + 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 thousandeyes_sdk.administrative.models.account_group import AccountGroup +from thousandeyes_sdk.administrative.models.account_group_role import AccountGroupRole +from thousandeyes_sdk.administrative.models.role import Role +from thousandeyes_sdk.administrative.models.self_links import SelfLinks +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[AccountGroup] = Field(default=None, alias="loginAccountGroup") + account_group_roles: Optional[List[AccountGroupRole]] = Field(default=None, alias="accountGroupRoles") + all_account_group_roles: Optional[List[Role]] = Field(default=None, alias="allAccountGroupRoles") + links: Optional[SelfLinks] = 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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 + # 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 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": AccountGroup.from_dict(obj["loginAccountGroup"]) if obj.get("loginAccountGroup") is not None else None, + "accountGroupRoles": [AccountGroupRole.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": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/enterprise_agent.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/enterprise_agent.py new file mode 100644 index 00000000..2a6b0fd9 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/enterprise_agent.py @@ -0,0 +1,200 @@ +# 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.6 + 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 thousandeyes_sdk.administrative.models.account_group import AccountGroup +from thousandeyes_sdk.administrative.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType +from thousandeyes_sdk.administrative.models.cluster_member import ClusterMember +from thousandeyes_sdk.administrative.models.enterprise_agent_ipv6_policy import EnterpriseAgentIpv6Policy +from thousandeyes_sdk.administrative.models.enterprise_agent_state import EnterpriseAgentState +from thousandeyes_sdk.administrative.models.error_detail import ErrorDetail +from thousandeyes_sdk.administrative.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[AccountGroup]] = 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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": [AccountGroup.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 + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/enterprise_agent_data.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/enterprise_agent_data.py new file mode 100644 index 00000000..71a6b97f --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/enterprise_agent_data.py @@ -0,0 +1,161 @@ +# 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.6 + 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 thousandeyes_sdk.administrative.models.account_group import AccountGroup +from thousandeyes_sdk.administrative.models.cluster_member import ClusterMember +from thousandeyes_sdk.administrative.models.enterprise_agent_ipv6_policy import EnterpriseAgentIpv6Policy +from thousandeyes_sdk.administrative.models.enterprise_agent_state import EnterpriseAgentState +from thousandeyes_sdk.administrative.models.error_detail import ErrorDetail +from thousandeyes_sdk.administrative.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[AccountGroup]] = 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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": [AccountGroup.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 + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/enterprise_agent_ipv6_policy.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/enterprise_agent_ipv6_policy.py new file mode 100644 index 00000000..d9340676 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/enterprise_agent_ipv6_policy.py @@ -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.6 + 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)) + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/enterprise_agent_state.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/enterprise_agent_state.py new file mode 100644 index 00000000..440eb537 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/enterprise_agent_state.py @@ -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.6 + 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)) + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/error.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/error.py new file mode 100644 index 00000000..de648f47 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/error.py @@ -0,0 +1,96 @@ +# 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.6 + 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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 + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/error_detail.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/error_detail.py new file mode 100644 index 00000000..aaddbbeb --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/error_detail.py @@ -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.6 + 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 thousandeyes_sdk.administrative.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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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 + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/error_detail_code.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/error_detail_code.py new file mode 100644 index 00000000..c83b62b6 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/error_detail_code.py @@ -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.6 + 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)) + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/expand.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/expand.py new file mode 100644 index 00000000..f3ecf72f --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/expand.py @@ -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.6 + 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)) + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/extended_user.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/extended_user.py new file mode 100644 index 00000000..42cf1ffc --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/extended_user.py @@ -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.6 + 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 thousandeyes_sdk.administrative.models.account_group import AccountGroup +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[AccountGroup] = 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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": AccountGroup.from_dict(obj["loginAccountGroup"]) if obj.get("loginAccountGroup") is not None else None, + "lastLogin": obj.get("lastLogin") + }) + return _obj + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/interface_ip_mapping.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/interface_ip_mapping.py new file mode 100644 index 00000000..a0639eed --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/interface_ip_mapping.py @@ -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.6 + 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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 + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/link.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/link.py new file mode 100644 index 00000000..f68172dc --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/link.py @@ -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.6 + 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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 + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/pagination_links.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/pagination_links.py new file mode 100644 index 00000000..a7864f97 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/pagination_links.py @@ -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.6 + 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 thousandeyes_sdk.administrative.models.link import Link +from typing import Optional, Set +from typing_extensions import Self + +class PaginationLinks(BaseModel): + """ + A links object containing pagination related link(s). + """ # 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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 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 PaginationLinks 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 + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/permission.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/permission.py new file mode 100644 index 00000000..c3efb418 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/permission.py @@ -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.6 + 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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 + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/permissions.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/permissions.py new file mode 100644 index 00000000..df7a4c17 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/permissions.py @@ -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.6 + 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 thousandeyes_sdk.administrative.models.permission import Permission +from thousandeyes_sdk.administrative.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class Permissions(BaseModel): + """ + Permissions + """ # noqa: E501 + permissions: Optional[List[Permission]] = None + links: Optional[SelfLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["permissions", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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 + # 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 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, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/resource.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/resource.py new file mode 100644 index 00000000..3d67f531 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/resource.py @@ -0,0 +1,90 @@ +# 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.6 + 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 Resource(BaseModel): + """ + Resource + """ # 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Resource 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 Resource 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 + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/role.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/role.py new file mode 100644 index 00000000..436cc33f --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/role.py @@ -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.6 + 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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 + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/role_detail.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/role_detail.py new file mode 100644 index 00000000..2a50bc99 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/role_detail.py @@ -0,0 +1,108 @@ +# 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.6 + 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 thousandeyes_sdk.administrative.models.permission import Permission +from thousandeyes_sdk.administrative.models.self_links import SelfLinks +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 + links: Optional[SelfLinks] = 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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 + # 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 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, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/role_request_body.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/role_request_body.py new file mode 100644 index 00000000..ad252985 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/role_request_body.py @@ -0,0 +1,90 @@ +# 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.6 + 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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 + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/roles.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/roles.py new file mode 100644 index 00000000..2301ae02 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/roles.py @@ -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.6 + 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 thousandeyes_sdk.administrative.models.role import Role +from thousandeyes_sdk.administrative.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class Roles(BaseModel): + """ + Roles + """ # noqa: E501 + roles: Optional[List[Role]] = None + links: Optional[SelfLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["roles", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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 + # 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 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, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/self_links.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/self_links.py new file mode 100644 index 00000000..03803398 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/self_links.py @@ -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.6 + 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 thousandeyes_sdk.administrative.models.link import Link +from typing import Optional, Set +from typing_extensions import Self + +class SelfLinks(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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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 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 SelfLinks 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 + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/simple_agent.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/simple_agent.py new file mode 100644 index 00000000..89d76c0a --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/simple_agent.py @@ -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.6 + 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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 + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/unauthorized_error.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/unauthorized_error.py new file mode 100644 index 00000000..b5721cc9 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/unauthorized_error.py @@ -0,0 +1,90 @@ +# 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.6 + 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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 + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/user.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/user.py new file mode 100644 index 00000000..9f4b0986 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/user.py @@ -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.6 + 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 thousandeyes_sdk.administrative.models.account_group import AccountGroup +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[AccountGroup] = 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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": AccountGroup.from_dict(obj["loginAccountGroup"]) if obj.get("loginAccountGroup") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/user_account_group.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/user_account_group.py new file mode 100644 index 00000000..1d64c846 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/user_account_group.py @@ -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.6 + 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 thousandeyes_sdk.administrative.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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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 + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/user_account_group_role.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/user_account_group_role.py new file mode 100644 index 00000000..0d248f41 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/user_account_group_role.py @@ -0,0 +1,90 @@ +# 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.6 + 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 UserAccountGroupRole(BaseModel): + """ + UserAccountGroupRole + """ # 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UserAccountGroupRole 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 UserAccountGroupRole 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 + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/user_detail.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/user_detail.py new file mode 100644 index 00000000..03070fe8 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/user_detail.py @@ -0,0 +1,129 @@ +# 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.6 + 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 thousandeyes_sdk.administrative.models.account_group import AccountGroup +from thousandeyes_sdk.administrative.models.account_group_role import AccountGroupRole +from thousandeyes_sdk.administrative.models.role import Role +from thousandeyes_sdk.administrative.models.self_links import SelfLinks +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[AccountGroup] = 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[AccountGroupRole]] = Field(default=None, alias="accountGroupRoles") + all_account_group_roles: Optional[List[Role]] = Field(default=None, alias="allAccountGroupRoles") + links: Optional[SelfLinks] = 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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 + # 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 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": AccountGroup.from_dict(obj["loginAccountGroup"]) if obj.get("loginAccountGroup") is not None else None, + "lastLogin": obj.get("lastLogin"), + "accountGroupRoles": [AccountGroupRole.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": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/user_event.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/user_event.py new file mode 100644 index 00000000..10ede084 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/user_event.py @@ -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.6 + 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 thousandeyes_sdk.administrative.models.resource import Resource +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[Resource]] = 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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": [Resource.from_dict(_item) for _item in obj["resources"]] if obj.get("resources") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/user_request.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/user_request.py new file mode 100644 index 00000000..b3da408c --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/user_request.py @@ -0,0 +1,104 @@ +# 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.6 + 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 thousandeyes_sdk.administrative.models.user_account_group_role import UserAccountGroupRole +from typing import Optional, Set +from typing_extensions import Self + +class UserRequest(BaseModel): + """ + UserRequest + """ # 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[UserAccountGroupRole]] = 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UserRequest 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 UserRequest 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": [UserAccountGroupRole.from_dict(_item) for _item in obj["accountGroupRoles"]] if obj.get("accountGroupRoles") is not None else None, + "allAccountGroupRoleIds": obj.get("allAccountGroupRoleIds") + }) + return _obj + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/users.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/users.py new file mode 100644 index 00000000..a730f2fb --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/users.py @@ -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.6 + 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 thousandeyes_sdk.administrative.models.extended_user import ExtendedUser +from thousandeyes_sdk.administrative.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class Users(BaseModel): + """ + Users + """ # noqa: E501 + users: Optional[List[ExtendedUser]] = None + links: Optional[SelfLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["users", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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 + # 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 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, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/validation_error.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/validation_error.py new file mode 100644 index 00000000..2dbc9d62 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/validation_error.py @@ -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.6 + 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 thousandeyes_sdk.administrative.models.validation_error_item import ValidationErrorItem +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[ValidationErrorItem]] = 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @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": [ValidationErrorItem.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/validation_error_item.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/validation_error_item.py new file mode 100644 index 00000000..0080a6fe --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/validation_error_item.py @@ -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.6 + 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 ValidationErrorItem(BaseModel): + """ + ValidationErrorItem + """ # 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[StrictStr] = 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=(), + extra="allow", + ) + + + 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 self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ValidationErrorItem 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 ValidationErrorItem 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 + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/py.typed b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/thousandeyes-sdk-administrative/test/test_account_groups_api.py b/thousandeyes-sdk-administrative/test/test_account_groups_api.py index 3b42863a..eff57116 100644 --- a/thousandeyes-sdk-administrative/test/test_account_groups_api.py +++ b/thousandeyes-sdk-administrative/test/test_account_groups_api.py @@ -14,10 +14,10 @@ import json import unittest -import thousandeyes_sdk.admin.models +import thousandeyes_sdk.administrative.models from .test_utils import assert_constructed_model_matches_example_json -from thousandeyes_sdk.admin.api.account_groups_api import AccountGroupsApi +from thousandeyes_sdk.administrative.api.account_groups_api import AccountGroupsApi class TestAccountGroupsApi(unittest.TestCase): @@ -38,7 +38,7 @@ class TestAccountGroupsApi(unittest.TestCase): }""" request_loaded_json = json.loads(request_body_json) - request_from_json = thousandeyes_sdk.admin.models.AccountGroupRequest.from_json(request_body_json) + request_from_json = thousandeyes_sdk.administrative.models.AccountGroupRequest.from_json(request_body_json) assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) response_body_json = """ @@ -98,7 +98,7 @@ class TestAccountGroupsApi(unittest.TestCase): }""" response_loaded_json = json.loads(response_body_json) - response_from_json = thousandeyes_sdk.admin.models.CreatedAccountGroup.from_json(response_body_json) + response_from_json = thousandeyes_sdk.administrative.models.CreatedAccountGroup.from_json(response_body_json) assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) def test_delete_account_group_models_validation(self) -> None: @@ -320,7 +320,7 @@ class TestAccountGroupsApi(unittest.TestCase): }""" response_loaded_json = json.loads(response_body_json) - response_from_json = thousandeyes_sdk.admin.models.AccountGroupDetail.from_json(response_body_json) + response_from_json = thousandeyes_sdk.administrative.models.AccountGroupDetail.from_json(response_body_json) assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) def test_get_account_groups_models_validation(self) -> None: @@ -356,7 +356,7 @@ class TestAccountGroupsApi(unittest.TestCase): }""" response_loaded_json = json.loads(response_body_json) - response_from_json = thousandeyes_sdk.admin.models.AccountGroups.from_json(response_body_json) + response_from_json = thousandeyes_sdk.administrative.models.AccountGroups.from_json(response_body_json) assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) def test_update_account_group_models_validation(self) -> None: @@ -368,7 +368,7 @@ class TestAccountGroupsApi(unittest.TestCase): }""" request_loaded_json = json.loads(request_body_json) - request_from_json = thousandeyes_sdk.admin.models.AccountGroupRequest.from_json(request_body_json) + request_from_json = thousandeyes_sdk.administrative.models.AccountGroupRequest.from_json(request_body_json) assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) response_body_json = """ @@ -583,7 +583,7 @@ class TestAccountGroupsApi(unittest.TestCase): }""" response_loaded_json = json.loads(response_body_json) - response_from_json = thousandeyes_sdk.admin.models.AccountGroupDetail.from_json(response_body_json) + response_from_json = thousandeyes_sdk.administrative.models.AccountGroupDetail.from_json(response_body_json) assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) diff --git a/thousandeyes-sdk-administrative/test/test_permissions_api.py b/thousandeyes-sdk-administrative/test/test_permissions_api.py index bcdb3aea..6a31764c 100644 --- a/thousandeyes-sdk-administrative/test/test_permissions_api.py +++ b/thousandeyes-sdk-administrative/test/test_permissions_api.py @@ -14,10 +14,10 @@ import json import unittest -import thousandeyes_sdk.admin.models +import thousandeyes_sdk.administrative.models from .test_utils import assert_constructed_model_matches_example_json -from thousandeyes_sdk.admin.api.permissions_api import PermissionsApi +from thousandeyes_sdk.administrative.api.permissions_api import PermissionsApi class TestPermissionsApi(unittest.TestCase): @@ -60,7 +60,7 @@ class TestPermissionsApi(unittest.TestCase): }""" response_loaded_json = json.loads(response_body_json) - response_from_json = thousandeyes_sdk.admin.models.Permissions.from_json(response_body_json) + response_from_json = thousandeyes_sdk.administrative.models.Permissions.from_json(response_body_json) assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) diff --git a/thousandeyes-sdk-administrative/test/test_roles_api.py b/thousandeyes-sdk-administrative/test/test_roles_api.py index fadcdc93..483562f5 100644 --- a/thousandeyes-sdk-administrative/test/test_roles_api.py +++ b/thousandeyes-sdk-administrative/test/test_roles_api.py @@ -14,10 +14,10 @@ import json import unittest -import thousandeyes_sdk.admin.models +import thousandeyes_sdk.administrative.models from .test_utils import assert_constructed_model_matches_example_json -from thousandeyes_sdk.admin.api.roles_api import RolesApi +from thousandeyes_sdk.administrative.api.roles_api import RolesApi class TestRolesApi(unittest.TestCase): @@ -38,7 +38,7 @@ class TestRolesApi(unittest.TestCase): }""" request_loaded_json = json.loads(request_body_json) - request_from_json = thousandeyes_sdk.admin.models.RoleRequestBody.from_json(request_body_json) + request_from_json = thousandeyes_sdk.administrative.models.RoleRequestBody.from_json(request_body_json) assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) response_body_json = """ @@ -72,7 +72,7 @@ class TestRolesApi(unittest.TestCase): }""" response_loaded_json = json.loads(response_body_json) - response_from_json = thousandeyes_sdk.admin.models.RoleDetail.from_json(response_body_json) + response_from_json = thousandeyes_sdk.administrative.models.RoleDetail.from_json(response_body_json) assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) def test_delete_role_models_validation(self) -> None: @@ -113,7 +113,7 @@ class TestRolesApi(unittest.TestCase): }""" response_loaded_json = json.loads(response_body_json) - response_from_json = thousandeyes_sdk.admin.models.RoleDetail.from_json(response_body_json) + response_from_json = thousandeyes_sdk.administrative.models.RoleDetail.from_json(response_body_json) assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) def test_get_roles_models_validation(self) -> None: @@ -147,7 +147,7 @@ class TestRolesApi(unittest.TestCase): }""" response_loaded_json = json.loads(response_body_json) - response_from_json = thousandeyes_sdk.admin.models.Roles.from_json(response_body_json) + response_from_json = thousandeyes_sdk.administrative.models.Roles.from_json(response_body_json) assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) def test_update_role_models_validation(self) -> None: @@ -159,7 +159,7 @@ class TestRolesApi(unittest.TestCase): }""" request_loaded_json = json.loads(request_body_json) - request_from_json = thousandeyes_sdk.admin.models.RoleRequestBody.from_json(request_body_json) + request_from_json = thousandeyes_sdk.administrative.models.RoleRequestBody.from_json(request_body_json) assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) response_body_json = """ @@ -193,7 +193,7 @@ class TestRolesApi(unittest.TestCase): }""" response_loaded_json = json.loads(response_body_json) - response_from_json = thousandeyes_sdk.admin.models.RoleDetail.from_json(response_body_json) + response_from_json = thousandeyes_sdk.administrative.models.RoleDetail.from_json(response_body_json) assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) diff --git a/thousandeyes-sdk-administrative/test/test_user_events_api.py b/thousandeyes-sdk-administrative/test/test_user_events_api.py index 0b5a3780..bc24ff3d 100644 --- a/thousandeyes-sdk-administrative/test/test_user_events_api.py +++ b/thousandeyes-sdk-administrative/test/test_user_events_api.py @@ -14,10 +14,10 @@ import json import unittest -import thousandeyes_sdk.admin.models +import thousandeyes_sdk.administrative.models from .test_utils import assert_constructed_model_matches_example_json -from thousandeyes_sdk.admin.api.user_events_api import UserEventsApi +from thousandeyes_sdk.administrative.api.user_events_api import UserEventsApi class TestUserEventsApi(unittest.TestCase): @@ -95,7 +95,7 @@ class TestUserEventsApi(unittest.TestCase): }""" response_loaded_json = json.loads(response_body_json) - response_from_json = thousandeyes_sdk.admin.models.AuditUserEvents.from_json(response_body_json) + response_from_json = thousandeyes_sdk.administrative.models.AuditUserEvents.from_json(response_body_json) assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) diff --git a/thousandeyes-sdk-administrative/test/test_users_api.py b/thousandeyes-sdk-administrative/test/test_users_api.py index 91a11e0d..91fbcebe 100644 --- a/thousandeyes-sdk-administrative/test/test_users_api.py +++ b/thousandeyes-sdk-administrative/test/test_users_api.py @@ -14,10 +14,10 @@ import json import unittest -import thousandeyes_sdk.admin.models +import thousandeyes_sdk.administrative.models from .test_utils import assert_constructed_model_matches_example_json -from thousandeyes_sdk.admin.api.users_api import UsersApi +from thousandeyes_sdk.administrative.api.users_api import UsersApi class TestUsersApi(unittest.TestCase): @@ -47,7 +47,7 @@ class TestUsersApi(unittest.TestCase): }""" request_loaded_json = json.loads(request_body_json) - request_from_json = thousandeyes_sdk.admin.models.UserRequest.from_json(request_body_json) + request_from_json = thousandeyes_sdk.administrative.models.UserRequest.from_json(request_body_json) assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) response_body_json = """ @@ -119,7 +119,7 @@ class TestUsersApi(unittest.TestCase): }""" response_loaded_json = json.loads(response_body_json) - response_from_json = thousandeyes_sdk.admin.models.CreatedUser.from_json(response_body_json) + response_from_json = thousandeyes_sdk.administrative.models.CreatedUser.from_json(response_body_json) assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) def test_delete_user_models_validation(self) -> None: @@ -199,7 +199,7 @@ class TestUsersApi(unittest.TestCase): }""" response_loaded_json = json.loads(response_body_json) - response_from_json = thousandeyes_sdk.admin.models.UserDetail.from_json(response_body_json) + response_from_json = thousandeyes_sdk.administrative.models.UserDetail.from_json(response_body_json) assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) def test_get_users_models_validation(self) -> None: @@ -243,7 +243,7 @@ class TestUsersApi(unittest.TestCase): }""" response_loaded_json = json.loads(response_body_json) - response_from_json = thousandeyes_sdk.admin.models.Users.from_json(response_body_json) + response_from_json = thousandeyes_sdk.administrative.models.Users.from_json(response_body_json) assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) def test_update_user_models_validation(self) -> None: @@ -264,7 +264,7 @@ class TestUsersApi(unittest.TestCase): }""" request_loaded_json = json.loads(request_body_json) - request_from_json = thousandeyes_sdk.admin.models.UserRequest.from_json(request_body_json) + request_from_json = thousandeyes_sdk.administrative.models.UserRequest.from_json(request_body_json) assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) response_body_json = """ @@ -337,7 +337,7 @@ class TestUsersApi(unittest.TestCase): }""" response_loaded_json = json.loads(response_body_json) - response_from_json = thousandeyes_sdk.admin.models.UserDetail.from_json(response_body_json) + response_from_json = thousandeyes_sdk.administrative.models.UserDetail.from_json(response_body_json) assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)