From 3b590b98fbb928de4ef5cc0f9198ff522a077b6b Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Fri, 30 Oct 2026 04:04:44 -0700 Subject: [PATCH 1/3] test(SDK-6911): Write documentSplitTest (box/box-codegen#999) --- .codegen.json | 2 +- docs/document_split.md | 27 ++++++++++++-- test/document_split.py | 80 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+), 4 deletions(-) create mode 100644 test/document_split.py diff --git a/.codegen.json b/.codegen.json index b65b7c31..dacecac4 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "976bbb9", "specHash": "a0e8038", "version": "10.18.0" } +{ "engineHash": "88c0ae7", "specHash": "a0e8038", "version": "10.18.0" } diff --git a/docs/document_split.md b/docs/document_split.md index b3cbaf4a..03625e09 100644 --- a/docs/document_split.md +++ b/docs/document_split.md @@ -25,7 +25,20 @@ 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 +74,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 +108,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/document_split.py b/test/document_split.py new file mode 100644 index 00000000..7dfef940 --- /dev/null +++ b/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.commons import get_default_client + +from test.commons import upload_new_file + +from 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 741285e17f2983a8c080fb1ad35c59fc1b0c4bef Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Wed, 4 Nov 2026 08:34:16 -0800 Subject: [PATCH 2/3] 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 ++++++++++++++++ docs/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 dacecac4..6e8a50c6 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "88c0ae7", "specHash": "a0e8038", "version": "10.18.0" } +{ "engineHash": "88c0ae7", "specHash": "74452eb", "version": "10.18.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/legal_hold_policy_assignments.md b/docs/legal_hold_policy_assignments.md index c23119a4..0265272c 100644 --- a/docs/legal_hold_policy_assignments.md +++ b/docs/legal_hold_policy_assignments.md @@ -48,7 +48,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`. @@ -72,6 +72,8 @@ client.legal_hold_policy_assignments.create_legal_hold_policy_assignment( - 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 b2e256e8953b99017d68c9f9f08223b06eba11ab Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Thu, 5 Nov 2026 02:35:28 -0800 Subject: [PATCH 3/3] test(SDK-6912) Write Shuttle ITest (box/box-codegen#1000) --- .codegen.json | 2 +- docs/shuttle.md | 269 +++++++++++++++++++++++++++++++++++++++++------- test/shuttle.py | 225 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 456 insertions(+), 40 deletions(-) create mode 100644 test/shuttle.py diff --git a/.codegen.json b/.codegen.json index 6e8a50c6..47e9423d 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "88c0ae7", "specHash": "74452eb", "version": "10.18.0" } +{ "engineHash": "2dcb7e8", "specHash": "74452eb", "version": "10.18.0" } diff --git a/docs/shuttle.md b/docs/shuttle.md index e831c06a..b901cf78 100644 --- a/docs/shuttle.md +++ b/docs/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,13 @@ 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 +119,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 +150,13 @@ 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 +185,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 +218,13 @@ 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 +251,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 +284,13 @@ 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 +329,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 +360,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 +401,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 +432,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 +466,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 +497,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 +528,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 +563,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 +594,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 +631,21 @@ 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 +679,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 +711,13 @@ 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 +752,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 +784,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 +819,18 @@ 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 +863,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 +895,13 @@ 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 +934,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 +979,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 +1045,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 +1083,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 +1118,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 +1157,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 +1189,13 @@ 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 +1225,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 +1257,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 +1296,13 @@ 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 +1342,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 +1377,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 +1416,13 @@ 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 +1459,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/shuttle.py b/test/shuttle.py new file mode 100644 index 00000000..10972de2 --- /dev/null +++ b/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.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'), + ), + )