From 8e4561276254adac0c11daa649bb2bdf7db4f46d Mon Sep 17 00:00:00 2001 From: Shahid Hussain Khan Date: Thu, 7 Dec 2023 10:28:08 +0000 Subject: [PATCH] CP-1656 Add SDK for Admin API endpoints --- admin_api/.github/workflows/python.yml | 38 + admin_api/.gitignore | 66 + admin_api/.gitlab-ci.yml | 31 + admin_api/.openapi-generator-ignore | 23 + admin_api/.openapi-generator/FILES | 218 +++ admin_api/.openapi-generator/VERSION | 1 + admin_api/.travis.yml | 17 + admin_api/README.md | 205 +++ admin_api/admin_api/__init__.py | 97 ++ admin_api/admin_api/api/__init__.py | 9 + admin_api/admin_api/api/account_groups_api.py | 1534 ++++++++++++++++ admin_api/admin_api/api/permissions_api.py | 332 ++++ admin_api/admin_api/api/roles_api.py | 1546 ++++++++++++++++ admin_api/admin_api/api/user_events_api.py | 420 +++++ admin_api/admin_api/api/users_api.py | 1547 +++++++++++++++++ admin_api/admin_api/api_client.py | 741 ++++++++ admin_api/admin_api/api_response.py | 21 + admin_api/admin_api/configuration.py | 434 +++++ admin_api/admin_api/exceptions.py | 166 ++ admin_api/admin_api/models/__init__.py | 76 + admin_api/admin_api/models/account_group.py | 96 + admin_api/admin_api/models/account_group1.py | 90 + .../admin_api/models/account_group_detail.py | 116 ++ .../admin_api/models/account_group_id.py | 88 + .../models/account_group_request_body.py | 90 + .../admin_api/models/account_group_roles.py | 96 + ...t_group_roles_account_group_roles_inner.py | 102 ++ .../account_group_roles_request_body_inner.py | 90 + admin_api/admin_api/models/account_groups.py | 96 + admin_api/admin_api/models/agent.py | 121 ++ admin_api/admin_api/models/agent_base.py | 98 ++ .../models/all_account_group_roles.py | 96 + admin_api/admin_api/models/base_role.py | 92 + .../models/cloud_enterprise_agent_type.py | 46 + admin_api/admin_api/models/cluster_member.py | 131 ++ .../create_account_group201_response.py | 112 ++ .../models/create_role201_response.py | 108 ++ .../models/create_user201_response.py | 126 ++ admin_api/admin_api/models/created_user.py | 120 ++ .../admin_api/models/enterprise_agent.py | 199 +++ .../models/enterprise_agent_ipv6_policy.py | 46 + .../models/enterprise_agent_state.py | 46 + .../admin_api/models/enterprise_agents.py | 95 + admin_api/admin_api/models/error.py | 96 + admin_api/admin_api/models/error_detail.py | 93 + .../admin_api/models/error_detail_code.py | 51 + admin_api/admin_api/models/expand.py | 45 + admin_api/admin_api/models/extended_user.py | 102 ++ .../models/get_account_group200_response.py | 122 ++ .../models/get_account_groups200_response.py | 102 ++ .../models/get_permissions200_response.py | 102 ++ .../admin_api/models/get_roles200_response.py | 102 ++ .../admin_api/models/get_user200_response.py | 128 ++ .../models/get_user_events200_response.py | 110 ++ .../admin_api/models/get_users200_response.py | 102 ++ .../admin_api/models/interface_ip_mapping.py | 94 + admin_api/admin_api/models/link.py | 102 ++ .../admin_api/models/login_account_group.py | 92 + .../models/new_account_group_response.py | 106 ++ .../admin_api/models/pagination_links.py | 92 + .../models/pagination_links_links.py | 96 + admin_api/admin_api/models/permission.py | 94 + admin_api/admin_api/models/permissions.py | 95 + admin_api/admin_api/models/query_window.py | 94 + admin_api/admin_api/models/role.py | 94 + admin_api/admin_api/models/role_detail.py | 102 ++ .../admin_api/models/role_request_body.py | 90 + admin_api/admin_api/models/roles.py | 95 + admin_api/admin_api/models/self_links.py | 92 + .../admin_api/models/self_links_links.py | 92 + .../admin_api/models/unauthorized_error.py | 89 + admin_api/admin_api/models/user.py | 100 ++ .../admin_api/models/user_account_group.py | 106 ++ .../admin_api/models/user_account_groups.py | 95 + admin_api/admin_api/models/user_detail.py | 122 ++ admin_api/admin_api/models/user_event.py | 110 ++ .../user_event_all_of_resources_inner.py | 90 + admin_api/admin_api/models/user_events.py | 96 + .../admin_api/models/user_request_body.py | 104 ++ admin_api/admin_api/models/users.py | 95 + admin_api/admin_api/py.typed | 0 admin_api/admin_api/rest.py | 231 +++ admin_api/docs/AccountGroup.md | 32 + admin_api/docs/AccountGroup1.md | 29 + admin_api/docs/AccountGroupDetail.md | 34 + admin_api/docs/AccountGroupId.md | 28 + admin_api/docs/AccountGroupRequestBody.md | 29 + admin_api/docs/AccountGroupRoles.md | 28 + ...AccountGroupRolesAccountGroupRolesInner.md | 29 + .../docs/AccountGroupRolesRequestBodyInner.md | 29 + admin_api/docs/AccountGroups.md | 28 + admin_api/docs/AccountGroupsApi.md | 438 +++++ admin_api/docs/Agent.md | 37 + admin_api/docs/AgentBase.md | 30 + admin_api/docs/AllAccountGroupRoles.md | 28 + admin_api/docs/BaseRole.md | 30 + admin_api/docs/CloudEnterpriseAgentType.md | 11 + admin_api/docs/ClusterMember.md | 37 + .../docs/CreateAccountGroup201Response.md | 34 + admin_api/docs/CreateRole201Response.md | 32 + admin_api/docs/CreateUser201Response.md | 35 + admin_api/docs/CreatedUser.md | 34 + admin_api/docs/EnterpriseAgent.md | 51 + admin_api/docs/EnterpriseAgentIpv6Policy.md | 11 + admin_api/docs/EnterpriseAgentState.md | 11 + admin_api/docs/EnterpriseAgents.md | 28 + admin_api/docs/Error.md | 32 + admin_api/docs/ErrorDetail.md | 29 + admin_api/docs/ErrorDetailCode.md | 11 + admin_api/docs/Expand.md | 10 + admin_api/docs/ExtendedUser.md | 33 + admin_api/docs/GetAccountGroup200Response.md | 35 + admin_api/docs/GetAccountGroups200Response.md | 29 + admin_api/docs/GetPermissions200Response.md | 29 + admin_api/docs/GetRoles200Response.md | 29 + admin_api/docs/GetUser200Response.md | 36 + admin_api/docs/GetUserEvents200Response.md | 31 + admin_api/docs/GetUsers200Response.md | 29 + admin_api/docs/InterfaceIpMapping.md | 29 + admin_api/docs/Link.md | 36 + admin_api/docs/LoginAccountGroup.md | 28 + admin_api/docs/NewAccountGroupResponse.md | 33 + admin_api/docs/PaginationLinks.md | 29 + admin_api/docs/PaginationLinksLinks.md | 29 + admin_api/docs/Permission.md | 31 + admin_api/docs/Permissions.md | 28 + admin_api/docs/PermissionsApi.md | 92 + admin_api/docs/QueryWindow.md | 29 + admin_api/docs/Role.md | 31 + admin_api/docs/RoleDetail.md | 31 + admin_api/docs/RoleRequestBody.md | 29 + admin_api/docs/Roles.md | 28 + admin_api/docs/RolesApi.md | 437 +++++ admin_api/docs/SelfLinks.md | 28 + admin_api/docs/SelfLinksLinks.md | 29 + admin_api/docs/UnauthorizedError.md | 29 + admin_api/docs/User.md | 32 + admin_api/docs/UserAccountGroup.md | 33 + admin_api/docs/UserAccountGroups.md | 28 + admin_api/docs/UserDetail.md | 35 + admin_api/docs/UserEvent.md | 35 + .../docs/UserEventAllOfResourcesInner.md | 29 + admin_api/docs/UserEvents.md | 28 + admin_api/docs/UserEventsApi.md | 100 ++ admin_api/docs/UserRequestBody.md | 32 + admin_api/docs/Users.md | 28 + admin_api/docs/UsersApi.md | 437 +++++ admin_api/git_push.sh | 57 + admin_api/pyproject.toml | 30 + admin_api/requirements.txt | 5 + admin_api/setup.cfg | 2 + admin_api/setup.py | 49 + admin_api/test-requirements.txt | 3 + admin_api/test/__init__.py | 0 admin_api/test/test_account_group.py | 56 + admin_api/test/test_account_group1.py | 53 + admin_api/test/test_account_group_detail.py | 70 + admin_api/test/test_account_group_id.py | 52 + .../test/test_account_group_request_body.py | 54 + admin_api/test/test_account_group_roles.py | 58 + ...t_group_roles_account_group_roles_inner.py | 55 + ..._account_group_roles_request_body_inner.py | 53 + admin_api/test/test_account_groups.py | 54 + admin_api/test/test_account_groups_api.py | 66 + admin_api/test/test_agent.py | 61 + admin_api/test/test_agent_base.py | 54 + .../test/test_all_account_group_roles.py | 54 + admin_api/test/test_base_role.py | 54 + .../test/test_cloud_enterprise_agent_type.py | 34 + admin_api/test/test_cluster_member.py | 65 + .../test_create_account_group201_response.py | 77 + .../test/test_create_role201_response.py | 65 + .../test/test_create_user201_response.py | 76 + admin_api/test/test_created_user.py | 66 + admin_api/test/test_enterprise_agent.py | 89 + .../test/test_enterprise_agent_ipv6_policy.py | 34 + admin_api/test/test_enterprise_agent_state.py | 34 + admin_api/test/test_enterprise_agents.py | 54 + admin_api/test/test_error.py | 56 + admin_api/test/test_error_detail.py | 53 + admin_api/test/test_error_detail_code.py | 34 + admin_api/test/test_expand.py | 34 + admin_api/test/test_extended_user.py | 57 + .../test_get_account_group200_response.py | 80 + .../test_get_account_groups200_response.py | 64 + .../test/test_get_permissions200_response.py | 62 + admin_api/test/test_get_roles200_response.py | 64 + admin_api/test/test_get_user200_response.py | 77 + .../test/test_get_user_events200_response.py | 64 + admin_api/test/test_get_users200_response.py | 64 + admin_api/test/test_interface_ip_mapping.py | 53 + admin_api/test/test_link.py | 60 + admin_api/test/test_login_account_group.py | 52 + .../test/test_new_account_group_response.py | 67 + admin_api/test/test_pagination_links.py | 70 + admin_api/test/test_pagination_links_links.py | 69 + admin_api/test/test_permission.py | 55 + admin_api/test/test_permissions.py | 52 + admin_api/test/test_permissions_api.py | 38 + admin_api/test/test_query_window.py | 53 + admin_api/test/test_role.py | 55 + admin_api/test/test_role_detail.py | 55 + admin_api/test/test_role_request_body.py | 53 + admin_api/test/test_roles.py | 54 + admin_api/test/test_roles_api.py | 66 + admin_api/test/test_self_links.py | 61 + admin_api/test/test_self_links_links.py | 60 + admin_api/test/test_unauthorized_error.py | 53 + admin_api/test/test_user.py | 56 + admin_api/test/test_user_account_group.py | 59 + admin_api/test/test_user_account_groups.py | 62 + admin_api/test/test_user_detail.py | 67 + admin_api/test/test_user_event.py | 63 + .../test_user_event_all_of_resources_inner.py | 53 + admin_api/test/test_user_events.py | 52 + admin_api/test/test_user_events_api.py | 38 + admin_api/test/test_user_request_body.py | 60 + admin_api/test/test_users.py | 54 + admin_api/test/test_users_api.py | 66 + admin_api/tox.ini | 9 + 220 files changed, 20822 insertions(+) create mode 100644 admin_api/.github/workflows/python.yml create mode 100644 admin_api/.gitignore create mode 100644 admin_api/.gitlab-ci.yml create mode 100644 admin_api/.openapi-generator-ignore create mode 100644 admin_api/.openapi-generator/FILES create mode 100644 admin_api/.openapi-generator/VERSION create mode 100644 admin_api/.travis.yml create mode 100644 admin_api/README.md create mode 100644 admin_api/admin_api/__init__.py create mode 100644 admin_api/admin_api/api/__init__.py create mode 100644 admin_api/admin_api/api/account_groups_api.py create mode 100644 admin_api/admin_api/api/permissions_api.py create mode 100644 admin_api/admin_api/api/roles_api.py create mode 100644 admin_api/admin_api/api/user_events_api.py create mode 100644 admin_api/admin_api/api/users_api.py create mode 100644 admin_api/admin_api/api_client.py create mode 100644 admin_api/admin_api/api_response.py create mode 100644 admin_api/admin_api/configuration.py create mode 100644 admin_api/admin_api/exceptions.py create mode 100644 admin_api/admin_api/models/__init__.py create mode 100644 admin_api/admin_api/models/account_group.py create mode 100644 admin_api/admin_api/models/account_group1.py create mode 100644 admin_api/admin_api/models/account_group_detail.py create mode 100644 admin_api/admin_api/models/account_group_id.py create mode 100644 admin_api/admin_api/models/account_group_request_body.py create mode 100644 admin_api/admin_api/models/account_group_roles.py create mode 100644 admin_api/admin_api/models/account_group_roles_account_group_roles_inner.py create mode 100644 admin_api/admin_api/models/account_group_roles_request_body_inner.py create mode 100644 admin_api/admin_api/models/account_groups.py create mode 100644 admin_api/admin_api/models/agent.py create mode 100644 admin_api/admin_api/models/agent_base.py create mode 100644 admin_api/admin_api/models/all_account_group_roles.py create mode 100644 admin_api/admin_api/models/base_role.py create mode 100644 admin_api/admin_api/models/cloud_enterprise_agent_type.py create mode 100644 admin_api/admin_api/models/cluster_member.py create mode 100644 admin_api/admin_api/models/create_account_group201_response.py create mode 100644 admin_api/admin_api/models/create_role201_response.py create mode 100644 admin_api/admin_api/models/create_user201_response.py create mode 100644 admin_api/admin_api/models/created_user.py create mode 100644 admin_api/admin_api/models/enterprise_agent.py create mode 100644 admin_api/admin_api/models/enterprise_agent_ipv6_policy.py create mode 100644 admin_api/admin_api/models/enterprise_agent_state.py create mode 100644 admin_api/admin_api/models/enterprise_agents.py create mode 100644 admin_api/admin_api/models/error.py create mode 100644 admin_api/admin_api/models/error_detail.py create mode 100644 admin_api/admin_api/models/error_detail_code.py create mode 100644 admin_api/admin_api/models/expand.py create mode 100644 admin_api/admin_api/models/extended_user.py create mode 100644 admin_api/admin_api/models/get_account_group200_response.py create mode 100644 admin_api/admin_api/models/get_account_groups200_response.py create mode 100644 admin_api/admin_api/models/get_permissions200_response.py create mode 100644 admin_api/admin_api/models/get_roles200_response.py create mode 100644 admin_api/admin_api/models/get_user200_response.py create mode 100644 admin_api/admin_api/models/get_user_events200_response.py create mode 100644 admin_api/admin_api/models/get_users200_response.py create mode 100644 admin_api/admin_api/models/interface_ip_mapping.py create mode 100644 admin_api/admin_api/models/link.py create mode 100644 admin_api/admin_api/models/login_account_group.py create mode 100644 admin_api/admin_api/models/new_account_group_response.py create mode 100644 admin_api/admin_api/models/pagination_links.py create mode 100644 admin_api/admin_api/models/pagination_links_links.py create mode 100644 admin_api/admin_api/models/permission.py create mode 100644 admin_api/admin_api/models/permissions.py create mode 100644 admin_api/admin_api/models/query_window.py create mode 100644 admin_api/admin_api/models/role.py create mode 100644 admin_api/admin_api/models/role_detail.py create mode 100644 admin_api/admin_api/models/role_request_body.py create mode 100644 admin_api/admin_api/models/roles.py create mode 100644 admin_api/admin_api/models/self_links.py create mode 100644 admin_api/admin_api/models/self_links_links.py create mode 100644 admin_api/admin_api/models/unauthorized_error.py create mode 100644 admin_api/admin_api/models/user.py create mode 100644 admin_api/admin_api/models/user_account_group.py create mode 100644 admin_api/admin_api/models/user_account_groups.py create mode 100644 admin_api/admin_api/models/user_detail.py create mode 100644 admin_api/admin_api/models/user_event.py create mode 100644 admin_api/admin_api/models/user_event_all_of_resources_inner.py create mode 100644 admin_api/admin_api/models/user_events.py create mode 100644 admin_api/admin_api/models/user_request_body.py create mode 100644 admin_api/admin_api/models/users.py create mode 100644 admin_api/admin_api/py.typed create mode 100644 admin_api/admin_api/rest.py create mode 100644 admin_api/docs/AccountGroup.md create mode 100644 admin_api/docs/AccountGroup1.md create mode 100644 admin_api/docs/AccountGroupDetail.md create mode 100644 admin_api/docs/AccountGroupId.md create mode 100644 admin_api/docs/AccountGroupRequestBody.md create mode 100644 admin_api/docs/AccountGroupRoles.md create mode 100644 admin_api/docs/AccountGroupRolesAccountGroupRolesInner.md create mode 100644 admin_api/docs/AccountGroupRolesRequestBodyInner.md create mode 100644 admin_api/docs/AccountGroups.md create mode 100644 admin_api/docs/AccountGroupsApi.md create mode 100644 admin_api/docs/Agent.md create mode 100644 admin_api/docs/AgentBase.md create mode 100644 admin_api/docs/AllAccountGroupRoles.md create mode 100644 admin_api/docs/BaseRole.md create mode 100644 admin_api/docs/CloudEnterpriseAgentType.md create mode 100644 admin_api/docs/ClusterMember.md create mode 100644 admin_api/docs/CreateAccountGroup201Response.md create mode 100644 admin_api/docs/CreateRole201Response.md create mode 100644 admin_api/docs/CreateUser201Response.md create mode 100644 admin_api/docs/CreatedUser.md create mode 100644 admin_api/docs/EnterpriseAgent.md create mode 100644 admin_api/docs/EnterpriseAgentIpv6Policy.md create mode 100644 admin_api/docs/EnterpriseAgentState.md create mode 100644 admin_api/docs/EnterpriseAgents.md create mode 100644 admin_api/docs/Error.md create mode 100644 admin_api/docs/ErrorDetail.md create mode 100644 admin_api/docs/ErrorDetailCode.md create mode 100644 admin_api/docs/Expand.md create mode 100644 admin_api/docs/ExtendedUser.md create mode 100644 admin_api/docs/GetAccountGroup200Response.md create mode 100644 admin_api/docs/GetAccountGroups200Response.md create mode 100644 admin_api/docs/GetPermissions200Response.md create mode 100644 admin_api/docs/GetRoles200Response.md create mode 100644 admin_api/docs/GetUser200Response.md create mode 100644 admin_api/docs/GetUserEvents200Response.md create mode 100644 admin_api/docs/GetUsers200Response.md create mode 100644 admin_api/docs/InterfaceIpMapping.md create mode 100644 admin_api/docs/Link.md create mode 100644 admin_api/docs/LoginAccountGroup.md create mode 100644 admin_api/docs/NewAccountGroupResponse.md create mode 100644 admin_api/docs/PaginationLinks.md create mode 100644 admin_api/docs/PaginationLinksLinks.md create mode 100644 admin_api/docs/Permission.md create mode 100644 admin_api/docs/Permissions.md create mode 100644 admin_api/docs/PermissionsApi.md create mode 100644 admin_api/docs/QueryWindow.md create mode 100644 admin_api/docs/Role.md create mode 100644 admin_api/docs/RoleDetail.md create mode 100644 admin_api/docs/RoleRequestBody.md create mode 100644 admin_api/docs/Roles.md create mode 100644 admin_api/docs/RolesApi.md create mode 100644 admin_api/docs/SelfLinks.md create mode 100644 admin_api/docs/SelfLinksLinks.md create mode 100644 admin_api/docs/UnauthorizedError.md create mode 100644 admin_api/docs/User.md create mode 100644 admin_api/docs/UserAccountGroup.md create mode 100644 admin_api/docs/UserAccountGroups.md create mode 100644 admin_api/docs/UserDetail.md create mode 100644 admin_api/docs/UserEvent.md create mode 100644 admin_api/docs/UserEventAllOfResourcesInner.md create mode 100644 admin_api/docs/UserEvents.md create mode 100644 admin_api/docs/UserEventsApi.md create mode 100644 admin_api/docs/UserRequestBody.md create mode 100644 admin_api/docs/Users.md create mode 100644 admin_api/docs/UsersApi.md create mode 100644 admin_api/git_push.sh create mode 100644 admin_api/pyproject.toml create mode 100644 admin_api/requirements.txt create mode 100644 admin_api/setup.cfg create mode 100644 admin_api/setup.py create mode 100644 admin_api/test-requirements.txt create mode 100644 admin_api/test/__init__.py create mode 100644 admin_api/test/test_account_group.py create mode 100644 admin_api/test/test_account_group1.py create mode 100644 admin_api/test/test_account_group_detail.py create mode 100644 admin_api/test/test_account_group_id.py create mode 100644 admin_api/test/test_account_group_request_body.py create mode 100644 admin_api/test/test_account_group_roles.py create mode 100644 admin_api/test/test_account_group_roles_account_group_roles_inner.py create mode 100644 admin_api/test/test_account_group_roles_request_body_inner.py create mode 100644 admin_api/test/test_account_groups.py create mode 100644 admin_api/test/test_account_groups_api.py create mode 100644 admin_api/test/test_agent.py create mode 100644 admin_api/test/test_agent_base.py create mode 100644 admin_api/test/test_all_account_group_roles.py create mode 100644 admin_api/test/test_base_role.py create mode 100644 admin_api/test/test_cloud_enterprise_agent_type.py create mode 100644 admin_api/test/test_cluster_member.py create mode 100644 admin_api/test/test_create_account_group201_response.py create mode 100644 admin_api/test/test_create_role201_response.py create mode 100644 admin_api/test/test_create_user201_response.py create mode 100644 admin_api/test/test_created_user.py create mode 100644 admin_api/test/test_enterprise_agent.py create mode 100644 admin_api/test/test_enterprise_agent_ipv6_policy.py create mode 100644 admin_api/test/test_enterprise_agent_state.py create mode 100644 admin_api/test/test_enterprise_agents.py create mode 100644 admin_api/test/test_error.py create mode 100644 admin_api/test/test_error_detail.py create mode 100644 admin_api/test/test_error_detail_code.py create mode 100644 admin_api/test/test_expand.py create mode 100644 admin_api/test/test_extended_user.py create mode 100644 admin_api/test/test_get_account_group200_response.py create mode 100644 admin_api/test/test_get_account_groups200_response.py create mode 100644 admin_api/test/test_get_permissions200_response.py create mode 100644 admin_api/test/test_get_roles200_response.py create mode 100644 admin_api/test/test_get_user200_response.py create mode 100644 admin_api/test/test_get_user_events200_response.py create mode 100644 admin_api/test/test_get_users200_response.py create mode 100644 admin_api/test/test_interface_ip_mapping.py create mode 100644 admin_api/test/test_link.py create mode 100644 admin_api/test/test_login_account_group.py create mode 100644 admin_api/test/test_new_account_group_response.py create mode 100644 admin_api/test/test_pagination_links.py create mode 100644 admin_api/test/test_pagination_links_links.py create mode 100644 admin_api/test/test_permission.py create mode 100644 admin_api/test/test_permissions.py create mode 100644 admin_api/test/test_permissions_api.py create mode 100644 admin_api/test/test_query_window.py create mode 100644 admin_api/test/test_role.py create mode 100644 admin_api/test/test_role_detail.py create mode 100644 admin_api/test/test_role_request_body.py create mode 100644 admin_api/test/test_roles.py create mode 100644 admin_api/test/test_roles_api.py create mode 100644 admin_api/test/test_self_links.py create mode 100644 admin_api/test/test_self_links_links.py create mode 100644 admin_api/test/test_unauthorized_error.py create mode 100644 admin_api/test/test_user.py create mode 100644 admin_api/test/test_user_account_group.py create mode 100644 admin_api/test/test_user_account_groups.py create mode 100644 admin_api/test/test_user_detail.py create mode 100644 admin_api/test/test_user_event.py create mode 100644 admin_api/test/test_user_event_all_of_resources_inner.py create mode 100644 admin_api/test/test_user_events.py create mode 100644 admin_api/test/test_user_events_api.py create mode 100644 admin_api/test/test_user_request_body.py create mode 100644 admin_api/test/test_users.py create mode 100644 admin_api/test/test_users_api.py create mode 100644 admin_api/tox.ini diff --git a/admin_api/.github/workflows/python.yml b/admin_api/.github/workflows/python.yml new file mode 100644 index 00000000..cbc5a5c7 --- /dev/null +++ b/admin_api/.github/workflows/python.yml @@ -0,0 +1,38 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: admin_api Python package + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest diff --git a/admin_api/.gitignore b/admin_api/.gitignore new file mode 100644 index 00000000..43995bd4 --- /dev/null +++ b/admin_api/.gitignore @@ -0,0 +1,66 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.venv/ +.python-version +.pytest_cache + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/admin_api/.gitlab-ci.yml b/admin_api/.gitlab-ci.yml new file mode 100644 index 00000000..3d11cfd8 --- /dev/null +++ b/admin_api/.gitlab-ci.yml @@ -0,0 +1,31 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.gitlab.com/ee/ci/README.html +# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml + +stages: + - test + +.pytest: + stage: test + script: + - pip install -r requirements.txt + - pip install -r test-requirements.txt + - pytest --cov=admin_api + +pytest-3.7: + extends: .pytest + image: python:3.7-alpine +pytest-3.8: + extends: .pytest + image: python:3.8-alpine +pytest-3.9: + extends: .pytest + image: python:3.9-alpine +pytest-3.10: + extends: .pytest + image: python:3.10-alpine +pytest-3.11: + extends: .pytest + image: python:3.11-alpine diff --git a/admin_api/.openapi-generator-ignore b/admin_api/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/admin_api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/admin_api/.openapi-generator/FILES b/admin_api/.openapi-generator/FILES new file mode 100644 index 00000000..d1a017a8 --- /dev/null +++ b/admin_api/.openapi-generator/FILES @@ -0,0 +1,218 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.travis.yml +README.md +admin_api/__init__.py +admin_api/api/__init__.py +admin_api/api/account_groups_api.py +admin_api/api/permissions_api.py +admin_api/api/roles_api.py +admin_api/api/user_events_api.py +admin_api/api/users_api.py +admin_api/api_client.py +admin_api/api_response.py +admin_api/configuration.py +admin_api/exceptions.py +admin_api/models/__init__.py +admin_api/models/account_group.py +admin_api/models/account_group1.py +admin_api/models/account_group_detail.py +admin_api/models/account_group_id.py +admin_api/models/account_group_request_body.py +admin_api/models/account_group_roles.py +admin_api/models/account_group_roles_account_group_roles_inner.py +admin_api/models/account_group_roles_request_body_inner.py +admin_api/models/account_groups.py +admin_api/models/agent.py +admin_api/models/agent_base.py +admin_api/models/all_account_group_roles.py +admin_api/models/base_role.py +admin_api/models/cloud_enterprise_agent_type.py +admin_api/models/cluster_member.py +admin_api/models/create_account_group201_response.py +admin_api/models/create_role201_response.py +admin_api/models/create_user201_response.py +admin_api/models/created_user.py +admin_api/models/enterprise_agent.py +admin_api/models/enterprise_agent_ipv6_policy.py +admin_api/models/enterprise_agent_state.py +admin_api/models/enterprise_agents.py +admin_api/models/error.py +admin_api/models/error_detail.py +admin_api/models/error_detail_code.py +admin_api/models/expand.py +admin_api/models/extended_user.py +admin_api/models/get_account_group200_response.py +admin_api/models/get_account_groups200_response.py +admin_api/models/get_permissions200_response.py +admin_api/models/get_roles200_response.py +admin_api/models/get_user200_response.py +admin_api/models/get_user_events200_response.py +admin_api/models/get_users200_response.py +admin_api/models/interface_ip_mapping.py +admin_api/models/link.py +admin_api/models/login_account_group.py +admin_api/models/new_account_group_response.py +admin_api/models/pagination_links.py +admin_api/models/pagination_links_links.py +admin_api/models/permission.py +admin_api/models/permissions.py +admin_api/models/query_window.py +admin_api/models/role.py +admin_api/models/role_detail.py +admin_api/models/role_request_body.py +admin_api/models/roles.py +admin_api/models/self_links.py +admin_api/models/self_links_links.py +admin_api/models/unauthorized_error.py +admin_api/models/user.py +admin_api/models/user_account_group.py +admin_api/models/user_account_groups.py +admin_api/models/user_detail.py +admin_api/models/user_event.py +admin_api/models/user_event_all_of_resources_inner.py +admin_api/models/user_events.py +admin_api/models/user_request_body.py +admin_api/models/users.py +admin_api/py.typed +admin_api/rest.py +docs/AccountGroup.md +docs/AccountGroup1.md +docs/AccountGroupDetail.md +docs/AccountGroupId.md +docs/AccountGroupRequestBody.md +docs/AccountGroupRoles.md +docs/AccountGroupRolesAccountGroupRolesInner.md +docs/AccountGroupRolesRequestBodyInner.md +docs/AccountGroups.md +docs/AccountGroupsApi.md +docs/Agent.md +docs/AgentBase.md +docs/AllAccountGroupRoles.md +docs/BaseRole.md +docs/CloudEnterpriseAgentType.md +docs/ClusterMember.md +docs/CreateAccountGroup201Response.md +docs/CreateRole201Response.md +docs/CreateUser201Response.md +docs/CreatedUser.md +docs/EnterpriseAgent.md +docs/EnterpriseAgentIpv6Policy.md +docs/EnterpriseAgentState.md +docs/EnterpriseAgents.md +docs/Error.md +docs/ErrorDetail.md +docs/ErrorDetailCode.md +docs/Expand.md +docs/ExtendedUser.md +docs/GetAccountGroup200Response.md +docs/GetAccountGroups200Response.md +docs/GetPermissions200Response.md +docs/GetRoles200Response.md +docs/GetUser200Response.md +docs/GetUserEvents200Response.md +docs/GetUsers200Response.md +docs/InterfaceIpMapping.md +docs/Link.md +docs/LoginAccountGroup.md +docs/NewAccountGroupResponse.md +docs/PaginationLinks.md +docs/PaginationLinksLinks.md +docs/Permission.md +docs/Permissions.md +docs/PermissionsApi.md +docs/QueryWindow.md +docs/Role.md +docs/RoleDetail.md +docs/RoleRequestBody.md +docs/Roles.md +docs/RolesApi.md +docs/SelfLinks.md +docs/SelfLinksLinks.md +docs/UnauthorizedError.md +docs/User.md +docs/UserAccountGroup.md +docs/UserAccountGroups.md +docs/UserDetail.md +docs/UserEvent.md +docs/UserEventAllOfResourcesInner.md +docs/UserEvents.md +docs/UserEventsApi.md +docs/UserRequestBody.md +docs/Users.md +docs/UsersApi.md +git_push.sh +pyproject.toml +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_account_group.py +test/test_account_group1.py +test/test_account_group_detail.py +test/test_account_group_id.py +test/test_account_group_request_body.py +test/test_account_group_roles.py +test/test_account_group_roles_account_group_roles_inner.py +test/test_account_group_roles_request_body_inner.py +test/test_account_groups.py +test/test_account_groups_api.py +test/test_agent.py +test/test_agent_base.py +test/test_all_account_group_roles.py +test/test_base_role.py +test/test_cloud_enterprise_agent_type.py +test/test_cluster_member.py +test/test_create_account_group201_response.py +test/test_create_role201_response.py +test/test_create_user201_response.py +test/test_created_user.py +test/test_enterprise_agent.py +test/test_enterprise_agent_ipv6_policy.py +test/test_enterprise_agent_state.py +test/test_enterprise_agents.py +test/test_error.py +test/test_error_detail.py +test/test_error_detail_code.py +test/test_expand.py +test/test_extended_user.py +test/test_get_account_group200_response.py +test/test_get_account_groups200_response.py +test/test_get_permissions200_response.py +test/test_get_roles200_response.py +test/test_get_user200_response.py +test/test_get_user_events200_response.py +test/test_get_users200_response.py +test/test_interface_ip_mapping.py +test/test_link.py +test/test_login_account_group.py +test/test_new_account_group_response.py +test/test_pagination_links.py +test/test_pagination_links_links.py +test/test_permission.py +test/test_permissions.py +test/test_permissions_api.py +test/test_query_window.py +test/test_role.py +test/test_role_detail.py +test/test_role_request_body.py +test/test_roles.py +test/test_roles_api.py +test/test_self_links.py +test/test_self_links_links.py +test/test_unauthorized_error.py +test/test_user.py +test/test_user_account_group.py +test/test_user_account_groups.py +test/test_user_detail.py +test/test_user_event.py +test/test_user_event_all_of_resources_inner.py +test/test_user_events.py +test/test_user_events_api.py +test/test_user_request_body.py +test/test_users.py +test/test_users_api.py +tox.ini diff --git a/admin_api/.openapi-generator/VERSION b/admin_api/.openapi-generator/VERSION new file mode 100644 index 00000000..3769235d --- /dev/null +++ b/admin_api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.1.0 \ No newline at end of file diff --git a/admin_api/.travis.yml b/admin_api/.travis.yml new file mode 100644 index 00000000..26d8878d --- /dev/null +++ b/admin_api/.travis.yml @@ -0,0 +1,17 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "3.7" + - "3.8" + - "3.9" + - "3.10" + - "3.11" + # uncomment the following if needed + #- "3.11-dev" # 3.11 development branch + #- "nightly" # nightly build +# command to install dependencies +install: + - "pip install -r requirements.txt" + - "pip install -r test-requirements.txt" +# command to run tests +script: pytest --cov=admin_api diff --git a/admin_api/README.md b/admin_api/README.md new file mode 100644 index 00000000..1ac01000 --- /dev/null +++ b/admin_api/README.md @@ -0,0 +1,205 @@ +# admin-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. + +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 7.0.0 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.PythonClientCodegen + +## Requirements. + +Python 3.7+ + +## Installation & Usage +### pip install + +If the python package is hosted on a repository, you can install directly using: + +```sh +pip install git+https://github.com/thousandeyes/thousandeyes-python-sdk.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/thousandeyes/thousandeyes-python-sdk.git`) + +Then import the package: +```python +import admin_api +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` +(or `sudo python setup.py install` to install the package for all users) + +Then import the package: +```python +import admin_api +``` + +### Tests + +Execute `pytest` to run the tests. + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```python + +import time +import admin_api +from admin_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = admin_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = admin_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + + +# Enter a context with an instance of the API client +with admin_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = admin_api.AccountGroupsApi(api_client) + account_group_request_body = admin_api.AccountGroupRequestBody() # AccountGroupRequestBody | + expand = [admin_api.Expand()] # List[Expand] | Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. (optional) + + try: + # Create account group + api_response = api_instance.create_account_group(account_group_request_body, expand=expand) + print("The response of AccountGroupsApi->create_account_group:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling AccountGroupsApi->create_account_group: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.thousandeyes.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AccountGroupsApi* | [**create_account_group**](docs/AccountGroupsApi.md#create_account_group) | **POST** /v7/account-groups | Create account group +*AccountGroupsApi* | [**delete_account_group**](docs/AccountGroupsApi.md#delete_account_group) | **DELETE** /v7/account-groups/{id} | Delete account group +*AccountGroupsApi* | [**get_account_group**](docs/AccountGroupsApi.md#get_account_group) | **GET** /v7/account-groups/{id} | Retrieve account group +*AccountGroupsApi* | [**get_account_groups**](docs/AccountGroupsApi.md#get_account_groups) | **GET** /v7/account-groups | List account groups +*AccountGroupsApi* | [**update_account_group**](docs/AccountGroupsApi.md#update_account_group) | **PUT** /v7/account-groups/{id} | Update account group +*PermissionsApi* | [**get_permissions**](docs/PermissionsApi.md#get_permissions) | **GET** /v7/permissions | List assignable permissions +*RolesApi* | [**create_role**](docs/RolesApi.md#create_role) | **POST** /v7/roles | Create role +*RolesApi* | [**delete_role**](docs/RolesApi.md#delete_role) | **DELETE** /v7/roles/{id} | Delete role +*RolesApi* | [**get_role**](docs/RolesApi.md#get_role) | **GET** /v7/roles/{id} | Retrieve role +*RolesApi* | [**get_roles**](docs/RolesApi.md#get_roles) | **GET** /v7/roles | List roles +*RolesApi* | [**update_role**](docs/RolesApi.md#update_role) | **PUT** /v7/roles/{id} | Update role +*UserEventsApi* | [**get_user_events**](docs/UserEventsApi.md#get_user_events) | **GET** /v7/audit-user-events | List activity log events +*UsersApi* | [**create_user**](docs/UsersApi.md#create_user) | **POST** /v7/users | Create user +*UsersApi* | [**delete_user**](docs/UsersApi.md#delete_user) | **DELETE** /v7/users/{id} | Delete user +*UsersApi* | [**get_user**](docs/UsersApi.md#get_user) | **GET** /v7/users/{id} | Retrieve user +*UsersApi* | [**get_users**](docs/UsersApi.md#get_users) | **GET** /v7/users | List users +*UsersApi* | [**update_user**](docs/UsersApi.md#update_user) | **PUT** /v7/users/{id} | Update user + + +## Documentation For Models + + - [AccountGroup](docs/AccountGroup.md) + - [AccountGroup1](docs/AccountGroup1.md) + - [AccountGroupDetail](docs/AccountGroupDetail.md) + - [AccountGroupId](docs/AccountGroupId.md) + - [AccountGroupRequestBody](docs/AccountGroupRequestBody.md) + - [AccountGroupRoles](docs/AccountGroupRoles.md) + - [AccountGroupRolesAccountGroupRolesInner](docs/AccountGroupRolesAccountGroupRolesInner.md) + - [AccountGroupRolesRequestBodyInner](docs/AccountGroupRolesRequestBodyInner.md) + - [AccountGroups](docs/AccountGroups.md) + - [Agent](docs/Agent.md) + - [AgentBase](docs/AgentBase.md) + - [AllAccountGroupRoles](docs/AllAccountGroupRoles.md) + - [BaseRole](docs/BaseRole.md) + - [CloudEnterpriseAgentType](docs/CloudEnterpriseAgentType.md) + - [ClusterMember](docs/ClusterMember.md) + - [CreateAccountGroup201Response](docs/CreateAccountGroup201Response.md) + - [CreateRole201Response](docs/CreateRole201Response.md) + - [CreateUser201Response](docs/CreateUser201Response.md) + - [CreatedUser](docs/CreatedUser.md) + - [EnterpriseAgent](docs/EnterpriseAgent.md) + - [EnterpriseAgentIpv6Policy](docs/EnterpriseAgentIpv6Policy.md) + - [EnterpriseAgentState](docs/EnterpriseAgentState.md) + - [EnterpriseAgents](docs/EnterpriseAgents.md) + - [Error](docs/Error.md) + - [ErrorDetail](docs/ErrorDetail.md) + - [ErrorDetailCode](docs/ErrorDetailCode.md) + - [Expand](docs/Expand.md) + - [ExtendedUser](docs/ExtendedUser.md) + - [GetAccountGroup200Response](docs/GetAccountGroup200Response.md) + - [GetAccountGroups200Response](docs/GetAccountGroups200Response.md) + - [GetPermissions200Response](docs/GetPermissions200Response.md) + - [GetRoles200Response](docs/GetRoles200Response.md) + - [GetUser200Response](docs/GetUser200Response.md) + - [GetUserEvents200Response](docs/GetUserEvents200Response.md) + - [GetUsers200Response](docs/GetUsers200Response.md) + - [InterfaceIpMapping](docs/InterfaceIpMapping.md) + - [Link](docs/Link.md) + - [LoginAccountGroup](docs/LoginAccountGroup.md) + - [NewAccountGroupResponse](docs/NewAccountGroupResponse.md) + - [PaginationLinks](docs/PaginationLinks.md) + - [PaginationLinksLinks](docs/PaginationLinksLinks.md) + - [Permission](docs/Permission.md) + - [Permissions](docs/Permissions.md) + - [QueryWindow](docs/QueryWindow.md) + - [Role](docs/Role.md) + - [RoleDetail](docs/RoleDetail.md) + - [RoleRequestBody](docs/RoleRequestBody.md) + - [Roles](docs/Roles.md) + - [SelfLinks](docs/SelfLinks.md) + - [SelfLinksLinks](docs/SelfLinksLinks.md) + - [UnauthorizedError](docs/UnauthorizedError.md) + - [User](docs/User.md) + - [UserAccountGroup](docs/UserAccountGroup.md) + - [UserAccountGroups](docs/UserAccountGroups.md) + - [UserDetail](docs/UserDetail.md) + - [UserEvent](docs/UserEvent.md) + - [UserEventAllOfResourcesInner](docs/UserEventAllOfResourcesInner.md) + - [UserEvents](docs/UserEvents.md) + - [UserRequestBody](docs/UserRequestBody.md) + - [Users](docs/Users.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### BearerAuth + +- **Type**: Bearer authentication + + +## Author + + + + diff --git a/admin_api/admin_api/__init__.py b/admin_api/admin_api/__init__.py new file mode 100644 index 00000000..83f7ca50 --- /dev/null +++ b/admin_api/admin_api/__init__.py @@ -0,0 +1,97 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +__version__ = "1.0.0" + +# import apis into sdk package +from admin_api.api.account_groups_api import AccountGroupsApi +from admin_api.api.permissions_api import PermissionsApi +from admin_api.api.roles_api import RolesApi +from admin_api.api.user_events_api import UserEventsApi +from admin_api.api.users_api import UsersApi + +# import ApiClient +from admin_api.api_response import ApiResponse +from admin_api.api_client import ApiClient +from admin_api.configuration import Configuration +from admin_api.exceptions import OpenApiException +from admin_api.exceptions import ApiTypeError +from admin_api.exceptions import ApiValueError +from admin_api.exceptions import ApiKeyError +from admin_api.exceptions import ApiAttributeError +from admin_api.exceptions import ApiException + +# import models into sdk package +from admin_api.models.account_group import AccountGroup +from admin_api.models.account_group1 import AccountGroup1 +from admin_api.models.account_group_detail import AccountGroupDetail +from admin_api.models.account_group_id import AccountGroupId +from admin_api.models.account_group_request_body import AccountGroupRequestBody +from admin_api.models.account_group_roles import AccountGroupRoles +from admin_api.models.account_group_roles_account_group_roles_inner import AccountGroupRolesAccountGroupRolesInner +from admin_api.models.account_group_roles_request_body_inner import AccountGroupRolesRequestBodyInner +from admin_api.models.account_groups import AccountGroups +from admin_api.models.agent import Agent +from admin_api.models.agent_base import AgentBase +from admin_api.models.all_account_group_roles import AllAccountGroupRoles +from admin_api.models.base_role import BaseRole +from admin_api.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType +from admin_api.models.cluster_member import ClusterMember +from admin_api.models.create_account_group201_response import CreateAccountGroup201Response +from admin_api.models.create_role201_response import CreateRole201Response +from admin_api.models.create_user201_response import CreateUser201Response +from admin_api.models.created_user import CreatedUser +from admin_api.models.enterprise_agent import EnterpriseAgent +from admin_api.models.enterprise_agent_ipv6_policy import EnterpriseAgentIpv6Policy +from admin_api.models.enterprise_agent_state import EnterpriseAgentState +from admin_api.models.enterprise_agents import EnterpriseAgents +from admin_api.models.error import Error +from admin_api.models.error_detail import ErrorDetail +from admin_api.models.error_detail_code import ErrorDetailCode +from admin_api.models.expand import Expand +from admin_api.models.extended_user import ExtendedUser +from admin_api.models.get_account_group200_response import GetAccountGroup200Response +from admin_api.models.get_account_groups200_response import GetAccountGroups200Response +from admin_api.models.get_permissions200_response import GetPermissions200Response +from admin_api.models.get_roles200_response import GetRoles200Response +from admin_api.models.get_user200_response import GetUser200Response +from admin_api.models.get_user_events200_response import GetUserEvents200Response +from admin_api.models.get_users200_response import GetUsers200Response +from admin_api.models.interface_ip_mapping import InterfaceIpMapping +from admin_api.models.link import Link +from admin_api.models.login_account_group import LoginAccountGroup +from admin_api.models.new_account_group_response import NewAccountGroupResponse +from admin_api.models.pagination_links import PaginationLinks +from admin_api.models.pagination_links_links import PaginationLinksLinks +from admin_api.models.permission import Permission +from admin_api.models.permissions import Permissions +from admin_api.models.query_window import QueryWindow +from admin_api.models.role import Role +from admin_api.models.role_detail import RoleDetail +from admin_api.models.role_request_body import RoleRequestBody +from admin_api.models.roles import Roles +from admin_api.models.self_links import SelfLinks +from admin_api.models.self_links_links import SelfLinksLinks +from admin_api.models.unauthorized_error import UnauthorizedError +from admin_api.models.user import User +from admin_api.models.user_account_group import UserAccountGroup +from admin_api.models.user_account_groups import UserAccountGroups +from admin_api.models.user_detail import UserDetail +from admin_api.models.user_event import UserEvent +from admin_api.models.user_event_all_of_resources_inner import UserEventAllOfResourcesInner +from admin_api.models.user_events import UserEvents +from admin_api.models.user_request_body import UserRequestBody +from admin_api.models.users import Users diff --git a/admin_api/admin_api/api/__init__.py b/admin_api/admin_api/api/__init__.py new file mode 100644 index 00000000..a63ca435 --- /dev/null +++ b/admin_api/admin_api/api/__init__.py @@ -0,0 +1,9 @@ +# flake8: noqa + +# import apis into api package +from admin_api.api.account_groups_api import AccountGroupsApi +from admin_api.api.permissions_api import PermissionsApi +from admin_api.api.roles_api import RolesApi +from admin_api.api.user_events_api import UserEventsApi +from admin_api.api.users_api import UsersApi + diff --git a/admin_api/admin_api/api/account_groups_api.py b/admin_api/admin_api/api/account_groups_api.py new file mode 100644 index 00000000..b71db216 --- /dev/null +++ b/admin_api/admin_api/api/account_groups_api.py @@ -0,0 +1,1534 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import io +import warnings + +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Dict, List, Optional, Tuple, Union, Any + +try: + from typing import Annotated +except ImportError: + from typing_extensions import Annotated + +from pydantic import Field +from typing_extensions import Annotated +from pydantic import StrictStr + +from typing import List, Optional + +from admin_api.models.account_group_request_body import AccountGroupRequestBody +from admin_api.models.create_account_group201_response import CreateAccountGroup201Response +from admin_api.models.expand import Expand +from admin_api.models.get_account_group200_response import GetAccountGroup200Response +from admin_api.models.get_account_groups200_response import GetAccountGroups200Response + +from admin_api.api_client import ApiClient +from admin_api.api_response import ApiResponse +from admin_api.rest import RESTResponseType + + +class AccountGroupsApi: + """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() + self.api_client = api_client + + + @validate_call + def create_account_group( + self, + account_group_request_body: AccountGroupRequestBody, + 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, + ) -> CreateAccountGroup201Response: + """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_body: (required) + :type account_group_request_body: AccountGroupRequestBody + :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_body=account_group_request_body, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateAccountGroup201Response", + '400': "Error", + '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, + ).data + + + @validate_call + def create_account_group_with_http_info( + self, + account_group_request_body: AccountGroupRequestBody, + 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[CreateAccountGroup201Response]: + """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_body: (required) + :type account_group_request_body: AccountGroupRequestBody + :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_body=account_group_request_body, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateAccountGroup201Response", + '400': "Error", + '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, + ) + + + @validate_call + def create_account_group_without_preload_content( + self, + account_group_request_body: AccountGroupRequestBody, + 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_body: (required) + :type account_group_request_body: AccountGroupRequestBody + :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_body=account_group_request_body, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateAccountGroup201Response", + '400': "Error", + '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_body, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> Tuple: + + _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, str] = {} + _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_body is not None: + _body_params = account_group_request_body + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+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]] = { + + } + 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, + ).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]] = { + + } + 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, + ) + + + @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]] = { + + } + 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, + ) -> Tuple: + + _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, str] = {} + _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, + ) -> GetAccountGroup200Response: + """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': "GetAccountGroup200Response", + '400': "Error", + '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, + ).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[GetAccountGroup200Response]: + """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': "GetAccountGroup200Response", + '400': "Error", + '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, + ) + + + @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': "GetAccountGroup200Response", + '400': "Error", + '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, + ) -> Tuple: + + _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, str] = {} + _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/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, + ) -> GetAccountGroups200Response: + """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': "GetAccountGroups200Response", + '400': "Error", + '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, + ).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[GetAccountGroups200Response]: + """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': "GetAccountGroups200Response", + '400': "Error", + '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, + ) + + + @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': "GetAccountGroups200Response", + '400': "Error", + '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, + ) -> Tuple: + + _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, str] = {} + _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/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_body: AccountGroupRequestBody, + 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, + ) -> GetAccountGroup200Response: + """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_body: (required) + :type account_group_request_body: AccountGroupRequestBody + :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_body=account_group_request_body, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetAccountGroup200Response", + '400': "Error", + '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, + ).data + + + @validate_call + def update_account_group_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Identifier for the account group.")], + account_group_request_body: AccountGroupRequestBody, + 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[GetAccountGroup200Response]: + """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_body: (required) + :type account_group_request_body: AccountGroupRequestBody + :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_body=account_group_request_body, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetAccountGroup200Response", + '400': "Error", + '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, + ) + + + @validate_call + def update_account_group_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Identifier for the account group.")], + account_group_request_body: AccountGroupRequestBody, + 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_body: (required) + :type account_group_request_body: AccountGroupRequestBody + :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_body=account_group_request_body, + expand=expand, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetAccountGroup200Response", + '400': "Error", + '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_body, + expand, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> Tuple: + + _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, str] = {} + _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_body is not None: + _body_params = account_group_request_body + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+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/admin_api/admin_api/api/permissions_api.py b/admin_api/admin_api/api/permissions_api.py new file mode 100644 index 00000000..bdf0c69b --- /dev/null +++ b/admin_api/admin_api/api/permissions_api.py @@ -0,0 +1,332 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import io +import warnings + +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Dict, List, Optional, Tuple, Union, Any + +try: + from typing import Annotated +except ImportError: + from typing_extensions import Annotated + +from pydantic import Field +from typing_extensions import Annotated +from pydantic import StrictStr + +from typing import Optional + +from admin_api.models.get_permissions200_response import GetPermissions200Response + +from admin_api.api_client import ApiClient +from admin_api.api_response import ApiResponse +from admin_api.rest import RESTResponseType + + +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() + 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, + ) -> GetPermissions200Response: + """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': "GetPermissions200Response", + '400': "Error", + '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, + ).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[GetPermissions200Response]: + """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': "GetPermissions200Response", + '400': "Error", + '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, + ) + + + @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': "GetPermissions200Response", + '400': "Error", + '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, + ) -> Tuple: + + _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, str] = {} + _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/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/admin_api/admin_api/api/roles_api.py b/admin_api/admin_api/api/roles_api.py new file mode 100644 index 00000000..1630de1a --- /dev/null +++ b/admin_api/admin_api/api/roles_api.py @@ -0,0 +1,1546 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import io +import warnings + +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Dict, List, Optional, Tuple, Union, Any + +try: + from typing import Annotated +except ImportError: + from typing_extensions import Annotated + +from pydantic import Field +from typing_extensions import Annotated +from pydantic import StrictStr + +from typing import Optional + +from admin_api.models.create_role201_response import CreateRole201Response +from admin_api.models.get_roles200_response import GetRoles200Response +from admin_api.models.role_request_body import RoleRequestBody + +from admin_api.api_client import ApiClient +from admin_api.api_response import ApiResponse +from admin_api.rest import RESTResponseType + + +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() + 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, + ) -> CreateRole201Response: + """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': "CreateRole201Response", + '400': "Error", + '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, + ).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[CreateRole201Response]: + """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': "CreateRole201Response", + '400': "Error", + '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, + ) + + + @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': "CreateRole201Response", + '400': "Error", + '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, + ) -> Tuple: + + _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, str] = {} + _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/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]] = { + + } + 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, + ).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]] = { + + } + 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, + ) + + + @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]] = { + + } + 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, + ) -> Tuple: + + _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, str] = {} + _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, + ) -> CreateRole201Response: + """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': "CreateRole201Response", + '400': "Error", + '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, + ).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[CreateRole201Response]: + """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': "CreateRole201Response", + '400': "Error", + '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, + ) + + + @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': "CreateRole201Response", + '400': "Error", + '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, + ) -> Tuple: + + _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, str] = {} + _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/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, + ) -> GetRoles200Response: + """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': "GetRoles200Response", + '400': "Error", + '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, + ).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[GetRoles200Response]: + """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': "GetRoles200Response", + '400': "Error", + '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, + ) + + + @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': "GetRoles200Response", + '400': "Error", + '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, + ) -> Tuple: + + _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, str] = {} + _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/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, + ) -> CreateRole201Response: + """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': "CreateRole201Response", + '400': "Error", + '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, + ).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[CreateRole201Response]: + """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': "CreateRole201Response", + '400': "Error", + '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, + ) + + + @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': "CreateRole201Response", + '400': "Error", + '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, + ) -> Tuple: + + _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, str] = {} + _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/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/admin_api/admin_api/api/user_events_api.py b/admin_api/admin_api/api/user_events_api.py new file mode 100644 index 00000000..b516bd46 --- /dev/null +++ b/admin_api/admin_api/api/user_events_api.py @@ -0,0 +1,420 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import io +import warnings + +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Dict, List, Optional, Tuple, Union, Any + +try: + from typing import Annotated +except ImportError: + from typing_extensions import Annotated + +from pydantic import Field +from typing_extensions import Annotated +from datetime import datetime + +from pydantic import StrictStr, field_validator + +from typing import Optional + +from admin_api.models.get_user_events200_response import GetUserEvents200Response + +from admin_api.api_client import ApiClient +from admin_api.api_response import ApiResponse +from admin_api.rest import RESTResponseType + + +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() + 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, + 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 `_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, + ) -> GetUserEvents200Response: + """List activity log events + + Returns a list of activity log events. Users with the `View activity log for all users in account group` permission can see all activity log events in the current account group. Users with the `View own activity log` permission can see their own activity log events in the current account group. For more information about changing the account group context, see [Account Context](https://developer.thousandeyes.com/v7/#/accountcontext). + + :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 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 `_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, + 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': "GetUserEvents200Response", + '400': "Error", + '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, + ).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, + 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 `_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[GetUserEvents200Response]: + """List activity log events + + Returns a list of activity log events. Users with the `View activity log for all users in account group` permission can see all activity log events in the current account group. Users with the `View own activity log` permission can see their own activity log events in the current account group. For more information about changing the account group context, see [Account Context](https://developer.thousandeyes.com/v7/#/accountcontext). + + :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 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 `_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, + 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': "GetUserEvents200Response", + '400': "Error", + '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, + ) + + + @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, + 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 `_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. Users with the `View activity log for all users in account group` permission can see all activity log events in the current account group. Users with the `View own activity log` permission can see their own activity log events in the current account group. For more information about changing the account group context, see [Account Context](https://developer.thousandeyes.com/v7/#/accountcontext). + + :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 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 `_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, + 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': "GetUserEvents200Response", + '400': "Error", + '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, + window, + start_date, + end_date, + cursor, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> Tuple: + + _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, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + 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/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/admin_api/admin_api/api/users_api.py b/admin_api/admin_api/api/users_api.py new file mode 100644 index 00000000..23d2b3c4 --- /dev/null +++ b/admin_api/admin_api/api/users_api.py @@ -0,0 +1,1547 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import io +import warnings + +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Dict, List, Optional, Tuple, Union, Any + +try: + from typing import Annotated +except ImportError: + from typing_extensions import Annotated + +from pydantic import Field +from typing_extensions import Annotated +from pydantic import StrictStr + +from typing import Optional + +from admin_api.models.create_user201_response import CreateUser201Response +from admin_api.models.get_user200_response import GetUser200Response +from admin_api.models.get_users200_response import GetUsers200Response +from admin_api.models.user_request_body import UserRequestBody + +from admin_api.api_client import ApiClient +from admin_api.api_response import ApiResponse +from admin_api.rest import RESTResponseType + + +class UsersApi: + """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() + self.api_client = api_client + + + @validate_call + def create_user( + self, + user_request_body: UserRequestBody, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _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, + ) -> CreateUser201Response: + """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_body: (required) + :type user_request_body: UserRequestBody + :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_body=user_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': "CreateUser201Response", + '400': "Error", + '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, + ).data + + + @validate_call + def create_user_with_http_info( + self, + user_request_body: UserRequestBody, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _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[CreateUser201Response]: + """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_body: (required) + :type user_request_body: UserRequestBody + :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_body=user_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': "CreateUser201Response", + '400': "Error", + '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, + ) + + + @validate_call + def create_user_without_preload_content( + self, + user_request_body: UserRequestBody, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _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_body: (required) + :type user_request_body: UserRequestBody + :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_body=user_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': "CreateUser201Response", + '400': "Error", + '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_body, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> Tuple: + + _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, str] = {} + _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_body is not None: + _body_params = user_request_body + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+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="Identifer 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: Identifer 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]] = { + + } + 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, + ).data + + + @validate_call + def delete_user_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Identifer 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: Identifer 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]] = { + + } + 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, + ) + + + @validate_call + def delete_user_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Identifer 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: Identifer 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]] = { + + } + 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, + ) -> Tuple: + + _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, str] = {} + _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="Identifer 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, + ) -> GetUser200Response: + """Retrieve user + + Retrieves detailed information about a user. This operation requires the `API Access` and `View All Users` permissions. + + :param id: Identifer 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': "GetUser200Response", + '400': "Error", + '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, + ).data + + + @validate_call + def get_user_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Identifer 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[GetUser200Response]: + """Retrieve user + + Retrieves detailed information about a user. This operation requires the `API Access` and `View All Users` permissions. + + :param id: Identifer 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': "GetUser200Response", + '400': "Error", + '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, + ) + + + @validate_call + def get_user_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Identifer 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: Identifer 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': "GetUser200Response", + '400': "Error", + '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, + ) -> Tuple: + + _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, str] = {} + _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/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, + ) -> GetUsers200Response: + """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': "GetUsers200Response", + '400': "Error", + '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, + ).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[GetUsers200Response]: + """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': "GetUsers200Response", + '400': "Error", + '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, + ) + + + @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': "GetUsers200Response", + '400': "Error", + '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, + ) -> Tuple: + + _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, str] = {} + _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/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="Identifer for the user.")], + user_request_body: UserRequestBody, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _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, + ) -> GetUser200Response: + """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: Identifer for the user. (required) + :type id: str + :param user_request_body: (required) + :type user_request_body: UserRequestBody + :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_body=user_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': "GetUser200Response", + '400': "Error", + '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, + ).data + + + @validate_call + def update_user_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Identifer for the user.")], + user_request_body: UserRequestBody, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _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[GetUser200Response]: + """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: Identifer for the user. (required) + :type id: str + :param user_request_body: (required) + :type user_request_body: UserRequestBody + :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_body=user_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': "GetUser200Response", + '400': "Error", + '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, + ) + + + @validate_call + def update_user_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Identifer for the user.")], + user_request_body: UserRequestBody, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _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: Identifer for the user. (required) + :type id: str + :param user_request_body: (required) + :type user_request_body: UserRequestBody + :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_body=user_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': "GetUser200Response", + '400': "Error", + '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_body, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> Tuple: + + _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, str] = {} + _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_body is not None: + _body_params = user_request_body + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+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/admin_api/admin_api/api_client.py b/admin_api/admin_api/api_client.py new file mode 100644 index 00000000..94ebfe98 --- /dev/null +++ b/admin_api/admin_api/api_client.py @@ -0,0 +1,741 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import atexit +import datetime +from dateutil.parser import parse +import json +import mimetypes +import os +import re +import tempfile + +from urllib.parse import quote +from typing import Tuple, Optional, List + +from admin_api.configuration import Configuration +from admin_api.api_response import ApiResponse +import admin_api.models +from admin_api import rest +from admin_api.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException +) + + +class ApiClient: + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int, # TODO remove as only py3 is supported? + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, + } + _pool = None + + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: + # use default configuration if none is provided + if configuration is None: + configuration = Configuration.get_default() + self.configuration = configuration + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'ThousandEyes Python SDK' + self.client_side_validation = configuration.client_side_validation + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + pass + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> Tuple: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict( + self.parameters_to_tuples(header_params,collection_formats) + ) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth( + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) + url += "?" + url_query + + return method, url, header_params, body, post_params + + + def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + + try: + # perform request and return response + response_data = self.rest_client.request( + method, url, + headers=header_params, + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + + except ApiException as e: + if e.body: + e.body = e.body.decode('utf-8') + raise e + + return response_data + + def response_deserialize( + self, + response_data=None, + response_types_map=None + ) -> ApiResponse: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ + + + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) + + if not 200 <= response_data.status <= 299: + if response_data.status == 400: + raise BadRequestException(http_resp=response_data) + + if response_data.status == 401: + raise UnauthorizedException(http_resp=response_data) + + if response_data.status == 403: + raise ForbiddenException(http_resp=response_data) + + if response_data.status == 404: + raise NotFoundException(http_resp=response_data) + + if 500 <= response_data.status <= 599: + raise ServiceException(http_resp=response_data) + raise ApiException(http_resp=response_data) + + # deserialize response data + + if response_type == "bytearray": + return_data = response_data.data + elif response_type is None: + return_data = None + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + else: + match = None + content_type = response_data.getheader('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type) + + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data + ) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] + elif isinstance(obj, tuple): + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + + elif isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + obj_dict = obj.to_dict() + + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } + + def deserialize(self, response_text, response_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + + # fetch data from response object + try: + data = json.loads(response_text) + except ValueError: + data = response_text + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith('List['): + sub_kls = re.match(r'List\[(.*)]', klass).group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('Dict['): + sub_kls = re.match(r'Dict\[([^,]*), (.*)]', klass).group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(admin_api.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datetime(data) + else: + return self.__deserialize_model(data, klass) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) + + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(quote(str(value)) for value in v)) + ) + else: + new_params.append((k, quote(str(v)))) + + return "&".join(["=".join(item) for item in new_params]) + + def files_parameters(self, files=None): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + + if files: + for k, v in files.items(): + if not v: + continue + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) + + return params + + def select_header_accept(self, accepts: List[str]) -> Optional[str]: + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return None + + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept + + return accepts[0] + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return None + + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type + + return content_types[0] + + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. + """ + if not auth_settings: + return + + if request_auth: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting + ) + + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: + """Updates the request parameters based on a single auth_setting + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint + """ + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + handle file downloading + save response body into a tmp file and return the instance + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + filename = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ).group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datetime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + return klass.from_dict(data) diff --git a/admin_api/admin_api/api_response.py b/admin_api/admin_api/api_response.py new file mode 100644 index 00000000..2ac1ada6 --- /dev/null +++ b/admin_api/admin_api/api_response.py @@ -0,0 +1,21 @@ +"""API response object.""" + +from __future__ import annotations +from typing import Any, Dict, Optional, Generic, TypeVar +from pydantic import Field, StrictInt, StrictStr, StrictBytes, BaseModel + +T = TypeVar("T") + +class ApiResponse(BaseModel, Generic[T]): + """ + API response object + """ + + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Dict[StrictStr, StrictStr]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + + model_config = { + "arbitrary_types_allowed": True + } diff --git a/admin_api/admin_api/configuration.py b/admin_api/admin_api/configuration.py new file mode 100644 index 00000000..32987fed --- /dev/null +++ b/admin_api/admin_api/configuration.py @@ -0,0 +1,434 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import copy +import logging +import sys +import urllib3 + +import http.client as httplib + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' +} + +class Configuration: + """This class contains various settings of the API client. + + :param host: Base url. + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum + values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + + :Example: + """ + + _default = None + + def __init__(self, host=None, + api_key=None, api_key_prefix=None, + username=None, password=None, + access_token=None, + server_index=None, server_variables=None, + server_operation_index=None, server_operation_variables=None, + ssl_ca_cert=None, + ) -> None: + """Constructor + """ + self._base_path = "https://api.thousandeyes.com" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.access_token = access_token + """Access token + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("admin_api") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ + + + self.proxy = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + """datetime format + """ + + self.date_format = "%Y-%m-%d" + """date format + """ + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + + @classmethod + def set_default(cls, default): + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = default + + @classmethod + def get_default_copy(cls): + """Deprecated. Please use `get_default` instead. + + Deprecated. Please use `get_default` instead. + + :return: The configuration object. + """ + return cls.get_default() + + @classmethod + def get_default(cls): + """Return the default configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration. + + :return: The configuration object. + """ + if cls._default is None: + cls._default = Configuration() + return cls._default + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier, alias=None): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + return urllib3.util.make_headers( + basic_auth=username + ':' + password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth = {} + if self.access_token is not None: + auth['BearerAuth'] = { + 'type': 'bearer', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } + return auth + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 7.0.0\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "https://api.thousandeyes.com", + 'description': "Thousandeyes API production URL", + } + ] + + def get_host_from_settings(self, index, variables=None, servers=None): + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self): + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value): + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/admin_api/admin_api/exceptions.py b/admin_api/admin_api/exceptions.py new file mode 100644 index 00000000..c092517b --- /dev/null +++ b/admin_api/admin_api/exceptions.py @@ -0,0 +1,166 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None) -> None: + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__(self, status=None, reason=None, http_resp=None) -> None: + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data.decode('utf-8') + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message + +class BadRequestException(ApiException): + + def __init__(self, status=None, reason=None, http_resp=None) -> None: + super(BadRequestException, self).__init__(status, reason, http_resp) + +class NotFoundException(ApiException): + + def __init__(self, status=None, reason=None, http_resp=None) -> None: + super(NotFoundException, self).__init__(status, reason, http_resp) + + +class UnauthorizedException(ApiException): + + def __init__(self, status=None, reason=None, http_resp=None) -> None: + super(UnauthorizedException, self).__init__(status, reason, http_resp) + + +class ForbiddenException(ApiException): + + def __init__(self, status=None, reason=None, http_resp=None) -> None: + super(ForbiddenException, self).__init__(status, reason, http_resp) + + +class ServiceException(ApiException): + + def __init__(self, status=None, reason=None, http_resp=None) -> None: + super(ServiceException, self).__init__(status, reason, http_resp) + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/admin_api/admin_api/models/__init__.py b/admin_api/admin_api/models/__init__.py new file mode 100644 index 00000000..4058f1ac --- /dev/null +++ b/admin_api/admin_api/models/__init__.py @@ -0,0 +1,76 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +# import models into model package +from admin_api.models.account_group import AccountGroup +from admin_api.models.account_group1 import AccountGroup1 +from admin_api.models.account_group_detail import AccountGroupDetail +from admin_api.models.account_group_id import AccountGroupId +from admin_api.models.account_group_request_body import AccountGroupRequestBody +from admin_api.models.account_group_roles import AccountGroupRoles +from admin_api.models.account_group_roles_account_group_roles_inner import AccountGroupRolesAccountGroupRolesInner +from admin_api.models.account_group_roles_request_body_inner import AccountGroupRolesRequestBodyInner +from admin_api.models.account_groups import AccountGroups +from admin_api.models.agent import Agent +from admin_api.models.agent_base import AgentBase +from admin_api.models.all_account_group_roles import AllAccountGroupRoles +from admin_api.models.base_role import BaseRole +from admin_api.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType +from admin_api.models.cluster_member import ClusterMember +from admin_api.models.create_account_group201_response import CreateAccountGroup201Response +from admin_api.models.create_role201_response import CreateRole201Response +from admin_api.models.create_user201_response import CreateUser201Response +from admin_api.models.created_user import CreatedUser +from admin_api.models.enterprise_agent import EnterpriseAgent +from admin_api.models.enterprise_agent_ipv6_policy import EnterpriseAgentIpv6Policy +from admin_api.models.enterprise_agent_state import EnterpriseAgentState +from admin_api.models.enterprise_agents import EnterpriseAgents +from admin_api.models.error import Error +from admin_api.models.error_detail import ErrorDetail +from admin_api.models.error_detail_code import ErrorDetailCode +from admin_api.models.expand import Expand +from admin_api.models.extended_user import ExtendedUser +from admin_api.models.get_account_group200_response import GetAccountGroup200Response +from admin_api.models.get_account_groups200_response import GetAccountGroups200Response +from admin_api.models.get_permissions200_response import GetPermissions200Response +from admin_api.models.get_roles200_response import GetRoles200Response +from admin_api.models.get_user200_response import GetUser200Response +from admin_api.models.get_user_events200_response import GetUserEvents200Response +from admin_api.models.get_users200_response import GetUsers200Response +from admin_api.models.interface_ip_mapping import InterfaceIpMapping +from admin_api.models.link import Link +from admin_api.models.login_account_group import LoginAccountGroup +from admin_api.models.new_account_group_response import NewAccountGroupResponse +from admin_api.models.pagination_links import PaginationLinks +from admin_api.models.pagination_links_links import PaginationLinksLinks +from admin_api.models.permission import Permission +from admin_api.models.permissions import Permissions +from admin_api.models.query_window import QueryWindow +from admin_api.models.role import Role +from admin_api.models.role_detail import RoleDetail +from admin_api.models.role_request_body import RoleRequestBody +from admin_api.models.roles import Roles +from admin_api.models.self_links import SelfLinks +from admin_api.models.self_links_links import SelfLinksLinks +from admin_api.models.unauthorized_error import UnauthorizedError +from admin_api.models.user import User +from admin_api.models.user_account_group import UserAccountGroup +from admin_api.models.user_account_groups import UserAccountGroups +from admin_api.models.user_detail import UserDetail +from admin_api.models.user_event import UserEvent +from admin_api.models.user_event_all_of_resources_inner import UserEventAllOfResourcesInner +from admin_api.models.user_events import UserEvents +from admin_api.models.user_request_body import UserRequestBody +from admin_api.models.users import Users diff --git a/admin_api/admin_api/models/account_group.py b/admin_api/admin_api/models/account_group.py new file mode 100644 index 00000000..d5248f7d --- /dev/null +++ b/admin_api/admin_api/models/account_group.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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictBool, StrictStr +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AccountGroup(BaseModel): + """ + AccountGroup + """ # noqa: E501 + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + account_group_name: Optional[StrictStr] = Field(default=None, description="Account group name", alias="accountGroupName") + is_current_account_group: Optional[StrictBool] = Field(default=None, description="Indicates whether the requested aid is the context of the current account.", alias="isCurrentAccountGroup") + is_default_account_group: Optional[StrictBool] = Field(default=None, description="Indicates whether the aid is the default one for the requesting user.", alias="isDefaultAccountGroup") + organization_name: Optional[StrictStr] = Field(default=None, description="(Optional) Indicates whether the aid is the default one for the requesting user.", alias="organizationName") + __properties: ClassVar[List[str]] = ["aid", "accountGroupName", "isCurrentAccountGroup", "isDefaultAccountGroup", "organizationName"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AccountGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "aid": obj.get("aid"), + "accountGroupName": obj.get("accountGroupName"), + "isCurrentAccountGroup": obj.get("isCurrentAccountGroup"), + "isDefaultAccountGroup": obj.get("isDefaultAccountGroup"), + "organizationName": obj.get("organizationName") + }) + return _obj + + diff --git a/admin_api/admin_api/models/account_group1.py b/admin_api/admin_api/models/account_group1.py new file mode 100644 index 00000000..569b7648 --- /dev/null +++ b/admin_api/admin_api/models/account_group1.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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictStr +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AccountGroup1(BaseModel): + """ + AccountGroup1 + """ # noqa: E501 + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + account_group_name: Optional[StrictStr] = Field(default=None, description="Account group name", alias="accountGroupName") + __properties: ClassVar[List[str]] = ["aid", "accountGroupName"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AccountGroup1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AccountGroup1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "aid": obj.get("aid"), + "accountGroupName": obj.get("accountGroupName") + }) + return _obj + + diff --git a/admin_api/admin_api/models/account_group_detail.py b/admin_api/admin_api/models/account_group_detail.py new file mode 100644 index 00000000..ae5f1b80 --- /dev/null +++ b/admin_api/admin_api/models/account_group_detail.py @@ -0,0 +1,116 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictBool, StrictStr +from pydantic import Field +from admin_api.models.enterprise_agent import EnterpriseAgent +from admin_api.models.user_account_group import UserAccountGroup +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AccountGroupDetail(BaseModel): + """ + AccountGroupDetail + """ # noqa: E501 + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + account_group_name: Optional[StrictStr] = Field(default=None, description="Account group name", alias="accountGroupName") + is_current_account_group: Optional[StrictBool] = Field(default=None, description="Indicates whether the requested aid is the context of the current account.", alias="isCurrentAccountGroup") + is_default_account_group: Optional[StrictBool] = Field(default=None, description="Indicates whether the aid is the default one for the requesting user.", alias="isDefaultAccountGroup") + organization_name: Optional[StrictStr] = Field(default=None, description="(Optional) Indicates whether the aid is the default one for the requesting user.", alias="organizationName") + users: Optional[List[UserAccountGroup]] = None + agents: Optional[List[EnterpriseAgent]] = None + __properties: ClassVar[List[str]] = ["aid", "accountGroupName", "isCurrentAccountGroup", "isDefaultAccountGroup", "organizationName", "users", "agents"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in users (list) + _items = [] + if self.users: + for _item in self.users: + if _item: + _items.append(_item.to_dict()) + _dict['users'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> 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.get("users")] if obj.get("users") is not None else None, + "agents": [EnterpriseAgent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/account_group_id.py b/admin_api/admin_api/models/account_group_id.py new file mode 100644 index 00000000..224fcbae --- /dev/null +++ b/admin_api/admin_api/models/account_group_id.py @@ -0,0 +1,88 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictStr +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AccountGroupId(BaseModel): + """ + AccountGroupId + """ # noqa: E501 + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + __properties: ClassVar[List[str]] = ["aid"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AccountGroupId from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AccountGroupId from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "aid": obj.get("aid") + }) + return _obj + + diff --git a/admin_api/admin_api/models/account_group_request_body.py b/admin_api/admin_api/models/account_group_request_body.py new file mode 100644 index 00000000..ab4bd331 --- /dev/null +++ b/admin_api/admin_api/models/account_group_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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictStr +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AccountGroupRequestBody(BaseModel): + """ + AccountGroupRequestBody + """ # noqa: E501 + account_group_name: StrictStr = Field(description="The name of the account group", alias="accountGroupName") + agents: Optional[List[StrictStr]] = Field(default=None, description="To grant access to enterprise agents, specify the agent list. Note that this is not an additive list - the full list must be specified if changing access to agents.") + __properties: ClassVar[List[str]] = ["accountGroupName", "agents"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AccountGroupRequestBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AccountGroupRequestBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "accountGroupName": obj.get("accountGroupName"), + "agents": obj.get("agents") + }) + return _obj + + diff --git a/admin_api/admin_api/models/account_group_roles.py b/admin_api/admin_api/models/account_group_roles.py new file mode 100644 index 00000000..3c635c1d --- /dev/null +++ b/admin_api/admin_api/models/account_group_roles.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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel +from pydantic import Field +from admin_api.models.account_group_roles_account_group_roles_inner import AccountGroupRolesAccountGroupRolesInner +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AccountGroupRoles(BaseModel): + """ + AccountGroupRoles + """ # noqa: E501 + account_group_roles: Optional[List[AccountGroupRolesAccountGroupRolesInner]] = Field(default=None, alias="accountGroupRoles") + __properties: ClassVar[List[str]] = ["accountGroupRoles"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AccountGroupRoles from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + 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: Dict) -> Self: + """Create an instance of AccountGroupRoles from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "accountGroupRoles": [AccountGroupRolesAccountGroupRolesInner.from_dict(_item) for _item in obj.get("accountGroupRoles")] if obj.get("accountGroupRoles") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/account_group_roles_account_group_roles_inner.py b/admin_api/admin_api/models/account_group_roles_account_group_roles_inner.py new file mode 100644 index 00000000..ffc2ce88 --- /dev/null +++ b/admin_api/admin_api/models/account_group_roles_account_group_roles_inner.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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel +from pydantic import Field +from admin_api.models.account_group1 import AccountGroup1 +from admin_api.models.role import Role +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AccountGroupRolesAccountGroupRolesInner(BaseModel): + """ + AccountGroupRolesAccountGroupRolesInner + """ # noqa: E501 + account_group: Optional[AccountGroup1] = Field(default=None, alias="accountGroup") + roles: Optional[List[Role]] = None + __properties: ClassVar[List[str]] = ["accountGroup", "roles"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AccountGroupRolesAccountGroupRolesInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + 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: Dict) -> Self: + """Create an instance of AccountGroupRolesAccountGroupRolesInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "accountGroup": AccountGroup1.from_dict(obj.get("accountGroup")) if obj.get("accountGroup") is not None else None, + "roles": [Role.from_dict(_item) for _item in obj.get("roles")] if obj.get("roles") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/account_group_roles_request_body_inner.py b/admin_api/admin_api/models/account_group_roles_request_body_inner.py new file mode 100644 index 00000000..92cd8e86 --- /dev/null +++ b/admin_api/admin_api/models/account_group_roles_request_body_inner.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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictStr +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AccountGroupRolesRequestBodyInner(BaseModel): + """ + AccountGroupRolesRequestBodyInner + """ # noqa: E501 + account_group_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the account group.", alias="accountGroupId") + role_ids: Optional[List[StrictStr]] = Field(default=None, description="Unique role IDs.", alias="roleIds") + __properties: ClassVar[List[str]] = ["accountGroupId", "roleIds"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AccountGroupRolesRequestBodyInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AccountGroupRolesRequestBodyInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "accountGroupId": obj.get("accountGroupId"), + "roleIds": obj.get("roleIds") + }) + return _obj + + diff --git a/admin_api/admin_api/models/account_groups.py b/admin_api/admin_api/models/account_groups.py new file mode 100644 index 00000000..92d3c6be --- /dev/null +++ b/admin_api/admin_api/models/account_groups.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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel +from pydantic import Field +from admin_api.models.account_group import AccountGroup +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AccountGroups(BaseModel): + """ + AccountGroups + """ # noqa: E501 + account_groups: Optional[List[AccountGroup]] = Field(default=None, alias="accountGroups") + __properties: ClassVar[List[str]] = ["accountGroups"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in account_groups (list) + _items = [] + if self.account_groups: + for _item in self.account_groups: + if _item: + _items.append(_item.to_dict()) + _dict['accountGroups'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AccountGroups from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "accountGroups": [AccountGroup.from_dict(_item) for _item in obj.get("accountGroups")] if obj.get("accountGroups") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/agent.py b/admin_api/admin_api/models/agent.py new file mode 100644 index 00000000..62ee766e --- /dev/null +++ b/admin_api/admin_api/models/agent.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Administrative API + + ## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictBool, StrictStr +from pydantic import Field +from admin_api.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType +try: + from typing import Self +except ImportError: + 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") + agent_type: Optional[CloudEnterpriseAgentType] = Field(default=None, alias="agentType") + 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.") + 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", "agentType", "location", "countryId", "enabled", "verifySslCertificates"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "ip_addresses", + "public_ip_addresses", + "network", + "agent_id", + "location", + "country_id", + "verify_ssl_certificates", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> 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"), + "agentType": obj.get("agentType"), + "location": obj.get("location"), + "countryId": obj.get("countryId"), + "enabled": obj.get("enabled"), + "verifySslCertificates": obj.get("verifySslCertificates") + }) + return _obj + + diff --git a/admin_api/admin_api/models/agent_base.py b/admin_api/admin_api/models/agent_base.py new file mode 100644 index 00000000..f14b6193 --- /dev/null +++ b/admin_api/admin_api/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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictStr +from pydantic import Field +try: + from typing import Self +except ImportError: + 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 = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "ip_addresses", + "public_ip_addresses", + "network", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> 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/admin_api/admin_api/models/all_account_group_roles.py b/admin_api/admin_api/models/all_account_group_roles.py new file mode 100644 index 00000000..4d5eef39 --- /dev/null +++ b/admin_api/admin_api/models/all_account_group_roles.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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel +from pydantic import Field +from admin_api.models.role import Role +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AllAccountGroupRoles(BaseModel): + """ + AllAccountGroupRoles + """ # noqa: E501 + all_account_group_roles: Optional[List[Role]] = Field(default=None, alias="allAccountGroupRoles") + __properties: ClassVar[List[str]] = ["allAccountGroupRoles"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AllAccountGroupRoles from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in all_account_group_roles (list) + _items = [] + if self.all_account_group_roles: + for _item in self.all_account_group_roles: + if _item: + _items.append(_item.to_dict()) + _dict['allAccountGroupRoles'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AllAccountGroupRoles from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "allAccountGroupRoles": [Role.from_dict(_item) for _item in obj.get("allAccountGroupRoles")] if obj.get("allAccountGroupRoles") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/base_role.py b/admin_api/admin_api/models/base_role.py new file mode 100644 index 00000000..c1c69d60 --- /dev/null +++ b/admin_api/admin_api/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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictBool, StrictStr +from pydantic import Field +try: + from typing import Self +except ImportError: + 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 = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> 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/admin_api/admin_api/models/cloud_enterprise_agent_type.py b/admin_api/admin_api/models/cloud_enterprise_agent_type.py new file mode 100644 index 00000000..cdebf7c0 --- /dev/null +++ b/admin_api/admin_api/models/cloud_enterprise_agent_type.py @@ -0,0 +1,46 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +import re # noqa: F401 +from enum import Enum + + + +try: + from typing import Self +except ImportError: + 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/admin_api/admin_api/models/cluster_member.py b/admin_api/admin_api/models/cluster_member.py new file mode 100644 index 00000000..c09bee81 --- /dev/null +++ b/admin_api/admin_api/models/cluster_member.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + Administrative API + + ## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import Field +from admin_api.models.enterprise_agent_state import EnterpriseAgentState +from admin_api.models.error_detail import ErrorDetail +try: + from typing import Self +except ImportError: + 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 = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "ip_addresses", + "public_ip_addresses", + "network", + "member_id", + "name", + "error_details", + "last_seen", + "utilization", + }, + 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: Dict) -> 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.get("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/admin_api/admin_api/models/create_account_group201_response.py b/admin_api/admin_api/models/create_account_group201_response.py new file mode 100644 index 00000000..b7876518 --- /dev/null +++ b/admin_api/admin_api/models/create_account_group201_response.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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictBool, StrictStr +from pydantic import Field +from admin_api.models.self_links_links import SelfLinksLinks +from admin_api.models.user_account_group import UserAccountGroup +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class CreateAccountGroup201Response(BaseModel): + """ + CreateAccountGroup201Response + """ # noqa: E501 + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + account_group_name: Optional[StrictStr] = Field(default=None, description="Account group name", alias="accountGroupName") + is_current_account_group: Optional[StrictBool] = Field(default=None, description="Indicates whether the requested aid is the context of the current account.", alias="isCurrentAccountGroup") + is_default_account_group: Optional[StrictBool] = Field(default=None, description="Indicates whether the aid is the default one for the requesting user.", alias="isDefaultAccountGroup") + organization_name: Optional[StrictStr] = Field(default=None, description="(Optional) Indicates whether the aid is the default one for the requesting user.", alias="organizationName") + users: Optional[List[UserAccountGroup]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["aid", "accountGroupName", "isCurrentAccountGroup", "isDefaultAccountGroup", "organizationName", "users", "_links"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of CreateAccountGroup201Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + 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: Dict) -> Self: + """Create an instance of CreateAccountGroup201Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "aid": obj.get("aid"), + "accountGroupName": obj.get("accountGroupName"), + "isCurrentAccountGroup": obj.get("isCurrentAccountGroup"), + "isDefaultAccountGroup": obj.get("isDefaultAccountGroup"), + "organizationName": obj.get("organizationName"), + "users": [UserAccountGroup.from_dict(_item) for _item in obj.get("users")] if obj.get("users") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/create_role201_response.py b/admin_api/admin_api/models/create_role201_response.py new file mode 100644 index 00000000..f9356b1a --- /dev/null +++ b/admin_api/admin_api/models/create_role201_response.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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictBool, StrictStr +from pydantic import Field +from admin_api.models.permission import Permission +from admin_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class CreateRole201Response(BaseModel): + """ + CreateRole201Response + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Name of the role.") + role_id: Optional[StrictStr] = Field(default=None, description="Unique ID representing the role.", alias="roleId") + is_builtin: Optional[StrictBool] = Field(default=None, description="Flag indicating if the role is built-in (Account Admin, Organization Admin, Regular User).", alias="isBuiltin") + permissions: Optional[List[Permission]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["name", "roleId", "isBuiltin", "permissions", "_links"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of CreateRole201Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + 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: Dict) -> Self: + """Create an instance of CreateRole201Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "roleId": obj.get("roleId"), + "isBuiltin": obj.get("isBuiltin"), + "permissions": [Permission.from_dict(_item) for _item in obj.get("permissions")] if obj.get("permissions") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/create_user201_response.py b/admin_api/admin_api/models/create_user201_response.py new file mode 100644 index 00000000..b2a1731a --- /dev/null +++ b/admin_api/admin_api/models/create_user201_response.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + Administrative API + + ## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictStr +from pydantic import Field +from admin_api.models.account_group1 import AccountGroup1 +from admin_api.models.account_group_roles_account_group_roles_inner import AccountGroupRolesAccountGroupRolesInner +from admin_api.models.role import Role +from admin_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class CreateUser201Response(BaseModel): + """ + CreateUser201Response + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="User's display name.") + email: Optional[StrictStr] = Field(default=None, description="User's email address.") + uid: Optional[StrictStr] = Field(default=None, description="Unique ID of the user.") + date_registered: Optional[datetime] = Field(default=None, description="UTC date the user registered their account (ISO date-time format).", alias="dateRegistered") + login_account_group: Optional[AccountGroup1] = Field(default=None, alias="loginAccountGroup") + account_group_roles: Optional[List[AccountGroupRolesAccountGroupRolesInner]] = Field(default=None, alias="accountGroupRoles") + all_account_group_roles: Optional[List[Role]] = Field(default=None, alias="allAccountGroupRoles") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["name", "email", "uid", "dateRegistered", "loginAccountGroup", "accountGroupRoles", "allAccountGroupRoles", "_links"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of CreateUser201Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + 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: Dict) -> Self: + """Create an instance of CreateUser201Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "email": obj.get("email"), + "uid": obj.get("uid"), + "dateRegistered": obj.get("dateRegistered"), + "loginAccountGroup": AccountGroup1.from_dict(obj.get("loginAccountGroup")) if obj.get("loginAccountGroup") is not None else None, + "accountGroupRoles": [AccountGroupRolesAccountGroupRolesInner.from_dict(_item) for _item in obj.get("accountGroupRoles")] if obj.get("accountGroupRoles") is not None else None, + "allAccountGroupRoles": [Role.from_dict(_item) for _item in obj.get("allAccountGroupRoles")] if obj.get("allAccountGroupRoles") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/created_user.py b/admin_api/admin_api/models/created_user.py new file mode 100644 index 00000000..0d2a0491 --- /dev/null +++ b/admin_api/admin_api/models/created_user.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + Administrative API + + ## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictStr +from pydantic import Field +from admin_api.models.account_group1 import AccountGroup1 +from admin_api.models.account_group_roles_account_group_roles_inner import AccountGroupRolesAccountGroupRolesInner +from admin_api.models.role import Role +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class CreatedUser(BaseModel): + """ + CreatedUser + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="User's display name.") + email: Optional[StrictStr] = Field(default=None, description="User's email address.") + uid: Optional[StrictStr] = Field(default=None, description="Unique ID of the user.") + date_registered: Optional[datetime] = Field(default=None, description="UTC date the user registered their account (ISO date-time format).", alias="dateRegistered") + login_account_group: Optional[AccountGroup1] = Field(default=None, alias="loginAccountGroup") + account_group_roles: Optional[List[AccountGroupRolesAccountGroupRolesInner]] = Field(default=None, alias="accountGroupRoles") + all_account_group_roles: Optional[List[Role]] = Field(default=None, alias="allAccountGroupRoles") + __properties: ClassVar[List[str]] = ["name", "email", "uid", "dateRegistered", "loginAccountGroup", "accountGroupRoles", "allAccountGroupRoles"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of login_account_group + if self.login_account_group: + _dict['loginAccountGroup'] = self.login_account_group.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in account_group_roles (list) + _items = [] + if self.account_group_roles: + for _item in self.account_group_roles: + if _item: + _items.append(_item.to_dict()) + _dict['accountGroupRoles'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in all_account_group_roles (list) + _items = [] + if self.all_account_group_roles: + for _item in self.all_account_group_roles: + if _item: + _items.append(_item.to_dict()) + _dict['allAccountGroupRoles'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of CreatedUser from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "email": obj.get("email"), + "uid": obj.get("uid"), + "dateRegistered": obj.get("dateRegistered"), + "loginAccountGroup": AccountGroup1.from_dict(obj.get("loginAccountGroup")) if obj.get("loginAccountGroup") is not None else None, + "accountGroupRoles": [AccountGroupRolesAccountGroupRolesInner.from_dict(_item) for _item in obj.get("accountGroupRoles")] if obj.get("accountGroupRoles") is not None else None, + "allAccountGroupRoles": [Role.from_dict(_item) for _item in obj.get("allAccountGroupRoles")] if obj.get("allAccountGroupRoles") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/enterprise_agent.py b/admin_api/admin_api/models/enterprise_agent.py new file mode 100644 index 00000000..2efd33c9 --- /dev/null +++ b/admin_api/admin_api/models/enterprise_agent.py @@ -0,0 +1,199 @@ +# coding: utf-8 + +""" + Administrative API + + ## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from pydantic import Field +from admin_api.models.account_group1 import AccountGroup1 +from admin_api.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType +from admin_api.models.cluster_member import ClusterMember +from admin_api.models.enterprise_agent_ipv6_policy import EnterpriseAgentIpv6Policy +from admin_api.models.enterprise_agent_state import EnterpriseAgentState +from admin_api.models.error_detail import ErrorDetail +from admin_api.models.interface_ip_mapping import InterfaceIpMapping +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EnterpriseAgent(BaseModel): + """ + EnterpriseAgent + """ # 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") + agent_type: Optional[CloudEnterpriseAgentType] = Field(default=None, alias="agentType") + 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.") + verify_ssl_certificates: Optional[StrictBool] = Field(default=None, description="Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests.", alias="verifySslCertificates") + cluster_members: Optional[List[ClusterMember]] = Field(default=None, description="If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents.", alias="clusterMembers") + utilization: Optional[StrictInt] = Field(default=None, description="Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only).") + account_groups: Optional[List[AccountGroup1]] = Field(default=None, description="List of account groups. See /accounts-groups to pull a list of account IDs", alias="accountGroups") + prefix: Optional[StrictStr] = Field(default=None, description="Prefix containing agents public IP address.") + 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]] = ["ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "agentType", "location", "countryId", "enabled", "verifySslCertificates", "clusterMembers", "utilization", "accountGroups", "prefix", "ipv6Policy", "errorDetails", "hostname", "lastSeen", "agentState", "keepBrowserCache", "createdDate", "targetForTests", "localResolutionPrefixes", "interfaceIpMappings"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "ip_addresses", + "public_ip_addresses", + "network", + "agent_id", + "location", + "country_id", + "verify_ssl_certificates", + "cluster_members", + "utilization", + "prefix", + "error_details", + "hostname", + "last_seen", + "created_date", + "interface_ip_mappings", + }, + 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: Dict) -> 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({ + "ipAddresses": obj.get("ipAddresses"), + "publicIpAddresses": obj.get("publicIpAddresses"), + "network": obj.get("network"), + "agentId": obj.get("agentId"), + "agentName": obj.get("agentName"), + "agentType": obj.get("agentType"), + "location": obj.get("location"), + "countryId": obj.get("countryId"), + "enabled": obj.get("enabled"), + "verifySslCertificates": obj.get("verifySslCertificates"), + "clusterMembers": [ClusterMember.from_dict(_item) for _item in obj.get("clusterMembers")] if obj.get("clusterMembers") is not None else None, + "utilization": obj.get("utilization"), + "accountGroups": [AccountGroup1.from_dict(_item) for _item in obj.get("accountGroups")] if obj.get("accountGroups") is not None else None, + "prefix": obj.get("prefix"), + "ipv6Policy": obj.get("ipv6Policy"), + "errorDetails": [ErrorDetail.from_dict(_item) for _item in obj.get("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.get("interfaceIpMappings")] if obj.get("interfaceIpMappings") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/enterprise_agent_ipv6_policy.py b/admin_api/admin_api/models/enterprise_agent_ipv6_policy.py new file mode 100644 index 00000000..c3693f09 --- /dev/null +++ b/admin_api/admin_api/models/enterprise_agent_ipv6_policy.py @@ -0,0 +1,46 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +import re # noqa: F401 +from enum import Enum + + + +try: + from typing import Self +except ImportError: + 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/admin_api/admin_api/models/enterprise_agent_state.py b/admin_api/admin_api/models/enterprise_agent_state.py new file mode 100644 index 00000000..eaa28aff --- /dev/null +++ b/admin_api/admin_api/models/enterprise_agent_state.py @@ -0,0 +1,46 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +import re # noqa: F401 +from enum import Enum + + + +try: + from typing import Self +except ImportError: + 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/admin_api/admin_api/models/enterprise_agents.py b/admin_api/admin_api/models/enterprise_agents.py new file mode 100644 index 00000000..dd7e467e --- /dev/null +++ b/admin_api/admin_api/models/enterprise_agents.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Administrative API + + ## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel +from admin_api.models.enterprise_agent import EnterpriseAgent +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class EnterpriseAgents(BaseModel): + """ + EnterpriseAgents + """ # noqa: E501 + agents: Optional[List[EnterpriseAgent]] = None + __properties: ClassVar[List[str]] = ["agents"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EnterpriseAgents from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of EnterpriseAgents from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agents": [EnterpriseAgent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/error.py b/admin_api/admin_api/models/error.py new file mode 100644 index 00000000..9b9d6032 --- /dev/null +++ b/admin_api/admin_api/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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import Field +try: + from typing import Self +except ImportError: + 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 = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> 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/admin_api/admin_api/models/error_detail.py b/admin_api/admin_api/models/error_detail.py new file mode 100644 index 00000000..02e1b323 --- /dev/null +++ b/admin_api/admin_api/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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictStr +from pydantic import Field +from admin_api.models.error_detail_code import ErrorDetailCode +try: + from typing import Self +except ImportError: + 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 = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "description", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> 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/admin_api/admin_api/models/error_detail_code.py b/admin_api/admin_api/models/error_detail_code.py new file mode 100644 index 00000000..96d5eef9 --- /dev/null +++ b/admin_api/admin_api/models/error_detail_code.py @@ -0,0 +1,51 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +import re # noqa: F401 +from enum import Enum + + + +try: + from typing import Self +except ImportError: + 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/admin_api/admin_api/models/expand.py b/admin_api/admin_api/models/expand.py new file mode 100644 index 00000000..ced69069 --- /dev/null +++ b/admin_api/admin_api/models/expand.py @@ -0,0 +1,45 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +import re # noqa: F401 +from enum import Enum + + + +try: + from typing import Self +except ImportError: + 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/admin_api/admin_api/models/extended_user.py b/admin_api/admin_api/models/extended_user.py new file mode 100644 index 00000000..d328c26d --- /dev/null +++ b/admin_api/admin_api/models/extended_user.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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictStr +from pydantic import Field +from admin_api.models.account_group1 import AccountGroup1 +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ExtendedUser(BaseModel): + """ + ExtendedUser + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="User's display name.") + email: Optional[StrictStr] = Field(default=None, description="User's email address.") + uid: Optional[StrictStr] = Field(default=None, description="Unique ID of the user.") + date_registered: Optional[datetime] = Field(default=None, description="UTC date the user registered their account (ISO date-time format).", alias="dateRegistered") + login_account_group: Optional[AccountGroup1] = Field(default=None, alias="loginAccountGroup") + last_login: Optional[datetime] = Field(default=None, description="UTC last login of the user (ISO date-time format).", alias="lastLogin") + __properties: ClassVar[List[str]] = ["name", "email", "uid", "dateRegistered", "loginAccountGroup", "lastLogin"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + 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: Dict) -> Self: + """Create an instance of ExtendedUser from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "email": obj.get("email"), + "uid": obj.get("uid"), + "dateRegistered": obj.get("dateRegistered"), + "loginAccountGroup": AccountGroup1.from_dict(obj.get("loginAccountGroup")) if obj.get("loginAccountGroup") is not None else None, + "lastLogin": obj.get("lastLogin") + }) + return _obj + + diff --git a/admin_api/admin_api/models/get_account_group200_response.py b/admin_api/admin_api/models/get_account_group200_response.py new file mode 100644 index 00000000..a0fccd80 --- /dev/null +++ b/admin_api/admin_api/models/get_account_group200_response.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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictBool, StrictStr +from pydantic import Field +from admin_api.models.enterprise_agent import EnterpriseAgent +from admin_api.models.self_links_links import SelfLinksLinks +from admin_api.models.user_account_group import UserAccountGroup +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetAccountGroup200Response(BaseModel): + """ + GetAccountGroup200Response + """ # noqa: E501 + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + account_group_name: Optional[StrictStr] = Field(default=None, description="Account group name", alias="accountGroupName") + is_current_account_group: Optional[StrictBool] = Field(default=None, description="Indicates whether the requested aid is the context of the current account.", alias="isCurrentAccountGroup") + is_default_account_group: Optional[StrictBool] = Field(default=None, description="Indicates whether the aid is the default one for the requesting user.", alias="isDefaultAccountGroup") + organization_name: Optional[StrictStr] = Field(default=None, description="(Optional) Indicates whether the aid is the default one for the requesting user.", alias="organizationName") + users: Optional[List[UserAccountGroup]] = None + agents: Optional[List[EnterpriseAgent]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["aid", "accountGroupName", "isCurrentAccountGroup", "isDefaultAccountGroup", "organizationName", "users", "agents", "_links"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of GetAccountGroup200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in users (list) + _items = [] + if self.users: + for _item in self.users: + if _item: + _items.append(_item.to_dict()) + _dict['users'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GetAccountGroup200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "aid": obj.get("aid"), + "accountGroupName": obj.get("accountGroupName"), + "isCurrentAccountGroup": obj.get("isCurrentAccountGroup"), + "isDefaultAccountGroup": obj.get("isDefaultAccountGroup"), + "organizationName": obj.get("organizationName"), + "users": [UserAccountGroup.from_dict(_item) for _item in obj.get("users")] if obj.get("users") is not None else None, + "agents": [EnterpriseAgent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/get_account_groups200_response.py b/admin_api/admin_api/models/get_account_groups200_response.py new file mode 100644 index 00000000..6a7cd961 --- /dev/null +++ b/admin_api/admin_api/models/get_account_groups200_response.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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel +from pydantic import Field +from admin_api.models.account_group import AccountGroup +from admin_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetAccountGroups200Response(BaseModel): + """ + GetAccountGroups200Response + """ # noqa: E501 + account_groups: Optional[List[AccountGroup]] = Field(default=None, alias="accountGroups") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["accountGroups", "_links"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of GetAccountGroups200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + 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: Dict) -> Self: + """Create an instance of GetAccountGroups200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "accountGroups": [AccountGroup.from_dict(_item) for _item in obj.get("accountGroups")] if obj.get("accountGroups") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/get_permissions200_response.py b/admin_api/admin_api/models/get_permissions200_response.py new file mode 100644 index 00000000..f127d472 --- /dev/null +++ b/admin_api/admin_api/models/get_permissions200_response.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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel +from pydantic import Field +from admin_api.models.permission import Permission +from admin_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetPermissions200Response(BaseModel): + """ + GetPermissions200Response + """ # noqa: E501 + permissions: Optional[List[Permission]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["permissions", "_links"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of GetPermissions200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + 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: Dict) -> Self: + """Create an instance of GetPermissions200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "permissions": [Permission.from_dict(_item) for _item in obj.get("permissions")] if obj.get("permissions") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/get_roles200_response.py b/admin_api/admin_api/models/get_roles200_response.py new file mode 100644 index 00000000..a9d92571 --- /dev/null +++ b/admin_api/admin_api/models/get_roles200_response.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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel +from pydantic import Field +from admin_api.models.role import Role +from admin_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetRoles200Response(BaseModel): + """ + GetRoles200Response + """ # noqa: E501 + roles: Optional[List[Role]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["roles", "_links"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of GetRoles200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + 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: Dict) -> Self: + """Create an instance of GetRoles200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "roles": [Role.from_dict(_item) for _item in obj.get("roles")] if obj.get("roles") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/get_user200_response.py b/admin_api/admin_api/models/get_user200_response.py new file mode 100644 index 00000000..1ebe120b --- /dev/null +++ b/admin_api/admin_api/models/get_user200_response.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + Administrative API + + ## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictStr +from pydantic import Field +from admin_api.models.account_group1 import AccountGroup1 +from admin_api.models.account_group_roles_account_group_roles_inner import AccountGroupRolesAccountGroupRolesInner +from admin_api.models.role import Role +from admin_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetUser200Response(BaseModel): + """ + GetUser200Response + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="User's display name.") + email: Optional[StrictStr] = Field(default=None, description="User's email address.") + uid: Optional[StrictStr] = Field(default=None, description="Unique ID of the user.") + date_registered: Optional[datetime] = Field(default=None, description="UTC date the user registered their account (ISO date-time format).", alias="dateRegistered") + login_account_group: Optional[AccountGroup1] = Field(default=None, alias="loginAccountGroup") + last_login: Optional[datetime] = Field(default=None, description="UTC last login of the user (ISO date-time format).", alias="lastLogin") + account_group_roles: Optional[List[AccountGroupRolesAccountGroupRolesInner]] = Field(default=None, alias="accountGroupRoles") + all_account_group_roles: Optional[List[Role]] = Field(default=None, alias="allAccountGroupRoles") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["name", "email", "uid", "dateRegistered", "loginAccountGroup", "lastLogin", "accountGroupRoles", "allAccountGroupRoles", "_links"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of GetUser200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + 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: Dict) -> Self: + """Create an instance of GetUser200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "email": obj.get("email"), + "uid": obj.get("uid"), + "dateRegistered": obj.get("dateRegistered"), + "loginAccountGroup": AccountGroup1.from_dict(obj.get("loginAccountGroup")) if obj.get("loginAccountGroup") is not None else None, + "lastLogin": obj.get("lastLogin"), + "accountGroupRoles": [AccountGroupRolesAccountGroupRolesInner.from_dict(_item) for _item in obj.get("accountGroupRoles")] if obj.get("accountGroupRoles") is not None else None, + "allAccountGroupRoles": [Role.from_dict(_item) for _item in obj.get("allAccountGroupRoles")] if obj.get("allAccountGroupRoles") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/get_user_events200_response.py b/admin_api/admin_api/models/get_user_events200_response.py new file mode 100644 index 00000000..1e99f719 --- /dev/null +++ b/admin_api/admin_api/models/get_user_events200_response.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Administrative API + + ## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel +from pydantic import Field +from admin_api.models.self_links_links import SelfLinksLinks +from admin_api.models.user_event import UserEvent +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetUserEvents200Response(BaseModel): + """ + GetUserEvents200Response + """ # noqa: E501 + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + audit_events: Optional[List[UserEvent]] = Field(default=None, alias="auditEvents") + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["startDate", "endDate", "auditEvents", "_links"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of GetUserEvents200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "start_date", + "end_date", + }, + 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: Dict) -> Self: + """Create an instance of GetUserEvents200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "auditEvents": [UserEvent.from_dict(_item) for _item in obj.get("auditEvents")] if obj.get("auditEvents") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/get_users200_response.py b/admin_api/admin_api/models/get_users200_response.py new file mode 100644 index 00000000..54ccecff --- /dev/null +++ b/admin_api/admin_api/models/get_users200_response.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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel +from pydantic import Field +from admin_api.models.extended_user import ExtendedUser +from admin_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GetUsers200Response(BaseModel): + """ + GetUsers200Response + """ # noqa: E501 + users: Optional[List[ExtendedUser]] = None + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["users", "_links"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of GetUsers200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + 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: Dict) -> Self: + """Create an instance of GetUsers200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "users": [ExtendedUser.from_dict(_item) for _item in obj.get("users")] if obj.get("users") is not None else None, + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/interface_ip_mapping.py b/admin_api/admin_api/models/interface_ip_mapping.py new file mode 100644 index 00000000..e3c1dab2 --- /dev/null +++ b/admin_api/admin_api/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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictStr +from pydantic import Field +try: + from typing import Self +except ImportError: + 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 = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "interface_name", + "ip_addresses", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> 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/admin_api/admin_api/models/link.py b/admin_api/admin_api/models/link.py new file mode 100644 index 00000000..0b108601 --- /dev/null +++ b/admin_api/admin_api/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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictBool, StrictStr +from pydantic import Field +try: + from typing import Self +except ImportError: + 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 = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> 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/admin_api/admin_api/models/login_account_group.py b/admin_api/admin_api/models/login_account_group.py new file mode 100644 index 00000000..a4d53783 --- /dev/null +++ b/admin_api/admin_api/models/login_account_group.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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel +from pydantic import Field +from admin_api.models.account_group1 import AccountGroup1 +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class LoginAccountGroup(BaseModel): + """ + LoginAccountGroup + """ # noqa: E501 + login_account_group: Optional[AccountGroup1] = Field(default=None, alias="loginAccountGroup") + __properties: ClassVar[List[str]] = ["loginAccountGroup"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of LoginAccountGroup from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + 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: Dict) -> Self: + """Create an instance of LoginAccountGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "loginAccountGroup": AccountGroup1.from_dict(obj.get("loginAccountGroup")) if obj.get("loginAccountGroup") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/new_account_group_response.py b/admin_api/admin_api/models/new_account_group_response.py new file mode 100644 index 00000000..2eb974d2 --- /dev/null +++ b/admin_api/admin_api/models/new_account_group_response.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Administrative API + + ## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictBool, StrictStr +from pydantic import Field +from admin_api.models.user_account_group import UserAccountGroup +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class NewAccountGroupResponse(BaseModel): + """ + NewAccountGroupResponse + """ # noqa: E501 + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + account_group_name: Optional[StrictStr] = Field(default=None, description="Account group name", alias="accountGroupName") + is_current_account_group: Optional[StrictBool] = Field(default=None, description="Indicates whether the requested aid is the context of the current account.", alias="isCurrentAccountGroup") + is_default_account_group: Optional[StrictBool] = Field(default=None, description="Indicates whether the aid is the default one for the requesting user.", alias="isDefaultAccountGroup") + organization_name: Optional[StrictStr] = Field(default=None, description="(Optional) Indicates whether the aid is the default one for the requesting user.", alias="organizationName") + users: Optional[List[UserAccountGroup]] = None + __properties: ClassVar[List[str]] = ["aid", "accountGroupName", "isCurrentAccountGroup", "isDefaultAccountGroup", "organizationName", "users"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of NewAccountGroupResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in users (list) + _items = [] + if self.users: + for _item in self.users: + if _item: + _items.append(_item.to_dict()) + _dict['users'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of NewAccountGroupResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "aid": obj.get("aid"), + "accountGroupName": obj.get("accountGroupName"), + "isCurrentAccountGroup": obj.get("isCurrentAccountGroup"), + "isDefaultAccountGroup": obj.get("isDefaultAccountGroup"), + "organizationName": obj.get("organizationName"), + "users": [UserAccountGroup.from_dict(_item) for _item in obj.get("users")] if obj.get("users") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/pagination_links.py b/admin_api/admin_api/models/pagination_links.py new file mode 100644 index 00000000..2c0bdbc0 --- /dev/null +++ b/admin_api/admin_api/models/pagination_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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel +from pydantic import Field +from admin_api.models.pagination_links_links import PaginationLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PaginationLinks(BaseModel): + """ + A links object containing pagination related link(s). + """ # noqa: E501 + links: Optional[PaginationLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["_links"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PaginationLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": PaginationLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/pagination_links_links.py b/admin_api/admin_api/models/pagination_links_links.py new file mode 100644 index 00000000..37221c29 --- /dev/null +++ b/admin_api/admin_api/models/pagination_links_links.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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel +from admin_api.models.link import Link +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class PaginationLinksLinks(BaseModel): + """ + PaginationLinksLinks + """ # noqa: E501 + previous: Optional[Link] = None + next: Optional[Link] = None + __properties: ClassVar[List[str]] = ["previous", "next"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of PaginationLinksLinks from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + 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() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of PaginationLinksLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "previous": Link.from_dict(obj.get("previous")) if obj.get("previous") is not None else None, + "next": Link.from_dict(obj.get("next")) if obj.get("next") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/permission.py b/admin_api/admin_api/models/permission.py new file mode 100644 index 00000000..cecb13de --- /dev/null +++ b/admin_api/admin_api/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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictBool, StrictStr +from pydantic import Field +try: + from typing import Self +except ImportError: + 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 = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> 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/admin_api/admin_api/models/permissions.py b/admin_api/admin_api/models/permissions.py new file mode 100644 index 00000000..0881fa2b --- /dev/null +++ b/admin_api/admin_api/models/permissions.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Administrative API + + ## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel +from admin_api.models.permission import Permission +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Permissions(BaseModel): + """ + Permissions + """ # noqa: E501 + permissions: Optional[List[Permission]] = None + __properties: ClassVar[List[str]] = ["permissions"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in permissions (list) + _items = [] + if self.permissions: + for _item in self.permissions: + if _item: + _items.append(_item.to_dict()) + _dict['permissions'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> 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.get("permissions")] if obj.get("permissions") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/query_window.py b/admin_api/admin_api/models/query_window.py new file mode 100644 index 00000000..94b87f5f --- /dev/null +++ b/admin_api/admin_api/models/query_window.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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class QueryWindow(BaseModel): + """ + QueryWindow + """ # noqa: E501 + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + __properties: ClassVar[List[str]] = ["startDate", "endDate"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of QueryWindow from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + "start_date", + "end_date", + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of QueryWindow from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate") + }) + return _obj + + diff --git a/admin_api/admin_api/models/role.py b/admin_api/admin_api/models/role.py new file mode 100644 index 00000000..0b17c30b --- /dev/null +++ b/admin_api/admin_api/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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictBool, StrictStr +from pydantic import Field +try: + from typing import Self +except ImportError: + 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 = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> 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/admin_api/admin_api/models/role_detail.py b/admin_api/admin_api/models/role_detail.py new file mode 100644 index 00000000..22d04588 --- /dev/null +++ b/admin_api/admin_api/models/role_detail.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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictBool, StrictStr +from pydantic import Field +from admin_api.models.permission import Permission +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class RoleDetail(BaseModel): + """ + RoleDetail + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Name of the role.") + role_id: Optional[StrictStr] = Field(default=None, description="Unique ID representing the role.", alias="roleId") + is_builtin: Optional[StrictBool] = Field(default=None, description="Flag indicating if the role is built-in (Account Admin, Organization Admin, Regular User).", alias="isBuiltin") + permissions: Optional[List[Permission]] = None + __properties: ClassVar[List[str]] = ["name", "roleId", "isBuiltin", "permissions"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in permissions (list) + _items = [] + if self.permissions: + for _item in self.permissions: + if _item: + _items.append(_item.to_dict()) + _dict['permissions'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> 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.get("permissions")] if obj.get("permissions") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/role_request_body.py b/admin_api/admin_api/models/role_request_body.py new file mode 100644 index 00000000..71458ad9 --- /dev/null +++ b/admin_api/admin_api/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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictStr +from pydantic import Field +try: + from typing import Self +except ImportError: + 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 = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> 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/admin_api/admin_api/models/roles.py b/admin_api/admin_api/models/roles.py new file mode 100644 index 00000000..19f6d8c8 --- /dev/null +++ b/admin_api/admin_api/models/roles.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Administrative API + + ## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel +from admin_api.models.role import Role +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Roles(BaseModel): + """ + Roles + """ # noqa: E501 + roles: Optional[List[Role]] = None + __properties: ClassVar[List[str]] = ["roles"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + 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: Dict) -> 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.get("roles")] if obj.get("roles") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/self_links.py b/admin_api/admin_api/models/self_links.py new file mode 100644 index 00000000..e0d58827 --- /dev/null +++ b/admin_api/admin_api/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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel +from pydantic import Field +from admin_api.models.self_links_links import SelfLinksLinks +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class SelfLinks(BaseModel): + """ + SelfLinks + """ # noqa: E501 + links: Optional[SelfLinksLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["_links"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of SelfLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/self_links_links.py b/admin_api/admin_api/models/self_links_links.py new file mode 100644 index 00000000..a01290b8 --- /dev/null +++ b/admin_api/admin_api/models/self_links_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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel +from pydantic import Field +from admin_api.models.link import Link +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class SelfLinksLinks(BaseModel): + """ + A links object containing the self link. + """ # noqa: E501 + var_self: Optional[Link] = Field(default=None, alias="self") + __properties: ClassVar[List[str]] = ["self"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SelfLinksLinks from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + 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: Dict) -> Self: + """Create an instance of SelfLinksLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "self": Link.from_dict(obj.get("self")) if obj.get("self") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/unauthorized_error.py b/admin_api/admin_api/models/unauthorized_error.py new file mode 100644 index 00000000..84e40ec7 --- /dev/null +++ b/admin_api/admin_api/models/unauthorized_error.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Administrative API + + ## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictStr +try: + from typing import Self +except ImportError: + 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 = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> 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/admin_api/admin_api/models/user.py b/admin_api/admin_api/models/user.py new file mode 100644 index 00000000..fa5749e5 --- /dev/null +++ b/admin_api/admin_api/models/user.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Administrative API + + ## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictStr +from pydantic import Field +from admin_api.models.account_group1 import AccountGroup1 +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class User(BaseModel): + """ + User + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="User's display name.") + email: Optional[StrictStr] = Field(default=None, description="User's email address.") + uid: Optional[StrictStr] = Field(default=None, description="Unique ID of the user.") + date_registered: Optional[datetime] = Field(default=None, description="UTC date the user registered their account (ISO date-time format).", alias="dateRegistered") + login_account_group: Optional[AccountGroup1] = Field(default=None, alias="loginAccountGroup") + __properties: ClassVar[List[str]] = ["name", "email", "uid", "dateRegistered", "loginAccountGroup"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + 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: Dict) -> Self: + """Create an instance of User from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "email": obj.get("email"), + "uid": obj.get("uid"), + "dateRegistered": obj.get("dateRegistered"), + "loginAccountGroup": AccountGroup1.from_dict(obj.get("loginAccountGroup")) if obj.get("loginAccountGroup") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/user_account_group.py b/admin_api/admin_api/models/user_account_group.py new file mode 100644 index 00000000..08b176ea --- /dev/null +++ b/admin_api/admin_api/models/user_account_group.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Administrative API + + ## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictStr +from pydantic import Field +from admin_api.models.role import Role +try: + from typing import Self +except ImportError: + 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 = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + 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: Dict) -> 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.get("roles")] if obj.get("roles") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/user_account_groups.py b/admin_api/admin_api/models/user_account_groups.py new file mode 100644 index 00000000..9ec895aa --- /dev/null +++ b/admin_api/admin_api/models/user_account_groups.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Administrative API + + ## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel +from admin_api.models.user_account_group import UserAccountGroup +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class UserAccountGroups(BaseModel): + """ + UserAccountGroups + """ # noqa: E501 + users: Optional[List[UserAccountGroup]] = None + __properties: ClassVar[List[str]] = ["users"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of UserAccountGroups from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in users (list) + _items = [] + if self.users: + for _item in self.users: + if _item: + _items.append(_item.to_dict()) + _dict['users'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of UserAccountGroups from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "users": [UserAccountGroup.from_dict(_item) for _item in obj.get("users")] if obj.get("users") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/user_detail.py b/admin_api/admin_api/models/user_detail.py new file mode 100644 index 00000000..a16660cf --- /dev/null +++ b/admin_api/admin_api/models/user_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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictStr +from pydantic import Field +from admin_api.models.account_group1 import AccountGroup1 +from admin_api.models.account_group_roles_account_group_roles_inner import AccountGroupRolesAccountGroupRolesInner +from admin_api.models.role import Role +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class UserDetail(BaseModel): + """ + UserDetail + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="User's display name.") + email: Optional[StrictStr] = Field(default=None, description="User's email address.") + uid: Optional[StrictStr] = Field(default=None, description="Unique ID of the user.") + date_registered: Optional[datetime] = Field(default=None, description="UTC date the user registered their account (ISO date-time format).", alias="dateRegistered") + login_account_group: Optional[AccountGroup1] = Field(default=None, alias="loginAccountGroup") + last_login: Optional[datetime] = Field(default=None, description="UTC last login of the user (ISO date-time format).", alias="lastLogin") + account_group_roles: Optional[List[AccountGroupRolesAccountGroupRolesInner]] = Field(default=None, alias="accountGroupRoles") + all_account_group_roles: Optional[List[Role]] = Field(default=None, alias="allAccountGroupRoles") + __properties: ClassVar[List[str]] = ["name", "email", "uid", "dateRegistered", "loginAccountGroup", "lastLogin", "accountGroupRoles", "allAccountGroupRoles"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of login_account_group + if self.login_account_group: + _dict['loginAccountGroup'] = self.login_account_group.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in account_group_roles (list) + _items = [] + if self.account_group_roles: + for _item in self.account_group_roles: + if _item: + _items.append(_item.to_dict()) + _dict['accountGroupRoles'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in all_account_group_roles (list) + _items = [] + if self.all_account_group_roles: + for _item in self.all_account_group_roles: + if _item: + _items.append(_item.to_dict()) + _dict['allAccountGroupRoles'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of UserDetail from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "email": obj.get("email"), + "uid": obj.get("uid"), + "dateRegistered": obj.get("dateRegistered"), + "loginAccountGroup": AccountGroup1.from_dict(obj.get("loginAccountGroup")) if obj.get("loginAccountGroup") is not None else None, + "lastLogin": obj.get("lastLogin"), + "accountGroupRoles": [AccountGroupRolesAccountGroupRolesInner.from_dict(_item) for _item in obj.get("accountGroupRoles")] if obj.get("accountGroupRoles") is not None else None, + "allAccountGroupRoles": [Role.from_dict(_item) for _item in obj.get("allAccountGroupRoles")] if obj.get("allAccountGroupRoles") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/user_event.py b/admin_api/admin_api/models/user_event.py new file mode 100644 index 00000000..9dc40065 --- /dev/null +++ b/admin_api/admin_api/models/user_event.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Administrative API + + ## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictStr +from pydantic import Field +from admin_api.models.user_event_all_of_resources_inner import UserEventAllOfResourcesInner +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class UserEvent(BaseModel): + """ + UserEvent + """ # noqa: E501 + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + account_group_name: Optional[StrictStr] = Field(default=None, description="Account group name", alias="accountGroupName") + var_date: Optional[datetime] = Field(default=None, description="UTC event date (ISO date-time format).", alias="date") + event: Optional[StrictStr] = Field(default=None, description="Event type.") + ip_address: Optional[StrictStr] = Field(default=None, description="Source IP address of the user.", alias="ipAddress") + uid: Optional[StrictStr] = Field(default=None, description="Unique id representing the user.") + user: Optional[StrictStr] = Field(default=None, description="The name and email address of the user.") + resources: Optional[List[UserEventAllOfResourcesInner]] = None + __properties: ClassVar[List[str]] = ["aid", "accountGroupName", "date", "event", "ipAddress", "uid", "user", "resources"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + 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: Dict) -> Self: + """Create an instance of UserEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "aid": obj.get("aid"), + "accountGroupName": obj.get("accountGroupName"), + "date": obj.get("date"), + "event": obj.get("event"), + "ipAddress": obj.get("ipAddress"), + "uid": obj.get("uid"), + "user": obj.get("user"), + "resources": [UserEventAllOfResourcesInner.from_dict(_item) for _item in obj.get("resources")] if obj.get("resources") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/user_event_all_of_resources_inner.py b/admin_api/admin_api/models/user_event_all_of_resources_inner.py new file mode 100644 index 00000000..bc4e2244 --- /dev/null +++ b/admin_api/admin_api/models/user_event_all_of_resources_inner.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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictStr +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class UserEventAllOfResourcesInner(BaseModel): + """ + UserEventAllOfResourcesInner + """ # noqa: E501 + type: Optional[StrictStr] = Field(default=None, description="Type of resource affected. Can be “testName”, “reportTitle”, “userDisplayName”, “alertRuleName”, etc.") + name: Optional[StrictStr] = Field(default=None, description="Name of the affected resource.") + __properties: ClassVar[List[str]] = ["type", "name"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of UserEventAllOfResourcesInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of UserEventAllOfResourcesInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "name": obj.get("name") + }) + return _obj + + diff --git a/admin_api/admin_api/models/user_events.py b/admin_api/admin_api/models/user_events.py new file mode 100644 index 00000000..0079c137 --- /dev/null +++ b/admin_api/admin_api/models/user_events.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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel +from pydantic import Field +from admin_api.models.user_event import UserEvent +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class UserEvents(BaseModel): + """ + UserEvents + """ # noqa: E501 + audit_events: Optional[List[UserEvent]] = Field(default=None, alias="auditEvents") + __properties: ClassVar[List[str]] = ["auditEvents"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of UserEvents from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in audit_events (list) + _items = [] + if self.audit_events: + for _item in self.audit_events: + if _item: + _items.append(_item.to_dict()) + _dict['auditEvents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of UserEvents from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "auditEvents": [UserEvent.from_dict(_item) for _item in obj.get("auditEvents")] if obj.get("auditEvents") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/models/user_request_body.py b/admin_api/admin_api/models/user_request_body.py new file mode 100644 index 00000000..04cf0d96 --- /dev/null +++ b/admin_api/admin_api/models/user_request_body.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. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictStr +from pydantic import Field +from admin_api.models.account_group_roles_request_body_inner import AccountGroupRolesRequestBodyInner +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class UserRequestBody(BaseModel): + """ + UserRequestBody + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="User's display name.") + email: Optional[StrictStr] = Field(default=None, description="User's email address.") + login_account_group_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the login account group.", alias="loginAccountGroupId") + account_group_roles: Optional[List[AccountGroupRolesRequestBodyInner]] = Field(default=None, alias="accountGroupRoles") + all_account_group_role_ids: Optional[List[StrictStr]] = Field(default=None, description="Unique IDs representing the roles.", alias="allAccountGroupRoleIds") + __properties: ClassVar[List[str]] = ["name", "email", "loginAccountGroupId", "accountGroupRoles", "allAccountGroupRoleIds"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of UserRequestBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + 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: Dict) -> Self: + """Create an instance of UserRequestBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "email": obj.get("email"), + "loginAccountGroupId": obj.get("loginAccountGroupId"), + "accountGroupRoles": [AccountGroupRolesRequestBodyInner.from_dict(_item) for _item in obj.get("accountGroupRoles")] if obj.get("accountGroupRoles") is not None else None, + "allAccountGroupRoleIds": obj.get("allAccountGroupRoleIds") + }) + return _obj + + diff --git a/admin_api/admin_api/models/users.py b/admin_api/admin_api/models/users.py new file mode 100644 index 00000000..deaaecc0 --- /dev/null +++ b/admin_api/admin_api/models/users.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Administrative API + + ## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. + + The version of the OpenAPI document: 7.0.0 + 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 typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel +from admin_api.models.extended_user import ExtendedUser +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Users(BaseModel): + """ + Users + """ # noqa: E501 + users: Optional[List[ExtendedUser]] = None + __properties: ClassVar[List[str]] = ["users"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> 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. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in users (list) + _items = [] + if self.users: + for _item in self.users: + if _item: + _items.append(_item.to_dict()) + _dict['users'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> 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.get("users")] if obj.get("users") is not None else None + }) + return _obj + + diff --git a/admin_api/admin_api/py.typed b/admin_api/admin_api/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/admin_api/admin_api/rest.py b/admin_api/admin_api/rest.py new file mode 100644 index 00000000..dc0c453a --- /dev/null +++ b/admin_api/admin_api/rest.py @@ -0,0 +1,231 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import io +import json +import re +import ssl + +import urllib3 + +from admin_api.exceptions import ApiException, ApiValueError + +RESTResponseType = urllib3.HTTPResponse + +class RESTResponse(io.IOBase): + + def __init__(self, resp) -> None: + self.response = resp + self.status = resp.status + self.reason = resp.reason + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.response.headers + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.response.headers.get(name, default) + + +class RESTClientObject: + + def __init__(self, configuration) -> None: + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) + + if configuration.retries is not None: + addition_pool_args['retries'] = configuration.retries + + if configuration.tls_server_name: + addition_pool_args['server_hostname'] = configuration.tls_server_name + + + if configuration.socket_options is not None: + addition_pool_args['socket_options'] = configuration.socket_options + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + cert_reqs=cert_reqs, + ca_certs=configuration.ssl_ca_cert, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + proxy_headers=configuration.proxy_headers, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + cert_reqs=cert_reqs, + ca_certs=configuration.ssl_ca_cert, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): + """Perform requests. + + :param method: http request method + :param url: http request url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, float)): + timeout = urllib3.Timeout(total=_request_timeout) + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): + timeout = urllib3.Timeout( + connect=_request_timeout[0], + read=_request_timeout[1] + ) + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + + # no content type provided or payload is json + content_type = headers.get('Content-Type') + if ( + not content_type + or re.search('json', content_type, re.IGNORECASE) + ): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, + url, + body=request_body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif content_type == 'application/x-www-form-urlencoded': + r = self.pool_manager.request( + method, + url, + fields=post_params, + encode_multipart=False, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif content_type == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, + url, + fields=post_params, + encode_multipart=True, + timeout=timeout, + headers=headers, + preload_content=False + ) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str) or isinstance(body, bytes): + request_body = body + r = self.pool_manager.request( + method, + url, + body=request_body, + timeout=timeout, + headers=headers, + preload_content=False + ) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False + ) + except urllib3.exceptions.SSLError as e: + msg = "\n".join([type(e).__name__, str(e)]) + raise ApiException(status=0, reason=msg) + + return RESTResponse(r) diff --git a/admin_api/docs/AccountGroup.md b/admin_api/docs/AccountGroup.md new file mode 100644 index 00000000..d6f9c450 --- /dev/null +++ b/admin_api/docs/AccountGroup.md @@ -0,0 +1,32 @@ +# AccountGroup + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**account_group_name** | **str** | Account group name | [optional] +**is_current_account_group** | **bool** | Indicates whether the requested aid is the context of the current account. | [optional] +**is_default_account_group** | **bool** | Indicates whether the aid is the default one for the requesting user. | [optional] +**organization_name** | **str** | (Optional) Indicates whether the aid is the default one for the requesting user. | [optional] + +## Example + +```python +from admin_api.models.account_group import AccountGroup + +# TODO update the JSON string below +json = "{}" +# create an instance of AccountGroup from a JSON string +account_group_instance = AccountGroup.from_json(json) +# print the JSON string representation of the object +print AccountGroup.to_json() + +# convert the object into a dict +account_group_dict = account_group_instance.to_dict() +# create an instance of AccountGroup from a dict +account_group_form_dict = account_group.from_dict(account_group_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/AccountGroup1.md b/admin_api/docs/AccountGroup1.md new file mode 100644 index 00000000..4d7e04c8 --- /dev/null +++ b/admin_api/docs/AccountGroup1.md @@ -0,0 +1,29 @@ +# AccountGroup1 + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**account_group_name** | **str** | Account group name | [optional] + +## Example + +```python +from admin_api.models.account_group1 import AccountGroup1 + +# TODO update the JSON string below +json = "{}" +# create an instance of AccountGroup1 from a JSON string +account_group1_instance = AccountGroup1.from_json(json) +# print the JSON string representation of the object +print AccountGroup1.to_json() + +# convert the object into a dict +account_group1_dict = account_group1_instance.to_dict() +# create an instance of AccountGroup1 from a dict +account_group1_form_dict = account_group1.from_dict(account_group1_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/AccountGroupDetail.md b/admin_api/docs/AccountGroupDetail.md new file mode 100644 index 00000000..ee3fbfa9 --- /dev/null +++ b/admin_api/docs/AccountGroupDetail.md @@ -0,0 +1,34 @@ +# AccountGroupDetail + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**account_group_name** | **str** | Account group name | [optional] +**is_current_account_group** | **bool** | Indicates whether the requested aid is the context of the current account. | [optional] +**is_default_account_group** | **bool** | Indicates whether the aid is the default one for the requesting user. | [optional] +**organization_name** | **str** | (Optional) Indicates whether the aid is the default one for the requesting user. | [optional] +**users** | [**List[UserAccountGroup]**](UserAccountGroup.md) | | [optional] +**agents** | [**List[EnterpriseAgent]**](EnterpriseAgent.md) | | [optional] + +## Example + +```python +from admin_api.models.account_group_detail import AccountGroupDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of AccountGroupDetail from a JSON string +account_group_detail_instance = AccountGroupDetail.from_json(json) +# print the JSON string representation of the object +print AccountGroupDetail.to_json() + +# convert the object into a dict +account_group_detail_dict = account_group_detail_instance.to_dict() +# create an instance of AccountGroupDetail from a dict +account_group_detail_form_dict = account_group_detail.from_dict(account_group_detail_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/AccountGroupId.md b/admin_api/docs/AccountGroupId.md new file mode 100644 index 00000000..172a3e78 --- /dev/null +++ b/admin_api/docs/AccountGroupId.md @@ -0,0 +1,28 @@ +# AccountGroupId + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] + +## Example + +```python +from admin_api.models.account_group_id import AccountGroupId + +# TODO update the JSON string below +json = "{}" +# create an instance of AccountGroupId from a JSON string +account_group_id_instance = AccountGroupId.from_json(json) +# print the JSON string representation of the object +print AccountGroupId.to_json() + +# convert the object into a dict +account_group_id_dict = account_group_id_instance.to_dict() +# create an instance of AccountGroupId from a dict +account_group_id_form_dict = account_group_id.from_dict(account_group_id_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/AccountGroupRequestBody.md b/admin_api/docs/AccountGroupRequestBody.md new file mode 100644 index 00000000..9708da44 --- /dev/null +++ b/admin_api/docs/AccountGroupRequestBody.md @@ -0,0 +1,29 @@ +# AccountGroupRequestBody + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_group_name** | **str** | The name of the account group | +**agents** | **List[str]** | 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. | [optional] + +## Example + +```python +from admin_api.models.account_group_request_body import AccountGroupRequestBody + +# TODO update the JSON string below +json = "{}" +# create an instance of AccountGroupRequestBody from a JSON string +account_group_request_body_instance = AccountGroupRequestBody.from_json(json) +# print the JSON string representation of the object +print AccountGroupRequestBody.to_json() + +# convert the object into a dict +account_group_request_body_dict = account_group_request_body_instance.to_dict() +# create an instance of AccountGroupRequestBody from a dict +account_group_request_body_form_dict = account_group_request_body.from_dict(account_group_request_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/AccountGroupRoles.md b/admin_api/docs/AccountGroupRoles.md new file mode 100644 index 00000000..8418839f --- /dev/null +++ b/admin_api/docs/AccountGroupRoles.md @@ -0,0 +1,28 @@ +# AccountGroupRoles + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_group_roles** | [**List[AccountGroupRolesAccountGroupRolesInner]**](AccountGroupRolesAccountGroupRolesInner.md) | | [optional] + +## Example + +```python +from admin_api.models.account_group_roles import AccountGroupRoles + +# TODO update the JSON string below +json = "{}" +# create an instance of AccountGroupRoles from a JSON string +account_group_roles_instance = AccountGroupRoles.from_json(json) +# print the JSON string representation of the object +print AccountGroupRoles.to_json() + +# convert the object into a dict +account_group_roles_dict = account_group_roles_instance.to_dict() +# create an instance of AccountGroupRoles from a dict +account_group_roles_form_dict = account_group_roles.from_dict(account_group_roles_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/AccountGroupRolesAccountGroupRolesInner.md b/admin_api/docs/AccountGroupRolesAccountGroupRolesInner.md new file mode 100644 index 00000000..d954ba17 --- /dev/null +++ b/admin_api/docs/AccountGroupRolesAccountGroupRolesInner.md @@ -0,0 +1,29 @@ +# AccountGroupRolesAccountGroupRolesInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_group** | [**AccountGroup1**](AccountGroup1.md) | | [optional] +**roles** | [**List[Role]**](Role.md) | | [optional] + +## Example + +```python +from admin_api.models.account_group_roles_account_group_roles_inner import AccountGroupRolesAccountGroupRolesInner + +# TODO update the JSON string below +json = "{}" +# create an instance of AccountGroupRolesAccountGroupRolesInner from a JSON string +account_group_roles_account_group_roles_inner_instance = AccountGroupRolesAccountGroupRolesInner.from_json(json) +# print the JSON string representation of the object +print AccountGroupRolesAccountGroupRolesInner.to_json() + +# convert the object into a dict +account_group_roles_account_group_roles_inner_dict = account_group_roles_account_group_roles_inner_instance.to_dict() +# create an instance of AccountGroupRolesAccountGroupRolesInner from a dict +account_group_roles_account_group_roles_inner_form_dict = account_group_roles_account_group_roles_inner.from_dict(account_group_roles_account_group_roles_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/AccountGroupRolesRequestBodyInner.md b/admin_api/docs/AccountGroupRolesRequestBodyInner.md new file mode 100644 index 00000000..c6da9612 --- /dev/null +++ b/admin_api/docs/AccountGroupRolesRequestBodyInner.md @@ -0,0 +1,29 @@ +# AccountGroupRolesRequestBodyInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_group_id** | **str** | Unique ID of the account group. | [optional] +**role_ids** | **List[str]** | Unique role IDs. | [optional] + +## Example + +```python +from admin_api.models.account_group_roles_request_body_inner import AccountGroupRolesRequestBodyInner + +# TODO update the JSON string below +json = "{}" +# create an instance of AccountGroupRolesRequestBodyInner from a JSON string +account_group_roles_request_body_inner_instance = AccountGroupRolesRequestBodyInner.from_json(json) +# print the JSON string representation of the object +print AccountGroupRolesRequestBodyInner.to_json() + +# convert the object into a dict +account_group_roles_request_body_inner_dict = account_group_roles_request_body_inner_instance.to_dict() +# create an instance of AccountGroupRolesRequestBodyInner from a dict +account_group_roles_request_body_inner_form_dict = account_group_roles_request_body_inner.from_dict(account_group_roles_request_body_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/AccountGroups.md b/admin_api/docs/AccountGroups.md new file mode 100644 index 00000000..719ebf92 --- /dev/null +++ b/admin_api/docs/AccountGroups.md @@ -0,0 +1,28 @@ +# AccountGroups + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_groups** | [**List[AccountGroup]**](AccountGroup.md) | | [optional] + +## Example + +```python +from admin_api.models.account_groups import AccountGroups + +# TODO update the JSON string below +json = "{}" +# create an instance of AccountGroups from a JSON string +account_groups_instance = AccountGroups.from_json(json) +# print the JSON string representation of the object +print AccountGroups.to_json() + +# convert the object into a dict +account_groups_dict = account_groups_instance.to_dict() +# create an instance of AccountGroups from a dict +account_groups_form_dict = account_groups.from_dict(account_groups_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/AccountGroupsApi.md b/admin_api/docs/AccountGroupsApi.md new file mode 100644 index 00000000..7e62d215 --- /dev/null +++ b/admin_api/docs/AccountGroupsApi.md @@ -0,0 +1,438 @@ +# admin_api.AccountGroupsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_account_group**](AccountGroupsApi.md#create_account_group) | **POST** /v7/account-groups | Create account group +[**delete_account_group**](AccountGroupsApi.md#delete_account_group) | **DELETE** /v7/account-groups/{id} | Delete account group +[**get_account_group**](AccountGroupsApi.md#get_account_group) | **GET** /v7/account-groups/{id} | Retrieve account group +[**get_account_groups**](AccountGroupsApi.md#get_account_groups) | **GET** /v7/account-groups | List account groups +[**update_account_group**](AccountGroupsApi.md#update_account_group) | **PUT** /v7/account-groups/{id} | Update account group + + +# **create_account_group** +> CreateAccountGroup201Response create_account_group(account_group_request_body, expand=expand) + +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. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import admin_api +from admin_api.models.account_group_request_body import AccountGroupRequestBody +from admin_api.models.create_account_group201_response import CreateAccountGroup201Response +from admin_api.models.expand import Expand +from admin_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = admin_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = admin_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with admin_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = admin_api.AccountGroupsApi(api_client) + account_group_request_body = admin_api.AccountGroupRequestBody() # AccountGroupRequestBody | + expand = [admin_api.Expand()] # List[Expand] | Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. (optional) + + try: + # Create account group + api_response = api_instance.create_account_group(account_group_request_body, expand=expand) + print("The response of AccountGroupsApi->create_account_group:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccountGroupsApi->create_account_group: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_group_request_body** | [**AccountGroupRequestBody**](AccountGroupRequestBody.md)| | + **expand** | [**List[Expand]**](Expand.md)| 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] + +### Return type + +[**CreateAccountGroup201Response**](CreateAccountGroup201Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_account_group** +> delete_account_group(id) + +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 + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import admin_api +from admin_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = admin_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = admin_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with admin_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = admin_api.AccountGroupsApi(api_client) + id = '2067' # str | Identifier for the account group. + + try: + # Delete account group + api_instance.delete_account_group(id) + except Exception as e: + print("Exception when calling AccountGroupsApi->delete_account_group: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Identifier for the account group. | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_account_group** +> GetAccountGroup200Response get_account_group(id, expand=expand) + +Retrieve account group + +Retrieves detailed information about an account group using its ID. This operation requires the `View all account groups settings` permission. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import admin_api +from admin_api.models.expand import Expand +from admin_api.models.get_account_group200_response import GetAccountGroup200Response +from admin_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = admin_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = admin_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with admin_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = admin_api.AccountGroupsApi(api_client) + id = '2067' # str | Identifier for the account group. + expand = [admin_api.Expand()] # List[Expand] | Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. (optional) + + try: + # Retrieve account group + api_response = api_instance.get_account_group(id, expand=expand) + print("The response of AccountGroupsApi->get_account_group:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccountGroupsApi->get_account_group: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Identifier for the account group. | + **expand** | [**List[Expand]**](Expand.md)| 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] + +### Return type + +[**GetAccountGroup200Response**](GetAccountGroup200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_account_groups** +> GetAccountGroups200Response get_account_groups(aid=aid) + +List account groups + +Retrieves a list of account groups available to the current user. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import admin_api +from admin_api.models.get_account_groups200_response import GetAccountGroups200Response +from admin_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = admin_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = admin_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with admin_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = admin_api.AccountGroupsApi(api_client) + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List account groups + api_response = api_instance.get_account_groups(aid=aid) + print("The response of AccountGroupsApi->get_account_groups:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccountGroupsApi->get_account_groups: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetAccountGroups200Response**](GetAccountGroups200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_account_group** +> GetAccountGroup200Response update_account_group(id, account_group_request_body, expand=expand) + +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. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import admin_api +from admin_api.models.account_group_request_body import AccountGroupRequestBody +from admin_api.models.expand import Expand +from admin_api.models.get_account_group200_response import GetAccountGroup200Response +from admin_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = admin_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = admin_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with admin_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = admin_api.AccountGroupsApi(api_client) + id = '2067' # str | Identifier for the account group. + account_group_request_body = admin_api.AccountGroupRequestBody() # AccountGroupRequestBody | + expand = [admin_api.Expand()] # List[Expand] | Optional parameter that specifies whether or not account group related resources should be expanded. By default, no expansion takes place if the query parameter is not passed. For example, to expand the `users` resource, pass the `?expand=user` query. (optional) + + try: + # Update account group + api_response = api_instance.update_account_group(id, account_group_request_body, expand=expand) + print("The response of AccountGroupsApi->update_account_group:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccountGroupsApi->update_account_group: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Identifier for the account group. | + **account_group_request_body** | [**AccountGroupRequestBody**](AccountGroupRequestBody.md)| | + **expand** | [**List[Expand]**](Expand.md)| 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] + +### Return type + +[**GetAccountGroup200Response**](GetAccountGroup200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/admin_api/docs/Agent.md b/admin_api/docs/Agent.md new file mode 100644 index 00000000..7a21d0f5 --- /dev/null +++ b/admin_api/docs/Agent.md @@ -0,0 +1,37 @@ +# Agent + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ip_addresses** | **List[str]** | Array of private IP addresses. | [optional] [readonly] +**public_ip_addresses** | **List[str]** | Array of public IP addresses. | [optional] [readonly] +**network** | **str** | Network (including ASN) of agent’s public IP. | [optional] [readonly] +**agent_id** | **str** | Unique ID of the agent. | [optional] [readonly] +**agent_name** | **str** | Name of the agent. | [optional] +**agent_type** | [**CloudEnterpriseAgentType**](CloudEnterpriseAgentType.md) | | [optional] +**location** | **str** | Location of the agent. | [optional] [readonly] +**country_id** | **str** | 2-digit ISO country code | [optional] [readonly] +**enabled** | **bool** | Flag indicating if the agent is enabled. | [optional] +**verify_ssl_certificates** | **bool** | Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests. | [optional] [readonly] + +## Example + +```python +from admin_api.models.agent import Agent + +# TODO update the JSON string below +json = "{}" +# create an instance of Agent from a JSON string +agent_instance = Agent.from_json(json) +# print the JSON string representation of the object +print Agent.to_json() + +# convert the object into a dict +agent_dict = agent_instance.to_dict() +# create an instance of Agent from a dict +agent_form_dict = agent.from_dict(agent_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/AgentBase.md b/admin_api/docs/AgentBase.md new file mode 100644 index 00000000..e7dfe60a --- /dev/null +++ b/admin_api/docs/AgentBase.md @@ -0,0 +1,30 @@ +# AgentBase + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ip_addresses** | **List[str]** | Array of private IP addresses. | [optional] [readonly] +**public_ip_addresses** | **List[str]** | Array of public IP addresses. | [optional] [readonly] +**network** | **str** | Network (including ASN) of agent’s public IP. | [optional] [readonly] + +## Example + +```python +from admin_api.models.agent_base import AgentBase + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentBase from a JSON string +agent_base_instance = AgentBase.from_json(json) +# print the JSON string representation of the object +print AgentBase.to_json() + +# convert the object into a dict +agent_base_dict = agent_base_instance.to_dict() +# create an instance of AgentBase from a dict +agent_base_form_dict = agent_base.from_dict(agent_base_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/AllAccountGroupRoles.md b/admin_api/docs/AllAccountGroupRoles.md new file mode 100644 index 00000000..0d457dc9 --- /dev/null +++ b/admin_api/docs/AllAccountGroupRoles.md @@ -0,0 +1,28 @@ +# AllAccountGroupRoles + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**all_account_group_roles** | [**List[Role]**](Role.md) | | [optional] + +## Example + +```python +from admin_api.models.all_account_group_roles import AllAccountGroupRoles + +# TODO update the JSON string below +json = "{}" +# create an instance of AllAccountGroupRoles from a JSON string +all_account_group_roles_instance = AllAccountGroupRoles.from_json(json) +# print the JSON string representation of the object +print AllAccountGroupRoles.to_json() + +# convert the object into a dict +all_account_group_roles_dict = all_account_group_roles_instance.to_dict() +# create an instance of AllAccountGroupRoles from a dict +all_account_group_roles_form_dict = all_account_group_roles.from_dict(all_account_group_roles_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/BaseRole.md b/admin_api/docs/BaseRole.md new file mode 100644 index 00000000..730e47b5 --- /dev/null +++ b/admin_api/docs/BaseRole.md @@ -0,0 +1,30 @@ +# BaseRole + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Name of the role. | [optional] +**role_id** | **str** | Unique ID representing the role. | [optional] +**is_builtin** | **bool** | Flag indicating if the role is built-in (Account Admin, Organization Admin, Regular User). | [optional] + +## Example + +```python +from admin_api.models.base_role import BaseRole + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseRole from a JSON string +base_role_instance = BaseRole.from_json(json) +# print the JSON string representation of the object +print BaseRole.to_json() + +# convert the object into a dict +base_role_dict = base_role_instance.to_dict() +# create an instance of BaseRole from a dict +base_role_form_dict = base_role.from_dict(base_role_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/CloudEnterpriseAgentType.md b/admin_api/docs/CloudEnterpriseAgentType.md new file mode 100644 index 00000000..951c803e --- /dev/null +++ b/admin_api/docs/CloudEnterpriseAgentType.md @@ -0,0 +1,11 @@ +# CloudEnterpriseAgentType + +Type of the agent. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/ClusterMember.md b/admin_api/docs/ClusterMember.md new file mode 100644 index 00000000..9ab70ee3 --- /dev/null +++ b/admin_api/docs/ClusterMember.md @@ -0,0 +1,37 @@ +# ClusterMember + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ip_addresses** | **List[str]** | Array of private IP addresses. | [optional] [readonly] +**public_ip_addresses** | **List[str]** | Array of public IP addresses. | [optional] [readonly] +**network** | **str** | Network (including ASN) of agent’s public IP. | [optional] [readonly] +**member_id** | **str** | Unique ID of the cluster member | [optional] [readonly] +**name** | **str** | Name of the cluster member | [optional] [readonly] +**error_details** | [**List[ErrorDetail]**](ErrorDetail.md) | If an enterprise agent or a cluster member presents at least one error, the errors will be shown as an array of entries in the errorDetails field (Enterprise Agents and Enterprise Cluster members only) | [optional] [readonly] +**last_seen** | **datetime** | UTC last seen date (ISO date-time format). | [optional] [readonly] +**agent_state** | [**EnterpriseAgentState**](EnterpriseAgentState.md) | | [optional] +**target_for_tests** | **str** | Test target IP address. | [optional] +**utilization** | **int** | Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only). | [optional] [readonly] + +## Example + +```python +from admin_api.models.cluster_member import ClusterMember + +# TODO update the JSON string below +json = "{}" +# create an instance of ClusterMember from a JSON string +cluster_member_instance = ClusterMember.from_json(json) +# print the JSON string representation of the object +print ClusterMember.to_json() + +# convert the object into a dict +cluster_member_dict = cluster_member_instance.to_dict() +# create an instance of ClusterMember from a dict +cluster_member_form_dict = cluster_member.from_dict(cluster_member_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/CreateAccountGroup201Response.md b/admin_api/docs/CreateAccountGroup201Response.md new file mode 100644 index 00000000..bba6db9c --- /dev/null +++ b/admin_api/docs/CreateAccountGroup201Response.md @@ -0,0 +1,34 @@ +# CreateAccountGroup201Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**account_group_name** | **str** | Account group name | [optional] +**is_current_account_group** | **bool** | Indicates whether the requested aid is the context of the current account. | [optional] +**is_default_account_group** | **bool** | Indicates whether the aid is the default one for the requesting user. | [optional] +**organization_name** | **str** | (Optional) Indicates whether the aid is the default one for the requesting user. | [optional] +**users** | [**List[UserAccountGroup]**](UserAccountGroup.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from admin_api.models.create_account_group201_response import CreateAccountGroup201Response + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateAccountGroup201Response from a JSON string +create_account_group201_response_instance = CreateAccountGroup201Response.from_json(json) +# print the JSON string representation of the object +print CreateAccountGroup201Response.to_json() + +# convert the object into a dict +create_account_group201_response_dict = create_account_group201_response_instance.to_dict() +# create an instance of CreateAccountGroup201Response from a dict +create_account_group201_response_form_dict = create_account_group201_response.from_dict(create_account_group201_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/CreateRole201Response.md b/admin_api/docs/CreateRole201Response.md new file mode 100644 index 00000000..2608ab99 --- /dev/null +++ b/admin_api/docs/CreateRole201Response.md @@ -0,0 +1,32 @@ +# CreateRole201Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Name of the role. | [optional] +**role_id** | **str** | Unique ID representing the role. | [optional] +**is_builtin** | **bool** | Flag indicating if the role is built-in (Account Admin, Organization Admin, Regular User). | [optional] +**permissions** | [**List[Permission]**](Permission.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from admin_api.models.create_role201_response import CreateRole201Response + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateRole201Response from a JSON string +create_role201_response_instance = CreateRole201Response.from_json(json) +# print the JSON string representation of the object +print CreateRole201Response.to_json() + +# convert the object into a dict +create_role201_response_dict = create_role201_response_instance.to_dict() +# create an instance of CreateRole201Response from a dict +create_role201_response_form_dict = create_role201_response.from_dict(create_role201_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/CreateUser201Response.md b/admin_api/docs/CreateUser201Response.md new file mode 100644 index 00000000..385c8a5c --- /dev/null +++ b/admin_api/docs/CreateUser201Response.md @@ -0,0 +1,35 @@ +# CreateUser201Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | User's display name. | [optional] +**email** | **str** | User's email address. | [optional] +**uid** | **str** | Unique ID of the user. | [optional] +**date_registered** | **datetime** | UTC date the user registered their account (ISO date-time format). | [optional] +**login_account_group** | [**AccountGroup1**](AccountGroup1.md) | | [optional] +**account_group_roles** | [**List[AccountGroupRolesAccountGroupRolesInner]**](AccountGroupRolesAccountGroupRolesInner.md) | | [optional] +**all_account_group_roles** | [**List[Role]**](Role.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from admin_api.models.create_user201_response import CreateUser201Response + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateUser201Response from a JSON string +create_user201_response_instance = CreateUser201Response.from_json(json) +# print the JSON string representation of the object +print CreateUser201Response.to_json() + +# convert the object into a dict +create_user201_response_dict = create_user201_response_instance.to_dict() +# create an instance of CreateUser201Response from a dict +create_user201_response_form_dict = create_user201_response.from_dict(create_user201_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/CreatedUser.md b/admin_api/docs/CreatedUser.md new file mode 100644 index 00000000..00486716 --- /dev/null +++ b/admin_api/docs/CreatedUser.md @@ -0,0 +1,34 @@ +# CreatedUser + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | User's display name. | [optional] +**email** | **str** | User's email address. | [optional] +**uid** | **str** | Unique ID of the user. | [optional] +**date_registered** | **datetime** | UTC date the user registered their account (ISO date-time format). | [optional] +**login_account_group** | [**AccountGroup1**](AccountGroup1.md) | | [optional] +**account_group_roles** | [**List[AccountGroupRolesAccountGroupRolesInner]**](AccountGroupRolesAccountGroupRolesInner.md) | | [optional] +**all_account_group_roles** | [**List[Role]**](Role.md) | | [optional] + +## Example + +```python +from admin_api.models.created_user import CreatedUser + +# TODO update the JSON string below +json = "{}" +# create an instance of CreatedUser from a JSON string +created_user_instance = CreatedUser.from_json(json) +# print the JSON string representation of the object +print CreatedUser.to_json() + +# convert the object into a dict +created_user_dict = created_user_instance.to_dict() +# create an instance of CreatedUser from a dict +created_user_form_dict = created_user.from_dict(created_user_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/EnterpriseAgent.md b/admin_api/docs/EnterpriseAgent.md new file mode 100644 index 00000000..60ac4e54 --- /dev/null +++ b/admin_api/docs/EnterpriseAgent.md @@ -0,0 +1,51 @@ +# EnterpriseAgent + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ip_addresses** | **List[str]** | Array of private IP addresses. | [optional] [readonly] +**public_ip_addresses** | **List[str]** | Array of public IP addresses. | [optional] [readonly] +**network** | **str** | Network (including ASN) of agent’s public IP. | [optional] [readonly] +**agent_id** | **str** | Unique ID of the agent. | [optional] [readonly] +**agent_name** | **str** | Name of the agent. | [optional] +**agent_type** | [**CloudEnterpriseAgentType**](CloudEnterpriseAgentType.md) | | [optional] +**location** | **str** | Location of the agent. | [optional] [readonly] +**country_id** | **str** | 2-digit ISO country code | [optional] [readonly] +**enabled** | **bool** | Flag indicating if the agent is enabled. | [optional] +**verify_ssl_certificates** | **bool** | Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests. | [optional] [readonly] +**cluster_members** | [**List[ClusterMember]**](ClusterMember.md) | 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. | [optional] [readonly] +**utilization** | **int** | Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only). | [optional] [readonly] +**account_groups** | [**List[AccountGroup1]**](AccountGroup1.md) | List of account groups. See /accounts-groups to pull a list of account IDs | [optional] +**prefix** | **str** | Prefix containing agents public IP address. | [optional] [readonly] +**ipv6_policy** | [**EnterpriseAgentIpv6Policy**](EnterpriseAgentIpv6Policy.md) | | [optional] +**error_details** | [**List[ErrorDetail]**](ErrorDetail.md) | If an enterprise agent or a cluster member presents at least one error, the errors will be shown as an array of entries in the errorDetails field (Enterprise Agents and Enterprise Cluster members only) | [optional] [readonly] +**hostname** | **str** | Fully qualified domain name of the agent (Enterprise Agents only) | [optional] [readonly] +**last_seen** | **datetime** | UTC last seen date (ISO date-time format). | [optional] [readonly] +**agent_state** | [**EnterpriseAgentState**](EnterpriseAgentState.md) | | [optional] +**keep_browser_cache** | **bool** | Flag indicating if the agent retains cache. | [optional] +**created_date** | **datetime** | UTC Agent creation date (ISO date-time format). | [optional] [readonly] +**target_for_tests** | **str** | Test target IP address. | [optional] +**local_resolution_prefixes** | **List[str]** | 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). | [optional] +**interface_ip_mappings** | [**List[InterfaceIpMapping]**](InterfaceIpMapping.md) | | [optional] [readonly] + +## Example + +```python +from admin_api.models.enterprise_agent import EnterpriseAgent + +# TODO update the JSON string below +json = "{}" +# create an instance of EnterpriseAgent from a JSON string +enterprise_agent_instance = EnterpriseAgent.from_json(json) +# print the JSON string representation of the object +print EnterpriseAgent.to_json() + +# convert the object into a dict +enterprise_agent_dict = enterprise_agent_instance.to_dict() +# create an instance of EnterpriseAgent from a dict +enterprise_agent_form_dict = enterprise_agent.from_dict(enterprise_agent_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/EnterpriseAgentIpv6Policy.md b/admin_api/docs/EnterpriseAgentIpv6Policy.md new file mode 100644 index 00000000..28e3b47f --- /dev/null +++ b/admin_api/docs/EnterpriseAgentIpv6Policy.md @@ -0,0 +1,11 @@ +# EnterpriseAgentIpv6Policy + +IP version policy, (Enterprise Agents and Enterprise Clusters only) + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/EnterpriseAgentState.md b/admin_api/docs/EnterpriseAgentState.md new file mode 100644 index 00000000..a9ec4b61 --- /dev/null +++ b/admin_api/docs/EnterpriseAgentState.md @@ -0,0 +1,11 @@ +# EnterpriseAgentState + +State of the agent. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/EnterpriseAgents.md b/admin_api/docs/EnterpriseAgents.md new file mode 100644 index 00000000..f384882c --- /dev/null +++ b/admin_api/docs/EnterpriseAgents.md @@ -0,0 +1,28 @@ +# EnterpriseAgents + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agents** | [**List[EnterpriseAgent]**](EnterpriseAgent.md) | | [optional] + +## Example + +```python +from admin_api.models.enterprise_agents import EnterpriseAgents + +# TODO update the JSON string below +json = "{}" +# create an instance of EnterpriseAgents from a JSON string +enterprise_agents_instance = EnterpriseAgents.from_json(json) +# print the JSON string representation of the object +print EnterpriseAgents.to_json() + +# convert the object into a dict +enterprise_agents_dict = enterprise_agents_instance.to_dict() +# create an instance of EnterpriseAgents from a dict +enterprise_agents_form_dict = enterprise_agents.from_dict(enterprise_agents_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/Error.md b/admin_api/docs/Error.md new file mode 100644 index 00000000..d22745ba --- /dev/null +++ b/admin_api/docs/Error.md @@ -0,0 +1,32 @@ +# Error + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\". | [optional] +**title** | **str** | A short, human-readable summary of the problem type. | [optional] +**status** | **int** | The HTTP status code generated by the origin server for this occurrence of the problem. | [optional] +**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**instance** | **str** | A URI reference that identifies the specific occurrence of the problem. | [optional] + +## Example + +```python +from admin_api.models.error import Error + +# TODO update the JSON string below +json = "{}" +# create an instance of Error from a JSON string +error_instance = Error.from_json(json) +# print the JSON string representation of the object +print Error.to_json() + +# convert the object into a dict +error_dict = error_instance.to_dict() +# create an instance of Error from a dict +error_form_dict = error.from_dict(error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/ErrorDetail.md b/admin_api/docs/ErrorDetail.md new file mode 100644 index 00000000..35587780 --- /dev/null +++ b/admin_api/docs/ErrorDetail.md @@ -0,0 +1,29 @@ +# ErrorDetail + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | [**ErrorDetailCode**](ErrorDetailCode.md) | | [optional] +**description** | **str** | Description for the agent error. | [optional] [readonly] + +## Example + +```python +from admin_api.models.error_detail import ErrorDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of ErrorDetail from a JSON string +error_detail_instance = ErrorDetail.from_json(json) +# print the JSON string representation of the object +print ErrorDetail.to_json() + +# convert the object into a dict +error_detail_dict = error_detail_instance.to_dict() +# create an instance of ErrorDetail from a dict +error_detail_form_dict = error_detail.from_dict(error_detail_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/ErrorDetailCode.md b/admin_api/docs/ErrorDetailCode.md new file mode 100644 index 00000000..c91277dc --- /dev/null +++ b/admin_api/docs/ErrorDetailCode.md @@ -0,0 +1,11 @@ +# ErrorDetailCode + +Code for the agent error. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/Expand.md b/admin_api/docs/Expand.md new file mode 100644 index 00000000..5d5b5ca2 --- /dev/null +++ b/admin_api/docs/Expand.md @@ -0,0 +1,10 @@ +# Expand + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/ExtendedUser.md b/admin_api/docs/ExtendedUser.md new file mode 100644 index 00000000..4fad69ce --- /dev/null +++ b/admin_api/docs/ExtendedUser.md @@ -0,0 +1,33 @@ +# ExtendedUser + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | User's display name. | [optional] +**email** | **str** | User's email address. | [optional] +**uid** | **str** | Unique ID of the user. | [optional] +**date_registered** | **datetime** | UTC date the user registered their account (ISO date-time format). | [optional] +**login_account_group** | [**AccountGroup1**](AccountGroup1.md) | | [optional] +**last_login** | **datetime** | UTC last login of the user (ISO date-time format). | [optional] + +## Example + +```python +from admin_api.models.extended_user import ExtendedUser + +# TODO update the JSON string below +json = "{}" +# create an instance of ExtendedUser from a JSON string +extended_user_instance = ExtendedUser.from_json(json) +# print the JSON string representation of the object +print ExtendedUser.to_json() + +# convert the object into a dict +extended_user_dict = extended_user_instance.to_dict() +# create an instance of ExtendedUser from a dict +extended_user_form_dict = extended_user.from_dict(extended_user_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/GetAccountGroup200Response.md b/admin_api/docs/GetAccountGroup200Response.md new file mode 100644 index 00000000..ce8b595d --- /dev/null +++ b/admin_api/docs/GetAccountGroup200Response.md @@ -0,0 +1,35 @@ +# GetAccountGroup200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**account_group_name** | **str** | Account group name | [optional] +**is_current_account_group** | **bool** | Indicates whether the requested aid is the context of the current account. | [optional] +**is_default_account_group** | **bool** | Indicates whether the aid is the default one for the requesting user. | [optional] +**organization_name** | **str** | (Optional) Indicates whether the aid is the default one for the requesting user. | [optional] +**users** | [**List[UserAccountGroup]**](UserAccountGroup.md) | | [optional] +**agents** | [**List[EnterpriseAgent]**](EnterpriseAgent.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from admin_api.models.get_account_group200_response import GetAccountGroup200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetAccountGroup200Response from a JSON string +get_account_group200_response_instance = GetAccountGroup200Response.from_json(json) +# print the JSON string representation of the object +print GetAccountGroup200Response.to_json() + +# convert the object into a dict +get_account_group200_response_dict = get_account_group200_response_instance.to_dict() +# create an instance of GetAccountGroup200Response from a dict +get_account_group200_response_form_dict = get_account_group200_response.from_dict(get_account_group200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/GetAccountGroups200Response.md b/admin_api/docs/GetAccountGroups200Response.md new file mode 100644 index 00000000..b0238f15 --- /dev/null +++ b/admin_api/docs/GetAccountGroups200Response.md @@ -0,0 +1,29 @@ +# GetAccountGroups200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_groups** | [**List[AccountGroup]**](AccountGroup.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from admin_api.models.get_account_groups200_response import GetAccountGroups200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetAccountGroups200Response from a JSON string +get_account_groups200_response_instance = GetAccountGroups200Response.from_json(json) +# print the JSON string representation of the object +print GetAccountGroups200Response.to_json() + +# convert the object into a dict +get_account_groups200_response_dict = get_account_groups200_response_instance.to_dict() +# create an instance of GetAccountGroups200Response from a dict +get_account_groups200_response_form_dict = get_account_groups200_response.from_dict(get_account_groups200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/GetPermissions200Response.md b/admin_api/docs/GetPermissions200Response.md new file mode 100644 index 00000000..f6538862 --- /dev/null +++ b/admin_api/docs/GetPermissions200Response.md @@ -0,0 +1,29 @@ +# GetPermissions200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**permissions** | [**List[Permission]**](Permission.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from admin_api.models.get_permissions200_response import GetPermissions200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetPermissions200Response from a JSON string +get_permissions200_response_instance = GetPermissions200Response.from_json(json) +# print the JSON string representation of the object +print GetPermissions200Response.to_json() + +# convert the object into a dict +get_permissions200_response_dict = get_permissions200_response_instance.to_dict() +# create an instance of GetPermissions200Response from a dict +get_permissions200_response_form_dict = get_permissions200_response.from_dict(get_permissions200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/GetRoles200Response.md b/admin_api/docs/GetRoles200Response.md new file mode 100644 index 00000000..1033d0f8 --- /dev/null +++ b/admin_api/docs/GetRoles200Response.md @@ -0,0 +1,29 @@ +# GetRoles200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**roles** | [**List[Role]**](Role.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from admin_api.models.get_roles200_response import GetRoles200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetRoles200Response from a JSON string +get_roles200_response_instance = GetRoles200Response.from_json(json) +# print the JSON string representation of the object +print GetRoles200Response.to_json() + +# convert the object into a dict +get_roles200_response_dict = get_roles200_response_instance.to_dict() +# create an instance of GetRoles200Response from a dict +get_roles200_response_form_dict = get_roles200_response.from_dict(get_roles200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/GetUser200Response.md b/admin_api/docs/GetUser200Response.md new file mode 100644 index 00000000..a7adce74 --- /dev/null +++ b/admin_api/docs/GetUser200Response.md @@ -0,0 +1,36 @@ +# GetUser200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | User's display name. | [optional] +**email** | **str** | User's email address. | [optional] +**uid** | **str** | Unique ID of the user. | [optional] +**date_registered** | **datetime** | UTC date the user registered their account (ISO date-time format). | [optional] +**login_account_group** | [**AccountGroup1**](AccountGroup1.md) | | [optional] +**last_login** | **datetime** | UTC last login of the user (ISO date-time format). | [optional] +**account_group_roles** | [**List[AccountGroupRolesAccountGroupRolesInner]**](AccountGroupRolesAccountGroupRolesInner.md) | | [optional] +**all_account_group_roles** | [**List[Role]**](Role.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from admin_api.models.get_user200_response import GetUser200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetUser200Response from a JSON string +get_user200_response_instance = GetUser200Response.from_json(json) +# print the JSON string representation of the object +print GetUser200Response.to_json() + +# convert the object into a dict +get_user200_response_dict = get_user200_response_instance.to_dict() +# create an instance of GetUser200Response from a dict +get_user200_response_form_dict = get_user200_response.from_dict(get_user200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/GetUserEvents200Response.md b/admin_api/docs/GetUserEvents200Response.md new file mode 100644 index 00000000..f52c0b36 --- /dev/null +++ b/admin_api/docs/GetUserEvents200Response.md @@ -0,0 +1,31 @@ +# GetUserEvents200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_date** | **datetime** | (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). | [optional] [readonly] +**end_date** | **datetime** | (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). | [optional] [readonly] +**audit_events** | [**List[UserEvent]**](UserEvent.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from admin_api.models.get_user_events200_response import GetUserEvents200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetUserEvents200Response from a JSON string +get_user_events200_response_instance = GetUserEvents200Response.from_json(json) +# print the JSON string representation of the object +print GetUserEvents200Response.to_json() + +# convert the object into a dict +get_user_events200_response_dict = get_user_events200_response_instance.to_dict() +# create an instance of GetUserEvents200Response from a dict +get_user_events200_response_form_dict = get_user_events200_response.from_dict(get_user_events200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/GetUsers200Response.md b/admin_api/docs/GetUsers200Response.md new file mode 100644 index 00000000..f124a6d1 --- /dev/null +++ b/admin_api/docs/GetUsers200Response.md @@ -0,0 +1,29 @@ +# GetUsers200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**users** | [**List[ExtendedUser]**](ExtendedUser.md) | | [optional] +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from admin_api.models.get_users200_response import GetUsers200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetUsers200Response from a JSON string +get_users200_response_instance = GetUsers200Response.from_json(json) +# print the JSON string representation of the object +print GetUsers200Response.to_json() + +# convert the object into a dict +get_users200_response_dict = get_users200_response_instance.to_dict() +# create an instance of GetUsers200Response from a dict +get_users200_response_form_dict = get_users200_response.from_dict(get_users200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/InterfaceIpMapping.md b/admin_api/docs/InterfaceIpMapping.md new file mode 100644 index 00000000..5fd3b486 --- /dev/null +++ b/admin_api/docs/InterfaceIpMapping.md @@ -0,0 +1,29 @@ +# InterfaceIpMapping + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interface_name** | **str** | Name of the mapping | [optional] [readonly] +**ip_addresses** | **List[str]** | Array of ipAddress entries | [optional] [readonly] + +## Example + +```python +from admin_api.models.interface_ip_mapping import InterfaceIpMapping + +# TODO update the JSON string below +json = "{}" +# create an instance of InterfaceIpMapping from a JSON string +interface_ip_mapping_instance = InterfaceIpMapping.from_json(json) +# print the JSON string representation of the object +print InterfaceIpMapping.to_json() + +# convert the object into a dict +interface_ip_mapping_dict = interface_ip_mapping_instance.to_dict() +# create an instance of InterfaceIpMapping from a dict +interface_ip_mapping_form_dict = interface_ip_mapping.from_dict(interface_ip_mapping_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/Link.md b/admin_api/docs/Link.md new file mode 100644 index 00000000..c63c2f38 --- /dev/null +++ b/admin_api/docs/Link.md @@ -0,0 +1,36 @@ +# Link + +A hyperlink from the containing resource to a URI. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | 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. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from admin_api.models.link import Link + +# TODO update the JSON string below +json = "{}" +# create an instance of Link from a JSON string +link_instance = Link.from_json(json) +# print the JSON string representation of the object +print Link.to_json() + +# convert the object into a dict +link_dict = link_instance.to_dict() +# create an instance of Link from a dict +link_form_dict = link.from_dict(link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/LoginAccountGroup.md b/admin_api/docs/LoginAccountGroup.md new file mode 100644 index 00000000..7cf18469 --- /dev/null +++ b/admin_api/docs/LoginAccountGroup.md @@ -0,0 +1,28 @@ +# LoginAccountGroup + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**login_account_group** | [**AccountGroup1**](AccountGroup1.md) | | [optional] + +## Example + +```python +from admin_api.models.login_account_group import LoginAccountGroup + +# TODO update the JSON string below +json = "{}" +# create an instance of LoginAccountGroup from a JSON string +login_account_group_instance = LoginAccountGroup.from_json(json) +# print the JSON string representation of the object +print LoginAccountGroup.to_json() + +# convert the object into a dict +login_account_group_dict = login_account_group_instance.to_dict() +# create an instance of LoginAccountGroup from a dict +login_account_group_form_dict = login_account_group.from_dict(login_account_group_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/NewAccountGroupResponse.md b/admin_api/docs/NewAccountGroupResponse.md new file mode 100644 index 00000000..a9b9f7a2 --- /dev/null +++ b/admin_api/docs/NewAccountGroupResponse.md @@ -0,0 +1,33 @@ +# NewAccountGroupResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**account_group_name** | **str** | Account group name | [optional] +**is_current_account_group** | **bool** | Indicates whether the requested aid is the context of the current account. | [optional] +**is_default_account_group** | **bool** | Indicates whether the aid is the default one for the requesting user. | [optional] +**organization_name** | **str** | (Optional) Indicates whether the aid is the default one for the requesting user. | [optional] +**users** | [**List[UserAccountGroup]**](UserAccountGroup.md) | | [optional] + +## Example + +```python +from admin_api.models.new_account_group_response import NewAccountGroupResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of NewAccountGroupResponse from a JSON string +new_account_group_response_instance = NewAccountGroupResponse.from_json(json) +# print the JSON string representation of the object +print NewAccountGroupResponse.to_json() + +# convert the object into a dict +new_account_group_response_dict = new_account_group_response_instance.to_dict() +# create an instance of NewAccountGroupResponse from a dict +new_account_group_response_form_dict = new_account_group_response.from_dict(new_account_group_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/PaginationLinks.md b/admin_api/docs/PaginationLinks.md new file mode 100644 index 00000000..3da3faa7 --- /dev/null +++ b/admin_api/docs/PaginationLinks.md @@ -0,0 +1,29 @@ +# PaginationLinks + +A links object containing pagination related link(s). + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**PaginationLinksLinks**](PaginationLinksLinks.md) | | [optional] + +## Example + +```python +from admin_api.models.pagination_links import PaginationLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of PaginationLinks from a JSON string +pagination_links_instance = PaginationLinks.from_json(json) +# print the JSON string representation of the object +print PaginationLinks.to_json() + +# convert the object into a dict +pagination_links_dict = pagination_links_instance.to_dict() +# create an instance of PaginationLinks from a dict +pagination_links_form_dict = pagination_links.from_dict(pagination_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/PaginationLinksLinks.md b/admin_api/docs/PaginationLinksLinks.md new file mode 100644 index 00000000..8099ec5c --- /dev/null +++ b/admin_api/docs/PaginationLinksLinks.md @@ -0,0 +1,29 @@ +# PaginationLinksLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**previous** | [**Link**](Link.md) | | [optional] +**next** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from admin_api.models.pagination_links_links import PaginationLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of PaginationLinksLinks from a JSON string +pagination_links_links_instance = PaginationLinksLinks.from_json(json) +# print the JSON string representation of the object +print PaginationLinksLinks.to_json() + +# convert the object into a dict +pagination_links_links_dict = pagination_links_links_instance.to_dict() +# create an instance of PaginationLinksLinks from a dict +pagination_links_links_form_dict = pagination_links_links.from_dict(pagination_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/Permission.md b/admin_api/docs/Permission.md new file mode 100644 index 00000000..d1eac038 --- /dev/null +++ b/admin_api/docs/Permission.md @@ -0,0 +1,31 @@ +# Permission + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **str** | Label corresponding to the permission. | [optional] +**permission_id** | **str** | Unique ID representing the permission. | [optional] +**is_management_permission** | **bool** | Flag indicating whether the permission is classified as a management permission. | [optional] +**permission** | **str** | Permission name | [optional] + +## Example + +```python +from admin_api.models.permission import Permission + +# TODO update the JSON string below +json = "{}" +# create an instance of Permission from a JSON string +permission_instance = Permission.from_json(json) +# print the JSON string representation of the object +print Permission.to_json() + +# convert the object into a dict +permission_dict = permission_instance.to_dict() +# create an instance of Permission from a dict +permission_form_dict = permission.from_dict(permission_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/Permissions.md b/admin_api/docs/Permissions.md new file mode 100644 index 00000000..8e5b0d5a --- /dev/null +++ b/admin_api/docs/Permissions.md @@ -0,0 +1,28 @@ +# Permissions + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**permissions** | [**List[Permission]**](Permission.md) | | [optional] + +## Example + +```python +from admin_api.models.permissions import Permissions + +# TODO update the JSON string below +json = "{}" +# create an instance of Permissions from a JSON string +permissions_instance = Permissions.from_json(json) +# print the JSON string representation of the object +print Permissions.to_json() + +# convert the object into a dict +permissions_dict = permissions_instance.to_dict() +# create an instance of Permissions from a dict +permissions_form_dict = permissions.from_dict(permissions_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/PermissionsApi.md b/admin_api/docs/PermissionsApi.md new file mode 100644 index 00000000..28b6381e --- /dev/null +++ b/admin_api/docs/PermissionsApi.md @@ -0,0 +1,92 @@ +# admin_api.PermissionsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_permissions**](PermissionsApi.md#get_permissions) | **GET** /v7/permissions | List assignable permissions + + +# **get_permissions** +> GetPermissions200Response get_permissions(aid=aid) + +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. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import admin_api +from admin_api.models.get_permissions200_response import GetPermissions200Response +from admin_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = admin_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = admin_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with admin_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = admin_api.PermissionsApi(api_client) + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List assignable permissions + api_response = api_instance.get_permissions(aid=aid) + print("The response of PermissionsApi->get_permissions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PermissionsApi->get_permissions: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetPermissions200Response**](GetPermissions200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/admin_api/docs/QueryWindow.md b/admin_api/docs/QueryWindow.md new file mode 100644 index 00000000..83d7cb41 --- /dev/null +++ b/admin_api/docs/QueryWindow.md @@ -0,0 +1,29 @@ +# QueryWindow + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_date** | **datetime** | (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). | [optional] [readonly] +**end_date** | **datetime** | (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). | [optional] [readonly] + +## Example + +```python +from admin_api.models.query_window import QueryWindow + +# TODO update the JSON string below +json = "{}" +# create an instance of QueryWindow from a JSON string +query_window_instance = QueryWindow.from_json(json) +# print the JSON string representation of the object +print QueryWindow.to_json() + +# convert the object into a dict +query_window_dict = query_window_instance.to_dict() +# create an instance of QueryWindow from a dict +query_window_form_dict = query_window.from_dict(query_window_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/Role.md b/admin_api/docs/Role.md new file mode 100644 index 00000000..b2153387 --- /dev/null +++ b/admin_api/docs/Role.md @@ -0,0 +1,31 @@ +# Role + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Name of the role. | [optional] +**role_id** | **str** | Unique ID representing the role. | [optional] +**is_builtin** | **bool** | Flag indicating if the role is built-in (Account Admin, Organization Admin, Regular User). | [optional] +**has_management_permissions** | **bool** | Flag indicating whether the user has management permissions. | [optional] + +## Example + +```python +from admin_api.models.role import Role + +# TODO update the JSON string below +json = "{}" +# create an instance of Role from a JSON string +role_instance = Role.from_json(json) +# print the JSON string representation of the object +print Role.to_json() + +# convert the object into a dict +role_dict = role_instance.to_dict() +# create an instance of Role from a dict +role_form_dict = role.from_dict(role_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/RoleDetail.md b/admin_api/docs/RoleDetail.md new file mode 100644 index 00000000..1de201c5 --- /dev/null +++ b/admin_api/docs/RoleDetail.md @@ -0,0 +1,31 @@ +# RoleDetail + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Name of the role. | [optional] +**role_id** | **str** | Unique ID representing the role. | [optional] +**is_builtin** | **bool** | Flag indicating if the role is built-in (Account Admin, Organization Admin, Regular User). | [optional] +**permissions** | [**List[Permission]**](Permission.md) | | [optional] + +## Example + +```python +from admin_api.models.role_detail import RoleDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of RoleDetail from a JSON string +role_detail_instance = RoleDetail.from_json(json) +# print the JSON string representation of the object +print RoleDetail.to_json() + +# convert the object into a dict +role_detail_dict = role_detail_instance.to_dict() +# create an instance of RoleDetail from a dict +role_detail_form_dict = role_detail.from_dict(role_detail_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/RoleRequestBody.md b/admin_api/docs/RoleRequestBody.md new file mode 100644 index 00000000..3de35512 --- /dev/null +++ b/admin_api/docs/RoleRequestBody.md @@ -0,0 +1,29 @@ +# RoleRequestBody + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Name of the role. | [optional] +**permissions** | **List[str]** | Contains list of test permission IDs (get `permissionId` from `/permissions` endpoint) | [optional] + +## Example + +```python +from admin_api.models.role_request_body import RoleRequestBody + +# TODO update the JSON string below +json = "{}" +# create an instance of RoleRequestBody from a JSON string +role_request_body_instance = RoleRequestBody.from_json(json) +# print the JSON string representation of the object +print RoleRequestBody.to_json() + +# convert the object into a dict +role_request_body_dict = role_request_body_instance.to_dict() +# create an instance of RoleRequestBody from a dict +role_request_body_form_dict = role_request_body.from_dict(role_request_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/Roles.md b/admin_api/docs/Roles.md new file mode 100644 index 00000000..37ca2905 --- /dev/null +++ b/admin_api/docs/Roles.md @@ -0,0 +1,28 @@ +# Roles + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**roles** | [**List[Role]**](Role.md) | | [optional] + +## Example + +```python +from admin_api.models.roles import Roles + +# TODO update the JSON string below +json = "{}" +# create an instance of Roles from a JSON string +roles_instance = Roles.from_json(json) +# print the JSON string representation of the object +print Roles.to_json() + +# convert the object into a dict +roles_dict = roles_instance.to_dict() +# create an instance of Roles from a dict +roles_form_dict = roles.from_dict(roles_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/RolesApi.md b/admin_api/docs/RolesApi.md new file mode 100644 index 00000000..31214417 --- /dev/null +++ b/admin_api/docs/RolesApi.md @@ -0,0 +1,437 @@ +# admin_api.RolesApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_role**](RolesApi.md#create_role) | **POST** /v7/roles | Create role +[**delete_role**](RolesApi.md#delete_role) | **DELETE** /v7/roles/{id} | Delete role +[**get_role**](RolesApi.md#get_role) | **GET** /v7/roles/{id} | Retrieve role +[**get_roles**](RolesApi.md#get_roles) | **GET** /v7/roles | List roles +[**update_role**](RolesApi.md#update_role) | **PUT** /v7/roles/{id} | Update role + + +# **create_role** +> CreateRole201Response create_role(role_request_body, aid=aid) + +Create role + +Creates a new role. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import admin_api +from admin_api.models.create_role201_response import CreateRole201Response +from admin_api.models.role_request_body import RoleRequestBody +from admin_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = admin_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = admin_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with admin_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = admin_api.RolesApi(api_client) + role_request_body = admin_api.RoleRequestBody() # RoleRequestBody | + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Create role + api_response = api_instance.create_role(role_request_body, aid=aid) + print("The response of RolesApi->create_role:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RolesApi->create_role: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **role_request_body** | [**RoleRequestBody**](RoleRequestBody.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**CreateRole201Response**](CreateRole201Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_role** +> delete_role(id, aid=aid) + +Delete role + +Deletes a role using its ID. The user needs appropriate permissions to successfully call this endpoint. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import admin_api +from admin_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = admin_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = admin_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with admin_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = admin_api.RolesApi(api_client) + id = '23' # str | The ID of the desired role. + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Delete role + api_instance.delete_role(id, aid=aid) + except Exception as e: + print("Exception when calling RolesApi->delete_role: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The ID of the desired role. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_role** +> CreateRole201Response get_role(id, aid=aid) + +Retrieve role + +Returns detailed information about a role using its ID. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import admin_api +from admin_api.models.create_role201_response import CreateRole201Response +from admin_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = admin_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = admin_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with admin_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = admin_api.RolesApi(api_client) + id = '23' # str | The ID of the desired role. + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Retrieve role + api_response = api_instance.get_role(id, aid=aid) + print("The response of RolesApi->get_role:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RolesApi->get_role: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The ID of the desired role. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**CreateRole201Response**](CreateRole201Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_roles** +> GetRoles200Response get_roles(aid=aid) + +List roles + +Retrieves a list of defined roles visible to the current user. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import admin_api +from admin_api.models.get_roles200_response import GetRoles200Response +from admin_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = admin_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = admin_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with admin_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = admin_api.RolesApi(api_client) + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List roles + api_response = api_instance.get_roles(aid=aid) + print("The response of RolesApi->get_roles:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RolesApi->get_roles: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetRoles200Response**](GetRoles200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_role** +> CreateRole201Response update_role(id, role_request_body, aid=aid) + +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. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import admin_api +from admin_api.models.create_role201_response import CreateRole201Response +from admin_api.models.role_request_body import RoleRequestBody +from admin_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = admin_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = admin_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with admin_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = admin_api.RolesApi(api_client) + id = '23' # str | The ID of the desired role. + role_request_body = admin_api.RoleRequestBody() # RoleRequestBody | + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Update role + api_response = api_instance.update_role(id, role_request_body, aid=aid) + print("The response of RolesApi->update_role:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RolesApi->update_role: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The ID of the desired role. | + **role_request_body** | [**RoleRequestBody**](RoleRequestBody.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**CreateRole201Response**](CreateRole201Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/admin_api/docs/SelfLinks.md b/admin_api/docs/SelfLinks.md new file mode 100644 index 00000000..726654ef --- /dev/null +++ b/admin_api/docs/SelfLinks.md @@ -0,0 +1,28 @@ +# SelfLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**SelfLinksLinks**](SelfLinksLinks.md) | | [optional] + +## Example + +```python +from admin_api.models.self_links import SelfLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinks from a JSON string +self_links_instance = SelfLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinks.to_json() + +# convert the object into a dict +self_links_dict = self_links_instance.to_dict() +# create an instance of SelfLinks from a dict +self_links_form_dict = self_links.from_dict(self_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/SelfLinksLinks.md b/admin_api/docs/SelfLinksLinks.md new file mode 100644 index 00000000..cd94f652 --- /dev/null +++ b/admin_api/docs/SelfLinksLinks.md @@ -0,0 +1,29 @@ +# SelfLinksLinks + +A links object containing the self link. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from admin_api.models.self_links_links import SelfLinksLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinksLinks from a JSON string +self_links_links_instance = SelfLinksLinks.from_json(json) +# print the JSON string representation of the object +print SelfLinksLinks.to_json() + +# convert the object into a dict +self_links_links_dict = self_links_links_instance.to_dict() +# create an instance of SelfLinksLinks from a dict +self_links_links_form_dict = self_links_links.from_dict(self_links_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/UnauthorizedError.md b/admin_api/docs/UnauthorizedError.md new file mode 100644 index 00000000..7ded01ea --- /dev/null +++ b/admin_api/docs/UnauthorizedError.md @@ -0,0 +1,29 @@ +# UnauthorizedError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | [optional] +**error_description** | **str** | | [optional] + +## Example + +```python +from admin_api.models.unauthorized_error import UnauthorizedError + +# TODO update the JSON string below +json = "{}" +# create an instance of UnauthorizedError from a JSON string +unauthorized_error_instance = UnauthorizedError.from_json(json) +# print the JSON string representation of the object +print UnauthorizedError.to_json() + +# convert the object into a dict +unauthorized_error_dict = unauthorized_error_instance.to_dict() +# create an instance of UnauthorizedError from a dict +unauthorized_error_form_dict = unauthorized_error.from_dict(unauthorized_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/User.md b/admin_api/docs/User.md new file mode 100644 index 00000000..6c0986f4 --- /dev/null +++ b/admin_api/docs/User.md @@ -0,0 +1,32 @@ +# User + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | User's display name. | [optional] +**email** | **str** | User's email address. | [optional] +**uid** | **str** | Unique ID of the user. | [optional] +**date_registered** | **datetime** | UTC date the user registered their account (ISO date-time format). | [optional] +**login_account_group** | [**AccountGroup1**](AccountGroup1.md) | | [optional] + +## Example + +```python +from admin_api.models.user import User + +# TODO update the JSON string below +json = "{}" +# create an instance of User from a JSON string +user_instance = User.from_json(json) +# print the JSON string representation of the object +print User.to_json() + +# convert the object into a dict +user_dict = user_instance.to_dict() +# create an instance of User from a dict +user_form_dict = user.from_dict(user_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/UserAccountGroup.md b/admin_api/docs/UserAccountGroup.md new file mode 100644 index 00000000..fe2dbc6e --- /dev/null +++ b/admin_api/docs/UserAccountGroup.md @@ -0,0 +1,33 @@ +# UserAccountGroup + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | User's display name. | [optional] +**email** | **str** | User's email address. | [optional] +**uid** | **str** | Unique ID representing the user. | [optional] +**last_login** | **datetime** | User's UTC last login date (ISO date-time format). | [optional] +**date_registered** | **datetime** | User's UTC registration date (ISO date-time format). | [optional] +**roles** | [**List[Role]**](Role.md) | | [optional] + +## Example + +```python +from admin_api.models.user_account_group import UserAccountGroup + +# TODO update the JSON string below +json = "{}" +# create an instance of UserAccountGroup from a JSON string +user_account_group_instance = UserAccountGroup.from_json(json) +# print the JSON string representation of the object +print UserAccountGroup.to_json() + +# convert the object into a dict +user_account_group_dict = user_account_group_instance.to_dict() +# create an instance of UserAccountGroup from a dict +user_account_group_form_dict = user_account_group.from_dict(user_account_group_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/UserAccountGroups.md b/admin_api/docs/UserAccountGroups.md new file mode 100644 index 00000000..9f004fd9 --- /dev/null +++ b/admin_api/docs/UserAccountGroups.md @@ -0,0 +1,28 @@ +# UserAccountGroups + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**users** | [**List[UserAccountGroup]**](UserAccountGroup.md) | | [optional] + +## Example + +```python +from admin_api.models.user_account_groups import UserAccountGroups + +# TODO update the JSON string below +json = "{}" +# create an instance of UserAccountGroups from a JSON string +user_account_groups_instance = UserAccountGroups.from_json(json) +# print the JSON string representation of the object +print UserAccountGroups.to_json() + +# convert the object into a dict +user_account_groups_dict = user_account_groups_instance.to_dict() +# create an instance of UserAccountGroups from a dict +user_account_groups_form_dict = user_account_groups.from_dict(user_account_groups_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/UserDetail.md b/admin_api/docs/UserDetail.md new file mode 100644 index 00000000..f8bf45da --- /dev/null +++ b/admin_api/docs/UserDetail.md @@ -0,0 +1,35 @@ +# UserDetail + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | User's display name. | [optional] +**email** | **str** | User's email address. | [optional] +**uid** | **str** | Unique ID of the user. | [optional] +**date_registered** | **datetime** | UTC date the user registered their account (ISO date-time format). | [optional] +**login_account_group** | [**AccountGroup1**](AccountGroup1.md) | | [optional] +**last_login** | **datetime** | UTC last login of the user (ISO date-time format). | [optional] +**account_group_roles** | [**List[AccountGroupRolesAccountGroupRolesInner]**](AccountGroupRolesAccountGroupRolesInner.md) | | [optional] +**all_account_group_roles** | [**List[Role]**](Role.md) | | [optional] + +## Example + +```python +from admin_api.models.user_detail import UserDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of UserDetail from a JSON string +user_detail_instance = UserDetail.from_json(json) +# print the JSON string representation of the object +print UserDetail.to_json() + +# convert the object into a dict +user_detail_dict = user_detail_instance.to_dict() +# create an instance of UserDetail from a dict +user_detail_form_dict = user_detail.from_dict(user_detail_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/UserEvent.md b/admin_api/docs/UserEvent.md new file mode 100644 index 00000000..a932cfd5 --- /dev/null +++ b/admin_api/docs/UserEvent.md @@ -0,0 +1,35 @@ +# UserEvent + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**account_group_name** | **str** | Account group name | [optional] +**var_date** | **datetime** | UTC event date (ISO date-time format). | [optional] +**event** | **str** | Event type. | [optional] +**ip_address** | **str** | Source IP address of the user. | [optional] +**uid** | **str** | Unique id representing the user. | [optional] +**user** | **str** | The name and email address of the user. | [optional] +**resources** | [**List[UserEventAllOfResourcesInner]**](UserEventAllOfResourcesInner.md) | | [optional] + +## Example + +```python +from admin_api.models.user_event import UserEvent + +# TODO update the JSON string below +json = "{}" +# create an instance of UserEvent from a JSON string +user_event_instance = UserEvent.from_json(json) +# print the JSON string representation of the object +print UserEvent.to_json() + +# convert the object into a dict +user_event_dict = user_event_instance.to_dict() +# create an instance of UserEvent from a dict +user_event_form_dict = user_event.from_dict(user_event_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/UserEventAllOfResourcesInner.md b/admin_api/docs/UserEventAllOfResourcesInner.md new file mode 100644 index 00000000..84a56475 --- /dev/null +++ b/admin_api/docs/UserEventAllOfResourcesInner.md @@ -0,0 +1,29 @@ +# UserEventAllOfResourcesInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | Type of resource affected. Can be “testName”, “reportTitle”, “userDisplayName”, “alertRuleName”, etc. | [optional] +**name** | **str** | Name of the affected resource. | [optional] + +## Example + +```python +from admin_api.models.user_event_all_of_resources_inner import UserEventAllOfResourcesInner + +# TODO update the JSON string below +json = "{}" +# create an instance of UserEventAllOfResourcesInner from a JSON string +user_event_all_of_resources_inner_instance = UserEventAllOfResourcesInner.from_json(json) +# print the JSON string representation of the object +print UserEventAllOfResourcesInner.to_json() + +# convert the object into a dict +user_event_all_of_resources_inner_dict = user_event_all_of_resources_inner_instance.to_dict() +# create an instance of UserEventAllOfResourcesInner from a dict +user_event_all_of_resources_inner_form_dict = user_event_all_of_resources_inner.from_dict(user_event_all_of_resources_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/UserEvents.md b/admin_api/docs/UserEvents.md new file mode 100644 index 00000000..8d95717a --- /dev/null +++ b/admin_api/docs/UserEvents.md @@ -0,0 +1,28 @@ +# UserEvents + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**audit_events** | [**List[UserEvent]**](UserEvent.md) | | [optional] + +## Example + +```python +from admin_api.models.user_events import UserEvents + +# TODO update the JSON string below +json = "{}" +# create an instance of UserEvents from a JSON string +user_events_instance = UserEvents.from_json(json) +# print the JSON string representation of the object +print UserEvents.to_json() + +# convert the object into a dict +user_events_dict = user_events_instance.to_dict() +# create an instance of UserEvents from a dict +user_events_form_dict = user_events.from_dict(user_events_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/UserEventsApi.md b/admin_api/docs/UserEventsApi.md new file mode 100644 index 00000000..744f81e4 --- /dev/null +++ b/admin_api/docs/UserEventsApi.md @@ -0,0 +1,100 @@ +# admin_api.UserEventsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_user_events**](UserEventsApi.md#get_user_events) | **GET** /v7/audit-user-events | List activity log events + + +# **get_user_events** +> GetUserEvents200Response get_user_events(aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + +List activity log events + +Returns a list of activity log events. Users with the `View activity log for all users in account group` permission can see all activity log events in the current account group. Users with the `View own activity log` permission can see their own activity log events in the current account group. For more information about changing the account group context, see [Account Context](https://developer.thousandeyes.com/v7/#/accountcontext). + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import admin_api +from admin_api.models.get_user_events200_response import GetUserEvents200Response +from admin_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = admin_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = admin_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with admin_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = admin_api.UserEventsApi(api_client) + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + 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) + start_date = '2022-07-17T22:00:54Z' # datetime | 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`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | 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`. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. (optional) + + try: + # List activity log events + api_response = api_instance.get_user_events(aid=aid, window=window, start_date=start_date, end_date=end_date, cursor=cursor) + print("The response of UserEventsApi->get_user_events:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UserEventsApi->get_user_events: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + **window** | **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] + **start_date** | **datetime**| 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`. | [optional] + **end_date** | **datetime**| 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`. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `_links` instead of this parameter. | [optional] + +### Return type + +[**GetUserEvents200Response**](GetUserEvents200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/admin_api/docs/UserRequestBody.md b/admin_api/docs/UserRequestBody.md new file mode 100644 index 00000000..98c305f6 --- /dev/null +++ b/admin_api/docs/UserRequestBody.md @@ -0,0 +1,32 @@ +# UserRequestBody + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | User's display name. | [optional] +**email** | **str** | User's email address. | [optional] +**login_account_group_id** | **str** | Unique ID of the login account group. | [optional] +**account_group_roles** | [**List[AccountGroupRolesRequestBodyInner]**](AccountGroupRolesRequestBodyInner.md) | | [optional] +**all_account_group_role_ids** | **List[str]** | Unique IDs representing the roles. | [optional] + +## Example + +```python +from admin_api.models.user_request_body import UserRequestBody + +# TODO update the JSON string below +json = "{}" +# create an instance of UserRequestBody from a JSON string +user_request_body_instance = UserRequestBody.from_json(json) +# print the JSON string representation of the object +print UserRequestBody.to_json() + +# convert the object into a dict +user_request_body_dict = user_request_body_instance.to_dict() +# create an instance of UserRequestBody from a dict +user_request_body_form_dict = user_request_body.from_dict(user_request_body_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/Users.md b/admin_api/docs/Users.md new file mode 100644 index 00000000..0dc1bb1c --- /dev/null +++ b/admin_api/docs/Users.md @@ -0,0 +1,28 @@ +# Users + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**users** | [**List[ExtendedUser]**](ExtendedUser.md) | | [optional] + +## Example + +```python +from admin_api.models.users import Users + +# TODO update the JSON string below +json = "{}" +# create an instance of Users from a JSON string +users_instance = Users.from_json(json) +# print the JSON string representation of the object +print Users.to_json() + +# convert the object into a dict +users_dict = users_instance.to_dict() +# create an instance of Users from a dict +users_form_dict = users.from_dict(users_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/admin_api/docs/UsersApi.md b/admin_api/docs/UsersApi.md new file mode 100644 index 00000000..34e152bd --- /dev/null +++ b/admin_api/docs/UsersApi.md @@ -0,0 +1,437 @@ +# admin_api.UsersApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_user**](UsersApi.md#create_user) | **POST** /v7/users | Create user +[**delete_user**](UsersApi.md#delete_user) | **DELETE** /v7/users/{id} | Delete user +[**get_user**](UsersApi.md#get_user) | **GET** /v7/users/{id} | Retrieve user +[**get_users**](UsersApi.md#get_users) | **GET** /v7/users | List users +[**update_user**](UsersApi.md#update_user) | **PUT** /v7/users/{id} | Update user + + +# **create_user** +> CreateUser201Response create_user(user_request_body, aid=aid) + +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. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import admin_api +from admin_api.models.create_user201_response import CreateUser201Response +from admin_api.models.user_request_body import UserRequestBody +from admin_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = admin_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = admin_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with admin_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = admin_api.UsersApi(api_client) + user_request_body = admin_api.UserRequestBody() # UserRequestBody | + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Create user + api_response = api_instance.create_user(user_request_body, aid=aid) + print("The response of UsersApi->create_user:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UsersApi->create_user: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_request_body** | [**UserRequestBody**](UserRequestBody.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**CreateUser201Response**](CreateUser201Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | * Location -
| +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_user** +> delete_user(id, aid=aid) + +Delete user + +Deletes a user using the user ID. This endpoint requires the `Edit users in all account groups` or `Edit users` permission. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import admin_api +from admin_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = admin_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = admin_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with admin_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = admin_api.UsersApi(api_client) + id = '1884' # str | Identifer for the user. + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Delete user + api_instance.delete_user(id, aid=aid) + except Exception as e: + print("Exception when calling UsersApi->delete_user: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Identifer for the user. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No content | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_user** +> GetUser200Response get_user(id, aid=aid) + +Retrieve user + +Retrieves detailed information about a user. This operation requires the `API Access` and `View All Users` permissions. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import admin_api +from admin_api.models.get_user200_response import GetUser200Response +from admin_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = admin_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = admin_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with admin_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = admin_api.UsersApi(api_client) + id = '1884' # str | Identifer for the user. + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Retrieve user + api_response = api_instance.get_user(id, aid=aid) + print("The response of UsersApi->get_user:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UsersApi->get_user: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Identifer for the user. | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetUser200Response**](GetUser200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_users** +> GetUsers200Response get_users(aid=aid) + +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. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import admin_api +from admin_api.models.get_users200_response import GetUsers200Response +from admin_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = admin_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = admin_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with admin_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = admin_api.UsersApi(api_client) + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List users + api_response = api_instance.get_users(aid=aid) + print("The response of UsersApi->get_users:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UsersApi->get_users: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetUsers200Response**](GetUsers200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_user** +> GetUser200Response update_user(id, user_request_body, aid=aid) + +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. + +### Example + +* Bearer Authentication (BearerAuth): +```python +import time +import os +import admin_api +from admin_api.models.get_user200_response import GetUser200Response +from admin_api.models.user_request_body import UserRequestBody +from admin_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com +# See configuration.py for a list of all supported configuration parameters. +configuration = admin_api.Configuration( + host = "https://api.thousandeyes.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = admin_api.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with admin_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = admin_api.UsersApi(api_client) + id = '1884' # str | Identifer for the user. + user_request_body = admin_api.UserRequestBody() # UserRequestBody | + aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Update user + api_response = api_instance.update_user(id, user_request_body, aid=aid) + print("The response of UsersApi->update_user:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UsersApi->update_user: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Identifer for the user. | + **user_request_body** | [**UserRequestBody**](UserRequestBody.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**GetUser200Response**](GetUser200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/hal+json, application/problem+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/admin_api/git_push.sh b/admin_api/git_push.sh new file mode 100644 index 00000000..6faad0b0 --- /dev/null +++ b/admin_api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="thousandeyes" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="thousandeyes-python-sdk" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/admin_api/pyproject.toml b/admin_api/pyproject.toml new file mode 100644 index 00000000..a3b147b9 --- /dev/null +++ b/admin_api/pyproject.toml @@ -0,0 +1,30 @@ +[tool.poetry] +name = "admin_api" +version = "1.0.0" +description = "Administrative API" +authors = ["OpenAPI Generator Community "] +license = "NoLicense" +readme = "README.md" +repository = "https://github.com/thousandeyes/thousandeyes-python-sdk" +keywords = ["OpenAPI", "OpenAPI-Generator", "Administrative API"] +include = ["admin_api/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" diff --git a/admin_api/requirements.txt b/admin_api/requirements.txt new file mode 100644 index 00000000..cc85509e --- /dev/null +++ b/admin_api/requirements.txt @@ -0,0 +1,5 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/admin_api/setup.cfg b/admin_api/setup.cfg new file mode 100644 index 00000000..11433ee8 --- /dev/null +++ b/admin_api/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/admin_api/setup.py b/admin_api/setup.py new file mode 100644 index 00000000..22a607f0 --- /dev/null +++ b/admin_api/setup.py @@ -0,0 +1,49 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "admin-api" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">=3.7" +REQUIRES = [ + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="Administrative API", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="https://github.com/thousandeyes/thousandeyes-python-sdk", + keywords=["OpenAPI", "OpenAPI-Generator", "Administrative API"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + ## 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. + """, # noqa: E501 + package_data={"admin_api": ["py.typed"]}, +) diff --git a/admin_api/test-requirements.txt b/admin_api/test-requirements.txt new file mode 100644 index 00000000..3a0d0b93 --- /dev/null +++ b/admin_api/test-requirements.txt @@ -0,0 +1,3 @@ +pytest~=7.1.3 +pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 diff --git a/admin_api/test/__init__.py b/admin_api/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/admin_api/test/test_account_group.py b/admin_api/test/test_account_group.py new file mode 100644 index 00000000..f7775a4f --- /dev/null +++ b/admin_api/test/test_account_group.py @@ -0,0 +1,56 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.account_group import AccountGroup + +class TestAccountGroup(unittest.TestCase): + """AccountGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AccountGroup: + """Test AccountGroup + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AccountGroup` + """ + model = AccountGroup() + if include_optional: + return AccountGroup( + aid = '11', + account_group_name = 'Account A', + is_current_account_group = True, + is_default_account_group = True, + organization_name = '' + ) + else: + return AccountGroup( + ) + """ + + def testAccountGroup(self): + """Test AccountGroup""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_account_group1.py b/admin_api/test/test_account_group1.py new file mode 100644 index 00000000..082ef38a --- /dev/null +++ b/admin_api/test/test_account_group1.py @@ -0,0 +1,53 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.account_group1 import AccountGroup1 + +class TestAccountGroup1(unittest.TestCase): + """AccountGroup1 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AccountGroup1: + """Test AccountGroup1 + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AccountGroup1` + """ + model = AccountGroup1() + if include_optional: + return AccountGroup1( + aid = '11', + account_group_name = 'Account A' + ) + else: + return AccountGroup1( + ) + """ + + def testAccountGroup1(self): + """Test AccountGroup1""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_account_group_detail.py b/admin_api/test/test_account_group_detail.py new file mode 100644 index 00000000..a08a7f9e --- /dev/null +++ b/admin_api/test/test_account_group_detail.py @@ -0,0 +1,70 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.account_group_detail import AccountGroupDetail + +class TestAccountGroupDetail(unittest.TestCase): + """AccountGroupDetail unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AccountGroupDetail: + """Test AccountGroupDetail + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AccountGroupDetail` + """ + model = AccountGroupDetail() + if include_optional: + return AccountGroupDetail( + aid = '11', + account_group_name = 'Account A', + is_current_account_group = True, + is_default_account_group = True, + organization_name = '', + users = [ + admin_api.models.user_account_group.UserAccountGroup( + name = 'User X', + email = 'userx@thousandeyes.com', + uid = '235', + last_login = '2022-07-17T22:00:54Z', + date_registered = '2022-07-17T22:00:54Z', + roles = [ + admin_api.models.role.Role() + ], ) + ], + agents = [ + null + ] + ) + else: + return AccountGroupDetail( + ) + """ + + def testAccountGroupDetail(self): + """Test AccountGroupDetail""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_account_group_id.py b/admin_api/test/test_account_group_id.py new file mode 100644 index 00000000..15127387 --- /dev/null +++ b/admin_api/test/test_account_group_id.py @@ -0,0 +1,52 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.account_group_id import AccountGroupId + +class TestAccountGroupId(unittest.TestCase): + """AccountGroupId unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AccountGroupId: + """Test AccountGroupId + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AccountGroupId` + """ + model = AccountGroupId() + if include_optional: + return AccountGroupId( + aid = '11' + ) + else: + return AccountGroupId( + ) + """ + + def testAccountGroupId(self): + """Test AccountGroupId""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_account_group_request_body.py b/admin_api/test/test_account_group_request_body.py new file mode 100644 index 00000000..788a6c48 --- /dev/null +++ b/admin_api/test/test_account_group_request_body.py @@ -0,0 +1,54 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.account_group_request_body import AccountGroupRequestBody + +class TestAccountGroupRequestBody(unittest.TestCase): + """AccountGroupRequestBody unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AccountGroupRequestBody: + """Test AccountGroupRequestBody + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AccountGroupRequestBody` + """ + model = AccountGroupRequestBody() + if include_optional: + return AccountGroupRequestBody( + account_group_name = 'My testing account group', + agents = ["105","719"] + ) + else: + return AccountGroupRequestBody( + account_group_name = 'My testing account group', + ) + """ + + def testAccountGroupRequestBody(self): + """Test AccountGroupRequestBody""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_account_group_roles.py b/admin_api/test/test_account_group_roles.py new file mode 100644 index 00000000..d3e74311 --- /dev/null +++ b/admin_api/test/test_account_group_roles.py @@ -0,0 +1,58 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.account_group_roles import AccountGroupRoles + +class TestAccountGroupRoles(unittest.TestCase): + """AccountGroupRoles unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AccountGroupRoles: + """Test AccountGroupRoles + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AccountGroupRoles` + """ + model = AccountGroupRoles() + if include_optional: + return AccountGroupRoles( + account_group_roles = [ + admin_api.models.account_group_roles_account_group_roles_inner.AccountGroupRoles_accountGroupRoles_inner( + account_group = admin_api.models.account_group_1.AccountGroup_1(), + roles = [ + admin_api.models.role.Role() + ], ) + ] + ) + else: + return AccountGroupRoles( + ) + """ + + def testAccountGroupRoles(self): + """Test AccountGroupRoles""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_account_group_roles_account_group_roles_inner.py b/admin_api/test/test_account_group_roles_account_group_roles_inner.py new file mode 100644 index 00000000..f927f236 --- /dev/null +++ b/admin_api/test/test_account_group_roles_account_group_roles_inner.py @@ -0,0 +1,55 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.account_group_roles_account_group_roles_inner import AccountGroupRolesAccountGroupRolesInner + +class TestAccountGroupRolesAccountGroupRolesInner(unittest.TestCase): + """AccountGroupRolesAccountGroupRolesInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AccountGroupRolesAccountGroupRolesInner: + """Test AccountGroupRolesAccountGroupRolesInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AccountGroupRolesAccountGroupRolesInner` + """ + model = AccountGroupRolesAccountGroupRolesInner() + if include_optional: + return AccountGroupRolesAccountGroupRolesInner( + account_group = admin_api.models.account_group_1.AccountGroup_1(), + roles = [ + admin_api.models.role.Role() + ] + ) + else: + return AccountGroupRolesAccountGroupRolesInner( + ) + """ + + def testAccountGroupRolesAccountGroupRolesInner(self): + """Test AccountGroupRolesAccountGroupRolesInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_account_group_roles_request_body_inner.py b/admin_api/test/test_account_group_roles_request_body_inner.py new file mode 100644 index 00000000..f35f0e3c --- /dev/null +++ b/admin_api/test/test_account_group_roles_request_body_inner.py @@ -0,0 +1,53 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.account_group_roles_request_body_inner import AccountGroupRolesRequestBodyInner + +class TestAccountGroupRolesRequestBodyInner(unittest.TestCase): + """AccountGroupRolesRequestBodyInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AccountGroupRolesRequestBodyInner: + """Test AccountGroupRolesRequestBodyInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AccountGroupRolesRequestBodyInner` + """ + model = AccountGroupRolesRequestBodyInner() + if include_optional: + return AccountGroupRolesRequestBodyInner( + account_group_id = '315', + role_ids = ["57","1140"] + ) + else: + return AccountGroupRolesRequestBodyInner( + ) + """ + + def testAccountGroupRolesRequestBodyInner(self): + """Test AccountGroupRolesRequestBodyInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_account_groups.py b/admin_api/test/test_account_groups.py new file mode 100644 index 00000000..cb945d79 --- /dev/null +++ b/admin_api/test/test_account_groups.py @@ -0,0 +1,54 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.account_groups import AccountGroups + +class TestAccountGroups(unittest.TestCase): + """AccountGroups unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AccountGroups: + """Test AccountGroups + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AccountGroups` + """ + model = AccountGroups() + if include_optional: + return AccountGroups( + account_groups = [ + admin_api.models.account_group.AccountGroup() + ] + ) + else: + return AccountGroups( + ) + """ + + def testAccountGroups(self): + """Test AccountGroups""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_account_groups_api.py b/admin_api/test/test_account_groups_api.py new file mode 100644 index 00000000..c726e601 --- /dev/null +++ b/admin_api/test/test_account_groups_api.py @@ -0,0 +1,66 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from admin_api.api.account_groups_api import AccountGroupsApi + + +class TestAccountGroupsApi(unittest.TestCase): + """AccountGroupsApi unit test stubs""" + + def setUp(self) -> None: + self.api = AccountGroupsApi() + + def tearDown(self) -> None: + pass + + def test_create_account_group(self) -> None: + """Test case for create_account_group + + Create account group + """ + pass + + def test_delete_account_group(self) -> None: + """Test case for delete_account_group + + Delete account group + """ + pass + + def test_get_account_group(self) -> None: + """Test case for get_account_group + + Retrieve account group + """ + pass + + def test_get_account_groups(self) -> None: + """Test case for get_account_groups + + List account groups + """ + pass + + def test_update_account_group(self) -> None: + """Test case for update_account_group + + Update account group + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_agent.py b/admin_api/test/test_agent.py new file mode 100644 index 00000000..78905104 --- /dev/null +++ b/admin_api/test/test_agent.py @@ -0,0 +1,61 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.agent import Agent + +class TestAgent(unittest.TestCase): + """Agent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Agent: + """Test Agent + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Agent` + """ + model = Agent() + if include_optional: + return Agent( + ip_addresses = [99.139.65.220, 99.139.65.221], + public_ip_addresses = [192.168.1.78, 192.168.1.79], + network = 'AT&T Services, Inc. (AS 7018)', + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + agent_type = 'enterprise-cluster', + location = 'San Francisco Bay Area', + country_id = 'US', + enabled = True, + verify_ssl_certificates = True + ) + else: + return Agent( + ) + """ + + def testAgent(self): + """Test Agent""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_agent_base.py b/admin_api/test/test_agent_base.py new file mode 100644 index 00000000..3e8dec04 --- /dev/null +++ b/admin_api/test/test_agent_base.py @@ -0,0 +1,54 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.agent_base import AgentBase + +class TestAgentBase(unittest.TestCase): + """AgentBase unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentBase: + """Test AgentBase + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AgentBase` + """ + model = AgentBase() + if include_optional: + return AgentBase( + ip_addresses = ["99.139.65.220","99.139.65.221"], + public_ip_addresses = ["192.168.1.78","192.168.1.79"], + network = 'AT&T Services, Inc. (AS 7018)' + ) + else: + return AgentBase( + ) + """ + + def testAgentBase(self): + """Test AgentBase""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_all_account_group_roles.py b/admin_api/test/test_all_account_group_roles.py new file mode 100644 index 00000000..351b9f4b --- /dev/null +++ b/admin_api/test/test_all_account_group_roles.py @@ -0,0 +1,54 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.all_account_group_roles import AllAccountGroupRoles + +class TestAllAccountGroupRoles(unittest.TestCase): + """AllAccountGroupRoles unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AllAccountGroupRoles: + """Test AllAccountGroupRoles + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AllAccountGroupRoles` + """ + model = AllAccountGroupRoles() + if include_optional: + return AllAccountGroupRoles( + all_account_group_roles = [ + admin_api.models.role.Role() + ] + ) + else: + return AllAccountGroupRoles( + ) + """ + + def testAllAccountGroupRoles(self): + """Test AllAccountGroupRoles""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_base_role.py b/admin_api/test/test_base_role.py new file mode 100644 index 00000000..dec2a3ba --- /dev/null +++ b/admin_api/test/test_base_role.py @@ -0,0 +1,54 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.base_role import BaseRole + +class TestBaseRole(unittest.TestCase): + """BaseRole unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseRole: + """Test BaseRole + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BaseRole` + """ + model = BaseRole() + if include_optional: + return BaseRole( + name = 'Organization Admin', + role_id = '35', + is_builtin = True + ) + else: + return BaseRole( + ) + """ + + def testBaseRole(self): + """Test BaseRole""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_cloud_enterprise_agent_type.py b/admin_api/test/test_cloud_enterprise_agent_type.py new file mode 100644 index 00000000..a39e780b --- /dev/null +++ b/admin_api/test/test_cloud_enterprise_agent_type.py @@ -0,0 +1,34 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType + +class TestCloudEnterpriseAgentType(unittest.TestCase): + """CloudEnterpriseAgentType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCloudEnterpriseAgentType(self): + """Test CloudEnterpriseAgentType""" + # inst = CloudEnterpriseAgentType() + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_cluster_member.py b/admin_api/test/test_cluster_member.py new file mode 100644 index 00000000..67c46957 --- /dev/null +++ b/admin_api/test/test_cluster_member.py @@ -0,0 +1,65 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.cluster_member import ClusterMember + +class TestClusterMember(unittest.TestCase): + """ClusterMember unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ClusterMember: + """Test ClusterMember + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ClusterMember` + """ + model = ClusterMember() + if include_optional: + return ClusterMember( + ip_addresses = [99.139.65.220, 99.139.65.221], + public_ip_addresses = [192.168.1.78, 192.168.1.79], + network = 'AT&T Services, Inc. (AS 7018)', + member_id = '10', + name = 'Cluster member name', + error_details = [ + admin_api.models.error_detail.ErrorDetail( + code = 'agent-version-outdated', + description = 'Agent Version 0.1.1 (latest: 1.0.0)', ) + ], + last_seen = '2022-07-17T22:00:54Z', + agent_state = 'online', + target_for_tests = '1.1.1.1', + utilization = 25 + ) + else: + return ClusterMember( + ) + """ + + def testClusterMember(self): + """Test ClusterMember""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_create_account_group201_response.py b/admin_api/test/test_create_account_group201_response.py new file mode 100644 index 00000000..1330ccc8 --- /dev/null +++ b/admin_api/test/test_create_account_group201_response.py @@ -0,0 +1,77 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.create_account_group201_response import CreateAccountGroup201Response + +class TestCreateAccountGroup201Response(unittest.TestCase): + """CreateAccountGroup201Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateAccountGroup201Response: + """Test CreateAccountGroup201Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateAccountGroup201Response` + """ + model = CreateAccountGroup201Response() + if include_optional: + return CreateAccountGroup201Response( + aid = '11', + account_group_name = 'Account A', + is_current_account_group = True, + is_default_account_group = True, + organization_name = '', + users = [ + admin_api.models.user_account_group.UserAccountGroup( + name = 'User X', + email = 'userx@thousandeyes.com', + uid = '235', + last_login = '2022-07-17T22:00:54Z', + date_registered = '2022-07-17T22:00:54Z', + roles = [ + admin_api.models.role.Role() + ], ) + ], + links = admin_api.models.self_links__links.SelfLinks__links( + self = admin_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return CreateAccountGroup201Response( + ) + """ + + def testCreateAccountGroup201Response(self): + """Test CreateAccountGroup201Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_create_role201_response.py b/admin_api/test/test_create_role201_response.py new file mode 100644 index 00000000..02313436 --- /dev/null +++ b/admin_api/test/test_create_role201_response.py @@ -0,0 +1,65 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.create_role201_response import CreateRole201Response + +class TestCreateRole201Response(unittest.TestCase): + """CreateRole201Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateRole201Response: + """Test CreateRole201Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateRole201Response` + """ + model = CreateRole201Response() + if include_optional: + return CreateRole201Response( + name = 'Organization Admin', + role_id = '35', + is_builtin = True, + permissions = [{label=View reports, permissionId=1, isManagementPermission=true, permission=REPORT_READ}, {label=View snapshots, permissionId=51, isManagementPermission=false, permission=REPORT_SNAPSHOTS_READ}], + links = admin_api.models.self_links__links.SelfLinks__links( + self = admin_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return CreateRole201Response( + ) + """ + + def testCreateRole201Response(self): + """Test CreateRole201Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_create_user201_response.py b/admin_api/test/test_create_user201_response.py new file mode 100644 index 00000000..37ec7ea9 --- /dev/null +++ b/admin_api/test/test_create_user201_response.py @@ -0,0 +1,76 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.create_user201_response import CreateUser201Response + +class TestCreateUser201Response(unittest.TestCase): + """CreateUser201Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateUser201Response: + """Test CreateUser201Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateUser201Response` + """ + model = CreateUser201Response() + if include_optional: + return CreateUser201Response( + name = 'User X', + email = 'userx@thousandeyes.com', + uid = '245', + date_registered = '2020-07-17T22:00:54Z', + login_account_group = admin_api.models.account_group_1.AccountGroup_1(), + account_group_roles = [ + admin_api.models.account_group_roles_account_group_roles_inner.AccountGroupRoles_accountGroupRoles_inner( + account_group = admin_api.models.account_group_1.AccountGroup_1(), + roles = [ + admin_api.models.role.Role() + ], ) + ], + all_account_group_roles = [ + admin_api.models.role.Role() + ], + links = admin_api.models.self_links__links.SelfLinks__links( + self = admin_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return CreateUser201Response( + ) + """ + + def testCreateUser201Response(self): + """Test CreateUser201Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_created_user.py b/admin_api/test/test_created_user.py new file mode 100644 index 00000000..7854dbd6 --- /dev/null +++ b/admin_api/test/test_created_user.py @@ -0,0 +1,66 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.created_user import CreatedUser + +class TestCreatedUser(unittest.TestCase): + """CreatedUser unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreatedUser: + """Test CreatedUser + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreatedUser` + """ + model = CreatedUser() + if include_optional: + return CreatedUser( + name = 'User X', + email = 'userx@thousandeyes.com', + uid = '245', + date_registered = '2020-07-17T22:00:54Z', + login_account_group = admin_api.models.account_group_1.AccountGroup_1(), + account_group_roles = [ + admin_api.models.account_group_roles_account_group_roles_inner.AccountGroupRoles_accountGroupRoles_inner( + account_group = admin_api.models.account_group_1.AccountGroup_1(), + roles = [ + admin_api.models.role.Role() + ], ) + ], + all_account_group_roles = [ + admin_api.models.role.Role() + ] + ) + else: + return CreatedUser( + ) + """ + + def testCreatedUser(self): + """Test CreatedUser""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_enterprise_agent.py b/admin_api/test/test_enterprise_agent.py new file mode 100644 index 00000000..5b658737 --- /dev/null +++ b/admin_api/test/test_enterprise_agent.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Administrative API + + ## Overview Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following endpoints that define the operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These endpoints can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.enterprise_agent import EnterpriseAgent + +class TestEnterpriseAgent(unittest.TestCase): + """EnterpriseAgent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EnterpriseAgent: + """Test EnterpriseAgent + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EnterpriseAgent` + """ + model = EnterpriseAgent() + if include_optional: + return EnterpriseAgent( + ip_addresses = [99.139.65.220, 99.139.65.221], + public_ip_addresses = [192.168.1.78, 192.168.1.79], + network = 'AT&T Services, Inc. (AS 7018)', + agent_id = '281474976710706', + agent_name = 'thousandeyes-stg-va-254', + agent_type = 'enterprise-cluster', + location = 'San Francisco Bay Area', + country_id = 'US', + enabled = True, + verify_ssl_certificates = True, + cluster_members = [ + null + ], + utilization = 25, + account_groups = [ + admin_api.models.account_group_1.AccountGroup_1() + ], + prefix = '99.128.0.0/11', + ipv6_policy = 'force-ipv4', + error_details = [ + admin_api.models.error_detail.ErrorDetail( + code = 'agent-version-outdated', + description = 'Agent Version 0.1.1 (latest: 1.0.0)', ) + ], + hostname = 'thousandeyes.com', + last_seen = '2022-07-17T22:00:54Z', + agent_state = 'online', + keep_browser_cache = True, + created_date = '2022-07-17T22:00:54Z', + target_for_tests = '1.1.1.1', + local_resolution_prefixes = [ + '10.2.3.3/24' + ], + interface_ip_mappings = [ + admin_api.models.interface_ip_mapping.InterfaceIpMapping( + interface_name = 'wlp4s0', + ip_addresses = ["73.252.207.219","2601:646:300:3ae0::b977"], ) + ] + ) + else: + return EnterpriseAgent( + ) + """ + + def testEnterpriseAgent(self): + """Test EnterpriseAgent""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_enterprise_agent_ipv6_policy.py b/admin_api/test/test_enterprise_agent_ipv6_policy.py new file mode 100644 index 00000000..83272d10 --- /dev/null +++ b/admin_api/test/test_enterprise_agent_ipv6_policy.py @@ -0,0 +1,34 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.enterprise_agent_ipv6_policy import EnterpriseAgentIpv6Policy + +class TestEnterpriseAgentIpv6Policy(unittest.TestCase): + """EnterpriseAgentIpv6Policy unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnterpriseAgentIpv6Policy(self): + """Test EnterpriseAgentIpv6Policy""" + # inst = EnterpriseAgentIpv6Policy() + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_enterprise_agent_state.py b/admin_api/test/test_enterprise_agent_state.py new file mode 100644 index 00000000..8b0c5810 --- /dev/null +++ b/admin_api/test/test_enterprise_agent_state.py @@ -0,0 +1,34 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.enterprise_agent_state import EnterpriseAgentState + +class TestEnterpriseAgentState(unittest.TestCase): + """EnterpriseAgentState unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnterpriseAgentState(self): + """Test EnterpriseAgentState""" + # inst = EnterpriseAgentState() + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_enterprise_agents.py b/admin_api/test/test_enterprise_agents.py new file mode 100644 index 00000000..55bee827 --- /dev/null +++ b/admin_api/test/test_enterprise_agents.py @@ -0,0 +1,54 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.enterprise_agents import EnterpriseAgents + +class TestEnterpriseAgents(unittest.TestCase): + """EnterpriseAgents unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EnterpriseAgents: + """Test EnterpriseAgents + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EnterpriseAgents` + """ + model = EnterpriseAgents() + if include_optional: + return EnterpriseAgents( + agents = [ + null + ] + ) + else: + return EnterpriseAgents( + ) + """ + + def testEnterpriseAgents(self): + """Test EnterpriseAgents""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_error.py b/admin_api/test/test_error.py new file mode 100644 index 00000000..92fd294a --- /dev/null +++ b/admin_api/test/test_error.py @@ -0,0 +1,56 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.error import Error + +class TestError(unittest.TestCase): + """Error unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Error: + """Test Error + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Error` + """ + model = Error() + if include_optional: + return Error( + type = '', + title = '', + status = 56, + detail = '', + instance = '' + ) + else: + return Error( + ) + """ + + def testError(self): + """Test Error""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_error_detail.py b/admin_api/test/test_error_detail.py new file mode 100644 index 00000000..af047bd6 --- /dev/null +++ b/admin_api/test/test_error_detail.py @@ -0,0 +1,53 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.error_detail import ErrorDetail + +class TestErrorDetail(unittest.TestCase): + """ErrorDetail unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ErrorDetail: + """Test ErrorDetail + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ErrorDetail` + """ + model = ErrorDetail() + if include_optional: + return ErrorDetail( + code = 'agent-version-outdated', + description = 'Agent Version 0.1.1 (latest: 1.0.0)' + ) + else: + return ErrorDetail( + ) + """ + + def testErrorDetail(self): + """Test ErrorDetail""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_error_detail_code.py b/admin_api/test/test_error_detail_code.py new file mode 100644 index 00000000..977242d5 --- /dev/null +++ b/admin_api/test/test_error_detail_code.py @@ -0,0 +1,34 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.error_detail_code import ErrorDetailCode + +class TestErrorDetailCode(unittest.TestCase): + """ErrorDetailCode unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testErrorDetailCode(self): + """Test ErrorDetailCode""" + # inst = ErrorDetailCode() + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_expand.py b/admin_api/test/test_expand.py new file mode 100644 index 00000000..f9a527df --- /dev/null +++ b/admin_api/test/test_expand.py @@ -0,0 +1,34 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.expand import Expand + +class TestExpand(unittest.TestCase): + """Expand unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testExpand(self): + """Test Expand""" + # inst = Expand() + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_extended_user.py b/admin_api/test/test_extended_user.py new file mode 100644 index 00000000..7ee6ae8b --- /dev/null +++ b/admin_api/test/test_extended_user.py @@ -0,0 +1,57 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.extended_user import ExtendedUser + +class TestExtendedUser(unittest.TestCase): + """ExtendedUser unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ExtendedUser: + """Test ExtendedUser + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ExtendedUser` + """ + model = ExtendedUser() + if include_optional: + return ExtendedUser( + name = 'User X', + email = 'userx@thousandeyes.com', + uid = '245', + date_registered = '2020-07-17T22:00:54Z', + login_account_group = admin_api.models.account_group_1.AccountGroup_1(), + last_login = '2022-07-17T22:00:54Z' + ) + else: + return ExtendedUser( + ) + """ + + def testExtendedUser(self): + """Test ExtendedUser""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_get_account_group200_response.py b/admin_api/test/test_get_account_group200_response.py new file mode 100644 index 00000000..c5ab044c --- /dev/null +++ b/admin_api/test/test_get_account_group200_response.py @@ -0,0 +1,80 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.get_account_group200_response import GetAccountGroup200Response + +class TestGetAccountGroup200Response(unittest.TestCase): + """GetAccountGroup200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetAccountGroup200Response: + """Test GetAccountGroup200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetAccountGroup200Response` + """ + model = GetAccountGroup200Response() + if include_optional: + return GetAccountGroup200Response( + aid = '11', + account_group_name = 'Account A', + is_current_account_group = True, + is_default_account_group = True, + organization_name = '', + users = [ + admin_api.models.user_account_group.UserAccountGroup( + name = 'User X', + email = 'userx@thousandeyes.com', + uid = '235', + last_login = '2022-07-17T22:00:54Z', + date_registered = '2022-07-17T22:00:54Z', + roles = [ + admin_api.models.role.Role() + ], ) + ], + agents = [ + null + ], + links = admin_api.models.self_links__links.SelfLinks__links( + self = admin_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetAccountGroup200Response( + ) + """ + + def testGetAccountGroup200Response(self): + """Test GetAccountGroup200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_get_account_groups200_response.py b/admin_api/test/test_get_account_groups200_response.py new file mode 100644 index 00000000..1415ab79 --- /dev/null +++ b/admin_api/test/test_get_account_groups200_response.py @@ -0,0 +1,64 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.get_account_groups200_response import GetAccountGroups200Response + +class TestGetAccountGroups200Response(unittest.TestCase): + """GetAccountGroups200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetAccountGroups200Response: + """Test GetAccountGroups200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetAccountGroups200Response` + """ + model = GetAccountGroups200Response() + if include_optional: + return GetAccountGroups200Response( + account_groups = [ + admin_api.models.account_group.AccountGroup() + ], + links = admin_api.models.self_links__links.SelfLinks__links( + self = admin_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetAccountGroups200Response( + ) + """ + + def testGetAccountGroups200Response(self): + """Test GetAccountGroups200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_get_permissions200_response.py b/admin_api/test/test_get_permissions200_response.py new file mode 100644 index 00000000..ee088b20 --- /dev/null +++ b/admin_api/test/test_get_permissions200_response.py @@ -0,0 +1,62 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.get_permissions200_response import GetPermissions200Response + +class TestGetPermissions200Response(unittest.TestCase): + """GetPermissions200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetPermissions200Response: + """Test GetPermissions200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetPermissions200Response` + """ + model = GetPermissions200Response() + if include_optional: + return GetPermissions200Response( + permissions = [{label=View reports, permissionId=1, isManagementPermission=true, permission=REPORT_READ}, {label=View snapshots, permissionId=51, isManagementPermission=false, permission=REPORT_SNAPSHOTS_READ}], + links = admin_api.models.self_links__links.SelfLinks__links( + self = admin_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetPermissions200Response( + ) + """ + + def testGetPermissions200Response(self): + """Test GetPermissions200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_get_roles200_response.py b/admin_api/test/test_get_roles200_response.py new file mode 100644 index 00000000..e1d6a7a7 --- /dev/null +++ b/admin_api/test/test_get_roles200_response.py @@ -0,0 +1,64 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.get_roles200_response import GetRoles200Response + +class TestGetRoles200Response(unittest.TestCase): + """GetRoles200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetRoles200Response: + """Test GetRoles200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetRoles200Response` + """ + model = GetRoles200Response() + if include_optional: + return GetRoles200Response( + roles = [ + admin_api.models.role.Role() + ], + links = admin_api.models.self_links__links.SelfLinks__links( + self = admin_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetRoles200Response( + ) + """ + + def testGetRoles200Response(self): + """Test GetRoles200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_get_user200_response.py b/admin_api/test/test_get_user200_response.py new file mode 100644 index 00000000..55dce4e4 --- /dev/null +++ b/admin_api/test/test_get_user200_response.py @@ -0,0 +1,77 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.get_user200_response import GetUser200Response + +class TestGetUser200Response(unittest.TestCase): + """GetUser200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetUser200Response: + """Test GetUser200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetUser200Response` + """ + model = GetUser200Response() + if include_optional: + return GetUser200Response( + name = 'User X', + email = 'userx@thousandeyes.com', + uid = '245', + date_registered = '2020-07-17T22:00:54Z', + login_account_group = admin_api.models.account_group_1.AccountGroup_1(), + last_login = '2022-07-17T22:00:54Z', + account_group_roles = [ + admin_api.models.account_group_roles_account_group_roles_inner.AccountGroupRoles_accountGroupRoles_inner( + account_group = admin_api.models.account_group_1.AccountGroup_1(), + roles = [ + admin_api.models.role.Role() + ], ) + ], + all_account_group_roles = [ + admin_api.models.role.Role() + ], + links = admin_api.models.self_links__links.SelfLinks__links( + self = admin_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetUser200Response( + ) + """ + + def testGetUser200Response(self): + """Test GetUser200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_get_user_events200_response.py b/admin_api/test/test_get_user_events200_response.py new file mode 100644 index 00000000..728c2b7d --- /dev/null +++ b/admin_api/test/test_get_user_events200_response.py @@ -0,0 +1,64 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.get_user_events200_response import GetUserEvents200Response + +class TestGetUserEvents200Response(unittest.TestCase): + """GetUserEvents200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetUserEvents200Response: + """Test GetUserEvents200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetUserEvents200Response` + """ + model = GetUserEvents200Response() + if include_optional: + return GetUserEvents200Response( + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z', + audit_events = [{accountGroupName=API Sandbox, aid=75, date=2020-07-17T21:54:54Z, event=Report created., ipAddress=99.128.0.0/11, uid=245, user=API Sandbox User (noreply@thousandeyes.com), resources=[{name=My New report, type=reportTitle}, {name=Other Report, type=testName}]}, {accountGroupName=API Sandbox, aid=75, date=2020-07-17T22:00:54Z, event=Login failed., ipAddress=99.128.0.0/11, uid=245, user=API Sandbox User (noreply@thousandeyes.com)}], + links = admin_api.models.self_links__links.SelfLinks__links( + self = admin_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetUserEvents200Response( + ) + """ + + def testGetUserEvents200Response(self): + """Test GetUserEvents200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_get_users200_response.py b/admin_api/test/test_get_users200_response.py new file mode 100644 index 00000000..20d584c5 --- /dev/null +++ b/admin_api/test/test_get_users200_response.py @@ -0,0 +1,64 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.get_users200_response import GetUsers200Response + +class TestGetUsers200Response(unittest.TestCase): + """GetUsers200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetUsers200Response: + """Test GetUsers200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetUsers200Response` + """ + model = GetUsers200Response() + if include_optional: + return GetUsers200Response( + users = [ + null + ], + links = admin_api.models.self_links__links.SelfLinks__links( + self = admin_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return GetUsers200Response( + ) + """ + + def testGetUsers200Response(self): + """Test GetUsers200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_interface_ip_mapping.py b/admin_api/test/test_interface_ip_mapping.py new file mode 100644 index 00000000..c41e1e2b --- /dev/null +++ b/admin_api/test/test_interface_ip_mapping.py @@ -0,0 +1,53 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.interface_ip_mapping import InterfaceIpMapping + +class TestInterfaceIpMapping(unittest.TestCase): + """InterfaceIpMapping unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InterfaceIpMapping: + """Test InterfaceIpMapping + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `InterfaceIpMapping` + """ + model = InterfaceIpMapping() + if include_optional: + return InterfaceIpMapping( + interface_name = 'wlp4s0', + ip_addresses = ["73.252.207.219","2601:646:300:3ae0::b977"] + ) + else: + return InterfaceIpMapping( + ) + """ + + def testInterfaceIpMapping(self): + """Test InterfaceIpMapping""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_link.py b/admin_api/test/test_link.py new file mode 100644 index 00000000..945bae6e --- /dev/null +++ b/admin_api/test/test_link.py @@ -0,0 +1,60 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.link import Link + +class TestLink(unittest.TestCase): + """Link unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Link: + """Test Link + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Link` + """ + model = Link() + if include_optional: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '' + ) + else: + return Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + ) + """ + + def testLink(self): + """Test Link""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_login_account_group.py b/admin_api/test/test_login_account_group.py new file mode 100644 index 00000000..0b3e53ca --- /dev/null +++ b/admin_api/test/test_login_account_group.py @@ -0,0 +1,52 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.login_account_group import LoginAccountGroup + +class TestLoginAccountGroup(unittest.TestCase): + """LoginAccountGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LoginAccountGroup: + """Test LoginAccountGroup + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `LoginAccountGroup` + """ + model = LoginAccountGroup() + if include_optional: + return LoginAccountGroup( + login_account_group = admin_api.models.account_group_1.AccountGroup_1() + ) + else: + return LoginAccountGroup( + ) + """ + + def testLoginAccountGroup(self): + """Test LoginAccountGroup""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_new_account_group_response.py b/admin_api/test/test_new_account_group_response.py new file mode 100644 index 00000000..8a187d7a --- /dev/null +++ b/admin_api/test/test_new_account_group_response.py @@ -0,0 +1,67 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.new_account_group_response import NewAccountGroupResponse + +class TestNewAccountGroupResponse(unittest.TestCase): + """NewAccountGroupResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NewAccountGroupResponse: + """Test NewAccountGroupResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NewAccountGroupResponse` + """ + model = NewAccountGroupResponse() + if include_optional: + return NewAccountGroupResponse( + aid = '11', + account_group_name = 'Account A', + is_current_account_group = True, + is_default_account_group = True, + organization_name = '', + users = [ + admin_api.models.user_account_group.UserAccountGroup( + name = 'User X', + email = 'userx@thousandeyes.com', + uid = '235', + last_login = '2022-07-17T22:00:54Z', + date_registered = '2022-07-17T22:00:54Z', + roles = [ + admin_api.models.role.Role() + ], ) + ] + ) + else: + return NewAccountGroupResponse( + ) + """ + + def testNewAccountGroupResponse(self): + """Test NewAccountGroupResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_pagination_links.py b/admin_api/test/test_pagination_links.py new file mode 100644 index 00000000..b89fb85c --- /dev/null +++ b/admin_api/test/test_pagination_links.py @@ -0,0 +1,70 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.pagination_links import PaginationLinks + +class TestPaginationLinks(unittest.TestCase): + """PaginationLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PaginationLinks: + """Test PaginationLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PaginationLinks` + """ + model = PaginationLinks() + if include_optional: + return PaginationLinks( + links = admin_api.models.pagination_links__links.PaginationLinks__links( + previous = admin_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), + next = admin_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return PaginationLinks( + ) + """ + + def testPaginationLinks(self): + """Test PaginationLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_pagination_links_links.py b/admin_api/test/test_pagination_links_links.py new file mode 100644 index 00000000..6d8fedb4 --- /dev/null +++ b/admin_api/test/test_pagination_links_links.py @@ -0,0 +1,69 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.pagination_links_links import PaginationLinksLinks + +class TestPaginationLinksLinks(unittest.TestCase): + """PaginationLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PaginationLinksLinks: + """Test PaginationLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PaginationLinksLinks` + """ + model = PaginationLinksLinks() + if include_optional: + return PaginationLinksLinks( + previous = admin_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), + next = admin_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return PaginationLinksLinks( + ) + """ + + def testPaginationLinksLinks(self): + """Test PaginationLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_permission.py b/admin_api/test/test_permission.py new file mode 100644 index 00000000..aa74809b --- /dev/null +++ b/admin_api/test/test_permission.py @@ -0,0 +1,55 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.permission import Permission + +class TestPermission(unittest.TestCase): + """Permission unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Permission: + """Test Permission + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Permission` + """ + model = Permission() + if include_optional: + return Permission( + label = 'View reports', + permission_id = '56', + is_management_permission = True, + permission = 'REPORT_SNAPSHOTS_READ' + ) + else: + return Permission( + ) + """ + + def testPermission(self): + """Test Permission""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_permissions.py b/admin_api/test/test_permissions.py new file mode 100644 index 00000000..8a976bb5 --- /dev/null +++ b/admin_api/test/test_permissions.py @@ -0,0 +1,52 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.permissions import Permissions + +class TestPermissions(unittest.TestCase): + """Permissions unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Permissions: + """Test Permissions + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Permissions` + """ + model = Permissions() + if include_optional: + return Permissions( + permissions = [{"label":"View reports","permissionId":1,"isManagementPermission":true,"permission":"REPORT_READ"},{"label":"View snapshots","permissionId":51,"isManagementPermission":false,"permission":"REPORT_SNAPSHOTS_READ"}] + ) + else: + return Permissions( + ) + """ + + def testPermissions(self): + """Test Permissions""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_permissions_api.py b/admin_api/test/test_permissions_api.py new file mode 100644 index 00000000..19b55afd --- /dev/null +++ b/admin_api/test/test_permissions_api.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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from admin_api.api.permissions_api import PermissionsApi + + +class TestPermissionsApi(unittest.TestCase): + """PermissionsApi unit test stubs""" + + def setUp(self) -> None: + self.api = PermissionsApi() + + def tearDown(self) -> None: + pass + + def test_get_permissions(self) -> None: + """Test case for get_permissions + + List assignable permissions + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_query_window.py b/admin_api/test/test_query_window.py new file mode 100644 index 00000000..ac3a6dbe --- /dev/null +++ b/admin_api/test/test_query_window.py @@ -0,0 +1,53 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.query_window import QueryWindow + +class TestQueryWindow(unittest.TestCase): + """QueryWindow unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> QueryWindow: + """Test QueryWindow + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `QueryWindow` + """ + model = QueryWindow() + if include_optional: + return QueryWindow( + start_date = '2022-07-17T22:00:54Z', + end_date = '2022-07-18T22:00:54Z' + ) + else: + return QueryWindow( + ) + """ + + def testQueryWindow(self): + """Test QueryWindow""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_role.py b/admin_api/test/test_role.py new file mode 100644 index 00000000..ddf5bd20 --- /dev/null +++ b/admin_api/test/test_role.py @@ -0,0 +1,55 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.role import Role + +class TestRole(unittest.TestCase): + """Role unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Role: + """Test Role + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Role` + """ + model = Role() + if include_optional: + return Role( + name = 'Organization Admin', + role_id = '35', + is_builtin = True, + has_management_permissions = True + ) + else: + return Role( + ) + """ + + def testRole(self): + """Test Role""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_role_detail.py b/admin_api/test/test_role_detail.py new file mode 100644 index 00000000..5984bce5 --- /dev/null +++ b/admin_api/test/test_role_detail.py @@ -0,0 +1,55 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.role_detail import RoleDetail + +class TestRoleDetail(unittest.TestCase): + """RoleDetail unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RoleDetail: + """Test RoleDetail + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RoleDetail` + """ + model = RoleDetail() + if include_optional: + return RoleDetail( + name = 'Organization Admin', + role_id = '35', + is_builtin = True, + permissions = [{label=View reports, permissionId=1, isManagementPermission=true, permission=REPORT_READ}, {label=View snapshots, permissionId=51, isManagementPermission=false, permission=REPORT_SNAPSHOTS_READ}] + ) + else: + return RoleDetail( + ) + """ + + def testRoleDetail(self): + """Test RoleDetail""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_role_request_body.py b/admin_api/test/test_role_request_body.py new file mode 100644 index 00000000..a8f6415a --- /dev/null +++ b/admin_api/test/test_role_request_body.py @@ -0,0 +1,53 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.role_request_body import RoleRequestBody + +class TestRoleRequestBody(unittest.TestCase): + """RoleRequestBody unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RoleRequestBody: + """Test RoleRequestBody + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RoleRequestBody` + """ + model = RoleRequestBody() + if include_optional: + return RoleRequestBody( + name = 'Organization Admin', + permissions = ["56","315"] + ) + else: + return RoleRequestBody( + ) + """ + + def testRoleRequestBody(self): + """Test RoleRequestBody""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_roles.py b/admin_api/test/test_roles.py new file mode 100644 index 00000000..657e4a7b --- /dev/null +++ b/admin_api/test/test_roles.py @@ -0,0 +1,54 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.roles import Roles + +class TestRoles(unittest.TestCase): + """Roles unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Roles: + """Test Roles + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Roles` + """ + model = Roles() + if include_optional: + return Roles( + roles = [ + admin_api.models.role.Role() + ] + ) + else: + return Roles( + ) + """ + + def testRoles(self): + """Test Roles""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_roles_api.py b/admin_api/test/test_roles_api.py new file mode 100644 index 00000000..aba35a64 --- /dev/null +++ b/admin_api/test/test_roles_api.py @@ -0,0 +1,66 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from admin_api.api.roles_api import RolesApi + + +class TestRolesApi(unittest.TestCase): + """RolesApi unit test stubs""" + + def setUp(self) -> None: + self.api = RolesApi() + + def tearDown(self) -> None: + pass + + def test_create_role(self) -> None: + """Test case for create_role + + Create role + """ + pass + + def test_delete_role(self) -> None: + """Test case for delete_role + + Delete role + """ + pass + + def test_get_role(self) -> None: + """Test case for get_role + + Retrieve role + """ + pass + + def test_get_roles(self) -> None: + """Test case for get_roles + + List roles + """ + pass + + def test_update_role(self) -> None: + """Test case for update_role + + Update role + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_self_links.py b/admin_api/test/test_self_links.py new file mode 100644 index 00000000..f8fd4f10 --- /dev/null +++ b/admin_api/test/test_self_links.py @@ -0,0 +1,61 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.self_links import SelfLinks + +class TestSelfLinks(unittest.TestCase): + """SelfLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinks: + """Test SelfLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinks` + """ + model = SelfLinks() + if include_optional: + return SelfLinks( + links = admin_api.models.self_links__links.SelfLinks__links( + self = admin_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ), ) + ) + else: + return SelfLinks( + ) + """ + + def testSelfLinks(self): + """Test SelfLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_self_links_links.py b/admin_api/test/test_self_links_links.py new file mode 100644 index 00000000..045e2cf4 --- /dev/null +++ b/admin_api/test/test_self_links_links.py @@ -0,0 +1,60 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.self_links_links import SelfLinksLinks + +class TestSelfLinksLinks(unittest.TestCase): + """SelfLinksLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfLinksLinks: + """Test SelfLinksLinks + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SelfLinksLinks` + """ + model = SelfLinksLinks() + if include_optional: + return SelfLinksLinks( + var_self = admin_api.models.link.Link( + href = 'https://api.thousandeyes.com/v7/link/to/resource/id', + templated = True, + type = '', + deprecation = '', + name = '', + profile = '', + title = '', + hreflang = '', ) + ) + else: + return SelfLinksLinks( + ) + """ + + def testSelfLinksLinks(self): + """Test SelfLinksLinks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_unauthorized_error.py b/admin_api/test/test_unauthorized_error.py new file mode 100644 index 00000000..b206cc91 --- /dev/null +++ b/admin_api/test/test_unauthorized_error.py @@ -0,0 +1,53 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.unauthorized_error import UnauthorizedError + +class TestUnauthorizedError(unittest.TestCase): + """UnauthorizedError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UnauthorizedError: + """Test UnauthorizedError + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UnauthorizedError` + """ + model = UnauthorizedError() + if include_optional: + return UnauthorizedError( + error = 'invalid_token', + error_description = 'Invalid access token' + ) + else: + return UnauthorizedError( + ) + """ + + def testUnauthorizedError(self): + """Test UnauthorizedError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_user.py b/admin_api/test/test_user.py new file mode 100644 index 00000000..93efdb55 --- /dev/null +++ b/admin_api/test/test_user.py @@ -0,0 +1,56 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.user import User + +class TestUser(unittest.TestCase): + """User unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> User: + """Test User + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `User` + """ + model = User() + if include_optional: + return User( + name = 'User X', + email = 'userx@thousandeyes.com', + uid = '245', + date_registered = '2020-07-17T22:00:54Z', + login_account_group = admin_api.models.account_group_1.AccountGroup_1() + ) + else: + return User( + ) + """ + + def testUser(self): + """Test User""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_user_account_group.py b/admin_api/test/test_user_account_group.py new file mode 100644 index 00000000..95bab0cd --- /dev/null +++ b/admin_api/test/test_user_account_group.py @@ -0,0 +1,59 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.user_account_group import UserAccountGroup + +class TestUserAccountGroup(unittest.TestCase): + """UserAccountGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UserAccountGroup: + """Test UserAccountGroup + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UserAccountGroup` + """ + model = UserAccountGroup() + if include_optional: + return UserAccountGroup( + name = 'User X', + email = 'userx@thousandeyes.com', + uid = '235', + last_login = '2022-07-17T22:00:54Z', + date_registered = '2022-07-17T22:00:54Z', + roles = [ + admin_api.models.role.Role() + ] + ) + else: + return UserAccountGroup( + ) + """ + + def testUserAccountGroup(self): + """Test UserAccountGroup""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_user_account_groups.py b/admin_api/test/test_user_account_groups.py new file mode 100644 index 00000000..73ac363b --- /dev/null +++ b/admin_api/test/test_user_account_groups.py @@ -0,0 +1,62 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.user_account_groups import UserAccountGroups + +class TestUserAccountGroups(unittest.TestCase): + """UserAccountGroups unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UserAccountGroups: + """Test UserAccountGroups + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UserAccountGroups` + """ + model = UserAccountGroups() + if include_optional: + return UserAccountGroups( + users = [ + admin_api.models.user_account_group.UserAccountGroup( + name = 'User X', + email = 'userx@thousandeyes.com', + uid = '235', + last_login = '2022-07-17T22:00:54Z', + date_registered = '2022-07-17T22:00:54Z', + roles = [ + admin_api.models.role.Role() + ], ) + ] + ) + else: + return UserAccountGroups( + ) + """ + + def testUserAccountGroups(self): + """Test UserAccountGroups""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_user_detail.py b/admin_api/test/test_user_detail.py new file mode 100644 index 00000000..20dcf946 --- /dev/null +++ b/admin_api/test/test_user_detail.py @@ -0,0 +1,67 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.user_detail import UserDetail + +class TestUserDetail(unittest.TestCase): + """UserDetail unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UserDetail: + """Test UserDetail + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UserDetail` + """ + model = UserDetail() + if include_optional: + return UserDetail( + name = 'User X', + email = 'userx@thousandeyes.com', + uid = '245', + date_registered = '2020-07-17T22:00:54Z', + login_account_group = admin_api.models.account_group_1.AccountGroup_1(), + last_login = '2022-07-17T22:00:54Z', + account_group_roles = [ + admin_api.models.account_group_roles_account_group_roles_inner.AccountGroupRoles_accountGroupRoles_inner( + account_group = admin_api.models.account_group_1.AccountGroup_1(), + roles = [ + admin_api.models.role.Role() + ], ) + ], + all_account_group_roles = [ + admin_api.models.role.Role() + ] + ) + else: + return UserDetail( + ) + """ + + def testUserDetail(self): + """Test UserDetail""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_user_event.py b/admin_api/test/test_user_event.py new file mode 100644 index 00000000..31c5c2f2 --- /dev/null +++ b/admin_api/test/test_user_event.py @@ -0,0 +1,63 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.user_event import UserEvent + +class TestUserEvent(unittest.TestCase): + """UserEvent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UserEvent: + """Test UserEvent + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UserEvent` + """ + model = UserEvent() + if include_optional: + return UserEvent( + aid = '11', + account_group_name = 'Account A', + var_date = '2020-07-17T22:00:54Z', + event = 'Login failed.', + ip_address = '99.128.0.0/11', + uid = '245', + user = 'API Sandbox User (noreply@thousandeyes.com)', + resources = [ + admin_api.models.user_event_all_of_resources_inner.UserEvent_allOf_resources_inner( + type = '', + name = '', ) + ] + ) + else: + return UserEvent( + ) + """ + + def testUserEvent(self): + """Test UserEvent""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_user_event_all_of_resources_inner.py b/admin_api/test/test_user_event_all_of_resources_inner.py new file mode 100644 index 00000000..c1004db3 --- /dev/null +++ b/admin_api/test/test_user_event_all_of_resources_inner.py @@ -0,0 +1,53 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.user_event_all_of_resources_inner import UserEventAllOfResourcesInner + +class TestUserEventAllOfResourcesInner(unittest.TestCase): + """UserEventAllOfResourcesInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UserEventAllOfResourcesInner: + """Test UserEventAllOfResourcesInner + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UserEventAllOfResourcesInner` + """ + model = UserEventAllOfResourcesInner() + if include_optional: + return UserEventAllOfResourcesInner( + type = '', + name = '' + ) + else: + return UserEventAllOfResourcesInner( + ) + """ + + def testUserEventAllOfResourcesInner(self): + """Test UserEventAllOfResourcesInner""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_user_events.py b/admin_api/test/test_user_events.py new file mode 100644 index 00000000..2cb5daf0 --- /dev/null +++ b/admin_api/test/test_user_events.py @@ -0,0 +1,52 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.user_events import UserEvents + +class TestUserEvents(unittest.TestCase): + """UserEvents unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UserEvents: + """Test UserEvents + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UserEvents` + """ + model = UserEvents() + if include_optional: + return UserEvents( + audit_events = [{"accountGroupName":"API Sandbox","aid":"75","date":"2020-07-17T21:54:54Z","event":"Report created.","ipAddress":"99.128.0.0/11","uid":"245","user":"API Sandbox User (noreply@thousandeyes.com)","resources":[{"name":"My New report","type":"reportTitle"},{"name":"Other Report","type":"testName"}]},{"accountGroupName":"API Sandbox","aid":"75","date":"2020-07-17T22:00:54Z","event":"Login failed.","ipAddress":"99.128.0.0/11","uid":"245","user":"API Sandbox User (noreply@thousandeyes.com)"}] + ) + else: + return UserEvents( + ) + """ + + def testUserEvents(self): + """Test UserEvents""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_user_events_api.py b/admin_api/test/test_user_events_api.py new file mode 100644 index 00000000..05b2bbeb --- /dev/null +++ b/admin_api/test/test_user_events_api.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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from admin_api.api.user_events_api import UserEventsApi + + +class TestUserEventsApi(unittest.TestCase): + """UserEventsApi unit test stubs""" + + def setUp(self) -> None: + self.api = UserEventsApi() + + def tearDown(self) -> None: + pass + + def test_get_user_events(self) -> None: + """Test case for get_user_events + + List activity log events + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_user_request_body.py b/admin_api/test/test_user_request_body.py new file mode 100644 index 00000000..0f0b0340 --- /dev/null +++ b/admin_api/test/test_user_request_body.py @@ -0,0 +1,60 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.user_request_body import UserRequestBody + +class TestUserRequestBody(unittest.TestCase): + """UserRequestBody unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UserRequestBody: + """Test UserRequestBody + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UserRequestBody` + """ + model = UserRequestBody() + if include_optional: + return UserRequestBody( + name = 'User X', + email = 'userx@thousandeyes.com', + login_account_group_id = '691', + account_group_roles = [ + admin_api.models.account_group_roles_request_body_inner.AccountGroupRolesRequestBody_inner( + account_group_id = '315', + role_ids = ["57","1140"], ) + ], + all_account_group_role_ids = ["57","1140"] + ) + else: + return UserRequestBody( + ) + """ + + def testUserRequestBody(self): + """Test UserRequestBody""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_users.py b/admin_api/test/test_users.py new file mode 100644 index 00000000..ee550b86 --- /dev/null +++ b/admin_api/test/test_users.py @@ -0,0 +1,54 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from admin_api.models.users import Users + +class TestUsers(unittest.TestCase): + """Users unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Users: + """Test Users + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Users` + """ + model = Users() + if include_optional: + return Users( + users = [ + null + ] + ) + else: + return Users( + ) + """ + + def testUsers(self): + """Test Users""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/test/test_users_api.py b/admin_api/test/test_users_api.py new file mode 100644 index 00000000..ad92814f --- /dev/null +++ b/admin_api/test/test_users_api.py @@ -0,0 +1,66 @@ +# 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. + + The version of the OpenAPI document: 7.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from admin_api.api.users_api import UsersApi + + +class TestUsersApi(unittest.TestCase): + """UsersApi unit test stubs""" + + def setUp(self) -> None: + self.api = UsersApi() + + def tearDown(self) -> None: + pass + + def test_create_user(self) -> None: + """Test case for create_user + + Create user + """ + pass + + def test_delete_user(self) -> None: + """Test case for delete_user + + Delete user + """ + pass + + def test_get_user(self) -> None: + """Test case for get_user + + Retrieve user + """ + pass + + def test_get_users(self) -> None: + """Test case for get_users + + List users + """ + pass + + def test_update_user(self) -> None: + """Test case for update_user + + Update user + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/admin_api/tox.ini b/admin_api/tox.ini new file mode 100644 index 00000000..289db326 --- /dev/null +++ b/admin_api/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=admin_api