diff --git a/.codegen.json b/.codegen.json index 77730fb..f3353ce 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "36bf5da", "specHash": "a8c36df", "version": "0.6.4" } +{ "engineHash": "36bf5da", "specHash": "f7e92ba", "version": "0.6.4" } diff --git a/box_sdk_gen/managers/events.py b/box_sdk_gen/managers/events.py index 7dedf77..7b9a3e5 100644 --- a/box_sdk_gen/managers/events.py +++ b/box_sdk_gen/managers/events.py @@ -100,6 +100,7 @@ class GetEventsEventType(str, Enum): GROUP_EDITED = 'GROUP_EDITED' GROUP_REMOVE_ITEM = 'GROUP_REMOVE_ITEM' GROUP_REMOVE_USER = 'GROUP_REMOVE_USER' + ITEM_EMAIL_SEND = 'ITEM_EMAIL_SEND' ITEM_MODIFY = 'ITEM_MODIFY' ITEM_OPEN = 'ITEM_OPEN' ITEM_SHARED_UPDATE = 'ITEM_SHARED_UPDATE' @@ -127,6 +128,7 @@ class GetEventsEventType(str, Enum): RENAME = 'RENAME' RETENTION_POLICY_ASSIGNMENT_ADD = 'RETENTION_POLICY_ASSIGNMENT_ADD' SHARE = 'SHARE' + SHARED_LINK_SEND = 'SHARED_LINK_SEND' SHARE_EXPIRATION = 'SHARE_EXPIRATION' SHIELD_ALERT = 'SHIELD_ALERT' SHIELD_EXTERNAL_COLLAB_ACCESS_BLOCKED = 'SHIELD_EXTERNAL_COLLAB_ACCESS_BLOCKED' diff --git a/box_sdk_gen/managers/search.py b/box_sdk_gen/managers/search.py index d337c34..ac7d94d 100644 --- a/box_sdk_gen/managers/search.py +++ b/box_sdk_gen/managers/search.py @@ -428,14 +428,9 @@ def search_for_content( the trash * `all_items` - Searches for both trashed and non-trashed items., defaults to None :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 contains a list of 1 metadata template to filter - the search results by. This list can currently only - contain one entry, though this might be expanded in the future. - - This parameter is required unless the `query` parameter is provided., defaults to None + :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 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 diff --git a/box_sdk_gen/schemas.py b/box_sdk_gen/schemas.py index 3d14a58..e5b1780 100644 --- a/box_sdk_gen/schemas.py +++ b/box_sdk_gen/schemas.py @@ -9173,6 +9173,7 @@ class EventEventTypeField(str, Enum): ITEM_COPY = 'ITEM_COPY' ITEM_CREATE = 'ITEM_CREATE' ITEM_DOWNLOAD = 'ITEM_DOWNLOAD' + ITEM_EMAIL_SEND = 'ITEM_EMAIL_SEND' ITEM_MAKE_CURRENT_VERSION = 'ITEM_MAKE_CURRENT_VERSION' ITEM_MODIFY = 'ITEM_MODIFY' ITEM_MOVE = 'ITEM_MOVE' @@ -9213,6 +9214,7 @@ class EventEventTypeField(str, Enum): RENAME = 'RENAME' RETENTION_POLICY_ASSIGNMENT_ADD = 'RETENTION_POLICY_ASSIGNMENT_ADD' SHARE = 'SHARE' + SHARED_LINK_SEND = 'SHARED_LINK_SEND' SHARE_EXPIRATION = 'SHARE_EXPIRATION' SHIELD_ALERT = 'SHIELD_ALERT' SHIELD_EXTERNAL_COLLAB_ACCESS_BLOCKED = 'SHIELD_EXTERNAL_COLLAB_ACCESS_BLOCKED' @@ -12913,7 +12915,7 @@ def __init__( self.entries = entries -class MetadataFieldFilterFloatRangeValue(BaseObject): +class MetadataFieldFilterFloatRange(BaseObject): def __init__( self, *, lt: Optional[float] = None, gt: Optional[float] = None, **kwargs ): @@ -12934,7 +12936,7 @@ def __init__( self.gt = gt -class MetadataFieldFilterDateRangeValue(BaseObject): +class MetadataFieldFilterDateRange(BaseObject): def __init__( self, *, lt: Optional[DateTime] = None, gt: Optional[DateTime] = None, **kwargs ): @@ -12977,12 +12979,15 @@ def __init__( scope: Optional[MetadataFilterScopeField] = None, template_key: Optional[str] = None, filters: Optional[ - Union[ - Dict[str, str], - Dict[str, float], - Dict[str, List[str]], - Dict[str, MetadataFieldFilterFloatRangeValue], - Dict[str, MetadataFieldFilterDateRangeValue], + Dict[ + str, + Union[ + str, + float, + List[str], + MetadataFieldFilterFloatRange, + MetadataFieldFilterDateRange, + ], ] ] = None, **kwargs @@ -12994,7 +12999,7 @@ def __init__( for use in this enterprise, and `global` for general templates that are available to all enterprises using Box., defaults to None :type scope: Optional[MetadataFilterScopeField], optional - :param template_key: The key of the template to filter search results by. + :param template_key: The key of the template used to filter search results. In many cases the template key is automatically derived of its display name, for example `Contract Template` would @@ -13009,6 +13014,11 @@ def __init__( [file]: e://get-files-id-metadata [folder]: e://get-folders-id-metadata, defaults to None :type template_key: Optional[str], optional + :param filters: Specifies which fields on the template to filter the search + results by. When more than one field is specified, the query + performs a logical `AND` to ensure that the instance of the + template matches each of the fields specified., defaults to None + :type filters: Optional[Dict[str, Union[str, float, List[str], MetadataFieldFilterFloatRange, MetadataFieldFilterDateRange]]], optional """ super().__init__(**kwargs) self.scope = scope diff --git a/docs/search.md b/docs/search.md index ce6df20..9566c64 100644 --- a/docs/search.md +++ b/docs/search.md @@ -63,7 +63,7 @@ See the endpoint docs at ```python -client.search.search_for_content(ancestor_folder_ids=['0'], mdfilters=[MetadataFilter(filters={'stringField': 'stringValue', 'dateField': {}(lt=date_time_from_string('2035-01-01T00:00:00Z'), gt=date_time_from_string('2035-01-03T00:00:00Z')), 'floatField': {}(lt=9.5, gt=10.5), 'enumField': 'enumValue2', 'multiSelectField': ['multiSelectValue1', 'multiSelectValue2']}, scope=MetadataFilterScopeField.ENTERPRISE.value, template_key=template_key)]) +client.search.search_for_content(ancestor_folder_ids=['0'], mdfilters=[MetadataFilter(filters={'stringField': 'stringValue', 'dateField': MetadataFieldFilterDateRange(lt=date_time_from_string('2035-01-01T00:00:00Z'), gt=date_time_from_string('2035-01-03T00:00:00Z')), 'floatField': MetadataFieldFilterFloatRange(lt=9.5, gt=10.5), 'enumField': 'enumValue2', 'multiSelectField': ['multiSelectValue1', 'multiSelectValue2']}, scope=MetadataFilterScopeField.ENTERPRISE.value, template_key=template_key)]) ``` ### Arguments @@ -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 contains a list of 1 metadata template to filter the search results by. This list can currently only contain one entry, though this might be expanded in the future. This parameter is required 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]` diff --git a/test/search.py b/test/search.py index c385e2c..8512c20 100644 --- a/test/search.py +++ b/test/search.py @@ -189,11 +189,11 @@ def testMetadataFilters(): MetadataFilter( filters={ 'stringField': 'stringValue', - 'dateField': {}( + 'dateField': MetadataFieldFilterDateRange( lt=date_time_from_string('2035-01-01T00:00:00Z'), gt=date_time_from_string('2035-01-03T00:00:00Z'), ), - 'floatField': {}(lt=9.5, gt=10.5), + 'floatField': MetadataFieldFilterFloatRange(lt=9.5, gt=10.5), 'enumField': 'enumValue2', 'multiSelectField': ['multiSelectValue1', 'multiSelectValue2'], },