From ae87796054ff192fb3079d9cc8dc73bc865e7fa1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 18 May 2026 00:33:18 +0000 Subject: [PATCH] Auto-update SDK on 2026-05-18 --- .openapi-generator/FILES | 32 +- README.md | 8 + api/openapi.yaml | 179 ++++++++++- docs/AccessRule.md | 2 +- docs/AccessRulesApi.md | 80 +++++ docs/GroupContainingGroup.md | 2 +- docs/GroupRemoteInfo.md | 2 + docs/GroupRemoteInfoGithubTeam.md | 1 + docs/GroupRemoteInfoGrafanaTeam.md | 30 ++ docs/GroupRemoteInfoTwingateGroupSynced.md | 30 ++ docs/GroupTypeEnum.md | 2 + docs/PaginatedAccessRulesList.md | 31 ++ docs/ResourceRemoteInfo.md | 3 + docs/ResourceRemoteInfoGithubOrgRole.md | 1 + docs/ResourceRemoteInfoGithubRepo.md | 1 + docs/ResourceRemoteInfoGrafanaDashboard.md | 30 ++ docs/ResourceRemoteInfoGrafanaFolder.md | 30 ++ docs/ResourceRemoteInfoGrafanaRole.md | 30 ++ docs/RuleDisjunction.md | 1 + docs/UpdateGroupUserRequest.md | 2 +- docs/UpdateResourceInfo.md | 1 + docs/UpdateResourceUserRequest.md | 2 +- docs/UserAttributeSelector.md | 30 ++ opal_security/__init__.py | 14 + opal_security/api/access_rules_api.py | 284 +++++++++++++++++- opal_security/models/__init__.py | 7 + opal_security/models/access_rule.py | 2 +- .../models/group_containing_group.py | 2 +- opal_security/models/group_remote_info.py | 16 +- .../models/group_remote_info_github_team.py | 6 +- .../models/group_remote_info_grafana_team.py | 101 +++++++ ...group_remote_info_twingate_group_synced.py | 101 +++++++ opal_security/models/group_type_enum.py | 1 + .../models/paginated_access_rules_list.py | 113 +++++++ opal_security/models/resource_remote_info.py | 22 +- .../resource_remote_info_github_org_role.py | 8 +- .../resource_remote_info_github_repo.py | 6 +- .../resource_remote_info_grafana_dashboard.py | 101 +++++++ .../resource_remote_info_grafana_folder.py | 101 +++++++ .../resource_remote_info_grafana_role.py | 101 +++++++ opal_security/models/rule_disjunction.py | 16 +- .../models/update_group_user_request.py | 2 +- opal_security/models/update_resource_info.py | 4 +- .../models/update_resource_user_request.py | 2 +- .../models/user_attribute_selector.py | 110 +++++++ pyproject.toml | 4 +- test/test_group_remote_info_grafana_team.py | 53 ++++ ...group_remote_info_twingate_group_synced.py | 53 ++++ test/test_paginated_access_rules_list.py | 125 ++++++++ ..._resource_remote_info_grafana_dashboard.py | 53 ++++ ...est_resource_remote_info_grafana_folder.py | 53 ++++ .../test_resource_remote_info_grafana_role.py | 53 ++++ test/test_user_attribute_selector.py | 59 ++++ 53 files changed, 2060 insertions(+), 43 deletions(-) create mode 100644 docs/GroupRemoteInfoGrafanaTeam.md create mode 100644 docs/GroupRemoteInfoTwingateGroupSynced.md create mode 100644 docs/PaginatedAccessRulesList.md create mode 100644 docs/ResourceRemoteInfoGrafanaDashboard.md create mode 100644 docs/ResourceRemoteInfoGrafanaFolder.md create mode 100644 docs/ResourceRemoteInfoGrafanaRole.md create mode 100644 docs/UserAttributeSelector.md create mode 100644 opal_security/models/group_remote_info_grafana_team.py create mode 100644 opal_security/models/group_remote_info_twingate_group_synced.py create mode 100644 opal_security/models/paginated_access_rules_list.py create mode 100644 opal_security/models/resource_remote_info_grafana_dashboard.py create mode 100644 opal_security/models/resource_remote_info_grafana_folder.py create mode 100644 opal_security/models/resource_remote_info_grafana_role.py create mode 100644 opal_security/models/user_attribute_selector.py create mode 100644 test/test_group_remote_info_grafana_team.py create mode 100644 test/test_group_remote_info_twingate_group_synced.py create mode 100644 test/test_paginated_access_rules_list.py create mode 100644 test/test_resource_remote_info_grafana_dashboard.py create mode 100644 test/test_resource_remote_info_grafana_folder.py create mode 100644 test/test_resource_remote_info_grafana_role.py create mode 100644 test/test_user_attribute_selector.py diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index ae34470..2eaa83d 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -81,6 +81,7 @@ docs/GroupRemoteInfoGithubEnterpriseTeam.md docs/GroupRemoteInfoGithubTeam.md docs/GroupRemoteInfoGitlabGroup.md docs/GroupRemoteInfoGoogleGroup.md +docs/GroupRemoteInfoGrafanaTeam.md docs/GroupRemoteInfoIncidentioOnCallSchedule.md docs/GroupRemoteInfoLdapGroup.md docs/GroupRemoteInfoOktaGroup.md @@ -90,6 +91,7 @@ docs/GroupRemoteInfoRootlyOnCallSchedule.md docs/GroupRemoteInfoSnowflakeRole.md docs/GroupRemoteInfoTailscaleGroup.md docs/GroupRemoteInfoTwingateGroup.md +docs/GroupRemoteInfoTwingateGroupSynced.md docs/GroupRemoteInfoWorkdayUserSecurityGroup.md docs/GroupResource.md docs/GroupResourceList.md @@ -115,6 +117,7 @@ docs/OnCallSchedulesApi.md docs/Owner.md docs/OwnersApi.md docs/PageInfo.md +docs/PaginatedAccessRulesList.md docs/PaginatedAssignedRequestList.md docs/PaginatedBundleGroupList.md docs/PaginatedBundleList.md @@ -207,6 +210,9 @@ docs/ResourceRemoteInfoGithubOrgRole.md docs/ResourceRemoteInfoGithubRepo.md docs/ResourceRemoteInfoGitlabProject.md docs/ResourceRemoteInfoGoogleWorkspaceRole.md +docs/ResourceRemoteInfoGrafanaDashboard.md +docs/ResourceRemoteInfoGrafanaFolder.md +docs/ResourceRemoteInfoGrafanaRole.md docs/ResourceRemoteInfoIlevelAdvancedRole.md docs/ResourceRemoteInfoNetsuiteRole.md docs/ResourceRemoteInfoOktaApp.md @@ -281,6 +287,7 @@ docs/UpdateResourceInfo.md docs/UpdateResourceInfoList.md docs/UpdateResourceUserRequest.md docs/User.md +docs/UserAttributeSelector.md docs/UserHrIdpStatusEnum.md docs/UserIDList.md docs/UserList.md @@ -386,6 +393,7 @@ opal_security/models/group_remote_info_github_enterprise_team.py opal_security/models/group_remote_info_github_team.py opal_security/models/group_remote_info_gitlab_group.py opal_security/models/group_remote_info_google_group.py +opal_security/models/group_remote_info_grafana_team.py opal_security/models/group_remote_info_incidentio_on_call_schedule.py opal_security/models/group_remote_info_ldap_group.py opal_security/models/group_remote_info_okta_group.py @@ -395,6 +403,7 @@ 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_twingate_group_synced.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 @@ -414,6 +423,7 @@ opal_security/models/on_call_schedule_list.py opal_security/models/on_call_schedule_provider_enum.py opal_security/models/owner.py opal_security/models/page_info.py +opal_security/models/paginated_access_rules_list.py opal_security/models/paginated_assigned_request_list.py opal_security/models/paginated_bundle_group_list.py opal_security/models/paginated_bundle_list.py @@ -505,6 +515,9 @@ opal_security/models/resource_remote_info_github_org_role.py 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_grafana_dashboard.py +opal_security/models/resource_remote_info_grafana_folder.py +opal_security/models/resource_remote_info_grafana_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 @@ -574,6 +587,7 @@ opal_security/models/update_resource_info.py opal_security/models/update_resource_info_list.py opal_security/models/update_resource_user_request.py opal_security/models/user.py +opal_security/models/user_attribute_selector.py opal_security/models/user_hr_idp_status_enum.py opal_security/models/user_id_list.py opal_security/models/user_list.py @@ -587,15 +601,11 @@ 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 +test/test_group_remote_info_grafana_team.py +test/test_group_remote_info_twingate_group_synced.py +test/test_paginated_access_rules_list.py +test/test_resource_remote_info_grafana_dashboard.py +test/test_resource_remote_info_grafana_folder.py +test/test_resource_remote_info_grafana_role.py +test/test_user_attribute_selector.py tox.ini diff --git a/README.md b/README.md index 1ba7a07..582afbb 100644 --- a/README.md +++ b/README.md @@ -142,6 +142,7 @@ Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AccessRulesApi* | [**create_access_rule**](docs/AccessRulesApi.md#create_access_rule) | **POST** /access-rules | *AccessRulesApi* | [**get_access_rule**](docs/AccessRulesApi.md#get_access_rule) | **GET** /access-rules/{access_rule_id} | +*AccessRulesApi* | [**get_access_rules**](docs/AccessRulesApi.md#get_access_rules) | **GET** /access-rules | *AccessRulesApi* | [**update_access_rule**](docs/AccessRulesApi.md#update_access_rule) | **PUT** /access-rules/{access_rule_id} | *AppsApi* | [**get_app**](docs/AppsApi.md#get_app) | **GET** /apps/{app_id} | Get app by ID *AppsApi* | [**get_apps**](docs/AppsApi.md#get_apps) | **GET** /apps | Get apps @@ -353,6 +354,7 @@ Class | Method | HTTP request | Description - [GroupRemoteInfoGithubTeam](docs/GroupRemoteInfoGithubTeam.md) - [GroupRemoteInfoGitlabGroup](docs/GroupRemoteInfoGitlabGroup.md) - [GroupRemoteInfoGoogleGroup](docs/GroupRemoteInfoGoogleGroup.md) + - [GroupRemoteInfoGrafanaTeam](docs/GroupRemoteInfoGrafanaTeam.md) - [GroupRemoteInfoIncidentioOnCallSchedule](docs/GroupRemoteInfoIncidentioOnCallSchedule.md) - [GroupRemoteInfoLdapGroup](docs/GroupRemoteInfoLdapGroup.md) - [GroupRemoteInfoOktaGroup](docs/GroupRemoteInfoOktaGroup.md) @@ -362,6 +364,7 @@ Class | Method | HTTP request | Description - [GroupRemoteInfoSnowflakeRole](docs/GroupRemoteInfoSnowflakeRole.md) - [GroupRemoteInfoTailscaleGroup](docs/GroupRemoteInfoTailscaleGroup.md) - [GroupRemoteInfoTwingateGroup](docs/GroupRemoteInfoTwingateGroup.md) + - [GroupRemoteInfoTwingateGroupSynced](docs/GroupRemoteInfoTwingateGroupSynced.md) - [GroupRemoteInfoWorkdayUserSecurityGroup](docs/GroupRemoteInfoWorkdayUserSecurityGroup.md) - [GroupResource](docs/GroupResource.md) - [GroupResourceList](docs/GroupResourceList.md) @@ -381,6 +384,7 @@ Class | Method | HTTP request | Description - [OnCallScheduleProviderEnum](docs/OnCallScheduleProviderEnum.md) - [Owner](docs/Owner.md) - [PageInfo](docs/PageInfo.md) + - [PaginatedAccessRulesList](docs/PaginatedAccessRulesList.md) - [PaginatedAssignedRequestList](docs/PaginatedAssignedRequestList.md) - [PaginatedBundleGroupList](docs/PaginatedBundleGroupList.md) - [PaginatedBundleList](docs/PaginatedBundleList.md) @@ -472,6 +476,9 @@ Class | Method | HTTP request | Description - [ResourceRemoteInfoGithubRepo](docs/ResourceRemoteInfoGithubRepo.md) - [ResourceRemoteInfoGitlabProject](docs/ResourceRemoteInfoGitlabProject.md) - [ResourceRemoteInfoGoogleWorkspaceRole](docs/ResourceRemoteInfoGoogleWorkspaceRole.md) + - [ResourceRemoteInfoGrafanaDashboard](docs/ResourceRemoteInfoGrafanaDashboard.md) + - [ResourceRemoteInfoGrafanaFolder](docs/ResourceRemoteInfoGrafanaFolder.md) + - [ResourceRemoteInfoGrafanaRole](docs/ResourceRemoteInfoGrafanaRole.md) - [ResourceRemoteInfoIlevelAdvancedRole](docs/ResourceRemoteInfoIlevelAdvancedRole.md) - [ResourceRemoteInfoNetsuiteRole](docs/ResourceRemoteInfoNetsuiteRole.md) - [ResourceRemoteInfoOktaApp](docs/ResourceRemoteInfoOktaApp.md) @@ -541,6 +548,7 @@ Class | Method | HTTP request | Description - [UpdateResourceInfoList](docs/UpdateResourceInfoList.md) - [UpdateResourceUserRequest](docs/UpdateResourceUserRequest.md) - [User](docs/User.md) + - [UserAttributeSelector](docs/UserAttributeSelector.md) - [UserHrIdpStatusEnum](docs/UserHrIdpStatusEnum.md) - [UserIDList](docs/UserIDList.md) - [UserList](docs/UserList.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index dd34b00..b1682f1 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -1621,7 +1621,7 @@ paths: access_level_remote_id: arn:aws:iam::590304332660:role/AdministratorAccess properties: duration_minutes: - description: The updated duration for which the group can be accessed (in minutes). Use 0 for indefinite. + description: The updated duration for which the group can be accessed (in minutes). Use 0 for indefinite, or a negative value to revoke access. type: integer maximum: 525960 # One year example: 120 @@ -3470,7 +3470,7 @@ paths: access_level_remote_id: arn:aws:iam::590304332660:role/AdministratorAccess properties: duration_minutes: - description: The updated duration for which the resource can be accessed (in minutes). Use 0 for indefinite. + description: The updated duration for which the resource can be accessed (in minutes). Use 0 for indefinite, or a negative value to revoke access. type: integer maximum: 525960 # One year example: 120 @@ -4026,6 +4026,39 @@ paths: tags: - users /access-rules: + get: + description: Returns a list of access rules for your organization. + operationId: get_access_rules + 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 + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/PaginatedAccessRulesList" + description: One page of access rules for your organization. + security: + - BearerAuth: [] + tags: + - access-rules post: description: Creates a new access rule config for the given group_id. operationId: create_access_rule @@ -6213,17 +6246,41 @@ components: results: - group_id: f454d283-ca87-4a8a-bdbb-df212eca5353 app_id: b5a5ca27-0ea3-4d86-9199-2126d57d1fbd + name: Payments Production Admin description: This group represents Active Directory group "Payments Production Admin". We use this AD group to facilitate staging deployments and qualifying new releases. admin_owner_id: 7c86c85d-0651-43e2-a748-d69d658418e8 + group_leader_user_ids: + - 7c86c85d-0651-43e2-a748-d69d658418e8 + remote_id: 037m2jsg218b2wb + remote_name: Finance Team + group_type: ACTIVE_DIRECTORY_GROUP max_duration: 120 + recommended_duration: 60 + extensions_duration_in_minutes: 60 require_manager_approval: False require_support_ticket: False + require_mfa_to_approve: False + require_mfa_to_request: False + auto_approval: False + is_requestable: True - group_id: 99d0b81d-14be-4cf6-bd27-348b4af1d11b + app_id: a7c3e291-1234-4abc-9def-1234567890ab + name: Integrations On-Call description: Manages the Integrations Team on-call privileged resources. This group is automatically synced with the on-call rotation defined in PagerDuty. admin_owner_id: 4220bc12-ab8a-4b5d-be7b-f6bbcf9159f3 + group_leader_user_ids: [] + remote_id: pagerduty-schedule:P123XYZ + remote_name: Integrations On-Call + group_type: PAGERDUTY_ON_CALL_SCHEDULE max_duration: 360 + recommended_duration: 120 + extensions_duration_in_minutes: 0 require_manager_approval: False require_support_ticket: True + require_mfa_to_approve: False + require_mfa_to_request: False + auto_approval: False + is_requestable: True properties: next: description: @@ -6299,7 +6356,7 @@ components: format: uuid type: string duration_minutes: - description: The updated duration for which the group can be accessed (in minutes). Use 0 for indefinite. + description: The updated duration for which the group can be accessed (in minutes). Use 0 for indefinite, or a negative value to revoke access. type: integer maximum: 525960 # One year example: 120 @@ -6321,13 +6378,23 @@ components: example: group_id: f454d283-ca87-4a8a-bdbb-df212eca5353 app_id: b5a5ca27-0ea3-4d86-9199-2126d57d1fbd - remote_id: 037m2jsg218b2wb - remote_name: Finance Team + name: Payments Production Admin description: This group represents Active Directory group "Payments Production Admin". We use this AD group to facilitate staging deployments and qualifying new releases. admin_owner_id: 7c86c85d-0651-43e2-a748-d69d658418e8 + group_leader_user_ids: + - 7c86c85d-0651-43e2-a748-d69d658418e8 + remote_id: 037m2jsg218b2wb + remote_name: Finance Team + group_type: ACTIVE_DIRECTORY_GROUP max_duration: 120 + recommended_duration: 60 + extensions_duration_in_minutes: 60 require_manager_approval: False require_support_ticket: False + require_mfa_to_approve: False + require_mfa_to_request: False + auto_approval: False + is_requestable: True properties: group_id: description: The ID of the group. @@ -6825,6 +6892,7 @@ components: - GRAFANA_TEAM - CLICKHOUSE_ROLE - TWINGATE_GROUP + - TWINGATE_GROUP_SYNCED example: OPAL_GROUP type: string ResourceTypeEnum: @@ -7407,6 +7475,16 @@ components: type: object required: - group_id + twingate_group_synced: + description: Remote info for Twingate synced group. + properties: + group_id: + description: The id of the Twingate synced group. + example: R3JvdXA6MTIzNA== + type: string + type: object + required: + - group_id aws_sso_group: description: Remote info for AWS SSO group. properties: @@ -7449,6 +7527,9 @@ components: description: The slug of the GitHub team. example: opal-security type: string + org_name: + description: GitHub team's org name, required only for Enterprise + type: string type: object required: - team_slug @@ -7612,6 +7693,16 @@ components: type: object required: - role_id + grafana_team: + description: Remote info for Grafana team. + properties: + team_id: + description: The ID of the team. + example: 2323 + type: string + type: object + required: + - team_id type: object ResourceRemoteInfo: description: Information that defines the remote resource. This replaces the deprecated remote_id and metadata fields. @@ -8086,6 +8177,9 @@ components: description: The name of the repository. example: Opal Security type: string + org_name: + description: GitHub repo's org name, required only for Enterprise. + type: string type: object required: - repo_name @@ -8096,6 +8190,9 @@ components: description: The id of the role. example: 112233 type: string + org_name: + description: GitHub org role's org name, required only for Enterprise. + type: string type: object required: - role_id @@ -8440,6 +8537,36 @@ components: required: - database_name - table_name + grafana_folder: + description: Remote info for Grafana folder. + properties: + folder_uid: + description: The UID of the Grafana folder. + example: fffRTXX + type: string + type: object + required: + - folder_uid + grafana_dashboard: + description: Remote info for Grafana dashboard. + properties: + dashboard_uid: + description: The UID of the Grafana dashboard. + example: dddRTXX + type: string + type: object + required: + - dashboard_uid + grafana_role: + description: Remote info for Grafana role(fixed or custom). + properties: + role_uid: + description: The UID of the Grafana role. + example: rrfRTXX + type: string + type: object + required: + - role_uid type: object RiskSensitivityEnum: type: string @@ -9675,6 +9802,12 @@ components: type: integer example: 120 deprecated: true + parent_resource_id: + description: The ID of the parent resource. + example: f454d283-ca67-4a8a-bdbb-df212eca5345 + format: uuid + type: string + nullable: true request_configurations: type: array items: @@ -10098,6 +10231,23 @@ components: - name - admin_owner_id - description + PaginatedAccessRulesList: + properties: + next: + description: The cursor with which to continue pagination if additional result pages exist. + example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + type: string + previous: + description: The cursor used to retrieve the previous page of results. + example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + type: string + results: + items: + $ref: "#/components/schemas/AccessRule" + type: array + required: + - results + type: object AccessRule: description: |- # Access Rule Object @@ -10105,7 +10255,7 @@ components: The `AccessRule` object is used to represent an access rule configuration. ### Usage Example - Get access rule configurations from the `GET Access Rule Configs` endpoint. + List access rules from the `GET /access-rules` endpoint, or retrieve a single access rule from the `GET /access-rules/{access_rule_id}` endpoint. properties: access_rule_id: description: The ID (group ID) of the access rule. @@ -10164,6 +10314,10 @@ components: type: array items: $ref: "#/components/schemas/TagSelector" + attribute_selectors: + type: array + items: + $ref: "#/components/schemas/UserAttributeSelector" required: - selectors TagSelector: @@ -10179,6 +10333,19 @@ components: - key - value - connection_id + UserAttributeSelector: + properties: + attribute: + type: string + enum: + - HR_IDP_STATUS + values: + type: array + items: + type: string + required: + - attribute + - values PaginatedOwnersList: example: next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw diff --git a/docs/AccessRule.md b/docs/AccessRule.md index fd609da..ed45494 100644 --- a/docs/AccessRule.md +++ b/docs/AccessRule.md @@ -1,6 +1,6 @@ # AccessRule -# Access Rule Object ### Description The `AccessRule` object is used to represent an access rule configuration. ### Usage Example Get access rule configurations from the `GET Access Rule Configs` endpoint. +# Access Rule Object ### Description The `AccessRule` object is used to represent an access rule configuration. ### Usage Example List access rules from the `GET /access-rules` endpoint, or retrieve a single access rule from the `GET /access-rules/{access_rule_id}` endpoint. ## Properties diff --git a/docs/AccessRulesApi.md b/docs/AccessRulesApi.md index 34e92d3..964e471 100644 --- a/docs/AccessRulesApi.md +++ b/docs/AccessRulesApi.md @@ -6,6 +6,7 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**create_access_rule**](AccessRulesApi.md#create_access_rule) | **POST** /access-rules | [**get_access_rule**](AccessRulesApi.md#get_access_rule) | **GET** /access-rules/{access_rule_id} | +[**get_access_rules**](AccessRulesApi.md#get_access_rules) | **GET** /access-rules | [**update_access_rule**](AccessRulesApi.md#update_access_rule) | **PUT** /access-rules/{access_rule_id} | @@ -164,6 +165,85 @@ 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_access_rules** +> PaginatedAccessRulesList get_access_rules(cursor=cursor, page_size=page_size) + +Returns a list of access rules for your organization. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import opal_security +from opal_security.models.paginated_access_rules_list import PaginatedAccessRulesList +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.AccessRulesApi(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) + + try: + api_response = api_instance.get_access_rules(cursor=cursor, page_size=page_size) + print("The response of AccessRulesApi->get_access_rules:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccessRulesApi->get_access_rules: %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] + +### Return type + +[**PaginatedAccessRulesList**](PaginatedAccessRulesList.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** | One page of access rules 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) + # **update_access_rule** > AccessRule update_access_rule(access_rule_id, update_access_rule_info) diff --git a/docs/GroupContainingGroup.md b/docs/GroupContainingGroup.md index ed7139c..8265f1f 100644 --- a/docs/GroupContainingGroup.md +++ b/docs/GroupContainingGroup.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **containing_group_id** | **UUID** | The groupID of the containing group. | -**duration_minutes** | **int** | The updated duration for which the group can be accessed (in minutes). Use 0 for indefinite. | [optional] +**duration_minutes** | **int** | The updated duration for which the group can be accessed (in minutes). Use 0 for indefinite, or a negative value to revoke access. | [optional] **access_level_remote_id** | **str** | The updated remote ID of the access level granted to this group. | [optional] ## Example diff --git a/docs/GroupRemoteInfo.md b/docs/GroupRemoteInfo.md index 9246310..60444a8 100644 --- a/docs/GroupRemoteInfo.md +++ b/docs/GroupRemoteInfo.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **active_directory_group** | [**GroupRemoteInfoActiveDirectoryGroup**](GroupRemoteInfoActiveDirectoryGroup.md) | | [optional] **tailscale_group** | [**GroupRemoteInfoTailscaleGroup**](GroupRemoteInfoTailscaleGroup.md) | | [optional] **twingate_group** | [**GroupRemoteInfoTwingateGroup**](GroupRemoteInfoTwingateGroup.md) | | [optional] +**twingate_group_synced** | [**GroupRemoteInfoTwingateGroupSynced**](GroupRemoteInfoTwingateGroupSynced.md) | | [optional] **aws_sso_group** | [**GroupRemoteInfoAwsSsoGroup**](GroupRemoteInfoAwsSsoGroup.md) | | [optional] **databricks_account_group** | [**GroupRemoteInfoDatabricksAccountGroup**](GroupRemoteInfoDatabricksAccountGroup.md) | | [optional] **connector_group** | [**GroupRemoteInfoConnectorGroup**](GroupRemoteInfoConnectorGroup.md) | | [optional] @@ -29,6 +30,7 @@ Name | Type | Description | Notes **rootly_on_call_schedule** | [**GroupRemoteInfoRootlyOnCallSchedule**](GroupRemoteInfoRootlyOnCallSchedule.md) | | [optional] **devin_group** | [**GroupRemoteInfoDevinGroup**](GroupRemoteInfoDevinGroup.md) | | [optional] **clickhouse_role** | [**GroupRemoteInfoClickhouseRole**](GroupRemoteInfoClickhouseRole.md) | | [optional] +**grafana_team** | [**GroupRemoteInfoGrafanaTeam**](GroupRemoteInfoGrafanaTeam.md) | | [optional] ## Example diff --git a/docs/GroupRemoteInfoGithubTeam.md b/docs/GroupRemoteInfoGithubTeam.md index dc5af6a..0403811 100644 --- a/docs/GroupRemoteInfoGithubTeam.md +++ b/docs/GroupRemoteInfoGithubTeam.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **team_id** | **str** | The id of the GitHub team. | [optional] **team_slug** | **str** | The slug of the GitHub team. | +**org_name** | **str** | GitHub team's org name, required only for Enterprise | [optional] ## Example diff --git a/docs/GroupRemoteInfoGrafanaTeam.md b/docs/GroupRemoteInfoGrafanaTeam.md new file mode 100644 index 0000000..97635c4 --- /dev/null +++ b/docs/GroupRemoteInfoGrafanaTeam.md @@ -0,0 +1,30 @@ +# GroupRemoteInfoGrafanaTeam + +Remote info for Grafana team. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**team_id** | **str** | The ID of the team. | + +## Example + +```python +from opal_security.models.group_remote_info_grafana_team import GroupRemoteInfoGrafanaTeam + +# TODO update the JSON string below +json = "{}" +# create an instance of GroupRemoteInfoGrafanaTeam from a JSON string +group_remote_info_grafana_team_instance = GroupRemoteInfoGrafanaTeam.from_json(json) +# print the JSON string representation of the object +print(GroupRemoteInfoGrafanaTeam.to_json()) + +# convert the object into a dict +group_remote_info_grafana_team_dict = group_remote_info_grafana_team_instance.to_dict() +# create an instance of GroupRemoteInfoGrafanaTeam from a dict +group_remote_info_grafana_team_from_dict = GroupRemoteInfoGrafanaTeam.from_dict(group_remote_info_grafana_team_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/GroupRemoteInfoTwingateGroupSynced.md b/docs/GroupRemoteInfoTwingateGroupSynced.md new file mode 100644 index 0000000..c836996 --- /dev/null +++ b/docs/GroupRemoteInfoTwingateGroupSynced.md @@ -0,0 +1,30 @@ +# GroupRemoteInfoTwingateGroupSynced + +Remote info for Twingate synced group. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**group_id** | **str** | The id of the Twingate synced group. | + +## Example + +```python +from opal_security.models.group_remote_info_twingate_group_synced import GroupRemoteInfoTwingateGroupSynced + +# TODO update the JSON string below +json = "{}" +# create an instance of GroupRemoteInfoTwingateGroupSynced from a JSON string +group_remote_info_twingate_group_synced_instance = GroupRemoteInfoTwingateGroupSynced.from_json(json) +# print the JSON string representation of the object +print(GroupRemoteInfoTwingateGroupSynced.to_json()) + +# convert the object into a dict +group_remote_info_twingate_group_synced_dict = group_remote_info_twingate_group_synced_instance.to_dict() +# create an instance of GroupRemoteInfoTwingateGroupSynced from a dict +group_remote_info_twingate_group_synced_from_dict = GroupRemoteInfoTwingateGroupSynced.from_dict(group_remote_info_twingate_group_synced_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 21cf51a..f35a93b 100644 --- a/docs/GroupTypeEnum.md +++ b/docs/GroupTypeEnum.md @@ -58,6 +58,8 @@ The type of the group. * `TWINGATE_GROUP` (value: `'TWINGATE_GROUP'`) +* `TWINGATE_GROUP_SYNCED` (value: `'TWINGATE_GROUP_SYNCED'`) + [[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/PaginatedAccessRulesList.md b/docs/PaginatedAccessRulesList.md new file mode 100644 index 0000000..26aa9b0 --- /dev/null +++ b/docs/PaginatedAccessRulesList.md @@ -0,0 +1,31 @@ +# PaginatedAccessRulesList + + +## 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 retrieve the previous page of results. | [optional] +**results** | [**List[AccessRule]**](AccessRule.md) | | + +## Example + +```python +from opal_security.models.paginated_access_rules_list import PaginatedAccessRulesList + +# TODO update the JSON string below +json = "{}" +# create an instance of PaginatedAccessRulesList from a JSON string +paginated_access_rules_list_instance = PaginatedAccessRulesList.from_json(json) +# print the JSON string representation of the object +print(PaginatedAccessRulesList.to_json()) + +# convert the object into a dict +paginated_access_rules_list_dict = paginated_access_rules_list_instance.to_dict() +# create an instance of PaginatedAccessRulesList from a dict +paginated_access_rules_list_from_dict = PaginatedAccessRulesList.from_dict(paginated_access_rules_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/ResourceRemoteInfo.md b/docs/ResourceRemoteInfo.md index b78ff34..4ab9f9d 100644 --- a/docs/ResourceRemoteInfo.md +++ b/docs/ResourceRemoteInfo.md @@ -73,6 +73,9 @@ Name | Type | Description | Notes **datadog_role** | [**ResourceRemoteInfoDatadogRole**](ResourceRemoteInfoDatadogRole.md) | | [optional] **clickhouse_database** | [**ResourceRemoteInfoClickhouseDatabase**](ResourceRemoteInfoClickhouseDatabase.md) | | [optional] **clickhouse_table** | [**ResourceRemoteInfoClickhouseTable**](ResourceRemoteInfoClickhouseTable.md) | | [optional] +**grafana_folder** | [**ResourceRemoteInfoGrafanaFolder**](ResourceRemoteInfoGrafanaFolder.md) | | [optional] +**grafana_dashboard** | [**ResourceRemoteInfoGrafanaDashboard**](ResourceRemoteInfoGrafanaDashboard.md) | | [optional] +**grafana_role** | [**ResourceRemoteInfoGrafanaRole**](ResourceRemoteInfoGrafanaRole.md) | | [optional] ## Example diff --git a/docs/ResourceRemoteInfoGithubOrgRole.md b/docs/ResourceRemoteInfoGithubOrgRole.md index 84d773f..309f2c7 100644 --- a/docs/ResourceRemoteInfoGithubOrgRole.md +++ b/docs/ResourceRemoteInfoGithubOrgRole.md @@ -7,6 +7,7 @@ Remote info for GitHub organization role. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **role_id** | **str** | The id of the role. | +**org_name** | **str** | GitHub org role's org name, required only for Enterprise. | [optional] ## Example diff --git a/docs/ResourceRemoteInfoGithubRepo.md b/docs/ResourceRemoteInfoGithubRepo.md index 6c2fd3e..cfc5635 100644 --- a/docs/ResourceRemoteInfoGithubRepo.md +++ b/docs/ResourceRemoteInfoGithubRepo.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **repo_id** | **str** | The id of the repository. | [optional] **repo_name** | **str** | The name of the repository. | +**org_name** | **str** | GitHub repo's org name, required only for Enterprise. | [optional] ## Example diff --git a/docs/ResourceRemoteInfoGrafanaDashboard.md b/docs/ResourceRemoteInfoGrafanaDashboard.md new file mode 100644 index 0000000..e90f411 --- /dev/null +++ b/docs/ResourceRemoteInfoGrafanaDashboard.md @@ -0,0 +1,30 @@ +# ResourceRemoteInfoGrafanaDashboard + +Remote info for Grafana dashboard. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dashboard_uid** | **str** | The UID of the Grafana dashboard. | + +## Example + +```python +from opal_security.models.resource_remote_info_grafana_dashboard import ResourceRemoteInfoGrafanaDashboard + +# TODO update the JSON string below +json = "{}" +# create an instance of ResourceRemoteInfoGrafanaDashboard from a JSON string +resource_remote_info_grafana_dashboard_instance = ResourceRemoteInfoGrafanaDashboard.from_json(json) +# print the JSON string representation of the object +print(ResourceRemoteInfoGrafanaDashboard.to_json()) + +# convert the object into a dict +resource_remote_info_grafana_dashboard_dict = resource_remote_info_grafana_dashboard_instance.to_dict() +# create an instance of ResourceRemoteInfoGrafanaDashboard from a dict +resource_remote_info_grafana_dashboard_from_dict = ResourceRemoteInfoGrafanaDashboard.from_dict(resource_remote_info_grafana_dashboard_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/ResourceRemoteInfoGrafanaFolder.md b/docs/ResourceRemoteInfoGrafanaFolder.md new file mode 100644 index 0000000..8ef59c6 --- /dev/null +++ b/docs/ResourceRemoteInfoGrafanaFolder.md @@ -0,0 +1,30 @@ +# ResourceRemoteInfoGrafanaFolder + +Remote info for Grafana folder. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**folder_uid** | **str** | The UID of the Grafana folder. | + +## Example + +```python +from opal_security.models.resource_remote_info_grafana_folder import ResourceRemoteInfoGrafanaFolder + +# TODO update the JSON string below +json = "{}" +# create an instance of ResourceRemoteInfoGrafanaFolder from a JSON string +resource_remote_info_grafana_folder_instance = ResourceRemoteInfoGrafanaFolder.from_json(json) +# print the JSON string representation of the object +print(ResourceRemoteInfoGrafanaFolder.to_json()) + +# convert the object into a dict +resource_remote_info_grafana_folder_dict = resource_remote_info_grafana_folder_instance.to_dict() +# create an instance of ResourceRemoteInfoGrafanaFolder from a dict +resource_remote_info_grafana_folder_from_dict = ResourceRemoteInfoGrafanaFolder.from_dict(resource_remote_info_grafana_folder_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/ResourceRemoteInfoGrafanaRole.md b/docs/ResourceRemoteInfoGrafanaRole.md new file mode 100644 index 0000000..6bda2fb --- /dev/null +++ b/docs/ResourceRemoteInfoGrafanaRole.md @@ -0,0 +1,30 @@ +# ResourceRemoteInfoGrafanaRole + +Remote info for Grafana role(fixed or custom). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**role_uid** | **str** | The UID of the Grafana role. | + +## Example + +```python +from opal_security.models.resource_remote_info_grafana_role import ResourceRemoteInfoGrafanaRole + +# TODO update the JSON string below +json = "{}" +# create an instance of ResourceRemoteInfoGrafanaRole from a JSON string +resource_remote_info_grafana_role_instance = ResourceRemoteInfoGrafanaRole.from_json(json) +# print the JSON string representation of the object +print(ResourceRemoteInfoGrafanaRole.to_json()) + +# convert the object into a dict +resource_remote_info_grafana_role_dict = resource_remote_info_grafana_role_instance.to_dict() +# create an instance of ResourceRemoteInfoGrafanaRole from a dict +resource_remote_info_grafana_role_from_dict = ResourceRemoteInfoGrafanaRole.from_dict(resource_remote_info_grafana_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/RuleDisjunction.md b/docs/RuleDisjunction.md index f478433..9c12b1b 100644 --- a/docs/RuleDisjunction.md +++ b/docs/RuleDisjunction.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **selectors** | [**List[TagSelector]**](TagSelector.md) | | +**attribute_selectors** | [**List[UserAttributeSelector]**](UserAttributeSelector.md) | | [optional] ## Example diff --git a/docs/UpdateGroupUserRequest.md b/docs/UpdateGroupUserRequest.md index 5d13bea..2986df4 100644 --- a/docs/UpdateGroupUserRequest.md +++ b/docs/UpdateGroupUserRequest.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**duration_minutes** | **int** | The updated duration for which the group can be accessed (in minutes). Use 0 for indefinite. | +**duration_minutes** | **int** | The updated duration for which the group can be accessed (in minutes). Use 0 for indefinite, or a negative value to revoke access. | **access_level_remote_id** | **str** | The updated remote ID of the access level granted to this user. | [optional] ## Example diff --git a/docs/UpdateResourceInfo.md b/docs/UpdateResourceInfo.md index c1fa4de..29865dd 100644 --- a/docs/UpdateResourceInfo.md +++ b/docs/UpdateResourceInfo.md @@ -26,6 +26,7 @@ Name | Type | Description | Notes **request_template_id** | **UUID** | The ID of the associated request template. Deprecated in favor of `request_configurations`. | [optional] **is_requestable** | **bool** | A bool representing whether or not to allow access requests to this resource. Deprecated in favor of `request_configurations`. | [optional] **extensions_duration_in_minutes** | **int** | The duration for which access can be extended (in minutes). Deprecated, set the extension duration in the request_configuration you want it to apply to. | [optional] +**parent_resource_id** | **UUID** | The ID of the parent resource. | [optional] **request_configurations** | [**List[RequestConfiguration]**](RequestConfiguration.md) | A list of configurations for requests to this resource. If not provided, the default request configuration will be used. | [optional] **request_configuration_list** | [**CreateRequestConfigurationInfoList**](CreateRequestConfigurationInfoList.md) | A list of configurations for requests to this resource. If not provided, the default request configuration will be used. Deprecated in favor of `request_configurations`. | [optional] diff --git a/docs/UpdateResourceUserRequest.md b/docs/UpdateResourceUserRequest.md index eb7717e..c9ca0d7 100644 --- a/docs/UpdateResourceUserRequest.md +++ b/docs/UpdateResourceUserRequest.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**duration_minutes** | **int** | The updated duration for which the resource can be accessed (in minutes). Use 0 for indefinite. | +**duration_minutes** | **int** | The updated duration for which the resource can be accessed (in minutes). Use 0 for indefinite, or a negative value to revoke access. | **access_level_remote_id** | **str** | The updated remote ID of the access level granted to this user. | [optional] ## Example diff --git a/docs/UserAttributeSelector.md b/docs/UserAttributeSelector.md new file mode 100644 index 0000000..02b3ad4 --- /dev/null +++ b/docs/UserAttributeSelector.md @@ -0,0 +1,30 @@ +# UserAttributeSelector + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attribute** | **str** | | +**values** | **List[str]** | | + +## Example + +```python +from opal_security.models.user_attribute_selector import UserAttributeSelector + +# TODO update the JSON string below +json = "{}" +# create an instance of UserAttributeSelector from a JSON string +user_attribute_selector_instance = UserAttributeSelector.from_json(json) +# print the JSON string representation of the object +print(UserAttributeSelector.to_json()) + +# convert the object into a dict +user_attribute_selector_dict = user_attribute_selector_instance.to_dict() +# create an instance of UserAttributeSelector from a dict +user_attribute_selector_from_dict = UserAttributeSelector.from_dict(user_attribute_selector_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/opal_security/__init__.py b/opal_security/__init__.py index 5f39560..1ced783 100644 --- a/opal_security/__init__.py +++ b/opal_security/__init__.py @@ -119,6 +119,7 @@ "GroupRemoteInfoGithubTeam", "GroupRemoteInfoGitlabGroup", "GroupRemoteInfoGoogleGroup", + "GroupRemoteInfoGrafanaTeam", "GroupRemoteInfoIncidentioOnCallSchedule", "GroupRemoteInfoLdapGroup", "GroupRemoteInfoOktaGroup", @@ -128,6 +129,7 @@ "GroupRemoteInfoSnowflakeRole", "GroupRemoteInfoTailscaleGroup", "GroupRemoteInfoTwingateGroup", + "GroupRemoteInfoTwingateGroupSynced", "GroupRemoteInfoWorkdayUserSecurityGroup", "GroupResource", "GroupResourceList", @@ -147,6 +149,7 @@ "OnCallScheduleProviderEnum", "Owner", "PageInfo", + "PaginatedAccessRulesList", "PaginatedAssignedRequestList", "PaginatedBundleGroupList", "PaginatedBundleList", @@ -238,6 +241,9 @@ "ResourceRemoteInfoGithubRepo", "ResourceRemoteInfoGitlabProject", "ResourceRemoteInfoGoogleWorkspaceRole", + "ResourceRemoteInfoGrafanaDashboard", + "ResourceRemoteInfoGrafanaFolder", + "ResourceRemoteInfoGrafanaRole", "ResourceRemoteInfoIlevelAdvancedRole", "ResourceRemoteInfoNetsuiteRole", "ResourceRemoteInfoOktaApp", @@ -307,6 +313,7 @@ "UpdateResourceInfoList", "UpdateResourceUserRequest", "User", + "UserAttributeSelector", "UserHrIdpStatusEnum", "UserIDList", "UserList", @@ -419,6 +426,7 @@ from opal_security.models.group_remote_info_github_team import GroupRemoteInfoGithubTeam as GroupRemoteInfoGithubTeam from opal_security.models.group_remote_info_gitlab_group import GroupRemoteInfoGitlabGroup as GroupRemoteInfoGitlabGroup from opal_security.models.group_remote_info_google_group import GroupRemoteInfoGoogleGroup as GroupRemoteInfoGoogleGroup +from opal_security.models.group_remote_info_grafana_team import GroupRemoteInfoGrafanaTeam as GroupRemoteInfoGrafanaTeam from opal_security.models.group_remote_info_incidentio_on_call_schedule import GroupRemoteInfoIncidentioOnCallSchedule as GroupRemoteInfoIncidentioOnCallSchedule from opal_security.models.group_remote_info_ldap_group import GroupRemoteInfoLdapGroup as GroupRemoteInfoLdapGroup from opal_security.models.group_remote_info_okta_group import GroupRemoteInfoOktaGroup as GroupRemoteInfoOktaGroup @@ -428,6 +436,7 @@ 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_twingate_group_synced import GroupRemoteInfoTwingateGroupSynced as GroupRemoteInfoTwingateGroupSynced 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 @@ -447,6 +456,7 @@ from opal_security.models.on_call_schedule_provider_enum import OnCallScheduleProviderEnum as OnCallScheduleProviderEnum from opal_security.models.owner import Owner as Owner from opal_security.models.page_info import PageInfo as PageInfo +from opal_security.models.paginated_access_rules_list import PaginatedAccessRulesList as PaginatedAccessRulesList from opal_security.models.paginated_assigned_request_list import PaginatedAssignedRequestList as PaginatedAssignedRequestList from opal_security.models.paginated_bundle_group_list import PaginatedBundleGroupList as PaginatedBundleGroupList from opal_security.models.paginated_bundle_list import PaginatedBundleList as PaginatedBundleList @@ -538,6 +548,9 @@ from opal_security.models.resource_remote_info_github_repo import ResourceRemoteInfoGithubRepo as ResourceRemoteInfoGithubRepo 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_grafana_dashboard import ResourceRemoteInfoGrafanaDashboard as ResourceRemoteInfoGrafanaDashboard +from opal_security.models.resource_remote_info_grafana_folder import ResourceRemoteInfoGrafanaFolder as ResourceRemoteInfoGrafanaFolder +from opal_security.models.resource_remote_info_grafana_role import ResourceRemoteInfoGrafanaRole as ResourceRemoteInfoGrafanaRole 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 @@ -607,6 +620,7 @@ from opal_security.models.update_resource_info_list import UpdateResourceInfoList as UpdateResourceInfoList from opal_security.models.update_resource_user_request import UpdateResourceUserRequest as UpdateResourceUserRequest from opal_security.models.user import User as User +from opal_security.models.user_attribute_selector import UserAttributeSelector as UserAttributeSelector from opal_security.models.user_hr_idp_status_enum import UserHrIdpStatusEnum as UserHrIdpStatusEnum from opal_security.models.user_id_list import UserIDList as UserIDList from opal_security.models.user_list import UserList as UserList diff --git a/opal_security/api/access_rules_api.py b/opal_security/api/access_rules_api.py index 6d6936a..5033d3f 100644 --- a/opal_security/api/access_rules_api.py +++ b/opal_security/api/access_rules_api.py @@ -17,10 +17,12 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field +from pydantic import Field, StrictInt, StrictStr +from typing import Optional from typing_extensions import Annotated from uuid import UUID from opal_security.models.access_rule import AccessRule +from opal_security.models.paginated_access_rules_list import PaginatedAccessRulesList from opal_security.models.update_access_rule_info import UpdateAccessRuleInfo from opal_security.api_client import ApiClient, RequestSerialized @@ -576,6 +578,286 @@ def _get_access_rule_serialize( + @validate_call + def get_access_rules( + self, + cursor: Annotated[Optional[StrictStr], Field(description="The pagination cursor value.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of results to return per page. Default is 200.")] = 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, + ) -> PaginatedAccessRulesList: + """get_access_rules + + Returns a list of access rules for your organization. + + :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 _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_access_rules_serialize( + cursor=cursor, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PaginatedAccessRulesList", + } + 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_access_rules_with_http_info( + self, + cursor: Annotated[Optional[StrictStr], Field(description="The pagination cursor value.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of results to return per page. Default is 200.")] = 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[PaginatedAccessRulesList]: + """get_access_rules + + Returns a list of access rules for your organization. + + :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 _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_access_rules_serialize( + cursor=cursor, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PaginatedAccessRulesList", + } + 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_access_rules_without_preload_content( + self, + cursor: Annotated[Optional[StrictStr], Field(description="The pagination cursor value.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of results to return per page. Default is 200.")] = 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_access_rules + + Returns a list of access rules for your organization. + + :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 _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_access_rules_serialize( + cursor=cursor, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PaginatedAccessRulesList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_access_rules_serialize( + self, + cursor, + page_size, + _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 + # 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)) + + # 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='/access-rules', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def update_access_rule( self, diff --git a/opal_security/models/__init__.py b/opal_security/models/__init__.py index 306be3e..d6bc25c 100644 --- a/opal_security/models/__init__.py +++ b/opal_security/models/__init__.py @@ -85,6 +85,7 @@ from opal_security.models.group_remote_info_github_team import GroupRemoteInfoGithubTeam from opal_security.models.group_remote_info_gitlab_group import GroupRemoteInfoGitlabGroup from opal_security.models.group_remote_info_google_group import GroupRemoteInfoGoogleGroup +from opal_security.models.group_remote_info_grafana_team import GroupRemoteInfoGrafanaTeam from opal_security.models.group_remote_info_incidentio_on_call_schedule import GroupRemoteInfoIncidentioOnCallSchedule from opal_security.models.group_remote_info_ldap_group import GroupRemoteInfoLdapGroup from opal_security.models.group_remote_info_okta_group import GroupRemoteInfoOktaGroup @@ -94,6 +95,7 @@ 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_twingate_group_synced import GroupRemoteInfoTwingateGroupSynced 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 @@ -113,6 +115,7 @@ from opal_security.models.on_call_schedule_provider_enum import OnCallScheduleProviderEnum from opal_security.models.owner import Owner from opal_security.models.page_info import PageInfo +from opal_security.models.paginated_access_rules_list import PaginatedAccessRulesList from opal_security.models.paginated_assigned_request_list import PaginatedAssignedRequestList from opal_security.models.paginated_bundle_group_list import PaginatedBundleGroupList from opal_security.models.paginated_bundle_list import PaginatedBundleList @@ -204,6 +207,9 @@ from opal_security.models.resource_remote_info_github_repo import ResourceRemoteInfoGithubRepo 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_grafana_dashboard import ResourceRemoteInfoGrafanaDashboard +from opal_security.models.resource_remote_info_grafana_folder import ResourceRemoteInfoGrafanaFolder +from opal_security.models.resource_remote_info_grafana_role import ResourceRemoteInfoGrafanaRole 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 @@ -273,6 +279,7 @@ from opal_security.models.update_resource_info_list import UpdateResourceInfoList from opal_security.models.update_resource_user_request import UpdateResourceUserRequest from opal_security.models.user import User +from opal_security.models.user_attribute_selector import UserAttributeSelector from opal_security.models.user_hr_idp_status_enum import UserHrIdpStatusEnum from opal_security.models.user_id_list import UserIDList from opal_security.models.user_list import UserList diff --git a/opal_security/models/access_rule.py b/opal_security/models/access_rule.py index 74438db..6be2da2 100644 --- a/opal_security/models/access_rule.py +++ b/opal_security/models/access_rule.py @@ -27,7 +27,7 @@ class AccessRule(BaseModel): """ - # Access Rule Object ### Description The `AccessRule` object is used to represent an access rule configuration. ### Usage Example Get access rule configurations from the `GET Access Rule Configs` endpoint. + # Access Rule Object ### Description The `AccessRule` object is used to represent an access rule configuration. ### Usage Example List access rules from the `GET /access-rules` endpoint, or retrieve a single access rule from the `GET /access-rules/{access_rule_id}` endpoint. """ # noqa: E501 access_rule_id: UUID = Field(description="The ID (group ID) of the access rule.") name: StrictStr = Field(description="The name of the access rule.") diff --git a/opal_security/models/group_containing_group.py b/opal_security/models/group_containing_group.py index a2e48e1..e75cb28 100644 --- a/opal_security/models/group_containing_group.py +++ b/opal_security/models/group_containing_group.py @@ -30,7 +30,7 @@ class GroupContainingGroup(BaseModel): # GroupContainingGroup Object ### Description The `GroupContainingGroup` object is used to represent a relationship between a group and a group. """ # noqa: E501 containing_group_id: UUID = Field(description="The groupID of the containing group.") - duration_minutes: Optional[Annotated[int, Field(le=525960, strict=True)]] = Field(default=None, description="The updated duration for which the group can be accessed (in minutes). Use 0 for indefinite.") + duration_minutes: Optional[Annotated[int, Field(le=525960, strict=True)]] = Field(default=None, description="The updated duration for which the group can be accessed (in minutes). Use 0 for indefinite, or a negative value to revoke access.") access_level_remote_id: Optional[StrictStr] = Field(default=None, description="The updated remote ID of the access level granted to this group.") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["containing_group_id", "duration_minutes", "access_level_remote_id"] diff --git a/opal_security/models/group_remote_info.py b/opal_security/models/group_remote_info.py index db3c0c7..e5c4597 100644 --- a/opal_security/models/group_remote_info.py +++ b/opal_security/models/group_remote_info.py @@ -33,6 +33,7 @@ from opal_security.models.group_remote_info_github_team import GroupRemoteInfoGithubTeam from opal_security.models.group_remote_info_gitlab_group import GroupRemoteInfoGitlabGroup from opal_security.models.group_remote_info_google_group import GroupRemoteInfoGoogleGroup +from opal_security.models.group_remote_info_grafana_team import GroupRemoteInfoGrafanaTeam from opal_security.models.group_remote_info_incidentio_on_call_schedule import GroupRemoteInfoIncidentioOnCallSchedule from opal_security.models.group_remote_info_ldap_group import GroupRemoteInfoLdapGroup from opal_security.models.group_remote_info_okta_group import GroupRemoteInfoOktaGroup @@ -42,6 +43,7 @@ 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_twingate_group_synced import GroupRemoteInfoTwingateGroupSynced from opal_security.models.group_remote_info_workday_user_security_group import GroupRemoteInfoWorkdayUserSecurityGroup from typing import Optional, Set from typing_extensions import Self @@ -53,6 +55,7 @@ class GroupRemoteInfo(BaseModel): active_directory_group: Optional[GroupRemoteInfoActiveDirectoryGroup] = None tailscale_group: Optional[GroupRemoteInfoTailscaleGroup] = None twingate_group: Optional[GroupRemoteInfoTwingateGroup] = None + twingate_group_synced: Optional[GroupRemoteInfoTwingateGroupSynced] = None aws_sso_group: Optional[GroupRemoteInfoAwsSsoGroup] = None databricks_account_group: Optional[GroupRemoteInfoDatabricksAccountGroup] = None connector_group: Optional[GroupRemoteInfoConnectorGroup] = None @@ -73,8 +76,9 @@ class GroupRemoteInfo(BaseModel): rootly_on_call_schedule: Optional[GroupRemoteInfoRootlyOnCallSchedule] = None devin_group: Optional[GroupRemoteInfoDevinGroup] = None clickhouse_role: Optional[GroupRemoteInfoClickhouseRole] = None + grafana_team: Optional[GroupRemoteInfoGrafanaTeam] = None additional_properties: Dict[str, Any] = {} - __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"] + __properties: ClassVar[List[str]] = ["active_directory_group", "tailscale_group", "twingate_group", "twingate_group_synced", "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", "grafana_team"] model_config = ConfigDict( populate_by_name=True, @@ -126,6 +130,9 @@ def to_dict(self) -> Dict[str, Any]: # 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 twingate_group_synced + if self.twingate_group_synced: + _dict['twingate_group_synced'] = self.twingate_group_synced.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() @@ -186,6 +193,9 @@ def to_dict(self) -> Dict[str, Any]: # 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() + # override the default output from pydantic by calling `to_dict()` of grafana_team + if self.grafana_team: + _dict['grafana_team'] = self.grafana_team.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(): @@ -206,6 +216,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "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, + "twingate_group_synced": GroupRemoteInfoTwingateGroupSynced.from_dict(obj["twingate_group_synced"]) if obj.get("twingate_group_synced") 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, @@ -225,7 +236,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "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, - "clickhouse_role": GroupRemoteInfoClickhouseRole.from_dict(obj["clickhouse_role"]) if obj.get("clickhouse_role") is not None else None + "clickhouse_role": GroupRemoteInfoClickhouseRole.from_dict(obj["clickhouse_role"]) if obj.get("clickhouse_role") is not None else None, + "grafana_team": GroupRemoteInfoGrafanaTeam.from_dict(obj["grafana_team"]) if obj.get("grafana_team") 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_github_team.py b/opal_security/models/group_remote_info_github_team.py index 47570c3..f6c2d42 100644 --- a/opal_security/models/group_remote_info_github_team.py +++ b/opal_security/models/group_remote_info_github_team.py @@ -29,8 +29,9 @@ class GroupRemoteInfoGithubTeam(BaseModel): """ # noqa: E501 team_id: Optional[StrictStr] = Field(default=None, description="The id of the GitHub team.") team_slug: StrictStr = Field(description="The slug of the GitHub team.") + org_name: Optional[StrictStr] = Field(default=None, description="GitHub team's org name, required only for Enterprise") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["team_id", "team_slug"] + __properties: ClassVar[List[str]] = ["team_id", "team_slug", "org_name"] model_config = ConfigDict( populate_by_name=True, @@ -91,7 +92,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "team_id": obj.get("team_id"), - "team_slug": obj.get("team_slug") + "team_slug": obj.get("team_slug"), + "org_name": obj.get("org_name") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/opal_security/models/group_remote_info_grafana_team.py b/opal_security/models/group_remote_info_grafana_team.py new file mode 100644 index 0000000..45f2d8f --- /dev/null +++ b/opal_security/models/group_remote_info_grafana_team.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 GroupRemoteInfoGrafanaTeam(BaseModel): + """ + Remote info for Grafana team. + """ # noqa: E501 + team_id: StrictStr = Field(description="The ID of the team.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["team_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 GroupRemoteInfoGrafanaTeam 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 GroupRemoteInfoGrafanaTeam from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "team_id": obj.get("team_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_synced.py b/opal_security/models/group_remote_info_twingate_group_synced.py new file mode 100644 index 0000000..6d1f275 --- /dev/null +++ b/opal_security/models/group_remote_info_twingate_group_synced.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 GroupRemoteInfoTwingateGroupSynced(BaseModel): + """ + Remote info for Twingate synced group. + """ # noqa: E501 + group_id: StrictStr = Field(description="The id of the Twingate synced 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 GroupRemoteInfoTwingateGroupSynced 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 GroupRemoteInfoTwingateGroupSynced 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 2ebd21e..8eccdd0 100644 --- a/opal_security/models/group_type_enum.py +++ b/opal_security/models/group_type_enum.py @@ -54,6 +54,7 @@ class GroupTypeEnum(str, Enum): GRAFANA_TEAM = 'GRAFANA_TEAM' CLICKHOUSE_ROLE = 'CLICKHOUSE_ROLE' TWINGATE_GROUP = 'TWINGATE_GROUP' + TWINGATE_GROUP_SYNCED = 'TWINGATE_GROUP_SYNCED' @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/opal_security/models/paginated_access_rules_list.py b/opal_security/models/paginated_access_rules_list.py new file mode 100644 index 0000000..ab3e28c --- /dev/null +++ b/opal_security/models/paginated_access_rules_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.access_rule import AccessRule +from typing import Optional, Set +from typing_extensions import Self + +class PaginatedAccessRulesList(BaseModel): + """ + PaginatedAccessRulesList + """ # 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 retrieve the previous page of results.") + results: List[AccessRule] + 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 PaginatedAccessRulesList 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 PaginatedAccessRulesList 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": [AccessRule.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 dea3112..8329c69 100644 --- a/opal_security/models/resource_remote_info.py +++ b/opal_security/models/resource_remote_info.py @@ -68,6 +68,9 @@ from opal_security.models.resource_remote_info_github_repo import ResourceRemoteInfoGithubRepo 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_grafana_dashboard import ResourceRemoteInfoGrafanaDashboard +from opal_security.models.resource_remote_info_grafana_folder import ResourceRemoteInfoGrafanaFolder +from opal_security.models.resource_remote_info_grafana_role import ResourceRemoteInfoGrafanaRole 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 @@ -161,8 +164,11 @@ class ResourceRemoteInfo(BaseModel): datadog_role: Optional[ResourceRemoteInfoDatadogRole] = None clickhouse_database: Optional[ResourceRemoteInfoClickhouseDatabase] = None clickhouse_table: Optional[ResourceRemoteInfoClickhouseTable] = None + grafana_folder: Optional[ResourceRemoteInfoGrafanaFolder] = None + grafana_dashboard: Optional[ResourceRemoteInfoGrafanaDashboard] = None + grafana_role: Optional[ResourceRemoteInfoGrafanaRole] = 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", "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"] + __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", "grafana_folder", "grafana_dashboard", "grafana_role"] model_config = ConfigDict( populate_by_name=True, @@ -406,6 +412,15 @@ def to_dict(self) -> Dict[str, Any]: # 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() + # override the default output from pydantic by calling `to_dict()` of grafana_folder + if self.grafana_folder: + _dict['grafana_folder'] = self.grafana_folder.to_dict() + # override the default output from pydantic by calling `to_dict()` of grafana_dashboard + if self.grafana_dashboard: + _dict['grafana_dashboard'] = self.grafana_dashboard.to_dict() + # override the default output from pydantic by calling `to_dict()` of grafana_role + if self.grafana_role: + _dict['grafana_role'] = self.grafana_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(): @@ -489,7 +504,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "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 + "clickhouse_table": ResourceRemoteInfoClickhouseTable.from_dict(obj["clickhouse_table"]) if obj.get("clickhouse_table") is not None else None, + "grafana_folder": ResourceRemoteInfoGrafanaFolder.from_dict(obj["grafana_folder"]) if obj.get("grafana_folder") is not None else None, + "grafana_dashboard": ResourceRemoteInfoGrafanaDashboard.from_dict(obj["grafana_dashboard"]) if obj.get("grafana_dashboard") is not None else None, + "grafana_role": ResourceRemoteInfoGrafanaRole.from_dict(obj["grafana_role"]) if obj.get("grafana_role") 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_github_org_role.py b/opal_security/models/resource_remote_info_github_org_role.py index 302a4ac..c6cf3a0 100644 --- a/opal_security/models/resource_remote_info_github_org_role.py +++ b/opal_security/models/resource_remote_info_github_org_role.py @@ -19,7 +19,7 @@ import json from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List +from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -28,8 +28,9 @@ class ResourceRemoteInfoGithubOrgRole(BaseModel): Remote info for GitHub organization role. """ # noqa: E501 role_id: StrictStr = Field(description="The id of the role.") + org_name: Optional[StrictStr] = Field(default=None, description="GitHub org role's org name, required only for Enterprise.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["role_id"] + __properties: ClassVar[List[str]] = ["role_id", "org_name"] model_config = ConfigDict( populate_by_name=True, @@ -89,7 +90,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "role_id": obj.get("role_id") + "role_id": obj.get("role_id"), + "org_name": obj.get("org_name") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/opal_security/models/resource_remote_info_github_repo.py b/opal_security/models/resource_remote_info_github_repo.py index 2c600c9..a969f0a 100644 --- a/opal_security/models/resource_remote_info_github_repo.py +++ b/opal_security/models/resource_remote_info_github_repo.py @@ -29,8 +29,9 @@ class ResourceRemoteInfoGithubRepo(BaseModel): """ # noqa: E501 repo_id: Optional[StrictStr] = Field(default=None, description="The id of the repository.") repo_name: StrictStr = Field(description="The name of the repository.") + org_name: Optional[StrictStr] = Field(default=None, description="GitHub repo's org name, required only for Enterprise.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["repo_id", "repo_name"] + __properties: ClassVar[List[str]] = ["repo_id", "repo_name", "org_name"] model_config = ConfigDict( populate_by_name=True, @@ -91,7 +92,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "repo_id": obj.get("repo_id"), - "repo_name": obj.get("repo_name") + "repo_name": obj.get("repo_name"), + "org_name": obj.get("org_name") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/opal_security/models/resource_remote_info_grafana_dashboard.py b/opal_security/models/resource_remote_info_grafana_dashboard.py new file mode 100644 index 0000000..79c0e9d --- /dev/null +++ b/opal_security/models/resource_remote_info_grafana_dashboard.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 ResourceRemoteInfoGrafanaDashboard(BaseModel): + """ + Remote info for Grafana dashboard. + """ # noqa: E501 + dashboard_uid: StrictStr = Field(description="The UID of the Grafana dashboard.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["dashboard_uid"] + + 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 ResourceRemoteInfoGrafanaDashboard 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 ResourceRemoteInfoGrafanaDashboard from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "dashboard_uid": obj.get("dashboard_uid") + }) + # 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_grafana_folder.py b/opal_security/models/resource_remote_info_grafana_folder.py new file mode 100644 index 0000000..355a492 --- /dev/null +++ b/opal_security/models/resource_remote_info_grafana_folder.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 ResourceRemoteInfoGrafanaFolder(BaseModel): + """ + Remote info for Grafana folder. + """ # noqa: E501 + folder_uid: StrictStr = Field(description="The UID of the Grafana folder.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["folder_uid"] + + 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 ResourceRemoteInfoGrafanaFolder 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 ResourceRemoteInfoGrafanaFolder from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "folder_uid": obj.get("folder_uid") + }) + # 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_grafana_role.py b/opal_security/models/resource_remote_info_grafana_role.py new file mode 100644 index 0000000..4855d49 --- /dev/null +++ b/opal_security/models/resource_remote_info_grafana_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 ResourceRemoteInfoGrafanaRole(BaseModel): + """ + Remote info for Grafana role(fixed or custom). + """ # noqa: E501 + role_uid: StrictStr = Field(description="The UID of the Grafana role.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["role_uid"] + + 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 ResourceRemoteInfoGrafanaRole 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 ResourceRemoteInfoGrafanaRole from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "role_uid": obj.get("role_uid") + }) + # 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/rule_disjunction.py b/opal_security/models/rule_disjunction.py index 7bf3367..1a20b22 100644 --- a/opal_security/models/rule_disjunction.py +++ b/opal_security/models/rule_disjunction.py @@ -19,8 +19,9 @@ import json from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List +from typing import Any, ClassVar, Dict, List, Optional from opal_security.models.tag_selector import TagSelector +from opal_security.models.user_attribute_selector import UserAttributeSelector from typing import Optional, Set from typing_extensions import Self @@ -29,8 +30,9 @@ class RuleDisjunction(BaseModel): RuleDisjunction """ # noqa: E501 selectors: List[TagSelector] + attribute_selectors: Optional[List[UserAttributeSelector]] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["selectors"] + __properties: ClassVar[List[str]] = ["selectors", "attribute_selectors"] model_config = ConfigDict( populate_by_name=True, @@ -80,6 +82,13 @@ def to_dict(self) -> Dict[str, Any]: if _item_selectors: _items.append(_item_selectors.to_dict()) _dict['selectors'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in attribute_selectors (list) + _items = [] + if self.attribute_selectors: + for _item_attribute_selectors in self.attribute_selectors: + if _item_attribute_selectors: + _items.append(_item_attribute_selectors.to_dict()) + _dict['attribute_selectors'] = _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(): @@ -97,7 +106,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "selectors": [TagSelector.from_dict(_item) for _item in obj["selectors"]] if obj.get("selectors") is not None else None + "selectors": [TagSelector.from_dict(_item) for _item in obj["selectors"]] if obj.get("selectors") is not None else None, + "attribute_selectors": [UserAttributeSelector.from_dict(_item) for _item in obj["attribute_selectors"]] if obj.get("attribute_selectors") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/opal_security/models/update_group_user_request.py b/opal_security/models/update_group_user_request.py index 64c99f0..0d13b8e 100644 --- a/opal_security/models/update_group_user_request.py +++ b/opal_security/models/update_group_user_request.py @@ -28,7 +28,7 @@ class UpdateGroupUserRequest(BaseModel): """ UpdateGroupUserRequest """ # noqa: E501 - duration_minutes: Annotated[int, Field(le=525960, strict=True)] = Field(description="The updated duration for which the group can be accessed (in minutes). Use 0 for indefinite.") + duration_minutes: Annotated[int, Field(le=525960, strict=True)] = Field(description="The updated duration for which the group can be accessed (in minutes). Use 0 for indefinite, or a negative value to revoke access.") access_level_remote_id: Optional[StrictStr] = Field(default=None, description="The updated remote ID of the access level granted to this user.") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["duration_minutes", "access_level_remote_id"] diff --git a/opal_security/models/update_resource_info.py b/opal_security/models/update_resource_info.py index 22774f5..6c46b86 100644 --- a/opal_security/models/update_resource_info.py +++ b/opal_security/models/update_resource_info.py @@ -53,10 +53,11 @@ class UpdateResourceInfo(BaseModel): request_template_id: Optional[UUID] = Field(default=None, description="The ID of the associated request template. Deprecated in favor of `request_configurations`.") is_requestable: Optional[StrictBool] = Field(default=None, description="A bool representing whether or not to allow access requests to this resource. Deprecated in favor of `request_configurations`.") extensions_duration_in_minutes: Optional[StrictInt] = Field(default=None, description="The duration for which access can be extended (in minutes). Deprecated, set the extension duration in the request_configuration you want it to apply to.") + parent_resource_id: Optional[UUID] = Field(default=None, description="The ID of the parent resource.") request_configurations: Optional[List[RequestConfiguration]] = Field(default=None, description="A list of configurations for requests to this resource. If not provided, the default request configuration will be used.") request_configuration_list: Optional[CreateRequestConfigurationInfoList] = Field(default=None, description="A list of configurations for requests to this resource. If not provided, the default request configuration will be used. Deprecated in favor of `request_configurations`.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["resource_id", "name", "description", "admin_owner_id", "max_duration", "recommended_duration", "require_manager_approval", "require_support_ticket", "folder_id", "require_mfa_to_approve", "require_mfa_to_request", "require_mfa_to_connect", "auto_approval", "ticket_propagation", "custom_request_notification", "risk_sensitivity_override", "configuration_template_id", "request_template_id", "is_requestable", "extensions_duration_in_minutes", "request_configurations", "request_configuration_list"] + __properties: ClassVar[List[str]] = ["resource_id", "name", "description", "admin_owner_id", "max_duration", "recommended_duration", "require_manager_approval", "require_support_ticket", "folder_id", "require_mfa_to_approve", "require_mfa_to_request", "require_mfa_to_connect", "auto_approval", "ticket_propagation", "custom_request_notification", "risk_sensitivity_override", "configuration_template_id", "request_template_id", "is_requestable", "extensions_duration_in_minutes", "parent_resource_id", "request_configurations", "request_configuration_list"] model_config = ConfigDict( populate_by_name=True, @@ -149,6 +150,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "request_template_id": obj.get("request_template_id"), "is_requestable": obj.get("is_requestable"), "extensions_duration_in_minutes": obj.get("extensions_duration_in_minutes"), + "parent_resource_id": obj.get("parent_resource_id"), "request_configurations": [RequestConfiguration.from_dict(_item) for _item in obj["request_configurations"]] if obj.get("request_configurations") is not None else None, "request_configuration_list": CreateRequestConfigurationInfoList.from_dict(obj["request_configuration_list"]) if obj.get("request_configuration_list") is not None else None }) diff --git a/opal_security/models/update_resource_user_request.py b/opal_security/models/update_resource_user_request.py index cef9218..c016f83 100644 --- a/opal_security/models/update_resource_user_request.py +++ b/opal_security/models/update_resource_user_request.py @@ -28,7 +28,7 @@ class UpdateResourceUserRequest(BaseModel): """ UpdateResourceUserRequest """ # noqa: E501 - duration_minutes: Annotated[int, Field(le=525960, strict=True)] = Field(description="The updated duration for which the resource can be accessed (in minutes). Use 0 for indefinite.") + duration_minutes: Annotated[int, Field(le=525960, strict=True)] = Field(description="The updated duration for which the resource can be accessed (in minutes). Use 0 for indefinite, or a negative value to revoke access.") access_level_remote_id: Optional[StrictStr] = Field(default=None, description="The updated remote ID of the access level granted to this user.") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["duration_minutes", "access_level_remote_id"] diff --git a/opal_security/models/user_attribute_selector.py b/opal_security/models/user_attribute_selector.py new file mode 100644 index 0000000..3b30b16 --- /dev/null +++ b/opal_security/models/user_attribute_selector.py @@ -0,0 +1,110 @@ +# 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, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class UserAttributeSelector(BaseModel): + """ + UserAttributeSelector + """ # noqa: E501 + attribute: StrictStr + values: List[StrictStr] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["attribute", "values"] + + @field_validator('attribute') + def attribute_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['HR_IDP_STATUS']): + raise ValueError("must be one of enum values ('HR_IDP_STATUS')") + return value + + 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 UserAttributeSelector 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 UserAttributeSelector from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "attribute": obj.get("attribute"), + "values": obj.get("values") + }) + # 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/pyproject.toml b/pyproject.toml index 4bed9f2..bfd1432 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "opal_security" -dynamic = ["version"] +version = "1.0.0" description = "Opal API" authors = [ {name = "Opal Team",email = "hello@opal.dev"}, @@ -32,7 +32,7 @@ mypy = ">= 1.5" [build-system] -requires = ["setuptools", "setuptools_scm"] +requires = ["setuptools"] build-backend = "setuptools.build_meta" [tool.pylint.'MESSAGES CONTROL'] diff --git a/test/test_group_remote_info_grafana_team.py b/test/test_group_remote_info_grafana_team.py new file mode 100644 index 0000000..4b968b7 --- /dev/null +++ b/test/test_group_remote_info_grafana_team.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_grafana_team import GroupRemoteInfoGrafanaTeam + +class TestGroupRemoteInfoGrafanaTeam(unittest.TestCase): + """GroupRemoteInfoGrafanaTeam unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GroupRemoteInfoGrafanaTeam: + """Test GroupRemoteInfoGrafanaTeam + 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 `GroupRemoteInfoGrafanaTeam` + """ + model = GroupRemoteInfoGrafanaTeam() + if include_optional: + return GroupRemoteInfoGrafanaTeam( + team_id = '2323' + ) + else: + return GroupRemoteInfoGrafanaTeam( + team_id = '2323', + ) + """ + + def testGroupRemoteInfoGrafanaTeam(self): + """Test GroupRemoteInfoGrafanaTeam""" + # 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_synced.py b/test/test_group_remote_info_twingate_group_synced.py new file mode 100644 index 0000000..2699e00 --- /dev/null +++ b/test/test_group_remote_info_twingate_group_synced.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_synced import GroupRemoteInfoTwingateGroupSynced + +class TestGroupRemoteInfoTwingateGroupSynced(unittest.TestCase): + """GroupRemoteInfoTwingateGroupSynced unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GroupRemoteInfoTwingateGroupSynced: + """Test GroupRemoteInfoTwingateGroupSynced + 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 `GroupRemoteInfoTwingateGroupSynced` + """ + model = GroupRemoteInfoTwingateGroupSynced() + if include_optional: + return GroupRemoteInfoTwingateGroupSynced( + group_id = 'R3JvdXA6MTIzNA==' + ) + else: + return GroupRemoteInfoTwingateGroupSynced( + group_id = 'R3JvdXA6MTIzNA==', + ) + """ + + def testGroupRemoteInfoTwingateGroupSynced(self): + """Test GroupRemoteInfoTwingateGroupSynced""" + # 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_access_rules_list.py b/test/test_paginated_access_rules_list.py new file mode 100644 index 0000000..91f6c80 --- /dev/null +++ b/test/test_paginated_access_rules_list.py @@ -0,0 +1,125 @@ +# 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_access_rules_list import PaginatedAccessRulesList + +class TestPaginatedAccessRulesList(unittest.TestCase): + """PaginatedAccessRulesList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PaginatedAccessRulesList: + """Test PaginatedAccessRulesList + 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 `PaginatedAccessRulesList` + """ + model = PaginatedAccessRulesList() + if include_optional: + return PaginatedAccessRulesList( + next = 'cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw', + previous = 'cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ', + results = [ + opal_security.models.access_rule.AccessRule( + access_rule_id = '7c86c85d-0651-43e2-a748-d69d658418e8', + name = 'Platform Engineering', + description = 'This access rule represents all platform engineers in the company.', + admin_owner_id = '7c86c85d-0651-43e2-a748-d69d658418e8', + status = 'ACTIVE', + rule_clauses = opal_security.models.rule_clauses.RuleClauses( + when = opal_security.models.rule_conjunction.RuleConjunction( + clauses = [ + opal_security.models.rule_disjunction.RuleDisjunction( + selectors = [ + opal_security.models.tag_selector.TagSelector( + key = '', + value = '', + connection_id = '', ) + ], + attribute_selectors = [ + opal_security.models.user_attribute_selector.UserAttributeSelector( + attribute = 'HR_IDP_STATUS', + values = [ + '' + ], ) + ], ) + ], ), + unless = opal_security.models.rule_conjunction.RuleConjunction( + clauses = [ + opal_security.models.rule_disjunction.RuleDisjunction( + selectors = [ + opal_security.models.tag_selector.TagSelector( + key = '', + value = '', + connection_id = '', ) + ], ) + ], ), ), ) + ] + ) + else: + return PaginatedAccessRulesList( + results = [ + opal_security.models.access_rule.AccessRule( + access_rule_id = '7c86c85d-0651-43e2-a748-d69d658418e8', + name = 'Platform Engineering', + description = 'This access rule represents all platform engineers in the company.', + admin_owner_id = '7c86c85d-0651-43e2-a748-d69d658418e8', + status = 'ACTIVE', + rule_clauses = opal_security.models.rule_clauses.RuleClauses( + when = opal_security.models.rule_conjunction.RuleConjunction( + clauses = [ + opal_security.models.rule_disjunction.RuleDisjunction( + selectors = [ + opal_security.models.tag_selector.TagSelector( + key = '', + value = '', + connection_id = '', ) + ], + attribute_selectors = [ + opal_security.models.user_attribute_selector.UserAttributeSelector( + attribute = 'HR_IDP_STATUS', + values = [ + '' + ], ) + ], ) + ], ), + unless = opal_security.models.rule_conjunction.RuleConjunction( + clauses = [ + opal_security.models.rule_disjunction.RuleDisjunction( + selectors = [ + opal_security.models.tag_selector.TagSelector( + key = '', + value = '', + connection_id = '', ) + ], ) + ], ), ), ) + ], + ) + """ + + def testPaginatedAccessRulesList(self): + """Test PaginatedAccessRulesList""" + # 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_grafana_dashboard.py b/test/test_resource_remote_info_grafana_dashboard.py new file mode 100644 index 0000000..918ada9 --- /dev/null +++ b/test/test_resource_remote_info_grafana_dashboard.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_grafana_dashboard import ResourceRemoteInfoGrafanaDashboard + +class TestResourceRemoteInfoGrafanaDashboard(unittest.TestCase): + """ResourceRemoteInfoGrafanaDashboard unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ResourceRemoteInfoGrafanaDashboard: + """Test ResourceRemoteInfoGrafanaDashboard + 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 `ResourceRemoteInfoGrafanaDashboard` + """ + model = ResourceRemoteInfoGrafanaDashboard() + if include_optional: + return ResourceRemoteInfoGrafanaDashboard( + dashboard_uid = 'dddRTXX' + ) + else: + return ResourceRemoteInfoGrafanaDashboard( + dashboard_uid = 'dddRTXX', + ) + """ + + def testResourceRemoteInfoGrafanaDashboard(self): + """Test ResourceRemoteInfoGrafanaDashboard""" + # 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_grafana_folder.py b/test/test_resource_remote_info_grafana_folder.py new file mode 100644 index 0000000..84161ff --- /dev/null +++ b/test/test_resource_remote_info_grafana_folder.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_grafana_folder import ResourceRemoteInfoGrafanaFolder + +class TestResourceRemoteInfoGrafanaFolder(unittest.TestCase): + """ResourceRemoteInfoGrafanaFolder unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ResourceRemoteInfoGrafanaFolder: + """Test ResourceRemoteInfoGrafanaFolder + 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 `ResourceRemoteInfoGrafanaFolder` + """ + model = ResourceRemoteInfoGrafanaFolder() + if include_optional: + return ResourceRemoteInfoGrafanaFolder( + folder_uid = 'fffRTXX' + ) + else: + return ResourceRemoteInfoGrafanaFolder( + folder_uid = 'fffRTXX', + ) + """ + + def testResourceRemoteInfoGrafanaFolder(self): + """Test ResourceRemoteInfoGrafanaFolder""" + # 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_grafana_role.py b/test/test_resource_remote_info_grafana_role.py new file mode 100644 index 0000000..b2a2454 --- /dev/null +++ b/test/test_resource_remote_info_grafana_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_grafana_role import ResourceRemoteInfoGrafanaRole + +class TestResourceRemoteInfoGrafanaRole(unittest.TestCase): + """ResourceRemoteInfoGrafanaRole unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ResourceRemoteInfoGrafanaRole: + """Test ResourceRemoteInfoGrafanaRole + 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 `ResourceRemoteInfoGrafanaRole` + """ + model = ResourceRemoteInfoGrafanaRole() + if include_optional: + return ResourceRemoteInfoGrafanaRole( + role_uid = 'rrfRTXX' + ) + else: + return ResourceRemoteInfoGrafanaRole( + role_uid = 'rrfRTXX', + ) + """ + + def testResourceRemoteInfoGrafanaRole(self): + """Test ResourceRemoteInfoGrafanaRole""" + # 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_user_attribute_selector.py b/test/test_user_attribute_selector.py new file mode 100644 index 0000000..f9ed22c --- /dev/null +++ b/test/test_user_attribute_selector.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.user_attribute_selector import UserAttributeSelector + +class TestUserAttributeSelector(unittest.TestCase): + """UserAttributeSelector unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UserAttributeSelector: + """Test UserAttributeSelector + 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 `UserAttributeSelector` + """ + model = UserAttributeSelector() + if include_optional: + return UserAttributeSelector( + attribute = 'HR_IDP_STATUS', + values = [ + '' + ] + ) + else: + return UserAttributeSelector( + attribute = 'HR_IDP_STATUS', + values = [ + '' + ], + ) + """ + + def testUserAttributeSelector(self): + """Test UserAttributeSelector""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main()