diff --git a/.github/workflows/autogen-remote-changes.yml b/.github/workflows/autogen-remote-changes.yml index 13bc201..d4d2913 100644 --- a/.github/workflows/autogen-remote-changes.yml +++ b/.github/workflows/autogen-remote-changes.yml @@ -20,9 +20,9 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v3 with: - node-version: '18' + node-version: '18' - name: Install OpenAPI Generator CLI - run: npm install @openapitools/openapi-generator-cli -g + run: npm install @openapitools/openapi-generator-cli@2.31.1 -g - name: Install dependencies run: | python -m pip install --upgrade pip @@ -32,29 +32,12 @@ jobs: - name: Check for changes id: check_changes run: | - if git diff --quiet; then + git add -A + if git diff --cached --quiet; then echo "changes=false" >> $GITHUB_ENV else echo "changes=true" >> $GITHUB_ENV fi - - name: Set up Git - if: env.changes == 'true' - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - - name: Commit changes - if: env.changes == 'true' - run: | - BRANCH_NAME="auto-update-sdk-$(date +'%Y-%m-%d-%H-%M-%S')" - echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV - git checkout -b $BRANCH_NAME || git checkout $BRANCH_NAME - git add . - git commit -m "Auto-update SDK on $(date +'%Y-%m-%d')" - - name: Push changes - if: env.changes == 'true' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: git push --force --set-upstream origin $BRANCH_NAME - name: Install GitHub CLI if: env.changes == 'true' run: | @@ -66,13 +49,32 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} id: check_pr run: | - PR_EXISTS=$(gh pr list --search "Auto-update SDK" --base main --state open --json number -q '.[0].number') + PR_EXISTS=$(gh pr list --search "Auto-update SDK" --base main --state open --json number,headRefName -q '.[0].number') if [[ -n "$PR_EXISTS" ]]; then - echo "pr_exists=true" >> $GITHUB_ENV - echo "PR_NUMBER=$PR_EXISTS" >> $GITHUB_ENV + echo "pr_exists=true" >> $GITHUB_ENV + echo "PR_NUMBER=$PR_EXISTS" >> $GITHUB_ENV + EXISTING_BRANCH=$(gh pr list --search "Auto-update SDK" --base main --state open --json number,headRefName -q '.[0].headRefName') + echo "BRANCH_NAME=$EXISTING_BRANCH" >> $GITHUB_ENV else - echo "pr_exists=false" >> $GITHUB_ENV + echo "pr_exists=false" >> $GITHUB_ENV + echo "BRANCH_NAME=auto-update-sdk-$(date +'%Y-%m-%d-%H-%M-%S')" >> $GITHUB_ENV fi + - name: Set up Git + if: env.changes == 'true' + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + - name: Commit changes + if: env.changes == 'true' + run: | + git fetch origin || true + git checkout -B $BRANCH_NAME origin/$BRANCH_NAME 2>/dev/null || git checkout -B $BRANCH_NAME + git commit -m "Auto-update SDK on $(date +'%Y-%m-%d')" + - name: Push changes + if: env.changes == 'true' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: git push --force --set-upstream origin $BRANCH_NAME - name: Create a pull request if: env.changes == 'true' && env.pr_exists == 'false' env: @@ -81,12 +83,9 @@ jobs: PR_TITLE="Auto-update SDK on $(date +'%Y-%m-%d')" PR_BODY="This pull request was automatically created by GitHub Actions to update the SDK with the latest remote OpenAPI specification." gh pr create --title "$PR_TITLE" --body "$PR_BODY" --head $BRANCH_NAME --base main - - name: Update existing pull request + - name: Comment on existing pull request if: env.changes == 'true' && env.pr_exists == 'true' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - echo "An existing pull request titled 'Auto-update SDK' is already open. Updating it with the latest changes." - git push --set-upstream origin $BRANCH_NAME --force gh pr comment $PR_NUMBER --body "This pull request has been updated with the latest changes from the automated SDK update process on $(date +'%Y-%m-%d %H:%M:%S')." - \ No newline at end of file diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index d7b8a2d..ae34470 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -13,6 +13,7 @@ docs/AddGroupResourceRequest.md docs/AddGroupUserRequest.md docs/AddResourceNhiRequest.md docs/AddResourceUserRequest.md +docs/ApiAccessLevelEnum.md docs/App.md docs/AppTypeEnum.md docs/AppValidation.md @@ -71,6 +72,7 @@ docs/GroupRemoteInfoActiveDirectoryGroup.md docs/GroupRemoteInfoAwsSsoGroup.md docs/GroupRemoteInfoAzureAdMicrosoft365Group.md docs/GroupRemoteInfoAzureAdSecurityGroup.md +docs/GroupRemoteInfoClickhouseRole.md docs/GroupRemoteInfoConnectorGroup.md docs/GroupRemoteInfoDatabricksAccountGroup.md docs/GroupRemoteInfoDevinGroup.md @@ -87,6 +89,7 @@ docs/GroupRemoteInfoPagerdutyOnCallSchedule.md docs/GroupRemoteInfoRootlyOnCallSchedule.md docs/GroupRemoteInfoSnowflakeRole.md docs/GroupRemoteInfoTailscaleGroup.md +docs/GroupRemoteInfoTwingateGroup.md docs/GroupRemoteInfoWorkdayUserSecurityGroup.md docs/GroupResource.md docs/GroupResourceList.md @@ -125,6 +128,7 @@ docs/PaginatedOwnersList.md docs/PaginatedRemoteUsersList.md docs/PaginatedResourcesList.md docs/PaginatedTagsList.md +docs/PaginatedTokensList.md docs/PaginatedUARsList.md docs/PaginatedUsersList.md docs/PropagationStatus.md @@ -177,10 +181,13 @@ docs/ResourceRemoteInfoAzureStorageContainer.md docs/ResourceRemoteInfoAzureSubscription.md docs/ResourceRemoteInfoAzureUserAssignedManagedIdentity.md docs/ResourceRemoteInfoAzureVirtualMachine.md +docs/ResourceRemoteInfoClickhouseDatabase.md +docs/ResourceRemoteInfoClickhouseTable.md docs/ResourceRemoteInfoCoupaRole.md docs/ResourceRemoteInfoCursorOrganization.md docs/ResourceRemoteInfoCustomConnector.md docs/ResourceRemoteInfoDatabricksAccountServicePrincipal.md +docs/ResourceRemoteInfoDatadogRole.md docs/ResourceRemoteInfoDatastaxAstraRole.md docs/ResourceRemoteInfoDevinOrganization.md docs/ResourceRemoteInfoDevinRole.md @@ -201,6 +208,7 @@ docs/ResourceRemoteInfoGithubRepo.md docs/ResourceRemoteInfoGitlabProject.md docs/ResourceRemoteInfoGoogleWorkspaceRole.md docs/ResourceRemoteInfoIlevelAdvancedRole.md +docs/ResourceRemoteInfoNetsuiteRole.md docs/ResourceRemoteInfoOktaApp.md docs/ResourceRemoteInfoOktaCustomRole.md docs/ResourceRemoteInfoOktaStandardRole.md @@ -216,6 +224,7 @@ docs/ResourceRemoteInfoSnowflakeSchema.md docs/ResourceRemoteInfoSnowflakeTable.md docs/ResourceRemoteInfoTailscaleSsh.md docs/ResourceRemoteInfoTeleportRole.md +docs/ResourceRemoteInfoTwingateResource.md docs/ResourceRemoteInfoWorkdayRole.md docs/ResourceTypeEnum.md docs/ResourceUser.md @@ -250,6 +259,8 @@ docs/TagsList.md docs/ThirdPartyProviderEnum.md docs/TicketPropagationConfiguration.md docs/TicketingProviderEnum.md +docs/Token.md +docs/TokensApi.md docs/UAR.md docs/UARReviewerAssignmentPolicyEnum.md docs/UARScope.md @@ -296,6 +307,7 @@ opal_security/api/requests_api.py opal_security/api/resources_api.py opal_security/api/sessions_api.py opal_security/api/tags_api.py +opal_security/api/tokens_api.py opal_security/api/uars_api.py opal_security/api/users_api.py opal_security/api_client.py @@ -312,6 +324,7 @@ opal_security/models/add_group_resource_request.py opal_security/models/add_group_user_request.py opal_security/models/add_resource_nhi_request.py opal_security/models/add_resource_user_request.py +opal_security/models/api_access_level_enum.py opal_security/models/app.py opal_security/models/app_type_enum.py opal_security/models/app_validation.py @@ -364,6 +377,7 @@ opal_security/models/group_remote_info_active_directory_group.py opal_security/models/group_remote_info_aws_sso_group.py opal_security/models/group_remote_info_azure_ad_microsoft365_group.py opal_security/models/group_remote_info_azure_ad_security_group.py +opal_security/models/group_remote_info_clickhouse_role.py opal_security/models/group_remote_info_connector_group.py opal_security/models/group_remote_info_databricks_account_group.py opal_security/models/group_remote_info_devin_group.py @@ -380,6 +394,7 @@ opal_security/models/group_remote_info_pagerduty_on_call_schedule.py opal_security/models/group_remote_info_rootly_on_call_schedule.py opal_security/models/group_remote_info_snowflake_role.py opal_security/models/group_remote_info_tailscale_group.py +opal_security/models/group_remote_info_twingate_group.py opal_security/models/group_remote_info_workday_user_security_group.py opal_security/models/group_resource.py opal_security/models/group_resource_list.py @@ -412,6 +427,7 @@ opal_security/models/paginated_owners_list.py opal_security/models/paginated_remote_users_list.py opal_security/models/paginated_resources_list.py opal_security/models/paginated_tags_list.py +opal_security/models/paginated_tokens_list.py opal_security/models/paginated_uars_list.py opal_security/models/paginated_users_list.py opal_security/models/propagation_status.py @@ -463,10 +479,13 @@ opal_security/models/resource_remote_info_azure_storage_container.py opal_security/models/resource_remote_info_azure_subscription.py opal_security/models/resource_remote_info_azure_user_assigned_managed_identity.py opal_security/models/resource_remote_info_azure_virtual_machine.py +opal_security/models/resource_remote_info_clickhouse_database.py +opal_security/models/resource_remote_info_clickhouse_table.py opal_security/models/resource_remote_info_coupa_role.py opal_security/models/resource_remote_info_cursor_organization.py opal_security/models/resource_remote_info_custom_connector.py opal_security/models/resource_remote_info_databricks_account_service_principal.py +opal_security/models/resource_remote_info_datadog_role.py opal_security/models/resource_remote_info_datastax_astra_role.py opal_security/models/resource_remote_info_devin_organization.py opal_security/models/resource_remote_info_devin_role.py @@ -487,6 +506,7 @@ opal_security/models/resource_remote_info_github_repo.py opal_security/models/resource_remote_info_gitlab_project.py opal_security/models/resource_remote_info_google_workspace_role.py opal_security/models/resource_remote_info_ilevel_advanced_role.py +opal_security/models/resource_remote_info_netsuite_role.py opal_security/models/resource_remote_info_okta_app.py opal_security/models/resource_remote_info_okta_custom_role.py opal_security/models/resource_remote_info_okta_standard_role.py @@ -502,6 +522,7 @@ opal_security/models/resource_remote_info_snowflake_schema.py opal_security/models/resource_remote_info_snowflake_table.py opal_security/models/resource_remote_info_tailscale_ssh.py opal_security/models/resource_remote_info_teleport_role.py +opal_security/models/resource_remote_info_twingate_resource.py opal_security/models/resource_remote_info_workday_role.py opal_security/models/resource_type_enum.py opal_security/models/resource_user.py @@ -533,6 +554,7 @@ opal_security/models/tags_list.py opal_security/models/third_party_provider_enum.py opal_security/models/ticket_propagation_configuration.py opal_security/models/ticketing_provider_enum.py +opal_security/models/token.py opal_security/models/uar.py opal_security/models/uar_reviewer_assignment_policy_enum.py opal_security/models/uar_scope.py @@ -565,4 +587,15 @@ setup.cfg setup.py test-requirements.txt test/__init__.py +test/test_api_access_level_enum.py +test/test_group_remote_info_clickhouse_role.py +test/test_group_remote_info_twingate_group.py +test/test_paginated_tokens_list.py +test/test_resource_remote_info_clickhouse_database.py +test/test_resource_remote_info_clickhouse_table.py +test/test_resource_remote_info_datadog_role.py +test/test_resource_remote_info_netsuite_role.py +test/test_resource_remote_info_twingate_resource.py +test/test_token.py +test/test_tokens_api.py tox.ini diff --git a/README.md b/README.md index d02bce9..1ba7a07 100644 --- a/README.md +++ b/README.md @@ -168,6 +168,7 @@ Class | Method | HTTP request | Description *DelegationsApi* | [**get_delegation**](docs/DelegationsApi.md#get_delegation) | **GET** /delegations/{delegation_id} | Get delegation by ID *DelegationsApi* | [**get_delegations**](docs/DelegationsApi.md#get_delegations) | **GET** /delegations | Get delegations *EventsApi* | [**events**](docs/EventsApi.md#events) | **GET** /events | +*EventsApi* | [**get_event**](docs/EventsApi.md#get_event) | **GET** /events/{event_id} | Get event by ID *GroupBindingsApi* | [**create_group_binding**](docs/GroupBindingsApi.md#create_group_binding) | **POST** /group-bindings | *GroupBindingsApi* | [**delete_group_binding**](docs/GroupBindingsApi.md#delete_group_binding) | **DELETE** /group-bindings/{group_binding_id} | *GroupBindingsApi* | [**get_group_binding**](docs/GroupBindingsApi.md#get_group_binding) | **GET** /group-bindings/{group_binding_id} | Get group binding by ID @@ -268,6 +269,8 @@ Class | Method | HTTP request | Description *TagsApi* | [**remove_group_tag**](docs/TagsApi.md#remove_group_tag) | **DELETE** /tags/{tag_id}/groups/{group_id} | *TagsApi* | [**remove_resource_tag**](docs/TagsApi.md#remove_resource_tag) | **DELETE** /tags/{tag_id}/resources/{resource_id} | *TagsApi* | [**remove_user_tag**](docs/TagsApi.md#remove_user_tag) | **DELETE** /tags/{tag_id}/users/{user_id} | +*TokensApi* | [**delete_token**](docs/TokensApi.md#delete_token) | **DELETE** /tokens/{token_id} | Delete token +*TokensApi* | [**get_tokens**](docs/TokensApi.md#get_tokens) | **GET** /tokens | Get tokens *UarsApi* | [**create_uar**](docs/UarsApi.md#create_uar) | **POST** /uar | *UarsApi* | [**get_uar**](docs/UarsApi.md#get_uar) | **GET** /uar/{uar_id} | *UarsApi* | [**get_uars**](docs/UarsApi.md#get_uars) | **GET** /uars | @@ -288,6 +291,7 @@ Class | Method | HTTP request | Description - [AddGroupUserRequest](docs/AddGroupUserRequest.md) - [AddResourceNhiRequest](docs/AddResourceNhiRequest.md) - [AddResourceUserRequest](docs/AddResourceUserRequest.md) + - [ApiAccessLevelEnum](docs/ApiAccessLevelEnum.md) - [App](docs/App.md) - [AppTypeEnum](docs/AppTypeEnum.md) - [AppValidation](docs/AppValidation.md) @@ -340,6 +344,7 @@ Class | Method | HTTP request | Description - [GroupRemoteInfoAwsSsoGroup](docs/GroupRemoteInfoAwsSsoGroup.md) - [GroupRemoteInfoAzureAdMicrosoft365Group](docs/GroupRemoteInfoAzureAdMicrosoft365Group.md) - [GroupRemoteInfoAzureAdSecurityGroup](docs/GroupRemoteInfoAzureAdSecurityGroup.md) + - [GroupRemoteInfoClickhouseRole](docs/GroupRemoteInfoClickhouseRole.md) - [GroupRemoteInfoConnectorGroup](docs/GroupRemoteInfoConnectorGroup.md) - [GroupRemoteInfoDatabricksAccountGroup](docs/GroupRemoteInfoDatabricksAccountGroup.md) - [GroupRemoteInfoDevinGroup](docs/GroupRemoteInfoDevinGroup.md) @@ -356,6 +361,7 @@ Class | Method | HTTP request | Description - [GroupRemoteInfoRootlyOnCallSchedule](docs/GroupRemoteInfoRootlyOnCallSchedule.md) - [GroupRemoteInfoSnowflakeRole](docs/GroupRemoteInfoSnowflakeRole.md) - [GroupRemoteInfoTailscaleGroup](docs/GroupRemoteInfoTailscaleGroup.md) + - [GroupRemoteInfoTwingateGroup](docs/GroupRemoteInfoTwingateGroup.md) - [GroupRemoteInfoWorkdayUserSecurityGroup](docs/GroupRemoteInfoWorkdayUserSecurityGroup.md) - [GroupResource](docs/GroupResource.md) - [GroupResourceList](docs/GroupResourceList.md) @@ -388,6 +394,7 @@ Class | Method | HTTP request | Description - [PaginatedRemoteUsersList](docs/PaginatedRemoteUsersList.md) - [PaginatedResourcesList](docs/PaginatedResourcesList.md) - [PaginatedTagsList](docs/PaginatedTagsList.md) + - [PaginatedTokensList](docs/PaginatedTokensList.md) - [PaginatedUARsList](docs/PaginatedUARsList.md) - [PaginatedUsersList](docs/PaginatedUsersList.md) - [PropagationStatus](docs/PropagationStatus.md) @@ -439,10 +446,13 @@ Class | Method | HTTP request | Description - [ResourceRemoteInfoAzureSubscription](docs/ResourceRemoteInfoAzureSubscription.md) - [ResourceRemoteInfoAzureUserAssignedManagedIdentity](docs/ResourceRemoteInfoAzureUserAssignedManagedIdentity.md) - [ResourceRemoteInfoAzureVirtualMachine](docs/ResourceRemoteInfoAzureVirtualMachine.md) + - [ResourceRemoteInfoClickhouseDatabase](docs/ResourceRemoteInfoClickhouseDatabase.md) + - [ResourceRemoteInfoClickhouseTable](docs/ResourceRemoteInfoClickhouseTable.md) - [ResourceRemoteInfoCoupaRole](docs/ResourceRemoteInfoCoupaRole.md) - [ResourceRemoteInfoCursorOrganization](docs/ResourceRemoteInfoCursorOrganization.md) - [ResourceRemoteInfoCustomConnector](docs/ResourceRemoteInfoCustomConnector.md) - [ResourceRemoteInfoDatabricksAccountServicePrincipal](docs/ResourceRemoteInfoDatabricksAccountServicePrincipal.md) + - [ResourceRemoteInfoDatadogRole](docs/ResourceRemoteInfoDatadogRole.md) - [ResourceRemoteInfoDatastaxAstraRole](docs/ResourceRemoteInfoDatastaxAstraRole.md) - [ResourceRemoteInfoDevinOrganization](docs/ResourceRemoteInfoDevinOrganization.md) - [ResourceRemoteInfoDevinRole](docs/ResourceRemoteInfoDevinRole.md) @@ -463,6 +473,7 @@ Class | Method | HTTP request | Description - [ResourceRemoteInfoGitlabProject](docs/ResourceRemoteInfoGitlabProject.md) - [ResourceRemoteInfoGoogleWorkspaceRole](docs/ResourceRemoteInfoGoogleWorkspaceRole.md) - [ResourceRemoteInfoIlevelAdvancedRole](docs/ResourceRemoteInfoIlevelAdvancedRole.md) + - [ResourceRemoteInfoNetsuiteRole](docs/ResourceRemoteInfoNetsuiteRole.md) - [ResourceRemoteInfoOktaApp](docs/ResourceRemoteInfoOktaApp.md) - [ResourceRemoteInfoOktaCustomRole](docs/ResourceRemoteInfoOktaCustomRole.md) - [ResourceRemoteInfoOktaStandardRole](docs/ResourceRemoteInfoOktaStandardRole.md) @@ -478,6 +489,7 @@ Class | Method | HTTP request | Description - [ResourceRemoteInfoSnowflakeTable](docs/ResourceRemoteInfoSnowflakeTable.md) - [ResourceRemoteInfoTailscaleSsh](docs/ResourceRemoteInfoTailscaleSsh.md) - [ResourceRemoteInfoTeleportRole](docs/ResourceRemoteInfoTeleportRole.md) + - [ResourceRemoteInfoTwingateResource](docs/ResourceRemoteInfoTwingateResource.md) - [ResourceRemoteInfoWorkdayRole](docs/ResourceRemoteInfoWorkdayRole.md) - [ResourceTypeEnum](docs/ResourceTypeEnum.md) - [ResourceUser](docs/ResourceUser.md) @@ -509,6 +521,7 @@ Class | Method | HTTP request | Description - [ThirdPartyProviderEnum](docs/ThirdPartyProviderEnum.md) - [TicketPropagationConfiguration](docs/TicketPropagationConfiguration.md) - [TicketingProviderEnum](docs/TicketingProviderEnum.md) + - [Token](docs/Token.md) - [UAR](docs/UAR.md) - [UARReviewerAssignmentPolicyEnum](docs/UARReviewerAssignmentPolicyEnum.md) - [UARScope](docs/UARScope.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index e1dbfdc..dd34b00 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -46,6 +46,8 @@ tags: description: Operations related to sessions - name: tags description: Operations related to tags + - name: tokens + description: Operations related to API tokens - name: uars description: Operations related to UARs - name: users @@ -742,6 +744,35 @@ paths: - BearerAuth: [] tags: - events + /events/{event_id}: + get: + summary: Get event by ID + description: Returns an `Event` object. + operationId: getEvent + parameters: + - description: The ID of the event. + example: 29827fb8-f2dd-4e80-9576-28e31e9934ac + explode: true + in: path + name: event_id + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/Event" + description: The requested `Event`. + "404": + description: Event not found. + security: + - BearerAuth: [] + tags: + - events /groups: get: summary: Get groups @@ -800,6 +831,15 @@ paths: schema: type: string style: form + - description: The IDs of the tags to filter by. Returns only groups that have any of these tags applied. + in: query + name: tag_ids + required: false + schema: + type: array + items: + format: uuid + type: string responses: "200": content: @@ -1091,13 +1131,23 @@ paths: format: uuid type: string style: simple + - description: The access level's remote ID to filter by. + example: arn:aws:iam::590304332660:role/AdministratorAccess + explode: true + in: query + name: access_level_remote_id + required: false + schema: + type: string + style: form + responses: "200": content: application/json: schema: $ref: "#/components/schemas/GroupContainingGroupList" - description: The resources that the group gives access to. + description: The groups that the group gives access to. security: - BearerAuth: [] tags: @@ -2337,6 +2387,24 @@ paths: format: uuid type: string style: form + - description: Filter requests by the resource ID that was requested. + example: 37cb7e41-12ba-46da-92ff-030abe0450b1 + in: query + name: resource_id + required: false + schema: + format: uuid + type: string + style: form + - description: Filter requests by the group ID that was requested. + example: 37cb7e41-12ba-46da-92ff-030abe0450b1 + in: query + name: group_id + required: false + schema: + format: uuid + type: string + style: form - description: The pagination cursor value. example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw explode: true @@ -2732,6 +2800,16 @@ paths: schema: type: string style: form + - description: The IDs of the tags to filter by. Returns only resources that have any of these tags applied. + in: query + name: tag_ids + required: false + schema: + type: array + items: + format: uuid + type: string + style: form responses: "200": content: @@ -3834,6 +3912,16 @@ paths: type: integer maximum: 1000 style: form + - description: The IDs of the tags to filter by. Returns only users that have any of these tags applied. + in: query + name: tag_ids + required: false + schema: + type: array + items: + format: uuid + type: string + style: form responses: "200": content: @@ -4507,6 +4595,90 @@ paths: - BearerAuth: [] tags: - on-call-schedules + /tokens: + get: + summary: Get tokens + description: Returns a list of first-party API tokens for your organization. Requires admin access. + operationId: getTokens + parameters: + - description: The pagination cursor value. + example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + explode: true + in: query + name: cursor + required: false + schema: + type: string + style: form + - description: Number of results to return per page. Default is 200. + example: 200 + explode: true + in: query + name: page_size + required: false + schema: + type: integer + maximum: 1000 + style: form + - description: Filter by token IDs. + explode: false + in: query + name: token_ids + required: false + schema: + items: + format: uuid + type: string + type: array + style: form + - description: Filter by user ID. + example: 29827fb8-f2dd-4e80-9576-28e31e9934ac + explode: true + in: query + name: user_id + required: false + schema: + format: uuid + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/PaginatedTokensList" + description: A list of API tokens for your organization. + security: + - BearerAuth: [] + tags: + - tokens + /tokens/{token_id}: + delete: + summary: Delete token + description: Deletes a first-party API token. Admins can delete any token. Non-admins can only delete their own tokens when the organization allows all users to create API tokens. + operationId: deleteToken + parameters: + - description: The ID of the token to delete. + example: f454d283-ca87-4a8a-bdbb-df212eca5353 + explode: false + in: path + name: token_id + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + description: The token was successfully deleted. + "403": + description: Not authorized to delete this token. + "404": + description: Token not found. + security: + - BearerAuth: [] + tags: + - tokens /uars: get: description: Returns a list of `UAR` objects. @@ -5210,6 +5382,7 @@ components: - COUPA - CURSOR - CUSTOM + - CUSTOM_CONNECTOR - DATABRICKS - DATASTAX_ASTRA - DUO @@ -5225,6 +5398,8 @@ components: - MONGO - MONGO_ATLAS - MYSQL + - NETSUITE + - DATADOG - OKTA_DIRECTORY - OPENAI_PLATFORM - OPAL @@ -5233,6 +5408,7 @@ components: - SNOWFLAKE - TAILSCALE - TELEPORT + - TWINGATE - WORKDAY example: OKTA_DIRECTORY type: string @@ -6646,6 +6822,9 @@ components: - ROOTLY_ON_CALL_SCHEDULE - DEVIN_GROUP - GIT_HUB_ENTERPRISE_TEAM + - GRAFANA_TEAM + - CLICKHOUSE_ROLE + - TWINGATE_GROUP example: OPAL_GROUP type: string ResourceTypeEnum: @@ -6694,6 +6873,8 @@ components: - GOOGLE_WORKSPACE_ROLE - MONGO_INSTANCE - MONGO_ATLAS_INSTANCE + - NETSUITE_ROLE + - DATADOG_ROLE - OKTA_APP - OKTA_ROLE - OPAL_ROLE @@ -6726,6 +6907,13 @@ components: - VAULT_POLICY - VAULT_OIDC_ROLE - GIT_HUB_ENTERPRISE_ROLE + - GRAFANA_FOLDER + - GRAFANA_DASHBOARD + - GRAFANA_BASIC_ROLE + - GRAFANA_ROLE + - CLICKHOUSE_DATABASE + - CLICKHOUSE_TABLE + - TWINGATE_RESOURCE example: AWS_IAM_ROLE type: string VisibilityTypeEnum: @@ -7018,6 +7206,8 @@ components: owner_ids: - 7870617d-e72a-47f5-a84c-693817ab4567 - 1520617d-e72a-47f5-a84c-693817ab48ad2 + service_user_ids: + - 7870617d-e72a-47f5-a84c-693817ab4568 properties: require_manager_approval: description: Whether this reviewer stage should require manager approval. @@ -7035,6 +7225,13 @@ components: example: AND type: string owner_ids: + description: The IDs of owners assigned as reviewers for this stage. + items: + type: string + format: uuid + type: array + service_user_ids: + description: The IDs of service users assigned as reviewers for this stage. items: type: string format: uuid @@ -7200,6 +7397,16 @@ components: type: object required: - group_id + twingate_group: + description: Remote info for Twingate group. + properties: + group_id: + description: The id of the Twingate group. + example: R3JvdXA6MTIzNA== + type: string + type: object + required: + - group_id aws_sso_group: description: Remote info for AWS SSO group. properties: @@ -7395,6 +7602,16 @@ components: type: object required: - group_name + clickhouse_role: + description: Remote info for ClickHouse role. + properties: + role_id: + description: The name of the ClickHouse role. + example: my_clickhouse_role + type: string + type: object + required: + - role_id type: object ResourceRemoteInfo: description: Information that defines the remote resource. This replaces the deprecated remote_id and metadata fields. @@ -8007,6 +8224,16 @@ components: type: object required: - tag_name + twingate_resource: + description: Remote info for Twingate resource. + properties: + resource_id: + description: The id of the Twingate resource. + example: UmVzb3VyY2U6MTIzNA== + type: string + type: object + required: + - resource_id pagerduty_role: description: Remote info for Pagerduty role. properties: @@ -8168,6 +8395,51 @@ components: type: object required: - role_id + netsuite_role: + description: Remote info for NetSuite role. + properties: + role_id: + description: The id of the role. + example: 123e4567-e89b-12d3-a456-426614174000 + type: string + type: object + required: + - role_id + datadog_role: + description: Remote info for Datadog role. + properties: + role_id: + description: The id of the role. + example: 123e4567-e89b-12d3-a456-426614174000 + type: string + type: object + required: + - role_id + clickhouse_database: + description: Remote info for ClickHouse database. + properties: + database_name: + description: The name of the ClickHouse database. + example: my_database + type: string + type: object + required: + - database_name + clickhouse_table: + description: Remote info for ClickHouse table. + properties: + database_name: + description: The name of the ClickHouse database containing the table. + example: my_database + type: string + table_name: + description: The name of the ClickHouse table. + example: my_table + type: string + type: object + required: + - database_name + - table_name type: object RiskSensitivityEnum: type: string @@ -11196,6 +11468,98 @@ components: - start_time - end_time - reason + ApiAccessLevelEnum: + description: The access level of an API token. + enum: + - READ_ONLY + - FULL_ACCESS + type: string + Token: + description: A first-party API token. + example: + token_id: f454d283-ca87-4a8a-bdbb-df212eca5353 + created_at: 2022-01-23T04:56:07Z + token_preview: ab123 + token_label: My API Token + creator_user_id: d4a7d928-783e-4599-8ec6-088d635a5bcc + user_id: d4a7d928-783e-4599-8ec6-088d635a5bcc + access_level: READ_ONLY + properties: + token_id: + description: The ID of the API token. + example: f454d283-ca87-4a8a-bdbb-df212eca5353 + format: uuid + type: string + created_at: + description: The date and time the token was created. + example: 2022-01-23T04:56:07Z + format: date-time + type: string + token_label: + description: A human-readable label for the token. + example: My API Token + type: string + creator_user_id: + description: The ID of the user who created the token. + example: d4a7d928-783e-4599-8ec6-088d635a5bcc + format: uuid + type: string + user_id: + description: The ID of the user the token authenticates as. + example: d4a7d928-783e-4599-8ec6-088d635a5bcc + format: uuid + type: string + last_used_at: + description: The date and time the token was last used. + example: 2022-01-23T04:56:07Z + format: date-time + nullable: true + type: string + access_level: + $ref: "#/components/schemas/ApiAccessLevelEnum" + expires_at: + description: The date and time the token expires. + example: 2023-01-23T04:56:07Z + format: date-time + nullable: true + type: string + required: + - token_id + - created_at + - token_label + - creator_user_id + - user_id + - access_level + type: object + PaginatedTokensList: + example: + next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + results: + - token_id: f454d283-ca87-4a8a-bdbb-df212eca5353 + created_at: 2022-01-23T04:56:07Z + token_label: My API Token + creator_user_id: d4a7d928-783e-4599-8ec6-088d635a5bcc + user_id: d4a7d928-783e-4599-8ec6-088d635a5bcc + access_level: READ_ONLY + properties: + next: + description: The cursor with which to continue pagination if additional result pages exist. + example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + nullable: true + type: string + previous: + description: The cursor used to obtain the current result page. + example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + nullable: true + type: string + results: + items: + $ref: "#/components/schemas/Token" + type: array + required: + - results + type: object securitySchemes: BearerAuth: scheme: bearer diff --git a/docs/ApiAccessLevelEnum.md b/docs/ApiAccessLevelEnum.md new file mode 100644 index 0000000..4b74de5 --- /dev/null +++ b/docs/ApiAccessLevelEnum.md @@ -0,0 +1,13 @@ +# ApiAccessLevelEnum + +The access level of an API token. + +## Enum + +* `READ_ONLY` (value: `'READ_ONLY'`) + +* `FULL_ACCESS` (value: `'FULL_ACCESS'`) + +[[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/docs/AppTypeEnum.md b/docs/AppTypeEnum.md index 39ddd28..9b9198a 100644 --- a/docs/AppTypeEnum.md +++ b/docs/AppTypeEnum.md @@ -20,6 +20,8 @@ The type of an app. * `CUSTOM` (value: `'CUSTOM'`) +* `CUSTOM_CONNECTOR` (value: `'CUSTOM_CONNECTOR'`) + * `DATABRICKS` (value: `'DATABRICKS'`) * `DATASTAX_ASTRA` (value: `'DATASTAX_ASTRA'`) @@ -50,6 +52,10 @@ The type of an app. * `MYSQL` (value: `'MYSQL'`) +* `NETSUITE` (value: `'NETSUITE'`) + +* `DATADOG` (value: `'DATADOG'`) + * `OKTA_DIRECTORY` (value: `'OKTA_DIRECTORY'`) * `OPENAI_PLATFORM` (value: `'OPENAI_PLATFORM'`) @@ -66,6 +72,8 @@ The type of an app. * `TELEPORT` (value: `'TELEPORT'`) +* `TWINGATE` (value: `'TWINGATE'`) + * `WORKDAY` (value: `'WORKDAY'`) [[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/docs/EventsApi.md b/docs/EventsApi.md index d71cefc..610eabc 100644 --- a/docs/EventsApi.md +++ b/docs/EventsApi.md @@ -5,6 +5,7 @@ All URIs are relative to *https://api.opal.dev/v1* Method | HTTP request | Description ------------- | ------------- | ------------- [**events**](EventsApi.md#events) | **GET** /events | +[**get_event**](EventsApi.md#get_event) | **GET** /events/{event_id} | Get event by ID # **events** @@ -98,3 +99,84 @@ Name | Type | Description | Notes [[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_event** +> Event get_event(event_id) + +Get event by ID + +Returns an `Event` object. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import opal_security +from opal_security.models.event import Event +from opal_security.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +import opal_security as opal + +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# 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 = opal.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with opal_security.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = opal_security.EventsApi(api_client) + event_id = UUID('29827fb8-f2dd-4e80-9576-28e31e9934ac') # UUID | The ID of the event. + + try: + # Get event by ID + api_response = api_instance.get_event(event_id) + print("The response of EventsApi->get_event:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EventsApi->get_event: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **event_id** | **UUID**| The ID of the event. | + +### Return type + +[**Event**](Event.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The requested `Event`. | - | +**404** | Event not found. | - | + +[[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/docs/GroupRemoteInfo.md b/docs/GroupRemoteInfo.md index 8c437a9..9246310 100644 --- a/docs/GroupRemoteInfo.md +++ b/docs/GroupRemoteInfo.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **active_directory_group** | [**GroupRemoteInfoActiveDirectoryGroup**](GroupRemoteInfoActiveDirectoryGroup.md) | | [optional] **tailscale_group** | [**GroupRemoteInfoTailscaleGroup**](GroupRemoteInfoTailscaleGroup.md) | | [optional] +**twingate_group** | [**GroupRemoteInfoTwingateGroup**](GroupRemoteInfoTwingateGroup.md) | | [optional] **aws_sso_group** | [**GroupRemoteInfoAwsSsoGroup**](GroupRemoteInfoAwsSsoGroup.md) | | [optional] **databricks_account_group** | [**GroupRemoteInfoDatabricksAccountGroup**](GroupRemoteInfoDatabricksAccountGroup.md) | | [optional] **connector_group** | [**GroupRemoteInfoConnectorGroup**](GroupRemoteInfoConnectorGroup.md) | | [optional] @@ -27,6 +28,7 @@ Name | Type | Description | Notes **incidentio_on_call_schedule** | [**GroupRemoteInfoIncidentioOnCallSchedule**](GroupRemoteInfoIncidentioOnCallSchedule.md) | | [optional] **rootly_on_call_schedule** | [**GroupRemoteInfoRootlyOnCallSchedule**](GroupRemoteInfoRootlyOnCallSchedule.md) | | [optional] **devin_group** | [**GroupRemoteInfoDevinGroup**](GroupRemoteInfoDevinGroup.md) | | [optional] +**clickhouse_role** | [**GroupRemoteInfoClickhouseRole**](GroupRemoteInfoClickhouseRole.md) | | [optional] ## Example diff --git a/docs/GroupRemoteInfoClickhouseRole.md b/docs/GroupRemoteInfoClickhouseRole.md new file mode 100644 index 0000000..84e3c32 --- /dev/null +++ b/docs/GroupRemoteInfoClickhouseRole.md @@ -0,0 +1,30 @@ +# GroupRemoteInfoClickhouseRole + +Remote info for ClickHouse role. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**role_id** | **str** | The name of the ClickHouse role. | + +## Example + +```python +from opal_security.models.group_remote_info_clickhouse_role import GroupRemoteInfoClickhouseRole + +# TODO update the JSON string below +json = "{}" +# create an instance of GroupRemoteInfoClickhouseRole from a JSON string +group_remote_info_clickhouse_role_instance = GroupRemoteInfoClickhouseRole.from_json(json) +# print the JSON string representation of the object +print(GroupRemoteInfoClickhouseRole.to_json()) + +# convert the object into a dict +group_remote_info_clickhouse_role_dict = group_remote_info_clickhouse_role_instance.to_dict() +# create an instance of GroupRemoteInfoClickhouseRole from a dict +group_remote_info_clickhouse_role_from_dict = GroupRemoteInfoClickhouseRole.from_dict(group_remote_info_clickhouse_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/docs/GroupRemoteInfoTwingateGroup.md b/docs/GroupRemoteInfoTwingateGroup.md new file mode 100644 index 0000000..bb96f34 --- /dev/null +++ b/docs/GroupRemoteInfoTwingateGroup.md @@ -0,0 +1,30 @@ +# GroupRemoteInfoTwingateGroup + +Remote info for Twingate group. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**group_id** | **str** | The id of the Twingate group. | + +## Example + +```python +from opal_security.models.group_remote_info_twingate_group import GroupRemoteInfoTwingateGroup + +# TODO update the JSON string below +json = "{}" +# create an instance of GroupRemoteInfoTwingateGroup from a JSON string +group_remote_info_twingate_group_instance = GroupRemoteInfoTwingateGroup.from_json(json) +# print the JSON string representation of the object +print(GroupRemoteInfoTwingateGroup.to_json()) + +# convert the object into a dict +group_remote_info_twingate_group_dict = group_remote_info_twingate_group_instance.to_dict() +# create an instance of GroupRemoteInfoTwingateGroup from a dict +group_remote_info_twingate_group_from_dict = GroupRemoteInfoTwingateGroup.from_dict(group_remote_info_twingate_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/docs/GroupTypeEnum.md b/docs/GroupTypeEnum.md index bde50ae..21cf51a 100644 --- a/docs/GroupTypeEnum.md +++ b/docs/GroupTypeEnum.md @@ -52,6 +52,12 @@ The type of the group. * `GIT_HUB_ENTERPRISE_TEAM` (value: `'GIT_HUB_ENTERPRISE_TEAM'`) +* `GRAFANA_TEAM` (value: `'GRAFANA_TEAM'`) + +* `CLICKHOUSE_ROLE` (value: `'CLICKHOUSE_ROLE'`) + +* `TWINGATE_GROUP` (value: `'TWINGATE_GROUP'`) + [[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/docs/GroupsApi.md b/docs/GroupsApi.md index 8ffc357..d311da4 100644 --- a/docs/GroupsApi.md +++ b/docs/GroupsApi.md @@ -676,7 +676,7 @@ Name | Type | Description | Notes [[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_group_containing_groups** -> GroupContainingGroupList get_group_containing_groups(group_id) +> GroupContainingGroupList get_group_containing_groups(group_id, access_level_remote_id=access_level_remote_id) Get nested groups @@ -715,10 +715,11 @@ with opal_security.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = opal_security.GroupsApi(api_client) group_id = UUID('4baf8423-db0a-4037-a4cf-f79c60cb67a5') # UUID | The ID of the group. + access_level_remote_id = 'arn:aws:iam::590304332660:role/AdministratorAccess' # str | The access level's remote ID to filter by. (optional) try: # Get nested groups - api_response = api_instance.get_group_containing_groups(group_id) + api_response = api_instance.get_group_containing_groups(group_id, access_level_remote_id=access_level_remote_id) print("The response of GroupsApi->get_group_containing_groups:\n") pprint(api_response) except Exception as e: @@ -733,6 +734,7 @@ with opal_security.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **UUID**| The ID of the group. | + **access_level_remote_id** | **str**| The access level's remote ID to filter by. | [optional] ### Return type @@ -751,7 +753,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | The resources that the group gives access to. | - | +**200** | The groups that the group gives access to. | - | [[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) @@ -1375,7 +1377,7 @@ Name | Type | Description | Notes [[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_groups** -> PaginatedGroupsList get_groups(cursor=cursor, page_size=page_size, group_type_filter=group_type_filter, group_ids=group_ids, group_name=group_name) +> PaginatedGroupsList get_groups(cursor=cursor, page_size=page_size, group_type_filter=group_type_filter, group_ids=group_ids, group_name=group_name, tag_ids=tag_ids) Get groups @@ -1419,10 +1421,11 @@ with opal_security.ApiClient(configuration) as api_client: group_type_filter = opal_security.GroupTypeEnum() # GroupTypeEnum | The group type to filter by. (optional) group_ids = [["4baf8423-db0a-4037-a4cf-f79c60cb67a5","1b978423-db0a-4037-a4cf-f79c60cb67b3"]] # List[UUID] | The group ids to filter by. (optional) group_name = 'example-name' # str | Group name. (optional) + tag_ids = None # List[UUID] | The IDs of the tags to filter by. Returns only groups that have any of these tags applied. (optional) try: # Get groups - api_response = api_instance.get_groups(cursor=cursor, page_size=page_size, group_type_filter=group_type_filter, group_ids=group_ids, group_name=group_name) + api_response = api_instance.get_groups(cursor=cursor, page_size=page_size, group_type_filter=group_type_filter, group_ids=group_ids, group_name=group_name, tag_ids=tag_ids) print("The response of GroupsApi->get_groups:\n") pprint(api_response) except Exception as e: @@ -1441,6 +1444,7 @@ Name | Type | Description | Notes **group_type_filter** | [**GroupTypeEnum**](.md)| The group type to filter by. | [optional] **group_ids** | [**List[UUID]**](UUID.md)| The group ids to filter by. | [optional] **group_name** | **str**| Group name. | [optional] + **tag_ids** | [**List[UUID]**](UUID.md)| The IDs of the tags to filter by. Returns only groups that have any of these tags applied. | [optional] ### Return type diff --git a/docs/PaginatedTokensList.md b/docs/PaginatedTokensList.md new file mode 100644 index 0000000..d58d383 --- /dev/null +++ b/docs/PaginatedTokensList.md @@ -0,0 +1,31 @@ +# PaginatedTokensList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next** | **str** | The cursor with which to continue pagination if additional result pages exist. | [optional] +**previous** | **str** | The cursor used to obtain the current result page. | [optional] +**results** | [**List[Token]**](Token.md) | | + +## Example + +```python +from opal_security.models.paginated_tokens_list import PaginatedTokensList + +# TODO update the JSON string below +json = "{}" +# create an instance of PaginatedTokensList from a JSON string +paginated_tokens_list_instance = PaginatedTokensList.from_json(json) +# print the JSON string representation of the object +print(PaginatedTokensList.to_json()) + +# convert the object into a dict +paginated_tokens_list_dict = paginated_tokens_list_instance.to_dict() +# create an instance of PaginatedTokensList from a dict +paginated_tokens_list_from_dict = PaginatedTokensList.from_dict(paginated_tokens_list_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/docs/RequestsApi.md b/docs/RequestsApi.md index dd23ce1..20b3a31 100644 --- a/docs/RequestsApi.md +++ b/docs/RequestsApi.md @@ -490,7 +490,7 @@ Name | Type | Description | Notes [[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_requests** -> RequestList get_requests(start_date_filter=start_date_filter, end_date_filter=end_date_filter, requester_id=requester_id, target_user_id=target_user_id, cursor=cursor, page_size=page_size, show_pending_only=show_pending_only) +> RequestList get_requests(start_date_filter=start_date_filter, end_date_filter=end_date_filter, requester_id=requester_id, target_user_id=target_user_id, resource_id=resource_id, group_id=group_id, cursor=cursor, page_size=page_size, show_pending_only=show_pending_only) Get requests @@ -532,13 +532,15 @@ with opal_security.ApiClient(configuration) as api_client: end_date_filter = '2021-11-12' # str | An end date filter for the events. (optional) requester_id = UUID('37cb7e41-12ba-46da-92ff-030abe0450b1') # UUID | Filter requests by their requester ID. (optional) target_user_id = UUID('37cb7e41-12ba-46da-92ff-030abe0450b1') # UUID | Filter requests by their target user ID. (optional) + resource_id = UUID('37cb7e41-12ba-46da-92ff-030abe0450b1') # UUID | Filter requests by the resource ID that was requested. (optional) + group_id = UUID('37cb7e41-12ba-46da-92ff-030abe0450b1') # UUID | Filter requests by the group ID that was requested. (optional) cursor = 'cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw' # str | The pagination cursor value. (optional) page_size = 200 # int | Number of results to return per page. Default is 200. (optional) show_pending_only = True # bool | Boolean toggle for if it should only show pending requests. (optional) try: # Get requests - api_response = api_instance.get_requests(start_date_filter=start_date_filter, end_date_filter=end_date_filter, requester_id=requester_id, target_user_id=target_user_id, cursor=cursor, page_size=page_size, show_pending_only=show_pending_only) + api_response = api_instance.get_requests(start_date_filter=start_date_filter, end_date_filter=end_date_filter, requester_id=requester_id, target_user_id=target_user_id, resource_id=resource_id, group_id=group_id, cursor=cursor, page_size=page_size, show_pending_only=show_pending_only) print("The response of RequestsApi->get_requests:\n") pprint(api_response) except Exception as e: @@ -556,6 +558,8 @@ Name | Type | Description | Notes **end_date_filter** | **str**| An end date filter for the events. | [optional] **requester_id** | **UUID**| Filter requests by their requester ID. | [optional] **target_user_id** | **UUID**| Filter requests by their target user ID. | [optional] + **resource_id** | **UUID**| Filter requests by the resource ID that was requested. | [optional] + **group_id** | **UUID**| Filter requests by the group ID that was requested. | [optional] **cursor** | **str**| The pagination cursor value. | [optional] **page_size** | **int**| Number of results to return per page. Default is 200. | [optional] **show_pending_only** | **bool**| Boolean toggle for if it should only show pending requests. | [optional] diff --git a/docs/ResourceRemoteInfo.md b/docs/ResourceRemoteInfo.md index 0f3b9f7..b78ff34 100644 --- a/docs/ResourceRemoteInfo.md +++ b/docs/ResourceRemoteInfo.md @@ -53,6 +53,7 @@ Name | Type | Description | Notes **snowflake_table** | [**ResourceRemoteInfoSnowflakeTable**](ResourceRemoteInfoSnowflakeTable.md) | | [optional] **ilevel_advanced_role** | [**ResourceRemoteInfoIlevelAdvancedRole**](ResourceRemoteInfoIlevelAdvancedRole.md) | | [optional] **tailscale_ssh** | [**ResourceRemoteInfoTailscaleSsh**](ResourceRemoteInfoTailscaleSsh.md) | | [optional] +**twingate_resource** | [**ResourceRemoteInfoTwingateResource**](ResourceRemoteInfoTwingateResource.md) | | [optional] **pagerduty_role** | [**ResourceRemoteInfoPagerdutyRole**](ResourceRemoteInfoPagerdutyRole.md) | | [optional] **workday_role** | [**ResourceRemoteInfoWorkdayRole**](ResourceRemoteInfoWorkdayRole.md) | | [optional] **salesforce_permission_set** | [**ResourceRemoteInfoSalesforcePermissionSet**](ResourceRemoteInfoSalesforcePermissionSet.md) | | [optional] @@ -68,6 +69,10 @@ Name | Type | Description | Notes **oracle_fusion_role** | [**ResourceRemoteInfoOracleFusionRole**](ResourceRemoteInfoOracleFusionRole.md) | | [optional] **devin_organization** | [**ResourceRemoteInfoDevinOrganization**](ResourceRemoteInfoDevinOrganization.md) | | [optional] **devin_role** | [**ResourceRemoteInfoDevinRole**](ResourceRemoteInfoDevinRole.md) | | [optional] +**netsuite_role** | [**ResourceRemoteInfoNetsuiteRole**](ResourceRemoteInfoNetsuiteRole.md) | | [optional] +**datadog_role** | [**ResourceRemoteInfoDatadogRole**](ResourceRemoteInfoDatadogRole.md) | | [optional] +**clickhouse_database** | [**ResourceRemoteInfoClickhouseDatabase**](ResourceRemoteInfoClickhouseDatabase.md) | | [optional] +**clickhouse_table** | [**ResourceRemoteInfoClickhouseTable**](ResourceRemoteInfoClickhouseTable.md) | | [optional] ## Example diff --git a/docs/ResourceRemoteInfoClickhouseDatabase.md b/docs/ResourceRemoteInfoClickhouseDatabase.md new file mode 100644 index 0000000..8c2b6f5 --- /dev/null +++ b/docs/ResourceRemoteInfoClickhouseDatabase.md @@ -0,0 +1,30 @@ +# ResourceRemoteInfoClickhouseDatabase + +Remote info for ClickHouse database. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**database_name** | **str** | The name of the ClickHouse database. | + +## Example + +```python +from opal_security.models.resource_remote_info_clickhouse_database import ResourceRemoteInfoClickhouseDatabase + +# TODO update the JSON string below +json = "{}" +# create an instance of ResourceRemoteInfoClickhouseDatabase from a JSON string +resource_remote_info_clickhouse_database_instance = ResourceRemoteInfoClickhouseDatabase.from_json(json) +# print the JSON string representation of the object +print(ResourceRemoteInfoClickhouseDatabase.to_json()) + +# convert the object into a dict +resource_remote_info_clickhouse_database_dict = resource_remote_info_clickhouse_database_instance.to_dict() +# create an instance of ResourceRemoteInfoClickhouseDatabase from a dict +resource_remote_info_clickhouse_database_from_dict = ResourceRemoteInfoClickhouseDatabase.from_dict(resource_remote_info_clickhouse_database_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/docs/ResourceRemoteInfoClickhouseTable.md b/docs/ResourceRemoteInfoClickhouseTable.md new file mode 100644 index 0000000..b52bfaf --- /dev/null +++ b/docs/ResourceRemoteInfoClickhouseTable.md @@ -0,0 +1,31 @@ +# ResourceRemoteInfoClickhouseTable + +Remote info for ClickHouse table. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**database_name** | **str** | The name of the ClickHouse database containing the table. | +**table_name** | **str** | The name of the ClickHouse table. | + +## Example + +```python +from opal_security.models.resource_remote_info_clickhouse_table import ResourceRemoteInfoClickhouseTable + +# TODO update the JSON string below +json = "{}" +# create an instance of ResourceRemoteInfoClickhouseTable from a JSON string +resource_remote_info_clickhouse_table_instance = ResourceRemoteInfoClickhouseTable.from_json(json) +# print the JSON string representation of the object +print(ResourceRemoteInfoClickhouseTable.to_json()) + +# convert the object into a dict +resource_remote_info_clickhouse_table_dict = resource_remote_info_clickhouse_table_instance.to_dict() +# create an instance of ResourceRemoteInfoClickhouseTable from a dict +resource_remote_info_clickhouse_table_from_dict = ResourceRemoteInfoClickhouseTable.from_dict(resource_remote_info_clickhouse_table_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/docs/ResourceRemoteInfoDatadogRole.md b/docs/ResourceRemoteInfoDatadogRole.md new file mode 100644 index 0000000..30d6526 --- /dev/null +++ b/docs/ResourceRemoteInfoDatadogRole.md @@ -0,0 +1,30 @@ +# ResourceRemoteInfoDatadogRole + +Remote info for Datadog role. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**role_id** | **str** | The id of the role. | + +## Example + +```python +from opal_security.models.resource_remote_info_datadog_role import ResourceRemoteInfoDatadogRole + +# TODO update the JSON string below +json = "{}" +# create an instance of ResourceRemoteInfoDatadogRole from a JSON string +resource_remote_info_datadog_role_instance = ResourceRemoteInfoDatadogRole.from_json(json) +# print the JSON string representation of the object +print(ResourceRemoteInfoDatadogRole.to_json()) + +# convert the object into a dict +resource_remote_info_datadog_role_dict = resource_remote_info_datadog_role_instance.to_dict() +# create an instance of ResourceRemoteInfoDatadogRole from a dict +resource_remote_info_datadog_role_from_dict = ResourceRemoteInfoDatadogRole.from_dict(resource_remote_info_datadog_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/docs/ResourceRemoteInfoNetsuiteRole.md b/docs/ResourceRemoteInfoNetsuiteRole.md new file mode 100644 index 0000000..db16829 --- /dev/null +++ b/docs/ResourceRemoteInfoNetsuiteRole.md @@ -0,0 +1,30 @@ +# ResourceRemoteInfoNetsuiteRole + +Remote info for NetSuite role. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**role_id** | **str** | The id of the role. | + +## Example + +```python +from opal_security.models.resource_remote_info_netsuite_role import ResourceRemoteInfoNetsuiteRole + +# TODO update the JSON string below +json = "{}" +# create an instance of ResourceRemoteInfoNetsuiteRole from a JSON string +resource_remote_info_netsuite_role_instance = ResourceRemoteInfoNetsuiteRole.from_json(json) +# print the JSON string representation of the object +print(ResourceRemoteInfoNetsuiteRole.to_json()) + +# convert the object into a dict +resource_remote_info_netsuite_role_dict = resource_remote_info_netsuite_role_instance.to_dict() +# create an instance of ResourceRemoteInfoNetsuiteRole from a dict +resource_remote_info_netsuite_role_from_dict = ResourceRemoteInfoNetsuiteRole.from_dict(resource_remote_info_netsuite_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/docs/ResourceRemoteInfoTwingateResource.md b/docs/ResourceRemoteInfoTwingateResource.md new file mode 100644 index 0000000..5fe8e2e --- /dev/null +++ b/docs/ResourceRemoteInfoTwingateResource.md @@ -0,0 +1,30 @@ +# ResourceRemoteInfoTwingateResource + +Remote info for Twingate resource. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resource_id** | **str** | The id of the Twingate resource. | + +## Example + +```python +from opal_security.models.resource_remote_info_twingate_resource import ResourceRemoteInfoTwingateResource + +# TODO update the JSON string below +json = "{}" +# create an instance of ResourceRemoteInfoTwingateResource from a JSON string +resource_remote_info_twingate_resource_instance = ResourceRemoteInfoTwingateResource.from_json(json) +# print the JSON string representation of the object +print(ResourceRemoteInfoTwingateResource.to_json()) + +# convert the object into a dict +resource_remote_info_twingate_resource_dict = resource_remote_info_twingate_resource_instance.to_dict() +# create an instance of ResourceRemoteInfoTwingateResource from a dict +resource_remote_info_twingate_resource_from_dict = ResourceRemoteInfoTwingateResource.from_dict(resource_remote_info_twingate_resource_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/docs/ResourceTypeEnum.md b/docs/ResourceTypeEnum.md index e05e8b5..485a8c5 100644 --- a/docs/ResourceTypeEnum.md +++ b/docs/ResourceTypeEnum.md @@ -90,6 +90,10 @@ The type of the resource. * `MONGO_ATLAS_INSTANCE` (value: `'MONGO_ATLAS_INSTANCE'`) +* `NETSUITE_ROLE` (value: `'NETSUITE_ROLE'`) + +* `DATADOG_ROLE` (value: `'DATADOG_ROLE'`) + * `OKTA_APP` (value: `'OKTA_APP'`) * `OKTA_ROLE` (value: `'OKTA_ROLE'`) @@ -154,6 +158,20 @@ The type of the resource. * `GIT_HUB_ENTERPRISE_ROLE` (value: `'GIT_HUB_ENTERPRISE_ROLE'`) +* `GRAFANA_FOLDER` (value: `'GRAFANA_FOLDER'`) + +* `GRAFANA_DASHBOARD` (value: `'GRAFANA_DASHBOARD'`) + +* `GRAFANA_BASIC_ROLE` (value: `'GRAFANA_BASIC_ROLE'`) + +* `GRAFANA_ROLE` (value: `'GRAFANA_ROLE'`) + +* `CLICKHOUSE_DATABASE` (value: `'CLICKHOUSE_DATABASE'`) + +* `CLICKHOUSE_TABLE` (value: `'CLICKHOUSE_TABLE'`) + +* `TWINGATE_RESOURCE` (value: `'TWINGATE_RESOURCE'`) + [[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/docs/ResourcesApi.md b/docs/ResourcesApi.md index 0d1d587..531db7c 100644 --- a/docs/ResourcesApi.md +++ b/docs/ResourcesApi.md @@ -1374,7 +1374,7 @@ Name | Type | Description | Notes [[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_resources** -> PaginatedResourcesList get_resources(cursor=cursor, page_size=page_size, resource_type_filter=resource_type_filter, resource_ids=resource_ids, resource_name=resource_name, parent_resource_id=parent_resource_id, ancestor_resource_id=ancestor_resource_id, remote_id=remote_id) +> PaginatedResourcesList get_resources(cursor=cursor, page_size=page_size, resource_type_filter=resource_type_filter, resource_ids=resource_ids, resource_name=resource_name, parent_resource_id=parent_resource_id, ancestor_resource_id=ancestor_resource_id, remote_id=remote_id, tag_ids=tag_ids) Get resources @@ -1421,10 +1421,11 @@ with opal_security.ApiClient(configuration) as api_client: parent_resource_id = UUID('[\"4baf8423-db0a-4037-a4cf-f79c60cb67a5\"]') # UUID | The parent resource id to filter by. (optional) ancestor_resource_id = UUID('[\"4baf8423-db0a-4037-a4cf-f79c60cb67a5\"]') # UUID | The ancestor resource id to filter by. Returns all resources that are descendants of the specified resource. (optional) remote_id = 'remote_id_example' # str | Filter resources by their remote id. This will return all resources that have a remote id that matches the provided remote id. Note that this requires resource_type_filter to be provided. (optional) + tag_ids = None # List[UUID] | The IDs of the tags to filter by. Returns only resources that have any of these tags applied. (optional) try: # Get resources - api_response = api_instance.get_resources(cursor=cursor, page_size=page_size, resource_type_filter=resource_type_filter, resource_ids=resource_ids, resource_name=resource_name, parent_resource_id=parent_resource_id, ancestor_resource_id=ancestor_resource_id, remote_id=remote_id) + api_response = api_instance.get_resources(cursor=cursor, page_size=page_size, resource_type_filter=resource_type_filter, resource_ids=resource_ids, resource_name=resource_name, parent_resource_id=parent_resource_id, ancestor_resource_id=ancestor_resource_id, remote_id=remote_id, tag_ids=tag_ids) print("The response of ResourcesApi->get_resources:\n") pprint(api_response) except Exception as e: @@ -1446,6 +1447,7 @@ Name | Type | Description | Notes **parent_resource_id** | **UUID**| The parent resource id to filter by. | [optional] **ancestor_resource_id** | **UUID**| The ancestor resource id to filter by. Returns all resources that are descendants of the specified resource. | [optional] **remote_id** | **str**| Filter resources by their remote id. This will return all resources that have a remote id that matches the provided remote id. Note that this requires resource_type_filter to be provided. | [optional] + **tag_ids** | [**List[UUID]**](UUID.md)| The IDs of the tags to filter by. Returns only resources that have any of these tags applied. | [optional] ### Return type diff --git a/docs/ReviewerStage.md b/docs/ReviewerStage.md index 747fc30..7471017 100644 --- a/docs/ReviewerStage.md +++ b/docs/ReviewerStage.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **require_manager_approval** | **bool** | Whether this reviewer stage should require manager approval. | **require_admin_approval** | **bool** | Whether this reviewer stage should require admin approval. | [optional] **operator** | **str** | The operator of the reviewer stage. Admin and manager approval are also treated as reviewers. | -**owner_ids** | **List[UUID]** | | +**owner_ids** | **List[UUID]** | The IDs of owners assigned as reviewers for this stage. | +**service_user_ids** | **List[UUID]** | The IDs of service users assigned as reviewers for this stage. | [optional] ## Example diff --git a/docs/Token.md b/docs/Token.md new file mode 100644 index 0000000..05a3ba3 --- /dev/null +++ b/docs/Token.md @@ -0,0 +1,37 @@ +# Token + +A first-party API token. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**token_id** | **UUID** | The ID of the API token. | +**created_at** | **datetime** | The date and time the token was created. | +**token_label** | **str** | A human-readable label for the token. | +**creator_user_id** | **UUID** | The ID of the user who created the token. | +**user_id** | **UUID** | The ID of the user the token authenticates as. | +**last_used_at** | **datetime** | The date and time the token was last used. | [optional] +**access_level** | [**ApiAccessLevelEnum**](ApiAccessLevelEnum.md) | | +**expires_at** | **datetime** | The date and time the token expires. | [optional] + +## Example + +```python +from opal_security.models.token import Token + +# TODO update the JSON string below +json = "{}" +# create an instance of Token from a JSON string +token_instance = Token.from_json(json) +# print the JSON string representation of the object +print(Token.to_json()) + +# convert the object into a dict +token_dict = token_instance.to_dict() +# create an instance of Token from a dict +token_from_dict = Token.from_dict(token_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/docs/TokensApi.md b/docs/TokensApi.md new file mode 100644 index 0000000..5df2c01 --- /dev/null +++ b/docs/TokensApi.md @@ -0,0 +1,175 @@ +# opal_security.TokensApi + +All URIs are relative to *https://api.opal.dev/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_token**](TokensApi.md#delete_token) | **DELETE** /tokens/{token_id} | Delete token +[**get_tokens**](TokensApi.md#get_tokens) | **GET** /tokens | Get tokens + + +# **delete_token** +> delete_token(token_id) + +Delete token + +Deletes a first-party API token. Admins can delete any token. Non-admins can only delete their own tokens when the organization allows all users to create API tokens. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import opal_security +from opal_security.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +import opal_security as opal + +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# 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 = opal.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with opal_security.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = opal_security.TokensApi(api_client) + token_id = UUID('f454d283-ca87-4a8a-bdbb-df212eca5353') # UUID | The ID of the token to delete. + + try: + # Delete token + api_instance.delete_token(token_id) + except Exception as e: + print("Exception when calling TokensApi->delete_token: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **token_id** | **UUID**| The ID of the token to delete. | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The token was successfully deleted. | - | +**403** | Not authorized to delete this token. | - | +**404** | Token not found. | - | + +[[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_tokens** +> PaginatedTokensList get_tokens(cursor=cursor, page_size=page_size, token_ids=token_ids, user_id=user_id) + +Get tokens + +Returns a list of first-party API tokens for your organization. Requires admin access. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import opal_security +from opal_security.models.paginated_tokens_list import PaginatedTokensList +from opal_security.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +import opal_security as opal + +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# 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 = opal.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with opal_security.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = opal_security.TokensApi(api_client) + cursor = 'cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw' # str | The pagination cursor value. (optional) + page_size = 200 # int | Number of results to return per page. Default is 200. (optional) + token_ids = None # List[UUID] | Filter by token IDs. (optional) + user_id = UUID('29827fb8-f2dd-4e80-9576-28e31e9934ac') # UUID | Filter by user ID. (optional) + + try: + # Get tokens + api_response = api_instance.get_tokens(cursor=cursor, page_size=page_size, token_ids=token_ids, user_id=user_id) + print("The response of TokensApi->get_tokens:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TokensApi->get_tokens: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **cursor** | **str**| The pagination cursor value. | [optional] + **page_size** | **int**| Number of results to return per page. Default is 200. | [optional] + **token_ids** | [**List[UUID]**](UUID.md)| Filter by token IDs. | [optional] + **user_id** | **UUID**| Filter by user ID. | [optional] + +### Return type + +[**PaginatedTokensList**](PaginatedTokensList.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A list of API tokens for your organization. | - | + +[[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/docs/UsersApi.md b/docs/UsersApi.md index bad87fd..262d8ec 100644 --- a/docs/UsersApi.md +++ b/docs/UsersApi.md @@ -174,7 +174,7 @@ Name | Type | Description | Notes [[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** -> PaginatedUsersList get_users(cursor=cursor, page_size=page_size) +> PaginatedUsersList get_users(cursor=cursor, page_size=page_size, tag_ids=tag_ids) Returns a list of users for your organization. @@ -212,9 +212,10 @@ with opal_security.ApiClient(configuration) as api_client: api_instance = opal_security.UsersApi(api_client) cursor = 'cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw' # str | The pagination cursor value. (optional) page_size = 200 # int | Number of results to return per page. Default is 200. (optional) + tag_ids = None # List[UUID] | The IDs of the tags to filter by. Returns only users that have any of these tags applied. (optional) try: - api_response = api_instance.get_users(cursor=cursor, page_size=page_size) + api_response = api_instance.get_users(cursor=cursor, page_size=page_size, tag_ids=tag_ids) print("The response of UsersApi->get_users:\n") pprint(api_response) except Exception as e: @@ -230,6 +231,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **cursor** | **str**| The pagination cursor value. | [optional] **page_size** | **int**| Number of results to return per page. Default is 200. | [optional] + **tag_ids** | [**List[UUID]**](UUID.md)| The IDs of the tags to filter by. Returns only users that have any of these tags applied. | [optional] ### Return type diff --git a/opal_security/__init__.py b/opal_security/__init__.py index 6af399f..5f39560 100644 --- a/opal_security/__init__.py +++ b/opal_security/__init__.py @@ -36,6 +36,7 @@ "ResourcesApi", "SessionsApi", "TagsApi", + "TokensApi", "UarsApi", "UsersApi", "ApiResponse", @@ -56,6 +57,7 @@ "AddGroupUserRequest", "AddResourceNhiRequest", "AddResourceUserRequest", + "ApiAccessLevelEnum", "App", "AppTypeEnum", "AppValidation", @@ -108,6 +110,7 @@ "GroupRemoteInfoAwsSsoGroup", "GroupRemoteInfoAzureAdMicrosoft365Group", "GroupRemoteInfoAzureAdSecurityGroup", + "GroupRemoteInfoClickhouseRole", "GroupRemoteInfoConnectorGroup", "GroupRemoteInfoDatabricksAccountGroup", "GroupRemoteInfoDevinGroup", @@ -124,6 +127,7 @@ "GroupRemoteInfoRootlyOnCallSchedule", "GroupRemoteInfoSnowflakeRole", "GroupRemoteInfoTailscaleGroup", + "GroupRemoteInfoTwingateGroup", "GroupRemoteInfoWorkdayUserSecurityGroup", "GroupResource", "GroupResourceList", @@ -156,6 +160,7 @@ "PaginatedRemoteUsersList", "PaginatedResourcesList", "PaginatedTagsList", + "PaginatedTokensList", "PaginatedUARsList", "PaginatedUsersList", "PropagationStatus", @@ -207,10 +212,13 @@ "ResourceRemoteInfoAzureSubscription", "ResourceRemoteInfoAzureUserAssignedManagedIdentity", "ResourceRemoteInfoAzureVirtualMachine", + "ResourceRemoteInfoClickhouseDatabase", + "ResourceRemoteInfoClickhouseTable", "ResourceRemoteInfoCoupaRole", "ResourceRemoteInfoCursorOrganization", "ResourceRemoteInfoCustomConnector", "ResourceRemoteInfoDatabricksAccountServicePrincipal", + "ResourceRemoteInfoDatadogRole", "ResourceRemoteInfoDatastaxAstraRole", "ResourceRemoteInfoDevinOrganization", "ResourceRemoteInfoDevinRole", @@ -231,6 +239,7 @@ "ResourceRemoteInfoGitlabProject", "ResourceRemoteInfoGoogleWorkspaceRole", "ResourceRemoteInfoIlevelAdvancedRole", + "ResourceRemoteInfoNetsuiteRole", "ResourceRemoteInfoOktaApp", "ResourceRemoteInfoOktaCustomRole", "ResourceRemoteInfoOktaStandardRole", @@ -246,6 +255,7 @@ "ResourceRemoteInfoSnowflakeTable", "ResourceRemoteInfoTailscaleSsh", "ResourceRemoteInfoTeleportRole", + "ResourceRemoteInfoTwingateResource", "ResourceRemoteInfoWorkdayRole", "ResourceTypeEnum", "ResourceUser", @@ -277,6 +287,7 @@ "ThirdPartyProviderEnum", "TicketPropagationConfiguration", "TicketingProviderEnum", + "Token", "UAR", "UARReviewerAssignmentPolicyEnum", "UARScope", @@ -321,6 +332,7 @@ from opal_security.api.resources_api import ResourcesApi as ResourcesApi from opal_security.api.sessions_api import SessionsApi as SessionsApi from opal_security.api.tags_api import TagsApi as TagsApi +from opal_security.api.tokens_api import TokensApi as TokensApi from opal_security.api.uars_api import UarsApi as UarsApi from opal_security.api.users_api import UsersApi as UsersApi @@ -345,6 +357,7 @@ from opal_security.models.add_group_user_request import AddGroupUserRequest as AddGroupUserRequest from opal_security.models.add_resource_nhi_request import AddResourceNhiRequest as AddResourceNhiRequest from opal_security.models.add_resource_user_request import AddResourceUserRequest as AddResourceUserRequest +from opal_security.models.api_access_level_enum import ApiAccessLevelEnum as ApiAccessLevelEnum from opal_security.models.app import App as App from opal_security.models.app_type_enum import AppTypeEnum as AppTypeEnum from opal_security.models.app_validation import AppValidation as AppValidation @@ -397,6 +410,7 @@ from opal_security.models.group_remote_info_aws_sso_group import GroupRemoteInfoAwsSsoGroup as GroupRemoteInfoAwsSsoGroup from opal_security.models.group_remote_info_azure_ad_microsoft365_group import GroupRemoteInfoAzureAdMicrosoft365Group as GroupRemoteInfoAzureAdMicrosoft365Group from opal_security.models.group_remote_info_azure_ad_security_group import GroupRemoteInfoAzureAdSecurityGroup as GroupRemoteInfoAzureAdSecurityGroup +from opal_security.models.group_remote_info_clickhouse_role import GroupRemoteInfoClickhouseRole as GroupRemoteInfoClickhouseRole from opal_security.models.group_remote_info_connector_group import GroupRemoteInfoConnectorGroup as GroupRemoteInfoConnectorGroup from opal_security.models.group_remote_info_databricks_account_group import GroupRemoteInfoDatabricksAccountGroup as GroupRemoteInfoDatabricksAccountGroup from opal_security.models.group_remote_info_devin_group import GroupRemoteInfoDevinGroup as GroupRemoteInfoDevinGroup @@ -413,6 +427,7 @@ from opal_security.models.group_remote_info_rootly_on_call_schedule import GroupRemoteInfoRootlyOnCallSchedule as GroupRemoteInfoRootlyOnCallSchedule from opal_security.models.group_remote_info_snowflake_role import GroupRemoteInfoSnowflakeRole as GroupRemoteInfoSnowflakeRole from opal_security.models.group_remote_info_tailscale_group import GroupRemoteInfoTailscaleGroup as GroupRemoteInfoTailscaleGroup +from opal_security.models.group_remote_info_twingate_group import GroupRemoteInfoTwingateGroup as GroupRemoteInfoTwingateGroup from opal_security.models.group_remote_info_workday_user_security_group import GroupRemoteInfoWorkdayUserSecurityGroup as GroupRemoteInfoWorkdayUserSecurityGroup from opal_security.models.group_resource import GroupResource as GroupResource from opal_security.models.group_resource_list import GroupResourceList as GroupResourceList @@ -445,6 +460,7 @@ from opal_security.models.paginated_remote_users_list import PaginatedRemoteUsersList as PaginatedRemoteUsersList from opal_security.models.paginated_resources_list import PaginatedResourcesList as PaginatedResourcesList from opal_security.models.paginated_tags_list import PaginatedTagsList as PaginatedTagsList +from opal_security.models.paginated_tokens_list import PaginatedTokensList as PaginatedTokensList from opal_security.models.paginated_uars_list import PaginatedUARsList as PaginatedUARsList from opal_security.models.paginated_users_list import PaginatedUsersList as PaginatedUsersList from opal_security.models.propagation_status import PropagationStatus as PropagationStatus @@ -496,10 +512,13 @@ from opal_security.models.resource_remote_info_azure_subscription import ResourceRemoteInfoAzureSubscription as ResourceRemoteInfoAzureSubscription from opal_security.models.resource_remote_info_azure_user_assigned_managed_identity import ResourceRemoteInfoAzureUserAssignedManagedIdentity as ResourceRemoteInfoAzureUserAssignedManagedIdentity from opal_security.models.resource_remote_info_azure_virtual_machine import ResourceRemoteInfoAzureVirtualMachine as ResourceRemoteInfoAzureVirtualMachine +from opal_security.models.resource_remote_info_clickhouse_database import ResourceRemoteInfoClickhouseDatabase as ResourceRemoteInfoClickhouseDatabase +from opal_security.models.resource_remote_info_clickhouse_table import ResourceRemoteInfoClickhouseTable as ResourceRemoteInfoClickhouseTable from opal_security.models.resource_remote_info_coupa_role import ResourceRemoteInfoCoupaRole as ResourceRemoteInfoCoupaRole from opal_security.models.resource_remote_info_cursor_organization import ResourceRemoteInfoCursorOrganization as ResourceRemoteInfoCursorOrganization from opal_security.models.resource_remote_info_custom_connector import ResourceRemoteInfoCustomConnector as ResourceRemoteInfoCustomConnector from opal_security.models.resource_remote_info_databricks_account_service_principal import ResourceRemoteInfoDatabricksAccountServicePrincipal as ResourceRemoteInfoDatabricksAccountServicePrincipal +from opal_security.models.resource_remote_info_datadog_role import ResourceRemoteInfoDatadogRole as ResourceRemoteInfoDatadogRole from opal_security.models.resource_remote_info_datastax_astra_role import ResourceRemoteInfoDatastaxAstraRole as ResourceRemoteInfoDatastaxAstraRole from opal_security.models.resource_remote_info_devin_organization import ResourceRemoteInfoDevinOrganization as ResourceRemoteInfoDevinOrganization from opal_security.models.resource_remote_info_devin_role import ResourceRemoteInfoDevinRole as ResourceRemoteInfoDevinRole @@ -520,6 +539,7 @@ from opal_security.models.resource_remote_info_gitlab_project import ResourceRemoteInfoGitlabProject as ResourceRemoteInfoGitlabProject from opal_security.models.resource_remote_info_google_workspace_role import ResourceRemoteInfoGoogleWorkspaceRole as ResourceRemoteInfoGoogleWorkspaceRole from opal_security.models.resource_remote_info_ilevel_advanced_role import ResourceRemoteInfoIlevelAdvancedRole as ResourceRemoteInfoIlevelAdvancedRole +from opal_security.models.resource_remote_info_netsuite_role import ResourceRemoteInfoNetsuiteRole as ResourceRemoteInfoNetsuiteRole from opal_security.models.resource_remote_info_okta_app import ResourceRemoteInfoOktaApp as ResourceRemoteInfoOktaApp from opal_security.models.resource_remote_info_okta_custom_role import ResourceRemoteInfoOktaCustomRole as ResourceRemoteInfoOktaCustomRole from opal_security.models.resource_remote_info_okta_standard_role import ResourceRemoteInfoOktaStandardRole as ResourceRemoteInfoOktaStandardRole @@ -535,6 +555,7 @@ from opal_security.models.resource_remote_info_snowflake_table import ResourceRemoteInfoSnowflakeTable as ResourceRemoteInfoSnowflakeTable from opal_security.models.resource_remote_info_tailscale_ssh import ResourceRemoteInfoTailscaleSsh as ResourceRemoteInfoTailscaleSsh from opal_security.models.resource_remote_info_teleport_role import ResourceRemoteInfoTeleportRole as ResourceRemoteInfoTeleportRole +from opal_security.models.resource_remote_info_twingate_resource import ResourceRemoteInfoTwingateResource as ResourceRemoteInfoTwingateResource from opal_security.models.resource_remote_info_workday_role import ResourceRemoteInfoWorkdayRole as ResourceRemoteInfoWorkdayRole from opal_security.models.resource_type_enum import ResourceTypeEnum as ResourceTypeEnum from opal_security.models.resource_user import ResourceUser as ResourceUser @@ -566,6 +587,7 @@ from opal_security.models.third_party_provider_enum import ThirdPartyProviderEnum as ThirdPartyProviderEnum from opal_security.models.ticket_propagation_configuration import TicketPropagationConfiguration as TicketPropagationConfiguration from opal_security.models.ticketing_provider_enum import TicketingProviderEnum as TicketingProviderEnum +from opal_security.models.token import Token as Token from opal_security.models.uar import UAR as UAR from opal_security.models.uar_reviewer_assignment_policy_enum import UARReviewerAssignmentPolicyEnum as UARReviewerAssignmentPolicyEnum from opal_security.models.uar_scope import UARScope as UARScope diff --git a/opal_security/api/__init__.py b/opal_security/api/__init__.py index c215bd8..5ae2d2d 100644 --- a/opal_security/api/__init__.py +++ b/opal_security/api/__init__.py @@ -18,6 +18,7 @@ from opal_security.api.resources_api import ResourcesApi from opal_security.api.sessions_api import SessionsApi from opal_security.api.tags_api import TagsApi +from opal_security.api.tokens_api import TokensApi from opal_security.api.uars_api import UarsApi from opal_security.api.users_api import UsersApi diff --git a/opal_security/api/events_api.py b/opal_security/api/events_api.py index 1e514db..53a62b2 100644 --- a/opal_security/api/events_api.py +++ b/opal_security/api/events_api.py @@ -21,6 +21,7 @@ from typing import Optional from typing_extensions import Annotated from uuid import UUID +from opal_security.models.event import Event from opal_security.models.paginated_event_list import PaginatedEventList from opal_security.api_client import ApiClient, RequestSerialized @@ -421,3 +422,267 @@ def _events_serialize( ) + + + @validate_call + def get_event( + self, + event_id: Annotated[UUID, Field(description="The ID of the event.")], + _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, + ) -> Event: + """Get event by ID + + Returns an `Event` object. + + :param event_id: The ID of the event. (required) + :type event_id: UUID + :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_event_serialize( + event_id=event_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Event", + '404': None, + } + 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_event_with_http_info( + self, + event_id: Annotated[UUID, Field(description="The ID of the event.")], + _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[Event]: + """Get event by ID + + Returns an `Event` object. + + :param event_id: The ID of the event. (required) + :type event_id: UUID + :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_event_serialize( + event_id=event_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Event", + '404': None, + } + 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_event_without_preload_content( + self, + event_id: Annotated[UUID, Field(description="The ID of the event.")], + _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: + """Get event by ID + + Returns an `Event` object. + + :param event_id: The ID of the event. (required) + :type event_id: UUID + :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_event_serialize( + event_id=event_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Event", + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_event_serialize( + self, + event_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if event_id is not None: + _path_params['event_id'] = event_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/events/{event_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/opal_security/api/groups_api.py b/opal_security/api/groups_api.py index b180fb4..37436ce 100644 --- a/opal_security/api/groups_api.py +++ b/opal_security/api/groups_api.py @@ -2367,6 +2367,7 @@ def _get_group_containing_group_serialize( def get_group_containing_groups( self, group_id: Annotated[UUID, Field(description="The ID of the group.")], + access_level_remote_id: Annotated[Optional[StrictStr], Field(description="The access level's remote ID to filter by.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2386,6 +2387,8 @@ def get_group_containing_groups( :param group_id: The ID of the group. (required) :type group_id: UUID + :param access_level_remote_id: The access level's remote ID to filter by. + :type access_level_remote_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 @@ -2410,6 +2413,7 @@ def get_group_containing_groups( _param = self._get_group_containing_groups_serialize( group_id=group_id, + access_level_remote_id=access_level_remote_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2434,6 +2438,7 @@ def get_group_containing_groups( def get_group_containing_groups_with_http_info( self, group_id: Annotated[UUID, Field(description="The ID of the group.")], + access_level_remote_id: Annotated[Optional[StrictStr], Field(description="The access level's remote ID to filter by.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2453,6 +2458,8 @@ def get_group_containing_groups_with_http_info( :param group_id: The ID of the group. (required) :type group_id: UUID + :param access_level_remote_id: The access level's remote ID to filter by. + :type access_level_remote_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 @@ -2477,6 +2484,7 @@ def get_group_containing_groups_with_http_info( _param = self._get_group_containing_groups_serialize( group_id=group_id, + access_level_remote_id=access_level_remote_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2501,6 +2509,7 @@ def get_group_containing_groups_with_http_info( def get_group_containing_groups_without_preload_content( self, group_id: Annotated[UUID, Field(description="The ID of the group.")], + access_level_remote_id: Annotated[Optional[StrictStr], Field(description="The access level's remote ID to filter by.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2520,6 +2529,8 @@ def get_group_containing_groups_without_preload_content( :param group_id: The ID of the group. (required) :type group_id: UUID + :param access_level_remote_id: The access level's remote ID to filter by. + :type access_level_remote_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 @@ -2544,6 +2555,7 @@ def get_group_containing_groups_without_preload_content( _param = self._get_group_containing_groups_serialize( group_id=group_id, + access_level_remote_id=access_level_remote_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2563,6 +2575,7 @@ def get_group_containing_groups_without_preload_content( def _get_group_containing_groups_serialize( self, group_id, + access_level_remote_id, _request_auth, _content_type, _headers, @@ -2587,6 +2600,10 @@ def _get_group_containing_groups_serialize( if group_id is not None: _path_params['group_id'] = group_id # process the query parameters + if access_level_remote_id is not None: + + _query_params.append(('access_level_remote_id', access_level_remote_id)) + # process the header parameters # process the form parameters # process the body parameter @@ -4760,6 +4777,7 @@ def get_groups( group_type_filter: Annotated[Optional[GroupTypeEnum], Field(description="The group type to filter by.")] = None, group_ids: Annotated[Optional[List[UUID]], Field(description="The group ids to filter by.")] = None, group_name: Annotated[Optional[StrictStr], Field(description="Group name.")] = None, + tag_ids: Annotated[Optional[List[UUID]], Field(description="The IDs of the tags to filter by. Returns only groups that have any of these tags applied.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4787,6 +4805,8 @@ def get_groups( :type group_ids: List[UUID] :param group_name: Group name. :type group_name: str + :param tag_ids: The IDs of the tags to filter by. Returns only groups that have any of these tags applied. + :type tag_ids: List[UUID] :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 @@ -4815,6 +4835,7 @@ def get_groups( group_type_filter=group_type_filter, group_ids=group_ids, group_name=group_name, + tag_ids=tag_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4843,6 +4864,7 @@ def get_groups_with_http_info( group_type_filter: Annotated[Optional[GroupTypeEnum], Field(description="The group type to filter by.")] = None, group_ids: Annotated[Optional[List[UUID]], Field(description="The group ids to filter by.")] = None, group_name: Annotated[Optional[StrictStr], Field(description="Group name.")] = None, + tag_ids: Annotated[Optional[List[UUID]], Field(description="The IDs of the tags to filter by. Returns only groups that have any of these tags applied.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4870,6 +4892,8 @@ def get_groups_with_http_info( :type group_ids: List[UUID] :param group_name: Group name. :type group_name: str + :param tag_ids: The IDs of the tags to filter by. Returns only groups that have any of these tags applied. + :type tag_ids: List[UUID] :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 @@ -4898,6 +4922,7 @@ def get_groups_with_http_info( group_type_filter=group_type_filter, group_ids=group_ids, group_name=group_name, + tag_ids=tag_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4926,6 +4951,7 @@ def get_groups_without_preload_content( group_type_filter: Annotated[Optional[GroupTypeEnum], Field(description="The group type to filter by.")] = None, group_ids: Annotated[Optional[List[UUID]], Field(description="The group ids to filter by.")] = None, group_name: Annotated[Optional[StrictStr], Field(description="Group name.")] = None, + tag_ids: Annotated[Optional[List[UUID]], Field(description="The IDs of the tags to filter by. Returns only groups that have any of these tags applied.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4953,6 +4979,8 @@ def get_groups_without_preload_content( :type group_ids: List[UUID] :param group_name: Group name. :type group_name: str + :param tag_ids: The IDs of the tags to filter by. Returns only groups that have any of these tags applied. + :type tag_ids: List[UUID] :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 @@ -4981,6 +5009,7 @@ def get_groups_without_preload_content( group_type_filter=group_type_filter, group_ids=group_ids, group_name=group_name, + tag_ids=tag_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5004,6 +5033,7 @@ def _get_groups_serialize( group_type_filter, group_ids, group_name, + tag_ids, _request_auth, _content_type, _headers, @@ -5014,6 +5044,7 @@ def _get_groups_serialize( _collection_formats: Dict[str, str] = { 'group_ids': 'csv', + 'tag_ids': 'multi', } _path_params: Dict[str, str] = {} @@ -5047,6 +5078,10 @@ def _get_groups_serialize( _query_params.append(('group_name', group_name)) + if tag_ids is not None: + + _query_params.append(('tag_ids', tag_ids)) + # process the header parameters # process the form parameters # process the body parameter diff --git a/opal_security/api/requests_api.py b/opal_security/api/requests_api.py index f8e3ebf..4de25ad 100644 --- a/opal_security/api/requests_api.py +++ b/opal_security/api/requests_api.py @@ -1721,6 +1721,8 @@ def get_requests( end_date_filter: Annotated[Optional[StrictStr], Field(description="An end date filter for the events.")] = None, requester_id: Annotated[Optional[UUID], Field(description="Filter requests by their requester ID.")] = None, target_user_id: Annotated[Optional[UUID], Field(description="Filter requests by their target user ID.")] = None, + resource_id: Annotated[Optional[UUID], Field(description="Filter requests by the resource ID that was requested.")] = None, + group_id: Annotated[Optional[UUID], Field(description="Filter requests by the group ID that was requested.")] = None, cursor: Annotated[Optional[StrictStr], Field(description="The pagination cursor value.")] = None, page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True)]], Field(description="Number of results to return per page. Default is 200.")] = None, show_pending_only: Annotated[Optional[StrictBool], Field(description="Boolean toggle for if it should only show pending requests.")] = None, @@ -1749,6 +1751,10 @@ def get_requests( :type requester_id: UUID :param target_user_id: Filter requests by their target user ID. :type target_user_id: UUID + :param resource_id: Filter requests by the resource ID that was requested. + :type resource_id: UUID + :param group_id: Filter requests by the group ID that was requested. + :type group_id: UUID :param cursor: The pagination cursor value. :type cursor: str :param page_size: Number of results to return per page. Default is 200. @@ -1782,6 +1788,8 @@ def get_requests( end_date_filter=end_date_filter, requester_id=requester_id, target_user_id=target_user_id, + resource_id=resource_id, + group_id=group_id, cursor=cursor, page_size=page_size, show_pending_only=show_pending_only, @@ -1812,6 +1820,8 @@ def get_requests_with_http_info( end_date_filter: Annotated[Optional[StrictStr], Field(description="An end date filter for the events.")] = None, requester_id: Annotated[Optional[UUID], Field(description="Filter requests by their requester ID.")] = None, target_user_id: Annotated[Optional[UUID], Field(description="Filter requests by their target user ID.")] = None, + resource_id: Annotated[Optional[UUID], Field(description="Filter requests by the resource ID that was requested.")] = None, + group_id: Annotated[Optional[UUID], Field(description="Filter requests by the group ID that was requested.")] = None, cursor: Annotated[Optional[StrictStr], Field(description="The pagination cursor value.")] = None, page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True)]], Field(description="Number of results to return per page. Default is 200.")] = None, show_pending_only: Annotated[Optional[StrictBool], Field(description="Boolean toggle for if it should only show pending requests.")] = None, @@ -1840,6 +1850,10 @@ def get_requests_with_http_info( :type requester_id: UUID :param target_user_id: Filter requests by their target user ID. :type target_user_id: UUID + :param resource_id: Filter requests by the resource ID that was requested. + :type resource_id: UUID + :param group_id: Filter requests by the group ID that was requested. + :type group_id: UUID :param cursor: The pagination cursor value. :type cursor: str :param page_size: Number of results to return per page. Default is 200. @@ -1873,6 +1887,8 @@ def get_requests_with_http_info( end_date_filter=end_date_filter, requester_id=requester_id, target_user_id=target_user_id, + resource_id=resource_id, + group_id=group_id, cursor=cursor, page_size=page_size, show_pending_only=show_pending_only, @@ -1903,6 +1919,8 @@ def get_requests_without_preload_content( end_date_filter: Annotated[Optional[StrictStr], Field(description="An end date filter for the events.")] = None, requester_id: Annotated[Optional[UUID], Field(description="Filter requests by their requester ID.")] = None, target_user_id: Annotated[Optional[UUID], Field(description="Filter requests by their target user ID.")] = None, + resource_id: Annotated[Optional[UUID], Field(description="Filter requests by the resource ID that was requested.")] = None, + group_id: Annotated[Optional[UUID], Field(description="Filter requests by the group ID that was requested.")] = None, cursor: Annotated[Optional[StrictStr], Field(description="The pagination cursor value.")] = None, page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True)]], Field(description="Number of results to return per page. Default is 200.")] = None, show_pending_only: Annotated[Optional[StrictBool], Field(description="Boolean toggle for if it should only show pending requests.")] = None, @@ -1931,6 +1949,10 @@ def get_requests_without_preload_content( :type requester_id: UUID :param target_user_id: Filter requests by their target user ID. :type target_user_id: UUID + :param resource_id: Filter requests by the resource ID that was requested. + :type resource_id: UUID + :param group_id: Filter requests by the group ID that was requested. + :type group_id: UUID :param cursor: The pagination cursor value. :type cursor: str :param page_size: Number of results to return per page. Default is 200. @@ -1964,6 +1986,8 @@ def get_requests_without_preload_content( end_date_filter=end_date_filter, requester_id=requester_id, target_user_id=target_user_id, + resource_id=resource_id, + group_id=group_id, cursor=cursor, page_size=page_size, show_pending_only=show_pending_only, @@ -1989,6 +2013,8 @@ def _get_requests_serialize( end_date_filter, requester_id, target_user_id, + resource_id, + group_id, cursor, page_size, show_pending_only, @@ -2030,6 +2056,14 @@ def _get_requests_serialize( _query_params.append(('target_user_id', target_user_id)) + if resource_id is not None: + + _query_params.append(('resource_id', resource_id)) + + if group_id is not None: + + _query_params.append(('group_id', group_id)) + if cursor is not None: _query_params.append(('cursor', cursor)) diff --git a/opal_security/api/resources_api.py b/opal_security/api/resources_api.py index 203fb79..02aa00b 100644 --- a/opal_security/api/resources_api.py +++ b/opal_security/api/resources_api.py @@ -4756,6 +4756,7 @@ def get_resources( parent_resource_id: Annotated[Optional[UUID], Field(description="The parent resource id to filter by.")] = None, ancestor_resource_id: Annotated[Optional[UUID], Field(description="The ancestor resource id to filter by. Returns all resources that are descendants of the specified resource.")] = None, remote_id: Annotated[Optional[StrictStr], Field(description="Filter resources by their remote id. This will return all resources that have a remote id that matches the provided remote id. Note that this requires resource_type_filter to be provided.")] = None, + tag_ids: Annotated[Optional[List[UUID]], Field(description="The IDs of the tags to filter by. Returns only resources that have any of these tags applied.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4789,6 +4790,8 @@ def get_resources( :type ancestor_resource_id: UUID :param remote_id: Filter resources by their remote id. This will return all resources that have a remote id that matches the provided remote id. Note that this requires resource_type_filter to be provided. :type remote_id: str + :param tag_ids: The IDs of the tags to filter by. Returns only resources that have any of these tags applied. + :type tag_ids: List[UUID] :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 @@ -4820,6 +4823,7 @@ def get_resources( parent_resource_id=parent_resource_id, ancestor_resource_id=ancestor_resource_id, remote_id=remote_id, + tag_ids=tag_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4851,6 +4855,7 @@ def get_resources_with_http_info( parent_resource_id: Annotated[Optional[UUID], Field(description="The parent resource id to filter by.")] = None, ancestor_resource_id: Annotated[Optional[UUID], Field(description="The ancestor resource id to filter by. Returns all resources that are descendants of the specified resource.")] = None, remote_id: Annotated[Optional[StrictStr], Field(description="Filter resources by their remote id. This will return all resources that have a remote id that matches the provided remote id. Note that this requires resource_type_filter to be provided.")] = None, + tag_ids: Annotated[Optional[List[UUID]], Field(description="The IDs of the tags to filter by. Returns only resources that have any of these tags applied.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4884,6 +4889,8 @@ def get_resources_with_http_info( :type ancestor_resource_id: UUID :param remote_id: Filter resources by their remote id. This will return all resources that have a remote id that matches the provided remote id. Note that this requires resource_type_filter to be provided. :type remote_id: str + :param tag_ids: The IDs of the tags to filter by. Returns only resources that have any of these tags applied. + :type tag_ids: List[UUID] :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 @@ -4915,6 +4922,7 @@ def get_resources_with_http_info( parent_resource_id=parent_resource_id, ancestor_resource_id=ancestor_resource_id, remote_id=remote_id, + tag_ids=tag_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4946,6 +4954,7 @@ def get_resources_without_preload_content( parent_resource_id: Annotated[Optional[UUID], Field(description="The parent resource id to filter by.")] = None, ancestor_resource_id: Annotated[Optional[UUID], Field(description="The ancestor resource id to filter by. Returns all resources that are descendants of the specified resource.")] = None, remote_id: Annotated[Optional[StrictStr], Field(description="Filter resources by their remote id. This will return all resources that have a remote id that matches the provided remote id. Note that this requires resource_type_filter to be provided.")] = None, + tag_ids: Annotated[Optional[List[UUID]], Field(description="The IDs of the tags to filter by. Returns only resources that have any of these tags applied.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4979,6 +4988,8 @@ def get_resources_without_preload_content( :type ancestor_resource_id: UUID :param remote_id: Filter resources by their remote id. This will return all resources that have a remote id that matches the provided remote id. Note that this requires resource_type_filter to be provided. :type remote_id: str + :param tag_ids: The IDs of the tags to filter by. Returns only resources that have any of these tags applied. + :type tag_ids: List[UUID] :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 @@ -5010,6 +5021,7 @@ def get_resources_without_preload_content( parent_resource_id=parent_resource_id, ancestor_resource_id=ancestor_resource_id, remote_id=remote_id, + tag_ids=tag_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5036,6 +5048,7 @@ def _get_resources_serialize( parent_resource_id, ancestor_resource_id, remote_id, + tag_ids, _request_auth, _content_type, _headers, @@ -5046,6 +5059,7 @@ def _get_resources_serialize( _collection_formats: Dict[str, str] = { 'resource_ids': 'csv', + 'tag_ids': 'multi', } _path_params: Dict[str, str] = {} @@ -5091,6 +5105,10 @@ def _get_resources_serialize( _query_params.append(('remote_id', remote_id)) + if tag_ids is not None: + + _query_params.append(('tag_ids', tag_ids)) + # process the header parameters # process the form parameters # process the body parameter diff --git a/opal_security/api/tokens_api.py b/opal_security/api/tokens_api.py new file mode 100644 index 0000000..7f9af89 --- /dev/null +++ b/opal_security/api/tokens_api.py @@ -0,0 +1,616 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from uuid import UUID +from opal_security.models.paginated_tokens_list import PaginatedTokensList + +from opal_security.api_client import ApiClient, RequestSerialized +from opal_security.api_response import ApiResponse +from opal_security.rest import RESTResponseType + + +class TokensApi: + """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 delete_token( + self, + token_id: Annotated[UUID, Field(description="The ID of the token to delete.")], + _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 token + + Deletes a first-party API token. Admins can delete any token. Non-admins can only delete their own tokens when the organization allows all users to create API tokens. + + :param token_id: The ID of the token to delete. (required) + :type token_id: UUID + :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_token_serialize( + token_id=token_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '403': None, + '404': None, + } + 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_token_with_http_info( + self, + token_id: Annotated[UUID, Field(description="The ID of the token to delete.")], + _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 token + + Deletes a first-party API token. Admins can delete any token. Non-admins can only delete their own tokens when the organization allows all users to create API tokens. + + :param token_id: The ID of the token to delete. (required) + :type token_id: UUID + :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_token_serialize( + token_id=token_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '403': None, + '404': None, + } + 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_token_without_preload_content( + self, + token_id: Annotated[UUID, Field(description="The ID of the token to delete.")], + _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 token + + Deletes a first-party API token. Admins can delete any token. Non-admins can only delete their own tokens when the organization allows all users to create API tokens. + + :param token_id: The ID of the token to delete. (required) + :type token_id: UUID + :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_token_serialize( + token_id=token_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '403': None, + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_token_serialize( + self, + token_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if token_id is not None: + _path_params['token_id'] = token_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/tokens/{token_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_tokens( + self, + cursor: Annotated[Optional[StrictStr], Field(description="The pagination cursor value.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True)]], Field(description="Number of results to return per page. Default is 200.")] = None, + token_ids: Annotated[Optional[List[UUID]], Field(description="Filter by token IDs.")] = None, + user_id: Annotated[Optional[UUID], Field(description="Filter by user ID.")] = 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, + ) -> PaginatedTokensList: + """Get tokens + + Returns a list of first-party API tokens for your organization. Requires admin access. + + :param cursor: The pagination cursor value. + :type cursor: str + :param page_size: Number of results to return per page. Default is 200. + :type page_size: int + :param token_ids: Filter by token IDs. + :type token_ids: List[UUID] + :param user_id: Filter by user ID. + :type user_id: UUID + :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_tokens_serialize( + cursor=cursor, + page_size=page_size, + token_ids=token_ids, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PaginatedTokensList", + } + 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_tokens_with_http_info( + self, + cursor: Annotated[Optional[StrictStr], Field(description="The pagination cursor value.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True)]], Field(description="Number of results to return per page. Default is 200.")] = None, + token_ids: Annotated[Optional[List[UUID]], Field(description="Filter by token IDs.")] = None, + user_id: Annotated[Optional[UUID], Field(description="Filter by user ID.")] = 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[PaginatedTokensList]: + """Get tokens + + Returns a list of first-party API tokens for your organization. Requires admin access. + + :param cursor: The pagination cursor value. + :type cursor: str + :param page_size: Number of results to return per page. Default is 200. + :type page_size: int + :param token_ids: Filter by token IDs. + :type token_ids: List[UUID] + :param user_id: Filter by user ID. + :type user_id: UUID + :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_tokens_serialize( + cursor=cursor, + page_size=page_size, + token_ids=token_ids, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PaginatedTokensList", + } + 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_tokens_without_preload_content( + self, + cursor: Annotated[Optional[StrictStr], Field(description="The pagination cursor value.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True)]], Field(description="Number of results to return per page. Default is 200.")] = None, + token_ids: Annotated[Optional[List[UUID]], Field(description="Filter by token IDs.")] = None, + user_id: Annotated[Optional[UUID], Field(description="Filter by user ID.")] = 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: + """Get tokens + + Returns a list of first-party API tokens for your organization. Requires admin access. + + :param cursor: The pagination cursor value. + :type cursor: str + :param page_size: Number of results to return per page. Default is 200. + :type page_size: int + :param token_ids: Filter by token IDs. + :type token_ids: List[UUID] + :param user_id: Filter by user ID. + :type user_id: UUID + :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_tokens_serialize( + cursor=cursor, + page_size=page_size, + token_ids=token_ids, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PaginatedTokensList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_tokens_serialize( + self, + cursor, + page_size, + token_ids, + user_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'token_ids': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if token_ids is not None: + + _query_params.append(('token_ids', token_ids)) + + if user_id is not None: + + _query_params.append(('user_id', user_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tokens', + 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/opal_security/api/users_api.py b/opal_security/api/users_api.py index cdb9cd0..9a27db4 100644 --- a/opal_security/api/users_api.py +++ b/opal_security/api/users_api.py @@ -645,6 +645,7 @@ def get_users( self, cursor: Annotated[Optional[StrictStr], Field(description="The pagination cursor value.")] = None, page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True)]], Field(description="Number of results to return per page. Default is 200.")] = None, + tag_ids: Annotated[Optional[List[UUID]], Field(description="The IDs of the tags to filter by. Returns only users that have any of these tags applied.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -666,6 +667,8 @@ def get_users( :type cursor: str :param page_size: Number of results to return per page. Default is 200. :type page_size: int + :param tag_ids: The IDs of the tags to filter by. Returns only users that have any of these tags applied. + :type tag_ids: List[UUID] :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 @@ -691,6 +694,7 @@ def get_users( _param = self._get_users_serialize( cursor=cursor, page_size=page_size, + tag_ids=tag_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -716,6 +720,7 @@ def get_users_with_http_info( self, cursor: Annotated[Optional[StrictStr], Field(description="The pagination cursor value.")] = None, page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True)]], Field(description="Number of results to return per page. Default is 200.")] = None, + tag_ids: Annotated[Optional[List[UUID]], Field(description="The IDs of the tags to filter by. Returns only users that have any of these tags applied.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -737,6 +742,8 @@ def get_users_with_http_info( :type cursor: str :param page_size: Number of results to return per page. Default is 200. :type page_size: int + :param tag_ids: The IDs of the tags to filter by. Returns only users that have any of these tags applied. + :type tag_ids: List[UUID] :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 @@ -762,6 +769,7 @@ def get_users_with_http_info( _param = self._get_users_serialize( cursor=cursor, page_size=page_size, + tag_ids=tag_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -787,6 +795,7 @@ def get_users_without_preload_content( self, cursor: Annotated[Optional[StrictStr], Field(description="The pagination cursor value.")] = None, page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True)]], Field(description="Number of results to return per page. Default is 200.")] = None, + tag_ids: Annotated[Optional[List[UUID]], Field(description="The IDs of the tags to filter by. Returns only users that have any of these tags applied.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -808,6 +817,8 @@ def get_users_without_preload_content( :type cursor: str :param page_size: Number of results to return per page. Default is 200. :type page_size: int + :param tag_ids: The IDs of the tags to filter by. Returns only users that have any of these tags applied. + :type tag_ids: List[UUID] :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 @@ -833,6 +844,7 @@ def get_users_without_preload_content( _param = self._get_users_serialize( cursor=cursor, page_size=page_size, + tag_ids=tag_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -853,6 +865,7 @@ def _get_users_serialize( self, cursor, page_size, + tag_ids, _request_auth, _content_type, _headers, @@ -862,6 +875,7 @@ def _get_users_serialize( _host = None _collection_formats: Dict[str, str] = { + 'tag_ids': 'multi', } _path_params: Dict[str, str] = {} @@ -883,6 +897,10 @@ def _get_users_serialize( _query_params.append(('page_size', page_size)) + if tag_ids is not None: + + _query_params.append(('tag_ids', tag_ids)) + # process the header parameters # process the form parameters # process the body parameter diff --git a/opal_security/models/__init__.py b/opal_security/models/__init__.py index fdbf08f..306be3e 100644 --- a/opal_security/models/__init__.py +++ b/opal_security/models/__init__.py @@ -23,6 +23,7 @@ from opal_security.models.add_group_user_request import AddGroupUserRequest from opal_security.models.add_resource_nhi_request import AddResourceNhiRequest from opal_security.models.add_resource_user_request import AddResourceUserRequest +from opal_security.models.api_access_level_enum import ApiAccessLevelEnum from opal_security.models.app import App from opal_security.models.app_type_enum import AppTypeEnum from opal_security.models.app_validation import AppValidation @@ -75,6 +76,7 @@ from opal_security.models.group_remote_info_aws_sso_group import GroupRemoteInfoAwsSsoGroup from opal_security.models.group_remote_info_azure_ad_microsoft365_group import GroupRemoteInfoAzureAdMicrosoft365Group from opal_security.models.group_remote_info_azure_ad_security_group import GroupRemoteInfoAzureAdSecurityGroup +from opal_security.models.group_remote_info_clickhouse_role import GroupRemoteInfoClickhouseRole from opal_security.models.group_remote_info_connector_group import GroupRemoteInfoConnectorGroup from opal_security.models.group_remote_info_databricks_account_group import GroupRemoteInfoDatabricksAccountGroup from opal_security.models.group_remote_info_devin_group import GroupRemoteInfoDevinGroup @@ -91,6 +93,7 @@ from opal_security.models.group_remote_info_rootly_on_call_schedule import GroupRemoteInfoRootlyOnCallSchedule from opal_security.models.group_remote_info_snowflake_role import GroupRemoteInfoSnowflakeRole from opal_security.models.group_remote_info_tailscale_group import GroupRemoteInfoTailscaleGroup +from opal_security.models.group_remote_info_twingate_group import GroupRemoteInfoTwingateGroup from opal_security.models.group_remote_info_workday_user_security_group import GroupRemoteInfoWorkdayUserSecurityGroup from opal_security.models.group_resource import GroupResource from opal_security.models.group_resource_list import GroupResourceList @@ -123,6 +126,7 @@ from opal_security.models.paginated_remote_users_list import PaginatedRemoteUsersList from opal_security.models.paginated_resources_list import PaginatedResourcesList from opal_security.models.paginated_tags_list import PaginatedTagsList +from opal_security.models.paginated_tokens_list import PaginatedTokensList from opal_security.models.paginated_uars_list import PaginatedUARsList from opal_security.models.paginated_users_list import PaginatedUsersList from opal_security.models.propagation_status import PropagationStatus @@ -174,10 +178,13 @@ from opal_security.models.resource_remote_info_azure_subscription import ResourceRemoteInfoAzureSubscription from opal_security.models.resource_remote_info_azure_user_assigned_managed_identity import ResourceRemoteInfoAzureUserAssignedManagedIdentity from opal_security.models.resource_remote_info_azure_virtual_machine import ResourceRemoteInfoAzureVirtualMachine +from opal_security.models.resource_remote_info_clickhouse_database import ResourceRemoteInfoClickhouseDatabase +from opal_security.models.resource_remote_info_clickhouse_table import ResourceRemoteInfoClickhouseTable from opal_security.models.resource_remote_info_coupa_role import ResourceRemoteInfoCoupaRole from opal_security.models.resource_remote_info_cursor_organization import ResourceRemoteInfoCursorOrganization from opal_security.models.resource_remote_info_custom_connector import ResourceRemoteInfoCustomConnector from opal_security.models.resource_remote_info_databricks_account_service_principal import ResourceRemoteInfoDatabricksAccountServicePrincipal +from opal_security.models.resource_remote_info_datadog_role import ResourceRemoteInfoDatadogRole from opal_security.models.resource_remote_info_datastax_astra_role import ResourceRemoteInfoDatastaxAstraRole from opal_security.models.resource_remote_info_devin_organization import ResourceRemoteInfoDevinOrganization from opal_security.models.resource_remote_info_devin_role import ResourceRemoteInfoDevinRole @@ -198,6 +205,7 @@ from opal_security.models.resource_remote_info_gitlab_project import ResourceRemoteInfoGitlabProject from opal_security.models.resource_remote_info_google_workspace_role import ResourceRemoteInfoGoogleWorkspaceRole from opal_security.models.resource_remote_info_ilevel_advanced_role import ResourceRemoteInfoIlevelAdvancedRole +from opal_security.models.resource_remote_info_netsuite_role import ResourceRemoteInfoNetsuiteRole from opal_security.models.resource_remote_info_okta_app import ResourceRemoteInfoOktaApp from opal_security.models.resource_remote_info_okta_custom_role import ResourceRemoteInfoOktaCustomRole from opal_security.models.resource_remote_info_okta_standard_role import ResourceRemoteInfoOktaStandardRole @@ -213,6 +221,7 @@ from opal_security.models.resource_remote_info_snowflake_table import ResourceRemoteInfoSnowflakeTable from opal_security.models.resource_remote_info_tailscale_ssh import ResourceRemoteInfoTailscaleSsh from opal_security.models.resource_remote_info_teleport_role import ResourceRemoteInfoTeleportRole +from opal_security.models.resource_remote_info_twingate_resource import ResourceRemoteInfoTwingateResource from opal_security.models.resource_remote_info_workday_role import ResourceRemoteInfoWorkdayRole from opal_security.models.resource_type_enum import ResourceTypeEnum from opal_security.models.resource_user import ResourceUser @@ -244,6 +253,7 @@ from opal_security.models.third_party_provider_enum import ThirdPartyProviderEnum from opal_security.models.ticket_propagation_configuration import TicketPropagationConfiguration from opal_security.models.ticketing_provider_enum import TicketingProviderEnum +from opal_security.models.token import Token from opal_security.models.uar import UAR from opal_security.models.uar_reviewer_assignment_policy_enum import UARReviewerAssignmentPolicyEnum from opal_security.models.uar_scope import UARScope diff --git a/opal_security/models/api_access_level_enum.py b/opal_security/models/api_access_level_enum.py new file mode 100644 index 0000000..e6609c3 --- /dev/null +++ b/opal_security/models/api_access_level_enum.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ApiAccessLevelEnum(str, Enum): + """ + The access level of an API token. + """ + + """ + allowed enum values + """ + READ_ONLY = 'READ_ONLY' + FULL_ACCESS = 'FULL_ACCESS' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ApiAccessLevelEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/opal_security/models/app_type_enum.py b/opal_security/models/app_type_enum.py index 0385cb8..8f8ecc1 100644 --- a/opal_security/models/app_type_enum.py +++ b/opal_security/models/app_type_enum.py @@ -35,6 +35,7 @@ class AppTypeEnum(str, Enum): COUPA = 'COUPA' CURSOR = 'CURSOR' CUSTOM = 'CUSTOM' + CUSTOM_CONNECTOR = 'CUSTOM_CONNECTOR' DATABRICKS = 'DATABRICKS' DATASTAX_ASTRA = 'DATASTAX_ASTRA' DUO = 'DUO' @@ -50,6 +51,8 @@ class AppTypeEnum(str, Enum): MONGO = 'MONGO' MONGO_ATLAS = 'MONGO_ATLAS' MYSQL = 'MYSQL' + NETSUITE = 'NETSUITE' + DATADOG = 'DATADOG' OKTA_DIRECTORY = 'OKTA_DIRECTORY' OPENAI_PLATFORM = 'OPENAI_PLATFORM' OPAL = 'OPAL' @@ -58,6 +61,7 @@ class AppTypeEnum(str, Enum): SNOWFLAKE = 'SNOWFLAKE' TAILSCALE = 'TAILSCALE' TELEPORT = 'TELEPORT' + TWINGATE = 'TWINGATE' WORKDAY = 'WORKDAY' @classmethod diff --git a/opal_security/models/group_remote_info.py b/opal_security/models/group_remote_info.py index 668843b..db3c0c7 100644 --- a/opal_security/models/group_remote_info.py +++ b/opal_security/models/group_remote_info.py @@ -24,6 +24,7 @@ from opal_security.models.group_remote_info_aws_sso_group import GroupRemoteInfoAwsSsoGroup from opal_security.models.group_remote_info_azure_ad_microsoft365_group import GroupRemoteInfoAzureAdMicrosoft365Group from opal_security.models.group_remote_info_azure_ad_security_group import GroupRemoteInfoAzureAdSecurityGroup +from opal_security.models.group_remote_info_clickhouse_role import GroupRemoteInfoClickhouseRole from opal_security.models.group_remote_info_connector_group import GroupRemoteInfoConnectorGroup from opal_security.models.group_remote_info_databricks_account_group import GroupRemoteInfoDatabricksAccountGroup from opal_security.models.group_remote_info_devin_group import GroupRemoteInfoDevinGroup @@ -40,6 +41,7 @@ from opal_security.models.group_remote_info_rootly_on_call_schedule import GroupRemoteInfoRootlyOnCallSchedule from opal_security.models.group_remote_info_snowflake_role import GroupRemoteInfoSnowflakeRole from opal_security.models.group_remote_info_tailscale_group import GroupRemoteInfoTailscaleGroup +from opal_security.models.group_remote_info_twingate_group import GroupRemoteInfoTwingateGroup from opal_security.models.group_remote_info_workday_user_security_group import GroupRemoteInfoWorkdayUserSecurityGroup from typing import Optional, Set from typing_extensions import Self @@ -50,6 +52,7 @@ class GroupRemoteInfo(BaseModel): """ # noqa: E501 active_directory_group: Optional[GroupRemoteInfoActiveDirectoryGroup] = None tailscale_group: Optional[GroupRemoteInfoTailscaleGroup] = None + twingate_group: Optional[GroupRemoteInfoTwingateGroup] = None aws_sso_group: Optional[GroupRemoteInfoAwsSsoGroup] = None databricks_account_group: Optional[GroupRemoteInfoDatabricksAccountGroup] = None connector_group: Optional[GroupRemoteInfoConnectorGroup] = None @@ -69,8 +72,9 @@ class GroupRemoteInfo(BaseModel): incidentio_on_call_schedule: Optional[GroupRemoteInfoIncidentioOnCallSchedule] = None rootly_on_call_schedule: Optional[GroupRemoteInfoRootlyOnCallSchedule] = None devin_group: Optional[GroupRemoteInfoDevinGroup] = None + clickhouse_role: Optional[GroupRemoteInfoClickhouseRole] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["active_directory_group", "tailscale_group", "aws_sso_group", "databricks_account_group", "connector_group", "github_team", "github_enterprise_team", "gitlab_group", "google_group", "ldap_group", "okta_group", "duo_group", "azure_ad_security_group", "azure_ad_microsoft_365_group", "snowflake_role", "okta_group_rule", "workday_user_security_group", "pagerduty_on_call_schedule", "incidentio_on_call_schedule", "rootly_on_call_schedule", "devin_group"] + __properties: ClassVar[List[str]] = ["active_directory_group", "tailscale_group", "twingate_group", "aws_sso_group", "databricks_account_group", "connector_group", "github_team", "github_enterprise_team", "gitlab_group", "google_group", "ldap_group", "okta_group", "duo_group", "azure_ad_security_group", "azure_ad_microsoft_365_group", "snowflake_role", "okta_group_rule", "workday_user_security_group", "pagerduty_on_call_schedule", "incidentio_on_call_schedule", "rootly_on_call_schedule", "devin_group", "clickhouse_role"] model_config = ConfigDict( populate_by_name=True, @@ -119,6 +123,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of tailscale_group if self.tailscale_group: _dict['tailscale_group'] = self.tailscale_group.to_dict() + # override the default output from pydantic by calling `to_dict()` of twingate_group + if self.twingate_group: + _dict['twingate_group'] = self.twingate_group.to_dict() # override the default output from pydantic by calling `to_dict()` of aws_sso_group if self.aws_sso_group: _dict['aws_sso_group'] = self.aws_sso_group.to_dict() @@ -176,6 +183,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of devin_group if self.devin_group: _dict['devin_group'] = self.devin_group.to_dict() + # override the default output from pydantic by calling `to_dict()` of clickhouse_role + if self.clickhouse_role: + _dict['clickhouse_role'] = self.clickhouse_role.to_dict() # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -195,6 +205,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "active_directory_group": GroupRemoteInfoActiveDirectoryGroup.from_dict(obj["active_directory_group"]) if obj.get("active_directory_group") is not None else None, "tailscale_group": GroupRemoteInfoTailscaleGroup.from_dict(obj["tailscale_group"]) if obj.get("tailscale_group") is not None else None, + "twingate_group": GroupRemoteInfoTwingateGroup.from_dict(obj["twingate_group"]) if obj.get("twingate_group") is not None else None, "aws_sso_group": GroupRemoteInfoAwsSsoGroup.from_dict(obj["aws_sso_group"]) if obj.get("aws_sso_group") is not None else None, "databricks_account_group": GroupRemoteInfoDatabricksAccountGroup.from_dict(obj["databricks_account_group"]) if obj.get("databricks_account_group") is not None else None, "connector_group": GroupRemoteInfoConnectorGroup.from_dict(obj["connector_group"]) if obj.get("connector_group") is not None else None, @@ -213,7 +224,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "pagerduty_on_call_schedule": GroupRemoteInfoPagerdutyOnCallSchedule.from_dict(obj["pagerduty_on_call_schedule"]) if obj.get("pagerduty_on_call_schedule") is not None else None, "incidentio_on_call_schedule": GroupRemoteInfoIncidentioOnCallSchedule.from_dict(obj["incidentio_on_call_schedule"]) if obj.get("incidentio_on_call_schedule") is not None else None, "rootly_on_call_schedule": GroupRemoteInfoRootlyOnCallSchedule.from_dict(obj["rootly_on_call_schedule"]) if obj.get("rootly_on_call_schedule") is not None else None, - "devin_group": GroupRemoteInfoDevinGroup.from_dict(obj["devin_group"]) if obj.get("devin_group") is not None else None + "devin_group": GroupRemoteInfoDevinGroup.from_dict(obj["devin_group"]) if obj.get("devin_group") is not None else None, + "clickhouse_role": GroupRemoteInfoClickhouseRole.from_dict(obj["clickhouse_role"]) if obj.get("clickhouse_role") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/opal_security/models/group_remote_info_clickhouse_role.py b/opal_security/models/group_remote_info_clickhouse_role.py new file mode 100644 index 0000000..289eda7 --- /dev/null +++ b/opal_security/models/group_remote_info_clickhouse_role.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class GroupRemoteInfoClickhouseRole(BaseModel): + """ + Remote info for ClickHouse role. + """ # noqa: E501 + role_id: StrictStr = Field(description="The name of the ClickHouse role.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["role_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GroupRemoteInfoClickhouseRole 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. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GroupRemoteInfoClickhouseRole from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "role_id": obj.get("role_id") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/opal_security/models/group_remote_info_twingate_group.py b/opal_security/models/group_remote_info_twingate_group.py new file mode 100644 index 0000000..db9026d --- /dev/null +++ b/opal_security/models/group_remote_info_twingate_group.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class GroupRemoteInfoTwingateGroup(BaseModel): + """ + Remote info for Twingate group. + """ # noqa: E501 + group_id: StrictStr = Field(description="The id of the Twingate group.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["group_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GroupRemoteInfoTwingateGroup 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. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GroupRemoteInfoTwingateGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "group_id": obj.get("group_id") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/opal_security/models/group_type_enum.py b/opal_security/models/group_type_enum.py index d608a55..2ebd21e 100644 --- a/opal_security/models/group_type_enum.py +++ b/opal_security/models/group_type_enum.py @@ -51,6 +51,9 @@ class GroupTypeEnum(str, Enum): ROOTLY_ON_CALL_SCHEDULE = 'ROOTLY_ON_CALL_SCHEDULE' DEVIN_GROUP = 'DEVIN_GROUP' GIT_HUB_ENTERPRISE_TEAM = 'GIT_HUB_ENTERPRISE_TEAM' + GRAFANA_TEAM = 'GRAFANA_TEAM' + CLICKHOUSE_ROLE = 'CLICKHOUSE_ROLE' + TWINGATE_GROUP = 'TWINGATE_GROUP' @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/opal_security/models/paginated_tokens_list.py b/opal_security/models/paginated_tokens_list.py new file mode 100644 index 0000000..6a4ad9d --- /dev/null +++ b/opal_security/models/paginated_tokens_list.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from opal_security.models.token import Token +from typing import Optional, Set +from typing_extensions import Self + +class PaginatedTokensList(BaseModel): + """ + PaginatedTokensList + """ # noqa: E501 + next: Optional[StrictStr] = Field(default=None, description="The cursor with which to continue pagination if additional result pages exist.") + previous: Optional[StrictStr] = Field(default=None, description="The cursor used to obtain the current result page.") + results: List[Token] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["next", "previous", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PaginatedTokensList 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. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) + _dict['results'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PaginatedTokensList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "next": obj.get("next"), + "previous": obj.get("previous"), + "results": [Token.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/opal_security/models/resource_remote_info.py b/opal_security/models/resource_remote_info.py index 67846c1..dea3112 100644 --- a/opal_security/models/resource_remote_info.py +++ b/opal_security/models/resource_remote_info.py @@ -42,10 +42,13 @@ from opal_security.models.resource_remote_info_azure_subscription import ResourceRemoteInfoAzureSubscription from opal_security.models.resource_remote_info_azure_user_assigned_managed_identity import ResourceRemoteInfoAzureUserAssignedManagedIdentity from opal_security.models.resource_remote_info_azure_virtual_machine import ResourceRemoteInfoAzureVirtualMachine +from opal_security.models.resource_remote_info_clickhouse_database import ResourceRemoteInfoClickhouseDatabase +from opal_security.models.resource_remote_info_clickhouse_table import ResourceRemoteInfoClickhouseTable from opal_security.models.resource_remote_info_coupa_role import ResourceRemoteInfoCoupaRole from opal_security.models.resource_remote_info_cursor_organization import ResourceRemoteInfoCursorOrganization from opal_security.models.resource_remote_info_custom_connector import ResourceRemoteInfoCustomConnector from opal_security.models.resource_remote_info_databricks_account_service_principal import ResourceRemoteInfoDatabricksAccountServicePrincipal +from opal_security.models.resource_remote_info_datadog_role import ResourceRemoteInfoDatadogRole from opal_security.models.resource_remote_info_datastax_astra_role import ResourceRemoteInfoDatastaxAstraRole from opal_security.models.resource_remote_info_devin_organization import ResourceRemoteInfoDevinOrganization from opal_security.models.resource_remote_info_devin_role import ResourceRemoteInfoDevinRole @@ -66,6 +69,7 @@ from opal_security.models.resource_remote_info_gitlab_project import ResourceRemoteInfoGitlabProject from opal_security.models.resource_remote_info_google_workspace_role import ResourceRemoteInfoGoogleWorkspaceRole from opal_security.models.resource_remote_info_ilevel_advanced_role import ResourceRemoteInfoIlevelAdvancedRole +from opal_security.models.resource_remote_info_netsuite_role import ResourceRemoteInfoNetsuiteRole from opal_security.models.resource_remote_info_okta_app import ResourceRemoteInfoOktaApp from opal_security.models.resource_remote_info_okta_custom_role import ResourceRemoteInfoOktaCustomRole from opal_security.models.resource_remote_info_okta_standard_role import ResourceRemoteInfoOktaStandardRole @@ -81,6 +85,7 @@ from opal_security.models.resource_remote_info_snowflake_table import ResourceRemoteInfoSnowflakeTable from opal_security.models.resource_remote_info_tailscale_ssh import ResourceRemoteInfoTailscaleSsh from opal_security.models.resource_remote_info_teleport_role import ResourceRemoteInfoTeleportRole +from opal_security.models.resource_remote_info_twingate_resource import ResourceRemoteInfoTwingateResource from opal_security.models.resource_remote_info_workday_role import ResourceRemoteInfoWorkdayRole from typing import Optional, Set from typing_extensions import Self @@ -136,6 +141,7 @@ class ResourceRemoteInfo(BaseModel): snowflake_table: Optional[ResourceRemoteInfoSnowflakeTable] = None ilevel_advanced_role: Optional[ResourceRemoteInfoIlevelAdvancedRole] = None tailscale_ssh: Optional[ResourceRemoteInfoTailscaleSsh] = None + twingate_resource: Optional[ResourceRemoteInfoTwingateResource] = None pagerduty_role: Optional[ResourceRemoteInfoPagerdutyRole] = None workday_role: Optional[ResourceRemoteInfoWorkdayRole] = None salesforce_permission_set: Optional[ResourceRemoteInfoSalesforcePermissionSet] = None @@ -151,8 +157,12 @@ class ResourceRemoteInfo(BaseModel): oracle_fusion_role: Optional[ResourceRemoteInfoOracleFusionRole] = None devin_organization: Optional[ResourceRemoteInfoDevinOrganization] = None devin_role: Optional[ResourceRemoteInfoDevinRole] = None + netsuite_role: Optional[ResourceRemoteInfoNetsuiteRole] = None + datadog_role: Optional[ResourceRemoteInfoDatadogRole] = None + clickhouse_database: Optional[ResourceRemoteInfoClickhouseDatabase] = None + clickhouse_table: Optional[ResourceRemoteInfoClickhouseTable] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["databricks_account_service_principal", "azure_subscription", "azure_resource_group", "azure_management_group", "azure_virtual_machine", "azure_storage_account", "azure_storage_container", "azure_sql_server", "azure_sql_database", "azure_sql_managed_instance", "azure_sql_managed_database", "azure_user_assigned_managed_identity", "azure_enterprise_app", "azure_entra_id_role", "aws_organizational_unit", "aws_account", "aws_permission_set", "aws_iam_role", "aws_ec2_instance", "aws_rds_cluster", "aws_rds_instance", "aws_eks_cluster", "custom_connector", "gcp_organization", "gcp_bucket", "gcp_compute_instance", "gcp_big_query_dataset", "gcp_big_query_table", "gcp_folder", "gcp_gke_cluster", "gcp_project", "gcp_sql_instance", "gcp_service_account", "google_workspace_role", "github_repo", "github_org_role", "github_org", "github_enterprise_role", "gitlab_project", "okta_app", "okta_standard_role", "okta_custom_role", "snowflake_database", "snowflake_schema", "snowflake_table", "ilevel_advanced_role", "tailscale_ssh", "pagerduty_role", "workday_role", "salesforce_permission_set", "salesforce_profile", "salesforce_role", "teleport_role", "datastax_astra_role", "coupa_role", "cursor_organization", "openai_platform_project", "openai_platform_service_account", "anthropic_workspace", "oracle_fusion_role", "devin_organization", "devin_role"] + __properties: ClassVar[List[str]] = ["databricks_account_service_principal", "azure_subscription", "azure_resource_group", "azure_management_group", "azure_virtual_machine", "azure_storage_account", "azure_storage_container", "azure_sql_server", "azure_sql_database", "azure_sql_managed_instance", "azure_sql_managed_database", "azure_user_assigned_managed_identity", "azure_enterprise_app", "azure_entra_id_role", "aws_organizational_unit", "aws_account", "aws_permission_set", "aws_iam_role", "aws_ec2_instance", "aws_rds_cluster", "aws_rds_instance", "aws_eks_cluster", "custom_connector", "gcp_organization", "gcp_bucket", "gcp_compute_instance", "gcp_big_query_dataset", "gcp_big_query_table", "gcp_folder", "gcp_gke_cluster", "gcp_project", "gcp_sql_instance", "gcp_service_account", "google_workspace_role", "github_repo", "github_org_role", "github_org", "github_enterprise_role", "gitlab_project", "okta_app", "okta_standard_role", "okta_custom_role", "snowflake_database", "snowflake_schema", "snowflake_table", "ilevel_advanced_role", "tailscale_ssh", "twingate_resource", "pagerduty_role", "workday_role", "salesforce_permission_set", "salesforce_profile", "salesforce_role", "teleport_role", "datastax_astra_role", "coupa_role", "cursor_organization", "openai_platform_project", "openai_platform_service_account", "anthropic_workspace", "oracle_fusion_role", "devin_organization", "devin_role", "netsuite_role", "datadog_role", "clickhouse_database", "clickhouse_table"] model_config = ConfigDict( populate_by_name=True, @@ -336,6 +346,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of tailscale_ssh if self.tailscale_ssh: _dict['tailscale_ssh'] = self.tailscale_ssh.to_dict() + # override the default output from pydantic by calling `to_dict()` of twingate_resource + if self.twingate_resource: + _dict['twingate_resource'] = self.twingate_resource.to_dict() # override the default output from pydantic by calling `to_dict()` of pagerduty_role if self.pagerduty_role: _dict['pagerduty_role'] = self.pagerduty_role.to_dict() @@ -381,6 +394,18 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of devin_role if self.devin_role: _dict['devin_role'] = self.devin_role.to_dict() + # override the default output from pydantic by calling `to_dict()` of netsuite_role + if self.netsuite_role: + _dict['netsuite_role'] = self.netsuite_role.to_dict() + # override the default output from pydantic by calling `to_dict()` of datadog_role + if self.datadog_role: + _dict['datadog_role'] = self.datadog_role.to_dict() + # override the default output from pydantic by calling `to_dict()` of clickhouse_database + if self.clickhouse_database: + _dict['clickhouse_database'] = self.clickhouse_database.to_dict() + # override the default output from pydantic by calling `to_dict()` of clickhouse_table + if self.clickhouse_table: + _dict['clickhouse_table'] = self.clickhouse_table.to_dict() # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -445,6 +470,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "snowflake_table": ResourceRemoteInfoSnowflakeTable.from_dict(obj["snowflake_table"]) if obj.get("snowflake_table") is not None else None, "ilevel_advanced_role": ResourceRemoteInfoIlevelAdvancedRole.from_dict(obj["ilevel_advanced_role"]) if obj.get("ilevel_advanced_role") is not None else None, "tailscale_ssh": ResourceRemoteInfoTailscaleSsh.from_dict(obj["tailscale_ssh"]) if obj.get("tailscale_ssh") is not None else None, + "twingate_resource": ResourceRemoteInfoTwingateResource.from_dict(obj["twingate_resource"]) if obj.get("twingate_resource") is not None else None, "pagerduty_role": ResourceRemoteInfoPagerdutyRole.from_dict(obj["pagerduty_role"]) if obj.get("pagerduty_role") is not None else None, "workday_role": ResourceRemoteInfoWorkdayRole.from_dict(obj["workday_role"]) if obj.get("workday_role") is not None else None, "salesforce_permission_set": ResourceRemoteInfoSalesforcePermissionSet.from_dict(obj["salesforce_permission_set"]) if obj.get("salesforce_permission_set") is not None else None, @@ -459,7 +485,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "anthropic_workspace": ResourceRemoteInfoAnthropicWorkspace.from_dict(obj["anthropic_workspace"]) if obj.get("anthropic_workspace") is not None else None, "oracle_fusion_role": ResourceRemoteInfoOracleFusionRole.from_dict(obj["oracle_fusion_role"]) if obj.get("oracle_fusion_role") is not None else None, "devin_organization": ResourceRemoteInfoDevinOrganization.from_dict(obj["devin_organization"]) if obj.get("devin_organization") is not None else None, - "devin_role": ResourceRemoteInfoDevinRole.from_dict(obj["devin_role"]) if obj.get("devin_role") is not None else None + "devin_role": ResourceRemoteInfoDevinRole.from_dict(obj["devin_role"]) if obj.get("devin_role") is not None else None, + "netsuite_role": ResourceRemoteInfoNetsuiteRole.from_dict(obj["netsuite_role"]) if obj.get("netsuite_role") is not None else None, + "datadog_role": ResourceRemoteInfoDatadogRole.from_dict(obj["datadog_role"]) if obj.get("datadog_role") is not None else None, + "clickhouse_database": ResourceRemoteInfoClickhouseDatabase.from_dict(obj["clickhouse_database"]) if obj.get("clickhouse_database") is not None else None, + "clickhouse_table": ResourceRemoteInfoClickhouseTable.from_dict(obj["clickhouse_table"]) if obj.get("clickhouse_table") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/opal_security/models/resource_remote_info_clickhouse_database.py b/opal_security/models/resource_remote_info_clickhouse_database.py new file mode 100644 index 0000000..f2ff332 --- /dev/null +++ b/opal_security/models/resource_remote_info_clickhouse_database.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class ResourceRemoteInfoClickhouseDatabase(BaseModel): + """ + Remote info for ClickHouse database. + """ # noqa: E501 + database_name: StrictStr = Field(description="The name of the ClickHouse database.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["database_name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ResourceRemoteInfoClickhouseDatabase 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. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ResourceRemoteInfoClickhouseDatabase from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "database_name": obj.get("database_name") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/opal_security/models/resource_remote_info_clickhouse_table.py b/opal_security/models/resource_remote_info_clickhouse_table.py new file mode 100644 index 0000000..4e52a80 --- /dev/null +++ b/opal_security/models/resource_remote_info_clickhouse_table.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class ResourceRemoteInfoClickhouseTable(BaseModel): + """ + Remote info for ClickHouse table. + """ # noqa: E501 + database_name: StrictStr = Field(description="The name of the ClickHouse database containing the table.") + table_name: StrictStr = Field(description="The name of the ClickHouse table.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["database_name", "table_name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ResourceRemoteInfoClickhouseTable 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. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ResourceRemoteInfoClickhouseTable from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "database_name": obj.get("database_name"), + "table_name": obj.get("table_name") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/opal_security/models/resource_remote_info_datadog_role.py b/opal_security/models/resource_remote_info_datadog_role.py new file mode 100644 index 0000000..712677c --- /dev/null +++ b/opal_security/models/resource_remote_info_datadog_role.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class ResourceRemoteInfoDatadogRole(BaseModel): + """ + Remote info for Datadog role. + """ # noqa: E501 + role_id: StrictStr = Field(description="The id of the role.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["role_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ResourceRemoteInfoDatadogRole 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. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ResourceRemoteInfoDatadogRole from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "role_id": obj.get("role_id") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/opal_security/models/resource_remote_info_netsuite_role.py b/opal_security/models/resource_remote_info_netsuite_role.py new file mode 100644 index 0000000..e6e4d1a --- /dev/null +++ b/opal_security/models/resource_remote_info_netsuite_role.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class ResourceRemoteInfoNetsuiteRole(BaseModel): + """ + Remote info for NetSuite role. + """ # noqa: E501 + role_id: StrictStr = Field(description="The id of the role.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["role_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ResourceRemoteInfoNetsuiteRole 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. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ResourceRemoteInfoNetsuiteRole from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "role_id": obj.get("role_id") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/opal_security/models/resource_remote_info_twingate_resource.py b/opal_security/models/resource_remote_info_twingate_resource.py new file mode 100644 index 0000000..7695bfd --- /dev/null +++ b/opal_security/models/resource_remote_info_twingate_resource.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class ResourceRemoteInfoTwingateResource(BaseModel): + """ + Remote info for Twingate resource. + """ # noqa: E501 + resource_id: StrictStr = Field(description="The id of the Twingate resource.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["resource_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ResourceRemoteInfoTwingateResource 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. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ResourceRemoteInfoTwingateResource from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "resource_id": obj.get("resource_id") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/opal_security/models/resource_type_enum.py b/opal_security/models/resource_type_enum.py index 9c82767..558c7c6 100644 --- a/opal_security/models/resource_type_enum.py +++ b/opal_security/models/resource_type_enum.py @@ -70,6 +70,8 @@ class ResourceTypeEnum(str, Enum): GOOGLE_WORKSPACE_ROLE = 'GOOGLE_WORKSPACE_ROLE' MONGO_INSTANCE = 'MONGO_INSTANCE' MONGO_ATLAS_INSTANCE = 'MONGO_ATLAS_INSTANCE' + NETSUITE_ROLE = 'NETSUITE_ROLE' + DATADOG_ROLE = 'DATADOG_ROLE' OKTA_APP = 'OKTA_APP' OKTA_ROLE = 'OKTA_ROLE' OPAL_ROLE = 'OPAL_ROLE' @@ -102,6 +104,13 @@ class ResourceTypeEnum(str, Enum): VAULT_POLICY = 'VAULT_POLICY' VAULT_OIDC_ROLE = 'VAULT_OIDC_ROLE' GIT_HUB_ENTERPRISE_ROLE = 'GIT_HUB_ENTERPRISE_ROLE' + GRAFANA_FOLDER = 'GRAFANA_FOLDER' + GRAFANA_DASHBOARD = 'GRAFANA_DASHBOARD' + GRAFANA_BASIC_ROLE = 'GRAFANA_BASIC_ROLE' + GRAFANA_ROLE = 'GRAFANA_ROLE' + CLICKHOUSE_DATABASE = 'CLICKHOUSE_DATABASE' + CLICKHOUSE_TABLE = 'CLICKHOUSE_TABLE' + TWINGATE_RESOURCE = 'TWINGATE_RESOURCE' @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/opal_security/models/reviewer_stage.py b/opal_security/models/reviewer_stage.py index 5f5013b..7c1ddf5 100644 --- a/opal_security/models/reviewer_stage.py +++ b/opal_security/models/reviewer_stage.py @@ -31,9 +31,10 @@ class ReviewerStage(BaseModel): require_manager_approval: StrictBool = Field(description="Whether this reviewer stage should require manager approval.") require_admin_approval: Optional[StrictBool] = Field(default=None, description="Whether this reviewer stage should require admin approval.") operator: StrictStr = Field(description="The operator of the reviewer stage. Admin and manager approval are also treated as reviewers.") - owner_ids: List[UUID] + owner_ids: List[UUID] = Field(description="The IDs of owners assigned as reviewers for this stage.") + service_user_ids: Optional[List[UUID]] = Field(default=None, description="The IDs of service users assigned as reviewers for this stage.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["require_manager_approval", "require_admin_approval", "operator", "owner_ids"] + __properties: ClassVar[List[str]] = ["require_manager_approval", "require_admin_approval", "operator", "owner_ids", "service_user_ids"] @field_validator('operator') def operator_validate_enum(cls, value): @@ -103,7 +104,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "require_manager_approval": obj.get("require_manager_approval"), "require_admin_approval": obj.get("require_admin_approval"), "operator": obj.get("operator"), - "owner_ids": obj.get("owner_ids") + "owner_ids": obj.get("owner_ids"), + "service_user_ids": obj.get("service_user_ids") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/opal_security/models/token.py b/opal_security/models/token.py new file mode 100644 index 0000000..f050a8d --- /dev/null +++ b/opal_security/models/token.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from opal_security.models.api_access_level_enum import ApiAccessLevelEnum +from typing import Optional, Set +from typing_extensions import Self + +class Token(BaseModel): + """ + A first-party API token. + """ # noqa: E501 + token_id: UUID = Field(description="The ID of the API token.") + created_at: datetime = Field(description="The date and time the token was created.") + token_label: StrictStr = Field(description="A human-readable label for the token.") + creator_user_id: UUID = Field(description="The ID of the user who created the token.") + user_id: UUID = Field(description="The ID of the user the token authenticates as.") + last_used_at: Optional[datetime] = Field(default=None, description="The date and time the token was last used.") + access_level: ApiAccessLevelEnum + expires_at: Optional[datetime] = Field(default=None, description="The date and time the token expires.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["token_id", "created_at", "token_label", "creator_user_id", "user_id", "last_used_at", "access_level", "expires_at"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Token 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. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Token from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "token_id": obj.get("token_id"), + "created_at": obj.get("created_at"), + "token_label": obj.get("token_label"), + "creator_user_id": obj.get("creator_user_id"), + "user_id": obj.get("user_id"), + "last_used_at": obj.get("last_used_at"), + "access_level": obj.get("access_level"), + "expires_at": obj.get("expires_at") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/openapitools.json b/openapitools.json index f8d07ce..dae2553 100644 --- a/openapitools.json +++ b/openapitools.json @@ -2,6 +2,6 @@ "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", "spaces": 2, "generator-cli": { - "version": "7.10.0" + "version": "7.19.0" } } diff --git a/test/test_api_access_level_enum.py b/test/test_api_access_level_enum.py new file mode 100644 index 0000000..a765eac --- /dev/null +++ b/test/test_api_access_level_enum.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from opal_security.models.api_access_level_enum import ApiAccessLevelEnum + +class TestApiAccessLevelEnum(unittest.TestCase): + """ApiAccessLevelEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testApiAccessLevelEnum(self): + """Test ApiAccessLevelEnum""" + # inst = ApiAccessLevelEnum() + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_group_remote_info_clickhouse_role.py b/test/test_group_remote_info_clickhouse_role.py new file mode 100644 index 0000000..fb43c29 --- /dev/null +++ b/test/test_group_remote_info_clickhouse_role.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from opal_security.models.group_remote_info_clickhouse_role import GroupRemoteInfoClickhouseRole + +class TestGroupRemoteInfoClickhouseRole(unittest.TestCase): + """GroupRemoteInfoClickhouseRole unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GroupRemoteInfoClickhouseRole: + """Test GroupRemoteInfoClickhouseRole + include_optional 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 `GroupRemoteInfoClickhouseRole` + """ + model = GroupRemoteInfoClickhouseRole() + if include_optional: + return GroupRemoteInfoClickhouseRole( + role_id = 'my_clickhouse_role' + ) + else: + return GroupRemoteInfoClickhouseRole( + role_id = 'my_clickhouse_role', + ) + """ + + def testGroupRemoteInfoClickhouseRole(self): + """Test GroupRemoteInfoClickhouseRole""" + # 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/test/test_group_remote_info_twingate_group.py b/test/test_group_remote_info_twingate_group.py new file mode 100644 index 0000000..1622aa8 --- /dev/null +++ b/test/test_group_remote_info_twingate_group.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from opal_security.models.group_remote_info_twingate_group import GroupRemoteInfoTwingateGroup + +class TestGroupRemoteInfoTwingateGroup(unittest.TestCase): + """GroupRemoteInfoTwingateGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GroupRemoteInfoTwingateGroup: + """Test GroupRemoteInfoTwingateGroup + include_optional 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 `GroupRemoteInfoTwingateGroup` + """ + model = GroupRemoteInfoTwingateGroup() + if include_optional: + return GroupRemoteInfoTwingateGroup( + group_id = 'R3JvdXA6MTIzNA==' + ) + else: + return GroupRemoteInfoTwingateGroup( + group_id = 'R3JvdXA6MTIzNA==', + ) + """ + + def testGroupRemoteInfoTwingateGroup(self): + """Test GroupRemoteInfoTwingateGroup""" + # 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/test/test_paginated_tokens_list.py b/test/test_paginated_tokens_list.py new file mode 100644 index 0000000..2ddc1f8 --- /dev/null +++ b/test/test_paginated_tokens_list.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from opal_security.models.paginated_tokens_list import PaginatedTokensList + +class TestPaginatedTokensList(unittest.TestCase): + """PaginatedTokensList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PaginatedTokensList: + """Test PaginatedTokensList + include_optional 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 `PaginatedTokensList` + """ + model = PaginatedTokensList() + if include_optional: + return PaginatedTokensList( + next = 'cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw', + previous = 'cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ', + results = [ + {token_id=f454d283-ca87-4a8a-bdbb-df212eca5353, created_at=2022-01-23T04:56:07.000+00:00, token_preview=ab123, token_label=My API Token, creator_user_id=d4a7d928-783e-4599-8ec6-088d635a5bcc, user_id=d4a7d928-783e-4599-8ec6-088d635a5bcc, access_level=READ_ONLY} + ] + ) + else: + return PaginatedTokensList( + results = [ + {token_id=f454d283-ca87-4a8a-bdbb-df212eca5353, created_at=2022-01-23T04:56:07.000+00:00, token_preview=ab123, token_label=My API Token, creator_user_id=d4a7d928-783e-4599-8ec6-088d635a5bcc, user_id=d4a7d928-783e-4599-8ec6-088d635a5bcc, access_level=READ_ONLY} + ], + ) + """ + + def testPaginatedTokensList(self): + """Test PaginatedTokensList""" + # 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/test/test_resource_remote_info_clickhouse_database.py b/test/test_resource_remote_info_clickhouse_database.py new file mode 100644 index 0000000..03a0ec8 --- /dev/null +++ b/test/test_resource_remote_info_clickhouse_database.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from opal_security.models.resource_remote_info_clickhouse_database import ResourceRemoteInfoClickhouseDatabase + +class TestResourceRemoteInfoClickhouseDatabase(unittest.TestCase): + """ResourceRemoteInfoClickhouseDatabase unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ResourceRemoteInfoClickhouseDatabase: + """Test ResourceRemoteInfoClickhouseDatabase + include_optional 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 `ResourceRemoteInfoClickhouseDatabase` + """ + model = ResourceRemoteInfoClickhouseDatabase() + if include_optional: + return ResourceRemoteInfoClickhouseDatabase( + database_name = 'my_database' + ) + else: + return ResourceRemoteInfoClickhouseDatabase( + database_name = 'my_database', + ) + """ + + def testResourceRemoteInfoClickhouseDatabase(self): + """Test ResourceRemoteInfoClickhouseDatabase""" + # 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/test/test_resource_remote_info_clickhouse_table.py b/test/test_resource_remote_info_clickhouse_table.py new file mode 100644 index 0000000..f12bcda --- /dev/null +++ b/test/test_resource_remote_info_clickhouse_table.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from opal_security.models.resource_remote_info_clickhouse_table import ResourceRemoteInfoClickhouseTable + +class TestResourceRemoteInfoClickhouseTable(unittest.TestCase): + """ResourceRemoteInfoClickhouseTable unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ResourceRemoteInfoClickhouseTable: + """Test ResourceRemoteInfoClickhouseTable + include_optional 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 `ResourceRemoteInfoClickhouseTable` + """ + model = ResourceRemoteInfoClickhouseTable() + if include_optional: + return ResourceRemoteInfoClickhouseTable( + database_name = 'my_database', + table_name = 'my_table' + ) + else: + return ResourceRemoteInfoClickhouseTable( + database_name = 'my_database', + table_name = 'my_table', + ) + """ + + def testResourceRemoteInfoClickhouseTable(self): + """Test ResourceRemoteInfoClickhouseTable""" + # 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/test/test_resource_remote_info_datadog_role.py b/test/test_resource_remote_info_datadog_role.py new file mode 100644 index 0000000..731162b --- /dev/null +++ b/test/test_resource_remote_info_datadog_role.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from opal_security.models.resource_remote_info_datadog_role import ResourceRemoteInfoDatadogRole + +class TestResourceRemoteInfoDatadogRole(unittest.TestCase): + """ResourceRemoteInfoDatadogRole unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ResourceRemoteInfoDatadogRole: + """Test ResourceRemoteInfoDatadogRole + include_optional 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 `ResourceRemoteInfoDatadogRole` + """ + model = ResourceRemoteInfoDatadogRole() + if include_optional: + return ResourceRemoteInfoDatadogRole( + role_id = '123e4567-e89b-12d3-a456-426614174000' + ) + else: + return ResourceRemoteInfoDatadogRole( + role_id = '123e4567-e89b-12d3-a456-426614174000', + ) + """ + + def testResourceRemoteInfoDatadogRole(self): + """Test ResourceRemoteInfoDatadogRole""" + # 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/test/test_resource_remote_info_netsuite_role.py b/test/test_resource_remote_info_netsuite_role.py new file mode 100644 index 0000000..a510d7d --- /dev/null +++ b/test/test_resource_remote_info_netsuite_role.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from opal_security.models.resource_remote_info_netsuite_role import ResourceRemoteInfoNetsuiteRole + +class TestResourceRemoteInfoNetsuiteRole(unittest.TestCase): + """ResourceRemoteInfoNetsuiteRole unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ResourceRemoteInfoNetsuiteRole: + """Test ResourceRemoteInfoNetsuiteRole + include_optional 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 `ResourceRemoteInfoNetsuiteRole` + """ + model = ResourceRemoteInfoNetsuiteRole() + if include_optional: + return ResourceRemoteInfoNetsuiteRole( + role_id = '123e4567-e89b-12d3-a456-426614174000' + ) + else: + return ResourceRemoteInfoNetsuiteRole( + role_id = '123e4567-e89b-12d3-a456-426614174000', + ) + """ + + def testResourceRemoteInfoNetsuiteRole(self): + """Test ResourceRemoteInfoNetsuiteRole""" + # 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/test/test_resource_remote_info_twingate_resource.py b/test/test_resource_remote_info_twingate_resource.py new file mode 100644 index 0000000..d75fd55 --- /dev/null +++ b/test/test_resource_remote_info_twingate_resource.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from opal_security.models.resource_remote_info_twingate_resource import ResourceRemoteInfoTwingateResource + +class TestResourceRemoteInfoTwingateResource(unittest.TestCase): + """ResourceRemoteInfoTwingateResource unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ResourceRemoteInfoTwingateResource: + """Test ResourceRemoteInfoTwingateResource + include_optional 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 `ResourceRemoteInfoTwingateResource` + """ + model = ResourceRemoteInfoTwingateResource() + if include_optional: + return ResourceRemoteInfoTwingateResource( + resource_id = 'UmVzb3VyY2U6MTIzNA==' + ) + else: + return ResourceRemoteInfoTwingateResource( + resource_id = 'UmVzb3VyY2U6MTIzNA==', + ) + """ + + def testResourceRemoteInfoTwingateResource(self): + """Test ResourceRemoteInfoTwingateResource""" + # 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/test/test_token.py b/test/test_token.py new file mode 100644 index 0000000..8fc7b38 --- /dev/null +++ b/test/test_token.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from opal_security.models.token import Token + +class TestToken(unittest.TestCase): + """Token unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Token: + """Test Token + include_optional 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 `Token` + """ + model = Token() + if include_optional: + return Token( + token_id = 'f454d283-ca87-4a8a-bdbb-df212eca5353', + created_at = '2022-01-23T04:56:07.000+00:00', + token_label = 'My API Token', + creator_user_id = 'd4a7d928-783e-4599-8ec6-088d635a5bcc', + user_id = 'd4a7d928-783e-4599-8ec6-088d635a5bcc', + last_used_at = '2022-01-23T04:56:07.000+00:00', + access_level = 'READ_ONLY', + expires_at = '2023-01-23T04:56:07.000+00:00' + ) + else: + return Token( + token_id = 'f454d283-ca87-4a8a-bdbb-df212eca5353', + created_at = '2022-01-23T04:56:07.000+00:00', + token_label = 'My API Token', + creator_user_id = 'd4a7d928-783e-4599-8ec6-088d635a5bcc', + user_id = 'd4a7d928-783e-4599-8ec6-088d635a5bcc', + access_level = 'READ_ONLY', + ) + """ + + def testToken(self): + """Test Token""" + # 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/test/test_tokens_api.py b/test/test_tokens_api.py new file mode 100644 index 0000000..dca4c49 --- /dev/null +++ b/test/test_tokens_api.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from opal_security.api.tokens_api import TokensApi + + +class TestTokensApi(unittest.TestCase): + """TokensApi unit test stubs""" + + def setUp(self) -> None: + self.api = TokensApi() + + def tearDown(self) -> None: + pass + + def test_delete_token(self) -> None: + """Test case for delete_token + + Delete token + """ + pass + + def test_get_tokens(self) -> None: + """Test case for get_tokens + + Get tokens + """ + pass + + +if __name__ == '__main__': + unittest.main()