From d9cff4c6adc9c5cc9ce1edf73dffe8ac5979ce71 Mon Sep 17 00:00:00 2001 From: box-sdk-build <94016436+box-sdk-build@users.noreply.github.com> Date: Mon, 9 Dec 2024 13:58:19 +0100 Subject: [PATCH] feat: Support optional `userId` parameter for updating files, folders and web links (box/box-openapi#488) (#406) --- .codegen.json | 2 +- box_sdk_gen/managers/files.py | 7 ++++++- box_sdk_gen/managers/folders.py | 12 +++++++----- box_sdk_gen/managers/web_links.py | 7 ++++++- docs/folders.md | 2 +- 5 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.codegen.json b/.codegen.json index 82042187..ddb94353 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "5604447", "specHash": "d7dfe68", "version": "1.8.0" } +{ "engineHash": "5604447", "specHash": "c9d7bb5", "version": "1.8.0" } diff --git a/box_sdk_gen/managers/files.py b/box_sdk_gen/managers/files.py index 1a251448..6692fd9c 100644 --- a/box_sdk_gen/managers/files.py +++ b/box_sdk_gen/managers/files.py @@ -50,13 +50,18 @@ class UpdateFileByIdParent(BaseObject): - def __init__(self, *, id: Optional[str] = None, **kwargs): + def __init__( + self, *, id: Optional[str] = None, user_id: Optional[str] = None, **kwargs + ): """ :param id: The ID of parent item, defaults to None :type id: Optional[str], optional + :param user_id: The input for `user_id` is optional. Moving to non-root folder is not allowed when `user_id` is present. Parent folder id should be zero when `user_id` is provided., defaults to None + :type user_id: Optional[str], optional """ super().__init__(**kwargs) self.id = id + self.user_id = user_id class UpdateFileByIdSharedLinkAccessField(str, Enum): diff --git a/box_sdk_gen/managers/folders.py b/box_sdk_gen/managers/folders.py index b3e5f3ef..93f7f585 100644 --- a/box_sdk_gen/managers/folders.py +++ b/box_sdk_gen/managers/folders.py @@ -70,13 +70,18 @@ class UpdateFolderByIdSyncState(str, Enum): class UpdateFolderByIdParent(BaseObject): - def __init__(self, *, id: Optional[str] = None, **kwargs): + def __init__( + self, *, id: Optional[str] = None, user_id: Optional[str] = None, **kwargs + ): """ - :param id: The ID of the new parent folder, defaults to None + :param id: The ID of parent item, defaults to None :type id: Optional[str], optional + :param user_id: The input for `user_id` is optional. Moving to non-root folder is not allowed when `user_id` is present. Parent folder id should be zero when `user_id` is provided., defaults to None + :type user_id: Optional[str], optional """ super().__init__(**kwargs) self.id = id + self.user_id = user_id class UpdateFolderByIdSharedLinkAccessField(str, Enum): @@ -489,9 +494,6 @@ def update_folder_by_id( :param can_non_owners_invite: Specifies if users who are not the owner of the folder can invite new collaborators to the folder., defaults to None :type can_non_owners_invite: Optional[bool], optional - :param parent: The parent folder for this folder. Use this to move - the folder or to restore it out of the trash., defaults to None - :type parent: Optional[UpdateFolderByIdParent], optional :param tags: The tags for this item. These tags are shown in the Box web app and mobile apps next to an item. diff --git a/box_sdk_gen/managers/web_links.py b/box_sdk_gen/managers/web_links.py index 2c6f51ca..428774ad 100644 --- a/box_sdk_gen/managers/web_links.py +++ b/box_sdk_gen/managers/web_links.py @@ -54,13 +54,18 @@ def __init__(self, id: str, **kwargs): class UpdateWebLinkByIdParent(BaseObject): - def __init__(self, *, id: Optional[str] = None, **kwargs): + def __init__( + self, *, id: Optional[str] = None, user_id: Optional[str] = None, **kwargs + ): """ :param id: The ID of parent item, defaults to None :type id: Optional[str], optional + :param user_id: The input for `user_id` is optional. Moving to non-root folder is not allowed when `user_id` is present. Parent folder id should be zero when `user_id` is provided., defaults to None + :type user_id: Optional[str], optional """ super().__init__(**kwargs) self.id = id + self.user_id = user_id class UpdateWebLinkByIdSharedLinkAccessField(str, Enum): diff --git a/docs/folders.md b/docs/folders.md index 77628902..08e9ff0f 100644 --- a/docs/folders.md +++ b/docs/folders.md @@ -97,7 +97,7 @@ downscoped_client.folders.update_folder_by_id(folder.id, name=get_uuid()) - can_non_owners_invite `Optional[bool]` - Specifies if users who are not the owner of the folder can invite new collaborators to the folder. - parent `Optional[UpdateFolderByIdParent]` - - The parent folder for this folder. Use this to move the folder or to restore it out of the trash. + - - shared_link `Optional[UpdateFolderByIdSharedLink]` - - folder_upload_email `Optional[UpdateFolderByIdFolderUploadEmail]`