├── test ├── __init__.py ├── trashed_items.py ├── recent_items.py ├── shared_links_app_items.py ├── storage_policies.py ├── file_version_legal_holds.py ├── transfer.py ├── device_pinners.py ├── invites.py ├── sign_templates.py ├── terms_of_services.py ├── groups.py ├── users.py ├── folder_watermarks.py └── email_aliases.py ├── requirements.txt ├── requirements-test.txt ├── requirements-dev.txt ├── box_sdk_gen ├── networking │ ├── version.py │ ├── proxy_config.py │ ├── network_client.py │ ├── __init__.py │ ├── base_urls.py │ ├── fetch_response.py │ └── auth.py ├── parameters │ ├── __init__.py │ └── v2025_r0 │ │ ├── __init__.py │ │ └── box_version_header_v2025_r0.py ├── serialization │ └── __init__.py ├── internal │ ├── null_value.py │ ├── errors.py │ ├── __init__.py │ └── logging.py ├── schemas │ ├── metadata_instance_value.py │ ├── resource.py │ ├── ai_agent_allowed_entity.py │ ├── ai_ask_agent.py │ ├── metadata_query_result_item.py │ ├── ai_extract_agent.py │ ├── ai_text_gen_agent.py │ ├── collaboration_access_grantee.py │ ├── collaboration_item.py │ ├── item.py │ ├── legal_hold_policy_assigned_item.py │ ├── search_result_item.py │ ├── recent_item_resource.py │ ├── ai_extract_structured_agent.py │ ├── app_item_associated_item.py │ ├── search_result_with_shared_link_item.py │ ├── search_results_response.py │ ├── uploaded_part.py │ ├── v2025_r0 │ │ ├── hub_access_grantee_v2025_r0.py │ │ ├── doc_gen_template_create_request_v2025_r0.py │ │ ├── doc_gen_template_base_v2025_r0.py │ │ ├── doc_gen_tags_processing_message_v2025_r0.py │ │ ├── hub_item_reference_v2025_r0.py │ │ ├── enterprise_configuration_item_v2025_r0.py │ │ ├── doc_gen_document_generation_data_v2025_r0.py │ │ ├── hub_collaboration_update_request_v2025_r0.py │ │ ├── external_users_submit_delete_job_request_v2025_r0.py │ │ ├── hub_items_manage_response_v2025_r0.py │ │ ├── custom_session_duration_group_item_v2025_r0.py │ │ ├── user_tracking_code_v2025_r0.py │ │ ├── shield_lists_v2025_r0.py │ │ ├── hub_create_request_v2025_r0.py │ │ ├── external_users_submit_delete_job_response_v2025_r0.py │ │ ├── hub_items_manage_request_v2025_r0.py │ │ ├── enterprise_configuration_shield_v2025_r0.py │ │ ├── doc_gen_template_v2025_r0.py │ │ ├── hub_copy_request_v2025_r0.py │ │ ├── shield_list_content_request_v2025_r0.py │ │ ├── user_base_v2025_r0.py │ │ ├── group_base_v2025_r0.py │ │ ├── file_reference_v2025_r0.py │ │ ├── hub_item_v2025_r0.py │ │ ├── enterprise_configuration_item_string_v2025_r0.py │ │ ├── list_user_v2025_r0.py │ │ ├── enterprise_configuration_item_boolean_v2025_r0.py │ │ ├── enterprise_configuration_item_integer_v2025_r0.py │ │ ├── user_reference_v2025_r0.py │ │ ├── folder_reference_v2025_r0.py │ │ ├── external_user_deletion_result_v2025_r0.py │ │ ├── weblink_reference_v2025_r0.py │ │ ├── enterprise_feature_settings_item_v2025_r0.py │ │ ├── doc_gen_job_base_v2025_r0.py │ │ ├── file_version_base_v2025_r0.py │ │ ├── doc_gen_batch_base_v2025_r0.py │ │ ├── shield_list_content_v2025_r0.py │ │ ├── enterprise_reference_v2025_r0.py │ │ ├── user_or_group_reference_v2025_r0.py │ │ ├── terms_of_service_base_v2025_r0.py │ │ ├── shield_list_content_ip_v2025_r0.py │ │ ├── shield_list_content_domain_v2025_r0.py │ │ ├── shield_list_content_email_v2025_r0.py │ │ ├── shield_list_content_country_v2025_r0.py │ │ ├── doc_gen_tag_v2025_r0.py │ │ ├── hub_base_v2025_r0.py │ │ ├── hub_item_operation_v2025_r0.py │ │ ├── user_mini_v2025_r0.py │ │ ├── hubs_v2025_r0.py │ │ ├── hub_items_v2025_r0.py │ │ ├── hub_collaboration_user_v2025_r0.py │ │ ├── archives_v2025_r0.py │ │ ├── hub_collaborations_v2025_r0.py │ │ └── group_mini_v2025_r0.py │ ├── ai_agent.py │ ├── metadata_filter_value.py │ ├── skill_card.py │ ├── event_source_resource.py │ ├── session_termination_message.py │ ├── ai_llm_endpoint_params.py │ ├── shield_information_barrier_reference.py │ ├── metadata_taxonomy_levels.py │ ├── sign_request_signer_attachment.py │ ├── integration_mappings_teams.py │ ├── integration_mapping_teams_create_request.py │ ├── user_base.py │ ├── group_base.py │ ├── o_auth_2_error.py │ ├── files.py │ ├── folder_reference.py │ ├── upload_url.py │ ├── email_aliases.py │ ├── integration_mapping_slack_options.py │ ├── shield_information_barrier_report_details.py │ ├── metadatas.py │ ├── realtime_servers.py │ ├── comment_base.py │ ├── terms_of_services.py │ ├── file_version_base.py │ ├── task_assignments.py │ ├── sign_request_signer_input_zip_validation.py │ ├── storage_policy_mini.py │ ├── enterprise_base.py │ ├── sign_request_signer_input_zip_4_validation.py │ ├── sign_request_signer_input_ssn_validation.py │ ├── sign_request_signer_input_email_validation.py │ ├── sign_request_signer_input_date_us_validation.py │ ├── sign_request_signer_input_date_eu_validation.py │ ├── sign_request_signer_input_date_iso_validation.py │ ├── terms_of_service_base.py │ ├── legal_hold_policy_mini.py │ ├── sign_request_signer_input_date_asia_validation.py │ ├── retention_policy_base.py │ ├── terms_of_service_user_statuses.py │ ├── integration_mapping_box_item_slack.py │ ├── tasks.py │ ├── ai_agent_text_gen.py │ ├── integration_mapping_slack_create_request.py │ ├── app_item.py │ ├── storage_policy.py │ ├── ai_item_ask.py │ ├── sign_request_signer_input_number_with_comma_validation.py │ ├── metadata_error.py │ ├── sign_request_signer_input_number_with_period_validation.py │ ├── integration_mapping_base.py │ ├── shield_information_barrier_base.py │ ├── upload_part_mini.py │ ├── metadata_field_filter_float_range.py │ ├── legal_hold_policy_assignment_base.py │ ├── watermark.py │ ├── ai_item_base.py │ ├── integration_mapping_partner_item_teams.py │ ├── user_mini.py │ ├── ai_dialogue_history.py │ ├── post_o_auth_2_revoke.py │ ├── shield_information_barrier_report_base.py │ ├── user_integration_mappings.py │ ├── metadata_field_filter_date_range.py │ ├── ai_extract_structured_response.py │ ├── web_link_base.py │ ├── ai_response.py │ ├── ai_extract.py │ ├── tracking_code.py │ ├── outcome.py │ ├── events.py │ ├── ai_citation.py │ ├── shield_information_barrier_segment_member_base.py │ ├── ai_agent_extract.py │ ├── folder_locks.py │ ├── shield_information_barrier_segment_restriction_base.py │ ├── ai_agent_reference.py │ ├── device_pinner.py │ ├── sign_requests.py │ ├── group_mini.py │ ├── integration_mapping_partner_item_teams_create_request.py │ ├── shield_information_barrier_segment_member_mini.py │ ├── email_alias.py │ ├── sign_request_prefill_tag.py │ ├── user_avatar.py │ ├── integration_mappings.py │ ├── metadata_taxonomy_ancestor.py │ ├── file_version_mini.py │ ├── retention_policies.py │ ├── app_item_event_source.py │ ├── metadata_taxonomy_level.py │ ├── retention_policy_assignments.py │ ├── shield_information_barriers.py │ ├── ai_agent_extract_structured.py │ ├── app_item_association.py │ └── app_item_associations.py ├── __init__.py └── box │ └── __init__.py ├── .codegen.json ├── .pypirc ├── pytest.ini ├── .github ├── workflows │ ├── semantic-pr.yml │ ├── spell-check-lint.yml │ ├── notify-changelog.yml │ └── autoupdate-pr.yml ├── ISSUE_TEMPLATE │ ├── enhancement.md │ └── config.yml └── stale.yml ├── .versionrc ├── CONTRIBUTING.md └── docs ├── event-stream.md ├── shared_links_app_items.md ├── external_users.md └── enterprise_configurations.md /test/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | -e . 2 | -------------------------------------------------------------------------------- /requirements-test.txt: -------------------------------------------------------------------------------- 1 | -e .[test] 2 | -------------------------------------------------------------------------------- /requirements-dev.txt: -------------------------------------------------------------------------------- 1 | -e .[test,dev] 2 | -------------------------------------------------------------------------------- /box_sdk_gen/networking/version.py: -------------------------------------------------------------------------------- 1 | __version__ = '10.3.0' 2 | -------------------------------------------------------------------------------- /box_sdk_gen/parameters/__init__.py: -------------------------------------------------------------------------------- 1 | from box_sdk_gen.parameters.v2025_r0 import * 2 | -------------------------------------------------------------------------------- /box_sdk_gen/serialization/__init__.py: -------------------------------------------------------------------------------- 1 | from box_sdk_gen.serialization.json import * 2 | -------------------------------------------------------------------------------- /.codegen.json: -------------------------------------------------------------------------------- 1 | { "engineHash": "41c28e1", "specHash": "1617aaf", "version": "10.3.0" } 2 | -------------------------------------------------------------------------------- /box_sdk_gen/internal/null_value.py: -------------------------------------------------------------------------------- 1 | class NullValue: 2 | pass 3 | 4 | 5 | null = NullValue() 6 | -------------------------------------------------------------------------------- /box_sdk_gen/parameters/v2025_r0/__init__.py: -------------------------------------------------------------------------------- 1 | from box_sdk_gen.parameters.v2025_r0.box_version_header_v2025_r0 import * 2 | -------------------------------------------------------------------------------- /.pypirc: -------------------------------------------------------------------------------- 1 | [distutils] 2 | index-servers= 3 | pypi 4 | testpypi 5 | 6 | [pypi] 7 | 8 | [testpypi] 9 | repository: https://test.pypi.org/legacy/ -------------------------------------------------------------------------------- /pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | addopts = --strict-markers --showlocals -r a --tb=long 3 | xfail_strict = True 4 | junit_suite_name = box_sdk_gen 5 | testpaths = test/ 6 | python_files=*.py 7 | timeout=90 8 | 9 | 10 | -------------------------------------------------------------------------------- /box_sdk_gen/parameters/v2025_r0/box_version_header_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.box.errors import BoxSDKError 4 | 5 | 6 | class BoxVersionHeaderV2025R0(str, Enum): 7 | _2025_0 = '2025.0' 8 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/metadata_instance_value.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | MetadataInstanceValue = Union[str, int, float, List[str]] 8 | -------------------------------------------------------------------------------- /box_sdk_gen/internal/errors.py: -------------------------------------------------------------------------------- 1 | class GeneratedCodeError(Exception): 2 | def __init__(self, message: str, **kwargs): 3 | super().__init__(message) 4 | self.name = 'GeneratedCodeError' 5 | self.message = message 6 | self.extra = kwargs 7 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/resource.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from box_sdk_gen.schemas.folder_mini import FolderMini 4 | 5 | from box_sdk_gen.schemas.file_mini import FileMini 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | Resource = Union[FolderMini, FileMini] 10 | -------------------------------------------------------------------------------- /box_sdk_gen/internal/__init__.py: -------------------------------------------------------------------------------- 1 | from box_sdk_gen.internal.utils import * 2 | 3 | from box_sdk_gen.internal.logging import * 4 | 5 | from box_sdk_gen.internal.errors import * 6 | 7 | from box_sdk_gen.internal.base_object import * 8 | 9 | from box_sdk_gen.internal.null_value import * 10 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/ai_agent_allowed_entity.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from box_sdk_gen.schemas.user_base import UserBase 4 | 5 | from box_sdk_gen.schemas.group_base import GroupBase 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | AiAgentAllowedEntity = Union[UserBase, GroupBase] 10 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/ai_ask_agent.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from box_sdk_gen.schemas.ai_agent_reference import AiAgentReference 4 | 5 | from box_sdk_gen.schemas.ai_agent_ask import AiAgentAsk 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | AiAskAgent = Union[AiAgentReference, AiAgentAsk] 10 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/metadata_query_result_item.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from box_sdk_gen.schemas.file_full import FileFull 4 | 5 | from box_sdk_gen.schemas.folder_full import FolderFull 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | MetadataQueryResultItem = Union[FileFull, FolderFull] 10 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/ai_extract_agent.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from box_sdk_gen.schemas.ai_agent_reference import AiAgentReference 4 | 5 | from box_sdk_gen.schemas.ai_agent_extract import AiAgentExtract 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | AiExtractAgent = Union[AiAgentReference, AiAgentExtract] 10 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/ai_text_gen_agent.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from box_sdk_gen.schemas.ai_agent_reference import AiAgentReference 4 | 5 | from box_sdk_gen.schemas.ai_agent_text_gen import AiAgentTextGen 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | AiTextGenAgent = Union[AiAgentReference, AiAgentTextGen] 10 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/collaboration_access_grantee.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from box_sdk_gen.schemas.user_collaborations import UserCollaborations 4 | 5 | from box_sdk_gen.schemas.group_mini import GroupMini 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | CollaborationAccessGrantee = Union[UserCollaborations, GroupMini] 10 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/collaboration_item.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from box_sdk_gen.schemas.file import File 4 | 5 | from box_sdk_gen.schemas.folder import Folder 6 | 7 | from box_sdk_gen.schemas.web_link import WebLink 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | CollaborationItem = Union[File, Folder, WebLink] 12 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/item.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from box_sdk_gen.schemas.file_full import FileFull 4 | 5 | from box_sdk_gen.schemas.folder_mini import FolderMini 6 | 7 | from box_sdk_gen.schemas.web_link import WebLink 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | Item = Union[FileFull, FolderMini, WebLink] 12 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/legal_hold_policy_assigned_item.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from box_sdk_gen.schemas.file import File 4 | 5 | from box_sdk_gen.schemas.folder import Folder 6 | 7 | from box_sdk_gen.schemas.web_link import WebLink 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | LegalHoldPolicyAssignedItem = Union[File, Folder, WebLink] 12 | -------------------------------------------------------------------------------- /box_sdk_gen/__init__.py: -------------------------------------------------------------------------------- 1 | from box_sdk_gen.box import * 2 | 3 | from box_sdk_gen.serialization import * 4 | 5 | from box_sdk_gen.internal import * 6 | 7 | from box_sdk_gen.networking import * 8 | 9 | from box_sdk_gen.schemas import * 10 | 11 | from box_sdk_gen.parameters import * 12 | 13 | from box_sdk_gen.managers import * 14 | 15 | from box_sdk_gen.client import * 16 | -------------------------------------------------------------------------------- /box_sdk_gen/box/__init__.py: -------------------------------------------------------------------------------- 1 | from box_sdk_gen.box.event_stream import * 2 | 3 | from box_sdk_gen.box.errors import * 4 | 5 | from box_sdk_gen.box.token_storage import * 6 | 7 | from box_sdk_gen.box.developer_token_auth import * 8 | 9 | from box_sdk_gen.box.oauth import * 10 | 11 | from box_sdk_gen.box.jwt_auth import * 12 | 13 | from box_sdk_gen.box.ccg_auth import * 14 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/search_result_item.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from box_sdk_gen.schemas.file_full import FileFull 4 | 5 | from box_sdk_gen.schemas.folder_full import FolderFull 6 | 7 | from box_sdk_gen.schemas.web_link import WebLink 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | SearchResultItem = Union[FileFull, FolderFull, WebLink] 12 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/recent_item_resource.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from box_sdk_gen.schemas.file_full import FileFull 4 | 5 | from box_sdk_gen.schemas.folder_full import FolderFull 6 | 7 | from box_sdk_gen.schemas.web_link import WebLink 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | RecentItemResource = Union[FileFull, FolderFull, WebLink] 12 | -------------------------------------------------------------------------------- /box_sdk_gen/networking/proxy_config.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | 4 | class ProxyConfig: 5 | def __init__( 6 | self, 7 | url: str, 8 | *, 9 | username: Optional[str] = None, 10 | password: Optional[str] = None 11 | ): 12 | self.url = url 13 | self.username = username 14 | self.password = password 15 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/ai_extract_structured_agent.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from box_sdk_gen.schemas.ai_agent_reference import AiAgentReference 4 | 5 | from box_sdk_gen.schemas.ai_agent_extract_structured import AiAgentExtractStructured 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | AiExtractStructuredAgent = Union[AiAgentReference, AiAgentExtractStructured] 10 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/app_item_associated_item.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from box_sdk_gen.schemas.file_base import FileBase 4 | 5 | from box_sdk_gen.schemas.folder_base import FolderBase 6 | 7 | from box_sdk_gen.schemas.web_link_base import WebLinkBase 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | AppItemAssociatedItem = Union[FileBase, FolderBase, WebLinkBase] 12 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/search_result_with_shared_link_item.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from box_sdk_gen.schemas.file_full import FileFull 4 | 5 | from box_sdk_gen.schemas.folder_full import FolderFull 6 | 7 | from box_sdk_gen.schemas.web_link import WebLink 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | SearchResultWithSharedLinkItem = Union[FileFull, FolderFull, WebLink] 12 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/search_results_response.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from box_sdk_gen.schemas.search_results import SearchResults 4 | 5 | from box_sdk_gen.schemas.search_results_with_shared_links import ( 6 | SearchResultsWithSharedLinks, 7 | ) 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | SearchResultsResponse = Union[SearchResults, SearchResultsWithSharedLinks] 12 | -------------------------------------------------------------------------------- /box_sdk_gen/networking/network_client.py: -------------------------------------------------------------------------------- 1 | from abc import abstractmethod 2 | 3 | from box_sdk_gen.networking.fetch_options import FetchOptions 4 | 5 | from box_sdk_gen.networking.fetch_response import FetchResponse 6 | 7 | 8 | class NetworkClient: 9 | def __init__(self): 10 | pass 11 | 12 | @abstractmethod 13 | def fetch(self, options: FetchOptions) -> FetchResponse: 14 | pass 15 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/uploaded_part.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.schemas.upload_part import UploadPart 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class UploadedPart(BaseObject): 11 | def __init__(self, *, part: Optional[UploadPart] = None, **kwargs): 12 | super().__init__(**kwargs) 13 | self.part = part 14 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/hub_access_grantee_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from box_sdk_gen.schemas.v2025_r0.hub_collaboration_user_v2025_r0 import ( 4 | HubCollaborationUserV2025R0, 5 | ) 6 | 7 | from box_sdk_gen.schemas.v2025_r0.group_mini_v2025_r0 import GroupMiniV2025R0 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | HubAccessGranteeV2025R0 = Union[HubCollaborationUserV2025R0, GroupMiniV2025R0] 12 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/doc_gen_template_create_request_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from box_sdk_gen.internal.base_object import BaseObject 2 | 3 | from box_sdk_gen.schemas.v2025_r0.file_reference_v2025_r0 import FileReferenceV2025R0 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class DocGenTemplateCreateRequestV2025R0(BaseObject): 9 | def __init__(self, file: FileReferenceV2025R0, **kwargs): 10 | super().__init__(**kwargs) 11 | self.file = file 12 | -------------------------------------------------------------------------------- /.github/workflows/semantic-pr.yml: -------------------------------------------------------------------------------- 1 | name: Semantic PR 2 | 3 | on: 4 | pull_request_target: 5 | types: 6 | - opened 7 | - edited 8 | - synchronize 9 | branches: 10 | - main 11 | 12 | permissions: 13 | contents: read 14 | 15 | jobs: 16 | main: 17 | name: Validate semantic PR title 18 | runs-on: ubuntu-latest 19 | steps: 20 | - uses: amannn/action-semantic-pull-request@v4 21 | env: 22 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 23 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/ai_agent.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from box_sdk_gen.schemas.ai_agent_ask import AiAgentAsk 4 | 5 | from box_sdk_gen.schemas.ai_agent_text_gen import AiAgentTextGen 6 | 7 | from box_sdk_gen.schemas.ai_agent_extract import AiAgentExtract 8 | 9 | from box_sdk_gen.schemas.ai_agent_extract_structured import AiAgentExtractStructured 10 | 11 | from box_sdk_gen.box.errors import BoxSDKError 12 | 13 | AiAgent = Union[AiAgentAsk, AiAgentTextGen, AiAgentExtract, AiAgentExtractStructured] 14 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/doc_gen_template_base_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.schemas.v2025_r0.file_reference_v2025_r0 import FileReferenceV2025R0 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class DocGenTemplateBaseV2025R0(BaseObject): 11 | def __init__(self, *, file: Optional[FileReferenceV2025R0] = None, **kwargs): 12 | super().__init__(**kwargs) 13 | self.file = file 14 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/metadata_filter_value.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.schemas.metadata_field_filter_float_range import ( 6 | MetadataFieldFilterFloatRange, 7 | ) 8 | 9 | from box_sdk_gen.schemas.metadata_field_filter_date_range import ( 10 | MetadataFieldFilterDateRange, 11 | ) 12 | 13 | from box_sdk_gen.box.errors import BoxSDKError 14 | 15 | MetadataFilterValue = Union[ 16 | str, float, List[str], MetadataFieldFilterFloatRange, MetadataFieldFilterDateRange 17 | ] 18 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/doc_gen_tags_processing_message_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from box_sdk_gen.internal.base_object import BaseObject 2 | 3 | from box_sdk_gen.box.errors import BoxSDKError 4 | 5 | 6 | class DocGenTagsProcessingMessageV2025R0(BaseObject): 7 | def __init__(self, message: str, **kwargs): 8 | """ 9 | :param message: A message informing the user that document tags are still being processed. 10 | :type message: str 11 | """ 12 | super().__init__(**kwargs) 13 | self.message = message 14 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/skill_card.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from box_sdk_gen.schemas.keyword_skill_card import KeywordSkillCard 4 | 5 | from box_sdk_gen.schemas.timeline_skill_card import TimelineSkillCard 6 | 7 | from box_sdk_gen.schemas.transcript_skill_card import TranscriptSkillCard 8 | 9 | from box_sdk_gen.schemas.status_skill_card import StatusSkillCard 10 | 11 | from box_sdk_gen.box.errors import BoxSDKError 12 | 13 | SkillCard = Union[ 14 | KeywordSkillCard, TimelineSkillCard, TranscriptSkillCard, StatusSkillCard 15 | ] 16 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/event_source_resource.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from typing import Dict 4 | 5 | from box_sdk_gen.schemas.user import User 6 | 7 | from box_sdk_gen.schemas.event_source import EventSource 8 | 9 | from box_sdk_gen.schemas.file import File 10 | 11 | from box_sdk_gen.schemas.folder import Folder 12 | 13 | from box_sdk_gen.schemas.app_item_event_source import AppItemEventSource 14 | 15 | from box_sdk_gen.box.errors import BoxSDKError 16 | 17 | EventSourceResource = Union[User, EventSource, File, Folder, Dict, AppItemEventSource] 18 | -------------------------------------------------------------------------------- /test/trashed_items.py: -------------------------------------------------------------------------------- 1 | from box_sdk_gen.client import BoxClient 2 | 3 | from box_sdk_gen.schemas.file_full import FileFull 4 | 5 | from box_sdk_gen.schemas.items import Items 6 | 7 | from test.commons import get_default_client 8 | 9 | from test.commons import upload_new_file 10 | 11 | client: BoxClient = get_default_client() 12 | 13 | 14 | def testListTrashedItems(): 15 | file: FileFull = upload_new_file() 16 | client.files.delete_file_by_id(file.id) 17 | trashed_items: Items = client.trashed_items.get_trashed_items() 18 | assert len(trashed_items.entries) > 0 19 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/session_termination_message.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class SessionTerminationMessage(BaseObject): 9 | def __init__(self, *, message: Optional[str] = None, **kwargs): 10 | """ 11 | :param message: The unique identifier for the termination job status., defaults to None 12 | :type message: Optional[str], optional 13 | """ 14 | super().__init__(**kwargs) 15 | self.message = message 16 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/hub_item_reference_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from box_sdk_gen.schemas.v2025_r0.file_reference_v2025_r0 import FileReferenceV2025R0 4 | 5 | from box_sdk_gen.schemas.v2025_r0.folder_reference_v2025_r0 import ( 6 | FolderReferenceV2025R0, 7 | ) 8 | 9 | from box_sdk_gen.schemas.v2025_r0.weblink_reference_v2025_r0 import ( 10 | WeblinkReferenceV2025R0, 11 | ) 12 | 13 | from box_sdk_gen.box.errors import BoxSDKError 14 | 15 | HubItemReferenceV2025R0 = Union[ 16 | FileReferenceV2025R0, FolderReferenceV2025R0, WeblinkReferenceV2025R0 17 | ] 18 | -------------------------------------------------------------------------------- /box_sdk_gen/networking/__init__.py: -------------------------------------------------------------------------------- 1 | from box_sdk_gen.networking.box_network_client import * 2 | 3 | from box_sdk_gen.networking.proxy_config import * 4 | 5 | from box_sdk_gen.networking.network import * 6 | 7 | from box_sdk_gen.networking.auth import * 8 | 9 | from box_sdk_gen.networking.fetch_options import * 10 | 11 | from box_sdk_gen.networking.fetch_response import * 12 | 13 | from box_sdk_gen.networking.network_client import * 14 | 15 | from box_sdk_gen.networking.retries import * 16 | 17 | from box_sdk_gen.networking.base_urls import * 18 | 19 | from box_sdk_gen.networking.version import * 20 | -------------------------------------------------------------------------------- /test/recent_items.py: -------------------------------------------------------------------------------- 1 | from box_sdk_gen.client import BoxClient 2 | 3 | from box_sdk_gen.schemas.recent_items import RecentItems 4 | 5 | from box_sdk_gen.internal.utils import decode_base_64 6 | 7 | from box_sdk_gen.internal.utils import get_env_var 8 | 9 | from box_sdk_gen.internal.utils import get_uuid 10 | 11 | from test.commons import get_default_client_with_user_subject 12 | 13 | 14 | def testRecentItems(): 15 | client: BoxClient = get_default_client_with_user_subject(get_env_var('USER_ID')) 16 | recent_items: RecentItems = client.recent_items.get_recent_items() 17 | assert len(recent_items.entries) >= 0 18 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/enterprise_configuration_item_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class EnterpriseConfigurationItemV2025R0(BaseObject): 9 | def __init__(self, *, is_used: Optional[bool] = None, **kwargs): 10 | """ 11 | :param is_used: Indicates whether a configuration is used for a given enterprise., defaults to None 12 | :type is_used: Optional[bool], optional 13 | """ 14 | super().__init__(**kwargs) 15 | self.is_used = is_used 16 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/doc_gen_document_generation_data_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Dict 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class DocGenDocumentGenerationDataV2025R0(BaseObject): 9 | def __init__(self, generated_file_name: str, user_input: Dict, **kwargs): 10 | """ 11 | :param generated_file_name: File name of the output file. 12 | :type generated_file_name: str 13 | """ 14 | super().__init__(**kwargs) 15 | self.generated_file_name = generated_file_name 16 | self.user_input = user_input 17 | -------------------------------------------------------------------------------- /.versionrc: -------------------------------------------------------------------------------- 1 | { 2 | "types": [ 3 | { 4 | "type": "feat", 5 | "section": "New Features and Enhancements", 6 | "hidden": false 7 | }, 8 | { 9 | "type": "fix", 10 | "section": "Bug Fixes", 11 | "hidden": false 12 | }, 13 | { 14 | "type": "chore", 15 | "hidden": true 16 | }, 17 | { 18 | "type": "docs", 19 | "hidden": true 20 | }, 21 | { 22 | "type": "style", 23 | "hidden": true 24 | }, 25 | { 26 | "type": "refactor", 27 | "hidden": true 28 | }, 29 | { 30 | "type": "test", 31 | "hidden": true 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/hub_collaboration_update_request_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class HubCollaborationUpdateRequestV2025R0(BaseObject): 9 | def __init__(self, *, role: Optional[str] = None, **kwargs): 10 | """ 11 | :param role: The level of access granted to a Box Hub. 12 | Possible values are `editor`, `viewer`, and `co-owner`., defaults to None 13 | :type role: Optional[str], optional 14 | """ 15 | super().__init__(**kwargs) 16 | self.role = role 17 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/ai_llm_endpoint_params.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from box_sdk_gen.schemas.ai_llm_endpoint_params_open_ai import AiLlmEndpointParamsOpenAi 4 | 5 | from box_sdk_gen.schemas.ai_llm_endpoint_params_google import AiLlmEndpointParamsGoogle 6 | 7 | from box_sdk_gen.schemas.ai_llm_endpoint_params_aws import AiLlmEndpointParamsAws 8 | 9 | from box_sdk_gen.schemas.ai_llm_endpoint_params_ibm import AiLlmEndpointParamsIbm 10 | 11 | from box_sdk_gen.box.errors import BoxSDKError 12 | 13 | AiLlmEndpointParams = Union[ 14 | AiLlmEndpointParamsOpenAi, 15 | AiLlmEndpointParamsGoogle, 16 | AiLlmEndpointParamsAws, 17 | AiLlmEndpointParamsIbm, 18 | ] 19 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/shield_information_barrier_reference.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.schemas.shield_information_barrier_base import ( 6 | ShieldInformationBarrierBase, 7 | ) 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class ShieldInformationBarrierReference(BaseObject): 13 | def __init__( 14 | self, 15 | *, 16 | shield_information_barrier: Optional[ShieldInformationBarrierBase] = None, 17 | **kwargs 18 | ): 19 | super().__init__(**kwargs) 20 | self.shield_information_barrier = shield_information_barrier 21 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/external_users_submit_delete_job_request_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.schemas.v2025_r0.user_reference_v2025_r0 import UserReferenceV2025R0 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class ExternalUsersSubmitDeleteJobRequestV2025R0(BaseObject): 11 | def __init__(self, external_users: List[UserReferenceV2025R0], **kwargs): 12 | """ 13 | :param external_users: List of external users to delete. 14 | :type external_users: List[UserReferenceV2025R0] 15 | """ 16 | super().__init__(**kwargs) 17 | self.external_users = external_users 18 | -------------------------------------------------------------------------------- /test/shared_links_app_items.py: -------------------------------------------------------------------------------- 1 | from box_sdk_gen.internal.utils import to_string 2 | 3 | from box_sdk_gen.client import BoxClient 4 | 5 | from box_sdk_gen.schemas.app_item import AppItem 6 | 7 | from box_sdk_gen.internal.utils import get_env_var 8 | 9 | from test.commons import get_default_client 10 | 11 | client: BoxClient = get_default_client() 12 | 13 | 14 | def testSharedLinksAppItems(): 15 | app_item_shared_link: str = get_env_var('APP_ITEM_SHARED_LINK') 16 | app_item: AppItem = client.shared_links_app_items.find_app_item_for_shared_link( 17 | ''.join(['shared_link=', app_item_shared_link]) 18 | ) 19 | assert to_string(app_item.type) == 'app_item' 20 | assert app_item.application_type == 'hubs' 21 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/hub_items_manage_response_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.schemas.v2025_r0.hub_item_operation_result_v2025_r0 import ( 6 | HubItemOperationResultV2025R0, 7 | ) 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class HubItemsManageResponseV2025R0(BaseObject): 13 | def __init__(self, operations: List[HubItemOperationResultV2025R0], **kwargs): 14 | """ 15 | :param operations: List of operations performed on Box Hub items. 16 | :type operations: List[HubItemOperationResultV2025R0] 17 | """ 18 | super().__init__(**kwargs) 19 | self.operations = operations 20 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/metadata_taxonomy_levels.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.metadata_taxonomy_level import MetadataTaxonomyLevel 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class MetadataTaxonomyLevels(BaseObject): 13 | def __init__( 14 | self, *, entries: Optional[List[MetadataTaxonomyLevel]] = None, **kwargs 15 | ): 16 | """ 17 | :param entries: An array of all taxonomy levels., defaults to None 18 | :type entries: Optional[List[MetadataTaxonomyLevel]], optional 19 | """ 20 | super().__init__(**kwargs) 21 | self.entries = entries 22 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/custom_session_duration_group_item_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class CustomSessionDurationGroupItemV2025R0(BaseObject): 9 | def __init__( 10 | self, *, id: Optional[str] = None, name: Optional[str] = None, **kwargs 11 | ): 12 | """ 13 | :param id: Group ID (numerical)., defaults to None 14 | :type id: Optional[str], optional 15 | :param name: Group Name., defaults to None 16 | :type name: Optional[str], optional 17 | """ 18 | super().__init__(**kwargs) 19 | self.id = id 20 | self.name = name 21 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/sign_request_signer_attachment.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class SignRequestSignerAttachment(BaseObject): 9 | def __init__( 10 | self, *, id: Optional[str] = None, name: Optional[str] = None, **kwargs 11 | ): 12 | """ 13 | :param id: Identifier of the attachment file., defaults to None 14 | :type id: Optional[str], optional 15 | :param name: Display name of the attachment file., defaults to None 16 | :type name: Optional[str], optional 17 | """ 18 | super().__init__(**kwargs) 19 | self.id = id 20 | self.name = name 21 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/user_tracking_code_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class UserTrackingCodeV2025R0(BaseObject): 9 | def __init__( 10 | self, *, id: Optional[int] = None, name: Optional[str] = None, **kwargs 11 | ): 12 | """ 13 | :param id: The ID of the user tracking code., defaults to None 14 | :type id: Optional[int], optional 15 | :param name: The name of the user tracking code., defaults to None 16 | :type name: Optional[str], optional 17 | """ 18 | super().__init__(**kwargs) 19 | self.id = id 20 | self.name = name 21 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/integration_mappings_teams.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.integration_mapping_teams import IntegrationMappingTeams 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class IntegrationMappingsTeams(BaseObject): 13 | def __init__( 14 | self, *, entries: Optional[List[IntegrationMappingTeams]] = None, **kwargs 15 | ): 16 | """ 17 | :param entries: A list of integration mappings., defaults to None 18 | :type entries: Optional[List[IntegrationMappingTeams]], optional 19 | """ 20 | super().__init__(**kwargs) 21 | self.entries = entries 22 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/shield_lists_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.v2025_r0.shield_list_mini_v2025_r0 import ShieldListMiniV2025R0 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class ShieldListsV2025R0(BaseObject): 13 | def __init__( 14 | self, *, entries: Optional[List[ShieldListMiniV2025R0]] = None, **kwargs 15 | ): 16 | """ 17 | :param entries: A list of shield list objects., defaults to None 18 | :type entries: Optional[List[ShieldListMiniV2025R0]], optional 19 | """ 20 | super().__init__(**kwargs) 21 | self.entries = entries 22 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/hub_create_request_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class HubCreateRequestV2025R0(BaseObject): 9 | def __init__(self, title: str, *, description: Optional[str] = None, **kwargs): 10 | """ 11 | :param title: Title of the Box Hub. It cannot be empty and should be less than 50 characters. 12 | :type title: str 13 | :param description: Description of the Box Hub., defaults to None 14 | :type description: Optional[str], optional 15 | """ 16 | super().__init__(**kwargs) 17 | self.title = title 18 | self.description = description 19 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/integration_mapping_teams_create_request.py: -------------------------------------------------------------------------------- 1 | from box_sdk_gen.internal.base_object import BaseObject 2 | 3 | from box_sdk_gen.schemas.integration_mapping_partner_item_teams_create_request import ( 4 | IntegrationMappingPartnerItemTeamsCreateRequest, 5 | ) 6 | 7 | from box_sdk_gen.schemas.folder_reference import FolderReference 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class IntegrationMappingTeamsCreateRequest(BaseObject): 13 | def __init__( 14 | self, 15 | partner_item: IntegrationMappingPartnerItemTeamsCreateRequest, 16 | box_item: FolderReference, 17 | **kwargs 18 | ): 19 | super().__init__(**kwargs) 20 | self.partner_item = partner_item 21 | self.box_item = box_item 22 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/external_users_submit_delete_job_response_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.schemas.v2025_r0.external_user_deletion_result_v2025_r0 import ( 6 | ExternalUserDeletionResultV2025R0, 7 | ) 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class ExternalUsersSubmitDeleteJobResponseV2025R0(BaseObject): 13 | def __init__(self, entries: List[ExternalUserDeletionResultV2025R0], **kwargs): 14 | """ 15 | :param entries: Array of results of each external user deletion request. 16 | :type entries: List[ExternalUserDeletionResultV2025R0] 17 | """ 18 | super().__init__(**kwargs) 19 | self.entries = entries 20 | -------------------------------------------------------------------------------- /.github/workflows/spell-check-lint.yml: -------------------------------------------------------------------------------- 1 | name: spell-check-lint 2 | on: 3 | pull_request_target: 4 | types: [opened, synchronize, edited] 5 | branches: 6 | - main 7 | 8 | permissions: 9 | contents: read 10 | 11 | jobs: 12 | spellcheck-request-title: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout current repository 16 | uses: actions/checkout@v4 17 | - name: Checkout spellchecker 18 | uses: actions/checkout@v4 19 | with: 20 | ref: refs/heads/main 21 | repository: box/box-sdk-spellchecker 22 | token: ${{ secrets.DISPATCH_ACCESS_TOKEN }} 23 | path: spellchecker 24 | - name: Execute spellchecker 25 | uses: ./spellchecker 26 | env: 27 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 28 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/user_base.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class UserBaseTypeField(str, Enum): 9 | USER = 'user' 10 | 11 | 12 | class UserBase(BaseObject): 13 | _discriminator = 'type', {'user'} 14 | 15 | def __init__( 16 | self, id: str, *, type: UserBaseTypeField = UserBaseTypeField.USER, **kwargs 17 | ): 18 | """ 19 | :param id: The unique identifier for this user. 20 | :type id: str 21 | :param type: The value will always be `user`., defaults to UserBaseTypeField.USER 22 | :type type: UserBaseTypeField, optional 23 | """ 24 | super().__init__(**kwargs) 25 | self.id = id 26 | self.type = type 27 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/group_base.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class GroupBaseTypeField(str, Enum): 9 | GROUP = 'group' 10 | 11 | 12 | class GroupBase(BaseObject): 13 | _discriminator = 'type', {'group'} 14 | 15 | def __init__( 16 | self, id: str, *, type: GroupBaseTypeField = GroupBaseTypeField.GROUP, **kwargs 17 | ): 18 | """ 19 | :param id: The unique identifier for this object. 20 | :type id: str 21 | :param type: The value will always be `group`., defaults to GroupBaseTypeField.GROUP 22 | :type type: GroupBaseTypeField, optional 23 | """ 24 | super().__init__(**kwargs) 25 | self.id = id 26 | self.type = type 27 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/hub_items_manage_request_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.v2025_r0.hub_item_operation_v2025_r0 import ( 8 | HubItemOperationV2025R0, 9 | ) 10 | 11 | from box_sdk_gen.box.errors import BoxSDKError 12 | 13 | 14 | class HubItemsManageRequestV2025R0(BaseObject): 15 | def __init__( 16 | self, *, operations: Optional[List[HubItemOperationV2025R0]] = None, **kwargs 17 | ): 18 | """ 19 | :param operations: List of operations to perform on Box Hub items., defaults to None 20 | :type operations: Optional[List[HubItemOperationV2025R0]], optional 21 | """ 22 | super().__init__(**kwargs) 23 | self.operations = operations 24 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/enhancement.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Enhancement 3 | about: Suggest a new feature or change 4 | title: '' 5 | labels: enhancement 6 | assignees: mwwoda, mhagmajer, arjankowski, lukaszsocha2, bartlomiejleszczynski, congminh1254 7 | --- 8 | 9 | ### Is your feature request related to a problem? Please describe. 10 | 11 | 12 | 13 | ### Describe the solution you'd like 14 | 15 | 16 | 17 | ### Describe alternatives you've considered 18 | 19 | 20 | 21 | ### Additional context 22 | 23 | 24 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/o_auth_2_error.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class OAuth2Error(BaseObject): 9 | def __init__( 10 | self, 11 | *, 12 | error: Optional[str] = None, 13 | error_description: Optional[str] = None, 14 | **kwargs 15 | ): 16 | """ 17 | :param error: The type of the error returned., defaults to None 18 | :type error: Optional[str], optional 19 | :param error_description: The type of the error returned., defaults to None 20 | :type error_description: Optional[str], optional 21 | """ 22 | super().__init__(**kwargs) 23 | self.error = error 24 | self.error_description = error_description 25 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/enterprise_configuration_shield_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.v2025_r0.shield_rule_item_v2025_r0 import ShieldRuleItemV2025R0 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class EnterpriseConfigurationShieldV2025R0(BaseObject): 13 | def __init__( 14 | self, *, shield_rules: Optional[List[ShieldRuleItemV2025R0]] = None, **kwargs 15 | ): 16 | """ 17 | :param shield_rules: The shield rules configuration for the enterprise., defaults to None 18 | :type shield_rules: Optional[List[ShieldRuleItemV2025R0]], optional 19 | """ 20 | super().__init__(**kwargs) 21 | self.shield_rules = shield_rules 22 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/doc_gen_template_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.schemas.v2025_r0.file_reference_v2025_r0 import FileReferenceV2025R0 4 | 5 | from box_sdk_gen.schemas.v2025_r0.doc_gen_template_base_v2025_r0 import ( 6 | DocGenTemplateBaseV2025R0, 7 | ) 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class DocGenTemplateV2025R0(DocGenTemplateBaseV2025R0): 13 | def __init__( 14 | self, 15 | *, 16 | file_name: Optional[str] = None, 17 | file: Optional[FileReferenceV2025R0] = None, 18 | **kwargs 19 | ): 20 | """ 21 | :param file_name: The name of the template., defaults to None 22 | :type file_name: Optional[str], optional 23 | """ 24 | super().__init__(file=file, **kwargs) 25 | self.file_name = file_name 26 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/hub_copy_request_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class HubCopyRequestV2025R0(BaseObject): 9 | def __init__( 10 | self, 11 | *, 12 | title: Optional[str] = None, 13 | description: Optional[str] = None, 14 | **kwargs 15 | ): 16 | """ 17 | :param title: Title of the Box Hub. It cannot be empty and should be less than 50 characters., defaults to None 18 | :type title: Optional[str], optional 19 | :param description: Description of the Box Hub., defaults to None 20 | :type description: Optional[str], optional 21 | """ 22 | super().__init__(**kwargs) 23 | self.title = title 24 | self.description = description 25 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: SDK documentation 4 | url: https://github.com/box/box-python-sdk/tree/main/docs 5 | about: Before creating an issue, I have checked that the SDK documentation doesn't solve my issue. 6 | - name: API documentation 7 | url: https://developer.box.com/docs 8 | about: Before creating an issue, I have checked that the API documentation doesn't solve my issue. 9 | - name: Box Developer Forums 10 | url: https://community.box.com/box-platform-5 11 | about: Before creating an issue, I have searched the Box Developer Forums and my issue isn't already reported there. 12 | - name: Issues in this repo 13 | url: https://github.com/box/box-python-sdk/search?type=Issues 14 | about: Before creating an issue, I have searched Issues in this repo and my issue isn't already reported. 15 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/shield_list_content_request_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from box_sdk_gen.schemas.v2025_r0.shield_list_content_country_v2025_r0 import ( 4 | ShieldListContentCountryV2025R0, 5 | ) 6 | 7 | from box_sdk_gen.schemas.v2025_r0.shield_list_content_domain_v2025_r0 import ( 8 | ShieldListContentDomainV2025R0, 9 | ) 10 | 11 | from box_sdk_gen.schemas.v2025_r0.shield_list_content_email_v2025_r0 import ( 12 | ShieldListContentEmailV2025R0, 13 | ) 14 | 15 | from box_sdk_gen.schemas.v2025_r0.shield_list_content_ip_v2025_r0 import ( 16 | ShieldListContentIpV2025R0, 17 | ) 18 | 19 | from box_sdk_gen.box.errors import BoxSDKError 20 | 21 | ShieldListContentRequestV2025R0 = Union[ 22 | ShieldListContentCountryV2025R0, 23 | ShieldListContentDomainV2025R0, 24 | ShieldListContentEmailV2025R0, 25 | ShieldListContentIpV2025R0, 26 | ] 27 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/files.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.file_full import FileFull 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class Files(BaseObject): 13 | def __init__( 14 | self, 15 | *, 16 | total_count: Optional[int] = None, 17 | entries: Optional[List[FileFull]] = None, 18 | **kwargs 19 | ): 20 | """ 21 | :param total_count: The number of files., defaults to None 22 | :type total_count: Optional[int], optional 23 | :param entries: A list of files., defaults to None 24 | :type entries: Optional[List[FileFull]], optional 25 | """ 26 | super().__init__(**kwargs) 27 | self.total_count = total_count 28 | self.entries = entries 29 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/folder_reference.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class FolderReferenceTypeField(str, Enum): 9 | FOLDER = 'folder' 10 | 11 | 12 | class FolderReference(BaseObject): 13 | _discriminator = 'type', {'folder'} 14 | 15 | def __init__( 16 | self, 17 | id: str, 18 | *, 19 | type: FolderReferenceTypeField = FolderReferenceTypeField.FOLDER, 20 | **kwargs 21 | ): 22 | """ 23 | :param id: ID of the folder. 24 | :type id: str 25 | :param type: The value will always be `folder`., defaults to FolderReferenceTypeField.FOLDER 26 | :type type: FolderReferenceTypeField, optional 27 | """ 28 | super().__init__(**kwargs) 29 | self.id = id 30 | self.type = type 31 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/user_base_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class UserBaseV2025R0TypeField(str, Enum): 9 | USER = 'user' 10 | 11 | 12 | class UserBaseV2025R0(BaseObject): 13 | _discriminator = 'type', {'user'} 14 | 15 | def __init__( 16 | self, 17 | id: str, 18 | *, 19 | type: UserBaseV2025R0TypeField = UserBaseV2025R0TypeField.USER, 20 | **kwargs 21 | ): 22 | """ 23 | :param id: The unique identifier for this user. 24 | :type id: str 25 | :param type: The value will always be `user`., defaults to UserBaseV2025R0TypeField.USER 26 | :type type: UserBaseV2025R0TypeField, optional 27 | """ 28 | super().__init__(**kwargs) 29 | self.id = id 30 | self.type = type 31 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/upload_url.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class UploadUrl(BaseObject): 9 | def __init__( 10 | self, 11 | *, 12 | upload_url: Optional[str] = None, 13 | upload_token: Optional[str] = None, 14 | **kwargs 15 | ): 16 | """ 17 | :param upload_url: A URL for an upload session that can be used to upload 18 | the file., defaults to None 19 | :type upload_url: Optional[str], optional 20 | :param upload_token: An optional access token to use to upload the file., defaults to None 21 | :type upload_token: Optional[str], optional 22 | """ 23 | super().__init__(**kwargs) 24 | self.upload_url = upload_url 25 | self.upload_token = upload_token 26 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/email_aliases.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.email_alias import EmailAlias 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class EmailAliases(BaseObject): 13 | def __init__( 14 | self, 15 | *, 16 | total_count: Optional[int] = None, 17 | entries: Optional[List[EmailAlias]] = None, 18 | **kwargs 19 | ): 20 | """ 21 | :param total_count: The number of email aliases., defaults to None 22 | :type total_count: Optional[int], optional 23 | :param entries: A list of email aliases., defaults to None 24 | :type entries: Optional[List[EmailAlias]], optional 25 | """ 26 | super().__init__(**kwargs) 27 | self.total_count = total_count 28 | self.entries = entries 29 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/integration_mapping_slack_options.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class IntegrationMappingSlackOptions(BaseObject): 9 | def __init__( 10 | self, *, is_access_management_disabled: Optional[bool] = None, **kwargs 11 | ): 12 | """ 13 | :param is_access_management_disabled: Indicates whether or not channel member 14 | access to the underlying box item 15 | should be automatically managed. 16 | Depending on type of channel, access is managed 17 | through creating collaborations or shared links., defaults to None 18 | :type is_access_management_disabled: Optional[bool], optional 19 | """ 20 | super().__init__(**kwargs) 21 | self.is_access_management_disabled = is_access_management_disabled 22 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/shield_information_barrier_report_details.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class ShieldInformationBarrierReportDetailsDetailsField(BaseObject): 9 | def __init__(self, *, folder_id: Optional[str] = None, **kwargs): 10 | """ 11 | :param folder_id: Folder ID for locating this report., defaults to None 12 | :type folder_id: Optional[str], optional 13 | """ 14 | super().__init__(**kwargs) 15 | self.folder_id = folder_id 16 | 17 | 18 | class ShieldInformationBarrierReportDetails(BaseObject): 19 | def __init__( 20 | self, 21 | *, 22 | details: Optional[ShieldInformationBarrierReportDetailsDetailsField] = None, 23 | **kwargs 24 | ): 25 | super().__init__(**kwargs) 26 | self.details = details 27 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/group_base_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class GroupBaseV2025R0TypeField(str, Enum): 9 | GROUP = 'group' 10 | 11 | 12 | class GroupBaseV2025R0(BaseObject): 13 | _discriminator = 'type', {'group'} 14 | 15 | def __init__( 16 | self, 17 | id: str, 18 | *, 19 | type: GroupBaseV2025R0TypeField = GroupBaseV2025R0TypeField.GROUP, 20 | **kwargs 21 | ): 22 | """ 23 | :param id: The unique identifier for this object. 24 | :type id: str 25 | :param type: The value will always be `group`., defaults to GroupBaseV2025R0TypeField.GROUP 26 | :type type: GroupBaseV2025R0TypeField, optional 27 | """ 28 | super().__init__(**kwargs) 29 | self.id = id 30 | self.type = type 31 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/file_reference_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class FileReferenceV2025R0TypeField(str, Enum): 9 | FILE = 'file' 10 | 11 | 12 | class FileReferenceV2025R0(BaseObject): 13 | _discriminator = 'type', {'file'} 14 | 15 | def __init__( 16 | self, 17 | id: str, 18 | *, 19 | type: FileReferenceV2025R0TypeField = FileReferenceV2025R0TypeField.FILE, 20 | **kwargs 21 | ): 22 | """ 23 | :param id: ID of the object. 24 | :type id: str 25 | :param type: The value will always be `file`., defaults to FileReferenceV2025R0TypeField.FILE 26 | :type type: FileReferenceV2025R0TypeField, optional 27 | """ 28 | super().__init__(**kwargs) 29 | self.id = id 30 | self.type = type 31 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/hub_item_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class HubItemV2025R0TypeField(str, Enum): 9 | FILE = 'file' 10 | FOLDER = 'folder' 11 | WEB_LINK = 'web_link' 12 | 13 | 14 | class HubItemV2025R0(BaseObject): 15 | _discriminator = 'type', {'file', 'folder', 'web_link'} 16 | 17 | def __init__(self, id: str, type: HubItemV2025R0TypeField, name: str, **kwargs): 18 | """ 19 | :param id: The unique identifier for this item. 20 | :type id: str 21 | :param type: The type of the item. 22 | :type type: HubItemV2025R0TypeField 23 | :param name: The name of the item. 24 | :type name: str 25 | """ 26 | super().__init__(**kwargs) 27 | self.id = id 28 | self.type = type 29 | self.name = name 30 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/enterprise_configuration_item_string_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.schemas.v2025_r0.enterprise_configuration_item_v2025_r0 import ( 4 | EnterpriseConfigurationItemV2025R0, 5 | ) 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class EnterpriseConfigurationItemStringV2025R0(EnterpriseConfigurationItemV2025R0): 11 | def __init__( 12 | self, *, value: Optional[str] = None, is_used: Optional[bool] = None, **kwargs 13 | ): 14 | """ 15 | :param value: The value of the enterprise configuration as a string., defaults to None 16 | :type value: Optional[str], optional 17 | :param is_used: Indicates whether a configuration is used for a given enterprise., defaults to None 18 | :type is_used: Optional[bool], optional 19 | """ 20 | super().__init__(is_used=is_used, **kwargs) 21 | self.value = value 22 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/list_user_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class ListUserV2025R0(BaseObject): 9 | def __init__( 10 | self, 11 | *, 12 | id: Optional[int] = None, 13 | name: Optional[str] = None, 14 | email: Optional[str] = None, 15 | **kwargs 16 | ): 17 | """ 18 | :param id: The ID of the user., defaults to None 19 | :type id: Optional[int], optional 20 | :param name: The name of the user., defaults to None 21 | :type name: Optional[str], optional 22 | :param email: The email of the user., defaults to None 23 | :type email: Optional[str], optional 24 | """ 25 | super().__init__(**kwargs) 26 | self.id = id 27 | self.name = name 28 | self.email = email 29 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/metadatas.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.metadata import Metadata 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class Metadatas(BaseObject): 13 | def __init__( 14 | self, 15 | *, 16 | entries: Optional[List[Metadata]] = None, 17 | limit: Optional[int] = None, 18 | **kwargs 19 | ): 20 | """ 21 | :param entries: A list of metadata instances, as applied to this file or folder., defaults to None 22 | :type entries: Optional[List[Metadata]], optional 23 | :param limit: The limit that was used for this page of results., defaults to None 24 | :type limit: Optional[int], optional 25 | """ 26 | super().__init__(**kwargs) 27 | self.entries = entries 28 | self.limit = limit 29 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/enterprise_configuration_item_boolean_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.schemas.v2025_r0.enterprise_configuration_item_v2025_r0 import ( 4 | EnterpriseConfigurationItemV2025R0, 5 | ) 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class EnterpriseConfigurationItemBooleanV2025R0(EnterpriseConfigurationItemV2025R0): 11 | def __init__( 12 | self, *, value: Optional[bool] = None, is_used: Optional[bool] = None, **kwargs 13 | ): 14 | """ 15 | :param value: The value of the enterprise configuration as a boolean., defaults to None 16 | :type value: Optional[bool], optional 17 | :param is_used: Indicates whether a configuration is used for a given enterprise., defaults to None 18 | :type is_used: Optional[bool], optional 19 | """ 20 | super().__init__(is_used=is_used, **kwargs) 21 | self.value = value 22 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/enterprise_configuration_item_integer_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.schemas.v2025_r0.enterprise_configuration_item_v2025_r0 import ( 4 | EnterpriseConfigurationItemV2025R0, 5 | ) 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class EnterpriseConfigurationItemIntegerV2025R0(EnterpriseConfigurationItemV2025R0): 11 | def __init__( 12 | self, *, value: Optional[int] = None, is_used: Optional[bool] = None, **kwargs 13 | ): 14 | """ 15 | :param value: The value of the enterprise configuration as an integer., defaults to None 16 | :type value: Optional[int], optional 17 | :param is_used: Indicates whether a configuration is used for a given enterprise., defaults to None 18 | :type is_used: Optional[bool], optional 19 | """ 20 | super().__init__(is_used=is_used, **kwargs) 21 | self.value = value 22 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/user_reference_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class UserReferenceV2025R0TypeField(str, Enum): 9 | USER = 'user' 10 | 11 | 12 | class UserReferenceV2025R0(BaseObject): 13 | _discriminator = 'type', {'user'} 14 | 15 | def __init__( 16 | self, 17 | id: str, 18 | *, 19 | type: UserReferenceV2025R0TypeField = UserReferenceV2025R0TypeField.USER, 20 | **kwargs 21 | ): 22 | """ 23 | :param id: The unique identifier for the user. 24 | :type id: str 25 | :param type: The value is always `user`., defaults to UserReferenceV2025R0TypeField.USER 26 | :type type: UserReferenceV2025R0TypeField, optional 27 | """ 28 | super().__init__(**kwargs) 29 | self.id = id 30 | self.type = type 31 | -------------------------------------------------------------------------------- /box_sdk_gen/networking/base_urls.py: -------------------------------------------------------------------------------- 1 | from typing import Dict 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class BaseUrls(BaseObject): 9 | _fields_to_json_mapping: Dict[str, str] = { 10 | 'oauth_2_url': 'oauth2_url', 11 | **BaseObject._fields_to_json_mapping, 12 | } 13 | _json_to_fields_mapping: Dict[str, str] = { 14 | 'oauth2_url': 'oauth_2_url', 15 | **BaseObject._json_to_fields_mapping, 16 | } 17 | 18 | def __init__( 19 | self, 20 | *, 21 | base_url: str = 'https://api.box.com', 22 | upload_url: str = 'https://upload.box.com/api', 23 | oauth_2_url: str = 'https://account.box.com/api/oauth2', 24 | **kwargs 25 | ): 26 | super().__init__(**kwargs) 27 | self.base_url = base_url 28 | self.upload_url = upload_url 29 | self.oauth_2_url = oauth_2_url 30 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/realtime_servers.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.realtime_server import RealtimeServer 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class RealtimeServers(BaseObject): 13 | def __init__( 14 | self, 15 | *, 16 | chunk_size: Optional[int] = None, 17 | entries: Optional[List[RealtimeServer]] = None, 18 | **kwargs 19 | ): 20 | """ 21 | :param chunk_size: The number of items in this response., defaults to None 22 | :type chunk_size: Optional[int], optional 23 | :param entries: A list of real-time servers., defaults to None 24 | :type entries: Optional[List[RealtimeServer]], optional 25 | """ 26 | super().__init__(**kwargs) 27 | self.chunk_size = chunk_size 28 | self.entries = entries 29 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/folder_reference_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class FolderReferenceV2025R0TypeField(str, Enum): 9 | FOLDER = 'folder' 10 | 11 | 12 | class FolderReferenceV2025R0(BaseObject): 13 | _discriminator = 'type', {'folder'} 14 | 15 | def __init__( 16 | self, 17 | id: str, 18 | *, 19 | type: FolderReferenceV2025R0TypeField = FolderReferenceV2025R0TypeField.FOLDER, 20 | **kwargs 21 | ): 22 | """ 23 | :param id: ID of the folder. 24 | :type id: str 25 | :param type: The value will always be `folder`., defaults to FolderReferenceV2025R0TypeField.FOLDER 26 | :type type: FolderReferenceV2025R0TypeField, optional 27 | """ 28 | super().__init__(**kwargs) 29 | self.id = id 30 | self.type = type 31 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/comment_base.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class CommentBaseTypeField(str, Enum): 11 | COMMENT = 'comment' 12 | 13 | 14 | class CommentBase(BaseObject): 15 | _discriminator = 'type', {'comment'} 16 | 17 | def __init__( 18 | self, 19 | *, 20 | id: Optional[str] = None, 21 | type: Optional[CommentBaseTypeField] = None, 22 | **kwargs 23 | ): 24 | """ 25 | :param id: The unique identifier for this comment., defaults to None 26 | :type id: Optional[str], optional 27 | :param type: The value will always be `comment`., defaults to None 28 | :type type: Optional[CommentBaseTypeField], optional 29 | """ 30 | super().__init__(**kwargs) 31 | self.id = id 32 | self.type = type 33 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/terms_of_services.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.terms_of_service import TermsOfService 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class TermsOfServices(BaseObject): 13 | def __init__( 14 | self, 15 | *, 16 | total_count: Optional[int] = None, 17 | entries: Optional[List[TermsOfService]] = None, 18 | **kwargs 19 | ): 20 | """ 21 | :param total_count: The total number of objects., defaults to None 22 | :type total_count: Optional[int], optional 23 | :param entries: A list of terms of service objects., defaults to None 24 | :type entries: Optional[List[TermsOfService]], optional 25 | """ 26 | super().__init__(**kwargs) 27 | self.total_count = total_count 28 | self.entries = entries 29 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/file_version_base.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class FileVersionBaseTypeField(str, Enum): 9 | FILE_VERSION = 'file_version' 10 | 11 | 12 | class FileVersionBase(BaseObject): 13 | _discriminator = 'type', {'file_version'} 14 | 15 | def __init__( 16 | self, 17 | id: str, 18 | *, 19 | type: FileVersionBaseTypeField = FileVersionBaseTypeField.FILE_VERSION, 20 | **kwargs 21 | ): 22 | """ 23 | :param id: The unique identifier that represent a file version. 24 | :type id: str 25 | :param type: The value will always be `file_version`., defaults to FileVersionBaseTypeField.FILE_VERSION 26 | :type type: FileVersionBaseTypeField, optional 27 | """ 28 | super().__init__(**kwargs) 29 | self.id = id 30 | self.type = type 31 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/task_assignments.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.task_assignment import TaskAssignment 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class TaskAssignments(BaseObject): 13 | def __init__( 14 | self, 15 | *, 16 | total_count: Optional[int] = None, 17 | entries: Optional[List[TaskAssignment]] = None, 18 | **kwargs 19 | ): 20 | """ 21 | :param total_count: The total number of items in this collection., defaults to None 22 | :type total_count: Optional[int], optional 23 | :param entries: A list of task assignments., defaults to None 24 | :type entries: Optional[List[TaskAssignment]], optional 25 | """ 26 | super().__init__(**kwargs) 27 | self.total_count = total_count 28 | self.entries = entries 29 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/external_user_deletion_result_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class ExternalUserDeletionResultV2025R0(BaseObject): 9 | def __init__( 10 | self, user_id: str, status: int, *, detail: Optional[str] = None, **kwargs 11 | ): 12 | """ 13 | :param user_id: The ID of the external user. 14 | :type user_id: str 15 | :param status: HTTP status code for a specific user's deletion request. 16 | :type status: int 17 | :param detail: Deletion request status details. This property is only present when the deletion request is not successful., defaults to None 18 | :type detail: Optional[str], optional 19 | """ 20 | super().__init__(**kwargs) 21 | self.user_id = user_id 22 | self.status = status 23 | self.detail = detail 24 | -------------------------------------------------------------------------------- /test/storage_policies.py: -------------------------------------------------------------------------------- 1 | from box_sdk_gen.internal.utils import to_string 2 | 3 | from box_sdk_gen.client import BoxClient 4 | 5 | from box_sdk_gen.schemas.storage_policies import StoragePolicies 6 | 7 | from box_sdk_gen.schemas.storage_policy import StoragePolicy 8 | 9 | from box_sdk_gen.internal.utils import get_env_var 10 | 11 | from test.commons import get_default_client_with_user_subject 12 | 13 | user_id: str = get_env_var('USER_ID') 14 | 15 | 16 | def testGetStoragePolicies(): 17 | client: BoxClient = get_default_client_with_user_subject(user_id) 18 | storage_policies: StoragePolicies = client.storage_policies.get_storage_policies() 19 | storage_policy: StoragePolicy = storage_policies.entries[0] 20 | assert to_string(storage_policy.type) == 'storage_policy' 21 | get_storage_policy: StoragePolicy = ( 22 | client.storage_policies.get_storage_policy_by_id(storage_policy.id) 23 | ) 24 | assert get_storage_policy.id == storage_policy.id 25 | -------------------------------------------------------------------------------- /.github/workflows/notify-changelog.yml: -------------------------------------------------------------------------------- 1 | # A GitHub action that notifies the developer 2 | # changelog repository of any new releases. 3 | 4 | name: Notify changelog 5 | 6 | on: 7 | # Only trigger for a full release, 8 | # ignoring pre-releases and drafts 9 | release: 10 | types: 11 | - released 12 | 13 | permissions: {} 14 | 15 | jobs: 16 | notify: 17 | # This job can run on the latest Ubuntu 18 | # and it should not take more than 3 minutes 19 | runs-on: ubuntu-latest 20 | timeout-minutes: 3 21 | 22 | steps: 23 | - name: Notify changelog of new release 24 | uses: peter-evans/repository-dispatch@v1 25 | with: 26 | token: ${{ secrets.DISPATCH_ACCESS_TOKEN }} 27 | repository: box/box-developer-changelog 28 | event-type: new-release-note 29 | client-payload: '{"ref": "${{ github.ref }}", "repository": "${{github.repository}}", "labels": "sdks,python", "repo_display_name": "Box Python SDK"}' 30 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/sign_request_signer_input_zip_validation.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class SignRequestSignerInputZipValidationValidationTypeField(str, Enum): 9 | ZIP = 'zip' 10 | 11 | 12 | class SignRequestSignerInputZipValidation(BaseObject): 13 | def __init__( 14 | self, 15 | *, 16 | validation_type: SignRequestSignerInputZipValidationValidationTypeField = SignRequestSignerInputZipValidationValidationTypeField.ZIP, 17 | **kwargs 18 | ): 19 | """ 20 | :param validation_type: Validates that the text input is a ZIP code., defaults to SignRequestSignerInputZipValidationValidationTypeField.ZIP 21 | :type validation_type: SignRequestSignerInputZipValidationValidationTypeField, optional 22 | """ 23 | super().__init__(**kwargs) 24 | self.validation_type = validation_type 25 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/weblink_reference_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class WeblinkReferenceV2025R0TypeField(str, Enum): 9 | WEB_LINK = 'web_link' 10 | 11 | 12 | class WeblinkReferenceV2025R0(BaseObject): 13 | _discriminator = 'type', {'web_link'} 14 | 15 | def __init__( 16 | self, 17 | id: str, 18 | *, 19 | type: WeblinkReferenceV2025R0TypeField = WeblinkReferenceV2025R0TypeField.WEB_LINK, 20 | **kwargs 21 | ): 22 | """ 23 | :param id: ID of the web link. 24 | :type id: str 25 | :param type: The value will always be `web_link`., defaults to WeblinkReferenceV2025R0TypeField.WEB_LINK 26 | :type type: WeblinkReferenceV2025R0TypeField, optional 27 | """ 28 | super().__init__(**kwargs) 29 | self.id = id 30 | self.type = type 31 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/storage_policy_mini.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class StoragePolicyMiniTypeField(str, Enum): 9 | STORAGE_POLICY = 'storage_policy' 10 | 11 | 12 | class StoragePolicyMini(BaseObject): 13 | _discriminator = 'type', {'storage_policy'} 14 | 15 | def __init__( 16 | self, 17 | id: str, 18 | *, 19 | type: StoragePolicyMiniTypeField = StoragePolicyMiniTypeField.STORAGE_POLICY, 20 | **kwargs 21 | ): 22 | """ 23 | :param id: The unique identifier for this storage policy. 24 | :type id: str 25 | :param type: The value will always be `storage_policy`., defaults to StoragePolicyMiniTypeField.STORAGE_POLICY 26 | :type type: StoragePolicyMiniTypeField, optional 27 | """ 28 | super().__init__(**kwargs) 29 | self.id = id 30 | self.type = type 31 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/enterprise_base.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class EnterpriseBaseTypeField(str, Enum): 11 | ENTERPRISE = 'enterprise' 12 | 13 | 14 | class EnterpriseBase(BaseObject): 15 | _discriminator = 'type', {'enterprise'} 16 | 17 | def __init__( 18 | self, 19 | *, 20 | id: Optional[str] = None, 21 | type: Optional[EnterpriseBaseTypeField] = None, 22 | **kwargs 23 | ): 24 | """ 25 | :param id: The unique identifier for this enterprise., defaults to None 26 | :type id: Optional[str], optional 27 | :param type: The value will always be `enterprise`., defaults to None 28 | :type type: Optional[EnterpriseBaseTypeField], optional 29 | """ 30 | super().__init__(**kwargs) 31 | self.id = id 32 | self.type = type 33 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/sign_request_signer_input_zip_4_validation.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class SignRequestSignerInputZip4ValidationValidationTypeField(str, Enum): 9 | ZIP_4 = 'zip_4' 10 | 11 | 12 | class SignRequestSignerInputZip4Validation(BaseObject): 13 | def __init__( 14 | self, 15 | *, 16 | validation_type: SignRequestSignerInputZip4ValidationValidationTypeField = SignRequestSignerInputZip4ValidationValidationTypeField.ZIP_4, 17 | **kwargs 18 | ): 19 | """ 20 | :param validation_type: Validates that the text input is a ZIP+4 code., defaults to SignRequestSignerInputZip4ValidationValidationTypeField.ZIP_4 21 | :type validation_type: SignRequestSignerInputZip4ValidationValidationTypeField, optional 22 | """ 23 | super().__init__(**kwargs) 24 | self.validation_type = validation_type 25 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/sign_request_signer_input_ssn_validation.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class SignRequestSignerInputSsnValidationValidationTypeField(str, Enum): 9 | SSN = 'ssn' 10 | 11 | 12 | class SignRequestSignerInputSsnValidation(BaseObject): 13 | def __init__( 14 | self, 15 | *, 16 | validation_type: SignRequestSignerInputSsnValidationValidationTypeField = SignRequestSignerInputSsnValidationValidationTypeField.SSN, 17 | **kwargs 18 | ): 19 | """ 20 | :param validation_type: Validates that the text input is a Social Security Number (SSN)., defaults to SignRequestSignerInputSsnValidationValidationTypeField.SSN 21 | :type validation_type: SignRequestSignerInputSsnValidationValidationTypeField, optional 22 | """ 23 | super().__init__(**kwargs) 24 | self.validation_type = validation_type 25 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/enterprise_feature_settings_item_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.schemas.v2025_r0.enterprise_configuration_item_v2025_r0 import ( 4 | EnterpriseConfigurationItemV2025R0, 5 | ) 6 | 7 | from box_sdk_gen.schemas.v2025_r0.enterprise_feature_setting_v2025_r0 import ( 8 | EnterpriseFeatureSettingV2025R0, 9 | ) 10 | 11 | from box_sdk_gen.box.errors import BoxSDKError 12 | 13 | 14 | class EnterpriseFeatureSettingsItemV2025R0(EnterpriseConfigurationItemV2025R0): 15 | def __init__( 16 | self, 17 | *, 18 | value: Optional[EnterpriseFeatureSettingV2025R0] = None, 19 | is_used: Optional[bool] = None, 20 | **kwargs 21 | ): 22 | """ 23 | :param is_used: Indicates whether a configuration is used for a given enterprise., defaults to None 24 | :type is_used: Optional[bool], optional 25 | """ 26 | super().__init__(is_used=is_used, **kwargs) 27 | self.value = value 28 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/sign_request_signer_input_email_validation.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class SignRequestSignerInputEmailValidationValidationTypeField(str, Enum): 9 | EMAIL = 'email' 10 | 11 | 12 | class SignRequestSignerInputEmailValidation(BaseObject): 13 | def __init__( 14 | self, 15 | *, 16 | validation_type: SignRequestSignerInputEmailValidationValidationTypeField = SignRequestSignerInputEmailValidationValidationTypeField.EMAIL, 17 | **kwargs 18 | ): 19 | """ 20 | :param validation_type: Validates that the text input is an email address., defaults to SignRequestSignerInputEmailValidationValidationTypeField.EMAIL 21 | :type validation_type: SignRequestSignerInputEmailValidationValidationTypeField, optional 22 | """ 23 | super().__init__(**kwargs) 24 | self.validation_type = validation_type 25 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/sign_request_signer_input_date_us_validation.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class SignRequestSignerInputDateUsValidationValidationTypeField(str, Enum): 11 | DATE_US = 'date_us' 12 | 13 | 14 | class SignRequestSignerInputDateUsValidation(BaseObject): 15 | def __init__( 16 | self, 17 | *, 18 | validation_type: Optional[ 19 | SignRequestSignerInputDateUsValidationValidationTypeField 20 | ] = None, 21 | **kwargs 22 | ): 23 | """ 24 | :param validation_type: Validates that the text input uses the US date format `MM/DD/YYYY`., defaults to None 25 | :type validation_type: Optional[SignRequestSignerInputDateUsValidationValidationTypeField], optional 26 | """ 27 | super().__init__(**kwargs) 28 | self.validation_type = validation_type 29 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/doc_gen_job_base_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class DocGenJobBaseV2025R0TypeField(str, Enum): 9 | DOCGEN_JOB = 'docgen_job' 10 | 11 | 12 | class DocGenJobBaseV2025R0(BaseObject): 13 | _discriminator = 'type', {'docgen_job'} 14 | 15 | def __init__( 16 | self, 17 | id: str, 18 | *, 19 | type: DocGenJobBaseV2025R0TypeField = DocGenJobBaseV2025R0TypeField.DOCGEN_JOB, 20 | **kwargs 21 | ): 22 | """ 23 | :param id: The unique identifier that represent a Box Doc Gen job. 24 | :type id: str 25 | :param type: The value will always be `docgen_job`., defaults to DocGenJobBaseV2025R0TypeField.DOCGEN_JOB 26 | :type type: DocGenJobBaseV2025R0TypeField, optional 27 | """ 28 | super().__init__(**kwargs) 29 | self.id = id 30 | self.type = type 31 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/sign_request_signer_input_date_eu_validation.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class SignRequestSignerInputDateEuValidationValidationTypeField(str, Enum): 11 | DATE_EU = 'date_eu' 12 | 13 | 14 | class SignRequestSignerInputDateEuValidation(BaseObject): 15 | def __init__( 16 | self, 17 | *, 18 | validation_type: Optional[ 19 | SignRequestSignerInputDateEuValidationValidationTypeField 20 | ] = None, 21 | **kwargs 22 | ): 23 | """ 24 | :param validation_type: Validates that the text input uses the European date format `DD/MM/YYYY`., defaults to None 25 | :type validation_type: Optional[SignRequestSignerInputDateEuValidationValidationTypeField], optional 26 | """ 27 | super().__init__(**kwargs) 28 | self.validation_type = validation_type 29 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/sign_request_signer_input_date_iso_validation.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class SignRequestSignerInputDateIsoValidationValidationTypeField(str, Enum): 11 | DATE_ISO = 'date_iso' 12 | 13 | 14 | class SignRequestSignerInputDateIsoValidation(BaseObject): 15 | def __init__( 16 | self, 17 | *, 18 | validation_type: Optional[ 19 | SignRequestSignerInputDateIsoValidationValidationTypeField 20 | ] = None, 21 | **kwargs 22 | ): 23 | """ 24 | :param validation_type: Validates that the text input uses the ISO date format `YYYY-MM-DD`., defaults to None 25 | :type validation_type: Optional[SignRequestSignerInputDateIsoValidationValidationTypeField], optional 26 | """ 27 | super().__init__(**kwargs) 28 | self.validation_type = validation_type 29 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/terms_of_service_base.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class TermsOfServiceBaseTypeField(str, Enum): 9 | TERMS_OF_SERVICE = 'terms_of_service' 10 | 11 | 12 | class TermsOfServiceBase(BaseObject): 13 | _discriminator = 'type', {'terms_of_service'} 14 | 15 | def __init__( 16 | self, 17 | id: str, 18 | *, 19 | type: TermsOfServiceBaseTypeField = TermsOfServiceBaseTypeField.TERMS_OF_SERVICE, 20 | **kwargs 21 | ): 22 | """ 23 | :param id: The unique identifier for this terms of service. 24 | :type id: str 25 | :param type: The value will always be `terms_of_service`., defaults to TermsOfServiceBaseTypeField.TERMS_OF_SERVICE 26 | :type type: TermsOfServiceBaseTypeField, optional 27 | """ 28 | super().__init__(**kwargs) 29 | self.id = id 30 | self.type = type 31 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/legal_hold_policy_mini.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class LegalHoldPolicyMiniTypeField(str, Enum): 9 | LEGAL_HOLD_POLICY = 'legal_hold_policy' 10 | 11 | 12 | class LegalHoldPolicyMini(BaseObject): 13 | _discriminator = 'type', {'legal_hold_policy'} 14 | 15 | def __init__( 16 | self, 17 | id: str, 18 | *, 19 | type: LegalHoldPolicyMiniTypeField = LegalHoldPolicyMiniTypeField.LEGAL_HOLD_POLICY, 20 | **kwargs 21 | ): 22 | """ 23 | :param id: The unique identifier for this legal hold policy. 24 | :type id: str 25 | :param type: The value will always be `legal_hold_policy`., defaults to LegalHoldPolicyMiniTypeField.LEGAL_HOLD_POLICY 26 | :type type: LegalHoldPolicyMiniTypeField, optional 27 | """ 28 | super().__init__(**kwargs) 29 | self.id = id 30 | self.type = type 31 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/sign_request_signer_input_date_asia_validation.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class SignRequestSignerInputDateAsiaValidationValidationTypeField(str, Enum): 11 | DATE_ASIA = 'date_asia' 12 | 13 | 14 | class SignRequestSignerInputDateAsiaValidation(BaseObject): 15 | def __init__( 16 | self, 17 | *, 18 | validation_type: Optional[ 19 | SignRequestSignerInputDateAsiaValidationValidationTypeField 20 | ] = None, 21 | **kwargs 22 | ): 23 | """ 24 | :param validation_type: Validates that the text input uses the Asian date format `YYYY/MM/DD`., defaults to None 25 | :type validation_type: Optional[SignRequestSignerInputDateAsiaValidationValidationTypeField], optional 26 | """ 27 | super().__init__(**kwargs) 28 | self.validation_type = validation_type 29 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/retention_policy_base.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class RetentionPolicyBaseTypeField(str, Enum): 9 | RETENTION_POLICY = 'retention_policy' 10 | 11 | 12 | class RetentionPolicyBase(BaseObject): 13 | _discriminator = 'type', {'retention_policy'} 14 | 15 | def __init__( 16 | self, 17 | id: str, 18 | *, 19 | type: RetentionPolicyBaseTypeField = RetentionPolicyBaseTypeField.RETENTION_POLICY, 20 | **kwargs 21 | ): 22 | """ 23 | :param id: The unique identifier that represents a retention policy. 24 | :type id: str 25 | :param type: The value will always be `retention_policy`., defaults to RetentionPolicyBaseTypeField.RETENTION_POLICY 26 | :type type: RetentionPolicyBaseTypeField, optional 27 | """ 28 | super().__init__(**kwargs) 29 | self.id = id 30 | self.type = type 31 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/file_version_base_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class FileVersionBaseV2025R0TypeField(str, Enum): 9 | FILE_VERSION = 'file_version' 10 | 11 | 12 | class FileVersionBaseV2025R0(BaseObject): 13 | _discriminator = 'type', {'file_version'} 14 | 15 | def __init__( 16 | self, 17 | id: str, 18 | *, 19 | type: FileVersionBaseV2025R0TypeField = FileVersionBaseV2025R0TypeField.FILE_VERSION, 20 | **kwargs 21 | ): 22 | """ 23 | :param id: The unique identifier that represent a file version. 24 | :type id: str 25 | :param type: The value will always be `file_version`., defaults to FileVersionBaseV2025R0TypeField.FILE_VERSION 26 | :type type: FileVersionBaseV2025R0TypeField, optional 27 | """ 28 | super().__init__(**kwargs) 29 | self.id = id 30 | self.type = type 31 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/terms_of_service_user_statuses.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.terms_of_service_user_status import TermsOfServiceUserStatus 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class TermsOfServiceUserStatuses(BaseObject): 13 | def __init__( 14 | self, 15 | *, 16 | total_count: Optional[int] = None, 17 | entries: Optional[List[TermsOfServiceUserStatus]] = None, 18 | **kwargs 19 | ): 20 | """ 21 | :param total_count: The total number of objects., defaults to None 22 | :type total_count: Optional[int], optional 23 | :param entries: A list of terms of service user statuses., defaults to None 24 | :type entries: Optional[List[TermsOfServiceUserStatus]], optional 25 | """ 26 | super().__init__(**kwargs) 27 | self.total_count = total_count 28 | self.entries = entries 29 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/doc_gen_batch_base_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class DocGenBatchBaseV2025R0TypeField(str, Enum): 9 | DOCGEN_BATCH = 'docgen_batch' 10 | 11 | 12 | class DocGenBatchBaseV2025R0(BaseObject): 13 | _discriminator = 'type', {'docgen_batch'} 14 | 15 | def __init__( 16 | self, 17 | id: str, 18 | *, 19 | type: DocGenBatchBaseV2025R0TypeField = DocGenBatchBaseV2025R0TypeField.DOCGEN_BATCH, 20 | **kwargs 21 | ): 22 | """ 23 | :param id: The unique identifier that represents a Box Doc Gen batch. 24 | :type id: str 25 | :param type: The value will always be `docgen_batch`., defaults to DocGenBatchBaseV2025R0TypeField.DOCGEN_BATCH 26 | :type type: DocGenBatchBaseV2025R0TypeField, optional 27 | """ 28 | super().__init__(**kwargs) 29 | self.id = id 30 | self.type = type 31 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/integration_mapping_box_item_slack.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class IntegrationMappingBoxItemSlackTypeField(str, Enum): 9 | FOLDER = 'folder' 10 | 11 | 12 | class IntegrationMappingBoxItemSlack(BaseObject): 13 | _discriminator = 'type', {'folder'} 14 | 15 | def __init__( 16 | self, 17 | id: str, 18 | *, 19 | type: IntegrationMappingBoxItemSlackTypeField = IntegrationMappingBoxItemSlackTypeField.FOLDER, 20 | **kwargs 21 | ): 22 | """ 23 | :param id: ID of the mapped item (of type referenced in `type`). 24 | :type id: str 25 | :param type: Type of the mapped item referenced in `id`., defaults to IntegrationMappingBoxItemSlackTypeField.FOLDER 26 | :type type: IntegrationMappingBoxItemSlackTypeField, optional 27 | """ 28 | super().__init__(**kwargs) 29 | self.id = id 30 | self.type = type 31 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/tasks.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.task import Task 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class Tasks(BaseObject): 13 | def __init__( 14 | self, 15 | *, 16 | total_count: Optional[int] = None, 17 | entries: Optional[List[Task]] = None, 18 | **kwargs 19 | ): 20 | """ 21 | :param total_count: One greater than the offset of the last entry in the entire collection. 22 | The total number of entries in the collection may be less than 23 | `total_count`., defaults to None 24 | :type total_count: Optional[int], optional 25 | :param entries: A list of tasks., defaults to None 26 | :type entries: Optional[List[Task]], optional 27 | """ 28 | super().__init__(**kwargs) 29 | self.total_count = total_count 30 | self.entries = entries 31 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/shield_list_content_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from box_sdk_gen.schemas.v2025_r0.shield_list_content_country_v2025_r0 import ( 4 | ShieldListContentCountryV2025R0, 5 | ) 6 | 7 | from box_sdk_gen.schemas.v2025_r0.shield_list_content_domain_v2025_r0 import ( 8 | ShieldListContentDomainV2025R0, 9 | ) 10 | 11 | from box_sdk_gen.schemas.v2025_r0.shield_list_content_email_v2025_r0 import ( 12 | ShieldListContentEmailV2025R0, 13 | ) 14 | 15 | from box_sdk_gen.schemas.v2025_r0.shield_list_content_ip_v2025_r0 import ( 16 | ShieldListContentIpV2025R0, 17 | ) 18 | 19 | from box_sdk_gen.schemas.v2025_r0.shield_list_content_integration_v2025_r0 import ( 20 | ShieldListContentIntegrationV2025R0, 21 | ) 22 | 23 | from box_sdk_gen.box.errors import BoxSDKError 24 | 25 | ShieldListContentV2025R0 = Union[ 26 | ShieldListContentCountryV2025R0, 27 | ShieldListContentDomainV2025R0, 28 | ShieldListContentEmailV2025R0, 29 | ShieldListContentIpV2025R0, 30 | ShieldListContentIntegrationV2025R0, 31 | ] 32 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/enterprise_reference_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class EnterpriseReferenceV2025R0TypeField(str, Enum): 11 | ENTERPRISE = 'enterprise' 12 | 13 | 14 | class EnterpriseReferenceV2025R0(BaseObject): 15 | _discriminator = 'type', {'enterprise'} 16 | 17 | def __init__( 18 | self, 19 | *, 20 | id: Optional[str] = None, 21 | type: Optional[EnterpriseReferenceV2025R0TypeField] = None, 22 | **kwargs 23 | ): 24 | """ 25 | :param id: The unique identifier for this enterprise., defaults to None 26 | :type id: Optional[str], optional 27 | :param type: The value will always be `enterprise`., defaults to None 28 | :type type: Optional[EnterpriseReferenceV2025R0TypeField], optional 29 | """ 30 | super().__init__(**kwargs) 31 | self.id = id 32 | self.type = type 33 | -------------------------------------------------------------------------------- /test/file_version_legal_holds.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from box_sdk_gen.schemas.file_version_legal_holds import FileVersionLegalHolds 4 | 5 | from box_sdk_gen.internal.utils import generate_byte_stream 6 | 7 | from box_sdk_gen.internal.utils import get_uuid 8 | 9 | from box_sdk_gen.client import BoxClient 10 | 11 | from test.commons import get_default_client 12 | 13 | client: BoxClient = get_default_client() 14 | 15 | 16 | def testGetFileVersionLegalHolds(): 17 | policy_id: str = '1234567890' 18 | file_version_legal_holds: FileVersionLegalHolds = ( 19 | client.file_version_legal_holds.get_file_version_legal_holds(policy_id) 20 | ) 21 | file_version_legal_holds_count: int = len(file_version_legal_holds.entries) 22 | assert file_version_legal_holds_count >= 0 23 | 24 | 25 | def testGetFileVersionLegalHoldById(): 26 | file_version_legal_hold_id: str = '987654321' 27 | with pytest.raises(Exception): 28 | client.file_version_legal_holds.get_file_version_legal_hold_by_id( 29 | file_version_legal_hold_id 30 | ) 31 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/ai_agent_text_gen.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.ai_agent_basic_gen_tool import AiAgentBasicGenTool 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class AiAgentTextGenTypeField(str, Enum): 13 | AI_AGENT_TEXT_GEN = 'ai_agent_text_gen' 14 | 15 | 16 | class AiAgentTextGen(BaseObject): 17 | _discriminator = 'type', {'ai_agent_text_gen'} 18 | 19 | def __init__( 20 | self, 21 | *, 22 | type: AiAgentTextGenTypeField = AiAgentTextGenTypeField.AI_AGENT_TEXT_GEN, 23 | basic_gen: Optional[AiAgentBasicGenTool] = None, 24 | **kwargs 25 | ): 26 | """ 27 | :param type: The type of AI agent used for generating text., defaults to AiAgentTextGenTypeField.AI_AGENT_TEXT_GEN 28 | :type type: AiAgentTextGenTypeField, optional 29 | """ 30 | super().__init__(**kwargs) 31 | self.type = type 32 | self.basic_gen = basic_gen 33 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/user_or_group_reference_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class UserOrGroupReferenceV2025R0TypeField(str, Enum): 11 | USER = 'user' 12 | GROUP = 'group' 13 | 14 | 15 | class UserOrGroupReferenceV2025R0(BaseObject): 16 | _discriminator = 'type', {'user', 'group'} 17 | 18 | def __init__( 19 | self, 20 | *, 21 | type: Optional[UserOrGroupReferenceV2025R0TypeField] = None, 22 | id: Optional[str] = None, 23 | **kwargs 24 | ): 25 | """ 26 | :param type: The type `user` or `group`., defaults to None 27 | :type type: Optional[UserOrGroupReferenceV2025R0TypeField], optional 28 | :param id: The identifier of the user or group., defaults to None 29 | :type id: Optional[str], optional 30 | """ 31 | super().__init__(**kwargs) 32 | self.type = type 33 | self.id = id 34 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/terms_of_service_base_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class TermsOfServiceBaseV2025R0TypeField(str, Enum): 9 | TERMS_OF_SERVICE = 'terms_of_service' 10 | 11 | 12 | class TermsOfServiceBaseV2025R0(BaseObject): 13 | _discriminator = 'type', {'terms_of_service'} 14 | 15 | def __init__( 16 | self, 17 | id: str, 18 | *, 19 | type: TermsOfServiceBaseV2025R0TypeField = TermsOfServiceBaseV2025R0TypeField.TERMS_OF_SERVICE, 20 | **kwargs 21 | ): 22 | """ 23 | :param id: The unique identifier for this terms of service. 24 | :type id: str 25 | :param type: The value will always be `terms_of_service`., defaults to TermsOfServiceBaseV2025R0TypeField.TERMS_OF_SERVICE 26 | :type type: TermsOfServiceBaseV2025R0TypeField, optional 27 | """ 28 | super().__init__(**kwargs) 29 | self.id = id 30 | self.type = type 31 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/integration_mapping_slack_create_request.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.schemas.integration_mapping_partner_item_slack import ( 6 | IntegrationMappingPartnerItemSlack, 7 | ) 8 | 9 | from box_sdk_gen.schemas.integration_mapping_box_item_slack import ( 10 | IntegrationMappingBoxItemSlack, 11 | ) 12 | 13 | from box_sdk_gen.schemas.integration_mapping_slack_options import ( 14 | IntegrationMappingSlackOptions, 15 | ) 16 | 17 | from box_sdk_gen.box.errors import BoxSDKError 18 | 19 | 20 | class IntegrationMappingSlackCreateRequest(BaseObject): 21 | def __init__( 22 | self, 23 | partner_item: IntegrationMappingPartnerItemSlack, 24 | box_item: IntegrationMappingBoxItemSlack, 25 | *, 26 | options: Optional[IntegrationMappingSlackOptions] = None, 27 | **kwargs 28 | ): 29 | super().__init__(**kwargs) 30 | self.partner_item = partner_item 31 | self.box_item = box_item 32 | self.options = options 33 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/shield_list_content_ip_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class ShieldListContentIpV2025R0TypeField(str, Enum): 11 | IP = 'ip' 12 | 13 | 14 | class ShieldListContentIpV2025R0(BaseObject): 15 | _discriminator = 'type', {'ip'} 16 | 17 | def __init__( 18 | self, 19 | ip_addresses: List[str], 20 | *, 21 | type: ShieldListContentIpV2025R0TypeField = ShieldListContentIpV2025R0TypeField.IP, 22 | **kwargs 23 | ): 24 | """ 25 | :param ip_addresses: List of ip addresses and CIDRs. 26 | :type ip_addresses: List[str] 27 | :param type: The type of content in the shield list., defaults to ShieldListContentIpV2025R0TypeField.IP 28 | :type type: ShieldListContentIpV2025R0TypeField, optional 29 | """ 30 | super().__init__(**kwargs) 31 | self.ip_addresses = ip_addresses 32 | self.type = type 33 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/app_item.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class AppItemTypeField(str, Enum): 9 | APP_ITEM = 'app_item' 10 | 11 | 12 | class AppItem(BaseObject): 13 | _discriminator = 'type', {'app_item'} 14 | 15 | def __init__( 16 | self, 17 | id: str, 18 | application_type: str, 19 | *, 20 | type: AppItemTypeField = AppItemTypeField.APP_ITEM, 21 | **kwargs 22 | ): 23 | """ 24 | :param id: The unique identifier for this app item. 25 | :type id: str 26 | :param application_type: The type of the app that owns this app item. 27 | :type application_type: str 28 | :param type: The value will always be `app_item`., defaults to AppItemTypeField.APP_ITEM 29 | :type type: AppItemTypeField, optional 30 | """ 31 | super().__init__(**kwargs) 32 | self.id = id 33 | self.application_type = application_type 34 | self.type = type 35 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/shield_list_content_domain_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class ShieldListContentDomainV2025R0TypeField(str, Enum): 11 | DOMAIN = 'domain' 12 | 13 | 14 | class ShieldListContentDomainV2025R0(BaseObject): 15 | _discriminator = 'type', {'domain'} 16 | 17 | def __init__( 18 | self, 19 | domains: List[str], 20 | *, 21 | type: ShieldListContentDomainV2025R0TypeField = ShieldListContentDomainV2025R0TypeField.DOMAIN, 22 | **kwargs 23 | ): 24 | """ 25 | :param domains: List of domain. 26 | :type domains: List[str] 27 | :param type: The type of content in the shield list., defaults to ShieldListContentDomainV2025R0TypeField.DOMAIN 28 | :type type: ShieldListContentDomainV2025R0TypeField, optional 29 | """ 30 | super().__init__(**kwargs) 31 | self.domains = domains 32 | self.type = type 33 | -------------------------------------------------------------------------------- /test/transfer.py: -------------------------------------------------------------------------------- 1 | from box_sdk_gen.client import BoxClient 2 | 3 | from box_sdk_gen.schemas.user_full import UserFull 4 | 5 | from box_sdk_gen.schemas.folder_full import FolderFull 6 | 7 | from box_sdk_gen.managers.transfer import TransferOwnedFolderOwnedBy 8 | 9 | from box_sdk_gen.internal.utils import get_uuid 10 | 11 | from test.commons import get_default_client 12 | 13 | client: BoxClient = get_default_client() 14 | 15 | 16 | def testTransferUserContent(): 17 | source_user_name: str = get_uuid() 18 | source_user: UserFull = client.users.create_user( 19 | source_user_name, is_platform_access_only=True 20 | ) 21 | target_user: UserFull = client.users.get_user_me() 22 | transferred_folder: FolderFull = client.transfer.transfer_owned_folder( 23 | source_user.id, TransferOwnedFolderOwnedBy(id=target_user.id), notify=False 24 | ) 25 | assert transferred_folder.owned_by.id == target_user.id 26 | client.folders.delete_folder_by_id(transferred_folder.id, recursive=True) 27 | client.users.delete_user_by_id(source_user.id, notify=False, force=True) 28 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/storage_policy.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.schemas.storage_policy_mini import StoragePolicyMiniTypeField 4 | 5 | from box_sdk_gen.schemas.storage_policy_mini import StoragePolicyMini 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class StoragePolicy(StoragePolicyMini): 11 | def __init__( 12 | self, 13 | id: str, 14 | *, 15 | name: Optional[str] = None, 16 | type: StoragePolicyMiniTypeField = StoragePolicyMiniTypeField.STORAGE_POLICY, 17 | **kwargs 18 | ): 19 | """ 20 | :param id: The unique identifier for this storage policy. 21 | :type id: str 22 | :param name: A descriptive name of the region., defaults to None 23 | :type name: Optional[str], optional 24 | :param type: The value will always be `storage_policy`., defaults to StoragePolicyMiniTypeField.STORAGE_POLICY 25 | :type type: StoragePolicyMiniTypeField, optional 26 | """ 27 | super().__init__(id=id, type=type, **kwargs) 28 | self.name = name 29 | -------------------------------------------------------------------------------- /box_sdk_gen/internal/logging.py: -------------------------------------------------------------------------------- 1 | from typing import Dict 2 | 3 | from box_sdk_gen.serialization.json import SerializedData 4 | 5 | from box_sdk_gen.internal.utils import sanitize_map 6 | 7 | from box_sdk_gen.serialization.json import sanitize_serialized_data 8 | 9 | 10 | class DataSanitizer: 11 | def __init__(self): 12 | self._keys_to_sanitize = { 13 | 'authorization': '', 14 | 'access_token': '', 15 | 'refresh_token': '', 16 | 'subject_token': '', 17 | 'token': '', 18 | 'client_id': '', 19 | 'client_secret': '', 20 | 'shared_link': '', 21 | 'download_url': '', 22 | 'jwt_private_key': '', 23 | 'jwt_private_key_passphrase': '', 24 | 'password': '', 25 | } 26 | 27 | def sanitize_headers(self, headers: Dict[str, str]) -> Dict[str, str]: 28 | return sanitize_map(headers, self._keys_to_sanitize) 29 | 30 | def sanitize_body(self, body: SerializedData) -> SerializedData: 31 | return sanitize_serialized_data(body, self._keys_to_sanitize) 32 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 30 3 | 4 | # Number of days of inactivity before a stale issue is closed 5 | daysUntilClose: 7 6 | 7 | # Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable 8 | exemptLabels: 9 | - enhancement 10 | - dontstale 11 | - needs-triage 12 | 13 | # Label to use when marking an issue as stale 14 | staleLabel: stale 15 | 16 | # Comment to post when marking an issue as stale. Set to `false` to disable 17 | markComment: > 18 | This issue has been automatically marked as stale because it has not been updated in the last 30 days. It will be closed if no further activity occurs within the next 7 days. Feel free to reach out or mention Box SDK team member for further help and resources if they are needed. 19 | 20 | # Comment to post when closing a stale issue. Set to `false` to disable 21 | closeComment: > 22 | This issue has been automatically closed due to maximum period of being stale. Thank you for your contribution to Box SDK and feel free to open another PR/issue at any time. 23 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/ai_item_ask.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class AiItemAskTypeField(str, Enum): 11 | FILE = 'file' 12 | HUBS = 'hubs' 13 | 14 | 15 | class AiItemAsk(BaseObject): 16 | _discriminator = 'type', {'file', 'hubs'} 17 | 18 | def __init__( 19 | self, 20 | id: str, 21 | type: AiItemAskTypeField, 22 | *, 23 | content: Optional[str] = None, 24 | **kwargs 25 | ): 26 | """ 27 | :param id: The ID of the file. 28 | :type id: str 29 | :param type: The type of the item. A `hubs` item must be used as a single item. 30 | :type type: AiItemAskTypeField 31 | :param content: The content of the item, often the text representation., defaults to None 32 | :type content: Optional[str], optional 33 | """ 34 | super().__init__(**kwargs) 35 | self.id = id 36 | self.type = type 37 | self.content = content 38 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/sign_request_signer_input_number_with_comma_validation.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class SignRequestSignerInputNumberWithCommaValidationValidationTypeField(str, Enum): 11 | NUMBER_WITH_COMMA = 'number_with_comma' 12 | 13 | 14 | class SignRequestSignerInputNumberWithCommaValidation(BaseObject): 15 | def __init__( 16 | self, 17 | *, 18 | validation_type: Optional[ 19 | SignRequestSignerInputNumberWithCommaValidationValidationTypeField 20 | ] = None, 21 | **kwargs 22 | ): 23 | """ 24 | :param validation_type: Validates that the text input uses a number format with a comma as the decimal separator (for example, 1,23)., defaults to None 25 | :type validation_type: Optional[SignRequestSignerInputNumberWithCommaValidationValidationTypeField], optional 26 | """ 27 | super().__init__(**kwargs) 28 | self.validation_type = validation_type 29 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/metadata_error.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class MetadataError(BaseObject): 9 | def __init__( 10 | self, 11 | *, 12 | code: Optional[str] = None, 13 | message: Optional[str] = None, 14 | request_id: Optional[str] = None, 15 | **kwargs 16 | ): 17 | """ 18 | :param code: A Box-specific error code., defaults to None 19 | :type code: Optional[str], optional 20 | :param message: A short message describing the error., defaults to None 21 | :type message: Optional[str], optional 22 | :param request_id: A unique identifier for this response, which can be used 23 | when contacting Box support., defaults to None 24 | :type request_id: Optional[str], optional 25 | """ 26 | super().__init__(**kwargs) 27 | self.code = code 28 | self.message = message 29 | self.request_id = request_id 30 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/shield_list_content_email_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class ShieldListContentEmailV2025R0TypeField(str, Enum): 11 | EMAIL = 'email' 12 | 13 | 14 | class ShieldListContentEmailV2025R0(BaseObject): 15 | _discriminator = 'type', {'email'} 16 | 17 | def __init__( 18 | self, 19 | email_addresses: List[str], 20 | *, 21 | type: ShieldListContentEmailV2025R0TypeField = ShieldListContentEmailV2025R0TypeField.EMAIL, 22 | **kwargs 23 | ): 24 | """ 25 | :param email_addresses: List of emails. 26 | :type email_addresses: List[str] 27 | :param type: The type of content in the shield list., defaults to ShieldListContentEmailV2025R0TypeField.EMAIL 28 | :type type: ShieldListContentEmailV2025R0TypeField, optional 29 | """ 30 | super().__init__(**kwargs) 31 | self.email_addresses = email_addresses 32 | self.type = type 33 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/sign_request_signer_input_number_with_period_validation.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class SignRequestSignerInputNumberWithPeriodValidationValidationTypeField(str, Enum): 11 | NUMBER_WITH_PERIOD = 'number_with_period' 12 | 13 | 14 | class SignRequestSignerInputNumberWithPeriodValidation(BaseObject): 15 | def __init__( 16 | self, 17 | *, 18 | validation_type: Optional[ 19 | SignRequestSignerInputNumberWithPeriodValidationValidationTypeField 20 | ] = None, 21 | **kwargs 22 | ): 23 | """ 24 | :param validation_type: Validates that the text input uses a number format with a period as the decimal separator (for example, 1.23)., defaults to None 25 | :type validation_type: Optional[SignRequestSignerInputNumberWithPeriodValidationValidationTypeField], optional 26 | """ 27 | super().__init__(**kwargs) 28 | self.validation_type = validation_type 29 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/integration_mapping_base.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class IntegrationMappingBaseTypeField(str, Enum): 9 | INTEGRATION_MAPPING = 'integration_mapping' 10 | 11 | 12 | class IntegrationMappingBase(BaseObject): 13 | _discriminator = 'type', {'integration_mapping'} 14 | 15 | def __init__( 16 | self, 17 | id: str, 18 | *, 19 | type: IntegrationMappingBaseTypeField = IntegrationMappingBaseTypeField.INTEGRATION_MAPPING, 20 | **kwargs 21 | ): 22 | """ 23 | :param id: A unique identifier of a folder mapping 24 | (part of a composite key together 25 | with `integration_type`). 26 | :type id: str 27 | :param type: Mapping type., defaults to IntegrationMappingBaseTypeField.INTEGRATION_MAPPING 28 | :type type: IntegrationMappingBaseTypeField, optional 29 | """ 30 | super().__init__(**kwargs) 31 | self.id = id 32 | self.type = type 33 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/shield_information_barrier_base.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class ShieldInformationBarrierBaseTypeField(str, Enum): 11 | SHIELD_INFORMATION_BARRIER = 'shield_information_barrier' 12 | 13 | 14 | class ShieldInformationBarrierBase(BaseObject): 15 | _discriminator = 'type', {'shield_information_barrier'} 16 | 17 | def __init__( 18 | self, 19 | *, 20 | id: Optional[str] = None, 21 | type: Optional[ShieldInformationBarrierBaseTypeField] = None, 22 | **kwargs 23 | ): 24 | """ 25 | :param id: The unique identifier for the shield information barrier., defaults to None 26 | :type id: Optional[str], optional 27 | :param type: The type of the shield information barrier., defaults to None 28 | :type type: Optional[ShieldInformationBarrierBaseTypeField], optional 29 | """ 30 | super().__init__(**kwargs) 31 | self.id = id 32 | self.type = type 33 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/upload_part_mini.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class UploadPartMini(BaseObject): 9 | def __init__( 10 | self, 11 | *, 12 | part_id: Optional[str] = None, 13 | offset: Optional[int] = None, 14 | size: Optional[int] = None, 15 | **kwargs 16 | ): 17 | """ 18 | :param part_id: The unique ID of the chunk., defaults to None 19 | :type part_id: Optional[str], optional 20 | :param offset: The offset of the chunk within the file 21 | in bytes. The lower bound of the position 22 | of the chunk within the file., defaults to None 23 | :type offset: Optional[int], optional 24 | :param size: The size of the chunk in bytes., defaults to None 25 | :type size: Optional[int], optional 26 | """ 27 | super().__init__(**kwargs) 28 | self.part_id = part_id 29 | self.offset = offset 30 | self.size = size 31 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/metadata_field_filter_float_range.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class MetadataFieldFilterFloatRange(BaseObject): 9 | def __init__( 10 | self, *, lt: Optional[float] = None, gt: Optional[float] = None, **kwargs 11 | ): 12 | """ 13 | :param lt: Specifies the (inclusive) upper bound for the metadata field 14 | value. The value of a field must be lower than (`lt`) or 15 | equal to this value for the search query to match this 16 | template., defaults to None 17 | :type lt: Optional[float], optional 18 | :param gt: Specifies the (inclusive) lower bound for the metadata field 19 | value. The value of a field must be greater than (`gt`) or 20 | equal to this value for the search query to match this 21 | template., defaults to None 22 | :type gt: Optional[float], optional 23 | """ 24 | super().__init__(**kwargs) 25 | self.lt = lt 26 | self.gt = gt 27 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/shield_list_content_country_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class ShieldListContentCountryV2025R0TypeField(str, Enum): 11 | COUNTRY = 'country' 12 | 13 | 14 | class ShieldListContentCountryV2025R0(BaseObject): 15 | _discriminator = 'type', {'country'} 16 | 17 | def __init__( 18 | self, 19 | country_codes: List[str], 20 | *, 21 | type: ShieldListContentCountryV2025R0TypeField = ShieldListContentCountryV2025R0TypeField.COUNTRY, 22 | **kwargs 23 | ): 24 | """ 25 | :param country_codes: List of country codes values. 26 | :type country_codes: List[str] 27 | :param type: The type of content in the shield list., defaults to ShieldListContentCountryV2025R0TypeField.COUNTRY 28 | :type type: ShieldListContentCountryV2025R0TypeField, optional 29 | """ 30 | super().__init__(**kwargs) 31 | self.country_codes = country_codes 32 | self.type = type 33 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/legal_hold_policy_assignment_base.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class LegalHoldPolicyAssignmentBaseTypeField(str, Enum): 11 | LEGAL_HOLD_POLICY_ASSIGNMENT = 'legal_hold_policy_assignment' 12 | 13 | 14 | class LegalHoldPolicyAssignmentBase(BaseObject): 15 | _discriminator = 'type', {'legal_hold_policy_assignment'} 16 | 17 | def __init__( 18 | self, 19 | *, 20 | id: Optional[str] = None, 21 | type: Optional[LegalHoldPolicyAssignmentBaseTypeField] = None, 22 | **kwargs 23 | ): 24 | """ 25 | :param id: The unique identifier for this legal hold assignment., defaults to None 26 | :type id: Optional[str], optional 27 | :param type: The value will always be `legal_hold_policy_assignment`., defaults to None 28 | :type type: Optional[LegalHoldPolicyAssignmentBaseTypeField], optional 29 | """ 30 | super().__init__(**kwargs) 31 | self.id = id 32 | self.type = type 33 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/watermark.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | from box_sdk_gen.internal.utils import DateTime 8 | 9 | 10 | class WatermarkWatermarkField(BaseObject): 11 | def __init__( 12 | self, 13 | *, 14 | created_at: Optional[DateTime] = None, 15 | modified_at: Optional[DateTime] = None, 16 | **kwargs 17 | ): 18 | """ 19 | :param created_at: When this watermark was created., defaults to None 20 | :type created_at: Optional[DateTime], optional 21 | :param modified_at: When this task was modified., defaults to None 22 | :type modified_at: Optional[DateTime], optional 23 | """ 24 | super().__init__(**kwargs) 25 | self.created_at = created_at 26 | self.modified_at = modified_at 27 | 28 | 29 | class Watermark(BaseObject): 30 | def __init__( 31 | self, *, watermark: Optional[WatermarkWatermarkField] = None, **kwargs 32 | ): 33 | super().__init__(**kwargs) 34 | self.watermark = watermark 35 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | All contributions are welcome to this project. 4 | 5 | ## Contributor License Agreement 6 | 7 | Before a contribution can be merged into this project, please fill out the Contributor License Agreement (CLA) located at: 8 | 9 | http://opensource.box.com/cla 10 | 11 | To learn more about CLAs and why they are important to open source projects, please see the [Wikipedia entry](http://en.wikipedia.org/wiki/Contributor_License_Agreement). 12 | 13 | ## Code of Conduct 14 | 15 | This project adheres to the [Box Open Code of Conduct](http://opensource.box.com/code-of-conduct/). By participating, you are expected to uphold this code. 16 | 17 | ## How to contribute 18 | 19 | - **File an issue** - if you found a bug, want to request an enhancement, or want to implement something (bug fix or feature). 20 | - **Send a pull request** - this project is generated using [Box Codegen](https://github.com/box/box-codegen) based on[Box OpenAPI 3.0 Specification](https://github.com/box/box-openapi), so if you want found something you want to change in the generated code, you'll need to modify the codegen project and submit a pull request there. 21 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/ai_item_base.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class AiItemBaseTypeField(str, Enum): 11 | FILE = 'file' 12 | 13 | 14 | class AiItemBase(BaseObject): 15 | _discriminator = 'type', {'file'} 16 | 17 | def __init__( 18 | self, 19 | id: str, 20 | *, 21 | type: AiItemBaseTypeField = AiItemBaseTypeField.FILE, 22 | content: Optional[str] = None, 23 | **kwargs 24 | ): 25 | """ 26 | :param id: The ID of the file. 27 | :type id: str 28 | :param type: The type of the item. Currently the value can be `file` only., defaults to AiItemBaseTypeField.FILE 29 | :type type: AiItemBaseTypeField, optional 30 | :param content: The content of the item, often the text representation., defaults to None 31 | :type content: Optional[str], optional 32 | """ 33 | super().__init__(**kwargs) 34 | self.id = id 35 | self.type = type 36 | self.content = content 37 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/integration_mapping_partner_item_teams.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class IntegrationMappingPartnerItemTeamsTypeField(str, Enum): 9 | CHANNEL = 'channel' 10 | TEAM = 'team' 11 | 12 | 13 | class IntegrationMappingPartnerItemTeams(BaseObject): 14 | _discriminator = 'type', {'channel', 'team'} 15 | 16 | def __init__( 17 | self, 18 | type: IntegrationMappingPartnerItemTeamsTypeField, 19 | id: str, 20 | tenant_id: str, 21 | **kwargs 22 | ): 23 | """ 24 | :param type: Type of the mapped item referenced in `id`. 25 | :type type: IntegrationMappingPartnerItemTeamsTypeField 26 | :param id: ID of the mapped item (of type referenced in `type`). 27 | :type id: str 28 | :param tenant_id: ID of the tenant that is registered with Microsoft Teams. 29 | :type tenant_id: str 30 | """ 31 | super().__init__(**kwargs) 32 | self.type = type 33 | self.id = id 34 | self.tenant_id = tenant_id 35 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/user_mini.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.schemas.user_base import UserBaseTypeField 4 | 5 | from box_sdk_gen.schemas.user_base import UserBase 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class UserMini(UserBase): 11 | def __init__( 12 | self, 13 | id: str, 14 | *, 15 | name: Optional[str] = None, 16 | login: Optional[str] = None, 17 | type: UserBaseTypeField = UserBaseTypeField.USER, 18 | **kwargs 19 | ): 20 | """ 21 | :param id: The unique identifier for this user. 22 | :type id: str 23 | :param name: The display name of this user., defaults to None 24 | :type name: Optional[str], optional 25 | :param login: The primary email address of this user., defaults to None 26 | :type login: Optional[str], optional 27 | :param type: The value will always be `user`., defaults to UserBaseTypeField.USER 28 | :type type: UserBaseTypeField, optional 29 | """ 30 | super().__init__(id=id, type=type, **kwargs) 31 | self.name = name 32 | self.login = login 33 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/doc_gen_tag_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class DocGenTagV2025R0TagTypeField(str, Enum): 11 | TEXT = 'text' 12 | ARITHMETIC = 'arithmetic' 13 | CONDITIONAL = 'conditional' 14 | FOR_LOOP = 'for-loop' 15 | TABLE_LOOP = 'table-loop' 16 | IMAGE = 'image' 17 | 18 | 19 | class DocGenTagV2025R0(BaseObject): 20 | def __init__( 21 | self, 22 | tag_content: str, 23 | tag_type: DocGenTagV2025R0TagTypeField, 24 | json_paths: List[str], 25 | **kwargs 26 | ): 27 | """ 28 | :param tag_content: The content of the tag. 29 | :type tag_content: str 30 | :param tag_type: Type of the tag. 31 | :type tag_type: DocGenTagV2025R0TagTypeField 32 | :param json_paths: List of the paths. 33 | :type json_paths: List[str] 34 | """ 35 | super().__init__(**kwargs) 36 | self.tag_content = tag_content 37 | self.tag_type = tag_type 38 | self.json_paths = json_paths 39 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/ai_dialogue_history.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | from box_sdk_gen.internal.utils import DateTime 8 | 9 | 10 | class AiDialogueHistory(BaseObject): 11 | def __init__( 12 | self, 13 | *, 14 | prompt: Optional[str] = None, 15 | answer: Optional[str] = None, 16 | created_at: Optional[DateTime] = None, 17 | **kwargs 18 | ): 19 | """ 20 | :param prompt: The prompt previously provided by the client and answered by the LLM., defaults to None 21 | :type prompt: Optional[str], optional 22 | :param answer: The answer previously provided by the LLM., defaults to None 23 | :type answer: Optional[str], optional 24 | :param created_at: The ISO date formatted timestamp of when the previous answer to the prompt was created., defaults to None 25 | :type created_at: Optional[DateTime], optional 26 | """ 27 | super().__init__(**kwargs) 28 | self.prompt = prompt 29 | self.answer = answer 30 | self.created_at = created_at 31 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/post_o_auth_2_revoke.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class PostOAuth2Revoke(BaseObject): 9 | def __init__( 10 | self, 11 | *, 12 | client_id: Optional[str] = None, 13 | client_secret: Optional[str] = None, 14 | token: Optional[str] = None, 15 | **kwargs 16 | ): 17 | """ 18 | :param client_id: The Client ID of the application requesting to revoke the 19 | access token., defaults to None 20 | :type client_id: Optional[str], optional 21 | :param client_secret: The client secret of the application requesting to revoke 22 | an access token., defaults to None 23 | :type client_secret: Optional[str], optional 24 | :param token: The access token to revoke., defaults to None 25 | :type token: Optional[str], optional 26 | """ 27 | super().__init__(**kwargs) 28 | self.client_id = client_id 29 | self.client_secret = client_secret 30 | self.token = token 31 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/shield_information_barrier_report_base.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class ShieldInformationBarrierReportBaseTypeField(str, Enum): 11 | SHIELD_INFORMATION_BARRIER_REPORT = 'shield_information_barrier_report' 12 | 13 | 14 | class ShieldInformationBarrierReportBase(BaseObject): 15 | _discriminator = 'type', {'shield_information_barrier_report'} 16 | 17 | def __init__( 18 | self, 19 | *, 20 | id: Optional[str] = None, 21 | type: Optional[ShieldInformationBarrierReportBaseTypeField] = None, 22 | **kwargs 23 | ): 24 | """ 25 | :param id: The unique identifier for the shield information barrier report., defaults to None 26 | :type id: Optional[str], optional 27 | :param type: The type of the shield information barrier report., defaults to None 28 | :type type: Optional[ShieldInformationBarrierReportBaseTypeField], optional 29 | """ 30 | super().__init__(**kwargs) 31 | self.id = id 32 | self.type = type 33 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/user_integration_mappings.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.schemas.user_base import UserBaseTypeField 4 | 5 | from box_sdk_gen.schemas.user_base import UserBase 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class UserIntegrationMappings(UserBase): 11 | def __init__( 12 | self, 13 | id: str, 14 | *, 15 | name: Optional[str] = None, 16 | login: Optional[str] = None, 17 | type: UserBaseTypeField = UserBaseTypeField.USER, 18 | **kwargs 19 | ): 20 | """ 21 | :param id: The unique identifier for this user. 22 | :type id: str 23 | :param name: The display name of this user., defaults to None 24 | :type name: Optional[str], optional 25 | :param login: The primary email address of this user., defaults to None 26 | :type login: Optional[str], optional 27 | :param type: The value will always be `user`., defaults to UserBaseTypeField.USER 28 | :type type: UserBaseTypeField, optional 29 | """ 30 | super().__init__(id=id, type=type, **kwargs) 31 | self.name = name 32 | self.login = login 33 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/metadata_field_filter_date_range.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | from box_sdk_gen.internal.utils import DateTime 8 | 9 | 10 | class MetadataFieldFilterDateRange(BaseObject): 11 | def __init__( 12 | self, *, lt: Optional[DateTime] = None, gt: Optional[DateTime] = None, **kwargs 13 | ): 14 | """ 15 | :param lt: Specifies the (inclusive) upper bound for the metadata field 16 | value. The value of a field must be lower than (`lt`) or 17 | equal to this value for the search query to match this 18 | template., defaults to None 19 | :type lt: Optional[DateTime], optional 20 | :param gt: Specifies the (inclusive) lower bound for the metadata field 21 | value. The value of a field must be greater than (`gt`) or 22 | equal to this value for the search query to match this 23 | template., defaults to None 24 | :type gt: Optional[DateTime], optional 25 | """ 26 | super().__init__(**kwargs) 27 | self.lt = lt 28 | self.gt = gt 29 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/ai_extract_structured_response.py: -------------------------------------------------------------------------------- 1 | from typing import Dict 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.ai_agent_info import AiAgentInfo 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | from box_sdk_gen.internal.utils import DateTime 12 | 13 | 14 | class AiExtractStructuredResponse(BaseObject): 15 | def __init__( 16 | self, 17 | answer: Dict, 18 | created_at: DateTime, 19 | *, 20 | completion_reason: Optional[str] = None, 21 | ai_agent_info: Optional[AiAgentInfo] = None, 22 | **kwargs 23 | ): 24 | """ 25 | :param created_at: The ISO date formatted timestamp of when the answer to the prompt was created. 26 | :type created_at: DateTime 27 | :param completion_reason: The reason the response finishes., defaults to None 28 | :type completion_reason: Optional[str], optional 29 | """ 30 | super().__init__(**kwargs) 31 | self.answer = answer 32 | self.created_at = created_at 33 | self.completion_reason = completion_reason 34 | self.ai_agent_info = ai_agent_info 35 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/hub_base_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class HubBaseV2025R0TypeField(str, Enum): 9 | HUBS = 'hubs' 10 | 11 | 12 | class HubBaseV2025R0(BaseObject): 13 | _discriminator = 'type', {'hubs'} 14 | 15 | def __init__( 16 | self, 17 | id: str, 18 | *, 19 | type: HubBaseV2025R0TypeField = HubBaseV2025R0TypeField.HUBS, 20 | **kwargs 21 | ): 22 | """ 23 | :param id: The unique identifier that represent a Box Hub. 24 | 25 | The ID for any Box Hub can be determined 26 | by visiting a Box Hub in the web application 27 | and copying the ID from the URL. For example, 28 | for the URL `https://*.app.box.com/hubs/123` 29 | the `hub_id` is `123`. 30 | :type id: str 31 | :param type: The value will always be `hubs`., defaults to HubBaseV2025R0TypeField.HUBS 32 | :type type: HubBaseV2025R0TypeField, optional 33 | """ 34 | super().__init__(**kwargs) 35 | self.id = id 36 | self.type = type 37 | -------------------------------------------------------------------------------- /docs/event-stream.md: -------------------------------------------------------------------------------- 1 | # Event Stream 2 | 3 | The Event Stream class utilizes long-polling to receive real-time events from Box. The SDK provides an easy way to set up and manage the event stream which returns an iterable object and yields events as they are received. 4 | 5 | 6 | 7 | 8 | - [Event Stream](#event-stream) 9 | - [Listening to the Event Stream](#listening-to-the-event-stream) 10 | - [Deduplication](#deduplication) 11 | 12 | 13 | 14 | ## Listening to the Event Stream 15 | 16 | When the `EventStream` is started, it will begin long-polling asynchronously. Events received from the API are then yielded to the caller. 17 | 18 | ```python 19 | event_stream = client.events.get_event_stream() 20 | for event in event_stream: 21 | print("Received event:", event) 22 | ``` 23 | 24 | ## Deduplication 25 | 26 | The `EventStream` class automatically deduplicates events based on their `event_id`. This means that if the same event is received multiple times, it will only be emitted once to the listeners. 27 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/web_link_base.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class WebLinkBaseTypeField(str, Enum): 11 | WEB_LINK = 'web_link' 12 | 13 | 14 | class WebLinkBase(BaseObject): 15 | _discriminator = 'type', {'web_link'} 16 | 17 | def __init__( 18 | self, 19 | id: str, 20 | *, 21 | type: WebLinkBaseTypeField = WebLinkBaseTypeField.WEB_LINK, 22 | etag: Optional[str] = None, 23 | **kwargs 24 | ): 25 | """ 26 | :param id: The unique identifier for this web link. 27 | :type id: str 28 | :param type: The value will always be `web_link`., defaults to WebLinkBaseTypeField.WEB_LINK 29 | :type type: WebLinkBaseTypeField, optional 30 | :param etag: The entity tag of this web link. Used with `If-Match` 31 | headers., defaults to None 32 | :type etag: Optional[str], optional 33 | """ 34 | super().__init__(**kwargs) 35 | self.id = id 36 | self.type = type 37 | self.etag = etag 38 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/ai_response.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.schemas.ai_agent_info import AiAgentInfo 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | from box_sdk_gen.internal.utils import DateTime 10 | 11 | 12 | class AiResponse(BaseObject): 13 | def __init__( 14 | self, 15 | answer: str, 16 | created_at: DateTime, 17 | *, 18 | completion_reason: Optional[str] = None, 19 | ai_agent_info: Optional[AiAgentInfo] = None, 20 | **kwargs 21 | ): 22 | """ 23 | :param answer: The answer provided by the LLM. 24 | :type answer: str 25 | :param created_at: The ISO date formatted timestamp of when the answer to the prompt was created. 26 | :type created_at: DateTime 27 | :param completion_reason: The reason the response finishes., defaults to None 28 | :type completion_reason: Optional[str], optional 29 | """ 30 | super().__init__(**kwargs) 31 | self.answer = answer 32 | self.created_at = created_at 33 | self.completion_reason = completion_reason 34 | self.ai_agent_info = ai_agent_info 35 | -------------------------------------------------------------------------------- /docs/shared_links_app_items.md: -------------------------------------------------------------------------------- 1 | # SharedLinksAppItemsManager 2 | 3 | - [Find app item for shared link](#find-app-item-for-shared-link) 4 | 5 | ## Find app item for shared link 6 | 7 | Returns the app item represented by a shared link. 8 | 9 | The link can originate from the current enterprise or another. 10 | 11 | This operation is performed by calling function `find_app_item_for_shared_link`. 12 | 13 | See the endpoint docs at 14 | [API Reference](https://developer.box.com/reference/get-shared-items--app-items/). 15 | 16 | 17 | 18 | ```python 19 | client.shared_links_app_items.find_app_item_for_shared_link( 20 | "".join(["shared_link=", app_item_shared_link]) 21 | ) 22 | ``` 23 | 24 | ### Arguments 25 | 26 | - boxapi `str` 27 | - A header containing the shared link and optional password for the shared link. The format for this header is `shared_link=[link]&shared_link_password=[password]`. 28 | - extra_headers `Optional[Dict[str, Optional[str]]]` 29 | - Extra headers that will be included in the HTTP request. 30 | 31 | ### Returns 32 | 33 | This function returns a value of type `AppItem`. 34 | 35 | Returns a full app item resource if the shared link is valid and 36 | the user has access to it. 37 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/hub_item_operation_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.schemas.v2025_r0.file_reference_v2025_r0 import FileReferenceV2025R0 6 | 7 | from box_sdk_gen.schemas.v2025_r0.folder_reference_v2025_r0 import ( 8 | FolderReferenceV2025R0, 9 | ) 10 | 11 | from box_sdk_gen.schemas.v2025_r0.weblink_reference_v2025_r0 import ( 12 | WeblinkReferenceV2025R0, 13 | ) 14 | 15 | from box_sdk_gen.schemas.v2025_r0.hub_item_reference_v2025_r0 import ( 16 | HubItemReferenceV2025R0, 17 | ) 18 | 19 | from box_sdk_gen.box.errors import BoxSDKError 20 | 21 | 22 | class HubItemOperationV2025R0ActionField(str, Enum): 23 | ADD = 'add' 24 | REMOVE = 'remove' 25 | 26 | 27 | class HubItemOperationV2025R0(BaseObject): 28 | def __init__( 29 | self, 30 | action: HubItemOperationV2025R0ActionField, 31 | item: HubItemReferenceV2025R0, 32 | **kwargs 33 | ): 34 | """ 35 | :param action: The action to perform on a Box Hub item. 36 | :type action: HubItemOperationV2025R0ActionField 37 | """ 38 | super().__init__(**kwargs) 39 | self.action = action 40 | self.item = item 41 | -------------------------------------------------------------------------------- /test/device_pinners.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from box_sdk_gen.client import BoxClient 4 | 5 | from box_sdk_gen.schemas.device_pinners import DevicePinners 6 | 7 | from box_sdk_gen.managers.device_pinners import GetEnterpriseDevicePinnersDirection 8 | 9 | from test.commons import get_default_client 10 | 11 | from box_sdk_gen.internal.utils import get_env_var 12 | 13 | client: BoxClient = get_default_client() 14 | 15 | 16 | def testDevicePinners(): 17 | enterprise_id: str = get_env_var('ENTERPRISE_ID') 18 | device_pinners: DevicePinners = client.device_pinners.get_enterprise_device_pinners( 19 | enterprise_id 20 | ) 21 | assert len(device_pinners.entries) >= 0 22 | device_pinners_in_desc_direction: DevicePinners = ( 23 | client.device_pinners.get_enterprise_device_pinners( 24 | enterprise_id, direction=GetEnterpriseDevicePinnersDirection.DESC 25 | ) 26 | ) 27 | assert len(device_pinners_in_desc_direction.entries) >= 0 28 | device_pinner_id: str = '123456' 29 | with pytest.raises(Exception): 30 | client.device_pinners.get_device_pinner_by_id(device_pinner_id) 31 | with pytest.raises(Exception): 32 | client.device_pinners.delete_device_pinner_by_id(device_pinner_id) 33 | -------------------------------------------------------------------------------- /docs/external_users.md: -------------------------------------------------------------------------------- 1 | # ExternalUsersManager 2 | 3 | - [Submit job to delete external users](#submit-job-to-delete-external-users) 4 | 5 | ## Submit job to delete external users 6 | 7 | Delete external users from current user enterprise. This will remove each 8 | external user from all invited collaborations within the current enterprise. 9 | 10 | This operation is performed by calling function `submit_job_to_delete_external_users_v2025_r0`. 11 | 12 | See the endpoint docs at 13 | [API Reference](https://developer.box.com/reference/v2025.0/post-external-users-submit-delete-job/). 14 | 15 | 16 | 17 | ```python 18 | client.external_users.submit_job_to_delete_external_users_v2025_r0( 19 | [UserReferenceV2025R0(id=get_env_var("BOX_EXTERNAL_USER_ID"))] 20 | ) 21 | ``` 22 | 23 | ### Arguments 24 | 25 | - external_users `List[UserReferenceV2025R0]` 26 | - List of external users to delete. 27 | - box_version `BoxVersionHeaderV2025R0` 28 | - Version header. 29 | - extra_headers `Optional[Dict[str, Optional[str]]]` 30 | - Extra headers that will be included in the HTTP request. 31 | 32 | ### Returns 33 | 34 | This function returns a value of type `ExternalUsersSubmitDeleteJobResponseV2025R0`. 35 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/ai_extract.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.ai_agent_reference import AiAgentReference 8 | 9 | from box_sdk_gen.schemas.ai_agent_extract import AiAgentExtract 10 | 11 | from box_sdk_gen.schemas.ai_item_base import AiItemBase 12 | 13 | from box_sdk_gen.schemas.ai_extract_agent import AiExtractAgent 14 | 15 | from box_sdk_gen.box.errors import BoxSDKError 16 | 17 | 18 | class AiExtract(BaseObject): 19 | def __init__( 20 | self, 21 | prompt: str, 22 | items: List[AiItemBase], 23 | *, 24 | ai_agent: Optional[AiExtractAgent] = None, 25 | **kwargs 26 | ): 27 | """ 28 | :param prompt: The prompt provided to a Large Language Model (LLM) in the request. The prompt can be up to 10000 characters long and it can be an XML or a JSON schema. 29 | :type prompt: str 30 | :param items: The items that LLM will process. Currently, you can use files only. 31 | :type items: List[AiItemBase] 32 | """ 33 | super().__init__(**kwargs) 34 | self.prompt = prompt 35 | self.items = items 36 | self.ai_agent = ai_agent 37 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/user_mini_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.schemas.v2025_r0.user_base_v2025_r0 import UserBaseV2025R0TypeField 4 | 5 | from box_sdk_gen.schemas.v2025_r0.user_base_v2025_r0 import UserBaseV2025R0 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class UserMiniV2025R0(UserBaseV2025R0): 11 | def __init__( 12 | self, 13 | id: str, 14 | *, 15 | name: Optional[str] = None, 16 | login: Optional[str] = None, 17 | type: UserBaseV2025R0TypeField = UserBaseV2025R0TypeField.USER, 18 | **kwargs 19 | ): 20 | """ 21 | :param id: The unique identifier for this user. 22 | :type id: str 23 | :param name: The display name of this user., defaults to None 24 | :type name: Optional[str], optional 25 | :param login: The primary email address of this user., defaults to None 26 | :type login: Optional[str], optional 27 | :param type: The value will always be `user`., defaults to UserBaseV2025R0TypeField.USER 28 | :type type: UserBaseV2025R0TypeField, optional 29 | """ 30 | super().__init__(id=id, type=type, **kwargs) 31 | self.name = name 32 | self.login = login 33 | -------------------------------------------------------------------------------- /box_sdk_gen/networking/fetch_response.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import Dict 4 | 5 | from box_sdk_gen.serialization.json import SerializedData 6 | 7 | from box_sdk_gen.internal.utils import ByteStream 8 | 9 | 10 | class FetchResponse: 11 | def __init__( 12 | self, 13 | status: int, 14 | headers: Dict[str, str], 15 | *, 16 | url: Optional[str] = None, 17 | data: Optional[SerializedData] = None, 18 | content: Optional[ByteStream] = None 19 | ): 20 | """ 21 | :param status: HTTP status code of the response 22 | :type status: int 23 | :param headers: HTTP headers of the response 24 | :type headers: Dict[str, str] 25 | :param url: URL of the response, defaults to None 26 | :type url: Optional[str], optional 27 | :param data: Response body of the response, defaults to None 28 | :type data: Optional[SerializedData], optional 29 | :param content: Streamed content of the response, defaults to None 30 | :type content: Optional[ByteStream], optional 31 | """ 32 | self.status = status 33 | self.headers = headers 34 | self.url = url 35 | self.data = data 36 | self.content = content 37 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/tracking_code.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class TrackingCodeTypeField(str, Enum): 11 | TRACKING_CODE = 'tracking_code' 12 | 13 | 14 | class TrackingCode(BaseObject): 15 | _discriminator = 'type', {'tracking_code'} 16 | 17 | def __init__( 18 | self, 19 | *, 20 | type: Optional[TrackingCodeTypeField] = None, 21 | name: Optional[str] = None, 22 | value: Optional[str] = None, 23 | **kwargs 24 | ): 25 | """ 26 | :param type: The value will always be `tracking_code`., defaults to None 27 | :type type: Optional[TrackingCodeTypeField], optional 28 | :param name: The name of the tracking code, which must be preconfigured in 29 | the Admin Console., defaults to None 30 | :type name: Optional[str], optional 31 | :param value: The value of the tracking code., defaults to None 32 | :type value: Optional[str], optional 33 | """ 34 | super().__init__(**kwargs) 35 | self.type = type 36 | self.name = name 37 | self.value = value 38 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/outcome.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.schemas.collaborator_variable import CollaboratorVariable 6 | 7 | from box_sdk_gen.schemas.completion_rule_variable import CompletionRuleVariable 8 | 9 | from box_sdk_gen.schemas.role_variable import RoleVariable 10 | 11 | from box_sdk_gen.box.errors import BoxSDKError 12 | 13 | 14 | class Outcome(BaseObject): 15 | def __init__( 16 | self, 17 | id: str, 18 | *, 19 | collaborators: Optional[CollaboratorVariable] = None, 20 | completion_rule: Optional[CompletionRuleVariable] = None, 21 | file_collaborator_role: Optional[RoleVariable] = None, 22 | task_collaborators: Optional[CollaboratorVariable] = None, 23 | role: Optional[RoleVariable] = None, 24 | **kwargs 25 | ): 26 | """ 27 | :param id: ID of a specific outcome. 28 | :type id: str 29 | """ 30 | super().__init__(**kwargs) 31 | self.id = id 32 | self.collaborators = collaborators 33 | self.completion_rule = completion_rule 34 | self.file_collaborator_role = file_collaborator_role 35 | self.task_collaborators = task_collaborators 36 | self.role = role 37 | -------------------------------------------------------------------------------- /box_sdk_gen/networking/auth.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from abc import abstractmethod 4 | 5 | from typing import List 6 | 7 | from box_sdk_gen.schemas.access_token import AccessToken 8 | 9 | from box_sdk_gen.networking.network import NetworkSession 10 | 11 | 12 | class Authentication: 13 | def __init__(self): 14 | pass 15 | 16 | @abstractmethod 17 | def retrieve_token( 18 | self, *, network_session: Optional[NetworkSession] = None 19 | ) -> AccessToken: 20 | pass 21 | 22 | @abstractmethod 23 | def refresh_token( 24 | self, *, network_session: Optional[NetworkSession] = None 25 | ) -> AccessToken: 26 | pass 27 | 28 | @abstractmethod 29 | def retrieve_authorization_header( 30 | self, *, network_session: Optional[NetworkSession] = None 31 | ) -> str: 32 | pass 33 | 34 | @abstractmethod 35 | def revoke_token(self, *, network_session: Optional[NetworkSession] = None) -> None: 36 | pass 37 | 38 | @abstractmethod 39 | def downscope_token( 40 | self, 41 | scopes: List[str], 42 | *, 43 | resource: Optional[str] = None, 44 | shared_link: Optional[str] = None, 45 | network_session: Optional[NetworkSession] = None 46 | ) -> AccessToken: 47 | pass 48 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/events.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import Union 4 | 5 | from typing import List 6 | 7 | from box_sdk_gen.internal.base_object import BaseObject 8 | 9 | from box_sdk_gen.schemas.event import Event 10 | 11 | from box_sdk_gen.box.errors import BoxSDKError 12 | 13 | 14 | class Events(BaseObject): 15 | def __init__( 16 | self, 17 | *, 18 | chunk_size: Optional[int] = None, 19 | next_stream_position: Optional[Union[str, int]] = None, 20 | entries: Optional[List[Event]] = None, 21 | **kwargs 22 | ): 23 | """ 24 | :param chunk_size: The number of events returned in this response., defaults to None 25 | :type chunk_size: Optional[int], optional 26 | :param next_stream_position: The stream position of the start of the next page (chunk) 27 | of events., defaults to None 28 | :type next_stream_position: Optional[Union[str, int]], optional 29 | :param entries: A list of events., defaults to None 30 | :type entries: Optional[List[Event]], optional 31 | """ 32 | super().__init__(**kwargs) 33 | self.chunk_size = chunk_size 34 | self.next_stream_position = next_stream_position 35 | self.entries = entries 36 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/ai_citation.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class AiCitationTypeField(str, Enum): 11 | FILE = 'file' 12 | 13 | 14 | class AiCitation(BaseObject): 15 | _discriminator = 'type', {'file'} 16 | 17 | def __init__( 18 | self, 19 | *, 20 | content: Optional[str] = None, 21 | id: Optional[str] = None, 22 | type: Optional[AiCitationTypeField] = None, 23 | name: Optional[str] = None, 24 | **kwargs 25 | ): 26 | """ 27 | :param content: The specific content from where the answer was referenced., defaults to None 28 | :type content: Optional[str], optional 29 | :param id: The id of the item., defaults to None 30 | :type id: Optional[str], optional 31 | :param type: The type of the item., defaults to None 32 | :type type: Optional[AiCitationTypeField], optional 33 | :param name: The name of the item., defaults to None 34 | :type name: Optional[str], optional 35 | """ 36 | super().__init__(**kwargs) 37 | self.content = content 38 | self.id = id 39 | self.type = type 40 | self.name = name 41 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/shield_information_barrier_segment_member_base.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class ShieldInformationBarrierSegmentMemberBaseTypeField(str, Enum): 11 | SHIELD_INFORMATION_BARRIER_SEGMENT_MEMBER = ( 12 | 'shield_information_barrier_segment_member' 13 | ) 14 | 15 | 16 | class ShieldInformationBarrierSegmentMemberBase(BaseObject): 17 | _discriminator = 'type', {'shield_information_barrier_segment_member'} 18 | 19 | def __init__( 20 | self, 21 | *, 22 | id: Optional[str] = None, 23 | type: Optional[ShieldInformationBarrierSegmentMemberBaseTypeField] = None, 24 | **kwargs 25 | ): 26 | """ 27 | :param id: The unique identifier for the 28 | shield information barrier segment member., defaults to None 29 | :type id: Optional[str], optional 30 | :param type: The type of the shield information barrier segment member., defaults to None 31 | :type type: Optional[ShieldInformationBarrierSegmentMemberBaseTypeField], optional 32 | """ 33 | super().__init__(**kwargs) 34 | self.id = id 35 | self.type = type 36 | -------------------------------------------------------------------------------- /test/invites.py: -------------------------------------------------------------------------------- 1 | from box_sdk_gen.internal.utils import to_string 2 | 3 | from box_sdk_gen.client import BoxClient 4 | 5 | from box_sdk_gen.schemas.user_full import UserFull 6 | 7 | from box_sdk_gen.schemas.invite import Invite 8 | 9 | from box_sdk_gen.managers.invites import CreateInviteEnterprise 10 | 11 | from box_sdk_gen.managers.invites import CreateInviteActionableBy 12 | 13 | from box_sdk_gen.internal.utils import get_uuid 14 | 15 | from box_sdk_gen.internal.utils import get_env_var 16 | 17 | from test.commons import get_default_client_with_user_subject 18 | 19 | 20 | def testInvites(): 21 | user_id: str = get_env_var('USER_ID') 22 | client: BoxClient = get_default_client_with_user_subject(user_id) 23 | current_user: UserFull = client.users.get_user_me(fields=['enterprise']) 24 | email: str = get_env_var('BOX_EXTERNAL_USER_EMAIL') 25 | invitation: Invite = client.invites.create_invite( 26 | CreateInviteEnterprise(id=current_user.enterprise.id), 27 | CreateInviteActionableBy(login=email), 28 | ) 29 | assert to_string(invitation.type) == 'invite' 30 | assert invitation.invited_to.id == current_user.enterprise.id 31 | assert invitation.actionable_by.login == email 32 | get_invitation: Invite = client.invites.get_invite_by_id(invitation.id) 33 | assert get_invitation.id == invitation.id 34 | -------------------------------------------------------------------------------- /test/sign_templates.py: -------------------------------------------------------------------------------- 1 | from box_sdk_gen.client import BoxClient 2 | 3 | from box_sdk_gen.schemas.sign_templates import SignTemplates 4 | 5 | from box_sdk_gen.schemas.sign_template import SignTemplate 6 | 7 | from box_sdk_gen.internal.utils import decode_base_64 8 | 9 | from box_sdk_gen.internal.utils import get_env_var 10 | 11 | from test.commons import get_default_client_with_user_subject 12 | 13 | 14 | def testGetSignTemplates(): 15 | client: BoxClient = get_default_client_with_user_subject(get_env_var('USER_ID')) 16 | sign_templates: SignTemplates = client.sign_templates.get_sign_templates(limit=2) 17 | assert len(sign_templates.entries) >= 0 18 | 19 | 20 | def testGetSignTemplate(): 21 | client: BoxClient = get_default_client_with_user_subject(get_env_var('USER_ID')) 22 | sign_templates: SignTemplates = client.sign_templates.get_sign_templates(limit=2) 23 | assert len(sign_templates.entries) >= 0 24 | if len(sign_templates.entries) > 0: 25 | sign_template: SignTemplate = client.sign_templates.get_sign_template_by_id( 26 | sign_templates.entries[0].id 27 | ) 28 | assert sign_template.id == sign_templates.entries[0].id 29 | assert len(sign_template.source_files) > 0 30 | assert not sign_template.name == '' 31 | assert not sign_template.parent_folder.id == '' 32 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/ai_agent_extract.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.ai_agent_long_text_tool import AiAgentLongTextTool 8 | 9 | from box_sdk_gen.schemas.ai_agent_basic_text_tool import AiAgentBasicTextTool 10 | 11 | from box_sdk_gen.box.errors import BoxSDKError 12 | 13 | 14 | class AiAgentExtractTypeField(str, Enum): 15 | AI_AGENT_EXTRACT = 'ai_agent_extract' 16 | 17 | 18 | class AiAgentExtract(BaseObject): 19 | _discriminator = 'type', {'ai_agent_extract'} 20 | 21 | def __init__( 22 | self, 23 | *, 24 | type: AiAgentExtractTypeField = AiAgentExtractTypeField.AI_AGENT_EXTRACT, 25 | long_text: Optional[AiAgentLongTextTool] = None, 26 | basic_text: Optional[AiAgentBasicTextTool] = None, 27 | basic_image: Optional[AiAgentBasicTextTool] = None, 28 | **kwargs 29 | ): 30 | """ 31 | :param type: The type of AI agent to be used for extraction., defaults to AiAgentExtractTypeField.AI_AGENT_EXTRACT 32 | :type type: AiAgentExtractTypeField, optional 33 | """ 34 | super().__init__(**kwargs) 35 | self.type = type 36 | self.long_text = long_text 37 | self.basic_text = basic_text 38 | self.basic_image = basic_image 39 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/folder_locks.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.folder_lock import FolderLock 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class FolderLocks(BaseObject): 13 | def __init__( 14 | self, 15 | *, 16 | entries: Optional[List[FolderLock]] = None, 17 | limit: Optional[str] = None, 18 | next_marker: Optional[str] = None, 19 | **kwargs 20 | ): 21 | """ 22 | :param entries: A list of folder locks., defaults to None 23 | :type entries: Optional[List[FolderLock]], optional 24 | :param limit: The limit that was used for these entries. This will be the same as the 25 | `limit` query parameter unless that value exceeded the maximum value 26 | allowed. The maximum value varies by API., defaults to None 27 | :type limit: Optional[str], optional 28 | :param next_marker: The marker for the start of the next page of results., defaults to None 29 | :type next_marker: Optional[str], optional 30 | """ 31 | super().__init__(**kwargs) 32 | self.entries = entries 33 | self.limit = limit 34 | self.next_marker = next_marker 35 | -------------------------------------------------------------------------------- /docs/enterprise_configurations.md: -------------------------------------------------------------------------------- 1 | # EnterpriseConfigurationsManager 2 | 3 | - [Get enterprise configuration](#get-enterprise-configuration) 4 | 5 | ## Get enterprise configuration 6 | 7 | Retrieves the configuration for an enterprise. 8 | 9 | This operation is performed by calling function `get_enterprise_configuration_by_id_v2025_r0`. 10 | 11 | See the endpoint docs at 12 | [API Reference](https://developer.box.com/reference/v2025.0/get-enterprise-configurations-id/). 13 | 14 | 15 | 16 | ```python 17 | admin_client.enterprise_configurations.get_enterprise_configuration_by_id_v2025_r0( 18 | enterprise_id, ["user_settings", "content_and_sharing", "security", "shield"] 19 | ) 20 | ``` 21 | 22 | ### Arguments 23 | 24 | - enterprise_id `str` 25 | - The ID of the enterprise. Example: "3442311" 26 | - categories `List[str]` 27 | - A comma-separated list of the enterprise configuration categories. Allowed values: `security`, `content_and_sharing`, `user_settings`, `shield`. 28 | - box_version `BoxVersionHeaderV2025R0` 29 | - Version header. 30 | - extra_headers `Optional[Dict[str, Optional[str]]]` 31 | - Extra headers that will be included in the HTTP request. 32 | 33 | ### Returns 34 | 35 | This function returns a value of type `EnterpriseConfigurationV2025R0`. 36 | 37 | Returns the enterprise configuration. 38 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/shield_information_barrier_segment_restriction_base.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class ShieldInformationBarrierSegmentRestrictionBaseTypeField(str, Enum): 11 | SHIELD_INFORMATION_BARRIER_SEGMENT_RESTRICTION = ( 12 | 'shield_information_barrier_segment_restriction' 13 | ) 14 | 15 | 16 | class ShieldInformationBarrierSegmentRestrictionBase(BaseObject): 17 | _discriminator = 'type', {'shield_information_barrier_segment_restriction'} 18 | 19 | def __init__( 20 | self, 21 | *, 22 | type: Optional[ShieldInformationBarrierSegmentRestrictionBaseTypeField] = None, 23 | id: Optional[str] = None, 24 | **kwargs 25 | ): 26 | """ 27 | :param type: Shield information barrier segment restriction., defaults to None 28 | :type type: Optional[ShieldInformationBarrierSegmentRestrictionBaseTypeField], optional 29 | :param id: The unique identifier for the 30 | shield information barrier segment restriction., defaults to None 31 | :type id: Optional[str], optional 32 | """ 33 | super().__init__(**kwargs) 34 | self.type = type 35 | self.id = id 36 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/ai_agent_reference.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class AiAgentReferenceTypeField(str, Enum): 11 | AI_AGENT_ID = 'ai_agent_id' 12 | 13 | 14 | class AiAgentReference(BaseObject): 15 | _discriminator = 'type', {'ai_agent_id'} 16 | 17 | def __init__( 18 | self, 19 | *, 20 | type: AiAgentReferenceTypeField = AiAgentReferenceTypeField.AI_AGENT_ID, 21 | id: Optional[str] = None, 22 | **kwargs 23 | ): 24 | """ 25 | :param type: The type of AI agent used to handle queries., defaults to AiAgentReferenceTypeField.AI_AGENT_ID 26 | :type type: AiAgentReferenceTypeField, optional 27 | :param id: The ID of an Agent. This can be a numeric ID for custom agents (for example, `14031`) 28 | or a unique identifier for pre-built agents (for example, `enhanced_extract_agent` 29 | for the [Enhanced Extract Agent](https://developer.box.com/guides/box-ai/ai-tutorials/extract-metadata-structured#enhanced-extract-agent))., defaults to None 30 | :type id: Optional[str], optional 31 | """ 32 | super().__init__(**kwargs) 33 | self.type = type 34 | self.id = id 35 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/device_pinner.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.user_mini import UserMini 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class DevicePinnerTypeField(str, Enum): 13 | DEVICE_PINNER = 'device_pinner' 14 | 15 | 16 | class DevicePinner(BaseObject): 17 | _discriminator = 'type', {'device_pinner'} 18 | 19 | def __init__( 20 | self, 21 | *, 22 | id: Optional[str] = None, 23 | type: Optional[DevicePinnerTypeField] = None, 24 | owned_by: Optional[UserMini] = None, 25 | product_name: Optional[str] = None, 26 | **kwargs 27 | ): 28 | """ 29 | :param id: The unique identifier for this device pin., defaults to None 30 | :type id: Optional[str], optional 31 | :param type: The value will always be `device_pinner`., defaults to None 32 | :type type: Optional[DevicePinnerTypeField], optional 33 | :param product_name: The type of device being pinned., defaults to None 34 | :type product_name: Optional[str], optional 35 | """ 36 | super().__init__(**kwargs) 37 | self.id = id 38 | self.type = type 39 | self.owned_by = owned_by 40 | self.product_name = product_name 41 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/sign_requests.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.sign_request import SignRequest 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class SignRequests(BaseObject): 13 | def __init__( 14 | self, 15 | *, 16 | limit: Optional[int] = None, 17 | next_marker: Optional[str] = None, 18 | entries: Optional[List[SignRequest]] = None, 19 | **kwargs 20 | ): 21 | """ 22 | :param limit: The limit that was used for these entries. This will be the same as the 23 | `limit` query parameter unless that value exceeded the maximum value 24 | allowed. The maximum value varies by API., defaults to None 25 | :type limit: Optional[int], optional 26 | :param next_marker: The marker for the start of the next page of results., defaults to None 27 | :type next_marker: Optional[str], optional 28 | :param entries: A list of Box Sign requests., defaults to None 29 | :type entries: Optional[List[SignRequest]], optional 30 | """ 31 | super().__init__(**kwargs) 32 | self.limit = limit 33 | self.next_marker = next_marker 34 | self.entries = entries 35 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/hubs_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.v2025_r0.hub_v2025_r0 import HubV2025R0 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class HubsV2025R0(BaseObject): 13 | def __init__( 14 | self, 15 | *, 16 | entries: Optional[List[HubV2025R0]] = None, 17 | limit: Optional[int] = None, 18 | next_marker: Optional[str] = None, 19 | **kwargs 20 | ): 21 | """ 22 | :param entries: A list of hubs., defaults to None 23 | :type entries: Optional[List[HubV2025R0]], optional 24 | :param limit: The limit that was used for these entries. This will be the same as the 25 | `limit` query parameter unless that value exceeded the maximum value 26 | allowed. The maximum value varies by API., defaults to None 27 | :type limit: Optional[int], optional 28 | :param next_marker: The marker for the start of the next page of results., defaults to None 29 | :type next_marker: Optional[str], optional 30 | """ 31 | super().__init__(**kwargs) 32 | self.entries = entries 33 | self.limit = limit 34 | self.next_marker = next_marker 35 | -------------------------------------------------------------------------------- /test/terms_of_services.py: -------------------------------------------------------------------------------- 1 | from box_sdk_gen.internal.utils import to_string 2 | 3 | from box_sdk_gen.client import BoxClient 4 | 5 | from box_sdk_gen.schemas.terms_of_service import TermsOfService 6 | 7 | from box_sdk_gen.managers.terms_of_services import UpdateTermsOfServiceByIdStatus 8 | 9 | from box_sdk_gen.schemas.terms_of_services import TermsOfServices 10 | 11 | from test.commons import get_default_client 12 | 13 | from test.commons import get_or_create_terms_of_services 14 | 15 | client: BoxClient = get_default_client() 16 | 17 | 18 | def testGetTermsOfServices(): 19 | tos: TermsOfService = get_or_create_terms_of_services() 20 | updated_tos_1: TermsOfService = ( 21 | client.terms_of_services.update_terms_of_service_by_id( 22 | tos.id, UpdateTermsOfServiceByIdStatus.DISABLED, 'TOS' 23 | ) 24 | ) 25 | assert to_string(updated_tos_1.status) == 'disabled' 26 | assert updated_tos_1.text == 'TOS' 27 | updated_tos_2: TermsOfService = ( 28 | client.terms_of_services.update_terms_of_service_by_id( 29 | tos.id, UpdateTermsOfServiceByIdStatus.DISABLED, 'Updated TOS' 30 | ) 31 | ) 32 | assert to_string(updated_tos_2.status) == 'disabled' 33 | assert updated_tos_2.text == 'Updated TOS' 34 | list_tos: TermsOfServices = client.terms_of_services.get_terms_of_service() 35 | assert list_tos.total_count > 0 36 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/group_mini.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.schemas.group_base import GroupBaseTypeField 6 | 7 | from box_sdk_gen.schemas.group_base import GroupBase 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class GroupMiniGroupTypeField(str, Enum): 13 | MANAGED_GROUP = 'managed_group' 14 | ALL_USERS_GROUP = 'all_users_group' 15 | 16 | 17 | class GroupMini(GroupBase): 18 | def __init__( 19 | self, 20 | id: str, 21 | *, 22 | name: Optional[str] = None, 23 | group_type: Optional[GroupMiniGroupTypeField] = None, 24 | type: GroupBaseTypeField = GroupBaseTypeField.GROUP, 25 | **kwargs 26 | ): 27 | """ 28 | :param id: The unique identifier for this object. 29 | :type id: str 30 | :param name: The name of the group., defaults to None 31 | :type name: Optional[str], optional 32 | :param group_type: The type of the group., defaults to None 33 | :type group_type: Optional[GroupMiniGroupTypeField], optional 34 | :param type: The value will always be `group`., defaults to GroupBaseTypeField.GROUP 35 | :type type: GroupBaseTypeField, optional 36 | """ 37 | super().__init__(id=id, type=type, **kwargs) 38 | self.name = name 39 | self.group_type = group_type 40 | -------------------------------------------------------------------------------- /test/groups.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from box_sdk_gen.client import BoxClient 4 | 5 | from box_sdk_gen.schemas.groups import Groups 6 | 7 | from box_sdk_gen.schemas.group_full import GroupFull 8 | 9 | from box_sdk_gen.internal.utils import get_uuid 10 | 11 | from test.commons import get_default_client 12 | 13 | client: BoxClient = get_default_client() 14 | 15 | 16 | def test_get_groups(): 17 | groups: Groups = client.groups.get_groups() 18 | assert groups.total_count >= 0 19 | 20 | 21 | def test_create_get_delete_group(): 22 | group_name: str = get_uuid() 23 | group_description: str = 'Group description' 24 | group: GroupFull = client.groups.create_group( 25 | group_name, description=group_description 26 | ) 27 | assert group.name == group_name 28 | group_by_id: GroupFull = client.groups.get_group_by_id( 29 | group.id, fields=['id', 'name', 'description', 'group_type'] 30 | ) 31 | assert group_by_id.id == group.id 32 | assert group_by_id.description == group_description 33 | updated_group_name: str = get_uuid() 34 | updated_group: GroupFull = client.groups.update_group_by_id( 35 | group.id, name=updated_group_name 36 | ) 37 | assert updated_group.name == updated_group_name 38 | client.groups.delete_group_by_id(group.id) 39 | with pytest.raises(Exception): 40 | client.groups.get_group_by_id(group.id) 41 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/integration_mapping_partner_item_teams_create_request.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class IntegrationMappingPartnerItemTeamsCreateRequestTypeField(str, Enum): 9 | CHANNEL = 'channel' 10 | TEAM = 'team' 11 | 12 | 13 | class IntegrationMappingPartnerItemTeamsCreateRequest(BaseObject): 14 | _discriminator = 'type', {'channel', 'team'} 15 | 16 | def __init__( 17 | self, 18 | type: IntegrationMappingPartnerItemTeamsCreateRequestTypeField, 19 | id: str, 20 | tenant_id: str, 21 | team_id: str, 22 | **kwargs 23 | ): 24 | """ 25 | :param type: Type of the mapped item referenced in `id`. 26 | :type type: IntegrationMappingPartnerItemTeamsCreateRequestTypeField 27 | :param id: ID of the mapped item (of type referenced in `type`). 28 | :type id: str 29 | :param tenant_id: ID of the tenant that is registered with Microsoft Teams. 30 | :type tenant_id: str 31 | :param team_id: ID of the team that is registered with Microsoft Teams. 32 | :type team_id: str 33 | """ 34 | super().__init__(**kwargs) 35 | self.type = type 36 | self.id = id 37 | self.tenant_id = tenant_id 38 | self.team_id = team_id 39 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/shield_information_barrier_segment_member_mini.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.schemas.shield_information_barrier_segment_member_base import ( 4 | ShieldInformationBarrierSegmentMemberBaseTypeField, 5 | ) 6 | 7 | from box_sdk_gen.schemas.shield_information_barrier_segment_member_base import ( 8 | ShieldInformationBarrierSegmentMemberBase, 9 | ) 10 | 11 | from box_sdk_gen.schemas.user_base import UserBase 12 | 13 | from box_sdk_gen.box.errors import BoxSDKError 14 | 15 | 16 | class ShieldInformationBarrierSegmentMemberMini( 17 | ShieldInformationBarrierSegmentMemberBase 18 | ): 19 | def __init__( 20 | self, 21 | *, 22 | user: Optional[UserBase] = None, 23 | id: Optional[str] = None, 24 | type: Optional[ShieldInformationBarrierSegmentMemberBaseTypeField] = None, 25 | **kwargs 26 | ): 27 | """ 28 | :param id: The unique identifier for the 29 | shield information barrier segment member., defaults to None 30 | :type id: Optional[str], optional 31 | :param type: The type of the shield information barrier segment member., defaults to None 32 | :type type: Optional[ShieldInformationBarrierSegmentMemberBaseTypeField], optional 33 | """ 34 | super().__init__(id=id, type=type, **kwargs) 35 | self.user = user 36 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/email_alias.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class EmailAliasTypeField(str, Enum): 11 | EMAIL_ALIAS = 'email_alias' 12 | 13 | 14 | class EmailAlias(BaseObject): 15 | _discriminator = 'type', {'email_alias'} 16 | 17 | def __init__( 18 | self, 19 | *, 20 | id: Optional[str] = None, 21 | type: Optional[EmailAliasTypeField] = None, 22 | email: Optional[str] = None, 23 | is_confirmed: Optional[bool] = None, 24 | **kwargs 25 | ): 26 | """ 27 | :param id: The unique identifier for this object., defaults to None 28 | :type id: Optional[str], optional 29 | :param type: The value will always be `email_alias`., defaults to None 30 | :type type: Optional[EmailAliasTypeField], optional 31 | :param email: The email address., defaults to None 32 | :type email: Optional[str], optional 33 | :param is_confirmed: Whether the email address has been confirmed., defaults to None 34 | :type is_confirmed: Optional[bool], optional 35 | """ 36 | super().__init__(**kwargs) 37 | self.id = id 38 | self.type = type 39 | self.email = email 40 | self.is_confirmed = is_confirmed 41 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/sign_request_prefill_tag.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | from box_sdk_gen.internal.utils import Date 8 | 9 | 10 | class SignRequestPrefillTag(BaseObject): 11 | def __init__( 12 | self, 13 | *, 14 | document_tag_id: Optional[str] = None, 15 | text_value: Optional[str] = None, 16 | checkbox_value: Optional[bool] = None, 17 | date_value: Optional[Date] = None, 18 | **kwargs 19 | ): 20 | """ 21 | :param document_tag_id: This references the ID of a specific tag contained in a file of the signature request., defaults to None 22 | :type document_tag_id: Optional[str], optional 23 | :param text_value: Text prefill value., defaults to None 24 | :type text_value: Optional[str], optional 25 | :param checkbox_value: Checkbox prefill value., defaults to None 26 | :type checkbox_value: Optional[bool], optional 27 | :param date_value: Date prefill value., defaults to None 28 | :type date_value: Optional[Date], optional 29 | """ 30 | super().__init__(**kwargs) 31 | self.document_tag_id = document_tag_id 32 | self.text_value = text_value 33 | self.checkbox_value = checkbox_value 34 | self.date_value = date_value 35 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/user_avatar.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.box.errors import BoxSDKError 6 | 7 | 8 | class UserAvatarPicUrlsField(BaseObject): 9 | def __init__( 10 | self, 11 | *, 12 | small: Optional[str] = None, 13 | large: Optional[str] = None, 14 | preview: Optional[str] = None, 15 | **kwargs 16 | ): 17 | """ 18 | :param small: The location of a small-sized avatar., defaults to None 19 | :type small: Optional[str], optional 20 | :param large: The location of a large-sized avatar., defaults to None 21 | :type large: Optional[str], optional 22 | :param preview: The location of the avatar preview., defaults to None 23 | :type preview: Optional[str], optional 24 | """ 25 | super().__init__(**kwargs) 26 | self.small = small 27 | self.large = large 28 | self.preview = preview 29 | 30 | 31 | class UserAvatar(BaseObject): 32 | def __init__(self, *, pic_urls: Optional[UserAvatarPicUrlsField] = None, **kwargs): 33 | """ 34 | :param pic_urls: Represents an object with user avatar URLs., defaults to None 35 | :type pic_urls: Optional[UserAvatarPicUrlsField], optional 36 | """ 37 | super().__init__(**kwargs) 38 | self.pic_urls = pic_urls 39 | -------------------------------------------------------------------------------- /test/users.py: -------------------------------------------------------------------------------- 1 | from box_sdk_gen.internal.utils import to_string 2 | 3 | from box_sdk_gen.client import BoxClient 4 | 5 | from box_sdk_gen.schemas.users import Users 6 | 7 | from box_sdk_gen.schemas.user_full import UserFull 8 | 9 | from box_sdk_gen.internal.utils import get_uuid 10 | 11 | from box_sdk_gen.internal.utils import create_null 12 | 13 | from test.commons import get_default_client 14 | 15 | client: BoxClient = get_default_client() 16 | 17 | 18 | def test_get_users(): 19 | users: Users = client.users.get_users() 20 | assert users.total_count >= 0 21 | 22 | 23 | def test_get_user_me(): 24 | current_user: UserFull = client.users.get_user_me() 25 | assert to_string(current_user.type) == 'user' 26 | 27 | 28 | def test_create_update_get_delete_user(): 29 | user_name: str = get_uuid() 30 | user_login: str = ''.join([get_uuid(), '@gmail.com']) 31 | user: UserFull = client.users.create_user( 32 | user_name, login=user_login, is_platform_access_only=True 33 | ) 34 | assert user.name == user_name 35 | user_by_id: UserFull = client.users.get_user_by_id(user.id) 36 | assert user_by_id.id == user.id 37 | updated_user_name: str = get_uuid() 38 | updated_user: UserFull = client.users.update_user_by_id( 39 | user.id, name=updated_user_name 40 | ) 41 | assert updated_user.name == updated_user_name 42 | client.users.delete_user_by_id(user.id) 43 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/hub_items_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.v2025_r0.hub_item_v2025_r0 import HubItemV2025R0 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class HubItemsV2025R0(BaseObject): 13 | def __init__( 14 | self, 15 | *, 16 | entries: Optional[List[HubItemV2025R0]] = None, 17 | limit: Optional[int] = None, 18 | next_marker: Optional[str] = None, 19 | **kwargs 20 | ): 21 | """ 22 | :param entries: A list of Box Hub items., defaults to None 23 | :type entries: Optional[List[HubItemV2025R0]], optional 24 | :param limit: The limit that was used for these entries. This will be the same as the 25 | `limit` query parameter unless that value exceeded the maximum value 26 | allowed. The maximum value varies by API., defaults to None 27 | :type limit: Optional[int], optional 28 | :param next_marker: The marker for the start of the next page of results., defaults to None 29 | :type next_marker: Optional[str], optional 30 | """ 31 | super().__init__(**kwargs) 32 | self.entries = entries 33 | self.limit = limit 34 | self.next_marker = next_marker 35 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/integration_mappings.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.integration_mapping import IntegrationMapping 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class IntegrationMappings(BaseObject): 13 | def __init__( 14 | self, 15 | *, 16 | limit: Optional[int] = None, 17 | next_marker: Optional[str] = None, 18 | entries: Optional[List[IntegrationMapping]] = None, 19 | **kwargs 20 | ): 21 | """ 22 | :param limit: The limit that was used for these entries. This will be the same as the 23 | `limit` query parameter unless that value exceeded the maximum value 24 | allowed. The maximum value varies by API., defaults to None 25 | :type limit: Optional[int], optional 26 | :param next_marker: The marker for the start of the next page of results., defaults to None 27 | :type next_marker: Optional[str], optional 28 | :param entries: A list of integration mappings., defaults to None 29 | :type entries: Optional[List[IntegrationMapping]], optional 30 | """ 31 | super().__init__(**kwargs) 32 | self.limit = limit 33 | self.next_marker = next_marker 34 | self.entries = entries 35 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/metadata_taxonomy_ancestor.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import Dict 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class MetadataTaxonomyAncestor(BaseObject): 11 | _fields_to_json_mapping: Dict[str, str] = { 12 | 'display_name': 'displayName', 13 | **BaseObject._fields_to_json_mapping, 14 | } 15 | _json_to_fields_mapping: Dict[str, str] = { 16 | 'displayName': 'display_name', 17 | **BaseObject._json_to_fields_mapping, 18 | } 19 | 20 | def __init__( 21 | self, 22 | *, 23 | id: Optional[str] = None, 24 | display_name: Optional[str] = None, 25 | level: Optional[int] = None, 26 | **kwargs 27 | ): 28 | """ 29 | :param id: A unique identifier of the metadata taxonomy node., defaults to None 30 | :type id: Optional[str], optional 31 | :param display_name: The display name of the metadata taxonomy node., defaults to None 32 | :type display_name: Optional[str], optional 33 | :param level: An index of the level to which the node belongs., defaults to None 34 | :type level: Optional[int], optional 35 | """ 36 | super().__init__(**kwargs) 37 | self.id = id 38 | self.display_name = display_name 39 | self.level = level 40 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/file_version_mini.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import Dict 4 | 5 | from box_sdk_gen.schemas.file_version_base import FileVersionBaseTypeField 6 | 7 | from box_sdk_gen.schemas.file_version_base import FileVersionBase 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class FileVersionMini(FileVersionBase): 13 | _fields_to_json_mapping: Dict[str, str] = { 14 | 'sha_1': 'sha1', 15 | **FileVersionBase._fields_to_json_mapping, 16 | } 17 | _json_to_fields_mapping: Dict[str, str] = { 18 | 'sha1': 'sha_1', 19 | **FileVersionBase._json_to_fields_mapping, 20 | } 21 | 22 | def __init__( 23 | self, 24 | id: str, 25 | *, 26 | sha_1: Optional[str] = None, 27 | type: FileVersionBaseTypeField = FileVersionBaseTypeField.FILE_VERSION, 28 | **kwargs 29 | ): 30 | """ 31 | :param id: The unique identifier that represent a file version. 32 | :type id: str 33 | :param sha_1: The SHA1 hash of this version of the file., defaults to None 34 | :type sha_1: Optional[str], optional 35 | :param type: The value will always be `file_version`., defaults to FileVersionBaseTypeField.FILE_VERSION 36 | :type type: FileVersionBaseTypeField, optional 37 | """ 38 | super().__init__(id=id, type=type, **kwargs) 39 | self.sha_1 = sha_1 40 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/hub_collaboration_user_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.schemas.v2025_r0.user_base_v2025_r0 import UserBaseV2025R0TypeField 4 | 5 | from box_sdk_gen.schemas.v2025_r0.user_base_v2025_r0 import UserBaseV2025R0 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class HubCollaborationUserV2025R0(UserBaseV2025R0): 11 | def __init__( 12 | self, 13 | id: str, 14 | *, 15 | name: Optional[str] = None, 16 | login: Optional[str] = None, 17 | type: UserBaseV2025R0TypeField = UserBaseV2025R0TypeField.USER, 18 | **kwargs 19 | ): 20 | """ 21 | :param id: The unique identifier for this user. 22 | :type id: str 23 | :param name: The display name of this user. If the collaboration status is `pending`, an empty string is returned., defaults to None 24 | :type name: Optional[str], optional 25 | :param login: The primary email address of this user. If the collaboration status is `pending`, an empty string is returned., defaults to None 26 | :type login: Optional[str], optional 27 | :param type: The value will always be `user`., defaults to UserBaseV2025R0TypeField.USER 28 | :type type: UserBaseV2025R0TypeField, optional 29 | """ 30 | super().__init__(id=id, type=type, **kwargs) 31 | self.name = name 32 | self.login = login 33 | -------------------------------------------------------------------------------- /test/folder_watermarks.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from box_sdk_gen.client import BoxClient 4 | 5 | from box_sdk_gen.schemas.folder_full import FolderFull 6 | 7 | from box_sdk_gen.managers.folders import CreateFolderParent 8 | 9 | from box_sdk_gen.schemas.watermark import Watermark 10 | 11 | from box_sdk_gen.managers.folder_watermarks import UpdateFolderWatermarkWatermark 12 | 13 | from box_sdk_gen.managers.folder_watermarks import ( 14 | UpdateFolderWatermarkWatermarkImprintField, 15 | ) 16 | 17 | from box_sdk_gen.internal.utils import get_uuid 18 | 19 | from test.commons import get_default_client 20 | 21 | client: BoxClient = get_default_client() 22 | 23 | 24 | def testCreateGetDeleteFolderWatermark(): 25 | folder_name: str = get_uuid() 26 | folder: FolderFull = client.folders.create_folder( 27 | folder_name, CreateFolderParent(id='0') 28 | ) 29 | created_watermark: Watermark = client.folder_watermarks.update_folder_watermark( 30 | folder.id, 31 | UpdateFolderWatermarkWatermark( 32 | imprint=UpdateFolderWatermarkWatermarkImprintField.DEFAULT 33 | ), 34 | ) 35 | watermark: Watermark = client.folder_watermarks.get_folder_watermark(folder.id) 36 | client.folder_watermarks.delete_folder_watermark(folder.id) 37 | with pytest.raises(Exception): 38 | client.folder_watermarks.get_folder_watermark(folder.id) 39 | client.folders.delete_folder_by_id(folder.id) 40 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/retention_policies.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.retention_policy import RetentionPolicy 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class RetentionPolicies(BaseObject): 13 | def __init__( 14 | self, 15 | *, 16 | entries: Optional[List[RetentionPolicy]] = None, 17 | limit: Optional[int] = None, 18 | next_marker: Optional[str] = None, 19 | **kwargs 20 | ): 21 | """ 22 | :param entries: A list in which each entry represents a retention policy object., defaults to None 23 | :type entries: Optional[List[RetentionPolicy]], optional 24 | :param limit: The limit that was used for these entries. This will be the same as the 25 | `limit` query parameter unless that value exceeded the maximum value 26 | allowed. The maximum value varies by API., defaults to None 27 | :type limit: Optional[int], optional 28 | :param next_marker: The marker for the start of the next page of results., defaults to None 29 | :type next_marker: Optional[str], optional 30 | """ 31 | super().__init__(**kwargs) 32 | self.entries = entries 33 | self.limit = limit 34 | self.next_marker = next_marker 35 | -------------------------------------------------------------------------------- /.github/workflows/autoupdate-pr.yml: -------------------------------------------------------------------------------- 1 | name: Autoupdate PR 2 | on: 3 | push: 4 | branches: 5 | - main 6 | - sdk-gen 7 | 8 | permissions: {} 9 | 10 | jobs: 11 | update_pull_requests: 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - name: Checkout repository 16 | uses: actions/checkout@v4 17 | with: 18 | token: ${{ secrets.DISPATCH_ACCESS_TOKEN }} 19 | 20 | - name: Set up Git 21 | run: | 22 | git config --global user.name 'box-sdk-build' 23 | git config --global user.email 'box-sdk-build@box.com' 24 | 25 | - name: Fetch all branches and tags 26 | run: git fetch --prune --unshallow 27 | 28 | - name: Auto update pull requests 29 | run: | 30 | PR_LIST=$(curl -s -H "Authorization: Bearer ${{ secrets.DISPATCH_ACCESS_TOKEN }}" "https://api.github.com/repos/$GITHUB_REPOSITORY/pulls?state=open&base=${{ github.ref_name }}" | jq -r '.[] | .head.ref') 31 | for pr_branch in $PR_LIST; do 32 | git checkout "$pr_branch" 33 | if git merge origin/${{ github.ref_name }}; then 34 | git push 35 | else 36 | # Conflict occurred, resolve by keeping our changes 37 | git checkout --ours . 38 | git add . 39 | git commit -m "Auto resolve conflict by keeping our changes" 40 | git push 41 | fi 42 | done 43 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/archives_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.v2025_r0.archive_v2025_r0 import ArchiveV2025R0 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class ArchivesV2025R0(BaseObject): 13 | def __init__( 14 | self, 15 | *, 16 | entries: Optional[List[ArchiveV2025R0]] = None, 17 | limit: Optional[int] = None, 18 | next_marker: Optional[str] = None, 19 | **kwargs 20 | ): 21 | """ 22 | :param entries: A list in which each entry represents an archive object., defaults to None 23 | :type entries: Optional[List[ArchiveV2025R0]], optional 24 | :param limit: The limit that was used for these entries. This will be the same as the 25 | `limit` query parameter unless that value exceeded the maximum value 26 | allowed. The maximum value varies by API., defaults to None 27 | :type limit: Optional[int], optional 28 | :param next_marker: The marker for the start of the next page of results., defaults to None 29 | :type next_marker: Optional[str], optional 30 | """ 31 | super().__init__(**kwargs) 32 | self.entries = entries 33 | self.limit = limit 34 | self.next_marker = next_marker 35 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/app_item_event_source.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.user_mini import UserMini 8 | 9 | from box_sdk_gen.schemas.group_mini import GroupMini 10 | 11 | from box_sdk_gen.box.errors import BoxSDKError 12 | 13 | 14 | class AppItemEventSourceTypeField(str, Enum): 15 | APP_ITEM = 'app_item' 16 | 17 | 18 | class AppItemEventSource(BaseObject): 19 | _discriminator = 'type', {'app_item'} 20 | 21 | def __init__( 22 | self, 23 | id: str, 24 | app_item_type: str, 25 | *, 26 | type: AppItemEventSourceTypeField = AppItemEventSourceTypeField.APP_ITEM, 27 | user: Optional[UserMini] = None, 28 | group: Optional[GroupMini] = None, 29 | **kwargs 30 | ): 31 | """ 32 | :param id: The id of the `AppItem`. 33 | :type id: str 34 | :param app_item_type: The type of the `AppItem`. 35 | :type app_item_type: str 36 | :param type: The type of the source that this event represents. Can only be `app_item`., defaults to AppItemEventSourceTypeField.APP_ITEM 37 | :type type: AppItemEventSourceTypeField, optional 38 | """ 39 | super().__init__(**kwargs) 40 | self.id = id 41 | self.app_item_type = app_item_type 42 | self.type = type 43 | self.user = user 44 | self.group = group 45 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/metadata_taxonomy_level.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import Dict 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class MetadataTaxonomyLevel(BaseObject): 11 | _fields_to_json_mapping: Dict[str, str] = { 12 | 'display_name': 'displayName', 13 | **BaseObject._fields_to_json_mapping, 14 | } 15 | _json_to_fields_mapping: Dict[str, str] = { 16 | 'displayName': 'display_name', 17 | **BaseObject._json_to_fields_mapping, 18 | } 19 | 20 | def __init__( 21 | self, 22 | *, 23 | display_name: Optional[str] = None, 24 | description: Optional[str] = None, 25 | level: Optional[int] = None, 26 | **kwargs 27 | ): 28 | """ 29 | :param display_name: The display name of the level as it is shown to the user., defaults to None 30 | :type display_name: Optional[str], optional 31 | :param description: A description of the level., defaults to None 32 | :type description: Optional[str], optional 33 | :param level: An index of the level within the taxonomy. Levels are indexed starting from 1., defaults to None 34 | :type level: Optional[int], optional 35 | """ 36 | super().__init__(**kwargs) 37 | self.display_name = display_name 38 | self.description = description 39 | self.level = level 40 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/retention_policy_assignments.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.retention_policy_assignment import RetentionPolicyAssignment 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class RetentionPolicyAssignments(BaseObject): 13 | def __init__( 14 | self, 15 | *, 16 | entries: Optional[List[RetentionPolicyAssignment]] = None, 17 | limit: Optional[int] = None, 18 | next_marker: Optional[str] = None, 19 | **kwargs 20 | ): 21 | """ 22 | :param entries: A list of retention policy assignments., defaults to None 23 | :type entries: Optional[List[RetentionPolicyAssignment]], optional 24 | :param limit: The limit that was used for these entries. This will be the same as the 25 | `limit` query parameter unless that value exceeded the maximum value 26 | allowed. The maximum value varies by API., defaults to None 27 | :type limit: Optional[int], optional 28 | :param next_marker: The marker for the start of the next page of results., defaults to None 29 | :type next_marker: Optional[str], optional 30 | """ 31 | super().__init__(**kwargs) 32 | self.entries = entries 33 | self.limit = limit 34 | self.next_marker = next_marker 35 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/shield_information_barriers.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.shield_information_barrier import ShieldInformationBarrier 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class ShieldInformationBarriers(BaseObject): 13 | def __init__( 14 | self, 15 | *, 16 | limit: Optional[int] = None, 17 | next_marker: Optional[str] = None, 18 | entries: Optional[List[ShieldInformationBarrier]] = None, 19 | **kwargs 20 | ): 21 | """ 22 | :param limit: The limit that was used for these entries. This will be the same as the 23 | `limit` query parameter unless that value exceeded the maximum value 24 | allowed. The maximum value varies by API., defaults to None 25 | :type limit: Optional[int], optional 26 | :param next_marker: The marker for the start of the next page of results., defaults to None 27 | :type next_marker: Optional[str], optional 28 | :param entries: A list of shield information barrier objects., defaults to None 29 | :type entries: Optional[List[ShieldInformationBarrier]], optional 30 | """ 31 | super().__init__(**kwargs) 32 | self.limit = limit 33 | self.next_marker = next_marker 34 | self.entries = entries 35 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/ai_agent_extract_structured.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.ai_agent_long_text_tool import AiAgentLongTextTool 8 | 9 | from box_sdk_gen.schemas.ai_agent_basic_text_tool import AiAgentBasicTextTool 10 | 11 | from box_sdk_gen.box.errors import BoxSDKError 12 | 13 | 14 | class AiAgentExtractStructuredTypeField(str, Enum): 15 | AI_AGENT_EXTRACT_STRUCTURED = 'ai_agent_extract_structured' 16 | 17 | 18 | class AiAgentExtractStructured(BaseObject): 19 | _discriminator = 'type', {'ai_agent_extract_structured'} 20 | 21 | def __init__( 22 | self, 23 | *, 24 | type: AiAgentExtractStructuredTypeField = AiAgentExtractStructuredTypeField.AI_AGENT_EXTRACT_STRUCTURED, 25 | long_text: Optional[AiAgentLongTextTool] = None, 26 | basic_text: Optional[AiAgentBasicTextTool] = None, 27 | basic_image: Optional[AiAgentBasicTextTool] = None, 28 | **kwargs 29 | ): 30 | """ 31 | :param type: The type of AI agent to be used for extraction., defaults to AiAgentExtractStructuredTypeField.AI_AGENT_EXTRACT_STRUCTURED 32 | :type type: AiAgentExtractStructuredTypeField, optional 33 | """ 34 | super().__init__(**kwargs) 35 | self.type = type 36 | self.long_text = long_text 37 | self.basic_text = basic_text 38 | self.basic_image = basic_image 39 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/hub_collaborations_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.v2025_r0.hub_collaboration_v2025_r0 import ( 8 | HubCollaborationV2025R0, 9 | ) 10 | 11 | from box_sdk_gen.box.errors import BoxSDKError 12 | 13 | 14 | class HubCollaborationsV2025R0(BaseObject): 15 | def __init__( 16 | self, 17 | *, 18 | entries: Optional[List[HubCollaborationV2025R0]] = None, 19 | limit: Optional[int] = None, 20 | next_marker: Optional[str] = None, 21 | **kwargs 22 | ): 23 | """ 24 | :param entries: A list of Box Hub collaborations., defaults to None 25 | :type entries: Optional[List[HubCollaborationV2025R0]], optional 26 | :param limit: The limit that was used for these entries. This will be the same as the 27 | `limit` query parameter unless that value exceeded the maximum value 28 | allowed. The maximum value varies by API., defaults to None 29 | :type limit: Optional[int], optional 30 | :param next_marker: The marker for the start of the next page of results., defaults to None 31 | :type next_marker: Optional[str], optional 32 | """ 33 | super().__init__(**kwargs) 34 | self.entries = entries 35 | self.limit = limit 36 | self.next_marker = next_marker 37 | -------------------------------------------------------------------------------- /test/email_aliases.py: -------------------------------------------------------------------------------- 1 | from box_sdk_gen.client import BoxClient 2 | 3 | from box_sdk_gen.schemas.user_full import UserFull 4 | 5 | from box_sdk_gen.schemas.email_aliases import EmailAliases 6 | 7 | from box_sdk_gen.schemas.email_alias import EmailAlias 8 | 9 | from box_sdk_gen.internal.utils import get_uuid 10 | 11 | from test.commons import get_default_client 12 | 13 | client: BoxClient = get_default_client() 14 | 15 | 16 | def testEmailAliases(): 17 | new_user_name: str = get_uuid() 18 | new_user_login: str = ''.join([get_uuid(), '@boxdemo.com']) 19 | new_user: UserFull = client.users.create_user(new_user_name, login=new_user_login) 20 | aliases: EmailAliases = client.email_aliases.get_user_email_aliases(new_user.id) 21 | assert aliases.total_count == 0 22 | new_alias_email: str = ''.join([new_user.id, '@boxdemo.com']) 23 | new_alias: EmailAlias = client.email_aliases.create_user_email_alias( 24 | new_user.id, new_alias_email 25 | ) 26 | updated_aliases: EmailAliases = client.email_aliases.get_user_email_aliases( 27 | new_user.id 28 | ) 29 | assert updated_aliases.total_count == 1 30 | assert updated_aliases.entries[0].email == new_alias_email 31 | client.email_aliases.delete_user_email_alias_by_id(new_user.id, new_alias.id) 32 | final_aliases: EmailAliases = client.email_aliases.get_user_email_aliases( 33 | new_user.id 34 | ) 35 | assert final_aliases.total_count == 0 36 | client.users.delete_user_by_id(new_user.id) 37 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/app_item_association.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from box_sdk_gen.schemas.file_base import FileBase 6 | 7 | from box_sdk_gen.schemas.folder_base import FolderBase 8 | 9 | from box_sdk_gen.schemas.web_link_base import WebLinkBase 10 | 11 | from box_sdk_gen.schemas.app_item import AppItem 12 | 13 | from box_sdk_gen.schemas.app_item_associated_item import AppItemAssociatedItem 14 | 15 | from box_sdk_gen.box.errors import BoxSDKError 16 | 17 | 18 | class AppItemAssociationTypeField(str, Enum): 19 | APP_ITEM_ASSOCIATION = 'app_item_association' 20 | 21 | 22 | class AppItemAssociation(BaseObject): 23 | _discriminator = 'type', {'app_item_association'} 24 | 25 | def __init__( 26 | self, 27 | id: str, 28 | app_item: AppItem, 29 | item: AppItemAssociatedItem, 30 | *, 31 | type: AppItemAssociationTypeField = AppItemAssociationTypeField.APP_ITEM_ASSOCIATION, 32 | **kwargs 33 | ): 34 | """ 35 | :param id: The unique identifier for this app item association. 36 | :type id: str 37 | :param type: The value will always be `app_item_association`., defaults to AppItemAssociationTypeField.APP_ITEM_ASSOCIATION 38 | :type type: AppItemAssociationTypeField, optional 39 | """ 40 | super().__init__(**kwargs) 41 | self.id = id 42 | self.app_item = app_item 43 | self.item = item 44 | self.type = type 45 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/group_mini_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from box_sdk_gen.schemas.v2025_r0.group_base_v2025_r0 import GroupBaseV2025R0TypeField 6 | 7 | from box_sdk_gen.schemas.v2025_r0.group_base_v2025_r0 import GroupBaseV2025R0 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class GroupMiniV2025R0GroupTypeField(str, Enum): 13 | MANAGED_GROUP = 'managed_group' 14 | ALL_USERS_GROUP = 'all_users_group' 15 | 16 | 17 | class GroupMiniV2025R0(GroupBaseV2025R0): 18 | def __init__( 19 | self, 20 | id: str, 21 | *, 22 | name: Optional[str] = None, 23 | group_type: Optional[GroupMiniV2025R0GroupTypeField] = None, 24 | type: GroupBaseV2025R0TypeField = GroupBaseV2025R0TypeField.GROUP, 25 | **kwargs 26 | ): 27 | """ 28 | :param id: The unique identifier for this object. 29 | :type id: str 30 | :param name: The name of the group., defaults to None 31 | :type name: Optional[str], optional 32 | :param group_type: The type of the group., defaults to None 33 | :type group_type: Optional[GroupMiniV2025R0GroupTypeField], optional 34 | :param type: The value will always be `group`., defaults to GroupBaseV2025R0TypeField.GROUP 35 | :type type: GroupBaseV2025R0TypeField, optional 36 | """ 37 | super().__init__(id=id, type=type, **kwargs) 38 | self.name = name 39 | self.group_type = group_type 40 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/app_item_associations.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.app_item_association import AppItemAssociation 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class AppItemAssociations(BaseObject): 13 | def __init__( 14 | self, 15 | *, 16 | limit: Optional[int] = None, 17 | next_marker: Optional[str] = None, 18 | prev_marker: Optional[str] = None, 19 | entries: Optional[List[AppItemAssociation]] = None, 20 | **kwargs 21 | ): 22 | """ 23 | :param limit: The limit that was used for these entries. This will be the same as the 24 | `limit` query parameter unless that value exceeded the maximum value 25 | allowed. The maximum value varies by API., defaults to None 26 | :type limit: Optional[int], optional 27 | :param next_marker: The marker for the start of the next page of results., defaults to None 28 | :type next_marker: Optional[str], optional 29 | :param prev_marker: The marker for the start of the previous page of results., defaults to None 30 | :type prev_marker: Optional[str], optional 31 | """ 32 | super().__init__(**kwargs) 33 | self.limit = limit 34 | self.next_marker = next_marker 35 | self.prev_marker = prev_marker 36 | self.entries = entries 37 | --------------------------------------------------------------------------------