From d152cd2800f7f1f8c73d29d29ba51002e51199d0 Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Fri, 30 Oct 2026 04:13:41 -0700 Subject: [PATCH 1/5] test(SDK-6911): Write documentSplitTest (box/box-codegen#999) --- .codegen.json | 2 +- docs/box_sdk_gen/document_split.md | 18 +++++- test/box_sdk_gen/test/document_split.py | 80 +++++++++++++++++++++++++ 3 files changed, 96 insertions(+), 4 deletions(-) create mode 100644 test/box_sdk_gen/test/document_split.py diff --git a/.codegen.json b/.codegen.json index 49b1336d..951067ec 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "976bbb9", "specHash": "a0e8038", "version": "4.19.0" } +{ "engineHash": "88c0ae7", "specHash": "a0e8038", "version": "4.19.0" } diff --git a/docs/box_sdk_gen/document_split.md b/docs/box_sdk_gen/document_split.md index b3cbaf4a..d272230a 100644 --- a/docs/box_sdk_gen/document_split.md +++ b/docs/box_sdk_gen/document_split.md @@ -25,7 +25,11 @@ This operation is performed by calling function `create_document_split_v2026_r0` See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/post-document-splits/). -_Currently we don't have an example for calling `create_document_split_v2026_r0` in integration tests_ + + +```python +client.document_split.create_document_split_v2026_r0(file.id, folder.id, CreateDocumentSplitV2026R0InputSource.API, DocumentSplitCreateRequestManualV2026R0(split_type=DocumentSplitCreateRequestManualV2026R0SplitTypeField.MANUAL, split_definition=[DocumentSplitPageRangeV2026R0(start=1, end=1)]), external_id=external_id) +``` ### Arguments @@ -61,7 +65,11 @@ This operation is performed by calling function `get_document_splits_v2026_r0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-document-splits/). -_Currently we don't have an example for calling `get_document_splits_v2026_r0` in integration tests_ + + +```python +client.document_split.get_document_splits_v2026_r0(limit=10) +``` ### Arguments @@ -91,7 +99,11 @@ This operation is performed by calling function `get_document_split_by_id_v2026_ See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-document-splits-id/). -_Currently we don't have an example for calling `get_document_split_by_id_v2026_r0` in integration tests_ + + +```python +client.document_split.get_document_split_by_id_v2026_r0(created_document_split.id) +``` ### Arguments diff --git a/test/box_sdk_gen/test/document_split.py b/test/box_sdk_gen/test/document_split.py new file mode 100644 index 00000000..b6ede5c2 --- /dev/null +++ b/test/box_sdk_gen/test/document_split.py @@ -0,0 +1,80 @@ +from box_sdk_gen.internal.utils import to_string + +from box_sdk_gen.client import BoxClient + +from box_sdk_gen.schemas.file_full import FileFull + +from box_sdk_gen.schemas.folder_full import FolderFull + +from box_sdk_gen.schemas.v2026_r0.document_split_create_response_v2026_r0 import ( + DocumentSplitCreateResponseV2026R0, +) + +from box_sdk_gen.managers.document_split import CreateDocumentSplitV2026R0InputSource + +from box_sdk_gen.schemas.v2026_r0.document_split_create_request_manual_v2026_r0 import ( + DocumentSplitCreateRequestManualV2026R0SplitTypeField, +) + +from box_sdk_gen.schemas.v2026_r0.document_split_page_range_v2026_r0 import ( + DocumentSplitPageRangeV2026R0, +) + +from box_sdk_gen.schemas.v2026_r0.document_split_v2026_r0 import DocumentSplitV2026R0 + +from box_sdk_gen.schemas.v2026_r0.document_splits_v2026_r0 import DocumentSplitsV2026R0 + +from box_sdk_gen.internal.utils import get_uuid + +from test.box_sdk_gen.test.commons import get_default_client + +from test.box_sdk_gen.test.commons import upload_new_file + +from test.box_sdk_gen.test.commons import create_new_folder + +from box_sdk_gen.schemas.v2026_r0.document_split_create_request_manual_v2026_r0 import ( + DocumentSplitCreateRequestManualV2026R0, +) + +client: BoxClient = get_default_client() + + +def testCreateDocumentSplitV2026R0(): + file: FileFull = upload_new_file() + folder: FolderFull = create_new_folder() + external_id: str = get_uuid() + created_document_split: DocumentSplitCreateResponseV2026R0 = ( + client.document_split.create_document_split_v2026_r0( + file.id, + folder.id, + CreateDocumentSplitV2026R0InputSource.API, + DocumentSplitCreateRequestManualV2026R0( + split_type=DocumentSplitCreateRequestManualV2026R0SplitTypeField.MANUAL, + split_definition=[DocumentSplitPageRangeV2026R0(start=1, end=1)], + ), + external_id=external_id, + ) + ) + assert not created_document_split.id == '' + assert to_string(created_document_split.type) == 'document_split' + document_split: DocumentSplitV2026R0 = ( + client.document_split.get_document_split_by_id_v2026_r0( + created_document_split.id + ) + ) + assert document_split.id == created_document_split.id + assert to_string(document_split.type) == 'document_split' + assert document_split.source_file.id == file.id + assert document_split.destination_folder.id == folder.id + assert to_string(document_split.input_source) == 'api' + assert not to_string(document_split.status) == '' + assert document_split.external_id == external_id + client.folders.delete_folder_by_id(folder.id, recursive=True) + client.files.delete_file_by_id(file.id) + + +def testGetDocumentSplitsV2026R0(): + document_splits: DocumentSplitsV2026R0 = ( + client.document_split.get_document_splits_v2026_r0(limit=10) + ) + assert len(document_splits.entries) >= 0 From 9ebef3b551899d6e8dd07e8a8fa3e6d4f27f4fcd Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Wed, 4 Nov 2026 08:42:18 -0800 Subject: [PATCH 2/5] feat: Add metadata assignment target to the legal holds API (box/box-openapi#625) --- .codegen.json | 2 +- .../managers/legal_hold_policy_assignments.py | 18 ++++++++++++++++-- box_sdk_gen/schemas/__init__.py | 2 ++ box_sdk_gen/schemas/legal_hold_policy.py | 4 ++++ .../schemas/legal_hold_policy_assigned_item.py | 2 ++ .../schemas/legal_hold_policy_assignment.py | 10 ++++++++++ ...egal_hold_policy_assignment_filter_field.py | 16 ++++++++++++++++ .../legal_hold_policy_assignments.md | 4 +++- 8 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 box_sdk_gen/schemas/legal_hold_policy_assignment_filter_field.py diff --git a/.codegen.json b/.codegen.json index 951067ec..d2d66688 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "88c0ae7", "specHash": "a0e8038", "version": "4.19.0" } +{ "engineHash": "88c0ae7", "specHash": "74452eb", "version": "4.19.0" } diff --git a/box_sdk_gen/managers/legal_hold_policy_assignments.py b/box_sdk_gen/managers/legal_hold_policy_assignments.py index c6ab1145..dc6c0cb6 100644 --- a/box_sdk_gen/managers/legal_hold_policy_assignments.py +++ b/box_sdk_gen/managers/legal_hold_policy_assignments.py @@ -22,6 +22,10 @@ from box_sdk_gen.schemas.legal_hold_policy_assignment import LegalHoldPolicyAssignment +from box_sdk_gen.schemas.legal_hold_policy_assignment_filter_field import ( + LegalHoldPolicyAssignmentFilterField, +) + from box_sdk_gen.schemas.files_on_hold import FilesOnHold from box_sdk_gen.box.errors import BoxSDKError @@ -52,6 +56,7 @@ class GetLegalHoldPolicyAssignmentsAssignToType(str, Enum): USER = 'user' OWNERSHIP = 'ownership' INTERACTIONS = 'interactions' + METADATA_TEMPLATE = 'metadata_template' class CreateLegalHoldPolicyAssignmentAssignToTypeField(str, Enum): @@ -61,6 +66,7 @@ class CreateLegalHoldPolicyAssignmentAssignToTypeField(str, Enum): USER = 'user' OWNERSHIP = 'ownership' INTERACTIONS = 'interactions' + METADATA_TEMPLATE = 'metadata_template' class CreateLegalHoldPolicyAssignmentAssignTo(BaseObject): @@ -71,6 +77,7 @@ class CreateLegalHoldPolicyAssignmentAssignTo(BaseObject): 'user', 'ownership', 'interactions', + 'metadata_template', } def __init__( @@ -176,20 +183,27 @@ def create_legal_hold_policy_assignment( policy_id: str, assign_to: CreateLegalHoldPolicyAssignmentAssignTo, *, + filter_fields: Optional[List[LegalHoldPolicyAssignmentFilterField]] = None, extra_headers: Optional[Dict[str, Optional[str]]] = None ) -> LegalHoldPolicyAssignment: """ - Assign a legal hold to an item type of: file, file version, folder, user, ownership, or interactions. + Assign a legal hold to an item type of: file, file version, folder, user, ownership, interactions, or metadata template. :param policy_id: The ID of the policy to assign. :type policy_id: str :param assign_to: The item to assign the policy to. :type assign_to: CreateLegalHoldPolicyAssignmentAssignTo + :param filter_fields: List of metadata template field filters. Only required when `assign_to.type` is `metadata_template`., defaults to None + :type filter_fields: Optional[List[LegalHoldPolicyAssignmentFilterField]], optional :param extra_headers: Extra headers that will be included in the HTTP request., defaults to None :type extra_headers: Optional[Dict[str, Optional[str]]], optional """ if extra_headers is None: extra_headers = {} - request_body: Dict = {'policy_id': policy_id, 'assign_to': assign_to} + request_body: Dict = { + 'policy_id': policy_id, + 'assign_to': assign_to, + 'filter_fields': filter_fields, + } headers_map: Dict[str, str] = prepare_params({**extra_headers}) response: FetchResponse = self.network_session.network_client.fetch( FetchOptions( diff --git a/box_sdk_gen/schemas/__init__.py b/box_sdk_gen/schemas/__init__.py index 3763f1d5..2b6681b4 100644 --- a/box_sdk_gen/schemas/__init__.py +++ b/box_sdk_gen/schemas/__init__.py @@ -204,6 +204,8 @@ from box_sdk_gen.schemas.legal_hold_policy_assignment_base import * +from box_sdk_gen.schemas.legal_hold_policy_assignment_filter_field import * + from box_sdk_gen.schemas.metadata_base import * from box_sdk_gen.schemas.metadata import * diff --git a/box_sdk_gen/schemas/legal_hold_policy.py b/box_sdk_gen/schemas/legal_hold_policy.py index 84763fb3..ca51bbe1 100644 --- a/box_sdk_gen/schemas/legal_hold_policy.py +++ b/box_sdk_gen/schemas/legal_hold_policy.py @@ -32,6 +32,7 @@ def __init__( file_version: Optional[int] = None, ownership: Optional[int] = None, interactions: Optional[int] = None, + metadata_template: Optional[int] = None, **kwargs ): """ @@ -47,6 +48,8 @@ def __init__( :type ownership: Optional[int], optional :param interactions: The number of users this policy is applied to with the `interactions` type assignment., defaults to None :type interactions: Optional[int], optional + :param metadata_template: The number of metadata templates this policy is applied to., defaults to None + :type metadata_template: Optional[int], optional """ super().__init__(**kwargs) self.user = user @@ -55,6 +58,7 @@ def __init__( self.file_version = file_version self.ownership = ownership self.interactions = interactions + self.metadata_template = metadata_template class LegalHoldPolicy(LegalHoldPolicyMini): diff --git a/box_sdk_gen/schemas/legal_hold_policy_assigned_item.py b/box_sdk_gen/schemas/legal_hold_policy_assigned_item.py index 77479f9a..f76d1bb1 100644 --- a/box_sdk_gen/schemas/legal_hold_policy_assigned_item.py +++ b/box_sdk_gen/schemas/legal_hold_policy_assigned_item.py @@ -12,6 +12,7 @@ class LegalHoldPolicyAssignedItemTypeField(str, Enum): USER = 'user' OWNERSHIP = 'ownership' INTERACTIONS = 'interactions' + METADATA_TEMPLATE = 'metadata_template' class LegalHoldPolicyAssignedItem(BaseObject): @@ -22,6 +23,7 @@ class LegalHoldPolicyAssignedItem(BaseObject): 'user', 'ownership', 'interactions', + 'metadata_template', } def __init__(self, type: LegalHoldPolicyAssignedItemTypeField, id: str, **kwargs): diff --git a/box_sdk_gen/schemas/legal_hold_policy_assignment.py b/box_sdk_gen/schemas/legal_hold_policy_assignment.py index b8221d9c..f944afe5 100644 --- a/box_sdk_gen/schemas/legal_hold_policy_assignment.py +++ b/box_sdk_gen/schemas/legal_hold_policy_assignment.py @@ -1,5 +1,7 @@ from typing import Optional +from typing import List + from box_sdk_gen.schemas.legal_hold_policy_assignment_base import ( LegalHoldPolicyAssignmentBaseTypeField, ) @@ -16,6 +18,10 @@ from box_sdk_gen.schemas.user_mini import UserMini +from box_sdk_gen.schemas.legal_hold_policy_assignment_filter_field import ( + LegalHoldPolicyAssignmentFilterField, +) + from box_sdk_gen.box.errors import BoxSDKError from box_sdk_gen.internal.utils import DateTime @@ -32,6 +38,7 @@ def __init__( assigned_by: Optional[UserMini] = None, assigned_at: Optional[DateTime] = None, deleted_at: Optional[DateTime] = None, + filter_fields: Optional[List[LegalHoldPolicyAssignmentFilterField]] = None, id: Optional[str] = None, type: Optional[LegalHoldPolicyAssignmentBaseTypeField] = None, **kwargs @@ -46,6 +53,8 @@ def __init__( assignment is fully deleted). If null, Assignment was not deleted., defaults to None :type deleted_at: Optional[DateTime], optional + :param filter_fields: List of metadata template field filters. Only present when `assigned_to.type` is `metadata_template`., defaults to None + :type filter_fields: Optional[List[LegalHoldPolicyAssignmentFilterField]], optional :param id: The unique identifier for this legal hold assignment., defaults to None :type id: Optional[str], optional :param type: The value will always be `legal_hold_policy_assignment`., defaults to None @@ -57,3 +66,4 @@ def __init__( self.assigned_by = assigned_by self.assigned_at = assigned_at self.deleted_at = deleted_at + self.filter_fields = filter_fields diff --git a/box_sdk_gen/schemas/legal_hold_policy_assignment_filter_field.py b/box_sdk_gen/schemas/legal_hold_policy_assignment_filter_field.py new file mode 100644 index 00000000..f9376779 --- /dev/null +++ b/box_sdk_gen/schemas/legal_hold_policy_assignment_filter_field.py @@ -0,0 +1,16 @@ +from box_sdk_gen.internal.base_object import BaseObject + +from box_sdk_gen.box.errors import BoxSDKError + + +class LegalHoldPolicyAssignmentFilterField(BaseObject): + def __init__(self, field: str, value: str, **kwargs): + """ + :param field: The ID of the metadata template field to filter on. + :type field: str + :param value: The value of the metadata template field to filter on. + :type value: str + """ + super().__init__(**kwargs) + self.field = field + self.value = value diff --git a/docs/box_sdk_gen/legal_hold_policy_assignments.md b/docs/box_sdk_gen/legal_hold_policy_assignments.md index 54ea02fb..f268b5da 100644 --- a/docs/box_sdk_gen/legal_hold_policy_assignments.md +++ b/docs/box_sdk_gen/legal_hold_policy_assignments.md @@ -46,7 +46,7 @@ Returns a list of legal hold policy assignments. ## Assign legal hold policy -Assign a legal hold to an item type of: file, file version, folder, user, ownership, or interactions. +Assign a legal hold to an item type of: file, file version, folder, user, ownership, interactions, or metadata template. This operation is performed by calling function `create_legal_hold_policy_assignment`. @@ -65,6 +65,8 @@ client.legal_hold_policy_assignments.create_legal_hold_policy_assignment(legal_h - The ID of the policy to assign. - assign_to `CreateLegalHoldPolicyAssignmentAssignTo` - The item to assign the policy to. +- filter_fields `Optional[List[LegalHoldPolicyAssignmentFilterField]]` + - List of metadata template field filters. Only required when `assign_to.type` is `metadata_template`. - extra_headers `Optional[Dict[str, Optional[str]]]` - Extra headers that will be included in the HTTP request. From 520353cec97682b8d698b7ae89afe1c0540be7cc Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Thu, 5 Nov 2026 02:42:39 -0800 Subject: [PATCH 3/5] test(SDK-6912) Write Shuttle ITest (box/box-codegen#1000) --- .codegen.json | 2 +- docs/box_sdk_gen/shuttle.md | 234 +++++++++++++++++++++++++------ test/box_sdk_gen/test/shuttle.py | 225 +++++++++++++++++++++++++++++ 3 files changed, 421 insertions(+), 40 deletions(-) create mode 100644 test/box_sdk_gen/test/shuttle.py diff --git a/.codegen.json b/.codegen.json index d2d66688..0e73d046 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "88c0ae7", "specHash": "74452eb", "version": "4.19.0" } +{ "engineHash": "2dcb7e8", "specHash": "74452eb", "version": "4.19.0" } diff --git a/docs/box_sdk_gen/shuttle.md b/docs/box_sdk_gen/shuttle.md index e831c06a..4c4f1c15 100644 --- a/docs/box_sdk_gen/shuttle.md +++ b/docs/box_sdk_gen/shuttle.md @@ -50,7 +50,11 @@ This operation is performed by calling function `get_shuttle_systems_v2026_r0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-systems/). -_Currently we don't have an example for calling `get_shuttle_systems_v2026_r0` in integration tests_ + + +```python +client.shuttle.get_shuttle_systems_v2026_r0() +``` ### Arguments @@ -80,7 +84,11 @@ This operation is performed by calling function `create_shuttle_system_v2026_r0` See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-systems/). -_Currently we don't have an example for calling `create_shuttle_system_v2026_r0` in integration tests_ + + +```python +client.shuttle.create_shuttle_system_v2026_r0(system_name, system_type=CreateShuttleSystemV2026R0SystemType.WINDOWS) +``` ### Arguments @@ -109,7 +117,11 @@ This operation is performed by calling function `get_shuttle_system_by_id_v2026_ See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-systems-id/). -_Currently we don't have an example for calling `get_shuttle_system_by_id_v2026_r0` in integration tests_ + + +```python +client.shuttle.get_shuttle_system_by_id_v2026_r0(created_system.id) +``` ### Arguments @@ -136,7 +148,11 @@ This operation is performed by calling function `update_shuttle_system_by_id_v20 See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/put-shuttle-systems-id/). -_Currently we don't have an example for calling `update_shuttle_system_by_id_v2026_r0` in integration tests_ + + +```python +client.shuttle.update_shuttle_system_by_id_v2026_r0(created_system.id, name=updated_system_name) +``` ### Arguments @@ -165,7 +181,11 @@ This operation is performed by calling function `delete_shuttle_system_by_id_v20 See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/delete-shuttle-systems-id/). -_Currently we don't have an example for calling `delete_shuttle_system_by_id_v2026_r0` in integration tests_ + + +```python +client.shuttle.delete_shuttle_system_by_id_v2026_r0(created_system.id) +``` ### Arguments @@ -194,7 +214,11 @@ This operation is performed by calling function `create_shuttle_system_issue_reg See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-systems-id-issue-registration-token/). -_Currently we don't have an example for calling `create_shuttle_system_issue_registration_token_v2026_r0` in integration tests_ + + +```python +client.shuttle.create_shuttle_system_issue_registration_token_v2026_r0(created_system.id) +``` ### Arguments @@ -221,7 +245,11 @@ This operation is performed by calling function `get_shuttle_jobs_v2026_r0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-jobs/). -_Currently we don't have an example for calling `get_shuttle_jobs_v2026_r0` in integration tests_ + + +```python +client.shuttle.get_shuttle_jobs_v2026_r0() +``` ### Arguments @@ -250,7 +278,11 @@ This operation is performed by calling function `create_shuttle_job_v2026_r0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-jobs/). -_Currently we don't have an example for calling `create_shuttle_job_v2026_r0` in integration tests_ + + +```python +client.shuttle.create_shuttle_job_v2026_r0(get_uuid(), CreateShuttleJobV2026R0JobType.TRANSFER, resource_id) +``` ### Arguments @@ -289,7 +321,11 @@ This operation is performed by calling function `get_shuttle_job_by_id_v2026_r0` See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-jobs-id/). -_Currently we don't have an example for calling `get_shuttle_job_by_id_v2026_r0` in integration tests_ + + +```python +client.shuttle.get_shuttle_job_by_id_v2026_r0(resource_id) +``` ### Arguments @@ -316,7 +352,11 @@ This operation is performed by calling function `update_shuttle_job_by_id_v2026_ See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/put-shuttle-jobs-id/). -_Currently we don't have an example for calling `update_shuttle_job_by_id_v2026_r0` in integration tests_ + + +```python +client.shuttle.update_shuttle_job_by_id_v2026_r0(resource_id, name=get_uuid()) +``` ### Arguments @@ -353,7 +393,11 @@ This operation is performed by calling function `delete_shuttle_job_by_id_v2026_ See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/delete-shuttle-jobs-id/). -_Currently we don't have an example for calling `delete_shuttle_job_by_id_v2026_r0` in integration tests_ + + +```python +client.shuttle.delete_shuttle_job_by_id_v2026_r0(resource_id) +``` ### Arguments @@ -380,7 +424,11 @@ This operation is performed by calling function `create_shuttle_job_start_v2026_ See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-jobs-id-start/). -_Currently we don't have an example for calling `create_shuttle_job_start_v2026_r0` in integration tests_ + + +```python +client.shuttle.create_shuttle_job_start_v2026_r0(resource_id) +``` ### Arguments @@ -410,7 +458,11 @@ This operation is performed by calling function `create_shuttle_job_stop_v2026_r See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-jobs-id-stop/). -_Currently we don't have an example for calling `create_shuttle_job_stop_v2026_r0` in integration tests_ + + +```python +client.shuttle.create_shuttle_job_stop_v2026_r0(resource_id) +``` ### Arguments @@ -437,7 +489,11 @@ This operation is performed by calling function `create_shuttle_job_prepare_migr See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-jobs-id-prepare-migration/). -_Currently we don't have an example for calling `create_shuttle_job_prepare_migration_v2026_r0` in integration tests_ + + +```python +client.shuttle.create_shuttle_job_prepare_migration_v2026_r0(resource_id) +``` ### Arguments @@ -464,7 +520,11 @@ This operation is performed by calling function `get_shuttle_runs_v2026_r0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-runs/). -_Currently we don't have an example for calling `get_shuttle_runs_v2026_r0` in integration tests_ + + +```python +client.shuttle.get_shuttle_runs_v2026_r0(resource_id) +``` ### Arguments @@ -495,7 +555,11 @@ This operation is performed by calling function `get_shuttle_run_by_id_v2026_r0` See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-runs-id/). -_Currently we don't have an example for calling `get_shuttle_run_by_id_v2026_r0` in integration tests_ + + +```python +client.shuttle.get_shuttle_run_by_id_v2026_r0(resource_id) +``` ### Arguments @@ -522,7 +586,11 @@ This operation is performed by calling function `get_shuttle_job_schedules_v2026 See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-job-schedules/). -_Currently we don't have an example for calling `get_shuttle_job_schedules_v2026_r0` in integration tests_ + + +```python +client.shuttle.get_shuttle_job_schedules_v2026_r0(resource_id) +``` ### Arguments @@ -555,7 +623,11 @@ This operation is performed by calling function `create_shuttle_job_schedule_v20 See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-job-schedules/). -_Currently we don't have an example for calling `create_shuttle_job_schedule_v2026_r0` in integration tests_ + + +```python +client.shuttle.create_shuttle_job_schedule_v2026_r0(resource_id, CreateShuttleJobScheduleV2026R0RunMode.TRANSFER, ShuttleJobScheduleTriggerByTimeV2026R0(type=ShuttleJobScheduleTriggerByTimeV2026R0TypeField.BY_TIME, start_at='2030-01-01T09:00:00', time_zone='America/Los_Angeles', repeat=ShuttleJobScheduleTriggerByTimeV2026R0RepeatField.DAILY), state=CreateShuttleJobScheduleV2026R0State.PAUSED) +``` ### Arguments @@ -589,7 +661,11 @@ This operation is performed by calling function `get_shuttle_job_schedule_by_id_ See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-job-schedules-id/). -_Currently we don't have an example for calling `get_shuttle_job_schedule_by_id_v2026_r0` in integration tests_ + + +```python +client.shuttle.get_shuttle_job_schedule_by_id_v2026_r0(resource_id) +``` ### Arguments @@ -617,7 +693,11 @@ This operation is performed by calling function `update_shuttle_job_schedule_by_ See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/put-shuttle-job-schedules-id/). -_Currently we don't have an example for calling `update_shuttle_job_schedule_by_id_v2026_r0` in integration tests_ + + +```python +client.shuttle.update_shuttle_job_schedule_by_id_v2026_r0(resource_id, run_mode=UpdateShuttleJobScheduleByIdV2026R0RunMode.SIMULATION) +``` ### Arguments @@ -652,7 +732,11 @@ This operation is performed by calling function `delete_shuttle_job_schedule_by_ See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/delete-shuttle-job-schedules-id/). -_Currently we don't have an example for calling `delete_shuttle_job_schedule_by_id_v2026_r0` in integration tests_ + + +```python +client.shuttle.delete_shuttle_job_schedule_by_id_v2026_r0(resource_id) +``` ### Arguments @@ -680,7 +764,11 @@ This operation is performed by calling function `get_shuttle_path_mappings_v2026 See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-path-mappings/). -_Currently we don't have an example for calling `get_shuttle_path_mappings_v2026_r0` in integration tests_ + + +```python +client.shuttle.get_shuttle_path_mappings_v2026_r0(resource_id) +``` ### Arguments @@ -711,7 +799,11 @@ This operation is performed by calling function `create_shuttle_path_mapping_v20 See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-path-mappings/). -_Currently we don't have an example for calling `create_shuttle_path_mapping_v2026_r0` in integration tests_ + + +```python +client.shuttle.create_shuttle_path_mapping_v2026_r0(resource_id, ShuttlePathMappingAccountLocationInputV2026R0(type=ShuttlePathMappingAccountLocationInputV2026R0TypeField.ACCOUNT, path='/finance', account=ShuttlePathMappingAccountInputV2026R0(email='user@example.com'))) +``` ### Arguments @@ -744,7 +836,11 @@ This operation is performed by calling function `get_shuttle_path_mapping_by_id_ See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-path-mappings-id/). -_Currently we don't have an example for calling `get_shuttle_path_mapping_by_id_v2026_r0` in integration tests_ + + +```python +client.shuttle.get_shuttle_path_mapping_by_id_v2026_r0(resource_id) +``` ### Arguments @@ -772,7 +868,11 @@ This operation is performed by calling function `update_shuttle_path_mapping_by_ See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/put-shuttle-path-mappings-id/). -_Currently we don't have an example for calling `update_shuttle_path_mapping_by_id_v2026_r0` in integration tests_ + + +```python +client.shuttle.update_shuttle_path_mapping_by_id_v2026_r0(resource_id, is_path_skipped=True) +``` ### Arguments @@ -805,7 +905,11 @@ This operation is performed by calling function `delete_shuttle_path_mapping_by_ See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/delete-shuttle-path-mappings-id/). -_Currently we don't have an example for calling `delete_shuttle_path_mapping_by_id_v2026_r0` in integration tests_ + + +```python +client.shuttle.delete_shuttle_path_mapping_by_id_v2026_r0(resource_id) +``` ### Arguments @@ -846,7 +950,11 @@ This operation is performed by calling function `create_shuttle_path_mapping_imp See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-path-mapping-imports/). -_Currently we don't have an example for calling `create_shuttle_path_mapping_import_v2026_r0` in integration tests_ + + +```python +client.shuttle.create_shuttle_path_mapping_import_v2026_r0(resource_id, resource_id) +``` ### Arguments @@ -908,7 +1016,11 @@ This operation is performed by calling function `create_shuttle_subject_mapping_ See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-subject-mapping-imports/). -_Currently we don't have an example for calling `create_shuttle_subject_mapping_import_v2026_r0` in integration tests_ + + +```python +client.shuttle.create_shuttle_subject_mapping_import_v2026_r0(resource_id, resource_id) +``` ### Arguments @@ -942,7 +1054,11 @@ This operation is performed by calling function `get_shuttle_subject_mappings_v2 See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-subject-mappings/). -_Currently we don't have an example for calling `get_shuttle_subject_mappings_v2026_r0` in integration tests_ + + +```python +client.shuttle.get_shuttle_subject_mappings_v2026_r0(resource_id) +``` ### Arguments @@ -973,7 +1089,11 @@ This operation is performed by calling function `create_shuttle_subject_mapping_ See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-subject-mappings/). -_Currently we don't have an example for calling `create_shuttle_subject_mapping_v2026_r0` in integration tests_ + + +```python +client.shuttle.create_shuttle_subject_mapping_v2026_r0(resource_id, resource_id) +``` ### Arguments @@ -1008,7 +1128,11 @@ This operation is performed by calling function `get_shuttle_subject_mapping_by_ See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-subject-mappings-id/). -_Currently we don't have an example for calling `get_shuttle_subject_mapping_by_id_v2026_r0` in integration tests_ + + +```python +client.shuttle.get_shuttle_subject_mapping_by_id_v2026_r0(resource_id) +``` ### Arguments @@ -1036,7 +1160,11 @@ This operation is performed by calling function `update_shuttle_subject_mapping_ See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/put-shuttle-subject-mappings-id/). -_Currently we don't have an example for calling `update_shuttle_subject_mapping_by_id_v2026_r0` in integration tests_ + + +```python +client.shuttle.update_shuttle_subject_mapping_by_id_v2026_r0(resource_id, is_subject_skipped=True) +``` ### Arguments @@ -1066,7 +1194,11 @@ This operation is performed by calling function `delete_shuttle_subject_mapping_ See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/delete-shuttle-subject-mappings-id/). -_Currently we don't have an example for calling `delete_shuttle_subject_mapping_by_id_v2026_r0` in integration tests_ + + +```python +client.shuttle.delete_shuttle_subject_mapping_by_id_v2026_r0(resource_id) +``` ### Arguments @@ -1094,7 +1226,11 @@ This operation is performed by calling function `get_shuttle_discovered_subjects See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-discovered-subjects/). -_Currently we don't have an example for calling `get_shuttle_discovered_subjects_v2026_r0` in integration tests_ + + +```python +client.shuttle.get_shuttle_discovered_subjects_v2026_r0(resource_id) +``` ### Arguments @@ -1129,7 +1265,11 @@ This operation is performed by calling function `get_shuttle_path_entries_v2026_ See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-path-entries/). -_Currently we don't have an example for calling `get_shuttle_path_entries_v2026_r0` in integration tests_ + + +```python +client.shuttle.get_shuttle_path_entries_v2026_r0(resource_id, GetShuttlePathEntriesV2026R0Side.SOURCE) +``` ### Arguments @@ -1169,7 +1309,11 @@ This operation is performed by calling function `get_shuttle_mapping_errors_v202 See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-mapping-errors/). -_Currently we don't have an example for calling `get_shuttle_mapping_errors_v2026_r0` in integration tests_ + + +```python +client.shuttle.get_shuttle_mapping_errors_v2026_r0(resource_id) +``` ### Arguments @@ -1200,7 +1344,11 @@ This operation is performed by calling function `get_shuttle_reports_v2026_r0`. See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-reports/). -_Currently we don't have an example for calling `get_shuttle_reports_v2026_r0` in integration tests_ + + +```python +client.shuttle.get_shuttle_reports_v2026_r0(resource_id) +``` ### Arguments @@ -1235,7 +1383,11 @@ This operation is performed by calling function `create_shuttle_report_v2026_r0` See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-reports/). -_Currently we don't have an example for calling `create_shuttle_report_v2026_r0` in integration tests_ + + +```python +client.shuttle.create_shuttle_report_v2026_r0(resource_id, CreateShuttleReportV2026R0Format.CSV, ['summary']) +``` ### Arguments @@ -1272,7 +1424,11 @@ This operation is performed by calling function `get_shuttle_report_by_id_v2026_ See the endpoint docs at [API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-reports-id/). -_Currently we don't have an example for calling `get_shuttle_report_by_id_v2026_r0` in integration tests_ + + +```python +client.shuttle.get_shuttle_report_by_id_v2026_r0(resource_id) +``` ### Arguments diff --git a/test/box_sdk_gen/test/shuttle.py b/test/box_sdk_gen/test/shuttle.py new file mode 100644 index 00000000..69695b18 --- /dev/null +++ b/test/box_sdk_gen/test/shuttle.py @@ -0,0 +1,225 @@ +from box_sdk_gen.internal.utils import to_string + +import pytest + +from box_sdk_gen.client import BoxClient + +from box_sdk_gen.schemas.v2026_r0.shuttle_system_v2026_r0 import ShuttleSystemV2026R0 + +from box_sdk_gen.managers.shuttle import CreateShuttleSystemV2026R0SystemType + +from box_sdk_gen.schemas.v2026_r0.shuttle_systems_v2026_r0 import ShuttleSystemsV2026R0 + +from box_sdk_gen.schemas.v2026_r0.shuttle_agent_credentials_v2026_r0 import ( + ShuttleAgentCredentialsV2026R0, +) + +from box_sdk_gen.schemas.v2026_r0.shuttle_jobs_v2026_r0 import ShuttleJobsV2026R0 + +from box_sdk_gen.managers.shuttle import CreateShuttleJobV2026R0JobType + +from box_sdk_gen.schemas.v2026_r0.shuttle_runs_v2026_r0 import ShuttleRunsV2026R0 + +from box_sdk_gen.managers.shuttle import GetShuttlePathEntriesV2026R0Side + +from box_sdk_gen.managers.shuttle import CreateShuttleReportV2026R0Format + +from box_sdk_gen.managers.shuttle import UpdateShuttleJobScheduleByIdV2026R0RunMode + +from box_sdk_gen.managers.shuttle import CreateShuttleJobScheduleV2026R0RunMode + +from box_sdk_gen.managers.shuttle import CreateShuttleJobScheduleV2026R0State + +from box_sdk_gen.schemas.v2026_r0.shuttle_job_schedule_trigger_by_time_v2026_r0 import ( + ShuttleJobScheduleTriggerByTimeV2026R0TypeField, +) + +from box_sdk_gen.schemas.v2026_r0.shuttle_job_schedule_trigger_by_time_v2026_r0 import ( + ShuttleJobScheduleTriggerByTimeV2026R0RepeatField, +) + +from box_sdk_gen.schemas.v2026_r0.shuttle_path_mapping_account_location_input_v2026_r0 import ( + ShuttlePathMappingAccountLocationInputV2026R0TypeField, +) + +from box_sdk_gen.schemas.v2026_r0.shuttle_path_mapping_account_input_v2026_r0 import ( + ShuttlePathMappingAccountInputV2026R0, +) + +from box_sdk_gen.internal.utils import get_env_var + +from box_sdk_gen.internal.utils import get_uuid + +from test.box_sdk_gen.test.commons import get_default_client_with_user_subject + +from box_sdk_gen.schemas.v2026_r0.shuttle_job_schedule_trigger_by_time_v2026_r0 import ( + ShuttleJobScheduleTriggerByTimeV2026R0, +) + +from box_sdk_gen.schemas.v2026_r0.shuttle_path_mapping_account_location_input_v2026_r0 import ( + ShuttlePathMappingAccountLocationInputV2026R0, +) + +client: BoxClient = get_default_client_with_user_subject(get_env_var('USER_ID')) + + +def testCreateGetUpdateListDeleteShuttleSystemV2026R0(): + system_name: str = get_uuid() + created_system: ShuttleSystemV2026R0 = ( + client.shuttle.create_shuttle_system_v2026_r0( + system_name, system_type=CreateShuttleSystemV2026R0SystemType.WINDOWS + ) + ) + assert created_system.name == system_name + assert created_system.system_type == 'windows' + assert to_string(created_system.type) == 'shuttle_system' + system_from_api: ShuttleSystemV2026R0 = ( + client.shuttle.get_shuttle_system_by_id_v2026_r0(created_system.id) + ) + assert system_from_api.id == created_system.id + assert system_from_api.name == system_name + updated_system_name: str = get_uuid() + updated_system: ShuttleSystemV2026R0 = ( + client.shuttle.update_shuttle_system_by_id_v2026_r0( + created_system.id, name=updated_system_name + ) + ) + assert updated_system.name == updated_system_name + systems: ShuttleSystemsV2026R0 = client.shuttle.get_shuttle_systems_v2026_r0() + assert len(systems.entries) > 0 + credentials: ShuttleAgentCredentialsV2026R0 = ( + client.shuttle.create_shuttle_system_issue_registration_token_v2026_r0( + created_system.id + ) + ) + assert not credentials.registration_token == '' + client.shuttle.delete_shuttle_system_by_id_v2026_r0(created_system.id) + with pytest.raises(Exception): + client.shuttle.get_shuttle_system_by_id_v2026_r0(created_system.id) + + +def testShuttleJobsWithNonExistentIdV2026R0(): + resource_id: str = '123456' + jobs: ShuttleJobsV2026R0 = client.shuttle.get_shuttle_jobs_v2026_r0() + assert len(jobs.entries) >= 0 + with pytest.raises(Exception): + client.shuttle.create_shuttle_job_v2026_r0( + get_uuid(), CreateShuttleJobV2026R0JobType.TRANSFER, resource_id + ) + with pytest.raises(Exception): + client.shuttle.get_shuttle_job_by_id_v2026_r0(resource_id) + with pytest.raises(Exception): + client.shuttle.update_shuttle_job_by_id_v2026_r0(resource_id, name=get_uuid()) + with pytest.raises(Exception): + client.shuttle.delete_shuttle_job_by_id_v2026_r0(resource_id) + with pytest.raises(Exception): + client.shuttle.create_shuttle_job_start_v2026_r0(resource_id) + with pytest.raises(Exception): + client.shuttle.create_shuttle_job_stop_v2026_r0(resource_id) + with pytest.raises(Exception): + client.shuttle.create_shuttle_job_prepare_migration_v2026_r0(resource_id) + + +def testShuttleRunsWithNonExistentIdV2026R0(): + resource_id: str = '123456' + runs: ShuttleRunsV2026R0 = client.shuttle.get_shuttle_runs_v2026_r0(resource_id) + assert len(runs.entries) >= 0 + with pytest.raises(Exception): + client.shuttle.get_shuttle_run_by_id_v2026_r0(resource_id) + + +def testShuttleMappingsWithNonExistentIdV2026R0(): + resource_id: str = '123456' + with pytest.raises(Exception): + client.shuttle.get_shuttle_path_mappings_v2026_r0(resource_id) + with pytest.raises(Exception): + client.shuttle.get_shuttle_path_mapping_by_id_v2026_r0(resource_id) + with pytest.raises(Exception): + client.shuttle.update_shuttle_path_mapping_by_id_v2026_r0( + resource_id, is_path_skipped=True + ) + with pytest.raises(Exception): + client.shuttle.delete_shuttle_path_mapping_by_id_v2026_r0(resource_id) + with pytest.raises(Exception): + client.shuttle.create_shuttle_path_mapping_import_v2026_r0( + resource_id, resource_id + ) + with pytest.raises(Exception): + client.shuttle.get_shuttle_subject_mappings_v2026_r0(resource_id) + with pytest.raises(Exception): + client.shuttle.create_shuttle_subject_mapping_v2026_r0(resource_id, resource_id) + with pytest.raises(Exception): + client.shuttle.get_shuttle_subject_mapping_by_id_v2026_r0(resource_id) + with pytest.raises(Exception): + client.shuttle.update_shuttle_subject_mapping_by_id_v2026_r0( + resource_id, is_subject_skipped=True + ) + with pytest.raises(Exception): + client.shuttle.delete_shuttle_subject_mapping_by_id_v2026_r0(resource_id) + with pytest.raises(Exception): + client.shuttle.create_shuttle_subject_mapping_import_v2026_r0( + resource_id, resource_id + ) + with pytest.raises(Exception): + client.shuttle.get_shuttle_discovered_subjects_v2026_r0(resource_id) + with pytest.raises(Exception): + client.shuttle.get_shuttle_path_entries_v2026_r0( + resource_id, GetShuttlePathEntriesV2026R0Side.SOURCE + ) + with pytest.raises(Exception): + client.shuttle.get_shuttle_mapping_errors_v2026_r0(resource_id) + + +def testShuttleReportsWithNonExistentIdV2026R0(): + resource_id: str = '123456' + with pytest.raises(Exception): + client.shuttle.get_shuttle_reports_v2026_r0(resource_id) + with pytest.raises(Exception): + client.shuttle.create_shuttle_report_v2026_r0( + resource_id, CreateShuttleReportV2026R0Format.CSV, ['summary'] + ) + with pytest.raises(Exception): + client.shuttle.get_shuttle_report_by_id_v2026_r0(resource_id) + + +def testShuttleJobSchedulesWithNonExistentIdV2026R0(): + resource_id: str = '123456' + with pytest.raises(Exception): + client.shuttle.get_shuttle_job_schedules_v2026_r0(resource_id) + with pytest.raises(Exception): + client.shuttle.get_shuttle_job_schedule_by_id_v2026_r0(resource_id) + with pytest.raises(Exception): + client.shuttle.update_shuttle_job_schedule_by_id_v2026_r0( + resource_id, run_mode=UpdateShuttleJobScheduleByIdV2026R0RunMode.SIMULATION + ) + with pytest.raises(Exception): + client.shuttle.delete_shuttle_job_schedule_by_id_v2026_r0(resource_id) + + +def testCreateShuttleJobScheduleWithNonExistentIdV2026R0(): + resource_id: str = '123456' + with pytest.raises(Exception): + client.shuttle.create_shuttle_job_schedule_v2026_r0( + resource_id, + CreateShuttleJobScheduleV2026R0RunMode.TRANSFER, + ShuttleJobScheduleTriggerByTimeV2026R0( + type=ShuttleJobScheduleTriggerByTimeV2026R0TypeField.BY_TIME, + start_at='2030-01-01T09:00:00', + time_zone='America/Los_Angeles', + repeat=ShuttleJobScheduleTriggerByTimeV2026R0RepeatField.DAILY, + ), + state=CreateShuttleJobScheduleV2026R0State.PAUSED, + ) + + +def testCreateShuttlePathMappingWithNonExistentIdV2026R0(): + resource_id: str = '123456' + with pytest.raises(Exception): + client.shuttle.create_shuttle_path_mapping_v2026_r0( + resource_id, + ShuttlePathMappingAccountLocationInputV2026R0( + type=ShuttlePathMappingAccountLocationInputV2026R0TypeField.ACCOUNT, + path='/finance', + account=ShuttlePathMappingAccountInputV2026R0(email='user@example.com'), + ), + ) From 80c028fa82f6344b2986524831bac9edf00e7409 Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Mon, 9 Nov 2026 05:42:03 -0800 Subject: [PATCH 4/5] chore: Update `.codegen.json` with commit hash of `codegen` and `openapi` spec [skip ci] --- .codegen.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codegen.json b/.codegen.json index 0e73d046..74be9594 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "2dcb7e8", "specHash": "74452eb", "version": "4.19.0" } +{ "engineHash": "83cf196", "specHash": "74452eb", "version": "4.19.0" } From 55d1f2d00841b8035afd0ba20b7255da11bb9af3 Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Mon, 9 Nov 2026 06:44:27 -0800 Subject: [PATCH 5/5] chore: Update `.codegen.json` with commit hash of `codegen` and `openapi` spec [skip ci] --- .codegen.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codegen.json b/.codegen.json index 74be9594..b18a5b57 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "83cf196", "specHash": "74452eb", "version": "4.19.0" } +{ "engineHash": "0068c55", "specHash": "74452eb", "version": "4.19.0" }