Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add missing marker pagination fields and introduce new event type AppItemEventSource (box/box-openapi#431) #189

Merged
merged 1 commit into from
Jun 11, 2024
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": "3ed6b56", "specHash": "c3c012c", "version": "1.0.0" }
{ "engineHash": "3ed6b56", "specHash": "5e023b9", "version": "1.0.0" }
24 changes: 24 additions & 0 deletions box_sdk_gen/managers/file_version_retentions.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ def get_file_version_retentions(
) -> FileVersionRetentions:
"""
Retrieves all file version retentions for the given enterprise.

**Note**:


File retention API is now **deprecated**.


To get information about files and file versions under retention,


see [files under retention](e://get-retention-policy-assignments-id-files-under-retention) or [file versions under retention](e://get-retention-policy-assignments-id-file-versions-under-retention) endpoints.

:param file_id: Filters results by files with this ID., defaults to None
:type file_id: Optional[str], optional
:param file_version_id: Filters results by file versions with this ID., defaults to None
Expand Down Expand Up @@ -133,6 +145,18 @@ def get_file_version_retention_by_id(
) -> FileVersionRetention:
"""
Returns information about a file version retention.

**Note**:


File retention API is now **deprecated**.


To get information about files and file versions under retention,


see [files under retention](e://get-retention-policy-assignments-id-files-under-retention) or [file versions under retention](e://get-retention-policy-assignments-id-file-versions-under-retention) endpoints.

:param file_version_retention_id: The ID of the file version retention
Example: "3424234"
:type file_version_retention_id: str
Expand Down
2 changes: 2 additions & 0 deletions box_sdk_gen/schemas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@

from box_sdk_gen.schemas.user_mini import *

from box_sdk_gen.schemas.app_item_event_source import *

from box_sdk_gen.schemas.event_source import *

from box_sdk_gen.schemas.user import *
Expand Down
43 changes: 43 additions & 0 deletions box_sdk_gen/schemas/app_item_event_source.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from enum import Enum

from typing import Optional

from box_sdk_gen.internal.base_object import BaseObject

from box_sdk_gen.schemas.user_mini import UserMini

from box_sdk_gen.schemas.group_mini import GroupMini


class AppItemEventSourceTypeField(str, Enum):
APP_ITEM = 'app_item'


class AppItemEventSource(BaseObject):
_discriminator = 'type', {'app_item'}

def __init__(
self,
id: str,
app_item_type: str,
*,
type: AppItemEventSourceTypeField = AppItemEventSourceTypeField.APP_ITEM.value,
user: Optional[UserMini] = None,
group: Optional[GroupMini] = None,
**kwargs
):
"""
:param id: The id of the `AppItem`
:type id: str
:param app_item_type: The type of the `AppItem`
:type app_item_type: str
:param type: The type of the source that this event represents. Can be only `app_item`.
, defaults to AppItemEventSourceTypeField.APP_ITEM.value
:type type: AppItemEventSourceTypeField, optional
"""
super().__init__(**kwargs)
self.id = id
self.app_item_type = app_item_type
self.type = type
self.user = user
self.group = group
20 changes: 14 additions & 6 deletions box_sdk_gen/schemas/collaborations.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,31 @@ class Collaborations(BaseObject):
def __init__(
self,
*,
total_count: Optional[int] = None,
limit: Optional[int] = None,
next_marker: Optional[str] = None,
prev_marker: Optional[str] = None,
total_count: Optional[int] = None,
offset: Optional[int] = None,
order: Optional[List[CollaborationsOrderField]] = None,
entries: Optional[List[Collaboration]] = 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 total_count: One greater than the offset of the last entry in the entire collection.
The total number of entries in the collection may be less than
`total_count`.

This field is only returned for calls that use offset-based pagination.
For marker-based paginated APIs, this field will be omitted., defaults to None
:type total_count: Optional[int], optional
: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 offset: The 0-based offset of the first entry in this set. This will be the same
as the `offset` query parameter.

Expand All @@ -71,8 +77,10 @@ def __init__(
:type entries: Optional[List[Collaboration]], optional
"""
super().__init__(**kwargs)
self.total_count = total_count
self.limit = limit
self.next_marker = next_marker
self.prev_marker = prev_marker
self.total_count = total_count
self.offset = offset
self.order = order
self.entries = entries
6 changes: 5 additions & 1 deletion box_sdk_gen/schemas/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

from box_sdk_gen.schemas.folder import Folder

from box_sdk_gen.schemas.app_item_event_source import AppItemEventSource

from box_sdk_gen.internal.utils import DateTime


Expand Down Expand Up @@ -191,7 +193,9 @@ def __init__(
created_by: Optional[UserMini] = None,
event_type: Optional[EventEventTypeField] = None,
session_id: Optional[str] = None,
source: Optional[Union[User, EventSource, File, Folder, Dict]] = None,
source: Optional[
Union[User, EventSource, File, Folder, Dict, AppItemEventSource]
] = None,
additional_details: Optional[EventAdditionalDetailsField] = None,
**kwargs
):
Expand Down
20 changes: 14 additions & 6 deletions box_sdk_gen/schemas/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,31 @@ class Items(BaseObject):
def __init__(
self,
*,
total_count: Optional[int] = None,
limit: Optional[int] = None,
next_marker: Optional[str] = None,
prev_marker: Optional[str] = None,
total_count: Optional[int] = None,
offset: Optional[int] = None,
order: Optional[List[ItemsOrderField]] = None,
entries: Optional[List[Union[FileFull, FolderMini, WebLink]]] = 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 total_count: One greater than the offset of the last entry in the entire collection.
The total number of entries in the collection may be less than
`total_count`.

This field is only returned for calls that use offset-based pagination.
For marker-based paginated APIs, this field will be omitted., defaults to None
:type total_count: Optional[int], optional
: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 offset: The 0-based offset of the first entry in this set. This will be the same
as the `offset` query parameter.

Expand All @@ -77,8 +83,10 @@ def __init__(
:type entries: Optional[List[Union[FileFull, FolderMini, WebLink]]], optional
"""
super().__init__(**kwargs)
self.total_count = total_count
self.limit = limit
self.next_marker = next_marker
self.prev_marker = prev_marker
self.total_count = total_count
self.offset = offset
self.order = order
self.entries = entries
20 changes: 14 additions & 6 deletions box_sdk_gen/schemas/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,31 @@ class Users(BaseObject):
def __init__(
self,
*,
total_count: Optional[int] = None,
limit: Optional[int] = None,
next_marker: Optional[str] = None,
prev_marker: Optional[str] = None,
total_count: Optional[int] = None,
offset: Optional[int] = None,
order: Optional[List[UsersOrderField]] = None,
entries: Optional[List[UserFull]] = 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 total_count: One greater than the offset of the last entry in the entire collection.
The total number of entries in the collection may be less than
`total_count`.

This field is only returned for calls that use offset-based pagination.
For marker-based paginated APIs, this field will be omitted., defaults to None
:type total_count: Optional[int], optional
: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 offset: The 0-based offset of the first entry in this set. This will be the same
as the `offset` query parameter.

Expand All @@ -71,8 +77,10 @@ def __init__(
:type entries: Optional[List[UserFull]], optional
"""
super().__init__(**kwargs)
self.total_count = total_count
self.limit = limit
self.next_marker = next_marker
self.prev_marker = prev_marker
self.total_count = total_count
self.offset = offset
self.order = order
self.entries = entries
10 changes: 10 additions & 0 deletions docs/file_version_retentions.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

Retrieves all file version retentions for the given enterprise.

**Note**:
File retention API is now **deprecated**.
To get information about files and file versions under retention,
see [files under retention](e://get-retention-policy-assignments-id-files-under-retention) or [file versions under retention](e://get-retention-policy-assignments-id-file-versions-under-retention) endpoints.

This operation is performed by calling function `get_file_version_retentions`.

See the endpoint docs at
Expand Down Expand Up @@ -49,6 +54,11 @@ Returns a list of all file version retentions for the enterprise.

Returns information about a file version retention.

**Note**:
File retention API is now **deprecated**.
To get information about files and file versions under retention,
see [files under retention](e://get-retention-policy-assignments-id-files-under-retention) or [file versions under retention](e://get-retention-policy-assignments-id-file-versions-under-retention) endpoints.

This operation is performed by calling function `get_file_version_retention_by_id`.

See the endpoint docs at
Expand Down
Loading