├── test ├── __init__.py ├── trashed_items.py ├── recent_items.py ├── shared_links_app_items.py ├── storage_policies.py ├── file_version_legal_holds.py ├── transfer.py ├── archives.py ├── device_pinners.py ├── invites.py ├── sign_templates.py ├── terms_of_services.py ├── groups.py ├── users.py ├── folder_watermarks.py ├── email_aliases.py ├── trashed_folders.py └── session_termination.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 ├── schemas │ ├── generic_source.py │ ├── v2025_r0 │ │ ├── hub_action_v2025_r0.py │ │ ├── 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 │ │ ├── doc_gen_document_generation_data_v2025_r0.py │ │ ├── hub_collaboration_update_request_v2025_r0.py │ │ ├── hub_items_manage_response_v2025_r0.py │ │ ├── shield_lists_v2025_r0.py │ │ ├── hub_create_request_v2025_r0.py │ │ ├── hub_items_manage_request_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 │ │ ├── folder_reference_v2025_r0.py │ │ ├── weblink_reference_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 │ │ ├── shield_list_content_ip_v2025_r0.py │ │ ├── terms_of_service_base_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 │ │ ├── user_mini_v2025_r0.py │ │ ├── hubs_v2025_r0.py │ │ ├── hub_items_v2025_r0.py │ │ ├── hub_item_operation_v2025_r0.py │ │ ├── hub_collaboration_user_v2025_r0.py │ │ ├── archives_v2025_r0.py │ │ ├── hub_collaborations_v2025_r0.py │ │ ├── group_mini_v2025_r0.py │ │ ├── archive_v2025_r0.py │ │ ├── shield_lists_create_v2025_r0.py │ │ ├── shield_lists_update_v2025_r0.py │ │ └── hub_item_operation_result_v2025_r0.py │ ├── metadata_instance_value.py │ ├── ai_extract_response.py │ ├── ai_agent_allowed_entity.py │ ├── uploaded_part.py │ ├── session_termination_message.py │ ├── ai_llm_endpoint_params.py │ ├── shield_information_barrier_reference.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 │ ├── storage_policy_mini.py │ ├── enterprise_base.py │ ├── terms_of_service_base.py │ ├── legal_hold_policy_mini.py │ ├── retention_policy_base.py │ ├── terms_of_service_user_statuses.py │ ├── ai_agent_reference.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 │ ├── metadata_error.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 │ ├── retention_policy_assignment_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 │ ├── web_link_base.py │ ├── ai_response.py │ ├── ai_extract.py │ ├── ai_extract_structured_response.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 │ ├── 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 │ ├── file_version_mini.py │ ├── retention_policies.py │ ├── app_item_event_source.py │ ├── retention_policy_assignments.py │ ├── shield_information_barriers.py │ ├── ai_agent_extract_structured.py │ ├── app_item_association.py │ ├── search_result_with_shared_link.py │ ├── app_item_associations.py │ ├── shield_information_barrier_reports.py │ ├── file_or_folder_scope.py │ ├── shield_information_barrier_segments.py │ ├── post_o_auth_2_token_refresh_access_token.py │ ├── user_collaborations.py │ ├── web_link_mini.py │ ├── file_base.py │ ├── shield_information_barrier_segment_members.py │ ├── ai_agent_basic_text_tool_base.py │ ├── ai_agent_spreadsheet_tool.py │ ├── workflow_mini.py │ ├── workflows.py │ ├── ai_response_full.py │ ├── files_on_hold.py │ ├── folder_base.py │ └── upload_part.py ├── serialization │ └── __init__.py ├── internal │ ├── null_value.py │ ├── errors.py │ ├── __init__.py │ └── logging.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 └── recent_items.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__ = '1.17.0' 2 | -------------------------------------------------------------------------------- /box_sdk_gen/parameters/__init__.py: -------------------------------------------------------------------------------- 1 | from box_sdk_gen.parameters.v2025_r0 import * 2 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/generic_source.py: -------------------------------------------------------------------------------- 1 | from box_sdk_gen.box.errors import BoxSDKError 2 | -------------------------------------------------------------------------------- /box_sdk_gen/serialization/__init__.py: -------------------------------------------------------------------------------- 1 | from box_sdk_gen.serialization.json import * 2 | -------------------------------------------------------------------------------- /.codegen.json: -------------------------------------------------------------------------------- 1 | { "engineHash": "cc4f3ee", "specHash": "ae77fe0", "version": "1.17.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/v2025_r0/hub_action_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from box_sdk_gen.box.errors import BoxSDKError 4 | 5 | 6 | class HubActionV2025R0(str, Enum): 7 | ADD = 'add' 8 | REMOVE = 'remove' 9 | -------------------------------------------------------------------------------- /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/ai_extract_response.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 AiExtractResponse(BaseObject): 7 | def __init__(self, **kwargs): 8 | super().__init__(**kwargs) 9 | -------------------------------------------------------------------------------- /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/__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/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/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 | -------------------------------------------------------------------------------- /.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 | 10 | jobs: 11 | main: 12 | name: Validate semantic PR title 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: amannn/action-semantic-pull-request@v4 16 | env: 17 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 18 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.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 | jobs: 8 | spellcheck-request: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Checkout current repository 12 | uses: actions/checkout@v4 13 | - name: Checkout spellchecker 14 | uses: actions/checkout@v4 15 | with: 16 | ref: refs/heads/main 17 | repository: box/box-sdk-spellchecker 18 | token: ${{ secrets.DISPATCH_ACCESS_TOKEN }} 19 | path: spellchecker 20 | - name: Execute spellchecker 21 | uses: ./spellchecker 22 | env: 23 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 24 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.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-gen/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/t5/Platform-and-Development-Forum/bd-p/DeveloperForum 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-gen/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/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/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/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 | -------------------------------------------------------------------------------- /.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 | jobs: 14 | notify: 15 | # This job can run on the latest Ubuntu 16 | # and it should not take more than 3 minutes 17 | runs-on: ubuntu-latest 18 | timeout-minutes: 3 19 | 20 | steps: 21 | - name: Notify changelog of new release 22 | uses: peter-evans/repository-dispatch@v1 23 | with: 24 | token: ${{ secrets.DISPATCH_ACCESS_TOKEN }} 25 | repository: box/box-developer-changelog 26 | event-type: new-release-note 27 | client-payload: '{"ref": "${{ github.ref }}", "repository": "${{github.repository}}", "labels": "sdks,python", "repo_display_name": "Box Python SDK Generated"}' 28 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | WEBLINK = 'weblink' 10 | 11 | 12 | class WeblinkReferenceV2025R0(BaseObject): 13 | _discriminator = 'type', {'weblink'} 14 | 15 | def __init__( 16 | self, 17 | id: str, 18 | *, 19 | type: WeblinkReferenceV2025R0TypeField = WeblinkReferenceV2025R0TypeField.WEBLINK, 20 | **kwargs 21 | ): 22 | """ 23 | :param id: ID of the weblink. 24 | :type id: str 25 | :param type: The value will always be `weblink`., defaults to WeblinkReferenceV2025R0TypeField.WEBLINK 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/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/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/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/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., defaults to None 28 | :type id: Optional[str], optional 29 | """ 30 | super().__init__(**kwargs) 31 | self.type = type 32 | self.id = id 33 | -------------------------------------------------------------------------------- /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/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 ips 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/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/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/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/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/retention_policy_assignment_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 RetentionPolicyAssignmentBaseTypeField(str, Enum): 9 | RETENTION_POLICY_ASSIGNMENT = 'retention_policy_assignment' 10 | 11 | 12 | class RetentionPolicyAssignmentBase(BaseObject): 13 | _discriminator = 'type', {'retention_policy_assignment'} 14 | 15 | def __init__( 16 | self, 17 | id: str, 18 | *, 19 | type: RetentionPolicyAssignmentBaseTypeField = RetentionPolicyAssignmentBaseTypeField.RETENTION_POLICY_ASSIGNMENT, 20 | **kwargs 21 | ): 22 | """ 23 | :param id: The unique identifier that represents a file version. 24 | :type id: str 25 | :param type: The value will always be `retention_policy_assignment`., defaults to RetentionPolicyAssignmentBaseTypeField.RETENTION_POLICY_ASSIGNMENT 26 | :type type: RetentionPolicyAssignmentBaseTypeField, optional 27 | """ 28 | super().__init__(**kwargs) 29 | self.id = id 30 | self.type = type 31 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /test/archives.py: -------------------------------------------------------------------------------- 1 | from box_sdk_gen.internal.utils import to_string 2 | 3 | import pytest 4 | 5 | from box_sdk_gen.client import BoxClient 6 | 7 | from box_sdk_gen.schemas.v2025_r0.archive_v2025_r0 import ArchiveV2025R0 8 | 9 | from box_sdk_gen.schemas.v2025_r0.archives_v2025_r0 import ArchivesV2025R0 10 | 11 | from box_sdk_gen.internal.utils import get_uuid 12 | 13 | from box_sdk_gen.internal.utils import get_env_var 14 | 15 | from test.commons import get_default_client_with_user_subject 16 | 17 | user_id: str = get_env_var('USER_ID') 18 | 19 | client: BoxClient = get_default_client_with_user_subject(user_id) 20 | 21 | 22 | def testArchivesCreateListDelete(): 23 | archive_name: str = get_uuid() 24 | archive: ArchiveV2025R0 = client.archives.create_archive_v2025_r0(archive_name) 25 | assert to_string(archive.type) == 'archive' 26 | assert archive.name == archive_name 27 | archives: ArchivesV2025R0 = client.archives.get_archives_v2025_r0(limit=100) 28 | assert len(archives.entries) > 0 29 | client.archives.delete_archive_by_id_v2025_r0(archive.id) 30 | with pytest.raises(Exception): 31 | client.archives.delete_archive_by_id_v2025_r0(archive.id) 32 | -------------------------------------------------------------------------------- /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/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/ai_extract.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | from typing import Optional 4 | 5 | from typing import Union 6 | 7 | from box_sdk_gen.internal.base_object import BaseObject 8 | 9 | from box_sdk_gen.schemas.ai_item_base import AiItemBase 10 | 11 | from box_sdk_gen.schemas.ai_agent_reference import AiAgentReference 12 | 13 | from box_sdk_gen.schemas.ai_agent_extract import AiAgentExtract 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[Union[AiAgentReference, AiAgentExtract]] = 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/ai_extract_structured_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_extract_response import AiExtractResponse 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: AiExtractResponse, 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/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 | -------------------------------------------------------------------------------- /.github/workflows/autoupdate-pr.yml: -------------------------------------------------------------------------------- 1 | name: Autoupdate PR 2 | on: 3 | push: 4 | branches: 5 | - main 6 | 7 | jobs: 8 | update_pull_requests: 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - name: Checkout repository 13 | uses: actions/checkout@v4 14 | with: 15 | token: ${{ secrets.DISPATCH_ACCESS_TOKEN }} 16 | 17 | - name: Set up Git 18 | run: | 19 | git config --global user.name 'box-sdk-build' 20 | git config --global user.email 'box-sdk-build@box.com' 21 | 22 | - name: Fetch all branches and tags 23 | run: git fetch --prune --unshallow 24 | 25 | - name: Auto update pull requests 26 | run: | 27 | PR_LIST=$(curl -s -H "Authorization: Bearer ${{ secrets.DISPATCH_ACCESS_TOKEN }}" "https://api.github.com/repos/$GITHUB_REPOSITORY/pulls?state=open" | jq -r '.[] | .head.ref') 28 | for pr_branch in $PR_LIST; do 29 | git checkout "$pr_branch" 30 | if git merge origin/main; then 31 | git push 32 | else 33 | # Conflict occurred, resolve by keeping our changes 34 | git checkout --ours . 35 | git add . 36 | git commit -m "Auto resolve conflict by keeping our changes" 37 | git push 38 | fi 39 | done 40 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/v2025_r0/hub_item_operation_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Union 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.v2025_r0.file_reference_v2025_r0 import FileReferenceV2025R0 8 | 9 | from box_sdk_gen.schemas.v2025_r0.folder_reference_v2025_r0 import ( 10 | FolderReferenceV2025R0, 11 | ) 12 | 13 | from box_sdk_gen.schemas.v2025_r0.weblink_reference_v2025_r0 import ( 14 | WeblinkReferenceV2025R0, 15 | ) 16 | 17 | from box_sdk_gen.box.errors import BoxSDKError 18 | 19 | 20 | class HubItemOperationV2025R0ActionField(str, Enum): 21 | ADD = 'add' 22 | REMOVE = 'remove' 23 | 24 | 25 | class HubItemOperationV2025R0(BaseObject): 26 | def __init__( 27 | self, 28 | action: HubItemOperationV2025R0ActionField, 29 | item: Union[ 30 | FileReferenceV2025R0, FolderReferenceV2025R0, WeblinkReferenceV2025R0 31 | ], 32 | **kwargs 33 | ): 34 | """ 35 | :param action: The action to perform on a Box Hub item. 36 | :type action: HubItemOperationV2025R0ActionField 37 | :param item: Reference to an item that can be added to a Hub. 38 | :type item: Union[FileReferenceV2025R0, FolderReferenceV2025R0, WeblinkReferenceV2025R0] 39 | """ 40 | super().__init__(**kwargs) 41 | self.action = action 42 | self.item = item 43 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/app_item_association.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Union 4 | 5 | from box_sdk_gen.internal.base_object import BaseObject 6 | 7 | from box_sdk_gen.schemas.app_item import AppItem 8 | 9 | from box_sdk_gen.schemas.file_base import FileBase 10 | 11 | from box_sdk_gen.schemas.folder_base import FolderBase 12 | 13 | from box_sdk_gen.schemas.web_link_base import WebLinkBase 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: Union[FileBase, FolderBase, WebLinkBase], 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/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/search_result_with_shared_link.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import Union 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.schemas.folder_full import FolderFull 10 | 11 | from box_sdk_gen.schemas.web_link import WebLink 12 | 13 | from box_sdk_gen.box.errors import BoxSDKError 14 | 15 | 16 | class SearchResultWithSharedLink(BaseObject): 17 | def __init__( 18 | self, 19 | *, 20 | accessible_via_shared_link: Optional[str] = None, 21 | item: Optional[Union[FileFull, FolderFull, WebLink]] = None, 22 | type: Optional[str] = None, 23 | **kwargs 24 | ): 25 | """ 26 | :param accessible_via_shared_link: The optional shared link through which the user has access to this 27 | item. This value is only returned for items for which the user has 28 | recently accessed the file through a shared link. For all other 29 | items this value will return `null`., defaults to None 30 | :type accessible_via_shared_link: Optional[str], optional 31 | :param type: The result type. The value is always `search_result`., defaults to None 32 | :type type: Optional[str], optional 33 | """ 34 | super().__init__(**kwargs) 35 | self.accessible_via_shared_link = accessible_via_shared_link 36 | self.item = item 37 | self.type = type 38 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/archive_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 ArchiveV2025R0TypeField(str, Enum): 9 | ARCHIVE = 'archive' 10 | 11 | 12 | class ArchiveV2025R0(BaseObject): 13 | _discriminator = 'type', {'archive'} 14 | 15 | def __init__( 16 | self, 17 | id: str, 18 | name: str, 19 | size: int, 20 | *, 21 | type: ArchiveV2025R0TypeField = ArchiveV2025R0TypeField.ARCHIVE, 22 | **kwargs 23 | ): 24 | r""" 25 | :param id: The unique identifier that represents an archive. 26 | :type id: str 27 | :param name: The name of the archive. 28 | 29 | The following restrictions to the archive name apply: names containing 30 | non-printable ASCII characters, forward and backward slashes 31 | (`/`, `\`), names with trailing spaces, and names `.` and `..` are 32 | not allowed. 33 | :type name: str 34 | :param size: The size of the archive in bytes. 35 | :type size: int 36 | :param type: The value will always be `archive`., defaults to ArchiveV2025R0TypeField.ARCHIVE 37 | :type type: ArchiveV2025R0TypeField, optional 38 | """ 39 | super().__init__(**kwargs) 40 | self.id = id 41 | self.name = name 42 | self.size = size 43 | self.type = type 44 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/shield_information_barrier_reports.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_report import ( 8 | ShieldInformationBarrierReport, 9 | ) 10 | 11 | from box_sdk_gen.box.errors import BoxSDKError 12 | 13 | 14 | class ShieldInformationBarrierReports(BaseObject): 15 | def __init__( 16 | self, 17 | *, 18 | limit: Optional[int] = None, 19 | next_marker: Optional[str] = None, 20 | entries: Optional[List[ShieldInformationBarrierReport]] = None, 21 | **kwargs 22 | ): 23 | """ 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 | :param entries: A list of shield information 31 | barrier reports., defaults to None 32 | :type entries: Optional[List[ShieldInformationBarrierReport]], optional 33 | """ 34 | super().__init__(**kwargs) 35 | self.limit = limit 36 | self.next_marker = next_marker 37 | self.entries = entries 38 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/file_or_folder_scope.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | from typing import Optional 4 | 5 | from typing import Union 6 | 7 | from box_sdk_gen.internal.base_object import BaseObject 8 | 9 | from box_sdk_gen.schemas.folder_mini import FolderMini 10 | 11 | from box_sdk_gen.schemas.file_mini import FileMini 12 | 13 | from box_sdk_gen.box.errors import BoxSDKError 14 | 15 | 16 | class FileOrFolderScopeScopeField(str, Enum): 17 | ANNOTATION_EDIT = 'annotation_edit' 18 | ANNOTATION_VIEW_ALL = 'annotation_view_all' 19 | ANNOTATION_VIEW_SELF = 'annotation_view_self' 20 | BASE_EXPLORER = 'base_explorer' 21 | BASE_PICKER = 'base_picker' 22 | BASE_PREVIEW = 'base_preview' 23 | BASE_UPLOAD = 'base_upload' 24 | ITEM_DELETE = 'item_delete' 25 | ITEM_DOWNLOAD = 'item_download' 26 | ITEM_PREVIEW = 'item_preview' 27 | ITEM_RENAME = 'item_rename' 28 | ITEM_SHARE = 'item_share' 29 | ITEM_UPLOAD = 'item_upload' 30 | ITEM_READ = 'item_read' 31 | 32 | 33 | class FileOrFolderScope(BaseObject): 34 | def __init__( 35 | self, 36 | *, 37 | scope: Optional[FileOrFolderScopeScopeField] = None, 38 | object: Optional[Union[FolderMini, FileMini]] = None, 39 | **kwargs 40 | ): 41 | """ 42 | :param scope: The scopes for the resource access., defaults to None 43 | :type scope: Optional[FileOrFolderScopeScopeField], optional 44 | """ 45 | super().__init__(**kwargs) 46 | self.scope = scope 47 | self.object = object 48 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/shield_information_barrier_segments.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_segment import ( 8 | ShieldInformationBarrierSegment, 9 | ) 10 | 11 | from box_sdk_gen.box.errors import BoxSDKError 12 | 13 | 14 | class ShieldInformationBarrierSegments(BaseObject): 15 | def __init__( 16 | self, 17 | *, 18 | limit: Optional[int] = None, 19 | next_marker: Optional[str] = None, 20 | entries: Optional[List[ShieldInformationBarrierSegment]] = None, 21 | **kwargs 22 | ): 23 | """ 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 | :param entries: A list of shield information barrier 31 | segments., defaults to None 32 | :type entries: Optional[List[ShieldInformationBarrierSegment]], optional 33 | """ 34 | super().__init__(**kwargs) 35 | self.limit = limit 36 | self.next_marker = next_marker 37 | self.entries = entries 38 | -------------------------------------------------------------------------------- /test/trashed_folders.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.trash_folder import TrashFolder 10 | 11 | from box_sdk_gen.schemas.trash_folder_restored import TrashFolderRestored 12 | 13 | from box_sdk_gen.internal.utils import get_uuid 14 | 15 | from test.commons import get_default_client 16 | 17 | client: BoxClient = get_default_client() 18 | 19 | 20 | def testTrashedFolders(): 21 | folder: FolderFull = client.folders.create_folder( 22 | get_uuid(), CreateFolderParent(id='0') 23 | ) 24 | client.folders.delete_folder_by_id(folder.id) 25 | from_trash: TrashFolder = client.trashed_folders.get_trashed_folder_by_id(folder.id) 26 | assert from_trash.id == folder.id 27 | assert from_trash.name == folder.name 28 | with pytest.raises(Exception): 29 | client.folders.get_folder_by_id(folder.id) 30 | restored_folder: TrashFolderRestored = ( 31 | client.trashed_folders.restore_folder_from_trash(folder.id) 32 | ) 33 | from_api: FolderFull = client.folders.get_folder_by_id(folder.id) 34 | assert restored_folder.id == from_api.id 35 | assert restored_folder.name == from_api.name 36 | client.folders.delete_folder_by_id(folder.id) 37 | client.trashed_folders.delete_trashed_folder_by_id(folder.id) 38 | with pytest.raises(Exception): 39 | client.trashed_folders.get_trashed_folder_by_id(folder.id) 40 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/post_o_auth_2_token_refresh_access_token.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 PostOAuth2TokenRefreshAccessTokenGrantTypeField(str, Enum): 9 | REFRESH_TOKEN = 'refresh_token' 10 | 11 | 12 | class PostOAuth2TokenRefreshAccessToken(BaseObject): 13 | def __init__( 14 | self, 15 | client_id: str, 16 | client_secret: str, 17 | refresh_token: str, 18 | *, 19 | grant_type: PostOAuth2TokenRefreshAccessTokenGrantTypeField = PostOAuth2TokenRefreshAccessTokenGrantTypeField.REFRESH_TOKEN, 20 | **kwargs 21 | ): 22 | """ 23 | :param client_id: The client ID of the application requesting to refresh the token. 24 | :type client_id: str 25 | :param client_secret: The client secret of the application requesting to refresh the token. 26 | :type client_secret: str 27 | :param refresh_token: The refresh token to refresh. 28 | :type refresh_token: str 29 | :param grant_type: The type of request being made, in this case a refresh request., defaults to PostOAuth2TokenRefreshAccessTokenGrantTypeField.REFRESH_TOKEN 30 | :type grant_type: PostOAuth2TokenRefreshAccessTokenGrantTypeField, optional 31 | """ 32 | super().__init__(**kwargs) 33 | self.client_id = client_id 34 | self.client_secret = client_secret 35 | self.refresh_token = refresh_token 36 | self.grant_type = grant_type 37 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/user_collaborations.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 UserCollaborations(UserBase): 11 | def __init__( 12 | self, 13 | id: str, 14 | *, 15 | name: Optional[str] = None, 16 | login: Optional[str] = None, 17 | is_active: Optional[bool] = None, 18 | type: UserBaseTypeField = UserBaseTypeField.USER, 19 | **kwargs 20 | ): 21 | """ 22 | :param id: The unique identifier for this user. 23 | :type id: str 24 | :param name: The display name of this user. If the collaboration status is `pending`, an empty string is returned., defaults to None 25 | :type name: Optional[str], optional 26 | :param login: The primary email address of this user. If the collaboration status is `pending`, an empty string is returned., defaults to None 27 | :type login: Optional[str], optional 28 | :param is_active: If set to `false`, the user is either deactivated or deleted., defaults to None 29 | :type is_active: Optional[bool], optional 30 | :param type: The value will always be `user`., defaults to UserBaseTypeField.USER 31 | :type type: UserBaseTypeField, optional 32 | """ 33 | super().__init__(id=id, type=type, **kwargs) 34 | self.name = name 35 | self.login = login 36 | self.is_active = is_active 37 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/shield_lists_create_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from typing import List 6 | 7 | from box_sdk_gen.schemas.v2025_r0.shield_list_content_country_v2025_r0 import ( 8 | ShieldListContentCountryV2025R0, 9 | ) 10 | 11 | from box_sdk_gen.schemas.v2025_r0.shield_list_content_domain_v2025_r0 import ( 12 | ShieldListContentDomainV2025R0, 13 | ) 14 | 15 | from box_sdk_gen.schemas.v2025_r0.shield_list_content_email_v2025_r0 import ( 16 | ShieldListContentEmailV2025R0, 17 | ) 18 | 19 | from box_sdk_gen.schemas.v2025_r0.shield_list_content_ip_v2025_r0 import ( 20 | ShieldListContentIpV2025R0, 21 | ) 22 | 23 | from box_sdk_gen.schemas.v2025_r0.shield_list_content_request_v2025_r0 import ( 24 | ShieldListContentRequestV2025R0, 25 | ) 26 | 27 | from box_sdk_gen.box.errors import BoxSDKError 28 | 29 | 30 | class ShieldListsCreateV2025R0(BaseObject): 31 | def __init__( 32 | self, 33 | name: str, 34 | content: ShieldListContentRequestV2025R0, 35 | *, 36 | description: Optional[str] = None, 37 | **kwargs 38 | ): 39 | """ 40 | :param name: The name of the shield list. 41 | :type name: str 42 | :param description: Optional description of Shield List., defaults to None 43 | :type description: Optional[str], optional 44 | """ 45 | super().__init__(**kwargs) 46 | self.name = name 47 | self.content = content 48 | self.description = description 49 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/shield_lists_update_v2025_r0.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.internal.base_object import BaseObject 4 | 5 | from typing import List 6 | 7 | from box_sdk_gen.schemas.v2025_r0.shield_list_content_country_v2025_r0 import ( 8 | ShieldListContentCountryV2025R0, 9 | ) 10 | 11 | from box_sdk_gen.schemas.v2025_r0.shield_list_content_domain_v2025_r0 import ( 12 | ShieldListContentDomainV2025R0, 13 | ) 14 | 15 | from box_sdk_gen.schemas.v2025_r0.shield_list_content_email_v2025_r0 import ( 16 | ShieldListContentEmailV2025R0, 17 | ) 18 | 19 | from box_sdk_gen.schemas.v2025_r0.shield_list_content_ip_v2025_r0 import ( 20 | ShieldListContentIpV2025R0, 21 | ) 22 | 23 | from box_sdk_gen.schemas.v2025_r0.shield_list_content_request_v2025_r0 import ( 24 | ShieldListContentRequestV2025R0, 25 | ) 26 | 27 | from box_sdk_gen.box.errors import BoxSDKError 28 | 29 | 30 | class ShieldListsUpdateV2025R0(BaseObject): 31 | def __init__( 32 | self, 33 | name: str, 34 | content: ShieldListContentRequestV2025R0, 35 | *, 36 | description: Optional[str] = None, 37 | **kwargs 38 | ): 39 | """ 40 | :param name: The name of the shield list. 41 | :type name: str 42 | :param description: Optional description of Shield List., defaults to None 43 | :type description: Optional[str], optional 44 | """ 45 | super().__init__(**kwargs) 46 | self.name = name 47 | self.content = content 48 | self.description = description 49 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/web_link_mini.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from box_sdk_gen.schemas.web_link_base import WebLinkBaseTypeField 4 | 5 | from box_sdk_gen.schemas.web_link_base import WebLinkBase 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class WebLinkMini(WebLinkBase): 11 | def __init__( 12 | self, 13 | id: str, 14 | *, 15 | url: Optional[str] = None, 16 | sequence_id: Optional[str] = None, 17 | name: Optional[str] = None, 18 | type: WebLinkBaseTypeField = WebLinkBaseTypeField.WEB_LINK, 19 | etag: Optional[str] = None, 20 | **kwargs 21 | ): 22 | """ 23 | :param id: The unique identifier for this web link. 24 | :type id: str 25 | :param url: The URL this web link points to., defaults to None 26 | :type url: Optional[str], optional 27 | :param name: The name of the web link., defaults to None 28 | :type name: Optional[str], optional 29 | :param type: The value will always be `web_link`., defaults to WebLinkBaseTypeField.WEB_LINK 30 | :type type: WebLinkBaseTypeField, optional 31 | :param etag: The entity tag of this web link. Used with `If-Match` 32 | headers., defaults to None 33 | :type etag: Optional[str], optional 34 | """ 35 | super().__init__(id=id, type=type, etag=etag, **kwargs) 36 | self.url = url 37 | self.sequence_id = sequence_id 38 | self.name = name 39 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/file_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 FileBaseTypeField(str, Enum): 11 | FILE = 'file' 12 | 13 | 14 | class FileBase(BaseObject): 15 | _discriminator = 'type', {'file'} 16 | 17 | def __init__( 18 | self, 19 | id: str, 20 | *, 21 | etag: Optional[str] = None, 22 | type: FileBaseTypeField = FileBaseTypeField.FILE, 23 | **kwargs 24 | ): 25 | """ 26 | :param id: The unique identifier that represent a file. 27 | 28 | The ID for any file can be determined 29 | by visiting a file in the web application 30 | and copying the ID from the URL. For example, 31 | for the URL `https://*.app.box.com/files/123` 32 | the `file_id` is `123`. 33 | :type id: str 34 | :param etag: The HTTP `etag` of this file. This can be used within some API 35 | endpoints in the `If-Match` and `If-None-Match` headers to only 36 | perform changes on the file if (no) changes have happened., defaults to None 37 | :type etag: Optional[str], optional 38 | :param type: The value will always be `file`., defaults to FileBaseTypeField.FILE 39 | :type type: FileBaseTypeField, optional 40 | """ 41 | super().__init__(**kwargs) 42 | self.id = id 43 | self.etag = etag 44 | self.type = type 45 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/v2025_r0/hub_item_operation_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.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 HubItemOperationResultV2025R0(BaseObject): 23 | def __init__( 24 | self, 25 | *, 26 | action: Optional[str] = None, 27 | item: Optional[HubItemReferenceV2025R0] = None, 28 | status: Optional[int] = None, 29 | error: Optional[str] = None, 30 | **kwargs 31 | ): 32 | """ 33 | :param action: The action performed on the item., defaults to None 34 | :type action: Optional[str], optional 35 | :param status: The HTTP status code of the operation., defaults to None 36 | :type status: Optional[int], optional 37 | :param error: Error message if the operation failed., defaults to None 38 | :type error: Optional[str], optional 39 | """ 40 | super().__init__(**kwargs) 41 | self.action = action 42 | self.item = item 43 | self.status = status 44 | self.error = error 45 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/shield_information_barrier_segment_members.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_segment_member import ( 8 | ShieldInformationBarrierSegmentMember, 9 | ) 10 | 11 | from box_sdk_gen.box.errors import BoxSDKError 12 | 13 | 14 | class ShieldInformationBarrierSegmentMembers(BaseObject): 15 | def __init__( 16 | self, 17 | *, 18 | limit: Optional[int] = None, 19 | next_marker: Optional[str] = None, 20 | entries: Optional[List[ShieldInformationBarrierSegmentMember]] = None, 21 | **kwargs 22 | ): 23 | """ 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 | :param entries: A list of shield information 31 | barrier segment members., defaults to None 32 | :type entries: Optional[List[ShieldInformationBarrierSegmentMember]], optional 33 | """ 34 | super().__init__(**kwargs) 35 | self.limit = limit 36 | self.next_marker = next_marker 37 | self.entries = entries 38 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/ai_agent_basic_text_tool_base.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_llm_endpoint_params_open_ai import AiLlmEndpointParamsOpenAi 6 | 7 | from box_sdk_gen.schemas.ai_llm_endpoint_params_google import AiLlmEndpointParamsGoogle 8 | 9 | from box_sdk_gen.schemas.ai_llm_endpoint_params_aws import AiLlmEndpointParamsAws 10 | 11 | from box_sdk_gen.schemas.ai_llm_endpoint_params_ibm import AiLlmEndpointParamsIbm 12 | 13 | from box_sdk_gen.schemas.ai_llm_endpoint_params import AiLlmEndpointParams 14 | 15 | from box_sdk_gen.box.errors import BoxSDKError 16 | 17 | 18 | class AiAgentBasicTextToolBase(BaseObject): 19 | def __init__( 20 | self, 21 | *, 22 | model: Optional[str] = None, 23 | num_tokens_for_completion: Optional[int] = None, 24 | llm_endpoint_params: Optional[AiLlmEndpointParams] = None, 25 | **kwargs 26 | ): 27 | """ 28 | :param model: The model used for the AI agent for basic text. For specific model values, see the [available models list](g://box-ai/supported-models)., defaults to None 29 | :type model: Optional[str], optional 30 | :param num_tokens_for_completion: The number of tokens for completion., defaults to None 31 | :type num_tokens_for_completion: Optional[int], optional 32 | """ 33 | super().__init__(**kwargs) 34 | self.model = model 35 | self.num_tokens_for_completion = num_tokens_for_completion 36 | self.llm_endpoint_params = llm_endpoint_params 37 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/ai_agent_spreadsheet_tool.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_llm_endpoint_params_open_ai import AiLlmEndpointParamsOpenAi 6 | 7 | from box_sdk_gen.schemas.ai_llm_endpoint_params_google import AiLlmEndpointParamsGoogle 8 | 9 | from box_sdk_gen.schemas.ai_llm_endpoint_params_aws import AiLlmEndpointParamsAws 10 | 11 | from box_sdk_gen.schemas.ai_llm_endpoint_params_ibm import AiLlmEndpointParamsIbm 12 | 13 | from box_sdk_gen.schemas.ai_llm_endpoint_params import AiLlmEndpointParams 14 | 15 | from box_sdk_gen.box.errors import BoxSDKError 16 | 17 | 18 | class AiAgentSpreadsheetTool(BaseObject): 19 | def __init__( 20 | self, 21 | *, 22 | model: Optional[str] = None, 23 | num_tokens_for_completion: Optional[int] = None, 24 | llm_endpoint_params: Optional[AiLlmEndpointParams] = None, 25 | **kwargs 26 | ): 27 | """ 28 | :param model: The model used for the AI agent for spreadsheets. For specific model values, see the [available models list](g://box-ai/supported-models)., defaults to None 29 | :type model: Optional[str], optional 30 | :param num_tokens_for_completion: The number of tokens for completion., defaults to None 31 | :type num_tokens_for_completion: Optional[int], optional 32 | """ 33 | super().__init__(**kwargs) 34 | self.model = model 35 | self.num_tokens_for_completion = num_tokens_for_completion 36 | self.llm_endpoint_params = llm_endpoint_params 37 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/workflow_mini.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 WorkflowMiniTypeField(str, Enum): 11 | WORKFLOW = 'workflow' 12 | 13 | 14 | class WorkflowMini(BaseObject): 15 | _discriminator = 'type', {'workflow'} 16 | 17 | def __init__( 18 | self, 19 | *, 20 | id: Optional[str] = None, 21 | type: Optional[WorkflowMiniTypeField] = None, 22 | name: Optional[str] = None, 23 | description: Optional[str] = None, 24 | is_enabled: Optional[bool] = None, 25 | **kwargs 26 | ): 27 | """ 28 | :param id: The unique identifier for the workflow., defaults to None 29 | :type id: Optional[str], optional 30 | :param type: The value will always be `workflow`., defaults to None 31 | :type type: Optional[WorkflowMiniTypeField], optional 32 | :param name: The name of the workflow., defaults to None 33 | :type name: Optional[str], optional 34 | :param description: The description for a workflow., defaults to None 35 | :type description: Optional[str], optional 36 | :param is_enabled: Specifies if this workflow is enabled., defaults to None 37 | :type is_enabled: Optional[bool], optional 38 | """ 39 | super().__init__(**kwargs) 40 | self.id = id 41 | self.type = type 42 | self.name = name 43 | self.description = description 44 | self.is_enabled = is_enabled 45 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/workflows.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.workflow import Workflow 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class Workflows(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[Workflow]] = 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 | :param entries: A list of workflows., defaults to None 32 | :type entries: Optional[List[Workflow]], optional 33 | """ 34 | super().__init__(**kwargs) 35 | self.limit = limit 36 | self.next_marker = next_marker 37 | self.prev_marker = prev_marker 38 | self.entries = entries 39 | -------------------------------------------------------------------------------- /docs/recent_items.md: -------------------------------------------------------------------------------- 1 | # RecentItemsManager 2 | 3 | - [List recently accessed items](#list-recently-accessed-items) 4 | 5 | ## List recently accessed items 6 | 7 | Returns information about the recent items accessed 8 | by a user, either in the last 90 days or up to the last 9 | 1000 items accessed. 10 | 11 | This operation is performed by calling function `get_recent_items`. 12 | 13 | See the endpoint docs at 14 | [API Reference](https://developer.box.com/reference/get-recent-items/). 15 | 16 | 17 | 18 | ```python 19 | client.recent_items.get_recent_items() 20 | ``` 21 | 22 | ### Arguments 23 | 24 | - fields `Optional[List[str]]` 25 | - A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested. 26 | - limit `Optional[int]` 27 | - The maximum number of items to return per page. 28 | - marker `Optional[str]` 29 | - Defines the position marker at which to begin returning results. This is used when paginating using marker-based pagination. This requires `usemarker` to be set to `true`. 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 `RecentItems`. 36 | 37 | Returns a list recent items access by a user. 38 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/ai_response_full.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import List 4 | 5 | from box_sdk_gen.internal.utils import DateTime 6 | 7 | from box_sdk_gen.schemas.ai_agent_info import AiAgentInfo 8 | 9 | from box_sdk_gen.schemas.ai_response import AiResponse 10 | 11 | from box_sdk_gen.schemas.ai_citation import AiCitation 12 | 13 | from box_sdk_gen.box.errors import BoxSDKError 14 | 15 | 16 | class AiResponseFull(AiResponse): 17 | def __init__( 18 | self, 19 | answer: str, 20 | created_at: DateTime, 21 | *, 22 | citations: Optional[List[AiCitation]] = None, 23 | completion_reason: Optional[str] = None, 24 | ai_agent_info: Optional[AiAgentInfo] = None, 25 | **kwargs 26 | ): 27 | """ 28 | :param answer: The answer provided by the LLM. 29 | :type answer: str 30 | :param created_at: The ISO date formatted timestamp of when the answer to the prompt was created. 31 | :type created_at: DateTime 32 | :param citations: The citations of the LLM's answer reference., defaults to None 33 | :type citations: Optional[List[AiCitation]], optional 34 | :param completion_reason: The reason the response finishes., defaults to None 35 | :type completion_reason: Optional[str], optional 36 | """ 37 | super().__init__( 38 | answer=answer, 39 | created_at=created_at, 40 | completion_reason=completion_reason, 41 | ai_agent_info=ai_agent_info, 42 | **kwargs 43 | ) 44 | self.citations = citations 45 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/files_on_hold.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_mini import FileMini 8 | 9 | from box_sdk_gen.box.errors import BoxSDKError 10 | 11 | 12 | class FilesOnHold(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[FileMini]] = 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 | :param entries: A list of files., defaults to None 32 | :type entries: Optional[List[FileMini]], optional 33 | """ 34 | super().__init__(**kwargs) 35 | self.limit = limit 36 | self.next_marker = next_marker 37 | self.prev_marker = prev_marker 38 | self.entries = entries 39 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/folder_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 FolderBaseTypeField(str, Enum): 11 | FOLDER = 'folder' 12 | 13 | 14 | class FolderBase(BaseObject): 15 | _discriminator = 'type', {'folder'} 16 | 17 | def __init__( 18 | self, 19 | id: str, 20 | *, 21 | etag: Optional[str] = None, 22 | type: FolderBaseTypeField = FolderBaseTypeField.FOLDER, 23 | **kwargs 24 | ): 25 | """ 26 | :param id: The unique identifier that represent a folder. 27 | 28 | The ID for any folder can be determined 29 | by visiting a folder in the web application 30 | and copying the ID from the URL. For example, 31 | for the URL `https://*.app.box.com/folders/123` 32 | the `folder_id` is `123`. 33 | :type id: str 34 | :param etag: The HTTP `etag` of this folder. This can be used within some API 35 | endpoints in the `If-Match` and `If-None-Match` headers to only 36 | perform changes on the folder if (no) changes have happened., defaults to None 37 | :type etag: Optional[str], optional 38 | :param type: The value will always be `folder`., defaults to FolderBaseTypeField.FOLDER 39 | :type type: FolderBaseTypeField, optional 40 | """ 41 | super().__init__(**kwargs) 42 | self.id = id 43 | self.etag = etag 44 | self.type = type 45 | -------------------------------------------------------------------------------- /box_sdk_gen/schemas/upload_part.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from typing import Dict 4 | 5 | from box_sdk_gen.schemas.upload_part_mini import UploadPartMini 6 | 7 | from box_sdk_gen.box.errors import BoxSDKError 8 | 9 | 10 | class UploadPart(UploadPartMini): 11 | _fields_to_json_mapping: Dict[str, str] = { 12 | 'sha_1': 'sha1', 13 | **UploadPartMini._fields_to_json_mapping, 14 | } 15 | _json_to_fields_mapping: Dict[str, str] = { 16 | 'sha1': 'sha_1', 17 | **UploadPartMini._json_to_fields_mapping, 18 | } 19 | 20 | def __init__( 21 | self, 22 | *, 23 | sha_1: Optional[str] = None, 24 | part_id: Optional[str] = None, 25 | offset: Optional[int] = None, 26 | size: Optional[int] = None, 27 | **kwargs 28 | ): 29 | """ 30 | :param sha_1: The SHA1 hash of the chunk., defaults to None 31 | :type sha_1: Optional[str], optional 32 | :param part_id: The unique ID of the chunk., defaults to None 33 | :type part_id: Optional[str], optional 34 | :param offset: The offset of the chunk within the file 35 | in bytes. The lower bound of the position 36 | of the chunk within the file., defaults to None 37 | :type offset: Optional[int], optional 38 | :param size: The size of the chunk in bytes., defaults to None 39 | :type size: Optional[int], optional 40 | """ 41 | super().__init__(part_id=part_id, offset=offset, size=size, **kwargs) 42 | self.sha_1 = sha_1 43 | -------------------------------------------------------------------------------- /test/session_termination.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.session_termination_message import SessionTerminationMessage 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 box_sdk_gen.internal.utils import get_env_var 12 | 13 | from test.commons import get_default_client 14 | 15 | from test.commons import get_default_client_with_user_subject 16 | 17 | client: BoxClient = get_default_client() 18 | 19 | 20 | def testSessionTerminationUser(): 21 | admin_client: BoxClient = get_default_client_with_user_subject( 22 | get_env_var('USER_ID') 23 | ) 24 | user: UserFull = admin_client.users.get_user_me() 25 | result: SessionTerminationMessage = ( 26 | client.session_termination.terminate_users_sessions( 27 | [get_env_var('USER_ID')], [user.login] 28 | ) 29 | ) 30 | assert ( 31 | result.message 32 | == 'Request is successful, please check the admin events for the status of the job' 33 | ) 34 | 35 | 36 | def testSessionTerminationGroup(): 37 | group_name: str = get_uuid() 38 | group: GroupFull = client.groups.create_group(group_name) 39 | result: SessionTerminationMessage = ( 40 | client.session_termination.terminate_groups_sessions([group.id]) 41 | ) 42 | assert ( 43 | result.message 44 | == 'Request is successful, please check the admin events for the status of the job' 45 | ) 46 | client.groups.delete_group_by_id(group.id) 47 | --------------------------------------------------------------------------------