Skip to content

Commit 6df014e

Browse files
fix(boxsdkgen): Align LegalHoldPolicyAssignedItem with API (box/box-openapi#1554) (box/box-openapi#590) (#1366)
1 parent 54b669e commit 6df014e

File tree

6 files changed

+47
-23
lines changed

6 files changed

+47
-23
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "7c01dda", "specHash": "2bd751f", "version": "4.5.0" }
1+
{ "engineHash": "7c01dda", "specHash": "74a1e4a", "version": "4.5.0" }

box_sdk_gen/managers/trashed_items.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ def get_trashed_items(
9292
9393
marker-based pagination using the `marker` parameter.
9494
95+
96+
The number of entries returned may be less than `total_count`. For example, if a user deletes items from a shared folder and is later removed as a collaborator, those deleted items will no longer appear in this endpoint’s results, even though they are still included in `total_count`.
97+
9598
:param fields: A comma-separated list of attributes to include in the
9699
response. This can be used to request fields that are
97100
not normally returned in a standard response.

box_sdk_gen/schemas/__init__.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@
188188

189189
from box_sdk_gen.schemas.legal_hold_policy_mini import *
190190

191+
from box_sdk_gen.schemas.legal_hold_policy_assigned_item import *
192+
191193
from box_sdk_gen.schemas.legal_hold_policy_assignment_base import *
192194

193195
from box_sdk_gen.schemas.metadata_base import *
@@ -414,6 +416,14 @@
414416

415417
from box_sdk_gen.schemas.retention_policies import *
416418

419+
from box_sdk_gen.schemas.legal_hold_policy_assignment import *
420+
421+
from box_sdk_gen.schemas.legal_hold_policy_assignments import *
422+
423+
from box_sdk_gen.schemas.file_version_legal_hold import *
424+
425+
from box_sdk_gen.schemas.file_version_legal_holds import *
426+
417427
from box_sdk_gen.schemas.legal_hold_policy import *
418428

419429
from box_sdk_gen.schemas.legal_hold_policies import *
@@ -520,16 +530,6 @@
520530

521531
from box_sdk_gen.schemas.folder import *
522532

523-
from box_sdk_gen.schemas.legal_hold_policy_assigned_item import *
524-
525-
from box_sdk_gen.schemas.legal_hold_policy_assignment import *
526-
527-
from box_sdk_gen.schemas.legal_hold_policy_assignments import *
528-
529-
from box_sdk_gen.schemas.file_version_legal_hold import *
530-
531-
from box_sdk_gen.schemas.file_version_legal_holds import *
532-
533533
from box_sdk_gen.schemas.folder_full import *
534534

535535
from box_sdk_gen.schemas.search_result_with_shared_link_item import *
Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,36 @@
1-
from typing import Union
1+
from enum import Enum
22

3-
from box_sdk_gen.schemas.file import File
3+
from box_sdk_gen.internal.base_object import BaseObject
44

5-
from box_sdk_gen.schemas.folder import Folder
5+
from box_sdk_gen.box.errors import BoxSDKError
66

7-
from box_sdk_gen.schemas.web_link import WebLink
87

9-
from box_sdk_gen.box.errors import BoxSDKError
8+
class LegalHoldPolicyAssignedItemTypeField(str, Enum):
9+
FILE = 'file'
10+
FILE_VERSION = 'file_version'
11+
FOLDER = 'folder'
12+
USER = 'user'
13+
OWNERSHIP = 'ownership'
14+
INTERACTIONS = 'interactions'
15+
16+
17+
class LegalHoldPolicyAssignedItem(BaseObject):
18+
_discriminator = 'type', {
19+
'file',
20+
'file_version',
21+
'folder',
22+
'user',
23+
'ownership',
24+
'interactions',
25+
}
1026

11-
LegalHoldPolicyAssignedItem = Union[File, Folder, WebLink]
27+
def __init__(self, type: LegalHoldPolicyAssignedItemTypeField, id: str, **kwargs):
28+
"""
29+
:param type: The type of item the policy is assigned to.
30+
:type type: LegalHoldPolicyAssignedItemTypeField
31+
:param id: The ID of the item the policy is assigned to.
32+
:type id: str
33+
"""
34+
super().__init__(**kwargs)
35+
self.type = type
36+
self.id = id

box_sdk_gen/schemas/legal_hold_policy_assignment.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
LegalHoldPolicyAssignmentBaseTypeField,
55
)
66

7-
from box_sdk_gen.schemas.file import File
8-
9-
from box_sdk_gen.schemas.folder import Folder
10-
11-
from box_sdk_gen.schemas.web_link import WebLink
12-
137
from box_sdk_gen.schemas.legal_hold_policy_assignment_base import (
148
LegalHoldPolicyAssignmentBase,
159
)

docs/box_sdk_gen/trashed_items.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ attributes that are not returned by default.
1414
This endpoint defaults to use offset-based pagination, yet also supports
1515
marker-based pagination using the `marker` parameter.
1616

17+
The number of entries returned may be less than `total_count`. For example, if a user deletes items from a shared folder and is later removed as a collaborator, those deleted items will no longer appear in this endpoint’s results, even though they are still included in `total_count`.
18+
1719
This operation is performed by calling function `get_trashed_items`.
1820

1921
See the endpoint docs at

0 commit comments

Comments
 (0)