diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index b342dd5..9152225 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -5,6 +5,10 @@ README.md docs/Access.md docs/AccessList.md +docs/AccessRuleCondition.md +docs/AccessRulesApi.md +docs/AddBundleGroupRequest.md +docs/AddBundleResourceRequest.md docs/AddGroupResourceRequest.md docs/AddGroupUserRequest.md docs/AddResourceNhiRequest.md @@ -18,9 +22,14 @@ docs/AppsApi.md docs/AppsList.md docs/AwsPermissionSetMetadata.md docs/AwsPermissionSetMetadataAwsPermissionSet.md +docs/Bundle.md +docs/BundleGroup.md +docs/BundleResource.md +docs/BundlesApi.md docs/Condition.md docs/ConfigurationTemplate.md docs/ConfigurationTemplatesApi.md +docs/CreateBundleInfo.md docs/CreateConfigurationTemplateInfo.md docs/CreateGroupBindingInfo.md docs/CreateGroupBindingInfoGroupsInner.md @@ -46,6 +55,8 @@ docs/GroupAccessLevel.md docs/GroupBinding.md docs/GroupBindingGroup.md docs/GroupBindingsApi.md +docs/GroupContainingGroup.md +docs/GroupContainingGroupList.md docs/GroupRemoteInfo.md docs/GroupRemoteInfoActiveDirectoryGroup.md docs/GroupRemoteInfoAzureAdMicrosoft365Group.md @@ -61,6 +72,7 @@ docs/GroupResourceList.md docs/GroupTypeEnum.md docs/GroupUser.md docs/GroupUserList.md +docs/GroupWithAccessLevel.md docs/GroupsApi.md docs/IdpGroupMapping.md docs/IdpGroupMappingList.md @@ -78,6 +90,9 @@ docs/OnCallScheduleProviderEnum.md docs/OnCallSchedulesApi.md docs/Owner.md docs/OwnersApi.md +docs/PaginatedBundleGroupList.md +docs/PaginatedBundleList.md +docs/PaginatedBundleResourceList.md docs/PaginatedConfigurationTemplateList.md docs/PaginatedEventList.md docs/PaginatedGroupBindingsList.md @@ -140,6 +155,9 @@ docs/ReviewerIDList.md docs/ReviewerStage.md docs/ReviewerStageList.md docs/RiskSensitivityEnum.md +docs/RuleClauses.md +docs/RuleConjunction.md +docs/RuleDisjunction.md docs/Session.md docs/SessionsApi.md docs/SessionsList.md @@ -148,6 +166,7 @@ docs/SyncError.md docs/SyncErrorList.md docs/Tag.md docs/TagFilter.md +docs/TagSelector.md docs/TagsApi.md docs/TagsList.md docs/TicketPropagationConfiguration.md @@ -168,6 +187,7 @@ docs/UpdateOwnerInfo.md docs/UpdateOwnerInfoList.md docs/UpdateResourceInfo.md docs/UpdateResourceInfoList.md +docs/UpdateResourceUserRequest.md docs/User.md docs/UserHrIdpStatusEnum.md docs/UserIDList.md @@ -178,7 +198,9 @@ docs/VisibilityTypeEnum.md git_push.sh opal_security/__init__.py opal_security/api/__init__.py +opal_security/api/access_rules_api.py opal_security/api/apps_api.py +opal_security/api/bundles_api.py opal_security/api/configuration_templates_api.py opal_security/api/events_api.py opal_security/api/group_bindings_api.py @@ -201,6 +223,9 @@ opal_security/exceptions.py opal_security/models/__init__.py opal_security/models/access.py opal_security/models/access_list.py +opal_security/models/access_rule_condition.py +opal_security/models/add_bundle_group_request.py +opal_security/models/add_bundle_resource_request.py opal_security/models/add_group_resource_request.py opal_security/models/add_group_user_request.py opal_security/models/add_resource_nhi_request.py @@ -213,8 +238,12 @@ opal_security/models/app_validation_status_enum.py opal_security/models/apps_list.py opal_security/models/aws_permission_set_metadata.py opal_security/models/aws_permission_set_metadata_aws_permission_set.py +opal_security/models/bundle.py +opal_security/models/bundle_group.py +opal_security/models/bundle_resource.py opal_security/models/condition.py opal_security/models/configuration_template.py +opal_security/models/create_bundle_info.py opal_security/models/create_configuration_template_info.py opal_security/models/create_group_binding_info.py opal_security/models/create_group_binding_info_groups_inner.py @@ -238,6 +267,8 @@ opal_security/models/group.py opal_security/models/group_access_level.py opal_security/models/group_binding.py opal_security/models/group_binding_group.py +opal_security/models/group_containing_group.py +opal_security/models/group_containing_group_list.py opal_security/models/group_remote_info.py opal_security/models/group_remote_info_active_directory_group.py opal_security/models/group_remote_info_azure_ad_microsoft365_group.py @@ -253,6 +284,7 @@ opal_security/models/group_resource_list.py opal_security/models/group_type_enum.py opal_security/models/group_user.py opal_security/models/group_user_list.py +opal_security/models/group_with_access_level.py opal_security/models/idp_group_mapping.py opal_security/models/idp_group_mapping_list.py opal_security/models/message_channel.py @@ -264,6 +296,9 @@ opal_security/models/on_call_schedule_id_list.py 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/paginated_bundle_group_list.py +opal_security/models/paginated_bundle_list.py +opal_security/models/paginated_bundle_resource_list.py opal_security/models/paginated_configuration_template_list.py opal_security/models/paginated_event_list.py opal_security/models/paginated_group_bindings_list.py @@ -324,6 +359,9 @@ opal_security/models/reviewer_id_list.py opal_security/models/reviewer_stage.py opal_security/models/reviewer_stage_list.py opal_security/models/risk_sensitivity_enum.py +opal_security/models/rule_clauses.py +opal_security/models/rule_conjunction.py +opal_security/models/rule_disjunction.py opal_security/models/session.py opal_security/models/sessions_list.py opal_security/models/sub_event.py @@ -331,6 +369,7 @@ opal_security/models/sync_error.py opal_security/models/sync_error_list.py opal_security/models/tag.py opal_security/models/tag_filter.py +opal_security/models/tag_selector.py opal_security/models/tags_list.py opal_security/models/ticket_propagation_configuration.py opal_security/models/ticketing_provider_enum.py @@ -349,6 +388,7 @@ opal_security/models/update_owner_info.py opal_security/models/update_owner_info_list.py 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_hr_idp_status_enum.py opal_security/models/user_id_list.py @@ -363,9 +403,24 @@ setup.cfg setup.py test-requirements.txt test/__init__.py -test/test_app_validation.py -test/test_app_validation_severity_enum.py -test/test_app_validation_status_enum.py -test/test_propagation_status.py -test/test_propagation_status_enum.py +test/test_access_rule_condition.py +test/test_access_rules_api.py +test/test_add_bundle_group_request.py +test/test_add_bundle_resource_request.py +test/test_bundle.py +test/test_bundle_group.py +test/test_bundle_resource.py +test/test_bundles_api.py +test/test_create_bundle_info.py +test/test_group_containing_group.py +test/test_group_containing_group_list.py +test/test_group_with_access_level.py +test/test_paginated_bundle_group_list.py +test/test_paginated_bundle_list.py +test/test_paginated_bundle_resource_list.py +test/test_rule_clauses.py +test/test_rule_conjunction.py +test/test_rule_disjunction.py +test/test_tag_selector.py +test/test_update_resource_user_request.py tox.ini diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index b23eb27..5f84a81 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -7.11.0 +7.12.0 diff --git a/README.md b/README.md index faeae72..b766004 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: - API version: 1.0 - [Releases](https://github.com/opalsecurity/opal-python/releases/) -- Generator version: 7.11.0 +- Generator version: 7.12.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://www.opal.dev/](https://www.opal.dev/) @@ -81,15 +81,15 @@ configuration = opal.Configuration( # Enter a context with an instance of the API client with opal.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = opal.AppsApi(api_client) - app_id = '32acc112-21ff-4669-91c2-21e27683eaa1' # str | The ID of the app. + api_instance = opal.AccessRulesApi(api_client) + access_rule_id = '1b978423-db0a-4037-a4cf-f79c60cb67b3' # str | The access rule ID (group ID) of the access rule. try: - api_response = api_instance.get_app(app_id) - print("The response of AppsApi->get_app:\n") + api_response = api_instance.get_access_rule(access_rule_id) + print("The response of AccessRulesApi->get_access_rule:\n") pprint(api_response) except ApiException as e: - print("Exception when calling AppsApi->get_app: %s\n" % e) + print("Exception when calling AccessRulesApi->get_access_rule: %s\n" % e) ``` @@ -141,9 +141,24 @@ All URIs are relative to *https://api.opal.dev/v1* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*AccessRulesApi* | [**get_access_rule**](docs/AccessRulesApi.md#get_access_rule) | **GET** /access-rules/{access_rule_id} | +*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} | *AppsApi* | [**get_apps**](docs/AppsApi.md#get_apps) | **GET** /apps | *AppsApi* | [**get_sync_errors**](docs/AppsApi.md#get_sync_errors) | **GET** /sync_errors | +*BundlesApi* | [**add_bundle_group**](docs/BundlesApi.md#add_bundle_group) | **POST** /bundles/{bundle_id}/groups | +*BundlesApi* | [**add_bundle_resource**](docs/BundlesApi.md#add_bundle_resource) | **POST** /bundles/{bundle_id}/resources | +*BundlesApi* | [**create_bundle**](docs/BundlesApi.md#create_bundle) | **POST** /bundles | +*BundlesApi* | [**delete_bundle**](docs/BundlesApi.md#delete_bundle) | **DELETE** /bundles/{bundle_id} | +*BundlesApi* | [**get_bundle**](docs/BundlesApi.md#get_bundle) | **GET** /bundles/{bundle_id} | +*BundlesApi* | [**get_bundle_groups**](docs/BundlesApi.md#get_bundle_groups) | **GET** /bundles/{bundle_id}/groups | +*BundlesApi* | [**get_bundle_resources**](docs/BundlesApi.md#get_bundle_resources) | **GET** /bundles/{bundle_id}/resources | +*BundlesApi* | [**get_bundle_visibility**](docs/BundlesApi.md#get_bundle_visibility) | **GET** /bundles/{bundle_id}/visibility | +*BundlesApi* | [**get_bundles**](docs/BundlesApi.md#get_bundles) | **GET** /bundles | +*BundlesApi* | [**remove_bundle_group**](docs/BundlesApi.md#remove_bundle_group) | **DELETE** /bundles/{bundle_id}/groups/{group_id} | +*BundlesApi* | [**remove_bundle_resource**](docs/BundlesApi.md#remove_bundle_resource) | **DELETE** /bundles/{bundle_id}/resources/{resource_id} | +*BundlesApi* | [**set_bundle_visibility**](docs/BundlesApi.md#set_bundle_visibility) | **PUT** /bundles/{bundle_id}/visibility | +*BundlesApi* | [**update_bundle**](docs/BundlesApi.md#update_bundle) | **PUT** /bundles/{bundle_id} | *ConfigurationTemplatesApi* | [**create_configuration_template**](docs/ConfigurationTemplatesApi.md#create_configuration_template) | **POST** /configuration-templates | *ConfigurationTemplatesApi* | [**delete_configuration_template**](docs/ConfigurationTemplatesApi.md#delete_configuration_template) | **DELETE** /configuration-templates/{configuration_template_id} | *ConfigurationTemplatesApi* | [**get_configuration_templates**](docs/ConfigurationTemplatesApi.md#get_configuration_templates) | **GET** /configuration-templates | @@ -154,12 +169,15 @@ Class | Method | HTTP request | Description *GroupBindingsApi* | [**get_group_binding**](docs/GroupBindingsApi.md#get_group_binding) | **GET** /group-bindings/{group_binding_id} | *GroupBindingsApi* | [**get_group_bindings**](docs/GroupBindingsApi.md#get_group_bindings) | **GET** /group-bindings | *GroupBindingsApi* | [**update_group_bindings**](docs/GroupBindingsApi.md#update_group_bindings) | **PUT** /group-bindings | +*GroupsApi* | [**add_group_containing_group**](docs/GroupsApi.md#add_group_containing_group) | **POST** /groups/{group_id}/containing-groups | *GroupsApi* | [**add_group_resource**](docs/GroupsApi.md#add_group_resource) | **POST** /groups/{group_id}/resources/{resource_id} | *GroupsApi* | [**add_group_user**](docs/GroupsApi.md#add_group_user) | **POST** /groups/{group_id}/users/{user_id} | *GroupsApi* | [**create_group**](docs/GroupsApi.md#create_group) | **POST** /groups | *GroupsApi* | [**delete_group**](docs/GroupsApi.md#delete_group) | **DELETE** /groups/{group_id} | *GroupsApi* | [**delete_group_user**](docs/GroupsApi.md#delete_group_user) | **DELETE** /groups/{group_id}/users/{user_id} | *GroupsApi* | [**get_group**](docs/GroupsApi.md#get_group) | **GET** /groups/{group_id} | +*GroupsApi* | [**get_group_containing_group**](docs/GroupsApi.md#get_group_containing_group) | **GET** /groups/{group_id}/containing-groups/{containing_group_id} | +*GroupsApi* | [**get_group_containing_groups**](docs/GroupsApi.md#get_group_containing_groups) | **GET** /groups/{group_id}/containing-groups | *GroupsApi* | [**get_group_message_channels**](docs/GroupsApi.md#get_group_message_channels) | **GET** /groups/{group_id}/message-channels | *GroupsApi* | [**get_group_on_call_schedules**](docs/GroupsApi.md#get_group_on_call_schedules) | **GET** /groups/{group_id}/on-call-schedules | *GroupsApi* | [**get_group_resources**](docs/GroupsApi.md#get_group_resources) | **GET** /groups/{group_id}/resources | @@ -169,6 +187,7 @@ Class | Method | HTTP request | Description *GroupsApi* | [**get_group_users**](docs/GroupsApi.md#get_group_users) | **GET** /groups/{group_id}/users | *GroupsApi* | [**get_group_visibility**](docs/GroupsApi.md#get_group_visibility) | **GET** /groups/{group_id}/visibility | *GroupsApi* | [**get_groups**](docs/GroupsApi.md#get_groups) | **GET** /groups | +*GroupsApi* | [**remove_group_containing_group**](docs/GroupsApi.md#remove_group_containing_group) | **DELETE** /groups/{group_id}/containing-groups/{containing_group_id} | *GroupsApi* | [**set_group_message_channels**](docs/GroupsApi.md#set_group_message_channels) | **PUT** /groups/{group_id}/message-channels | *GroupsApi* | [**set_group_on_call_schedules**](docs/GroupsApi.md#set_group_on_call_schedules) | **PUT** /groups/{group_id}/on-call-schedules | *GroupsApi* | [**set_group_resources**](docs/GroupsApi.md#set_group_resources) | **PUT** /groups/{group_id}/resources | @@ -216,6 +235,7 @@ Class | Method | HTTP request | Description *ResourcesApi* | [**set_resource_reviewer_stages**](docs/ResourcesApi.md#set_resource_reviewer_stages) | **PUT** /resources/{resource_id}/reviewer-stages | *ResourcesApi* | [**set_resource_reviewers**](docs/ResourcesApi.md#set_resource_reviewers) | **PUT** /resources/{resource_id}/reviewers | *ResourcesApi* | [**set_resource_visibility**](docs/ResourcesApi.md#set_resource_visibility) | **PUT** /resources/{resource_id}/visibility | +*ResourcesApi* | [**update_resource_user**](docs/ResourcesApi.md#update_resource_user) | **PUT** /resources/{resource_id}/users/{user_id} | *ResourcesApi* | [**update_resources**](docs/ResourcesApi.md#update_resources) | **PUT** /resources | *SessionsApi* | [**sessions**](docs/SessionsApi.md#sessions) | **GET** /sessions | *TagsApi* | [**add_group_tag**](docs/TagsApi.md#add_group_tag) | **POST** /tags/{tag_id}/groups/{group_id} | @@ -241,6 +261,9 @@ Class | Method | HTTP request | Description - [Access](docs/Access.md) - [AccessList](docs/AccessList.md) + - [AccessRuleCondition](docs/AccessRuleCondition.md) + - [AddBundleGroupRequest](docs/AddBundleGroupRequest.md) + - [AddBundleResourceRequest](docs/AddBundleResourceRequest.md) - [AddGroupResourceRequest](docs/AddGroupResourceRequest.md) - [AddGroupUserRequest](docs/AddGroupUserRequest.md) - [AddResourceNhiRequest](docs/AddResourceNhiRequest.md) @@ -253,8 +276,12 @@ Class | Method | HTTP request | Description - [AppsList](docs/AppsList.md) - [AwsPermissionSetMetadata](docs/AwsPermissionSetMetadata.md) - [AwsPermissionSetMetadataAwsPermissionSet](docs/AwsPermissionSetMetadataAwsPermissionSet.md) + - [Bundle](docs/Bundle.md) + - [BundleGroup](docs/BundleGroup.md) + - [BundleResource](docs/BundleResource.md) - [Condition](docs/Condition.md) - [ConfigurationTemplate](docs/ConfigurationTemplate.md) + - [CreateBundleInfo](docs/CreateBundleInfo.md) - [CreateConfigurationTemplateInfo](docs/CreateConfigurationTemplateInfo.md) - [CreateGroupBindingInfo](docs/CreateGroupBindingInfo.md) - [CreateGroupBindingInfoGroupsInner](docs/CreateGroupBindingInfoGroupsInner.md) @@ -278,6 +305,8 @@ Class | Method | HTTP request | Description - [GroupAccessLevel](docs/GroupAccessLevel.md) - [GroupBinding](docs/GroupBinding.md) - [GroupBindingGroup](docs/GroupBindingGroup.md) + - [GroupContainingGroup](docs/GroupContainingGroup.md) + - [GroupContainingGroupList](docs/GroupContainingGroupList.md) - [GroupRemoteInfo](docs/GroupRemoteInfo.md) - [GroupRemoteInfoActiveDirectoryGroup](docs/GroupRemoteInfoActiveDirectoryGroup.md) - [GroupRemoteInfoAzureAdMicrosoft365Group](docs/GroupRemoteInfoAzureAdMicrosoft365Group.md) @@ -293,6 +322,7 @@ Class | Method | HTTP request | Description - [GroupTypeEnum](docs/GroupTypeEnum.md) - [GroupUser](docs/GroupUser.md) - [GroupUserList](docs/GroupUserList.md) + - [GroupWithAccessLevel](docs/GroupWithAccessLevel.md) - [IdpGroupMapping](docs/IdpGroupMapping.md) - [IdpGroupMappingList](docs/IdpGroupMappingList.md) - [MessageChannel](docs/MessageChannel.md) @@ -304,6 +334,9 @@ Class | Method | HTTP request | Description - [OnCallScheduleList](docs/OnCallScheduleList.md) - [OnCallScheduleProviderEnum](docs/OnCallScheduleProviderEnum.md) - [Owner](docs/Owner.md) + - [PaginatedBundleGroupList](docs/PaginatedBundleGroupList.md) + - [PaginatedBundleList](docs/PaginatedBundleList.md) + - [PaginatedBundleResourceList](docs/PaginatedBundleResourceList.md) - [PaginatedConfigurationTemplateList](docs/PaginatedConfigurationTemplateList.md) - [PaginatedEventList](docs/PaginatedEventList.md) - [PaginatedGroupBindingsList](docs/PaginatedGroupBindingsList.md) @@ -364,6 +397,9 @@ Class | Method | HTTP request | Description - [ReviewerStage](docs/ReviewerStage.md) - [ReviewerStageList](docs/ReviewerStageList.md) - [RiskSensitivityEnum](docs/RiskSensitivityEnum.md) + - [RuleClauses](docs/RuleClauses.md) + - [RuleConjunction](docs/RuleConjunction.md) + - [RuleDisjunction](docs/RuleDisjunction.md) - [Session](docs/Session.md) - [SessionsList](docs/SessionsList.md) - [SubEvent](docs/SubEvent.md) @@ -371,6 +407,7 @@ Class | Method | HTTP request | Description - [SyncErrorList](docs/SyncErrorList.md) - [Tag](docs/Tag.md) - [TagFilter](docs/TagFilter.md) + - [TagSelector](docs/TagSelector.md) - [TagsList](docs/TagsList.md) - [TicketPropagationConfiguration](docs/TicketPropagationConfiguration.md) - [TicketingProviderEnum](docs/TicketingProviderEnum.md) @@ -389,6 +426,7 @@ Class | Method | HTTP request | Description - [UpdateOwnerInfoList](docs/UpdateOwnerInfoList.md) - [UpdateResourceInfo](docs/UpdateResourceInfo.md) - [UpdateResourceInfoList](docs/UpdateResourceInfoList.md) + - [UpdateResourceUserRequest](docs/UpdateResourceUserRequest.md) - [User](docs/User.md) - [UserHrIdpStatusEnum](docs/UserHrIdpStatusEnum.md) - [UserIDList](docs/UserIDList.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index 0f0a9d4..303cf1b 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -76,6 +76,430 @@ paths: - BearerAuth: [] tags: - apps + /bundles: + get: + description: Returns a list of `Bundle` objects. + operationId: getBundles + parameters: + - description: The maximum number of bundles to return from the beginning of the list. Default is 200, max is 1000. + example: 200 + explode: true + in: query + name: page_size + required: false + schema: + type: integer + style: form + - description: A cursor indicating where to start fetching items after a specific point. + example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + explode: true + in: query + name: cursor + required: false + schema: + type: string + style: form + - description: A filter for the bundle name. + example: Engineering + explode: true + in: query + name: contains + required: false + schema: + type: string + style: form + responses: + "200": + description: A list of bundles for your organization. + content: + application/json: + schema: + $ref: "#/components/schemas/PaginatedBundleList" + security: + - BearerAuth: [] + tags: + - bundles + post: + description: Creates a bundle. + operationId: createBundle + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreateBundleInfo" + responses: + "201": + description: The bundle successfully created. + content: + application/json: + schema: + $ref: "#/components/schemas/Bundle" + security: + - BearerAuth: [] + tags: + - bundles + /bundles/{bundle_id}: + get: + description: Returns a `Bundle` object. + operationId: getBundle + parameters: + - description: The ID of the bundle. + example: 32acc112-21ff-4669-91c2-21e27683eaa1 + explode: true + in: path + name: bundle_id + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/Bundle" + description: The requested `Bundle`. + security: + - BearerAuth: [] + tags: + - bundles + delete: + description: Deletes a bundle. + operationId: deleteBundle + parameters: + - description: The ID of the bundle. + example: 32acc112-21ff-4669-91c2-21e27683eaa1 + explode: true + in: path + name: bundle_id + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + description: The bundle was successfully deleted. + security: + - BearerAuth: [] + tags: + - bundles + put: + description: Updates a bundle. + operationId: updateBundle + parameters: + - description: The ID of the bundle to be updated. + example: 32acc112-21ff-4669-91c2-21e27683eaa1 + in: path + name: bundle_id + required: true + schema: + format: uuid + type: string + style: simple + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Bundle" + responses: + "200": + description: The bundle was successfully updated. + content: + application/json: + schema: + $ref: "#/components/schemas/Bundle" + "204": + description: No changes detected (no-op) + security: + - BearerAuth: [] + tags: + - bundles + /bundles/{bundle_id}/resources: + get: + description: Returns a list of `Resource` objects in a given bundle. + operationId: getBundleResources + parameters: + - description: The ID of the bundle. + example: 32acc112-21ff-4669-91c2-21e27683eaa1 + in: path + name: bundle_id + required: true + schema: + format: uuid + type: string + style: simple + - description: The maximum number of resources to return from the beginning of the list. Default is 200, max is 1000. + example: 200 + explode: true + in: query + name: page_size + required: false + schema: + type: integer + style: form + - description: A cursor indicating where to start fetching items after a specific point. + example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + explode: true + in: query + name: cursor + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/PaginatedBundleResourceList" + description: A list of resources for the bundle. + security: + - BearerAuth: [] + tags: + - bundles + post: + description: Adds a resource to a bundle. + operationId: addBundleResource + parameters: + - description: The ID of the bundle. + example: 32acc112-21ff-4669-91c2-21e27683eaa1 + in: path + name: bundle_id + required: true + schema: + format: uuid + type: string + requestBody: + required: false + content: + application/json: + schema: + properties: + resource_id: + description: The ID of the resource to add. + example: 72e75a6f-7183-48c5-94ff-6013f213314b + format: uuid + type: string + access_level_remote_id: + description: The remote ID of the access level to grant to this user. Required if the resource being added requires an access level. If omitted, the default access level remote ID value (empty string) is used. + example: arn:aws:iam::590304332660:role/AdministratorAccess + type: string + access_level_name: + description: The name of the access level to grant to this user. If omitted, the default access level name value (empty string) is used. + example: AdministratorAccess + type: string + required: + - resource_id + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/BundleResource" + description: Resource was successfully added to the bundle. + security: + - BearerAuth: [] + tags: + - bundles + /bundles/{bundle_id}/resources/{resource_id}: + delete: + description: Removes a resource from a bundle. + operationId: removeBundleResource + parameters: + - description: The ID of the bundle. + example: 32acc112-21ff-4669-91c2-21e27683eaa1 + in: path + name: bundle_id + required: true + schema: + format: uuid + type: string + - description: The ID of the resource to remove. + example: 72e75a6f-7183-48c5-94ff-6013f213314b + in: path + name: resource_id + required: true + schema: + format: uuid + type: string + - description: The remote ID of the access level to grant. If omitted, the default access level remote ID value (empty string) is used. + example: arn:aws:iam::590304332660:role/AdministratorAccess + explode: true + in: query + name: access_level_remote_id + required: false + schema: + type: string + style: form + responses: + "200": + description: Resource was successfully removed from the bundle. + security: + - BearerAuth: [] + tags: + - bundles + /bundles/{bundle_id}/groups: + get: + description: Returns a list of `Group` objects in a given bundle. + operationId: getBundleGroups + parameters: + - description: The ID of the bundle. + example: 32acc112-21ff-4669-91c2-21e27683eaa1 + in: path + name: bundle_id + required: true + schema: + format: uuid + type: string + style: simple + - description: The maximum number of groups to return from the beginning of the list. Default is 200, max is 1000. + example: 200 + explode: true + in: query + name: page_size + required: false + schema: + type: integer + style: form + - description: A cursor indicating where to start fetching items after a specific point. + example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + explode: true + in: query + name: cursor + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/PaginatedBundleGroupList" + description: A list of groups for the bundle. + security: + - BearerAuth: [] + tags: + - bundles + post: + description: Adds a group to a bundle. + operationId: addBundleGroup + parameters: + - description: The ID of the bundle. + example: 32acc112-21ff-4669-91c2-21e27683eaa1 + in: path + name: bundle_id + required: true + schema: + format: uuid + type: string + requestBody: + required: true + content: + application/json: + schema: + properties: + group_id: + description: The ID of the group to add. + example: 72e75a6f-7183-48c5-94ff-6013f213314b + format: uuid + type: string + required: + - group_id + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/BundleGroup" + description: Group was successfully added to the bundle. + security: + - BearerAuth: [] + tags: + - bundles + /bundles/{bundle_id}/groups/{group_id}: + delete: + description: Removes a group from a bundle. + operationId: removeBundleGroup + parameters: + - description: The ID of the bundle. + example: 32acc112-21ff-4669-91c2-21e27683eaa1 + in: path + name: bundle_id + required: true + schema: + format: uuid + type: string + - description: The ID of the group to remove. + example: 72e75a6f-7183-48c5-94ff-6013f213314b + in: path + name: group_id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: Group was successfully removed from the bundle. + security: + - BearerAuth: [] + tags: + - bundles + /bundles/{bundle_id}/visibility: + get: + description: Gets the visibility of the bundle. + operationId: getBundleVisibility + parameters: + - description: The ID of the bundle. + example: 32acc112-21ff-4669-91c2-21e27683eaa1 + in: path + name: bundle_id + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/VisibilityInfo" + description: The visibility details of a bundle. + security: + - BearerAuth: [] + tags: + - bundles + put: + description: Sets the visibility of the bundle. + operationId: setBundleVisibility + parameters: + - description: The ID of the bundle. + example: 32acc112-21ff-4669-91c2-21e27683eaa1 + in: path + name: bundle_id + required: true + schema: + format: uuid + type: string + requestBody: + required: true + content: + application/json: + schema: + description: The visibility details of the bundle. Setting to LIMITED visibility with no visibility groups will make bundle only visible to admins and users with access. + $ref: "#/components/schemas/VisibilityInfo" + responses: + "200": + description: The visibility details of the bundle were successfully set. + security: + - BearerAuth: [] + tags: + - bundles /configuration-templates: get: description: Returns a list of `ConfigurationTemplate` objects. @@ -347,7 +771,7 @@ paths: tags: - groups post: - description: Creates a group. See [here](https://docs.opal.dev/reference/end-system-objects) for details about importing groups. + description: Creates an Opal group or [imports a remote group](https://docs.opal.dev/reference/end-system-objects). operationId: createGroup requestBody: required: true @@ -588,6 +1012,130 @@ paths: - BearerAuth: [] tags: - groups + /groups/{group_id}/containing-groups: + get: + description: Gets the list of groups that the group gives access to. + operationId: get_group_containing_groups + parameters: + - description: The ID of the group. + example: 4baf8423-db0a-4037-a4cf-f79c60cb67a5 + explode: false + in: path + name: group_id + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GroupContainingGroupList" + description: The resources that the group gives access to. + security: + - BearerAuth: [] + tags: + - groups + post: + description: Creates a new containing group. + operationId: add_group_containing_group + parameters: + - description: The ID of the group. + example: 4baf8423-db0a-4037-a4cf-f79c60cb67a5 + explode: false + in: path + name: group_id + required: true + schema: + format: uuid + type: string + style: simple + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/GroupContainingGroup" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GroupContainingGroup" + description: The created `GroupContainingGroup` object. + security: + - BearerAuth: [] + tags: + - groups + /groups/{group_id}/containing-groups/{containing_group_id}: + get: + description: Gets a specific containing group for a group. + operationId: get_group_containing_group + parameters: + - description: The ID of the group. + example: 4baf8423-db0a-4037-a4cf-f79c60cb67a5 + explode: false + in: path + name: group_id + required: true + schema: + format: uuid + type: string + style: simple + - description: The ID of the containing group. + example: 4baf8423-db0a-4037-a4cf-f79c60cb67a5 + explode: false + in: path + name: containing_group_id + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/GroupContainingGroup" + description: The created `GroupContainingGroup` object. + security: + - BearerAuth: [] + tags: + - groups + delete: + description: Removes a containing group from a group. + operationId: remove_group_containing_group + parameters: + - description: The ID of the group. + example: 4baf8423-db0a-4037-a4cf-f79c60cb67a5 + explode: false + in: path + name: group_id + required: true + schema: + format: uuid + type: string + style: simple + - description: The ID of the containing group. + example: 4baf8423-db0a-4037-a4cf-f79c60cb67a5 + explode: false + in: path + name: containing_group_id + required: true + schema: + format: uuid + type: string + style: simple + responses: + "204": + description: The containing group was successfully removed from the group. + security: + - BearerAuth: [] + tags: + - groups /groups/{group_id}/resources/{resource_id}: post: description: Adds a resource to a group. @@ -2144,55 +2692,109 @@ paths: format: uuid type: string style: simple - - description: The duration for which the resource can be accessed (in minutes). Use 0 to set to indefinite. - example: 60 - explode: true - in: query - name: duration_minutes - required: false - schema: - type: integer - maximum: 525960 # One year - style: form - deprecated: true - - description: The remote ID of the access level to grant to this user. If omitted, the default access level remote ID value (empty string) is used. - example: arn:aws:iam::590304332660:role/AdministratorAccess - explode: true - in: query - name: access_level_remote_id - required: false - schema: - type: string - style: form - deprecated: true + - description: The duration for which the resource can be accessed (in minutes). Use 0 to set to indefinite. + example: 60 + explode: true + in: query + name: duration_minutes + required: false + schema: + type: integer + maximum: 525960 # One year + style: form + deprecated: true + - description: The remote ID of the access level to grant to this user. If omitted, the default access level remote ID value (empty string) is used. + example: arn:aws:iam::590304332660:role/AdministratorAccess + explode: true + in: query + name: access_level_remote_id + required: false + schema: + type: string + style: form + deprecated: true + requestBody: + required: false + content: + application/json: + schema: + example: + duration_minutes: 60 + access_level_remote_id: arn:aws:iam::590304332660:role/AdministratorAccess + properties: + duration_minutes: + description: The duration for which the resource can be accessed (in minutes). Use 0 to set to indefinite. + example: 60 + type: integer + maximum: 525960 # One year + access_level_remote_id: + description: The remote ID of the access level to grant to this user. If omitted, the default access level remote ID value (empty string) is used. + example: arn:aws:iam::590304332660:role/AdministratorAccess + type: string + required: + - duration_minutes + type: object + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ResourceUser" + description: The ResourceUser that was created. + security: + - BearerAuth: [] + tags: + - resources + put: + description: Updates a user's access level or duration on this resource. + operationId: update_resource_user + parameters: + - description: The ID of the resource. + example: 4baf8423-db0a-4037-a4cf-f79c60cb67a5 + in: path + name: resource_id + required: true + schema: + format: uuid + type: string + style: simple + - description: The ID of the user whose access is being updated. + example: f92aa855-cea9-4814-b9d8-f2a60d3e4a06 + in: path + name: user_id + required: true + schema: + format: uuid + type: string + style: simple requestBody: - required: false + required: true content: application/json: schema: + type: object example: duration_minutes: 60 access_level_remote_id: arn:aws:iam::590304332660:role/AdministratorAccess properties: duration_minutes: - description: The duration for which the resource can be accessed (in minutes). Use 0 to set to indefinite. - example: 60 + description: The updated duration for which the resource can be accessed (in minutes). Use 0 for indefinite. type: integer maximum: 525960 # One year + example: 120 access_level_remote_id: - description: The remote ID of the access level to grant to this user. If omitted, the default access level remote ID value (empty string) is used. - example: arn:aws:iam::590304332660:role/AdministratorAccess + description: The updated remote ID of the access level granted to this user. type: string + example: arn:aws:iam::590304332660:role/ReadOnlyAccess required: - duration_minutes - type: object responses: "200": + description: The ResourceUser was successfully updated. content: application/json: schema: $ref: "#/components/schemas/ResourceUser" - description: The ResourceUser that was created. security: - BearerAuth: [] tags: @@ -2458,6 +3060,63 @@ paths: - BearerAuth: [] tags: - users + /access-rules/{access_rule_id}: + get: + description: Returns a list of access rule config given the group_id of the access rule. + operationId: get_access_rule + parameters: + - description: The access rule ID (group ID) of the access rule. + example: 1b978423-db0a-4037-a4cf-f79c60cb67b3 + explode: false + in: path + name: access_rule_id + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/AccessRuleCondition" + description: The access rules for the group. + security: + - BearerAuth: [] + tags: + - access-rules + put: + description: Updates the access rule config for the given group_id. + operationId: update_access_rule + parameters: + - description: The access rule ID (group ID) of the access rule. + example: 1b978423-db0a-4037-a4cf-f79c60cb67b3 + explode: false + in: path + name: access_rule_id + required: true + schema: + format: uuid + type: string + style: simple + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/AccessRuleCondition" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/AccessRuleCondition" + description: The updated access rule config for the group. + security: + - BearerAuth: [] + tags: + - access-rules /tag/{tag_id}: get: description: UNSTABLE. May be removed at any time. Gets a tag with the given id. @@ -4041,11 +4700,11 @@ components: previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ results: - user_id: 29827fb8-f2dd-4e80-9576-28e31e9934ac - email: 1b978423-db0a-4037-a4cf-f79c60cb67b3 + email: john.doe@company.dev full_name: John Doe position: Senior Engineer - user_id: e8581682-04f7-473a-a419-472f0fb26d46 - email: 186511e5-5b5a-4ad7-a4ad-b6c8694a544a + email: jane.smith@company.dev full_name: Jane Smith position: Product Marketing Lead properties: @@ -4078,7 +4737,7 @@ components: Fetch from the `LIST Sessions` endpoint. example: user_id: 29827fb8-f2dd-4e80-9576-28e31e9934ac - email: 1b978423-db0a-4037-a4cf-f79c60cb67b3 + email: john.doe@company.dev full_name: John Doe first_name: John last_name: Doe @@ -4091,7 +4750,7 @@ components: type: string email: description: The email of the user. - example: 29827fb8-f2dd-4e80-9576-28e31e9934ac + example: john.doe@company.dev type: string full_name: description: The full name of the user. @@ -4219,6 +4878,22 @@ components: - resource_id - access_level type: object + GroupContainingGroup: + description: |- + # GroupContainingGroup Object + ### Description + The `GroupContainingGroup` object is used to represent a relationship between a group and a group. + example: + containing_group_id: f454d283-ca87-4a8a-bdbb-df212eca5353 + properties: + containing_group_id: + description: The groupID of the containing group. + example: f454d283-ca87-4a8a-bdbb-df212eca5353 + format: uuid + type: string + required: + - containing_group_id + type: object Group: description: |- # Group Object @@ -4835,6 +5510,24 @@ components: required: - resource_id type: object + GroupWithAccessLevel: + description: Information about a group and corresponding access level + example: + group_id: 7870617d-e72a-47f5-a84c-693817ab4567 + access_level_remote_id: "write" + properties: + group_id: + description: The ID of the group. + example: 7870617d-e72a-47f5-a84c-693817ab4567 + format: uuid + type: string + access_level_remote_id: + description: The ID of the resource. + example: write + type: string + required: + - group_id + type: object GroupResourceList: example: group_resources: @@ -4852,6 +5545,19 @@ components: type: object required: - group_resources + GroupContainingGroupList: + example: + containing_groups: + - containing_group_id: 7870617d-e72a-47f5-a84c-693817ab4567 + - containing_group_id: 50333e67-73ce-47ab-b049-d8abcd45f7a1 + properties: + containing_groups: + items: + $ref: "#/components/schemas/GroupContainingGroup" + type: array + type: object + required: + - containing_groups MessageChannelList: example: channels: @@ -5871,6 +6577,34 @@ components: - resource_type - app_id type: object + CreateBundleInfo: + description: |- + # CreateBundleInfo Object + ### Description + The `CreateBundleInfo` object is used to store creation info for a bundle. + + ### Usage Example + Use in the `POST Bundles` endpoint. + example: + name: Engineering Team Bundle + description: Engineering team bundle. + admin_owner_id: 7870617d-e72a-47f5-a84c-693817ab4567 + properties: + name: + type: string + description: The name of the bundle. + example: "Test Bundle" + description: + type: string + description: A brief description of the bundle. + example: "This is a test bundle" + admin_owner_id: + type: string + description: The ID of the bundle's admin owner. + example: "7c86c85d-0651-43e2-a748-d69d658418e8" + required: + - name + - admin_owner_id CreateGroupInfo: description: |- # CreateGroupInfo Object @@ -6945,6 +7679,66 @@ components: - group_id - group_type type: object + AccessRuleCondition: + description: |- + # Access Rule Config Object + ### Description + The `AccessRuleConfig` object is used to represent an access rule configuration. + + ### Usage Example + Get access rule configurations from the `GET Access Rule Configs` endpoint. + properties: + status: + description: The status of the access rule. + type: string + enum: + - ACTIVE + - PAUSED + example: ACTIVE + ruleClauses: + $ref: "#/components/schemas/RuleClauses" + required: + - status + - ruleClauses + RuleClauses: + properties: + when: + $ref: "#/components/schemas/RuleConjunction" + unless: + $ref: "#/components/schemas/RuleConjunction" + required: + - when + RuleConjunction: + properties: + clauses: + type: array + minItems: 1 + items: + $ref: "#/components/schemas/RuleDisjunction" + required: + - clauses + RuleDisjunction: + properties: + selectors: + type: array + minItems: 1 + items: + $ref: "#/components/schemas/TagSelector" + required: + - selectors + TagSelector: + properties: + key: + type: string + value: + type: string + connection_id: + type: string + format: uuid + required: + - key + - value + - connection_id PaginatedOwnersList: example: next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw @@ -7848,6 +8642,200 @@ components: - last_seen - error_message type: object + Bundle: + properties: + bundle_id: + description: The ID of the bundle. + example: a381e7a3-e5e0-4c48-b1d6-4ccb4c191bc1 + format: uuid + type: string + readOnly: true + name: + description: The name of the bundle. + example: Bundle 1 + type: string + description: + description: The description of the bundle. + example: Description of bundle 1 + type: string + created_at: + type: string + format: date-time + description: The creation timestamp of the bundle, in ISO 8601 format + readOnly: true + updated_at: + type: string + format: date-time + description: The last updated timestamp of the bundle, in ISO 8601 format + readOnly: true + admin_owner_id: + description: The ID of the owner of the bundle. + example: 4aed3e8a-727b-4d72-8010-3b8710c50bec + format: uuid + type: string + total_num_items: + description: The total number of items in the bundle. + example: 15 + type: integer + readOnly: true + total_num_resources: + description: The total number of resources in the bundle. + example: 10 + type: integer + readOnly: true + total_num_groups: + description: The total number of groups in the bundle. + example: 5 + type: integer + readOnly: true + PaginatedBundleList: + example: + next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + totalCount: 2 + bundles: + - id: a381e7a3-e5e0-4c48-b1d6-4ccb4c191bc1 + name: Bundle 1 + description: Description of bundle 1 + admin_owner_id: 4aed3e8a-727b-4d72-8010-3b8710c50bec + total_num_items: 0 + total_num_resources: 0 + total_num_groups: 0 + - id: 8294e9c9-deb6-48e9-9c99-da2a1e04a87f + name: Bundle 2 + description: Description of bundle 2 + admin_owner_id: 4aed3e8a-727b-4d72-8010-3b8710c50bec + total_num_items: 0 + total_num_resources: 0 + total_num_groups: 0 + properties: + previous: + description: The cursor used to obtain the current result page. + example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + nullable: true + type: string + next: + description: + The cursor with which to continue pagination if additional + result pages exist. + example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + nullable: true + type: string + total_count: + description: The total number of items in the result set. + example: 2 + type: integer + bundles: + items: + $ref: "#/components/schemas/Bundle" + type: array + type: object + required: + - bundles + BundleResource: + properties: + bundle_id: + description: The ID of the bundle containing the resource. + example: a381e7a3-e5e0-4c48-b1d6-4ccb4c191bc1 + format: uuid + type: string + readOnly: true + resource_id: + description: The ID of the resource within a bundle. + example: a381e7a3-e5e0-4c48-b1d6-4ccb4c191bc1 + format: uuid + type: string + readOnly: true + access_level_name: + description: The access level of the resource within a bundle. + example: Read + type: string + access_level_remote_id: + description: The remote ID of the access level of the resource within a bundle. + example: arn:aws:iam::490306337630:role/SupportUser + type: string + PaginatedBundleResourceList: + example: + next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + total_count: 3 + bundle_resources: + - id: a381e7a3-e5e0-4c48-b1d6-4ccb4c191bc1 + name: Resource 1 + access_level_name: read + access_level_remote_id: pull + properties: + previous: + description: The cursor used to obtain the current result page. + example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + nullable: true + type: string + next: + description: + The cursor with which to continue pagination if additional + result pages exist. + example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + nullable: true + type: string + total_count: + description: The total number of items in the result set. + example: 2 + type: integer + bundle_resources: + items: + $ref: "#/components/schemas/BundleResource" + type: array + type: object + required: + - bundle_resources + BundleGroup: + properties: + bundle_id: + description: The ID of the bundle containing the group. + example: a381e7a3-e5e0-4c48-b1d6-4ccb4c191bc1 + format: uuid + type: string + readOnly: true + group_id: + description: The ID of the group within a bundle. + example: a381e7a3-e5e0-4c48-b1d6-4ccb4c191bc1 + format: uuid + type: string + readOnly: true + PaginatedBundleGroupList: + example: + next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + total_count: 2 + bundle_groups: + - id: a381e7a3-e5e0-4c48-b1d6-4ccb4c191bc1 + name: Group 1 + - id: 8294e9c9-deb6-48e9-9c99-da2a1e04a87f + name: Group 2 + properties: + previous: + description: The cursor used to obtain the current result page. + example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + nullable: true + type: string + next: + description: + The cursor with which to continue pagination if additional + result pages exist. + example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + nullable: true + type: string + total_count: + description: The total number of items in the result set. + example: 2 + type: integer + bundle_groups: + items: + $ref: "#/components/schemas/BundleGroup" + type: array + type: object + required: + - bundle_groups securitySchemes: BearerAuth: scheme: bearer diff --git a/docs/AccessRuleCondition.md b/docs/AccessRuleCondition.md new file mode 100644 index 0000000..5095ee4 --- /dev/null +++ b/docs/AccessRuleCondition.md @@ -0,0 +1,31 @@ +# AccessRuleCondition + +# Access Rule Config Object ### Description The `AccessRuleConfig` object is used to represent an access rule configuration. ### Usage Example Get access rule configurations from the `GET Access Rule Configs` endpoint. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | The status of the access rule. | +**rule_clauses** | [**RuleClauses**](RuleClauses.md) | | + +## Example + +```python +from opal_security.models.access_rule_condition import AccessRuleCondition + +# TODO update the JSON string below +json = "{}" +# create an instance of AccessRuleCondition from a JSON string +access_rule_condition_instance = AccessRuleCondition.from_json(json) +# print the JSON string representation of the object +print(AccessRuleCondition.to_json()) + +# convert the object into a dict +access_rule_condition_dict = access_rule_condition_instance.to_dict() +# create an instance of AccessRuleCondition from a dict +access_rule_condition_from_dict = AccessRuleCondition.from_dict(access_rule_condition_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/AccessRulesApi.md b/docs/AccessRulesApi.md new file mode 100644 index 0000000..c63ffad --- /dev/null +++ b/docs/AccessRulesApi.md @@ -0,0 +1,166 @@ +# opal_security.AccessRulesApi + +All URIs are relative to *https://api.opal.dev/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_access_rule**](AccessRulesApi.md#get_access_rule) | **GET** /access-rules/{access_rule_id} | +[**update_access_rule**](AccessRulesApi.md#update_access_rule) | **PUT** /access-rules/{access_rule_id} | + + +# **get_access_rule** +> AccessRuleCondition get_access_rule(access_rule_id) + +Returns a list of access rule config given the group_id of the access rule. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import opal_security +from opal_security.models.access_rule_condition import AccessRuleCondition +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) + access_rule_id = '1b978423-db0a-4037-a4cf-f79c60cb67b3' # str | The access rule ID (group ID) of the access rule. + + try: + api_response = api_instance.get_access_rule(access_rule_id) + print("The response of AccessRulesApi->get_access_rule:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccessRulesApi->get_access_rule: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **access_rule_id** | **str**| The access rule ID (group ID) of the access rule. | + +### Return type + +[**AccessRuleCondition**](AccessRuleCondition.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The access rules for the group. | - | + +[[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** +> AccessRuleCondition update_access_rule(access_rule_id, access_rule_condition) + +Updates the access rule config for the given group_id. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import opal_security +from opal_security.models.access_rule_condition import AccessRuleCondition +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) + access_rule_id = '1b978423-db0a-4037-a4cf-f79c60cb67b3' # str | The access rule ID (group ID) of the access rule. + access_rule_condition = opal_security.AccessRuleCondition() # AccessRuleCondition | + + try: + api_response = api_instance.update_access_rule(access_rule_id, access_rule_condition) + print("The response of AccessRulesApi->update_access_rule:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccessRulesApi->update_access_rule: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **access_rule_id** | **str**| The access rule ID (group ID) of the access rule. | + **access_rule_condition** | [**AccessRuleCondition**](AccessRuleCondition.md)| | + +### Return type + +[**AccessRuleCondition**](AccessRuleCondition.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The updated access rule config for the group. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/AddBundleGroupRequest.md b/docs/AddBundleGroupRequest.md new file mode 100644 index 0000000..cad701f --- /dev/null +++ b/docs/AddBundleGroupRequest.md @@ -0,0 +1,29 @@ +# AddBundleGroupRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**group_id** | **str** | The ID of the group to add. | + +## Example + +```python +from opal_security.models.add_bundle_group_request import AddBundleGroupRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of AddBundleGroupRequest from a JSON string +add_bundle_group_request_instance = AddBundleGroupRequest.from_json(json) +# print the JSON string representation of the object +print(AddBundleGroupRequest.to_json()) + +# convert the object into a dict +add_bundle_group_request_dict = add_bundle_group_request_instance.to_dict() +# create an instance of AddBundleGroupRequest from a dict +add_bundle_group_request_from_dict = AddBundleGroupRequest.from_dict(add_bundle_group_request_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/AddBundleResourceRequest.md b/docs/AddBundleResourceRequest.md new file mode 100644 index 0000000..1e9cc63 --- /dev/null +++ b/docs/AddBundleResourceRequest.md @@ -0,0 +1,31 @@ +# AddBundleResourceRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resource_id** | **str** | The ID of the resource to add. | +**access_level_remote_id** | **str** | The remote ID of the access level to grant to this user. Required if the resource being added requires an access level. If omitted, the default access level remote ID value (empty string) is used. | [optional] +**access_level_name** | **str** | The name of the access level to grant to this user. If omitted, the default access level name value (empty string) is used. | [optional] + +## Example + +```python +from opal_security.models.add_bundle_resource_request import AddBundleResourceRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of AddBundleResourceRequest from a JSON string +add_bundle_resource_request_instance = AddBundleResourceRequest.from_json(json) +# print the JSON string representation of the object +print(AddBundleResourceRequest.to_json()) + +# convert the object into a dict +add_bundle_resource_request_dict = add_bundle_resource_request_instance.to_dict() +# create an instance of AddBundleResourceRequest from a dict +add_bundle_resource_request_from_dict = AddBundleResourceRequest.from_dict(add_bundle_resource_request_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/AppsApi.md b/docs/AppsApi.md index 41adb4f..4356bc4 100644 --- a/docs/AppsApi.md +++ b/docs/AppsApi.md @@ -12,8 +12,6 @@ Method | HTTP request | Description # **get_app** > App get_app(app_id) - - Returns an `App` object. ### Example @@ -91,8 +89,6 @@ Name | Type | Description | Notes # **get_apps** > AppsList get_apps(app_type_filter=app_type_filter, owner_filter=owner_filter) - - Returns a list of `App` objects. ### Example @@ -173,8 +169,6 @@ Name | Type | Description | Notes # **get_sync_errors** > List[SyncErrorList] get_sync_errors(app_id=app_id, resource_id=resource_id, group_id=group_id) - - Returns a list of recent sync errors that have occurred since the last successful sync. ### Example diff --git a/docs/Bundle.md b/docs/Bundle.md new file mode 100644 index 0000000..320cab4 --- /dev/null +++ b/docs/Bundle.md @@ -0,0 +1,37 @@ +# Bundle + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bundle_id** | **str** | The ID of the bundle. | [optional] [readonly] +**name** | **str** | The name of the bundle. | [optional] +**description** | **str** | The description of the bundle. | [optional] +**created_at** | **datetime** | The creation timestamp of the bundle, in ISO 8601 format | [optional] [readonly] +**updated_at** | **datetime** | The last updated timestamp of the bundle, in ISO 8601 format | [optional] [readonly] +**admin_owner_id** | **str** | The ID of the owner of the bundle. | [optional] +**total_num_items** | **int** | The total number of items in the bundle. | [optional] [readonly] +**total_num_resources** | **int** | The total number of resources in the bundle. | [optional] [readonly] +**total_num_groups** | **int** | The total number of groups in the bundle. | [optional] [readonly] + +## Example + +```python +from opal_security.models.bundle import Bundle + +# TODO update the JSON string below +json = "{}" +# create an instance of Bundle from a JSON string +bundle_instance = Bundle.from_json(json) +# print the JSON string representation of the object +print(Bundle.to_json()) + +# convert the object into a dict +bundle_dict = bundle_instance.to_dict() +# create an instance of Bundle from a dict +bundle_from_dict = Bundle.from_dict(bundle_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/BundleGroup.md b/docs/BundleGroup.md new file mode 100644 index 0000000..938da16 --- /dev/null +++ b/docs/BundleGroup.md @@ -0,0 +1,30 @@ +# BundleGroup + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bundle_id** | **str** | The ID of the bundle containing the group. | [optional] [readonly] +**group_id** | **str** | The ID of the group within a bundle. | [optional] [readonly] + +## Example + +```python +from opal_security.models.bundle_group import BundleGroup + +# TODO update the JSON string below +json = "{}" +# create an instance of BundleGroup from a JSON string +bundle_group_instance = BundleGroup.from_json(json) +# print the JSON string representation of the object +print(BundleGroup.to_json()) + +# convert the object into a dict +bundle_group_dict = bundle_group_instance.to_dict() +# create an instance of BundleGroup from a dict +bundle_group_from_dict = BundleGroup.from_dict(bundle_group_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BundleResource.md b/docs/BundleResource.md new file mode 100644 index 0000000..85b9285 --- /dev/null +++ b/docs/BundleResource.md @@ -0,0 +1,32 @@ +# BundleResource + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bundle_id** | **str** | The ID of the bundle containing the resource. | [optional] [readonly] +**resource_id** | **str** | The ID of the resource within a bundle. | [optional] [readonly] +**access_level_name** | **str** | The access level of the resource within a bundle. | [optional] +**access_level_remote_id** | **str** | The remote ID of the access level of the resource within a bundle. | [optional] + +## Example + +```python +from opal_security.models.bundle_resource import BundleResource + +# TODO update the JSON string below +json = "{}" +# create an instance of BundleResource from a JSON string +bundle_resource_instance = BundleResource.from_json(json) +# print the JSON string representation of the object +print(BundleResource.to_json()) + +# convert the object into a dict +bundle_resource_dict = bundle_resource_instance.to_dict() +# create an instance of BundleResource from a dict +bundle_resource_from_dict = BundleResource.from_dict(bundle_resource_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BundlesApi.md b/docs/BundlesApi.md new file mode 100644 index 0000000..f0495b6 --- /dev/null +++ b/docs/BundlesApi.md @@ -0,0 +1,1041 @@ +# opal_security.BundlesApi + +All URIs are relative to *https://api.opal.dev/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_bundle_group**](BundlesApi.md#add_bundle_group) | **POST** /bundles/{bundle_id}/groups | +[**add_bundle_resource**](BundlesApi.md#add_bundle_resource) | **POST** /bundles/{bundle_id}/resources | +[**create_bundle**](BundlesApi.md#create_bundle) | **POST** /bundles | +[**delete_bundle**](BundlesApi.md#delete_bundle) | **DELETE** /bundles/{bundle_id} | +[**get_bundle**](BundlesApi.md#get_bundle) | **GET** /bundles/{bundle_id} | +[**get_bundle_groups**](BundlesApi.md#get_bundle_groups) | **GET** /bundles/{bundle_id}/groups | +[**get_bundle_resources**](BundlesApi.md#get_bundle_resources) | **GET** /bundles/{bundle_id}/resources | +[**get_bundle_visibility**](BundlesApi.md#get_bundle_visibility) | **GET** /bundles/{bundle_id}/visibility | +[**get_bundles**](BundlesApi.md#get_bundles) | **GET** /bundles | +[**remove_bundle_group**](BundlesApi.md#remove_bundle_group) | **DELETE** /bundles/{bundle_id}/groups/{group_id} | +[**remove_bundle_resource**](BundlesApi.md#remove_bundle_resource) | **DELETE** /bundles/{bundle_id}/resources/{resource_id} | +[**set_bundle_visibility**](BundlesApi.md#set_bundle_visibility) | **PUT** /bundles/{bundle_id}/visibility | +[**update_bundle**](BundlesApi.md#update_bundle) | **PUT** /bundles/{bundle_id} | + + +# **add_bundle_group** +> BundleGroup add_bundle_group(bundle_id, add_bundle_group_request) + +Adds a group to a bundle. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import opal_security +from opal_security.models.add_bundle_group_request import AddBundleGroupRequest +from opal_security.models.bundle_group import BundleGroup +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.BundlesApi(api_client) + bundle_id = '32acc112-21ff-4669-91c2-21e27683eaa1' # str | The ID of the bundle. + add_bundle_group_request = opal_security.AddBundleGroupRequest() # AddBundleGroupRequest | + + try: + api_response = api_instance.add_bundle_group(bundle_id, add_bundle_group_request) + print("The response of BundlesApi->add_bundle_group:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BundlesApi->add_bundle_group: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bundle_id** | **str**| The ID of the bundle. | + **add_bundle_group_request** | [**AddBundleGroupRequest**](AddBundleGroupRequest.md)| | + +### Return type + +[**BundleGroup**](BundleGroup.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Group was successfully added to the bundle. | - | + +[[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) + +# **add_bundle_resource** +> BundleResource add_bundle_resource(bundle_id, add_bundle_resource_request=add_bundle_resource_request) + +Adds a resource to a bundle. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import opal_security +from opal_security.models.add_bundle_resource_request import AddBundleResourceRequest +from opal_security.models.bundle_resource import BundleResource +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.BundlesApi(api_client) + bundle_id = '32acc112-21ff-4669-91c2-21e27683eaa1' # str | The ID of the bundle. + add_bundle_resource_request = opal_security.AddBundleResourceRequest() # AddBundleResourceRequest | (optional) + + try: + api_response = api_instance.add_bundle_resource(bundle_id, add_bundle_resource_request=add_bundle_resource_request) + print("The response of BundlesApi->add_bundle_resource:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BundlesApi->add_bundle_resource: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bundle_id** | **str**| The ID of the bundle. | + **add_bundle_resource_request** | [**AddBundleResourceRequest**](AddBundleResourceRequest.md)| | [optional] + +### Return type + +[**BundleResource**](BundleResource.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Resource was successfully added to the bundle. | - | + +[[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) + +# **create_bundle** +> Bundle create_bundle(create_bundle_info) + +Creates a bundle. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import opal_security +from opal_security.models.bundle import Bundle +from opal_security.models.create_bundle_info import CreateBundleInfo +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.BundlesApi(api_client) + create_bundle_info = opal_security.CreateBundleInfo() # CreateBundleInfo | + + try: + api_response = api_instance.create_bundle(create_bundle_info) + print("The response of BundlesApi->create_bundle:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BundlesApi->create_bundle: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **create_bundle_info** | [**CreateBundleInfo**](CreateBundleInfo.md)| | + +### Return type + +[**Bundle**](Bundle.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | The bundle successfully created. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_bundle** +> delete_bundle(bundle_id) + +Deletes a bundle. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import opal_security +from opal_security.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +import opal_security as opal + +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with opal_security.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = opal_security.BundlesApi(api_client) + bundle_id = '32acc112-21ff-4669-91c2-21e27683eaa1' # str | The ID of the bundle. + + try: + api_instance.delete_bundle(bundle_id) + except Exception as e: + print("Exception when calling BundlesApi->delete_bundle: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bundle_id** | **str**| The ID of the bundle. | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The bundle was successfully deleted. | - | + +[[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_bundle** +> Bundle get_bundle(bundle_id) + +Returns a `Bundle` object. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import opal_security +from opal_security.models.bundle import Bundle +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.BundlesApi(api_client) + bundle_id = '32acc112-21ff-4669-91c2-21e27683eaa1' # str | The ID of the bundle. + + try: + api_response = api_instance.get_bundle(bundle_id) + print("The response of BundlesApi->get_bundle:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BundlesApi->get_bundle: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bundle_id** | **str**| The ID of the bundle. | + +### Return type + +[**Bundle**](Bundle.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The requested `Bundle`. | - | + +[[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_bundle_groups** +> PaginatedBundleGroupList get_bundle_groups(bundle_id, page_size=page_size, cursor=cursor) + +Returns a list of `Group` objects in a given bundle. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import opal_security +from opal_security.models.paginated_bundle_group_list import PaginatedBundleGroupList +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.BundlesApi(api_client) + bundle_id = '32acc112-21ff-4669-91c2-21e27683eaa1' # str | The ID of the bundle. + page_size = 200 # int | The maximum number of groups to return from the beginning of the list. Default is 200, max is 1000. (optional) + cursor = 'cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw' # str | A cursor indicating where to start fetching items after a specific point. (optional) + + try: + api_response = api_instance.get_bundle_groups(bundle_id, page_size=page_size, cursor=cursor) + print("The response of BundlesApi->get_bundle_groups:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BundlesApi->get_bundle_groups: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bundle_id** | **str**| The ID of the bundle. | + **page_size** | **int**| The maximum number of groups to return from the beginning of the list. Default is 200, max is 1000. | [optional] + **cursor** | **str**| A cursor indicating where to start fetching items after a specific point. | [optional] + +### Return type + +[**PaginatedBundleGroupList**](PaginatedBundleGroupList.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A list of groups for the bundle. | - | + +[[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_bundle_resources** +> PaginatedBundleResourceList get_bundle_resources(bundle_id, page_size=page_size, cursor=cursor) + +Returns a list of `Resource` objects in a given bundle. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import opal_security +from opal_security.models.paginated_bundle_resource_list import PaginatedBundleResourceList +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.BundlesApi(api_client) + bundle_id = '32acc112-21ff-4669-91c2-21e27683eaa1' # str | The ID of the bundle. + page_size = 200 # int | The maximum number of resources to return from the beginning of the list. Default is 200, max is 1000. (optional) + cursor = 'cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw' # str | A cursor indicating where to start fetching items after a specific point. (optional) + + try: + api_response = api_instance.get_bundle_resources(bundle_id, page_size=page_size, cursor=cursor) + print("The response of BundlesApi->get_bundle_resources:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BundlesApi->get_bundle_resources: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bundle_id** | **str**| The ID of the bundle. | + **page_size** | **int**| The maximum number of resources to return from the beginning of the list. Default is 200, max is 1000. | [optional] + **cursor** | **str**| A cursor indicating where to start fetching items after a specific point. | [optional] + +### Return type + +[**PaginatedBundleResourceList**](PaginatedBundleResourceList.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A list of resources for the bundle. | - | + +[[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_bundle_visibility** +> VisibilityInfo get_bundle_visibility(bundle_id) + +Gets the visibility of the bundle. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import opal_security +from opal_security.models.visibility_info import VisibilityInfo +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.BundlesApi(api_client) + bundle_id = '32acc112-21ff-4669-91c2-21e27683eaa1' # str | The ID of the bundle. + + try: + api_response = api_instance.get_bundle_visibility(bundle_id) + print("The response of BundlesApi->get_bundle_visibility:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BundlesApi->get_bundle_visibility: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bundle_id** | **str**| The ID of the bundle. | + +### Return type + +[**VisibilityInfo**](VisibilityInfo.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The visibility details of a bundle. | - | + +[[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_bundles** +> PaginatedBundleList get_bundles(page_size=page_size, cursor=cursor, contains=contains) + +Returns a list of `Bundle` objects. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import opal_security +from opal_security.models.paginated_bundle_list import PaginatedBundleList +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.BundlesApi(api_client) + page_size = 200 # int | The maximum number of bundles to return from the beginning of the list. Default is 200, max is 1000. (optional) + cursor = 'cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw' # str | A cursor indicating where to start fetching items after a specific point. (optional) + contains = 'Engineering' # str | A filter for the bundle name. (optional) + + try: + api_response = api_instance.get_bundles(page_size=page_size, cursor=cursor, contains=contains) + print("The response of BundlesApi->get_bundles:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BundlesApi->get_bundles: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page_size** | **int**| The maximum number of bundles to return from the beginning of the list. Default is 200, max is 1000. | [optional] + **cursor** | **str**| A cursor indicating where to start fetching items after a specific point. | [optional] + **contains** | **str**| A filter for the bundle name. | [optional] + +### Return type + +[**PaginatedBundleList**](PaginatedBundleList.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A list of bundles 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) + +# **remove_bundle_group** +> remove_bundle_group(bundle_id, group_id) + +Removes a group from a bundle. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import opal_security +from opal_security.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +import opal_security as opal + +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with opal_security.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = opal_security.BundlesApi(api_client) + bundle_id = '32acc112-21ff-4669-91c2-21e27683eaa1' # str | The ID of the bundle. + group_id = '72e75a6f-7183-48c5-94ff-6013f213314b' # str | The ID of the group to remove. + + try: + api_instance.remove_bundle_group(bundle_id, group_id) + except Exception as e: + print("Exception when calling BundlesApi->remove_bundle_group: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bundle_id** | **str**| The ID of the bundle. | + **group_id** | **str**| The ID of the group to remove. | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Group was successfully removed from the bundle. | - | + +[[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) + +# **remove_bundle_resource** +> remove_bundle_resource(bundle_id, resource_id, access_level_remote_id=access_level_remote_id) + +Removes a resource from a bundle. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import opal_security +from opal_security.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +import opal_security as opal + +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with opal_security.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = opal_security.BundlesApi(api_client) + bundle_id = '32acc112-21ff-4669-91c2-21e27683eaa1' # str | The ID of the bundle. + resource_id = '72e75a6f-7183-48c5-94ff-6013f213314b' # str | The ID of the resource to remove. + access_level_remote_id = 'arn:aws:iam::590304332660:role/AdministratorAccess' # str | The remote ID of the access level to grant. If omitted, the default access level remote ID value (empty string) is used. (optional) + + try: + api_instance.remove_bundle_resource(bundle_id, resource_id, access_level_remote_id=access_level_remote_id) + except Exception as e: + print("Exception when calling BundlesApi->remove_bundle_resource: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bundle_id** | **str**| The ID of the bundle. | + **resource_id** | **str**| The ID of the resource to remove. | + **access_level_remote_id** | **str**| The remote ID of the access level to grant. If omitted, the default access level remote ID value (empty string) is used. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Resource was successfully removed from the bundle. | - | + +[[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) + +# **set_bundle_visibility** +> set_bundle_visibility(bundle_id, visibility_info) + +Sets the visibility of the bundle. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import opal_security +from opal_security.models.visibility_info import VisibilityInfo +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.BundlesApi(api_client) + bundle_id = '32acc112-21ff-4669-91c2-21e27683eaa1' # str | The ID of the bundle. + visibility_info = opal_security.VisibilityInfo() # VisibilityInfo | + + try: + api_instance.set_bundle_visibility(bundle_id, visibility_info) + except Exception as e: + print("Exception when calling BundlesApi->set_bundle_visibility: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bundle_id** | **str**| The ID of the bundle. | + **visibility_info** | [**VisibilityInfo**](VisibilityInfo.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The visibility details of the bundle were successfully set. | - | + +[[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_bundle** +> Bundle update_bundle(bundle_id, bundle) + +Updates a bundle. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import opal_security +from opal_security.models.bundle import Bundle +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.BundlesApi(api_client) + bundle_id = '32acc112-21ff-4669-91c2-21e27683eaa1' # str | The ID of the bundle to be updated. + bundle = opal_security.Bundle() # Bundle | + + try: + api_response = api_instance.update_bundle(bundle_id, bundle) + print("The response of BundlesApi->update_bundle:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BundlesApi->update_bundle: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bundle_id** | **str**| The ID of the bundle to be updated. | + **bundle** | [**Bundle**](Bundle.md)| | + +### Return type + +[**Bundle**](Bundle.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The bundle was successfully updated. | - | +**204** | No changes detected (no-op) | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/ConfigurationTemplatesApi.md b/docs/ConfigurationTemplatesApi.md index c10b46f..dcd8712 100644 --- a/docs/ConfigurationTemplatesApi.md +++ b/docs/ConfigurationTemplatesApi.md @@ -13,8 +13,6 @@ Method | HTTP request | Description # **create_configuration_template** > ConfigurationTemplate create_configuration_template(create_configuration_template_info) - - Creates a configuration template. ### Example @@ -93,8 +91,6 @@ Name | Type | Description | Notes # **delete_configuration_template** > delete_configuration_template(configuration_template_id) - - Deletes a configuration template. ### Example @@ -169,8 +165,6 @@ void (empty response body) # **get_configuration_templates** > PaginatedConfigurationTemplateList get_configuration_templates() - - Returns a list of `ConfigurationTemplate` objects. ### Example @@ -244,8 +238,6 @@ This endpoint does not need any parameter. # **update_configuration_template** > ConfigurationTemplate update_configuration_template(update_configuration_template_info) - - Update a configuration template. ### Example diff --git a/docs/CreateBundleInfo.md b/docs/CreateBundleInfo.md new file mode 100644 index 0000000..c4a52e1 --- /dev/null +++ b/docs/CreateBundleInfo.md @@ -0,0 +1,32 @@ +# CreateBundleInfo + +# CreateBundleInfo Object ### Description The `CreateBundleInfo` object is used to store creation info for a bundle. ### Usage Example Use in the `POST Bundles` endpoint. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The name of the bundle. | +**description** | **str** | A brief description of the bundle. | [optional] +**admin_owner_id** | **str** | The ID of the bundle's admin owner. | + +## Example + +```python +from opal_security.models.create_bundle_info import CreateBundleInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateBundleInfo from a JSON string +create_bundle_info_instance = CreateBundleInfo.from_json(json) +# print the JSON string representation of the object +print(CreateBundleInfo.to_json()) + +# convert the object into a dict +create_bundle_info_dict = create_bundle_info_instance.to_dict() +# create an instance of CreateBundleInfo from a dict +create_bundle_info_from_dict = CreateBundleInfo.from_dict(create_bundle_info_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/EventsApi.md b/docs/EventsApi.md index 583435e..8fd046b 100644 --- a/docs/EventsApi.md +++ b/docs/EventsApi.md @@ -10,8 +10,6 @@ Method | HTTP request | Description # **events** > PaginatedEventList events(start_date_filter=start_date_filter, end_date_filter=end_date_filter, actor_filter=actor_filter, object_filter=object_filter, event_type_filter=event_type_filter, api_token_filter=api_token_filter, cursor=cursor, page_size=page_size) - - Returns a list of `Event` objects. ### Example diff --git a/docs/GroupBindingsApi.md b/docs/GroupBindingsApi.md index 0fded3b..f34af17 100644 --- a/docs/GroupBindingsApi.md +++ b/docs/GroupBindingsApi.md @@ -14,8 +14,6 @@ Method | HTTP request | Description # **create_group_binding** > GroupBinding create_group_binding(create_group_binding_info) - - Creates a group binding. ### Example @@ -94,8 +92,6 @@ Name | Type | Description | Notes # **delete_group_binding** > delete_group_binding(group_binding_id) - - Deletes a group binding. ### Example @@ -170,8 +166,6 @@ void (empty response body) # **get_group_binding** > GroupBinding get_group_binding(group_binding_id) - - Returns a `GroupBinding` object. ### Example @@ -249,8 +243,6 @@ Name | Type | Description | Notes # **get_group_bindings** > PaginatedGroupBindingsList get_group_bindings(cursor=cursor, page_size=page_size) - - Returns a list of `GroupBinding` objects. ### Example @@ -330,8 +322,6 @@ Name | Type | Description | Notes # **update_group_bindings** > update_group_bindings(update_group_binding_info_list) - - Bulk updates a list of group bindings. ### Example diff --git a/docs/GroupContainingGroup.md b/docs/GroupContainingGroup.md new file mode 100644 index 0000000..def7a2e --- /dev/null +++ b/docs/GroupContainingGroup.md @@ -0,0 +1,30 @@ +# GroupContainingGroup + +# GroupContainingGroup Object ### Description The `GroupContainingGroup` object is used to represent a relationship between a group and a group. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**containing_group_id** | **str** | The groupID of the containing group. | + +## Example + +```python +from opal_security.models.group_containing_group import GroupContainingGroup + +# TODO update the JSON string below +json = "{}" +# create an instance of GroupContainingGroup from a JSON string +group_containing_group_instance = GroupContainingGroup.from_json(json) +# print the JSON string representation of the object +print(GroupContainingGroup.to_json()) + +# convert the object into a dict +group_containing_group_dict = group_containing_group_instance.to_dict() +# create an instance of GroupContainingGroup from a dict +group_containing_group_from_dict = GroupContainingGroup.from_dict(group_containing_group_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GroupContainingGroupList.md b/docs/GroupContainingGroupList.md new file mode 100644 index 0000000..a3ac911 --- /dev/null +++ b/docs/GroupContainingGroupList.md @@ -0,0 +1,29 @@ +# GroupContainingGroupList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**containing_groups** | [**List[GroupContainingGroup]**](GroupContainingGroup.md) | | + +## Example + +```python +from opal_security.models.group_containing_group_list import GroupContainingGroupList + +# TODO update the JSON string below +json = "{}" +# create an instance of GroupContainingGroupList from a JSON string +group_containing_group_list_instance = GroupContainingGroupList.from_json(json) +# print the JSON string representation of the object +print(GroupContainingGroupList.to_json()) + +# convert the object into a dict +group_containing_group_list_dict = group_containing_group_list_instance.to_dict() +# create an instance of GroupContainingGroupList from a dict +group_containing_group_list_from_dict = GroupContainingGroupList.from_dict(group_containing_group_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/GroupWithAccessLevel.md b/docs/GroupWithAccessLevel.md new file mode 100644 index 0000000..14c078e --- /dev/null +++ b/docs/GroupWithAccessLevel.md @@ -0,0 +1,31 @@ +# GroupWithAccessLevel + +Information about a group and corresponding access level + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**group_id** | **str** | The ID of the group. | +**access_level_remote_id** | **str** | The ID of the resource. | [optional] + +## Example + +```python +from opal_security.models.group_with_access_level import GroupWithAccessLevel + +# TODO update the JSON string below +json = "{}" +# create an instance of GroupWithAccessLevel from a JSON string +group_with_access_level_instance = GroupWithAccessLevel.from_json(json) +# print the JSON string representation of the object +print(GroupWithAccessLevel.to_json()) + +# convert the object into a dict +group_with_access_level_dict = group_with_access_level_instance.to_dict() +# create an instance of GroupWithAccessLevel from a dict +group_with_access_level_from_dict = GroupWithAccessLevel.from_dict(group_with_access_level_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/GroupsApi.md b/docs/GroupsApi.md index 6d0101f..d26f8da 100644 --- a/docs/GroupsApi.md +++ b/docs/GroupsApi.md @@ -4,12 +4,15 @@ All URIs are relative to *https://api.opal.dev/v1* Method | HTTP request | Description ------------- | ------------- | ------------- +[**add_group_containing_group**](GroupsApi.md#add_group_containing_group) | **POST** /groups/{group_id}/containing-groups | [**add_group_resource**](GroupsApi.md#add_group_resource) | **POST** /groups/{group_id}/resources/{resource_id} | [**add_group_user**](GroupsApi.md#add_group_user) | **POST** /groups/{group_id}/users/{user_id} | [**create_group**](GroupsApi.md#create_group) | **POST** /groups | [**delete_group**](GroupsApi.md#delete_group) | **DELETE** /groups/{group_id} | [**delete_group_user**](GroupsApi.md#delete_group_user) | **DELETE** /groups/{group_id}/users/{user_id} | [**get_group**](GroupsApi.md#get_group) | **GET** /groups/{group_id} | +[**get_group_containing_group**](GroupsApi.md#get_group_containing_group) | **GET** /groups/{group_id}/containing-groups/{containing_group_id} | +[**get_group_containing_groups**](GroupsApi.md#get_group_containing_groups) | **GET** /groups/{group_id}/containing-groups | [**get_group_message_channels**](GroupsApi.md#get_group_message_channels) | **GET** /groups/{group_id}/message-channels | [**get_group_on_call_schedules**](GroupsApi.md#get_group_on_call_schedules) | **GET** /groups/{group_id}/on-call-schedules | [**get_group_resources**](GroupsApi.md#get_group_resources) | **GET** /groups/{group_id}/resources | @@ -19,6 +22,7 @@ Method | HTTP request | Description [**get_group_users**](GroupsApi.md#get_group_users) | **GET** /groups/{group_id}/users | [**get_group_visibility**](GroupsApi.md#get_group_visibility) | **GET** /groups/{group_id}/visibility | [**get_groups**](GroupsApi.md#get_groups) | **GET** /groups | +[**remove_group_containing_group**](GroupsApi.md#remove_group_containing_group) | **DELETE** /groups/{group_id}/containing-groups/{containing_group_id} | [**set_group_message_channels**](GroupsApi.md#set_group_message_channels) | **PUT** /groups/{group_id}/message-channels | [**set_group_on_call_schedules**](GroupsApi.md#set_group_on_call_schedules) | **PUT** /groups/{group_id}/on-call-schedules | [**set_group_resources**](GroupsApi.md#set_group_resources) | **PUT** /groups/{group_id}/resources | @@ -28,10 +32,87 @@ Method | HTTP request | Description [**update_groups**](GroupsApi.md#update_groups) | **PUT** /groups | -# **add_group_resource** -> GroupResource add_group_resource(group_id, resource_id, access_level_remote_id=access_level_remote_id, add_group_resource_request=add_group_resource_request) +# **add_group_containing_group** +> GroupContainingGroup add_group_containing_group(group_id, group_containing_group) + +Creates a new containing group. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import opal_security +from opal_security.models.group_containing_group import GroupContainingGroup +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.GroupsApi(api_client) + group_id = '4baf8423-db0a-4037-a4cf-f79c60cb67a5' # str | The ID of the group. + group_containing_group = opal_security.GroupContainingGroup() # GroupContainingGroup | + + try: + api_response = api_instance.add_group_containing_group(group_id, group_containing_group) + print("The response of GroupsApi->add_group_containing_group:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling GroupsApi->add_group_containing_group: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| The ID of the group. | + **group_containing_group** | [**GroupContainingGroup**](GroupContainingGroup.md)| | + +### Return type + +[**GroupContainingGroup**](GroupContainingGroup.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The created `GroupContainingGroup` object. | - | +[[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) +# **add_group_resource** +> GroupResource add_group_resource(group_id, resource_id, access_level_remote_id=access_level_remote_id, add_group_resource_request=add_group_resource_request) Adds a resource to a group. @@ -117,8 +198,6 @@ Name | Type | Description | Notes # **add_group_user** > GroupUser add_group_user(group_id, user_id, duration_minutes=duration_minutes, access_level_remote_id=access_level_remote_id, add_group_user_request=add_group_user_request) - - Adds a user to this group. ### Example @@ -205,9 +284,7 @@ Name | Type | Description | Notes # **create_group** > Group create_group(create_group_info) - - -Creates a group. See [here](https://docs.opal.dev/reference/end-system-objects) for details about importing groups. +Creates an Opal group or [imports a remote group](https://docs.opal.dev/reference/end-system-objects). ### Example @@ -285,8 +362,6 @@ Name | Type | Description | Notes # **delete_group** > delete_group(group_id) - - Deletes a group. ### Example @@ -361,8 +436,6 @@ void (empty response body) # **delete_group_user** > delete_group_user(group_id, user_id) - - Removes a user's access from this group. ### Example @@ -439,8 +512,6 @@ void (empty response body) # **get_group** > Group get_group(group_id) - - Returns a `Group` object. ### Example @@ -515,11 +586,165 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **get_group_message_channels** -> MessageChannelList get_group_message_channels(group_id) +# **get_group_containing_group** +> GroupContainingGroup get_group_containing_group(group_id, containing_group_id) + +Gets a specific containing group for a group. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import opal_security +from opal_security.models.group_containing_group import GroupContainingGroup +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.GroupsApi(api_client) + group_id = '4baf8423-db0a-4037-a4cf-f79c60cb67a5' # str | The ID of the group. + containing_group_id = '4baf8423-db0a-4037-a4cf-f79c60cb67a5' # str | The ID of the containing group. + + try: + api_response = api_instance.get_group_containing_group(group_id, containing_group_id) + print("The response of GroupsApi->get_group_containing_group:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling GroupsApi->get_group_containing_group: %s\n" % e) +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| The ID of the group. | + **containing_group_id** | **str**| The ID of the containing group. | + +### Return type + +[**GroupContainingGroup**](GroupContainingGroup.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The created `GroupContainingGroup` object. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_group_containing_groups** +> GroupContainingGroupList get_group_containing_groups(group_id) + +Gets the list of groups that the group gives access to. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import opal_security +from opal_security.models.group_containing_group_list import GroupContainingGroupList +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.GroupsApi(api_client) + group_id = '4baf8423-db0a-4037-a4cf-f79c60cb67a5' # str | The ID of the group. + + try: + api_response = api_instance.get_group_containing_groups(group_id) + print("The response of GroupsApi->get_group_containing_groups:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling GroupsApi->get_group_containing_groups: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| The ID of the group. | + +### Return type + +[**GroupContainingGroupList**](GroupContainingGroupList.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The resources that the group gives access to. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_group_message_channels** +> MessageChannelList get_group_message_channels(group_id) + Gets the list of audit and reviewer message channels attached to a group. ### Example @@ -597,8 +822,6 @@ Name | Type | Description | Notes # **get_group_on_call_schedules** > OnCallScheduleList get_group_on_call_schedules(group_id) - - Gets the list of on call schedules attached to a group. ### Example @@ -676,8 +899,6 @@ Name | Type | Description | Notes # **get_group_resources** > GroupResourceList get_group_resources(group_id) - - Gets the list of resources that the group gives access to. ### Example @@ -755,8 +976,6 @@ Name | Type | Description | Notes # **get_group_reviewer_stages** > List[ReviewerStage] get_group_reviewer_stages(group_id) - - Gets the list of reviewer stages for a group. ### Example @@ -834,8 +1053,6 @@ Name | Type | Description | Notes # **get_group_reviewers** > List[str] get_group_reviewers(group_id) - - Gets the list of owner IDs of the reviewers for a group. ### Example @@ -912,8 +1129,6 @@ Name | Type | Description | Notes # **get_group_tags** > TagsList get_group_tags(group_id) - - Returns all tags applied to the group. ### Example @@ -991,8 +1206,6 @@ Name | Type | Description | Notes # **get_group_users** > GroupUserList get_group_users(group_id) - - Gets the list of users for this group. ### Example @@ -1070,8 +1283,6 @@ Name | Type | Description | Notes # **get_group_visibility** > VisibilityInfo get_group_visibility(group_id) - - Gets the visibility of this group. ### Example @@ -1149,8 +1360,6 @@ Name | Type | Description | Notes # **get_groups** > PaginatedGroupsList get_groups(cursor=cursor, page_size=page_size, group_type_filter=group_type_filter, group_ids=group_ids, group_name=group_name) - - Returns a list of groups for your organization. ### Example @@ -1234,11 +1443,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) -# **set_group_message_channels** -> List[str] set_group_message_channels(group_id, message_channel_id_list) +# **remove_group_containing_group** +> remove_group_containing_group(group_id, containing_group_id) + +Removes a containing group from a group. +### Example + +* Bearer Authentication (BearerAuth): + +```python +import opal_security +from opal_security.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +import opal_security as opal + +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with opal_security.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = opal_security.GroupsApi(api_client) + group_id = '4baf8423-db0a-4037-a4cf-f79c60cb67a5' # str | The ID of the group. + containing_group_id = '4baf8423-db0a-4037-a4cf-f79c60cb67a5' # str | The ID of the containing group. + + try: + api_instance.remove_group_containing_group(group_id, containing_group_id) + except Exception as e: + print("Exception when calling GroupsApi->remove_group_containing_group: %s\n" % e) +``` + + + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| The ID of the group. | + **containing_group_id** | **str**| The ID of the containing group. | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | The containing group was successfully removed from the group. | - | + +[[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) + +# **set_group_message_channels** +> List[str] set_group_message_channels(group_id, message_channel_id_list) + Sets the list of audit message channels attached to a group. ### Example @@ -1318,8 +1601,6 @@ Name | Type | Description | Notes # **set_group_on_call_schedules** > List[str] set_group_on_call_schedules(group_id, on_call_schedule_id_list) - - Sets the list of on call schedules attached to a group. ### Example @@ -1399,8 +1680,6 @@ Name | Type | Description | Notes # **set_group_resources** > set_group_resources(group_id, update_group_resources_info) - - Sets the list of resources that the group gives access to. ### Example @@ -1478,8 +1757,6 @@ void (empty response body) # **set_group_reviewer_stages** > List[ReviewerStage] set_group_reviewer_stages(group_id, reviewer_stage_list) - - Sets the list of reviewer stages for a group. ### Example @@ -1560,8 +1837,6 @@ Name | Type | Description | Notes # **set_group_reviewers** > List[str] set_group_reviewers(group_id, reviewer_id_list) - - Sets the list of reviewers for a group. ### Example @@ -1641,8 +1916,6 @@ Name | Type | Description | Notes # **set_group_visibility** > VisibilityInfo set_group_visibility(group_id, visibility_info) - - Sets the visibility of this group. ### Example @@ -1722,8 +1995,6 @@ Name | Type | Description | Notes # **update_groups** > UpdateGroupInfoList update_groups(update_group_info_list) - - Bulk updates a list of groups. ### Example diff --git a/docs/IdpGroupMappingsApi.md b/docs/IdpGroupMappingsApi.md index dc5302a..088205a 100644 --- a/docs/IdpGroupMappingsApi.md +++ b/docs/IdpGroupMappingsApi.md @@ -12,8 +12,6 @@ Method | HTTP request | Description # **delete_idp_group_mappings** > delete_idp_group_mappings(app_resource_id, group_id) - - Deletes an `IdpGroupMapping` object. ### Example @@ -90,8 +88,6 @@ void (empty response body) # **get_idp_group_mappings** > IdpGroupMappingList get_idp_group_mappings(app_resource_id) - - Returns the configured set of available `IdpGroupMapping` objects for an Okta app. ### Example @@ -169,8 +165,6 @@ Name | Type | Description | Notes # **update_idp_group_mappings** > update_idp_group_mappings(app_resource_id, update_idp_group_mappings_request) - - Updates the list of available `IdpGroupMapping` objects for an Okta app. ### Example diff --git a/docs/MessageChannelsApi.md b/docs/MessageChannelsApi.md index be867a3..f4918ab 100644 --- a/docs/MessageChannelsApi.md +++ b/docs/MessageChannelsApi.md @@ -12,8 +12,6 @@ Method | HTTP request | Description # **create_message_channel** > MessageChannel create_message_channel(create_message_channel_info) - - Creates a `MessageChannel` objects. ### Example @@ -92,8 +90,6 @@ Name | Type | Description | Notes # **get_message_channel** > MessageChannel get_message_channel(message_channel_id) - - Gets a `MessageChannel` object. ### Example @@ -171,8 +167,6 @@ Name | Type | Description | Notes # **get_message_channels** > MessageChannelList get_message_channels() - - Returns a list of `MessageChannel` objects. ### Example diff --git a/docs/NonHumanIdentitiesApi.md b/docs/NonHumanIdentitiesApi.md index 511955d..040c778 100644 --- a/docs/NonHumanIdentitiesApi.md +++ b/docs/NonHumanIdentitiesApi.md @@ -10,8 +10,6 @@ Method | HTTP request | Description # **get_nhis** > PaginatedResourcesList get_nhis(cursor=cursor, page_size=page_size) - - Returns a list of non-human identities for your organization. ### Example diff --git a/docs/OnCallSchedulesApi.md b/docs/OnCallSchedulesApi.md index 885e65a..912b3d9 100644 --- a/docs/OnCallSchedulesApi.md +++ b/docs/OnCallSchedulesApi.md @@ -12,8 +12,6 @@ Method | HTTP request | Description # **create_on_call_schedule** > OnCallSchedule create_on_call_schedule(create_on_call_schedule_info) - - Creates a `OnCallSchedule` objects. ### Example @@ -92,8 +90,6 @@ Name | Type | Description | Notes # **get_on_call_schedule** > OnCallSchedule get_on_call_schedule(on_call_schedule_id) - - Gets a `OnCallSchedule` object. ### Example @@ -171,8 +167,6 @@ Name | Type | Description | Notes # **get_on_call_schedules** > OnCallScheduleList get_on_call_schedules() - - Returns a list of `OnCallSchedule` objects. ### Example diff --git a/docs/OwnersApi.md b/docs/OwnersApi.md index 8986cb3..a9c0d1e 100644 --- a/docs/OwnersApi.md +++ b/docs/OwnersApi.md @@ -17,8 +17,6 @@ Method | HTTP request | Description # **create_owner** > Owner create_owner(create_owner_info) - - Creates an owner. ### Example @@ -97,8 +95,6 @@ Name | Type | Description | Notes # **delete_owner** > delete_owner(owner_id) - - Deletes an owner. ### Example @@ -173,8 +169,6 @@ void (empty response body) # **get_owner** > Owner get_owner(owner_id) - - Returns an `Owner` object. ### Example @@ -252,8 +246,6 @@ Name | Type | Description | Notes # **get_owner_from_name** > Owner get_owner_from_name(owner_name) - - Returns an `Owner` object. Does not support owners with `/` in their name, use /owners?name=... instead. ### Example @@ -331,8 +323,6 @@ Name | Type | Description | Notes # **get_owner_users** > UserList get_owner_users(owner_id) - - Gets the list of users for this owner, in escalation priority order if applicable. ### Example @@ -410,8 +400,6 @@ Name | Type | Description | Notes # **get_owners** > PaginatedOwnersList get_owners(cursor=cursor, page_size=page_size, name=name) - - Returns a list of `Owner` objects. ### Example @@ -493,8 +481,6 @@ Name | Type | Description | Notes # **set_owner_users** > UserList set_owner_users(owner_id, user_id_list) - - Sets the list of users for this owner. If escalation is enabled, the order of this list is the escalation priority order of the users. If the owner has a source group, adding or removing users from this list won't be possible. ### Example @@ -575,8 +561,6 @@ Name | Type | Description | Notes # **update_owners** > UpdateOwnerInfoList update_owners(update_owner_info_list) - - Bulk updates a list of owners. ### Example diff --git a/docs/PaginatedBundleGroupList.md b/docs/PaginatedBundleGroupList.md new file mode 100644 index 0000000..1504302 --- /dev/null +++ b/docs/PaginatedBundleGroupList.md @@ -0,0 +1,32 @@ +# PaginatedBundleGroupList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**previous** | **str** | The cursor used to obtain the current result page. | [optional] +**next** | **str** | The cursor with which to continue pagination if additional result pages exist. | [optional] +**total_count** | **int** | The total number of items in the result set. | [optional] +**bundle_groups** | [**List[BundleGroup]**](BundleGroup.md) | | + +## Example + +```python +from opal_security.models.paginated_bundle_group_list import PaginatedBundleGroupList + +# TODO update the JSON string below +json = "{}" +# create an instance of PaginatedBundleGroupList from a JSON string +paginated_bundle_group_list_instance = PaginatedBundleGroupList.from_json(json) +# print the JSON string representation of the object +print(PaginatedBundleGroupList.to_json()) + +# convert the object into a dict +paginated_bundle_group_list_dict = paginated_bundle_group_list_instance.to_dict() +# create an instance of PaginatedBundleGroupList from a dict +paginated_bundle_group_list_from_dict = PaginatedBundleGroupList.from_dict(paginated_bundle_group_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/PaginatedBundleList.md b/docs/PaginatedBundleList.md new file mode 100644 index 0000000..cce9a9c --- /dev/null +++ b/docs/PaginatedBundleList.md @@ -0,0 +1,32 @@ +# PaginatedBundleList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**previous** | **str** | The cursor used to obtain the current result page. | [optional] +**next** | **str** | The cursor with which to continue pagination if additional result pages exist. | [optional] +**total_count** | **int** | The total number of items in the result set. | [optional] +**bundles** | [**List[Bundle]**](Bundle.md) | | + +## Example + +```python +from opal_security.models.paginated_bundle_list import PaginatedBundleList + +# TODO update the JSON string below +json = "{}" +# create an instance of PaginatedBundleList from a JSON string +paginated_bundle_list_instance = PaginatedBundleList.from_json(json) +# print the JSON string representation of the object +print(PaginatedBundleList.to_json()) + +# convert the object into a dict +paginated_bundle_list_dict = paginated_bundle_list_instance.to_dict() +# create an instance of PaginatedBundleList from a dict +paginated_bundle_list_from_dict = PaginatedBundleList.from_dict(paginated_bundle_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/PaginatedBundleResourceList.md b/docs/PaginatedBundleResourceList.md new file mode 100644 index 0000000..ad64ae5 --- /dev/null +++ b/docs/PaginatedBundleResourceList.md @@ -0,0 +1,32 @@ +# PaginatedBundleResourceList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**previous** | **str** | The cursor used to obtain the current result page. | [optional] +**next** | **str** | The cursor with which to continue pagination if additional result pages exist. | [optional] +**total_count** | **int** | The total number of items in the result set. | [optional] +**bundle_resources** | [**List[BundleResource]**](BundleResource.md) | | + +## Example + +```python +from opal_security.models.paginated_bundle_resource_list import PaginatedBundleResourceList + +# TODO update the JSON string below +json = "{}" +# create an instance of PaginatedBundleResourceList from a JSON string +paginated_bundle_resource_list_instance = PaginatedBundleResourceList.from_json(json) +# print the JSON string representation of the object +print(PaginatedBundleResourceList.to_json()) + +# convert the object into a dict +paginated_bundle_resource_list_dict = paginated_bundle_resource_list_instance.to_dict() +# create an instance of PaginatedBundleResourceList from a dict +paginated_bundle_resource_list_from_dict = PaginatedBundleResourceList.from_dict(paginated_bundle_resource_list_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RequestsApi.md b/docs/RequestsApi.md index 620b557..f38d6d8 100644 --- a/docs/RequestsApi.md +++ b/docs/RequestsApi.md @@ -11,8 +11,6 @@ Method | HTTP request | Description # **create_request** > CreateRequest200Response create_request(create_request_info) - - Create an access request ### Example @@ -91,8 +89,6 @@ Name | Type | Description | Notes # **get_requests** > RequestList get_requests(cursor=cursor, page_size=page_size, show_pending_only=show_pending_only) - - Returns a list of requests for your organization that is visible by the admin. ### Example diff --git a/docs/ResourcesApi.md b/docs/ResourcesApi.md index 3b9030b..e7195e4 100644 --- a/docs/ResourcesApi.md +++ b/docs/ResourcesApi.md @@ -24,14 +24,13 @@ Method | HTTP request | Description [**set_resource_reviewer_stages**](ResourcesApi.md#set_resource_reviewer_stages) | **PUT** /resources/{resource_id}/reviewer-stages | [**set_resource_reviewers**](ResourcesApi.md#set_resource_reviewers) | **PUT** /resources/{resource_id}/reviewers | [**set_resource_visibility**](ResourcesApi.md#set_resource_visibility) | **PUT** /resources/{resource_id}/visibility | +[**update_resource_user**](ResourcesApi.md#update_resource_user) | **PUT** /resources/{resource_id}/users/{user_id} | [**update_resources**](ResourcesApi.md#update_resources) | **PUT** /resources | # **add_resource_nhi** > ResourceNHI add_resource_nhi(resource_id, non_human_identity_id, add_resource_nhi_request=add_resource_nhi_request) - - Gives a non-human identity access to this resource. ### Example @@ -114,8 +113,6 @@ Name | Type | Description | Notes # **add_resource_user** > ResourceUser add_resource_user(resource_id, user_id, duration_minutes=duration_minutes, access_level_remote_id=access_level_remote_id, add_resource_user_request=add_resource_user_request) - - Adds a user to this resource. ### Example @@ -202,8 +199,6 @@ Name | Type | Description | Notes # **create_resource** > Resource create_resource(create_resource_info) - - Creates a resource. See [here](https://docs.opal.dev/reference/end-system-objects) for details about importing resources. ### Example @@ -282,8 +277,6 @@ Name | Type | Description | Notes # **delete_resource** > delete_resource(resource_id) - - Deletes a resource. ### Example @@ -358,8 +351,6 @@ void (empty response body) # **delete_resource_nhi** > delete_resource_nhi(resource_id, non_human_identity_id, access_level_remote_id=access_level_remote_id) - - Removes a non-human identity's direct access from this resource. ### Example @@ -438,8 +429,6 @@ void (empty response body) # **delete_resource_user** > delete_resource_user(resource_id, user_id, access_level_remote_id=access_level_remote_id) - - Removes a user's direct access from this resource. ### Example @@ -518,8 +507,6 @@ void (empty response body) # **get_resource** > Resource get_resource(resource_id) - - Retrieves a resource. ### Example @@ -597,8 +584,6 @@ Name | Type | Description | Notes # **get_resource_message_channels** > MessageChannelList get_resource_message_channels(resource_id) - - Gets the list of audit message channels attached to a resource. ### Example @@ -676,8 +661,6 @@ Name | Type | Description | Notes # **get_resource_nhis** > AccessList get_resource_nhis(resource_id, limit=limit) - - Gets the list of non-human identities with access to this resource. ### Example @@ -757,8 +740,6 @@ Name | Type | Description | Notes # **get_resource_reviewer_stages** > List[ReviewerStage] get_resource_reviewer_stages(resource_id) - - Gets the list reviewer stages for a resource. ### Example @@ -836,8 +817,6 @@ Name | Type | Description | Notes # **get_resource_reviewers** > List[str] get_resource_reviewers(resource_id) - - Gets the list of owner IDs of the reviewers for a resource. ### Example @@ -914,8 +893,6 @@ Name | Type | Description | Notes # **get_resource_tags** > TagsList get_resource_tags(resource_id) - - Returns all tags applied to the resource. ### Example @@ -993,8 +970,6 @@ Name | Type | Description | Notes # **get_resource_users** > ResourceAccessUserList get_resource_users(resource_id, limit=limit) - - Gets the list of users for this resource. ### Example @@ -1074,8 +1049,6 @@ Name | Type | Description | Notes # **get_resource_visibility** > VisibilityInfo get_resource_visibility(resource_id) - - Gets the visibility of this resource. ### Example @@ -1153,8 +1126,6 @@ Name | Type | Description | Notes # **get_resources** > PaginatedResourcesList get_resources(cursor=cursor, page_size=page_size, resource_type_filter=resource_type_filter, resource_ids=resource_ids, resource_name=resource_name, parent_resource_id=parent_resource_id) - - Returns a list of resources for your organization. ### Example @@ -1243,8 +1214,6 @@ Name | Type | Description | Notes # **resource_user_access_status_retrieve** > ResourceUserAccessStatus resource_user_access_status_retrieve(resource_id, user_id, access_level_remote_id=access_level_remote_id, cursor=cursor, page_size=page_size) - - Get user's access status to a resource. ### Example @@ -1330,8 +1299,6 @@ Name | Type | Description | Notes # **set_resource_message_channels** > List[str] set_resource_message_channels(resource_id, message_channel_id_list) - - Sets the list of audit message channels attached to a resource. ### Example @@ -1411,8 +1378,6 @@ Name | Type | Description | Notes # **set_resource_reviewer_stages** > List[ReviewerStage] set_resource_reviewer_stages(resource_id, reviewer_stage_list) - - Sets the list of reviewer stages for a resource. ### Example @@ -1493,8 +1458,6 @@ Name | Type | Description | Notes # **set_resource_reviewers** > List[str] set_resource_reviewers(resource_id, reviewer_id_list) - - Sets the list of reviewers for a resource. ### Example @@ -1574,8 +1537,6 @@ Name | Type | Description | Notes # **set_resource_visibility** > VisibilityInfo set_resource_visibility(resource_id, visibility_info) - - Sets the visibility of this resource. ### Example @@ -1652,10 +1613,90 @@ 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) -# **update_resources** -> UpdateResourceInfoList update_resources(update_resource_info_list) +# **update_resource_user** +> ResourceUser update_resource_user(resource_id, user_id, update_resource_user_request) + +Updates a user's access level or duration on this resource. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import opal_security +from opal_security.models.resource_user import ResourceUser +from opal_security.models.update_resource_user_request import UpdateResourceUserRequest +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.ResourcesApi(api_client) + resource_id = '4baf8423-db0a-4037-a4cf-f79c60cb67a5' # str | The ID of the resource. + user_id = 'f92aa855-cea9-4814-b9d8-f2a60d3e4a06' # str | The ID of the user whose access is being updated. + update_resource_user_request = opal_security.UpdateResourceUserRequest() # UpdateResourceUserRequest | + + try: + api_response = api_instance.update_resource_user(resource_id, user_id, update_resource_user_request) + print("The response of ResourcesApi->update_resource_user:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ResourcesApi->update_resource_user: %s\n" % e) +``` + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **resource_id** | **str**| The ID of the resource. | + **user_id** | **str**| The ID of the user whose access is being updated. | + **update_resource_user_request** | [**UpdateResourceUserRequest**](UpdateResourceUserRequest.md)| | + +### Return type + +[**ResourceUser**](ResourceUser.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The ResourceUser was successfully updated. | - | + +[[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_resources** +> UpdateResourceInfoList update_resources(update_resource_info_list) Bulk updates a list of resources. diff --git a/docs/RuleClauses.md b/docs/RuleClauses.md new file mode 100644 index 0000000..afb008f --- /dev/null +++ b/docs/RuleClauses.md @@ -0,0 +1,30 @@ +# RuleClauses + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**when** | [**RuleConjunction**](RuleConjunction.md) | | +**unless** | [**RuleConjunction**](RuleConjunction.md) | | [optional] + +## Example + +```python +from opal_security.models.rule_clauses import RuleClauses + +# TODO update the JSON string below +json = "{}" +# create an instance of RuleClauses from a JSON string +rule_clauses_instance = RuleClauses.from_json(json) +# print the JSON string representation of the object +print(RuleClauses.to_json()) + +# convert the object into a dict +rule_clauses_dict = rule_clauses_instance.to_dict() +# create an instance of RuleClauses from a dict +rule_clauses_from_dict = RuleClauses.from_dict(rule_clauses_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/RuleConjunction.md b/docs/RuleConjunction.md new file mode 100644 index 0000000..89e1172 --- /dev/null +++ b/docs/RuleConjunction.md @@ -0,0 +1,29 @@ +# RuleConjunction + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**clauses** | [**List[RuleDisjunction]**](RuleDisjunction.md) | | + +## Example + +```python +from opal_security.models.rule_conjunction import RuleConjunction + +# TODO update the JSON string below +json = "{}" +# create an instance of RuleConjunction from a JSON string +rule_conjunction_instance = RuleConjunction.from_json(json) +# print the JSON string representation of the object +print(RuleConjunction.to_json()) + +# convert the object into a dict +rule_conjunction_dict = rule_conjunction_instance.to_dict() +# create an instance of RuleConjunction from a dict +rule_conjunction_from_dict = RuleConjunction.from_dict(rule_conjunction_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 new file mode 100644 index 0000000..f478433 --- /dev/null +++ b/docs/RuleDisjunction.md @@ -0,0 +1,29 @@ +# RuleDisjunction + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**selectors** | [**List[TagSelector]**](TagSelector.md) | | + +## Example + +```python +from opal_security.models.rule_disjunction import RuleDisjunction + +# TODO update the JSON string below +json = "{}" +# create an instance of RuleDisjunction from a JSON string +rule_disjunction_instance = RuleDisjunction.from_json(json) +# print the JSON string representation of the object +print(RuleDisjunction.to_json()) + +# convert the object into a dict +rule_disjunction_dict = rule_disjunction_instance.to_dict() +# create an instance of RuleDisjunction from a dict +rule_disjunction_from_dict = RuleDisjunction.from_dict(rule_disjunction_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/SessionsApi.md b/docs/SessionsApi.md index 22311f7..589a63c 100644 --- a/docs/SessionsApi.md +++ b/docs/SessionsApi.md @@ -10,8 +10,6 @@ Method | HTTP request | Description # **sessions** > SessionsList sessions(resource_id, user_id=user_id) - - Returns a list of `Session` objects. ### Example diff --git a/docs/TagSelector.md b/docs/TagSelector.md new file mode 100644 index 0000000..46089af --- /dev/null +++ b/docs/TagSelector.md @@ -0,0 +1,31 @@ +# TagSelector + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **str** | | +**value** | **str** | | +**connection_id** | **str** | | + +## Example + +```python +from opal_security.models.tag_selector import TagSelector + +# TODO update the JSON string below +json = "{}" +# create an instance of TagSelector from a JSON string +tag_selector_instance = TagSelector.from_json(json) +# print the JSON string representation of the object +print(TagSelector.to_json()) + +# convert the object into a dict +tag_selector_dict = tag_selector_instance.to_dict() +# create an instance of TagSelector from a dict +tag_selector_from_dict = TagSelector.from_dict(tag_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/docs/TagsApi.md b/docs/TagsApi.md index 52d49e0..bf93f9c 100644 --- a/docs/TagsApi.md +++ b/docs/TagsApi.md @@ -20,8 +20,6 @@ Method | HTTP request | Description # **add_group_tag** > add_group_tag(tag_id, group_id) - - Applies a tag to a group. ### Example @@ -98,8 +96,6 @@ void (empty response body) # **add_resource_tag** > add_resource_tag(tag_id, resource_id) - - Applies a tag to a resource. ### Example @@ -176,8 +172,6 @@ void (empty response body) # **add_user_tag** > add_user_tag(tag_id, user_id) - - Applies a tag to a user. ### Example @@ -254,8 +248,6 @@ void (empty response body) # **create_tag** > Tag create_tag(tag_key=tag_key, tag_value=tag_value, admin_owner_id=admin_owner_id, create_tag_info=create_tag_info) - - Creates a tag with the given key and value. ### Example @@ -340,8 +332,6 @@ Name | Type | Description | Notes # **delete_tag_by_id** > delete_tag_by_id(tag_id) - - UNSTABLE. May be removed at any time. Deletes a tag with the given id. ### Example @@ -416,8 +406,6 @@ void (empty response body) # **get_tag** > Tag get_tag(tag_key, tag_value=tag_value) - - Gets a tag with the given key and value. ### Example @@ -497,8 +485,6 @@ Name | Type | Description | Notes # **get_tag_by_id** > Tag get_tag_by_id(tag_id) - - UNSTABLE. May be removed at any time. Gets a tag with the given id. ### Example @@ -576,8 +562,6 @@ Name | Type | Description | Notes # **get_tags** > PaginatedTagsList get_tags(cursor=cursor, page_size=page_size) - - Returns a list of tags created by your organization. ### Example @@ -657,8 +641,6 @@ Name | Type | Description | Notes # **remove_group_tag** > remove_group_tag(tag_id, group_id) - - Removes a tag from a group. ### Example @@ -735,8 +717,6 @@ void (empty response body) # **remove_resource_tag** > remove_resource_tag(tag_id, resource_id) - - Removes a tag from a resource. ### Example @@ -813,8 +793,6 @@ void (empty response body) # **remove_user_tag** > remove_user_tag(tag_id, user_id) - - Removes a tag from a user. ### Example diff --git a/docs/UarsApi.md b/docs/UarsApi.md index 0de803a..0382cc0 100644 --- a/docs/UarsApi.md +++ b/docs/UarsApi.md @@ -12,8 +12,6 @@ Method | HTTP request | Description # **create_uar** > UAR create_uar(create_uar_info) - - Starts a User Access Review. ### Example @@ -92,8 +90,6 @@ Name | Type | Description | Notes # **get_uar** > UAR get_uar(uar_id) - - Retrieves a specific UAR. ### Example @@ -171,8 +167,6 @@ Name | Type | Description | Notes # **get_uars** > PaginatedUARsList get_uars(cursor=cursor, page_size=page_size) - - Returns a list of `UAR` objects. ### Example diff --git a/docs/UpdateResourceUserRequest.md b/docs/UpdateResourceUserRequest.md new file mode 100644 index 0000000..eb7717e --- /dev/null +++ b/docs/UpdateResourceUserRequest.md @@ -0,0 +1,30 @@ +# UpdateResourceUserRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**duration_minutes** | **int** | The updated duration for which the resource can be accessed (in minutes). Use 0 for indefinite. | +**access_level_remote_id** | **str** | The updated remote ID of the access level granted to this user. | [optional] + +## Example + +```python +from opal_security.models.update_resource_user_request import UpdateResourceUserRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateResourceUserRequest from a JSON string +update_resource_user_request_instance = UpdateResourceUserRequest.from_json(json) +# print the JSON string representation of the object +print(UpdateResourceUserRequest.to_json()) + +# convert the object into a dict +update_resource_user_request_dict = update_resource_user_request_instance.to_dict() +# create an instance of UpdateResourceUserRequest from a dict +update_resource_user_request_from_dict = UpdateResourceUserRequest.from_dict(update_resource_user_request_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/UsersApi.md b/docs/UsersApi.md index 6f25054..7d6d09b 100644 --- a/docs/UsersApi.md +++ b/docs/UsersApi.md @@ -12,8 +12,6 @@ Method | HTTP request | Description # **get_user_tags** > TagsList get_user_tags(user_id) - - Returns all tags applied to the user. ### Example @@ -91,8 +89,6 @@ Name | Type | Description | Notes # **get_users** > PaginatedUsersList get_users(cursor=cursor, page_size=page_size) - - Returns a list of users for your organization. ### Example @@ -172,8 +168,6 @@ Name | Type | Description | Notes # **user** > User user(user_id=user_id, email=email) - - Returns a `User` object. ### Example diff --git a/opal_security/__init__.py b/opal_security/__init__.py index 15741f3..b80246d 100644 --- a/opal_security/__init__.py +++ b/opal_security/__init__.py @@ -18,7 +18,9 @@ __version__ = "1.0.0" # import apis into sdk package +from opal_security.api.access_rules_api import AccessRulesApi from opal_security.api.apps_api import AppsApi +from opal_security.api.bundles_api import BundlesApi from opal_security.api.configuration_templates_api import ConfigurationTemplatesApi from opal_security.api.events_api import EventsApi from opal_security.api.group_bindings_api import GroupBindingsApi @@ -49,6 +51,9 @@ # import models into sdk package from opal_security.models.access import Access from opal_security.models.access_list import AccessList +from opal_security.models.access_rule_condition import AccessRuleCondition +from opal_security.models.add_bundle_group_request import AddBundleGroupRequest +from opal_security.models.add_bundle_resource_request import AddBundleResourceRequest from opal_security.models.add_group_resource_request import AddGroupResourceRequest from opal_security.models.add_group_user_request import AddGroupUserRequest from opal_security.models.add_resource_nhi_request import AddResourceNhiRequest @@ -61,8 +66,12 @@ from opal_security.models.apps_list import AppsList from opal_security.models.aws_permission_set_metadata import AwsPermissionSetMetadata from opal_security.models.aws_permission_set_metadata_aws_permission_set import AwsPermissionSetMetadataAwsPermissionSet +from opal_security.models.bundle import Bundle +from opal_security.models.bundle_group import BundleGroup +from opal_security.models.bundle_resource import BundleResource from opal_security.models.condition import Condition from opal_security.models.configuration_template import ConfigurationTemplate +from opal_security.models.create_bundle_info import CreateBundleInfo from opal_security.models.create_configuration_template_info import CreateConfigurationTemplateInfo from opal_security.models.create_group_binding_info import CreateGroupBindingInfo from opal_security.models.create_group_binding_info_groups_inner import CreateGroupBindingInfoGroupsInner @@ -86,6 +95,8 @@ from opal_security.models.group_access_level import GroupAccessLevel from opal_security.models.group_binding import GroupBinding from opal_security.models.group_binding_group import GroupBindingGroup +from opal_security.models.group_containing_group import GroupContainingGroup +from opal_security.models.group_containing_group_list import GroupContainingGroupList from opal_security.models.group_remote_info import GroupRemoteInfo from opal_security.models.group_remote_info_active_directory_group import GroupRemoteInfoActiveDirectoryGroup from opal_security.models.group_remote_info_azure_ad_microsoft365_group import GroupRemoteInfoAzureAdMicrosoft365Group @@ -101,6 +112,7 @@ from opal_security.models.group_type_enum import GroupTypeEnum from opal_security.models.group_user import GroupUser from opal_security.models.group_user_list import GroupUserList +from opal_security.models.group_with_access_level import GroupWithAccessLevel from opal_security.models.idp_group_mapping import IdpGroupMapping from opal_security.models.idp_group_mapping_list import IdpGroupMappingList from opal_security.models.message_channel import MessageChannel @@ -112,6 +124,9 @@ from opal_security.models.on_call_schedule_list import OnCallScheduleList from opal_security.models.on_call_schedule_provider_enum import OnCallScheduleProviderEnum from opal_security.models.owner import Owner +from opal_security.models.paginated_bundle_group_list import PaginatedBundleGroupList +from opal_security.models.paginated_bundle_list import PaginatedBundleList +from opal_security.models.paginated_bundle_resource_list import PaginatedBundleResourceList from opal_security.models.paginated_configuration_template_list import PaginatedConfigurationTemplateList from opal_security.models.paginated_event_list import PaginatedEventList from opal_security.models.paginated_group_bindings_list import PaginatedGroupBindingsList @@ -172,6 +187,9 @@ from opal_security.models.reviewer_stage import ReviewerStage from opal_security.models.reviewer_stage_list import ReviewerStageList from opal_security.models.risk_sensitivity_enum import RiskSensitivityEnum +from opal_security.models.rule_clauses import RuleClauses +from opal_security.models.rule_conjunction import RuleConjunction +from opal_security.models.rule_disjunction import RuleDisjunction from opal_security.models.session import Session from opal_security.models.sessions_list import SessionsList from opal_security.models.sub_event import SubEvent @@ -179,6 +197,7 @@ from opal_security.models.sync_error_list import SyncErrorList from opal_security.models.tag import Tag from opal_security.models.tag_filter import TagFilter +from opal_security.models.tag_selector import TagSelector from opal_security.models.tags_list import TagsList from opal_security.models.ticket_propagation_configuration import TicketPropagationConfiguration from opal_security.models.ticketing_provider_enum import TicketingProviderEnum @@ -197,6 +216,7 @@ from opal_security.models.update_owner_info_list import UpdateOwnerInfoList from opal_security.models.update_resource_info import UpdateResourceInfo 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_hr_idp_status_enum import UserHrIdpStatusEnum from opal_security.models.user_id_list import UserIDList diff --git a/opal_security/api/__init__.py b/opal_security/api/__init__.py index c3fde7c..e6c3fcc 100644 --- a/opal_security/api/__init__.py +++ b/opal_security/api/__init__.py @@ -1,7 +1,9 @@ # flake8: noqa # import apis into api package +from opal_security.api.access_rules_api import AccessRulesApi from opal_security.api.apps_api import AppsApi +from opal_security.api.bundles_api import BundlesApi from opal_security.api.configuration_templates_api import ConfigurationTemplatesApi from opal_security.api.events_api import EventsApi from opal_security.api.group_bindings_api import GroupBindingsApi diff --git a/opal_security/api/access_rules_api.py b/opal_security/api/access_rules_api.py new file mode 100644 index 0000000..0f73d20 --- /dev/null +++ b/opal_security/api/access_rules_api.py @@ -0,0 +1,589 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing_extensions import Annotated +from opal_security.models.access_rule_condition import AccessRuleCondition + +from opal_security.api_client import ApiClient, RequestSerialized +from opal_security.api_response import ApiResponse +from opal_security.rest import RESTResponseType + + +class AccessRulesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def get_access_rule( + self, + access_rule_id: Annotated[StrictStr, Field(description="The access rule ID (group ID) of the access rule.")], + _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, + ) -> AccessRuleCondition: + """get_access_rule + + Returns a list of access rule config given the group_id of the access rule. + + :param access_rule_id: The access rule ID (group ID) of the access rule. (required) + :type access_rule_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_access_rule_serialize( + access_rule_id=access_rule_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccessRuleCondition", + } + 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_rule_with_http_info( + self, + access_rule_id: Annotated[StrictStr, Field(description="The access rule ID (group ID) of the access rule.")], + _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[AccessRuleCondition]: + """get_access_rule + + Returns a list of access rule config given the group_id of the access rule. + + :param access_rule_id: The access rule ID (group ID) of the access rule. (required) + :type access_rule_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_access_rule_serialize( + access_rule_id=access_rule_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccessRuleCondition", + } + 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_rule_without_preload_content( + self, + access_rule_id: Annotated[StrictStr, Field(description="The access rule ID (group ID) of the access rule.")], + _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_rule + + Returns a list of access rule config given the group_id of the access rule. + + :param access_rule_id: The access rule ID (group ID) of the access rule. (required) + :type access_rule_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_access_rule_serialize( + access_rule_id=access_rule_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccessRuleCondition", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_access_rule_serialize( + self, + access_rule_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if access_rule_id is not None: + _path_params['access_rule_id'] = access_rule_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/access-rules/{access_rule_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_access_rule( + self, + access_rule_id: Annotated[StrictStr, Field(description="The access rule ID (group ID) of the access rule.")], + access_rule_condition: AccessRuleCondition, + _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, + ) -> AccessRuleCondition: + """update_access_rule + + Updates the access rule config for the given group_id. + + :param access_rule_id: The access rule ID (group ID) of the access rule. (required) + :type access_rule_id: str + :param access_rule_condition: (required) + :type access_rule_condition: AccessRuleCondition + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_access_rule_serialize( + access_rule_id=access_rule_id, + access_rule_condition=access_rule_condition, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccessRuleCondition", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_access_rule_with_http_info( + self, + access_rule_id: Annotated[StrictStr, Field(description="The access rule ID (group ID) of the access rule.")], + access_rule_condition: AccessRuleCondition, + _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[AccessRuleCondition]: + """update_access_rule + + Updates the access rule config for the given group_id. + + :param access_rule_id: The access rule ID (group ID) of the access rule. (required) + :type access_rule_id: str + :param access_rule_condition: (required) + :type access_rule_condition: AccessRuleCondition + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_access_rule_serialize( + access_rule_id=access_rule_id, + access_rule_condition=access_rule_condition, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccessRuleCondition", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_access_rule_without_preload_content( + self, + access_rule_id: Annotated[StrictStr, Field(description="The access rule ID (group ID) of the access rule.")], + access_rule_condition: AccessRuleCondition, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """update_access_rule + + Updates the access rule config for the given group_id. + + :param access_rule_id: The access rule ID (group ID) of the access rule. (required) + :type access_rule_id: str + :param access_rule_condition: (required) + :type access_rule_condition: AccessRuleCondition + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_access_rule_serialize( + access_rule_id=access_rule_id, + access_rule_condition=access_rule_condition, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccessRuleCondition", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_access_rule_serialize( + self, + access_rule_id, + access_rule_condition, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if access_rule_id is not None: + _path_params['access_rule_id'] = access_rule_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if access_rule_condition is not None: + _body_params = access_rule_condition + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/access-rules/{access_rule_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/opal_security/api/bundles_api.py b/opal_security/api/bundles_api.py new file mode 100644 index 0000000..52a9242 --- /dev/null +++ b/opal_security/api/bundles_api.py @@ -0,0 +1,3693 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated +from opal_security.models.add_bundle_group_request import AddBundleGroupRequest +from opal_security.models.add_bundle_resource_request import AddBundleResourceRequest +from opal_security.models.bundle import Bundle +from opal_security.models.bundle_group import BundleGroup +from opal_security.models.bundle_resource import BundleResource +from opal_security.models.create_bundle_info import CreateBundleInfo +from opal_security.models.paginated_bundle_group_list import PaginatedBundleGroupList +from opal_security.models.paginated_bundle_list import PaginatedBundleList +from opal_security.models.paginated_bundle_resource_list import PaginatedBundleResourceList +from opal_security.models.visibility_info import VisibilityInfo + +from opal_security.api_client import ApiClient, RequestSerialized +from opal_security.api_response import ApiResponse +from opal_security.rest import RESTResponseType + + +class BundlesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def add_bundle_group( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + add_bundle_group_request: AddBundleGroupRequest, + _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, + ) -> BundleGroup: + """add_bundle_group + + Adds a group to a bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param add_bundle_group_request: (required) + :type add_bundle_group_request: AddBundleGroupRequest + :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._add_bundle_group_serialize( + bundle_id=bundle_id, + add_bundle_group_request=add_bundle_group_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "BundleGroup", + } + 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 add_bundle_group_with_http_info( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + add_bundle_group_request: AddBundleGroupRequest, + _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[BundleGroup]: + """add_bundle_group + + Adds a group to a bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param add_bundle_group_request: (required) + :type add_bundle_group_request: AddBundleGroupRequest + :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._add_bundle_group_serialize( + bundle_id=bundle_id, + add_bundle_group_request=add_bundle_group_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "BundleGroup", + } + 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 add_bundle_group_without_preload_content( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + add_bundle_group_request: AddBundleGroupRequest, + _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: + """add_bundle_group + + Adds a group to a bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param add_bundle_group_request: (required) + :type add_bundle_group_request: AddBundleGroupRequest + :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._add_bundle_group_serialize( + bundle_id=bundle_id, + add_bundle_group_request=add_bundle_group_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "BundleGroup", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _add_bundle_group_serialize( + self, + bundle_id, + add_bundle_group_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if bundle_id is not None: + _path_params['bundle_id'] = bundle_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if add_bundle_group_request is not None: + _body_params = add_bundle_group_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/bundles/{bundle_id}/groups', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def add_bundle_resource( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + add_bundle_resource_request: Optional[AddBundleResourceRequest] = 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, + ) -> BundleResource: + """add_bundle_resource + + Adds a resource to a bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param add_bundle_resource_request: + :type add_bundle_resource_request: AddBundleResourceRequest + :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._add_bundle_resource_serialize( + bundle_id=bundle_id, + add_bundle_resource_request=add_bundle_resource_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "BundleResource", + } + 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 add_bundle_resource_with_http_info( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + add_bundle_resource_request: Optional[AddBundleResourceRequest] = 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[BundleResource]: + """add_bundle_resource + + Adds a resource to a bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param add_bundle_resource_request: + :type add_bundle_resource_request: AddBundleResourceRequest + :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._add_bundle_resource_serialize( + bundle_id=bundle_id, + add_bundle_resource_request=add_bundle_resource_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "BundleResource", + } + 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 add_bundle_resource_without_preload_content( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + add_bundle_resource_request: Optional[AddBundleResourceRequest] = 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: + """add_bundle_resource + + Adds a resource to a bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param add_bundle_resource_request: + :type add_bundle_resource_request: AddBundleResourceRequest + :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._add_bundle_resource_serialize( + bundle_id=bundle_id, + add_bundle_resource_request=add_bundle_resource_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "BundleResource", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _add_bundle_resource_serialize( + self, + bundle_id, + add_bundle_resource_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if bundle_id is not None: + _path_params['bundle_id'] = bundle_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if add_bundle_resource_request is not None: + _body_params = add_bundle_resource_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/bundles/{bundle_id}/resources', + 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 create_bundle( + self, + create_bundle_info: CreateBundleInfo, + _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, + ) -> Bundle: + """create_bundle + + Creates a bundle. + + :param create_bundle_info: (required) + :type create_bundle_info: CreateBundleInfo + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_bundle_serialize( + create_bundle_info=create_bundle_info, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Bundle", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_bundle_with_http_info( + self, + create_bundle_info: CreateBundleInfo, + _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[Bundle]: + """create_bundle + + Creates a bundle. + + :param create_bundle_info: (required) + :type create_bundle_info: CreateBundleInfo + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_bundle_serialize( + create_bundle_info=create_bundle_info, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Bundle", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_bundle_without_preload_content( + self, + create_bundle_info: CreateBundleInfo, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """create_bundle + + Creates a bundle. + + :param create_bundle_info: (required) + :type create_bundle_info: CreateBundleInfo + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_bundle_serialize( + create_bundle_info=create_bundle_info, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Bundle", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_bundle_serialize( + self, + create_bundle_info, + _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 + # process the header parameters + # process the form parameters + # process the body parameter + if create_bundle_info is not None: + _body_params = create_bundle_info + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/bundles', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_bundle( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """delete_bundle + + Deletes a bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_bundle_serialize( + bundle_id=bundle_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_bundle_with_http_info( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """delete_bundle + + Deletes a bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_bundle_serialize( + bundle_id=bundle_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_bundle_without_preload_content( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete_bundle + + Deletes a bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_bundle_serialize( + bundle_id=bundle_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_bundle_serialize( + self, + bundle_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if bundle_id is not None: + _path_params['bundle_id'] = bundle_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/bundles/{bundle_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_bundle( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + _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, + ) -> Bundle: + """get_bundle + + Returns a `Bundle` object. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bundle_serialize( + bundle_id=bundle_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Bundle", + } + 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_bundle_with_http_info( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + _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[Bundle]: + """get_bundle + + Returns a `Bundle` object. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bundle_serialize( + bundle_id=bundle_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Bundle", + } + 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_bundle_without_preload_content( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + _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_bundle + + Returns a `Bundle` object. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bundle_serialize( + bundle_id=bundle_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Bundle", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_bundle_serialize( + self, + bundle_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if bundle_id is not None: + _path_params['bundle_id'] = bundle_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/bundles/{bundle_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_bundle_groups( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + page_size: Annotated[Optional[StrictInt], Field(description="The maximum number of groups to return from the beginning of the list. Default is 200, max is 1000.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="A cursor indicating where to start fetching items after a specific point.")] = 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, + ) -> PaginatedBundleGroupList: + """get_bundle_groups + + Returns a list of `Group` objects in a given bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param page_size: The maximum number of groups to return from the beginning of the list. Default is 200, max is 1000. + :type page_size: int + :param cursor: A cursor indicating where to start fetching items after a specific point. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bundle_groups_serialize( + bundle_id=bundle_id, + page_size=page_size, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PaginatedBundleGroupList", + } + 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_bundle_groups_with_http_info( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + page_size: Annotated[Optional[StrictInt], Field(description="The maximum number of groups to return from the beginning of the list. Default is 200, max is 1000.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="A cursor indicating where to start fetching items after a specific point.")] = 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[PaginatedBundleGroupList]: + """get_bundle_groups + + Returns a list of `Group` objects in a given bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param page_size: The maximum number of groups to return from the beginning of the list. Default is 200, max is 1000. + :type page_size: int + :param cursor: A cursor indicating where to start fetching items after a specific point. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bundle_groups_serialize( + bundle_id=bundle_id, + page_size=page_size, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PaginatedBundleGroupList", + } + 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_bundle_groups_without_preload_content( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + page_size: Annotated[Optional[StrictInt], Field(description="The maximum number of groups to return from the beginning of the list. Default is 200, max is 1000.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="A cursor indicating where to start fetching items after a specific point.")] = 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_bundle_groups + + Returns a list of `Group` objects in a given bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param page_size: The maximum number of groups to return from the beginning of the list. Default is 200, max is 1000. + :type page_size: int + :param cursor: A cursor indicating where to start fetching items after a specific point. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bundle_groups_serialize( + bundle_id=bundle_id, + page_size=page_size, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PaginatedBundleGroupList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_bundle_groups_serialize( + self, + bundle_id, + page_size, + cursor, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if bundle_id is not None: + _path_params['bundle_id'] = bundle_id + # process the query parameters + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + 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='/bundles/{bundle_id}/groups', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_bundle_resources( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + page_size: Annotated[Optional[StrictInt], Field(description="The maximum number of resources to return from the beginning of the list. Default is 200, max is 1000.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="A cursor indicating where to start fetching items after a specific point.")] = 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, + ) -> PaginatedBundleResourceList: + """get_bundle_resources + + Returns a list of `Resource` objects in a given bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param page_size: The maximum number of resources to return from the beginning of the list. Default is 200, max is 1000. + :type page_size: int + :param cursor: A cursor indicating where to start fetching items after a specific point. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bundle_resources_serialize( + bundle_id=bundle_id, + page_size=page_size, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PaginatedBundleResourceList", + } + 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_bundle_resources_with_http_info( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + page_size: Annotated[Optional[StrictInt], Field(description="The maximum number of resources to return from the beginning of the list. Default is 200, max is 1000.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="A cursor indicating where to start fetching items after a specific point.")] = 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[PaginatedBundleResourceList]: + """get_bundle_resources + + Returns a list of `Resource` objects in a given bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param page_size: The maximum number of resources to return from the beginning of the list. Default is 200, max is 1000. + :type page_size: int + :param cursor: A cursor indicating where to start fetching items after a specific point. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bundle_resources_serialize( + bundle_id=bundle_id, + page_size=page_size, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PaginatedBundleResourceList", + } + 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_bundle_resources_without_preload_content( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + page_size: Annotated[Optional[StrictInt], Field(description="The maximum number of resources to return from the beginning of the list. Default is 200, max is 1000.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="A cursor indicating where to start fetching items after a specific point.")] = 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_bundle_resources + + Returns a list of `Resource` objects in a given bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param page_size: The maximum number of resources to return from the beginning of the list. Default is 200, max is 1000. + :type page_size: int + :param cursor: A cursor indicating where to start fetching items after a specific point. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bundle_resources_serialize( + bundle_id=bundle_id, + page_size=page_size, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PaginatedBundleResourceList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_bundle_resources_serialize( + self, + bundle_id, + page_size, + cursor, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if bundle_id is not None: + _path_params['bundle_id'] = bundle_id + # process the query parameters + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + 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='/bundles/{bundle_id}/resources', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_bundle_visibility( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + _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, + ) -> VisibilityInfo: + """get_bundle_visibility + + Gets the visibility of the bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bundle_visibility_serialize( + bundle_id=bundle_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VisibilityInfo", + } + 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_bundle_visibility_with_http_info( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + _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[VisibilityInfo]: + """get_bundle_visibility + + Gets the visibility of the bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bundle_visibility_serialize( + bundle_id=bundle_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VisibilityInfo", + } + 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_bundle_visibility_without_preload_content( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + _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_bundle_visibility + + Gets the visibility of the bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bundle_visibility_serialize( + bundle_id=bundle_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VisibilityInfo", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_bundle_visibility_serialize( + self, + bundle_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if bundle_id is not None: + _path_params['bundle_id'] = bundle_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/bundles/{bundle_id}/visibility', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_bundles( + self, + page_size: Annotated[Optional[StrictInt], Field(description="The maximum number of bundles to return from the beginning of the list. Default is 200, max is 1000.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="A cursor indicating where to start fetching items after a specific point.")] = None, + contains: Annotated[Optional[StrictStr], Field(description="A filter for the bundle name.")] = 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, + ) -> PaginatedBundleList: + """get_bundles + + Returns a list of `Bundle` objects. + + :param page_size: The maximum number of bundles to return from the beginning of the list. Default is 200, max is 1000. + :type page_size: int + :param cursor: A cursor indicating where to start fetching items after a specific point. + :type cursor: str + :param contains: A filter for the bundle name. + :type contains: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bundles_serialize( + page_size=page_size, + cursor=cursor, + contains=contains, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PaginatedBundleList", + } + 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_bundles_with_http_info( + self, + page_size: Annotated[Optional[StrictInt], Field(description="The maximum number of bundles to return from the beginning of the list. Default is 200, max is 1000.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="A cursor indicating where to start fetching items after a specific point.")] = None, + contains: Annotated[Optional[StrictStr], Field(description="A filter for the bundle name.")] = 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[PaginatedBundleList]: + """get_bundles + + Returns a list of `Bundle` objects. + + :param page_size: The maximum number of bundles to return from the beginning of the list. Default is 200, max is 1000. + :type page_size: int + :param cursor: A cursor indicating where to start fetching items after a specific point. + :type cursor: str + :param contains: A filter for the bundle name. + :type contains: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bundles_serialize( + page_size=page_size, + cursor=cursor, + contains=contains, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PaginatedBundleList", + } + 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_bundles_without_preload_content( + self, + page_size: Annotated[Optional[StrictInt], Field(description="The maximum number of bundles to return from the beginning of the list. Default is 200, max is 1000.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="A cursor indicating where to start fetching items after a specific point.")] = None, + contains: Annotated[Optional[StrictStr], Field(description="A filter for the bundle name.")] = 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_bundles + + Returns a list of `Bundle` objects. + + :param page_size: The maximum number of bundles to return from the beginning of the list. Default is 200, max is 1000. + :type page_size: int + :param cursor: A cursor indicating where to start fetching items after a specific point. + :type cursor: str + :param contains: A filter for the bundle name. + :type contains: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bundles_serialize( + page_size=page_size, + cursor=cursor, + contains=contains, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PaginatedBundleList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_bundles_serialize( + self, + page_size, + cursor, + contains, + _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 page_size is not None: + + _query_params.append(('page_size', page_size)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if contains is not None: + + _query_params.append(('contains', contains)) + + # 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='/bundles', + 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 remove_bundle_group( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + group_id: Annotated[StrictStr, Field(description="The ID of the group to remove.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """remove_bundle_group + + Removes a group from a bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param group_id: The ID of the group to remove. (required) + :type group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_bundle_group_serialize( + bundle_id=bundle_id, + group_id=group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def remove_bundle_group_with_http_info( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + group_id: Annotated[StrictStr, Field(description="The ID of the group to remove.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """remove_bundle_group + + Removes a group from a bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param group_id: The ID of the group to remove. (required) + :type group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_bundle_group_serialize( + bundle_id=bundle_id, + group_id=group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def remove_bundle_group_without_preload_content( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + group_id: Annotated[StrictStr, Field(description="The ID of the group to remove.")], + _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: + """remove_bundle_group + + Removes a group from a bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param group_id: The ID of the group to remove. (required) + :type group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_bundle_group_serialize( + bundle_id=bundle_id, + group_id=group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _remove_bundle_group_serialize( + self, + bundle_id, + group_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if bundle_id is not None: + _path_params['bundle_id'] = bundle_id + if group_id is not None: + _path_params['group_id'] = group_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/bundles/{bundle_id}/groups/{group_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def remove_bundle_resource( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + resource_id: Annotated[StrictStr, Field(description="The ID of the resource to remove.")], + access_level_remote_id: Annotated[Optional[StrictStr], Field(description="The remote ID of the access level to grant. If omitted, the default access level remote ID value (empty string) is used.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """remove_bundle_resource + + Removes a resource from a bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param resource_id: The ID of the resource to remove. (required) + :type resource_id: str + :param access_level_remote_id: The remote ID of the access level to grant. If omitted, the default access level remote ID value (empty string) is used. + :type access_level_remote_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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._remove_bundle_resource_serialize( + bundle_id=bundle_id, + resource_id=resource_id, + access_level_remote_id=access_level_remote_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def remove_bundle_resource_with_http_info( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + resource_id: Annotated[StrictStr, Field(description="The ID of the resource to remove.")], + access_level_remote_id: Annotated[Optional[StrictStr], Field(description="The remote ID of the access level to grant. If omitted, the default access level remote ID value (empty string) is used.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """remove_bundle_resource + + Removes a resource from a bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param resource_id: The ID of the resource to remove. (required) + :type resource_id: str + :param access_level_remote_id: The remote ID of the access level to grant. If omitted, the default access level remote ID value (empty string) is used. + :type access_level_remote_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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._remove_bundle_resource_serialize( + bundle_id=bundle_id, + resource_id=resource_id, + access_level_remote_id=access_level_remote_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def remove_bundle_resource_without_preload_content( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + resource_id: Annotated[StrictStr, Field(description="The ID of the resource to remove.")], + access_level_remote_id: Annotated[Optional[StrictStr], Field(description="The remote ID of the access level to grant. If omitted, the default access level remote ID value (empty string) is used.")] = 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: + """remove_bundle_resource + + Removes a resource from a bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param resource_id: The ID of the resource to remove. (required) + :type resource_id: str + :param access_level_remote_id: The remote ID of the access level to grant. If omitted, the default access level remote ID value (empty string) is used. + :type access_level_remote_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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._remove_bundle_resource_serialize( + bundle_id=bundle_id, + resource_id=resource_id, + access_level_remote_id=access_level_remote_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _remove_bundle_resource_serialize( + self, + bundle_id, + resource_id, + access_level_remote_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if bundle_id is not None: + _path_params['bundle_id'] = bundle_id + if resource_id is not None: + _path_params['resource_id'] = resource_id + # process the query parameters + if access_level_remote_id is not None: + + _query_params.append(('access_level_remote_id', access_level_remote_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/bundles/{bundle_id}/resources/{resource_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def set_bundle_visibility( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + visibility_info: VisibilityInfo, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """set_bundle_visibility + + Sets the visibility of the bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param visibility_info: (required) + :type visibility_info: VisibilityInfo + :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._set_bundle_visibility_serialize( + bundle_id=bundle_id, + visibility_info=visibility_info, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def set_bundle_visibility_with_http_info( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + visibility_info: VisibilityInfo, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """set_bundle_visibility + + Sets the visibility of the bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param visibility_info: (required) + :type visibility_info: VisibilityInfo + :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._set_bundle_visibility_serialize( + bundle_id=bundle_id, + visibility_info=visibility_info, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def set_bundle_visibility_without_preload_content( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle.")], + visibility_info: VisibilityInfo, + _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: + """set_bundle_visibility + + Sets the visibility of the bundle. + + :param bundle_id: The ID of the bundle. (required) + :type bundle_id: str + :param visibility_info: (required) + :type visibility_info: VisibilityInfo + :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._set_bundle_visibility_serialize( + bundle_id=bundle_id, + visibility_info=visibility_info, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _set_bundle_visibility_serialize( + self, + bundle_id, + visibility_info, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if bundle_id is not None: + _path_params['bundle_id'] = bundle_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if visibility_info is not None: + _body_params = visibility_info + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/bundles/{bundle_id}/visibility', + 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_bundle( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle to be updated.")], + bundle: Bundle, + _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, + ) -> Bundle: + """update_bundle + + Updates a bundle. + + :param bundle_id: The ID of the bundle to be updated. (required) + :type bundle_id: str + :param bundle: (required) + :type bundle: Bundle + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_bundle_serialize( + bundle_id=bundle_id, + bundle=bundle, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Bundle", + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_bundle_with_http_info( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle to be updated.")], + bundle: Bundle, + _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[Bundle]: + """update_bundle + + Updates a bundle. + + :param bundle_id: The ID of the bundle to be updated. (required) + :type bundle_id: str + :param bundle: (required) + :type bundle: Bundle + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_bundle_serialize( + bundle_id=bundle_id, + bundle=bundle, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Bundle", + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_bundle_without_preload_content( + self, + bundle_id: Annotated[StrictStr, Field(description="The ID of the bundle to be updated.")], + bundle: Bundle, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """update_bundle + + Updates a bundle. + + :param bundle_id: The ID of the bundle to be updated. (required) + :type bundle_id: str + :param bundle: (required) + :type bundle: Bundle + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_bundle_serialize( + bundle_id=bundle_id, + bundle=bundle, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Bundle", + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_bundle_serialize( + self, + bundle_id, + bundle, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if bundle_id is not None: + _path_params['bundle_id'] = bundle_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if bundle is not None: + _body_params = bundle + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/bundles/{bundle_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/opal_security/api/groups_api.py b/opal_security/api/groups_api.py index dd8a954..6214b5a 100644 --- a/opal_security/api/groups_api.py +++ b/opal_security/api/groups_api.py @@ -24,6 +24,8 @@ from opal_security.models.add_group_user_request import AddGroupUserRequest from opal_security.models.create_group_info import CreateGroupInfo from opal_security.models.group import Group +from opal_security.models.group_containing_group import GroupContainingGroup +from opal_security.models.group_containing_group_list import GroupContainingGroupList from opal_security.models.group_resource import GroupResource from opal_security.models.group_resource_list import GroupResourceList from opal_security.models.group_type_enum import GroupTypeEnum @@ -60,6 +62,295 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client + @validate_call + def add_group_containing_group( + self, + group_id: Annotated[StrictStr, Field(description="The ID of the group.")], + group_containing_group: GroupContainingGroup, + _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, + ) -> GroupContainingGroup: + """add_group_containing_group + + Creates a new containing group. + + :param group_id: The ID of the group. (required) + :type group_id: str + :param group_containing_group: (required) + :type group_containing_group: GroupContainingGroup + :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._add_group_containing_group_serialize( + group_id=group_id, + group_containing_group=group_containing_group, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupContainingGroup", + } + 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 add_group_containing_group_with_http_info( + self, + group_id: Annotated[StrictStr, Field(description="The ID of the group.")], + group_containing_group: GroupContainingGroup, + _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[GroupContainingGroup]: + """add_group_containing_group + + Creates a new containing group. + + :param group_id: The ID of the group. (required) + :type group_id: str + :param group_containing_group: (required) + :type group_containing_group: GroupContainingGroup + :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._add_group_containing_group_serialize( + group_id=group_id, + group_containing_group=group_containing_group, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupContainingGroup", + } + 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 add_group_containing_group_without_preload_content( + self, + group_id: Annotated[StrictStr, Field(description="The ID of the group.")], + group_containing_group: GroupContainingGroup, + _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: + """add_group_containing_group + + Creates a new containing group. + + :param group_id: The ID of the group. (required) + :type group_id: str + :param group_containing_group: (required) + :type group_containing_group: GroupContainingGroup + :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._add_group_containing_group_serialize( + group_id=group_id, + group_containing_group=group_containing_group, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupContainingGroup", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _add_group_containing_group_serialize( + self, + group_id, + group_containing_group, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if group_id is not None: + _path_params['group_id'] = group_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if group_containing_group is not None: + _body_params = group_containing_group + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/groups/{group_id}/containing-groups', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def add_group_resource( self, @@ -738,7 +1029,7 @@ def create_group( ) -> Group: """create_group - Creates a group. See [here](https://docs.opal.dev/reference/end-system-objects) for details about importing groups. + Creates an Opal group or [imports a remote group](https://docs.opal.dev/reference/end-system-objects). :param create_group_info: (required) :type create_group_info: CreateGroupInfo @@ -805,7 +1096,7 @@ def create_group_with_http_info( ) -> ApiResponse[Group]: """create_group - Creates a group. See [here](https://docs.opal.dev/reference/end-system-objects) for details about importing groups. + Creates an Opal group or [imports a remote group](https://docs.opal.dev/reference/end-system-objects). :param create_group_info: (required) :type create_group_info: CreateGroupInfo @@ -872,7 +1163,7 @@ def create_group_without_preload_content( ) -> RESTResponseType: """create_group - Creates a group. See [here](https://docs.opal.dev/reference/end-system-objects) for details about importing groups. + Creates an Opal group or [imports a remote group](https://docs.opal.dev/reference/end-system-objects). :param create_group_info: (required) :type create_group_info: CreateGroupInfo @@ -1517,7 +1808,544 @@ def _delete_group_user_serialize( @validate_call - def get_group( + def get_group( + self, + group_id: Annotated[StrictStr, Field(description="The ID of the group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Group: + """get_group + + Returns a `Group` object. + + :param group_id: The ID of the group. (required) + :type group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_group_serialize( + group_id=group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Group", + } + 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_group_with_http_info( + self, + group_id: Annotated[StrictStr, Field(description="The ID of the group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Group]: + """get_group + + Returns a `Group` object. + + :param group_id: The ID of the group. (required) + :type group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_group_serialize( + group_id=group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Group", + } + 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_group_without_preload_content( + self, + group_id: Annotated[StrictStr, Field(description="The ID of the group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_group + + Returns a `Group` object. + + :param group_id: The ID of the group. (required) + :type group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_group_serialize( + group_id=group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Group", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_group_serialize( + self, + group_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if group_id is not None: + _path_params['group_id'] = group_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/groups/{group_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_group_containing_group( + self, + group_id: Annotated[StrictStr, Field(description="The ID of the group.")], + containing_group_id: Annotated[StrictStr, Field(description="The ID of the containing group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GroupContainingGroup: + """get_group_containing_group + + Gets a specific containing group for a group. + + :param group_id: The ID of the group. (required) + :type group_id: str + :param containing_group_id: The ID of the containing group. (required) + :type containing_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_group_containing_group_serialize( + group_id=group_id, + containing_group_id=containing_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupContainingGroup", + } + 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_group_containing_group_with_http_info( + self, + group_id: Annotated[StrictStr, Field(description="The ID of the group.")], + containing_group_id: Annotated[StrictStr, Field(description="The ID of the containing group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GroupContainingGroup]: + """get_group_containing_group + + Gets a specific containing group for a group. + + :param group_id: The ID of the group. (required) + :type group_id: str + :param containing_group_id: The ID of the containing group. (required) + :type containing_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_group_containing_group_serialize( + group_id=group_id, + containing_group_id=containing_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupContainingGroup", + } + 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_group_containing_group_without_preload_content( + self, + group_id: Annotated[StrictStr, Field(description="The ID of the group.")], + containing_group_id: Annotated[StrictStr, Field(description="The ID of the containing group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_group_containing_group + + Gets a specific containing group for a group. + + :param group_id: The ID of the group. (required) + :type group_id: str + :param containing_group_id: The ID of the containing group. (required) + :type containing_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_group_containing_group_serialize( + group_id=group_id, + containing_group_id=containing_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupContainingGroup", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_group_containing_group_serialize( + self, + group_id, + containing_group_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if group_id is not None: + _path_params['group_id'] = group_id + if containing_group_id is not None: + _path_params['containing_group_id'] = containing_group_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/groups/{group_id}/containing-groups/{containing_group_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_group_containing_groups( self, group_id: Annotated[StrictStr, Field(description="The ID of the group.")], _request_timeout: Union[ @@ -1532,10 +2360,10 @@ def get_group( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Group: - """get_group + ) -> GroupContainingGroupList: + """get_group_containing_groups - Returns a `Group` object. + Gets the list of groups that the group gives access to. :param group_id: The ID of the group. (required) :type group_id: str @@ -1561,7 +2389,7 @@ def get_group( :return: Returns the result object. """ # noqa: E501 - _param = self._get_group_serialize( + _param = self._get_group_containing_groups_serialize( group_id=group_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1570,7 +2398,7 @@ def get_group( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Group", + '200': "GroupContainingGroupList", } response_data = self.api_client.call_api( *_param, @@ -1584,7 +2412,7 @@ def get_group( @validate_call - def get_group_with_http_info( + def get_group_containing_groups_with_http_info( self, group_id: Annotated[StrictStr, Field(description="The ID of the group.")], _request_timeout: Union[ @@ -1599,10 +2427,10 @@ def get_group_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Group]: - """get_group + ) -> ApiResponse[GroupContainingGroupList]: + """get_group_containing_groups - Returns a `Group` object. + Gets the list of groups that the group gives access to. :param group_id: The ID of the group. (required) :type group_id: str @@ -1628,7 +2456,7 @@ def get_group_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_group_serialize( + _param = self._get_group_containing_groups_serialize( group_id=group_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1637,7 +2465,7 @@ def get_group_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Group", + '200': "GroupContainingGroupList", } response_data = self.api_client.call_api( *_param, @@ -1651,7 +2479,7 @@ def get_group_with_http_info( @validate_call - def get_group_without_preload_content( + def get_group_containing_groups_without_preload_content( self, group_id: Annotated[StrictStr, Field(description="The ID of the group.")], _request_timeout: Union[ @@ -1667,9 +2495,9 @@ def get_group_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_group + """get_group_containing_groups - Returns a `Group` object. + Gets the list of groups that the group gives access to. :param group_id: The ID of the group. (required) :type group_id: str @@ -1695,7 +2523,7 @@ def get_group_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_group_serialize( + _param = self._get_group_containing_groups_serialize( group_id=group_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1704,7 +2532,7 @@ def get_group_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Group", + '200': "GroupContainingGroupList", } response_data = self.api_client.call_api( *_param, @@ -1713,7 +2541,7 @@ def get_group_without_preload_content( return response_data.response - def _get_group_serialize( + def _get_group_containing_groups_serialize( self, group_id, _request_auth, @@ -1761,7 +2589,7 @@ def _get_group_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/groups/{group_id}', + resource_path='/groups/{group_id}/containing-groups', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4203,6 +5031,275 @@ def _get_groups_serialize( + @validate_call + def remove_group_containing_group( + self, + group_id: Annotated[StrictStr, Field(description="The ID of the group.")], + containing_group_id: Annotated[StrictStr, Field(description="The ID of the containing group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """remove_group_containing_group + + Removes a containing group from a group. + + :param group_id: The ID of the group. (required) + :type group_id: str + :param containing_group_id: The ID of the containing group. (required) + :type containing_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_group_containing_group_serialize( + group_id=group_id, + containing_group_id=containing_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def remove_group_containing_group_with_http_info( + self, + group_id: Annotated[StrictStr, Field(description="The ID of the group.")], + containing_group_id: Annotated[StrictStr, Field(description="The ID of the containing group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """remove_group_containing_group + + Removes a containing group from a group. + + :param group_id: The ID of the group. (required) + :type group_id: str + :param containing_group_id: The ID of the containing group. (required) + :type containing_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_group_containing_group_serialize( + group_id=group_id, + containing_group_id=containing_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def remove_group_containing_group_without_preload_content( + self, + group_id: Annotated[StrictStr, Field(description="The ID of the group.")], + containing_group_id: Annotated[StrictStr, Field(description="The ID of the containing group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """remove_group_containing_group + + Removes a containing group from a group. + + :param group_id: The ID of the group. (required) + :type group_id: str + :param containing_group_id: The ID of the containing group. (required) + :type containing_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_group_containing_group_serialize( + group_id=group_id, + containing_group_id=containing_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _remove_group_containing_group_serialize( + self, + group_id, + containing_group_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if group_id is not None: + _path_params['group_id'] = group_id + if containing_group_id is not None: + _path_params['containing_group_id'] = containing_group_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/groups/{group_id}/containing-groups/{containing_group_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def set_group_message_channels( self, diff --git a/opal_security/api/resources_api.py b/opal_security/api/resources_api.py index ec94fca..c2173e4 100644 --- a/opal_security/api/resources_api.py +++ b/opal_security/api/resources_api.py @@ -38,6 +38,7 @@ from opal_security.models.reviewer_stage_list import ReviewerStageList from opal_security.models.tags_list import TagsList from opal_security.models.update_resource_info_list import UpdateResourceInfoList +from opal_security.models.update_resource_user_request import UpdateResourceUserRequest from opal_security.models.visibility_info import VisibilityInfo from opal_security.api_client import ApiClient, RequestSerialized @@ -5754,6 +5755,310 @@ def _set_resource_visibility_serialize( + @validate_call + def update_resource_user( + self, + resource_id: Annotated[StrictStr, Field(description="The ID of the resource.")], + user_id: Annotated[StrictStr, Field(description="The ID of the user whose access is being updated.")], + update_resource_user_request: UpdateResourceUserRequest, + _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, + ) -> ResourceUser: + """update_resource_user + + Updates a user's access level or duration on this resource. + + :param resource_id: The ID of the resource. (required) + :type resource_id: str + :param user_id: The ID of the user whose access is being updated. (required) + :type user_id: str + :param update_resource_user_request: (required) + :type update_resource_user_request: UpdateResourceUserRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_resource_user_serialize( + resource_id=resource_id, + user_id=user_id, + update_resource_user_request=update_resource_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResourceUser", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_resource_user_with_http_info( + self, + resource_id: Annotated[StrictStr, Field(description="The ID of the resource.")], + user_id: Annotated[StrictStr, Field(description="The ID of the user whose access is being updated.")], + update_resource_user_request: UpdateResourceUserRequest, + _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[ResourceUser]: + """update_resource_user + + Updates a user's access level or duration on this resource. + + :param resource_id: The ID of the resource. (required) + :type resource_id: str + :param user_id: The ID of the user whose access is being updated. (required) + :type user_id: str + :param update_resource_user_request: (required) + :type update_resource_user_request: UpdateResourceUserRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_resource_user_serialize( + resource_id=resource_id, + user_id=user_id, + update_resource_user_request=update_resource_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResourceUser", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_resource_user_without_preload_content( + self, + resource_id: Annotated[StrictStr, Field(description="The ID of the resource.")], + user_id: Annotated[StrictStr, Field(description="The ID of the user whose access is being updated.")], + update_resource_user_request: UpdateResourceUserRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """update_resource_user + + Updates a user's access level or duration on this resource. + + :param resource_id: The ID of the resource. (required) + :type resource_id: str + :param user_id: The ID of the user whose access is being updated. (required) + :type user_id: str + :param update_resource_user_request: (required) + :type update_resource_user_request: UpdateResourceUserRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_resource_user_serialize( + resource_id=resource_id, + user_id=user_id, + update_resource_user_request=update_resource_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResourceUser", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_resource_user_serialize( + self, + resource_id, + user_id, + update_resource_user_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if resource_id is not None: + _path_params['resource_id'] = resource_id + if user_id is not None: + _path_params['user_id'] = user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if update_resource_user_request is not None: + _body_params = update_resource_user_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/resources/{resource_id}/users/{user_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def update_resources( self, diff --git a/opal_security/configuration.py b/opal_security/configuration.py index f8a4d28..47c40a4 100644 --- a/opal_security/configuration.py +++ b/opal_security/configuration.py @@ -19,7 +19,7 @@ from logging import FileHandler import multiprocessing import sys -from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict +from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union from typing_extensions import NotRequired, Self import urllib3 @@ -162,6 +162,8 @@ class Configuration: :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. :param retries: Number of retries for API requests. + :param ca_cert_data: verify the peer using concatenated CA certificate data + in PEM (str) or DER (bytes) format. :Example: """ @@ -176,13 +178,14 @@ def __init__( username: Optional[str]=None, password: Optional[str]=None, access_token: Optional[str]=None, - server_index: Optional[int]=None, + server_index: Optional[int]=None, server_variables: Optional[ServerVariablesT]=None, server_operation_index: Optional[Dict[int, int]]=None, server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, ignore_operation_servers: bool=False, ssl_ca_cert: Optional[str]=None, retries: Optional[int] = None, + ca_cert_data: Optional[Union[str, bytes]] = None, *, debug: Optional[bool] = None, ) -> None: @@ -260,6 +263,10 @@ def __init__( self.ssl_ca_cert = ssl_ca_cert """Set this to customize the certificate file to verify the peer. """ + self.ca_cert_data = ca_cert_data + """Set this to verify the peer using PEM (str) or DER (bytes) + certificate data. + """ self.cert_file = None """client certificate file """ diff --git a/opal_security/models/__init__.py b/opal_security/models/__init__.py index 38f376b..dde490a 100644 --- a/opal_security/models/__init__.py +++ b/opal_security/models/__init__.py @@ -17,6 +17,9 @@ # import models into model package from opal_security.models.access import Access from opal_security.models.access_list import AccessList +from opal_security.models.access_rule_condition import AccessRuleCondition +from opal_security.models.add_bundle_group_request import AddBundleGroupRequest +from opal_security.models.add_bundle_resource_request import AddBundleResourceRequest from opal_security.models.add_group_resource_request import AddGroupResourceRequest from opal_security.models.add_group_user_request import AddGroupUserRequest from opal_security.models.add_resource_nhi_request import AddResourceNhiRequest @@ -29,8 +32,12 @@ from opal_security.models.apps_list import AppsList from opal_security.models.aws_permission_set_metadata import AwsPermissionSetMetadata from opal_security.models.aws_permission_set_metadata_aws_permission_set import AwsPermissionSetMetadataAwsPermissionSet +from opal_security.models.bundle import Bundle +from opal_security.models.bundle_group import BundleGroup +from opal_security.models.bundle_resource import BundleResource from opal_security.models.condition import Condition from opal_security.models.configuration_template import ConfigurationTemplate +from opal_security.models.create_bundle_info import CreateBundleInfo from opal_security.models.create_configuration_template_info import CreateConfigurationTemplateInfo from opal_security.models.create_group_binding_info import CreateGroupBindingInfo from opal_security.models.create_group_binding_info_groups_inner import CreateGroupBindingInfoGroupsInner @@ -54,6 +61,8 @@ from opal_security.models.group_access_level import GroupAccessLevel from opal_security.models.group_binding import GroupBinding from opal_security.models.group_binding_group import GroupBindingGroup +from opal_security.models.group_containing_group import GroupContainingGroup +from opal_security.models.group_containing_group_list import GroupContainingGroupList from opal_security.models.group_remote_info import GroupRemoteInfo from opal_security.models.group_remote_info_active_directory_group import GroupRemoteInfoActiveDirectoryGroup from opal_security.models.group_remote_info_azure_ad_microsoft365_group import GroupRemoteInfoAzureAdMicrosoft365Group @@ -69,6 +78,7 @@ from opal_security.models.group_type_enum import GroupTypeEnum from opal_security.models.group_user import GroupUser from opal_security.models.group_user_list import GroupUserList +from opal_security.models.group_with_access_level import GroupWithAccessLevel from opal_security.models.idp_group_mapping import IdpGroupMapping from opal_security.models.idp_group_mapping_list import IdpGroupMappingList from opal_security.models.message_channel import MessageChannel @@ -80,6 +90,9 @@ from opal_security.models.on_call_schedule_list import OnCallScheduleList from opal_security.models.on_call_schedule_provider_enum import OnCallScheduleProviderEnum from opal_security.models.owner import Owner +from opal_security.models.paginated_bundle_group_list import PaginatedBundleGroupList +from opal_security.models.paginated_bundle_list import PaginatedBundleList +from opal_security.models.paginated_bundle_resource_list import PaginatedBundleResourceList from opal_security.models.paginated_configuration_template_list import PaginatedConfigurationTemplateList from opal_security.models.paginated_event_list import PaginatedEventList from opal_security.models.paginated_group_bindings_list import PaginatedGroupBindingsList @@ -140,6 +153,9 @@ from opal_security.models.reviewer_stage import ReviewerStage from opal_security.models.reviewer_stage_list import ReviewerStageList from opal_security.models.risk_sensitivity_enum import RiskSensitivityEnum +from opal_security.models.rule_clauses import RuleClauses +from opal_security.models.rule_conjunction import RuleConjunction +from opal_security.models.rule_disjunction import RuleDisjunction from opal_security.models.session import Session from opal_security.models.sessions_list import SessionsList from opal_security.models.sub_event import SubEvent @@ -147,6 +163,7 @@ from opal_security.models.sync_error_list import SyncErrorList from opal_security.models.tag import Tag from opal_security.models.tag_filter import TagFilter +from opal_security.models.tag_selector import TagSelector from opal_security.models.tags_list import TagsList from opal_security.models.ticket_propagation_configuration import TicketPropagationConfiguration from opal_security.models.ticketing_provider_enum import TicketingProviderEnum @@ -165,6 +182,7 @@ from opal_security.models.update_owner_info_list import UpdateOwnerInfoList from opal_security.models.update_resource_info import UpdateResourceInfo 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_hr_idp_status_enum import UserHrIdpStatusEnum from opal_security.models.user_id_list import UserIDList diff --git a/opal_security/models/access_rule_condition.py b/opal_security/models/access_rule_condition.py new file mode 100644 index 0000000..f1f53d3 --- /dev/null +++ b/opal_security/models/access_rule_condition.py @@ -0,0 +1,114 @@ +# 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, field_validator +from typing import Any, ClassVar, Dict, List +from opal_security.models.rule_clauses import RuleClauses +from typing import Optional, Set +from typing_extensions import Self + +class AccessRuleCondition(BaseModel): + """ + # Access Rule Config Object ### Description The `AccessRuleConfig` object is used to represent an access rule configuration. ### Usage Example Get access rule configurations from the `GET Access Rule Configs` endpoint. + """ # noqa: E501 + status: StrictStr = Field(description="The status of the access rule.") + rule_clauses: RuleClauses = Field(alias="ruleClauses") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["status", "ruleClauses"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ACTIVE', 'PAUSED']): + raise ValueError("must be one of enum values ('ACTIVE', 'PAUSED')") + 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 AccessRuleCondition 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 rule_clauses + if self.rule_clauses: + _dict['ruleClauses'] = self.rule_clauses.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(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AccessRuleCondition from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "ruleClauses": RuleClauses.from_dict(obj["ruleClauses"]) if obj.get("ruleClauses") 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/add_bundle_group_request.py b/opal_security/models/add_bundle_group_request.py new file mode 100644 index 0000000..3801982 --- /dev/null +++ b/opal_security/models/add_bundle_group_request.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 AddBundleGroupRequest(BaseModel): + """ + AddBundleGroupRequest + """ # noqa: E501 + group_id: StrictStr = Field(description="The ID of the group to add.") + 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 AddBundleGroupRequest 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 AddBundleGroupRequest 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/add_bundle_resource_request.py b/opal_security/models/add_bundle_resource_request.py new file mode 100644 index 0000000..9320d29 --- /dev/null +++ b/opal_security/models/add_bundle_resource_request.py @@ -0,0 +1,105 @@ +# 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 typing import Optional, Set +from typing_extensions import Self + +class AddBundleResourceRequest(BaseModel): + """ + AddBundleResourceRequest + """ # noqa: E501 + resource_id: StrictStr = Field(description="The ID of the resource to add.") + access_level_remote_id: Optional[StrictStr] = Field(default=None, description="The remote ID of the access level to grant to this user. Required if the resource being added requires an access level. If omitted, the default access level remote ID value (empty string) is used.") + access_level_name: Optional[StrictStr] = Field(default=None, description="The name of the access level to grant to this user. If omitted, the default access level name value (empty string) is used.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["resource_id", "access_level_remote_id", "access_level_name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AddBundleResourceRequest 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 AddBundleResourceRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "resource_id": obj.get("resource_id"), + "access_level_remote_id": obj.get("access_level_remote_id"), + "access_level_name": obj.get("access_level_name") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/opal_security/models/bundle.py b/opal_security/models/bundle.py new file mode 100644 index 0000000..bf2965b --- /dev/null +++ b/opal_security/models/bundle.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Bundle(BaseModel): + """ + Bundle + """ # noqa: E501 + bundle_id: Optional[StrictStr] = Field(default=None, description="The ID of the bundle.") + name: Optional[StrictStr] = Field(default=None, description="The name of the bundle.") + description: Optional[StrictStr] = Field(default=None, description="The description of the bundle.") + created_at: Optional[datetime] = Field(default=None, description="The creation timestamp of the bundle, in ISO 8601 format") + updated_at: Optional[datetime] = Field(default=None, description="The last updated timestamp of the bundle, in ISO 8601 format") + admin_owner_id: Optional[StrictStr] = Field(default=None, description="The ID of the owner of the bundle.") + total_num_items: Optional[StrictInt] = Field(default=None, description="The total number of items in the bundle.") + total_num_resources: Optional[StrictInt] = Field(default=None, description="The total number of resources in the bundle.") + total_num_groups: Optional[StrictInt] = Field(default=None, description="The total number of groups in the bundle.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["bundle_id", "name", "description", "created_at", "updated_at", "admin_owner_id", "total_num_items", "total_num_resources", "total_num_groups"] + + 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 Bundle from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "bundle_id", + "created_at", + "updated_at", + "total_num_items", + "total_num_resources", + "total_num_groups", + "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 Bundle from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bundle_id": obj.get("bundle_id"), + "name": obj.get("name"), + "description": obj.get("description"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "admin_owner_id": obj.get("admin_owner_id"), + "total_num_items": obj.get("total_num_items"), + "total_num_resources": obj.get("total_num_resources"), + "total_num_groups": obj.get("total_num_groups") + }) + # 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/bundle_group.py b/opal_security/models/bundle_group.py new file mode 100644 index 0000000..a5fbb43 --- /dev/null +++ b/opal_security/models/bundle_group.py @@ -0,0 +1,107 @@ +# 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 typing import Optional, Set +from typing_extensions import Self + +class BundleGroup(BaseModel): + """ + BundleGroup + """ # noqa: E501 + bundle_id: Optional[StrictStr] = Field(default=None, description="The ID of the bundle containing the group.") + group_id: Optional[StrictStr] = Field(default=None, description="The ID of the group within a bundle.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["bundle_id", "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 BundleGroup from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "bundle_id", + "group_id", + "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 BundleGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bundle_id": obj.get("bundle_id"), + "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/bundle_resource.py b/opal_security/models/bundle_resource.py new file mode 100644 index 0000000..004c46e --- /dev/null +++ b/opal_security/models/bundle_resource.py @@ -0,0 +1,111 @@ +# 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 typing import Optional, Set +from typing_extensions import Self + +class BundleResource(BaseModel): + """ + BundleResource + """ # noqa: E501 + bundle_id: Optional[StrictStr] = Field(default=None, description="The ID of the bundle containing the resource.") + resource_id: Optional[StrictStr] = Field(default=None, description="The ID of the resource within a bundle.") + access_level_name: Optional[StrictStr] = Field(default=None, description="The access level of the resource within a bundle.") + access_level_remote_id: Optional[StrictStr] = Field(default=None, description="The remote ID of the access level of the resource within a bundle.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["bundle_id", "resource_id", "access_level_name", "access_level_remote_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 BundleResource from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "bundle_id", + "resource_id", + "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 BundleResource from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bundle_id": obj.get("bundle_id"), + "resource_id": obj.get("resource_id"), + "access_level_name": obj.get("access_level_name"), + "access_level_remote_id": obj.get("access_level_remote_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/create_bundle_info.py b/opal_security/models/create_bundle_info.py new file mode 100644 index 0000000..aeee56a --- /dev/null +++ b/opal_security/models/create_bundle_info.py @@ -0,0 +1,105 @@ +# 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 typing import Optional, Set +from typing_extensions import Self + +class CreateBundleInfo(BaseModel): + """ + # CreateBundleInfo Object ### Description The `CreateBundleInfo` object is used to store creation info for a bundle. ### Usage Example Use in the `POST Bundles` endpoint. + """ # noqa: E501 + name: StrictStr = Field(description="The name of the bundle.") + description: Optional[StrictStr] = Field(default=None, description="A brief description of the bundle.") + admin_owner_id: StrictStr = Field(description="The ID of the bundle's admin owner.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["name", "description", "admin_owner_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 CreateBundleInfo 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 CreateBundleInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "description": obj.get("description"), + "admin_owner_id": obj.get("admin_owner_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_containing_group.py b/opal_security/models/group_containing_group.py new file mode 100644 index 0000000..07c62c8 --- /dev/null +++ b/opal_security/models/group_containing_group.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class 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: StrictStr = Field(description="The groupID of the containing group.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["containing_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 GroupContainingGroup 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 GroupContainingGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "containing_group_id": obj.get("containing_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_containing_group_list.py b/opal_security/models/group_containing_group_list.py new file mode 100644 index 0000000..3965510 --- /dev/null +++ b/opal_security/models/group_containing_group_list.py @@ -0,0 +1,109 @@ +# 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 +from typing import Any, ClassVar, Dict, List +from opal_security.models.group_containing_group import GroupContainingGroup +from typing import Optional, Set +from typing_extensions import Self + +class GroupContainingGroupList(BaseModel): + """ + GroupContainingGroupList + """ # noqa: E501 + containing_groups: List[GroupContainingGroup] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["containing_groups"] + + 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 GroupContainingGroupList 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 containing_groups (list) + _items = [] + if self.containing_groups: + for _item_containing_groups in self.containing_groups: + if _item_containing_groups: + _items.append(_item_containing_groups.to_dict()) + _dict['containing_groups'] = _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 GroupContainingGroupList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "containing_groups": [GroupContainingGroup.from_dict(_item) for _item in obj["containing_groups"]] if obj.get("containing_groups") 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/group_with_access_level.py b/opal_security/models/group_with_access_level.py new file mode 100644 index 0000000..fcd4df8 --- /dev/null +++ b/opal_security/models/group_with_access_level.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class GroupWithAccessLevel(BaseModel): + """ + Information about a group and corresponding access level + """ # noqa: E501 + group_id: StrictStr = Field(description="The ID of the group.") + access_level_remote_id: Optional[StrictStr] = Field(default=None, description="The ID of the resource.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["group_id", "access_level_remote_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 GroupWithAccessLevel 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 GroupWithAccessLevel 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"), + "access_level_remote_id": obj.get("access_level_remote_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/paginated_bundle_group_list.py b/opal_security/models/paginated_bundle_group_list.py new file mode 100644 index 0000000..dfae5f7 --- /dev/null +++ b/opal_security/models/paginated_bundle_group_list.py @@ -0,0 +1,115 @@ +# 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from opal_security.models.bundle_group import BundleGroup +from typing import Optional, Set +from typing_extensions import Self + +class PaginatedBundleGroupList(BaseModel): + """ + PaginatedBundleGroupList + """ # noqa: E501 + previous: Optional[StrictStr] = Field(default=None, description="The cursor used to obtain the current result page.") + next: Optional[StrictStr] = Field(default=None, description="The cursor with which to continue pagination if additional result pages exist.") + total_count: Optional[StrictInt] = Field(default=None, description="The total number of items in the result set.") + bundle_groups: List[BundleGroup] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["previous", "next", "total_count", "bundle_groups"] + + 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 PaginatedBundleGroupList 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 bundle_groups (list) + _items = [] + if self.bundle_groups: + for _item_bundle_groups in self.bundle_groups: + if _item_bundle_groups: + _items.append(_item_bundle_groups.to_dict()) + _dict['bundle_groups'] = _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 PaginatedBundleGroupList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "previous": obj.get("previous"), + "next": obj.get("next"), + "total_count": obj.get("total_count"), + "bundle_groups": [BundleGroup.from_dict(_item) for _item in obj["bundle_groups"]] if obj.get("bundle_groups") 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/paginated_bundle_list.py b/opal_security/models/paginated_bundle_list.py new file mode 100644 index 0000000..f0c259f --- /dev/null +++ b/opal_security/models/paginated_bundle_list.py @@ -0,0 +1,115 @@ +# 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from opal_security.models.bundle import Bundle +from typing import Optional, Set +from typing_extensions import Self + +class PaginatedBundleList(BaseModel): + """ + PaginatedBundleList + """ # noqa: E501 + previous: Optional[StrictStr] = Field(default=None, description="The cursor used to obtain the current result page.") + next: Optional[StrictStr] = Field(default=None, description="The cursor with which to continue pagination if additional result pages exist.") + total_count: Optional[StrictInt] = Field(default=None, description="The total number of items in the result set.") + bundles: List[Bundle] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["previous", "next", "total_count", "bundles"] + + 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 PaginatedBundleList 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 bundles (list) + _items = [] + if self.bundles: + for _item_bundles in self.bundles: + if _item_bundles: + _items.append(_item_bundles.to_dict()) + _dict['bundles'] = _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 PaginatedBundleList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "previous": obj.get("previous"), + "next": obj.get("next"), + "total_count": obj.get("total_count"), + "bundles": [Bundle.from_dict(_item) for _item in obj["bundles"]] if obj.get("bundles") 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/paginated_bundle_resource_list.py b/opal_security/models/paginated_bundle_resource_list.py new file mode 100644 index 0000000..2a009b4 --- /dev/null +++ b/opal_security/models/paginated_bundle_resource_list.py @@ -0,0 +1,115 @@ +# 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from opal_security.models.bundle_resource import BundleResource +from typing import Optional, Set +from typing_extensions import Self + +class PaginatedBundleResourceList(BaseModel): + """ + PaginatedBundleResourceList + """ # noqa: E501 + previous: Optional[StrictStr] = Field(default=None, description="The cursor used to obtain the current result page.") + next: Optional[StrictStr] = Field(default=None, description="The cursor with which to continue pagination if additional result pages exist.") + total_count: Optional[StrictInt] = Field(default=None, description="The total number of items in the result set.") + bundle_resources: List[BundleResource] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["previous", "next", "total_count", "bundle_resources"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PaginatedBundleResourceList 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 bundle_resources (list) + _items = [] + if self.bundle_resources: + for _item_bundle_resources in self.bundle_resources: + if _item_bundle_resources: + _items.append(_item_bundle_resources.to_dict()) + _dict['bundle_resources'] = _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 PaginatedBundleResourceList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "previous": obj.get("previous"), + "next": obj.get("next"), + "total_count": obj.get("total_count"), + "bundle_resources": [BundleResource.from_dict(_item) for _item in obj["bundle_resources"]] if obj.get("bundle_resources") 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/rule_clauses.py b/opal_security/models/rule_clauses.py new file mode 100644 index 0000000..7c9489e --- /dev/null +++ b/opal_security/models/rule_clauses.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 +from typing import Any, ClassVar, Dict, List, Optional +from opal_security.models.rule_conjunction import RuleConjunction +from typing import Optional, Set +from typing_extensions import Self + +class RuleClauses(BaseModel): + """ + RuleClauses + """ # noqa: E501 + when: RuleConjunction + unless: Optional[RuleConjunction] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["when", "unless"] + + 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 RuleClauses 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 when + if self.when: + _dict['when'] = self.when.to_dict() + # override the default output from pydantic by calling `to_dict()` of unless + if self.unless: + _dict['unless'] = self.unless.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(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RuleClauses from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "when": RuleConjunction.from_dict(obj["when"]) if obj.get("when") is not None else None, + "unless": RuleConjunction.from_dict(obj["unless"]) if obj.get("unless") 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/rule_conjunction.py b/opal_security/models/rule_conjunction.py new file mode 100644 index 0000000..f00a4ff --- /dev/null +++ b/opal_security/models/rule_conjunction.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, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from opal_security.models.rule_disjunction import RuleDisjunction +from typing import Optional, Set +from typing_extensions import Self + +class RuleConjunction(BaseModel): + """ + RuleConjunction + """ # noqa: E501 + clauses: Annotated[List[RuleDisjunction], Field(min_length=1)] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["clauses"] + + 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 RuleConjunction 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 clauses (list) + _items = [] + if self.clauses: + for _item_clauses in self.clauses: + if _item_clauses: + _items.append(_item_clauses.to_dict()) + _dict['clauses'] = _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 RuleConjunction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "clauses": [RuleDisjunction.from_dict(_item) for _item in obj["clauses"]] if obj.get("clauses") 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/rule_disjunction.py b/opal_security/models/rule_disjunction.py new file mode 100644 index 0000000..bdbc7bc --- /dev/null +++ b/opal_security/models/rule_disjunction.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, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from opal_security.models.tag_selector import TagSelector +from typing import Optional, Set +from typing_extensions import Self + +class RuleDisjunction(BaseModel): + """ + RuleDisjunction + """ # noqa: E501 + selectors: Annotated[List[TagSelector], Field(min_length=1)] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["selectors"] + + 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 RuleDisjunction 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 selectors (list) + _items = [] + if self.selectors: + for _item_selectors in self.selectors: + if _item_selectors: + _items.append(_item_selectors.to_dict()) + _dict['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(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RuleDisjunction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + 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 + }) + # 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/tag_selector.py b/opal_security/models/tag_selector.py new file mode 100644 index 0000000..2ed4a68 --- /dev/null +++ b/opal_security/models/tag_selector.py @@ -0,0 +1,105 @@ +# 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 +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class TagSelector(BaseModel): + """ + TagSelector + """ # noqa: E501 + key: StrictStr + value: StrictStr + connection_id: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["key", "value", "connection_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 TagSelector 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 TagSelector from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "key": obj.get("key"), + "value": obj.get("value"), + "connection_id": obj.get("connection_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/update_resource_user_request.py b/opal_security/models/update_resource_user_request.py new file mode 100644 index 0000000..cef9218 --- /dev/null +++ b/opal_security/models/update_resource_user_request.py @@ -0,0 +1,104 @@ +# 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 typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +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.") + 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"] + + 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 UpdateResourceUserRequest 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 UpdateResourceUserRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "duration_minutes": obj.get("duration_minutes"), + "access_level_remote_id": obj.get("access_level_remote_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/rest.py b/opal_security/rest.py index 34aa2ca..7044330 100644 --- a/opal_security/rest.py +++ b/opal_security/rest.py @@ -77,6 +77,7 @@ def __init__(self, configuration) -> None: "ca_certs": configuration.ssl_ca_cert, "cert_file": configuration.cert_file, "key_file": configuration.key_file, + "ca_cert_data": configuration.ca_cert_data, } if configuration.assert_hostname is not None: pool_args['assert_hostname'] = ( diff --git a/test/test_access_rule_condition.py b/test/test_access_rule_condition.py new file mode 100644 index 0000000..0779bbb --- /dev/null +++ b/test/test_access_rule_condition.py @@ -0,0 +1,95 @@ +# 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.access_rule_condition import AccessRuleCondition + +class TestAccessRuleCondition(unittest.TestCase): + """AccessRuleCondition unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AccessRuleCondition: + """Test AccessRuleCondition + 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 `AccessRuleCondition` + """ + model = AccessRuleCondition() + if include_optional: + return AccessRuleCondition( + 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 = '', ) + ], ) + ], ), + 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 AccessRuleCondition( + 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 = '', ) + ], ) + ], ), + 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 testAccessRuleCondition(self): + """Test AccessRuleCondition""" + # 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_access_rules_api.py b/test/test_access_rules_api.py new file mode 100644 index 0000000..5a9121a --- /dev/null +++ b/test/test_access_rules_api.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from opal_security.api.access_rules_api import AccessRulesApi + + +class TestAccessRulesApi(unittest.TestCase): + """AccessRulesApi unit test stubs""" + + def setUp(self) -> None: + self.api = AccessRulesApi() + + def tearDown(self) -> None: + pass + + def test_get_access_rule(self) -> None: + """Test case for get_access_rule + + """ + pass + + def test_update_access_rule(self) -> None: + """Test case for update_access_rule + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_add_bundle_group_request.py b/test/test_add_bundle_group_request.py new file mode 100644 index 0000000..b42e1af --- /dev/null +++ b/test/test_add_bundle_group_request.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.add_bundle_group_request import AddBundleGroupRequest + +class TestAddBundleGroupRequest(unittest.TestCase): + """AddBundleGroupRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AddBundleGroupRequest: + """Test AddBundleGroupRequest + 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 `AddBundleGroupRequest` + """ + model = AddBundleGroupRequest() + if include_optional: + return AddBundleGroupRequest( + group_id = '72e75a6f-7183-48c5-94ff-6013f213314b' + ) + else: + return AddBundleGroupRequest( + group_id = '72e75a6f-7183-48c5-94ff-6013f213314b', + ) + """ + + def testAddBundleGroupRequest(self): + """Test AddBundleGroupRequest""" + # 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_add_bundle_resource_request.py b/test/test_add_bundle_resource_request.py new file mode 100644 index 0000000..939ef0c --- /dev/null +++ b/test/test_add_bundle_resource_request.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from opal_security.models.add_bundle_resource_request import AddBundleResourceRequest + +class TestAddBundleResourceRequest(unittest.TestCase): + """AddBundleResourceRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AddBundleResourceRequest: + """Test AddBundleResourceRequest + 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 `AddBundleResourceRequest` + """ + model = AddBundleResourceRequest() + if include_optional: + return AddBundleResourceRequest( + resource_id = '72e75a6f-7183-48c5-94ff-6013f213314b', + access_level_remote_id = 'arn:aws:iam::590304332660:role/AdministratorAccess', + access_level_name = 'AdministratorAccess' + ) + else: + return AddBundleResourceRequest( + resource_id = '72e75a6f-7183-48c5-94ff-6013f213314b', + ) + """ + + def testAddBundleResourceRequest(self): + """Test AddBundleResourceRequest""" + # 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_bundle.py b/test/test_bundle.py new file mode 100644 index 0000000..23eb6ca --- /dev/null +++ b/test/test_bundle.py @@ -0,0 +1,60 @@ +# 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.bundle import Bundle + +class TestBundle(unittest.TestCase): + """Bundle unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Bundle: + """Test Bundle + 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 `Bundle` + """ + model = Bundle() + if include_optional: + return Bundle( + bundle_id = 'a381e7a3-e5e0-4c48-b1d6-4ccb4c191bc1', + name = 'Bundle 1', + description = 'Description of bundle 1', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + admin_owner_id = '4aed3e8a-727b-4d72-8010-3b8710c50bec', + total_num_items = 15, + total_num_resources = 10, + total_num_groups = 5 + ) + else: + return Bundle( + ) + """ + + def testBundle(self): + """Test Bundle""" + # 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_bundle_group.py b/test/test_bundle_group.py new file mode 100644 index 0000000..4a9944d --- /dev/null +++ b/test/test_bundle_group.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from opal_security.models.bundle_group import BundleGroup + +class TestBundleGroup(unittest.TestCase): + """BundleGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BundleGroup: + """Test BundleGroup + 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 `BundleGroup` + """ + model = BundleGroup() + if include_optional: + return BundleGroup( + bundle_id = 'a381e7a3-e5e0-4c48-b1d6-4ccb4c191bc1', + group_id = 'a381e7a3-e5e0-4c48-b1d6-4ccb4c191bc1' + ) + else: + return BundleGroup( + ) + """ + + def testBundleGroup(self): + """Test BundleGroup""" + # 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_bundle_resource.py b/test/test_bundle_resource.py new file mode 100644 index 0000000..2498348 --- /dev/null +++ b/test/test_bundle_resource.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from opal_security.models.bundle_resource import BundleResource + +class TestBundleResource(unittest.TestCase): + """BundleResource unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BundleResource: + """Test BundleResource + 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 `BundleResource` + """ + model = BundleResource() + if include_optional: + return BundleResource( + bundle_id = 'a381e7a3-e5e0-4c48-b1d6-4ccb4c191bc1', + resource_id = 'a381e7a3-e5e0-4c48-b1d6-4ccb4c191bc1', + access_level_name = 'Read', + access_level_remote_id = 'arn:aws:iam::490306337630:role/SupportUser' + ) + else: + return BundleResource( + ) + """ + + def testBundleResource(self): + """Test BundleResource""" + # 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_bundles_api.py b/test/test_bundles_api.py new file mode 100644 index 0000000..fd6bf98 --- /dev/null +++ b/test/test_bundles_api.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 + + +import unittest + +from opal_security.api.bundles_api import BundlesApi + + +class TestBundlesApi(unittest.TestCase): + """BundlesApi unit test stubs""" + + def setUp(self) -> None: + self.api = BundlesApi() + + def tearDown(self) -> None: + pass + + def test_add_bundle_group(self) -> None: + """Test case for add_bundle_group + + """ + pass + + def test_add_bundle_resource(self) -> None: + """Test case for add_bundle_resource + + """ + pass + + def test_create_bundle(self) -> None: + """Test case for create_bundle + + """ + pass + + def test_delete_bundle(self) -> None: + """Test case for delete_bundle + + """ + pass + + def test_get_bundle(self) -> None: + """Test case for get_bundle + + """ + pass + + def test_get_bundle_groups(self) -> None: + """Test case for get_bundle_groups + + """ + pass + + def test_get_bundle_resources(self) -> None: + """Test case for get_bundle_resources + + """ + pass + + def test_get_bundle_visibility(self) -> None: + """Test case for get_bundle_visibility + + """ + pass + + def test_get_bundles(self) -> None: + """Test case for get_bundles + + """ + pass + + def test_remove_bundle_group(self) -> None: + """Test case for remove_bundle_group + + """ + pass + + def test_remove_bundle_resource(self) -> None: + """Test case for remove_bundle_resource + + """ + pass + + def test_set_bundle_visibility(self) -> None: + """Test case for set_bundle_visibility + + """ + pass + + def test_update_bundle(self) -> None: + """Test case for update_bundle + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_bundle_info.py b/test/test_create_bundle_info.py new file mode 100644 index 0000000..3f9b78d --- /dev/null +++ b/test/test_create_bundle_info.py @@ -0,0 +1,56 @@ +# 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.create_bundle_info import CreateBundleInfo + +class TestCreateBundleInfo(unittest.TestCase): + """CreateBundleInfo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateBundleInfo: + """Test CreateBundleInfo + 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 `CreateBundleInfo` + """ + model = CreateBundleInfo() + if include_optional: + return CreateBundleInfo( + name = 'Test Bundle', + description = 'This is a test bundle', + admin_owner_id = '7c86c85d-0651-43e2-a748-d69d658418e8' + ) + else: + return CreateBundleInfo( + name = 'Test Bundle', + admin_owner_id = '7c86c85d-0651-43e2-a748-d69d658418e8', + ) + """ + + def testCreateBundleInfo(self): + """Test CreateBundleInfo""" + # 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_containing_group.py b/test/test_group_containing_group.py new file mode 100644 index 0000000..91aa14b --- /dev/null +++ b/test/test_group_containing_group.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Opal API + + The Opal API is a RESTful API that allows you to interact with the Opal Security platform programmatically. + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from opal_security.models.group_containing_group import GroupContainingGroup + +class TestGroupContainingGroup(unittest.TestCase): + """GroupContainingGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GroupContainingGroup: + """Test GroupContainingGroup + 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 `GroupContainingGroup` + """ + model = GroupContainingGroup() + if include_optional: + return GroupContainingGroup( + containing_group_id = 'f454d283-ca87-4a8a-bdbb-df212eca5353' + ) + else: + return GroupContainingGroup( + containing_group_id = 'f454d283-ca87-4a8a-bdbb-df212eca5353', + ) + """ + + def testGroupContainingGroup(self): + """Test GroupContainingGroup""" + # 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_containing_group_list.py b/test/test_group_containing_group_list.py new file mode 100644 index 0000000..2dbceb6 --- /dev/null +++ b/test/test_group_containing_group_list.py @@ -0,0 +1,57 @@ +# 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_containing_group_list import GroupContainingGroupList + +class TestGroupContainingGroupList(unittest.TestCase): + """GroupContainingGroupList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GroupContainingGroupList: + """Test GroupContainingGroupList + 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 `GroupContainingGroupList` + """ + model = GroupContainingGroupList() + if include_optional: + return GroupContainingGroupList( + containing_groups = [ + {containing_group_id=f454d283-ca87-4a8a-bdbb-df212eca5353} + ] + ) + else: + return GroupContainingGroupList( + containing_groups = [ + {containing_group_id=f454d283-ca87-4a8a-bdbb-df212eca5353} + ], + ) + """ + + def testGroupContainingGroupList(self): + """Test GroupContainingGroupList""" + # 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_with_access_level.py b/test/test_group_with_access_level.py new file mode 100644 index 0000000..f0fa22e --- /dev/null +++ b/test/test_group_with_access_level.py @@ -0,0 +1,54 @@ +# 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_with_access_level import GroupWithAccessLevel + +class TestGroupWithAccessLevel(unittest.TestCase): + """GroupWithAccessLevel unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GroupWithAccessLevel: + """Test GroupWithAccessLevel + 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 `GroupWithAccessLevel` + """ + model = GroupWithAccessLevel() + if include_optional: + return GroupWithAccessLevel( + group_id = '7870617d-e72a-47f5-a84c-693817ab4567', + access_level_remote_id = 'write' + ) + else: + return GroupWithAccessLevel( + group_id = '7870617d-e72a-47f5-a84c-693817ab4567', + ) + """ + + def testGroupWithAccessLevel(self): + """Test GroupWithAccessLevel""" + # 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_bundle_group_list.py b/test/test_paginated_bundle_group_list.py new file mode 100644 index 0000000..57f1892 --- /dev/null +++ b/test/test_paginated_bundle_group_list.py @@ -0,0 +1,64 @@ +# 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_bundle_group_list import PaginatedBundleGroupList + +class TestPaginatedBundleGroupList(unittest.TestCase): + """PaginatedBundleGroupList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PaginatedBundleGroupList: + """Test PaginatedBundleGroupList + 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 `PaginatedBundleGroupList` + """ + model = PaginatedBundleGroupList() + if include_optional: + return PaginatedBundleGroupList( + previous = 'cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ', + next = 'cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw', + total_count = 2, + bundle_groups = [ + opal_security.models.bundle_group.BundleGroup( + bundle_id = 'a381e7a3-e5e0-4c48-b1d6-4ccb4c191bc1', + group_id = 'a381e7a3-e5e0-4c48-b1d6-4ccb4c191bc1', ) + ] + ) + else: + return PaginatedBundleGroupList( + bundle_groups = [ + opal_security.models.bundle_group.BundleGroup( + bundle_id = 'a381e7a3-e5e0-4c48-b1d6-4ccb4c191bc1', + group_id = 'a381e7a3-e5e0-4c48-b1d6-4ccb4c191bc1', ) + ], + ) + """ + + def testPaginatedBundleGroupList(self): + """Test PaginatedBundleGroupList""" + # 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_bundle_list.py b/test/test_paginated_bundle_list.py new file mode 100644 index 0000000..688671f --- /dev/null +++ b/test/test_paginated_bundle_list.py @@ -0,0 +1,78 @@ +# 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_bundle_list import PaginatedBundleList + +class TestPaginatedBundleList(unittest.TestCase): + """PaginatedBundleList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PaginatedBundleList: + """Test PaginatedBundleList + 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 `PaginatedBundleList` + """ + model = PaginatedBundleList() + if include_optional: + return PaginatedBundleList( + previous = 'cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ', + next = 'cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw', + total_count = 2, + bundles = [ + opal_security.models.bundle.Bundle( + bundle_id = 'a381e7a3-e5e0-4c48-b1d6-4ccb4c191bc1', + name = 'Bundle 1', + description = 'Description of bundle 1', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + admin_owner_id = '4aed3e8a-727b-4d72-8010-3b8710c50bec', + total_num_items = 15, + total_num_resources = 10, + total_num_groups = 5, ) + ] + ) + else: + return PaginatedBundleList( + bundles = [ + opal_security.models.bundle.Bundle( + bundle_id = 'a381e7a3-e5e0-4c48-b1d6-4ccb4c191bc1', + name = 'Bundle 1', + description = 'Description of bundle 1', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + admin_owner_id = '4aed3e8a-727b-4d72-8010-3b8710c50bec', + total_num_items = 15, + total_num_resources = 10, + total_num_groups = 5, ) + ], + ) + """ + + def testPaginatedBundleList(self): + """Test PaginatedBundleList""" + # 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_bundle_resource_list.py b/test/test_paginated_bundle_resource_list.py new file mode 100644 index 0000000..be67633 --- /dev/null +++ b/test/test_paginated_bundle_resource_list.py @@ -0,0 +1,68 @@ +# 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_bundle_resource_list import PaginatedBundleResourceList + +class TestPaginatedBundleResourceList(unittest.TestCase): + """PaginatedBundleResourceList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PaginatedBundleResourceList: + """Test PaginatedBundleResourceList + 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 `PaginatedBundleResourceList` + """ + model = PaginatedBundleResourceList() + if include_optional: + return PaginatedBundleResourceList( + previous = 'cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ', + next = 'cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw', + total_count = 2, + bundle_resources = [ + opal_security.models.bundle_resource.BundleResource( + bundle_id = 'a381e7a3-e5e0-4c48-b1d6-4ccb4c191bc1', + resource_id = 'a381e7a3-e5e0-4c48-b1d6-4ccb4c191bc1', + access_level_name = 'Read', + access_level_remote_id = 'arn:aws:iam::490306337630:role/SupportUser', ) + ] + ) + else: + return PaginatedBundleResourceList( + bundle_resources = [ + opal_security.models.bundle_resource.BundleResource( + bundle_id = 'a381e7a3-e5e0-4c48-b1d6-4ccb4c191bc1', + resource_id = 'a381e7a3-e5e0-4c48-b1d6-4ccb4c191bc1', + access_level_name = 'Read', + access_level_remote_id = 'arn:aws:iam::490306337630:role/SupportUser', ) + ], + ) + """ + + def testPaginatedBundleResourceList(self): + """Test PaginatedBundleResourceList""" + # 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_rule_clauses.py b/test/test_rule_clauses.py new file mode 100644 index 0000000..2e0649d --- /dev/null +++ b/test/test_rule_clauses.py @@ -0,0 +1,81 @@ +# 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.rule_clauses import RuleClauses + +class TestRuleClauses(unittest.TestCase): + """RuleClauses unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RuleClauses: + """Test RuleClauses + 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 `RuleClauses` + """ + model = RuleClauses() + if include_optional: + return 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 = '', ) + ], ) + ], ), + 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 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 = '', ) + ], ) + ], ), + ) + """ + + def testRuleClauses(self): + """Test RuleClauses""" + # 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_rule_conjunction.py b/test/test_rule_conjunction.py new file mode 100644 index 0000000..93098f6 --- /dev/null +++ b/test/test_rule_conjunction.py @@ -0,0 +1,69 @@ +# 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.rule_conjunction import RuleConjunction + +class TestRuleConjunction(unittest.TestCase): + """RuleConjunction unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RuleConjunction: + """Test RuleConjunction + 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 `RuleConjunction` + """ + model = RuleConjunction() + if include_optional: + return RuleConjunction( + clauses = [ + opal_security.models.rule_disjunction.RuleDisjunction( + selectors = [ + opal_security.models.tag_selector.TagSelector( + key = '', + value = '', + connection_id = '', ) + ], ) + ] + ) + else: + return RuleConjunction( + clauses = [ + opal_security.models.rule_disjunction.RuleDisjunction( + selectors = [ + opal_security.models.tag_selector.TagSelector( + key = '', + value = '', + connection_id = '', ) + ], ) + ], + ) + """ + + def testRuleConjunction(self): + """Test RuleConjunction""" + # 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_rule_disjunction.py b/test/test_rule_disjunction.py new file mode 100644 index 0000000..bfcb6ad --- /dev/null +++ b/test/test_rule_disjunction.py @@ -0,0 +1,63 @@ +# 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.rule_disjunction import RuleDisjunction + +class TestRuleDisjunction(unittest.TestCase): + """RuleDisjunction unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RuleDisjunction: + """Test RuleDisjunction + 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 `RuleDisjunction` + """ + model = RuleDisjunction() + if include_optional: + return RuleDisjunction( + selectors = [ + opal_security.models.tag_selector.TagSelector( + key = '', + value = '', + connection_id = '', ) + ] + ) + else: + return RuleDisjunction( + selectors = [ + opal_security.models.tag_selector.TagSelector( + key = '', + value = '', + connection_id = '', ) + ], + ) + """ + + def testRuleDisjunction(self): + """Test RuleDisjunction""" + # 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_tag_selector.py b/test/test_tag_selector.py new file mode 100644 index 0000000..0ff41b9 --- /dev/null +++ b/test/test_tag_selector.py @@ -0,0 +1,57 @@ +# 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.tag_selector import TagSelector + +class TestTagSelector(unittest.TestCase): + """TagSelector unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TagSelector: + """Test TagSelector + 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 `TagSelector` + """ + model = TagSelector() + if include_optional: + return TagSelector( + key = '', + value = '', + connection_id = '' + ) + else: + return TagSelector( + key = '', + value = '', + connection_id = '', + ) + """ + + def testTagSelector(self): + """Test TagSelector""" + # 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_update_resource_user_request.py b/test/test_update_resource_user_request.py new file mode 100644 index 0000000..d45a6bf --- /dev/null +++ b/test/test_update_resource_user_request.py @@ -0,0 +1,54 @@ +# 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.update_resource_user_request import UpdateResourceUserRequest + +class TestUpdateResourceUserRequest(unittest.TestCase): + """UpdateResourceUserRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateResourceUserRequest: + """Test UpdateResourceUserRequest + 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 `UpdateResourceUserRequest` + """ + model = UpdateResourceUserRequest() + if include_optional: + return UpdateResourceUserRequest( + duration_minutes = 120, + access_level_remote_id = 'arn:aws:iam::590304332660:role/ReadOnlyAccess' + ) + else: + return UpdateResourceUserRequest( + duration_minutes = 120, + ) + """ + + def testUpdateResourceUserRequest(self): + """Test UpdateResourceUserRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main()