Skip to content

Commit

Permalink
fix: Fix schemas for updating classification on a file and folder (bo…
Browse files Browse the repository at this point in the history
  • Loading branch information
box-sdk-build committed May 14, 2024
1 parent edaa076 commit f3ec8c6
Show file tree
Hide file tree
Showing 12 changed files with 103 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "c8ba3d9", "specHash": "d5769a1", "version": "0.6.5" }
{ "engineHash": "c8ba3d9", "specHash": "98bca8f", "version": "0.6.5" }
10 changes: 6 additions & 4 deletions box_sdk_gen/managers/legal_hold_policy_assignments.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@

from box_sdk_gen.schemas.legal_hold_policy_assignment import LegalHoldPolicyAssignment

from box_sdk_gen.schemas.file_version_legal_holds import FileVersionLegalHolds
from box_sdk_gen.schemas.files_on_hold import FilesOnHold

from box_sdk_gen.schemas.file_versions_on_hold import FileVersionsOnHold

from box_sdk_gen.networking.auth import Authentication

Expand Down Expand Up @@ -281,9 +283,9 @@ def get_legal_hold_policy_assignment_file_on_hold(
limit: Optional[int] = None,
fields: Optional[List[str]] = None,
extra_headers: Optional[Dict[str, Optional[str]]] = None
) -> FileVersionLegalHolds:
) -> FilesOnHold:
"""
Get a list of current file versions for a legal hold
Get a list of files with current file versions for a legal hold
assignment.
Expand Down Expand Up @@ -371,4 +373,4 @@ def get_legal_hold_policy_assignment_file_on_hold(
network_session=self.network_session,
),
)
return deserialize(response.data, FileVersionLegalHolds)
return deserialize(response.data, FilesOnHold)
2 changes: 1 addition & 1 deletion box_sdk_gen/managers/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def search_for_content(
:type trash_content: Optional[SearchForContentTrashContent], optional
:param mdfilters: Limits the search results to any items for which the metadata matches the provided filter.
This parameter is a list that specifies exactly **one** metadata template used to filter the search results.
It unless the `query` parameter is provided., defaults to None
It is required unless the `query` parameter is provided., defaults to None
:type mdfilters: Optional[List[MetadataFilter]], optional
:param sort: Defines the order in which search results are returned. This API
defaults to returning items by relevance unless this parameter is
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 @@ -50,6 +50,8 @@

from box_sdk_gen.schemas.file_mini import *

from box_sdk_gen.schemas.files_on_hold import *

from box_sdk_gen.schemas.files_under_retention import *

from box_sdk_gen.schemas.file_conflict import *
Expand Down Expand Up @@ -220,6 +222,8 @@

from box_sdk_gen.schemas.file_versions import *

from box_sdk_gen.schemas.file_versions_on_hold import *

from box_sdk_gen.schemas.file_request import *

from box_sdk_gen.schemas.file import *
Expand Down
6 changes: 4 additions & 2 deletions box_sdk_gen/schemas/events.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from typing import Optional

from typing import Union

from typing import List

from box_sdk_gen.internal.base_object import BaseObject
Expand All @@ -12,7 +14,7 @@ def __init__(
self,
*,
chunk_size: Optional[int] = None,
next_stream_position: Optional[str] = None,
next_stream_position: Optional[Union[str, float]] = None,
entries: Optional[List[Event]] = None,
**kwargs
):
Expand All @@ -21,7 +23,7 @@ def __init__(
:type chunk_size: Optional[int], optional
:param next_stream_position: The stream position of the start of the next page (chunk)
of events., defaults to None
:type next_stream_position: Optional[str], optional
:type next_stream_position: Optional[Union[str, float]], optional
:param entries: A list of events, defaults to None
:type entries: Optional[List[Event]], optional
"""
Expand Down
4 changes: 3 additions & 1 deletion box_sdk_gen/schemas/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ def __init__(
for the URL `https://*.app.box.com/files/123`
the `file_id` is `123`.
:type id: str
:param description: The optional description of this file, defaults to None
:param description: The optional description of this file.
If the description exceeds 255 characters, the first 255 characters
are set as a file description and the rest of it is ignored., defaults to None
:type description: Optional[str], optional
:param size: The file size in bytes. Be careful parsing this integer as it can
get very large and cause an integer overflow., defaults to None
Expand Down
4 changes: 3 additions & 1 deletion box_sdk_gen/schemas/file_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,9 @@ def __init__(
:param shared_link_permission_options: A list of the types of roles that user can be invited at
when sharing this file., defaults to None
:type shared_link_permission_options: Optional[List[FileFullSharedLinkPermissionOptionsField]], optional
:param description: The optional description of this file, defaults to None
:param description: The optional description of this file.
If the description exceeds 255 characters, the first 255 characters
are set as a file description and the rest of it is ignored., defaults to None
:type description: Optional[str], optional
:param size: The file size in bytes. Be careful parsing this integer as it can
get very large and cause an integer overflow., defaults to None
Expand Down
36 changes: 36 additions & 0 deletions box_sdk_gen/schemas/file_versions_on_hold.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from typing import Optional

from typing import List

from box_sdk_gen.internal.base_object import BaseObject

from box_sdk_gen.schemas.file_version import FileVersion


class FileVersionsOnHold(BaseObject):
def __init__(
self,
*,
limit: Optional[int] = None,
next_marker: Optional[str] = None,
prev_marker: Optional[str] = None,
entries: Optional[List[FileVersion]] = None,
**kwargs
):
"""
:param limit: The limit that was used for these entries. This will be the same as the
`limit` query parameter unless that value exceeded the maximum value
allowed. The maximum value varies by API., defaults to None
:type limit: Optional[int], optional
:param next_marker: The marker for the start of the next page of results., defaults to None
:type next_marker: Optional[str], optional
:param prev_marker: The marker for the start of the previous page of results., defaults to None
:type prev_marker: Optional[str], optional
:param entries: A list of file versions on hold., defaults to None
:type entries: Optional[List[FileVersion]], optional
"""
super().__init__(**kwargs)
self.limit = limit
self.next_marker = next_marker
self.prev_marker = prev_marker
self.entries = entries
36 changes: 36 additions & 0 deletions box_sdk_gen/schemas/files_on_hold.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from typing import Optional

from typing import List

from box_sdk_gen.internal.base_object import BaseObject

from box_sdk_gen.schemas.file_mini import FileMini


class FilesOnHold(BaseObject):
def __init__(
self,
*,
limit: Optional[int] = None,
next_marker: Optional[str] = None,
prev_marker: Optional[str] = None,
entries: Optional[List[FileMini]] = None,
**kwargs
):
"""
:param limit: The limit that was used for these entries. This will be the same as the
`limit` query parameter unless that value exceeded the maximum value
allowed. The maximum value varies by API., defaults to None
:type limit: Optional[int], optional
:param next_marker: The marker for the start of the next page of results., defaults to None
:type next_marker: Optional[str], optional
:param prev_marker: The marker for the start of the previous page of results., defaults to None
:type prev_marker: Optional[str], optional
:param entries: A list of files, defaults to None
:type entries: Optional[List[FileMini]], optional
"""
super().__init__(**kwargs)
self.limit = limit
self.next_marker = next_marker
self.prev_marker = prev_marker
self.entries = entries
8 changes: 4 additions & 4 deletions box_sdk_gen/schemas/realtime_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ def __init__(
*,
type: Optional[str] = None,
url: Optional[str] = None,
ttl: Optional[int] = None,
max_retries: Optional[int] = None,
ttl: Optional[str] = None,
max_retries: Optional[str] = None,
retry_timeout: Optional[int] = None,
**kwargs
):
Expand All @@ -20,11 +20,11 @@ def __init__(
:param url: The URL for the server., defaults to None
:type url: Optional[str], optional
:param ttl: The time in minutes for which this server is available, defaults to None
:type ttl: Optional[int], optional
:type ttl: Optional[str], optional
:param max_retries: The maximum number of retries this server will
allow before a new long poll should be started by
getting a [new list of server](#options-events)., defaults to None
:type max_retries: Optional[int], optional
:type max_retries: Optional[str], optional
:param retry_timeout: The maximum number of seconds without a response
after which you should retry the long poll connection.
Expand Down
8 changes: 4 additions & 4 deletions docs/legal_hold_policy_assignments.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- [Assign legal hold policy](#assign-legal-hold-policy)
- [Get legal hold policy assignment](#get-legal-hold-policy-assignment)
- [Unassign legal hold policy](#unassign-legal-hold-policy)
- [List current file versions for legal hold policy assignment](#list-current-file-versions-for-legal-hold-policy-assignment)
- [List files with current file versions for legal hold policy assignment](#list-files-with-current-file-versions-for-legal-hold-policy-assignment)

## List legal hold policy assignments

Expand Down Expand Up @@ -134,9 +134,9 @@ This function returns a value of type `None`.
A blank response is returned if the assignment was
successfully deleted.

## List current file versions for legal hold policy assignment
## List files with current file versions for legal hold policy assignment

Get a list of current file versions for a legal hold
Get a list of files with current file versions for a legal hold
assignment.

In some cases you may want to get previous file versions instead. In these
Expand Down Expand Up @@ -175,7 +175,7 @@ _Currently we don't have an example for calling `get_legal_hold_policy_assignmen

### Returns

This function returns a value of type `FileVersionLegalHolds`.
This function returns a value of type `FilesOnHold`.

Returns the list of current file versions held under legal hold for a
specific legal hold policy assignment.
2 changes: 1 addition & 1 deletion docs/search.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ client.search.search_for_content(ancestor_folder_ids=['0'], mdfilters=[MetadataF
- trash_content `Optional[SearchForContentTrashContent]`
- Determines if the search should look in the trash for items. By default, this API only returns search results for items not currently in the trash (`non_trashed_only`). _ `trashed_only` - Only searches for items currently in the trash _ `non_trashed_only` - Only searches for items currently not in the trash \* `all_items` - Searches for both trashed and non-trashed items.
- mdfilters `Optional[List[MetadataFilter]]`
- Limits the search results to any items for which the metadata matches the provided filter. This parameter is a list that specifies exactly **one** metadata template used to filter the search results. It unless the `query` parameter is provided.
- Limits the search results to any items for which the metadata matches the provided filter. This parameter is a list that specifies exactly **one** metadata template used to filter the search results. It is required unless the `query` parameter is provided.
- sort `Optional[SearchForContentSort]`
- Defines the order in which search results are returned. This API defaults to returning items by relevance unless this parameter is explicitly specified. _ `relevance` (default) returns the results sorted by relevance to the query search term. The relevance is based on the occurrence of the search term in the items name, description, content, and additional properties. _ `modified_at` returns the results ordered in descending order by date at which the item was last modified.
- direction `Optional[SearchForContentDirection]`
Expand Down

0 comments on commit f3ec8c6

Please sign in to comment.