From b9033558fef5777f6cd1979cab8cb4b418a7d55a Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Thu, 2 Apr 2026 03:43:58 -0700 Subject: [PATCH] feat: Support union of primitives (box/box-codegen#932) --- .codegen.json | 2 +- box_sdk_gen/managers/retention_policies.py | 12 ++++++------ docs/box_sdk_gen/retention_policies.md | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.codegen.json b/.codegen.json index 0fbc22a45..027e4e270 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "8a22201", "specHash": "f8e0d99", "version": "4.6.0" } +{ "engineHash": "37c0986", "specHash": "f8e0d99", "version": "4.6.0" } diff --git a/box_sdk_gen/managers/retention_policies.py b/box_sdk_gen/managers/retention_policies.py index 9f5f5f723..bfd717c1e 100644 --- a/box_sdk_gen/managers/retention_policies.py +++ b/box_sdk_gen/managers/retention_policies.py @@ -10,12 +10,12 @@ from box_sdk_gen.serialization.json import deserialize +from typing import Union + from box_sdk_gen.serialization.json import serialize from box_sdk_gen.internal.null_value import NullValue -from typing import Union - from box_sdk_gen.networking.fetch_options import ResponseFormat from box_sdk_gen.schemas.retention_policies import RetentionPolicies @@ -154,7 +154,7 @@ def create_retention_policy( disposition_action: CreateRetentionPolicyDispositionAction, *, description: Optional[str] = None, - retention_length: Optional[str] = None, + retention_length: Optional[Union[str, int]] = None, retention_type: Optional[CreateRetentionPolicyRetentionType] = None, can_owner_extend_retention: Optional[bool] = None, are_owners_notified: Optional[bool] = None, @@ -186,7 +186,7 @@ def create_retention_policy( content. If the policy has a `policy_type` of `indefinite`, the `retention_length` will also be `indefinite`., defaults to None - :type retention_length: Optional[str], optional + :type retention_length: Optional[Union[str, int]], optional :param retention_type: Specifies the retention type: * `modifiable`: You can modify the retention policy. For example, @@ -301,7 +301,7 @@ def update_retention_policy_by_id( description: Union[Optional[str], NullValue] = None, disposition_action: Optional[str] = None, retention_type: Union[Optional[str], NullValue] = None, - retention_length: Optional[str] = None, + retention_length: Optional[Union[str, int]] = None, status: Union[Optional[str], NullValue] = None, can_owner_extend_retention: Union[Optional[bool], NullValue] = None, are_owners_notified: Union[Optional[bool], NullValue] = None, @@ -354,7 +354,7 @@ def update_retention_policy_by_id( content. If the policy has a `policy_type` of `indefinite`, the `retention_length` will also be `indefinite`., defaults to None - :type retention_length: Optional[str], optional + :type retention_length: Optional[Union[str, int]], optional :param status: Used to retire a retention policy. If not retiring a policy, do not include this parameter diff --git a/docs/box_sdk_gen/retention_policies.md b/docs/box_sdk_gen/retention_policies.md index a671ff3a0..182d77770 100644 --- a/docs/box_sdk_gen/retention_policies.md +++ b/docs/box_sdk_gen/retention_policies.md @@ -69,7 +69,7 @@ client.retention_policies.create_retention_policy(retention_policy_name, CreateR - The type of the retention policy. A retention policy type can either be `finite`, where a specific amount of time to retain the content is known upfront, or `indefinite`, where the amount of time to retain the content is still unknown. - disposition_action `CreateRetentionPolicyDispositionAction` - The disposition action of the retention policy. `permanently_delete` deletes the content retained by the policy permanently. `remove_retention` lifts retention policy from the content, allowing it to be deleted by users once the retention policy has expired. -- retention_length `Optional[str]` +- retention_length `Optional[Union[str, int]]` - The length of the retention policy. This value specifies the duration in days that the retention policy will be active for after being assigned to content. If the policy has a `policy_type` of `indefinite`, the `retention_length` will also be `indefinite`. - retention_type `Optional[CreateRetentionPolicyRetentionType]` - Specifies the retention type: _ `modifiable`: You can modify the retention policy. For example, you can add or remove folders, shorten or lengthen the policy duration, or delete the assignment. Use this type if your retention policy is not related to any regulatory purposes. _ `non_modifiable`: You can modify the retention policy only in a limited way: add a folder, lengthen the duration, retire the policy, change the disposition action or notification settings. You cannot perform other actions, such as deleting the assignment or shortening the policy duration. Use this type to ensure compliance with regulatory retention policies. @@ -145,7 +145,7 @@ client.retention_policies.update_retention_policy_by_id(retention_policy.id, pol - The disposition action of the retention policy. This action can be `permanently_delete`, which will cause the content retained by the policy to be permanently deleted, or `remove_retention`, which will lift the retention policy from the content, allowing it to be deleted by users, once the retention policy has expired. You can use `null` if you don't want to change `disposition_action`. - retention_type `Optional[str]` - Specifies the retention type: _ `modifiable`: You can modify the retention policy. For example, you can add or remove folders, shorten or lengthen the policy duration, or delete the assignment. Use this type if your retention policy is not related to any regulatory purposes. _ `non-modifiable`: You can modify the retention policy only in a limited way: add a folder, lengthen the duration, retire the policy, change the disposition action or notification settings. You cannot perform other actions, such as deleting the assignment or shortening the policy duration. Use this type to ensure compliance with regulatory retention policies. When updating a retention policy, you can use `non-modifiable` type only. You can convert a `modifiable` policy to `non-modifiable`, but not the other way around. -- retention_length `Optional[str]` +- retention_length `Optional[Union[str, int]]` - The length of the retention policy. This value specifies the duration in days that the retention policy will be active for after being assigned to content. If the policy has a `policy_type` of `indefinite`, the `retention_length` will also be `indefinite`. - status `Optional[str]` - Used to retire a retention policy. If not retiring a policy, do not include this parameter or set it to `null`.