Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "450fb53", "specHash": "f8e0d99", "version": "10.6.0" }
{ "engineHash": "450fb53", "specHash": "d0976fc", "version": "10.6.0" }
10 changes: 5 additions & 5 deletions box_sdk_gen/managers/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def __init__(
class CreateAiExtractStructuredFieldsOptionsField(BaseObject):
def __init__(self, key: str, **kwargs):
"""
:param key: A unique identifier for the field.
:param key: A unique identifier for the option.
:type key: str
"""
super().__init__(**kwargs)
Expand Down Expand Up @@ -196,9 +196,9 @@ def __init__(
:type display_name: Optional[str], optional
:param prompt: The context about the key that may include how to find and format it., defaults to None
:type prompt: Optional[str], optional
:param type: The type of the field. It include but is not limited to string, float, date, enum, and multiSelect., defaults to None
:param type: The type of the field. It can include but is not limited to `string`, `float`, `date`, `enum`, and `multiSelect`., defaults to None
:type type: Optional[str], optional
:param options: A list of options for this field. This is most often used in combination with the enum and multiSelect field types., defaults to None
:param options: A list of options for this field. This is most often used in combination with the `enum` and `multiSelect` field types., defaults to None
:type options: Optional[List[CreateAiExtractStructuredFieldsOptionsField]], optional
"""
super().__init__(**kwargs)
Expand Down Expand Up @@ -425,9 +425,9 @@ def create_ai_extract_structured(
*,
metadata_template: Optional[CreateAiExtractStructuredMetadataTemplate] = None,
fields: Optional[List[CreateAiExtractStructuredFields]] = None,
ai_agent: Optional[AiExtractStructuredAgent] = None,
include_confidence_score: Optional[bool] = None,
include_reference: Optional[bool] = None,
ai_agent: Optional[AiExtractStructuredAgent] = None,
extra_headers: Optional[Dict[str, Optional[str]]] = None
) -> AiExtractStructuredResponse:
"""
Expand Down Expand Up @@ -465,9 +465,9 @@ def create_ai_extract_structured(
'items': items,
'metadata_template': metadata_template,
'fields': fields,
'ai_agent': ai_agent,
'include_confidence_score': include_confidence_score,
'include_reference': include_reference,
'ai_agent': ai_agent,
}
headers_map: Dict[str, str] = prepare_params({**extra_headers})
response: FetchResponse = self.network_session.network_client.fetch(
Expand Down
12 changes: 12 additions & 0 deletions box_sdk_gen/managers/retention_policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,20 @@

from box_sdk_gen.networking.fetch_options import ResponseFormat

from box_sdk_gen.schemas.retention_policy_max_extension_length_request import (
RetentionPolicyMaxExtensionLengthRequestEnum,
)

from box_sdk_gen.schemas.retention_policies import RetentionPolicies

from box_sdk_gen.schemas.client_error import ClientError

from box_sdk_gen.schemas.retention_policy import RetentionPolicy

from box_sdk_gen.schemas.retention_policy_max_extension_length_request import (
RetentionPolicyMaxExtensionLengthRequest,
)

from box_sdk_gen.schemas.user_mini import UserMini

from box_sdk_gen.schemas.user_base import UserBase
Expand Down Expand Up @@ -157,6 +165,7 @@ def create_retention_policy(
retention_length: Optional[Union[str, int]] = None,
retention_type: Optional[CreateRetentionPolicyRetentionType] = None,
can_owner_extend_retention: Optional[bool] = None,
max_extension_length: Optional[RetentionPolicyMaxExtensionLengthRequest] = None,
are_owners_notified: Optional[bool] = None,
custom_notification_recipients: Optional[List[UserMini]] = None,
extra_headers: Optional[Dict[str, Optional[str]]] = None
Expand Down Expand Up @@ -225,6 +234,7 @@ def create_retention_policy(
'retention_length': retention_length,
'retention_type': retention_type,
'can_owner_extend_retention': can_owner_extend_retention,
'max_extension_length': max_extension_length,
'are_owners_notified': are_owners_notified,
'custom_notification_recipients': custom_notification_recipients,
}
Expand Down Expand Up @@ -304,6 +314,7 @@ def update_retention_policy_by_id(
retention_length: Optional[Union[str, int]] = None,
status: Union[Optional[str], NullValue] = None,
can_owner_extend_retention: Union[Optional[bool], NullValue] = None,
max_extension_length: Optional[RetentionPolicyMaxExtensionLengthRequest] = None,
are_owners_notified: Union[Optional[bool], NullValue] = None,
custom_notification_recipients: Union[
Optional[List[UserBase]], NullValue
Expand Down Expand Up @@ -383,6 +394,7 @@ def update_retention_policy_by_id(
'retention_length': retention_length,
'status': status,
'can_owner_extend_retention': can_owner_extend_retention,
'max_extension_length': max_extension_length,
'are_owners_notified': are_owners_notified,
'custom_notification_recipients': custom_notification_recipients,
}
Expand Down
5 changes: 2 additions & 3 deletions box_sdk_gen/managers/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ def delete_user_by_id(
"""
Deletes a user. By default, this operation fails if the user

still owns any content, was recently active, or recently joined the enterprise from a free account.
still owns any content.


To proceed, move their owned content first, or use the `force` parameter to delete
Expand All @@ -669,8 +669,7 @@ def delete_user_by_id(
:param notify: Whether the user will receive email notification of
the deletion., defaults to None
:type notify: Optional[bool], optional
:param force: Specifies whether to delete the user even if they still own files,
were recently active, or recently joined the enterprise from a free account., defaults to None
:param force: Specifies whether to delete the user even if they still own files., defaults to None
:type force: Optional[bool], 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
Expand Down
4 changes: 4 additions & 0 deletions box_sdk_gen/schemas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@

from box_sdk_gen.schemas.retention_policy_base import *

from box_sdk_gen.schemas.retention_policy_max_extension_length_request import *

from box_sdk_gen.schemas.retention_policy_max_extension_length_response import *

from box_sdk_gen.schemas.retention_policy_mini import *

from box_sdk_gen.schemas.file_version_retention import *
Expand Down
10 changes: 5 additions & 5 deletions box_sdk_gen/schemas/ai_extract_structured.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def __init__(
class AiExtractStructuredFieldsOptionsField(BaseObject):
def __init__(self, key: str, **kwargs):
"""
:param key: A unique identifier for the field.
:param key: A unique identifier for the option.
:type key: str
"""
super().__init__(**kwargs)
Expand Down Expand Up @@ -93,9 +93,9 @@ def __init__(
:type display_name: Optional[str], optional
:param prompt: The context about the key that may include how to find and format it., defaults to None
:type prompt: Optional[str], optional
:param type: The type of the field. It include but is not limited to string, float, date, enum, and multiSelect., defaults to None
:param type: The type of the field. It can include but is not limited to `string`, `float`, `date`, `enum`, and `multiSelect`., defaults to None
:type type: Optional[str], optional
:param options: A list of options for this field. This is most often used in combination with the enum and multiSelect field types., defaults to None
:param options: A list of options for this field. This is most often used in combination with the `enum` and `multiSelect` field types., defaults to None
:type options: Optional[List[AiExtractStructuredFieldsOptionsField]], optional
"""
super().__init__(**kwargs)
Expand All @@ -114,9 +114,9 @@ def __init__(
*,
metadata_template: Optional[AiExtractStructuredMetadataTemplateField] = None,
fields: Optional[List[AiExtractStructuredFieldsField]] = None,
ai_agent: Optional[AiExtractStructuredAgent] = None,
include_confidence_score: Optional[bool] = None,
include_reference: Optional[bool] = None,
ai_agent: Optional[AiExtractStructuredAgent] = None,
**kwargs
):
"""
Expand All @@ -137,6 +137,6 @@ def __init__(
self.items = items
self.metadata_template = metadata_template
self.fields = fields
self.ai_agent = ai_agent
self.include_confidence_score = include_confidence_score
self.include_reference = include_reference
self.ai_agent = ai_agent
12 changes: 12 additions & 0 deletions box_sdk_gen/schemas/retention_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
RetentionPolicyMiniDispositionActionField,
)

from box_sdk_gen.schemas.retention_policy_max_extension_length_response import (
RetentionPolicyMaxExtensionLengthResponseEnum,
)

from box_sdk_gen.schemas.retention_policy_max_extension_length_response import (
RetentionPolicyMaxExtensionLengthResponse,
)

from box_sdk_gen.schemas.retention_policy_mini import RetentionPolicyMini

from box_sdk_gen.schemas.user_mini import UserMini
Expand Down Expand Up @@ -82,6 +90,9 @@ def __init__(
policy_name: Optional[str] = None,
retention_length: Optional[str] = None,
disposition_action: Optional[RetentionPolicyMiniDispositionActionField] = None,
max_extension_length: Optional[
RetentionPolicyMaxExtensionLengthResponse
] = None,
type: RetentionPolicyBaseTypeField = RetentionPolicyBaseTypeField.RETENTION_POLICY,
**kwargs
):
Expand Down Expand Up @@ -159,6 +170,7 @@ def __init__(
policy_name=policy_name,
retention_length=retention_length,
disposition_action=disposition_action,
max_extension_length=max_extension_length,
type=type,
**kwargs
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from enum import Enum

from typing import Union

from box_sdk_gen.box.errors import BoxSDKError


class RetentionPolicyMaxExtensionLengthRequestEnum(str, Enum):
NONE = 'none'


RetentionPolicyMaxExtensionLengthRequest = Union[
RetentionPolicyMaxExtensionLengthRequestEnum, str, int
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from enum import Enum

from typing import Union

from box_sdk_gen.box.errors import BoxSDKError


class RetentionPolicyMaxExtensionLengthResponseEnum(str, Enum):
NONE = 'none'


RetentionPolicyMaxExtensionLengthResponse = Union[
RetentionPolicyMaxExtensionLengthResponseEnum, str
]
12 changes: 12 additions & 0 deletions box_sdk_gen/schemas/retention_policy_mini.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@

from box_sdk_gen.schemas.retention_policy_base import RetentionPolicyBaseTypeField

from box_sdk_gen.schemas.retention_policy_max_extension_length_response import (
RetentionPolicyMaxExtensionLengthResponseEnum,
)

from box_sdk_gen.schemas.retention_policy_base import RetentionPolicyBase

from box_sdk_gen.schemas.retention_policy_max_extension_length_response import (
RetentionPolicyMaxExtensionLengthResponse,
)

from box_sdk_gen.box.errors import BoxSDKError


Expand All @@ -24,6 +32,9 @@ def __init__(
policy_name: Optional[str] = None,
retention_length: Optional[str] = None,
disposition_action: Optional[RetentionPolicyMiniDispositionActionField] = None,
max_extension_length: Optional[
RetentionPolicyMaxExtensionLengthResponse
] = None,
type: RetentionPolicyBaseTypeField = RetentionPolicyBaseTypeField.RETENTION_POLICY,
**kwargs
):
Expand Down Expand Up @@ -54,3 +65,4 @@ def __init__(
self.policy_name = policy_name
self.retention_length = retention_length
self.disposition_action = disposition_action
self.max_extension_length = max_extension_length
4 changes: 2 additions & 2 deletions docs/ai.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ client.ai.create_ai_extract_structured(
],
),
],
include_confidence_score=True,
ai_agent=ai_extract_structured_agent_basic_text_config,
include_confidence_score=True,
)
```

Expand All @@ -259,11 +259,11 @@ client.ai.create_ai_extract_structured(
- The metadata template containing the fields to extract. For your request to work, you must provide either `metadata_template` or `fields`, but not both.
- fields `Optional[List[CreateAiExtractStructuredFields]]`
- The fields to be extracted from the provided items. For your request to work, you must provide either `metadata_template` or `fields`, but not both.
- ai_agent `Optional[AiExtractStructuredAgent]`
- include_confidence_score `Optional[bool]`
- A flag to indicate whether confidence scores for every extracted field should be returned.
- include_reference `Optional[bool]`
- A flag to indicate whether references for every extracted field should be returned.
- ai_agent `Optional[AiExtractStructuredAgent]`
- extra_headers `Optional[Dict[str, Optional[str]]]`
- Extra headers that will be included in the HTTP request.

Expand Down
2 changes: 2 additions & 0 deletions docs/retention_policies.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ client.retention_policies.create_retention_policy(
- 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.
- can_owner_extend_retention `Optional[bool]`
- Whether the owner of a file will be allowed to extend the retention.
- max_extension_length `Optional[RetentionPolicyMaxExtensionLengthRequest]`
- are_owners_notified `Optional[bool]`
- Whether owner and co-owners of a file are notified when the policy nears expiration.
- custom_notification_recipients `Optional[List[UserMini]]`
Expand Down Expand Up @@ -162,6 +163,7 @@ client.retention_policies.update_retention_policy_by_id(
- Used to retire a retention policy. If not retiring a policy, do not include this parameter or set it to `null`.
- can_owner_extend_retention `Optional[bool]`
- Determines if the owner of items under the policy can extend the retention when the original retention duration is about to end.
- max_extension_length `Optional[RetentionPolicyMaxExtensionLengthRequest]`
- are_owners_notified `Optional[bool]`
- Determines if owners and co-owners of items under the policy are notified when the retention duration is about to end.
- custom_notification_recipients `Optional[List[UserBase]]`
Expand Down
4 changes: 2 additions & 2 deletions docs/users.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ Returns the updated user object.
## Delete user

Deletes a user. By default, this operation fails if the user
still owns any content, was recently active, or recently joined the enterprise from a free account.
still owns any content.
To proceed, move their owned content first, or use the `force` parameter to delete
the user and their files.

Expand All @@ -301,7 +301,7 @@ client.users.delete_user_by_id(user.id)
- notify `Optional[bool]`
- Whether the user will receive email notification of the deletion.
- force `Optional[bool]`
- Specifies whether to delete the user even if they still own files, were recently active, or recently joined the enterprise from a free account.
- Specifies whether to delete the user even if they still own files.
- extra_headers `Optional[Dict[str, Optional[str]]]`
- Extra headers that will be included in the HTTP request.

Expand Down
2 changes: 1 addition & 1 deletion test/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ def testAIExtractStructuredWithFields():
],
),
],
include_confidence_score=True,
ai_agent=ai_extract_structured_agent_basic_text_config,
include_confidence_score=True,
)
assert not response.confidence_score == None
assert to_string(response.answer.get('hobby')) == to_string(['guitar'])
Expand Down
Loading