From a68328dd5b82b8a4684bbf7e10b5ecbc0a81b02c Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Wed, 3 Jul 2024 06:12:17 -0700 Subject: [PATCH 01/11] test: Improve term of service test reliability (box/box-codegen#522) --- .codegen.json | 2 +- docs/terms_of_services.md | 2 +- test/terms_of_services.py | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.codegen.json b/.codegen.json index 2855d76c..04071b88 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "62a25a4", "specHash": "e95d6fa", "version": "1.1.0" } +{ "engineHash": "5a07c4a", "specHash": "e95d6fa", "version": "1.1.0" } diff --git a/docs/terms_of_services.md b/docs/terms_of_services.md index 9fcc4095..0efe617f 100644 --- a/docs/terms_of_services.md +++ b/docs/terms_of_services.md @@ -109,7 +109,7 @@ See the endpoint docs at ```python client.terms_of_services.update_terms_of_service_by_id( - tos.id, UpdateTermsOfServiceByIdStatus.DISABLED.value, "Disabled TOS" + tos.id, UpdateTermsOfServiceByIdStatus.DISABLED.value, "Updated TOS" ) ``` diff --git a/test/terms_of_services.py b/test/terms_of_services.py index 83f02276..65bf7168 100644 --- a/test/terms_of_services.py +++ b/test/terms_of_services.py @@ -19,17 +19,17 @@ def testGetTermsOfServices(): tos: TermsOfService = get_or_create_terms_of_services() updated_tos_1: TermsOfService = ( client.terms_of_services.update_terms_of_service_by_id( - tos.id, UpdateTermsOfServiceByIdStatus.ENABLED.value, 'Enabled TOS' + tos.id, UpdateTermsOfServiceByIdStatus.DISABLED.value, 'TOS' ) ) - assert to_string(updated_tos_1.status) == 'enabled' - assert updated_tos_1.text == 'Enabled TOS' + assert to_string(updated_tos_1.status) == 'disabled' + assert updated_tos_1.text == 'TOS' updated_tos_2: TermsOfService = ( client.terms_of_services.update_terms_of_service_by_id( - tos.id, UpdateTermsOfServiceByIdStatus.DISABLED.value, 'Disabled TOS' + tos.id, UpdateTermsOfServiceByIdStatus.DISABLED.value, 'Updated TOS' ) ) assert to_string(updated_tos_2.status) == 'disabled' - assert updated_tos_2.text == 'Disabled TOS' + assert updated_tos_2.text == 'Updated TOS' list_tos: TermsOfServices = client.terms_of_services.get_terms_of_service() assert list_tos.total_count > 0 From 02adc44e4c2241756ccd608412d4720d6143a479 Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Thu, 4 Jul 2024 07:30:35 -0700 Subject: [PATCH 02/11] chore: Update .codegen.json with commit hash of codegen and openapi spec --- .codegen.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codegen.json b/.codegen.json index 04071b88..7986f731 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "5a07c4a", "specHash": "e95d6fa", "version": "1.1.0" } +{ "engineHash": "ef31179", "specHash": "e95d6fa", "version": "1.1.0" } From 125da0dd4a935a98914e90397a3d0e3e43c9d91a Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Thu, 4 Jul 2024 11:41:39 -0700 Subject: [PATCH 03/11] chore: Update .codegen.json with commit hash of codegen and openapi spec --- .codegen.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codegen.json b/.codegen.json index 7986f731..953a0f1b 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "ef31179", "specHash": "e95d6fa", "version": "1.1.0" } +{ "engineHash": "f9e3f29", "specHash": "e95d6fa", "version": "1.1.0" } From 6cd3981466c92b56c39f81a73723d6686107ed8f Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Fri, 5 Jul 2024 03:12:03 -0700 Subject: [PATCH 04/11] chore: Update .codegen.json with commit hash of codegen and openapi spec --- .codegen.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codegen.json b/.codegen.json index 953a0f1b..3a060a63 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "f9e3f29", "specHash": "e95d6fa", "version": "1.1.0" } +{ "engineHash": "ae7e03e", "specHash": "e95d6fa", "version": "1.1.0" } From 3ff8786fd176d8a80f629392f2877fbf454e1c65 Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Mon, 8 Jul 2024 02:41:27 -0700 Subject: [PATCH 05/11] fix: Update chunked upload (box/box-codegen#523) --- .codegen.json | 2 +- box_sdk_gen/internal/utils.py | 4 +++- box_sdk_gen/managers/chunked_uploads.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.codegen.json b/.codegen.json index 3a060a63..29c21a7b 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "ae7e03e", "specHash": "e95d6fa", "version": "1.1.0" } +{ "engineHash": "89557a9", "specHash": "e95d6fa", "version": "1.1.0" } diff --git a/box_sdk_gen/internal/utils.py b/box_sdk_gen/internal/utils.py index 4e87acee..85ac81d6 100644 --- a/box_sdk_gen/internal/utils.py +++ b/box_sdk_gen/internal/utils.py @@ -152,7 +152,9 @@ def hex_to_base_64(data: hex): Accumulator = TypeVar('Accumulator') -def iterate_chunks(stream: ByteStream, chunk_size: int) -> Iterable[ByteStream]: +def iterate_chunks( + stream: ByteStream, chunk_size: int, file_size: int +) -> Iterable[ByteStream]: stream_is_finished = False while not stream_is_finished: copied_length = 0 diff --git a/box_sdk_gen/managers/chunked_uploads.py b/box_sdk_gen/managers/chunked_uploads.py index 000b2ae5..417320d0 100644 --- a/box_sdk_gen/managers/chunked_uploads.py +++ b/box_sdk_gen/managers/chunked_uploads.py @@ -532,7 +532,7 @@ def upload_big_file( assert part_size * total_parts >= file_size assert upload_session.num_parts_processed == 0 file_hash: Hash = Hash(algorithm=HashName.SHA1.value) - chunks_iterator: Iterator = iterate_chunks(file, part_size) + chunks_iterator: Iterator = iterate_chunks(file, part_size, file_size) results: _PartAccumulator = reduce_iterator( chunks_iterator, self._reducer, From 5ae69aecad690bdca9eba49db59585c163924e7c Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Mon, 8 Jul 2024 07:12:23 -0700 Subject: [PATCH 06/11] chore: Update .codegen.json with commit hash of codegen and openapi spec --- .codegen.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codegen.json b/.codegen.json index 29c21a7b..b04fe144 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "89557a9", "specHash": "e95d6fa", "version": "1.1.0" } +{ "engineHash": "8ad81db", "specHash": "e95d6fa", "version": "1.1.0" } From 5c53748945baa30b7e9efeaeff7545613bb36eb8 Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Thu, 11 Jul 2024 08:42:54 -0700 Subject: [PATCH 07/11] chore: Update .codegen.json with commit hash of codegen and openapi spec --- .codegen.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codegen.json b/.codegen.json index b04fe144..73e9728a 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "8ad81db", "specHash": "e95d6fa", "version": "1.1.0" } +{ "engineHash": "65ccde4", "specHash": "e95d6fa", "version": "1.1.0" } From 7dcf4f1548eab0062579cb726a61bdc2ac08c82a Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Tue, 16 Jul 2024 03:41:52 -0700 Subject: [PATCH 08/11] chore: Update .codegen.json with commit hash of codegen and openapi spec --- .codegen.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codegen.json b/.codegen.json index 73e9728a..2838a89d 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "65ccde4", "specHash": "e95d6fa", "version": "1.1.0" } +{ "engineHash": "25c4224", "specHash": "e95d6fa", "version": "1.1.0" } From 32ef4806938edf2d3f2db13b609cfa17ea7de429 Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Wed, 17 Jul 2024 22:12:36 -0700 Subject: [PATCH 09/11] Add param to user collab (box/box-openapi#437) --- .codegen.json | 2 +- box_sdk_gen/schemas/user_collaborations.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.codegen.json b/.codegen.json index 2838a89d..f297c63d 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "25c4224", "specHash": "e95d6fa", "version": "1.1.0" } +{ "engineHash": "25c4224", "specHash": "137da0d", "version": "1.1.0" } diff --git a/box_sdk_gen/schemas/user_collaborations.py b/box_sdk_gen/schemas/user_collaborations.py index bcd46fbb..f06fbe0d 100644 --- a/box_sdk_gen/schemas/user_collaborations.py +++ b/box_sdk_gen/schemas/user_collaborations.py @@ -12,6 +12,7 @@ def __init__( *, name: Optional[str] = None, login: Optional[str] = None, + is_active: Optional[bool] = None, type: UserBaseTypeField = UserBaseTypeField.USER.value, **kwargs ): @@ -22,9 +23,12 @@ def __init__( :type name: Optional[str], optional :param login: The primary email address of this user. If the collaboration status is `pending`, an empty string is returned., defaults to None :type login: Optional[str], optional + :param is_active: If set to `false`, the user is either deactivated or deleted., defaults to None + :type is_active: Optional[bool], optional :param type: `user`, defaults to UserBaseTypeField.USER.value :type type: UserBaseTypeField, optional """ super().__init__(id=id, type=type, **kwargs) self.name = name self.login = login + self.is_active = is_active From ac4187e57afd2642380b77321f52cd940f7db79e Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Thu, 18 Jul 2024 03:41:47 -0700 Subject: [PATCH 10/11] fix: Fix chunked uploads (box/box-codegen#529) --- .codegen.json | 2 +- box_sdk_gen/managers/chunked_uploads.py | 4 ---- docs/chunked_uploads.md | 6 +----- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/.codegen.json b/.codegen.json index f297c63d..f3079035 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "25c4224", "specHash": "137da0d", "version": "1.1.0" } +{ "engineHash": "594b60f", "specHash": "137da0d", "version": "1.1.0" } diff --git a/box_sdk_gen/managers/chunked_uploads.py b/box_sdk_gen/managers/chunked_uploads.py index 417320d0..7f7ac798 100644 --- a/box_sdk_gen/managers/chunked_uploads.py +++ b/box_sdk_gen/managers/chunked_uploads.py @@ -549,10 +549,6 @@ def upload_big_file( upload_session_id ) assert processed_session_parts.total_count == total_parts - processed_session: UploadSession = self.get_file_upload_session_by_id( - upload_session_id - ) - assert processed_session.num_parts_processed == total_parts sha_1: str = file_hash.digest_hash('base64') digest: str = ''.join(['sha=', sha_1]) committed_session: Files = self.create_file_upload_session_commit( diff --git a/docs/chunked_uploads.md b/docs/chunked_uploads.md index e6634f3b..decf91be 100644 --- a/docs/chunked_uploads.md +++ b/docs/chunked_uploads.md @@ -80,11 +80,7 @@ This operation is performed by calling function `get_file_upload_session_by_id`. See the endpoint docs at [API Reference](https://developer.box.com/reference/get-files-upload-sessions-id/). - - -```python -self.get_file_upload_session_by_id(upload_session_id) -``` +_Currently we don't have an example for calling `get_file_upload_session_by_id` in integration tests_ ### Arguments From 0e179abed98e98c635c1fecb8ab694698379bc39 Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Thu, 18 Jul 2024 03:43:47 -0700 Subject: [PATCH 11/11] chore: Update .codegen.json with commit hash of codegen and openapi spec --- .codegen.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codegen.json b/.codegen.json index f3079035..54017b3d 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "594b60f", "specHash": "137da0d", "version": "1.1.0" } +{ "engineHash": "6a7e147", "specHash": "137da0d", "version": "1.1.0" }