Skip to content

Commit

Permalink
add support for filter_entity_type on transfer client endpoint search
Browse files Browse the repository at this point in the history
Added a new keyword argument to TransferClient.endpoint_search() that
supports filtering by the collection entity type. Updated
filter_non_functional argument to indicate its mutual exclusivity
with filter_entity_type.

refs sc-37389
  • Loading branch information
pjhinton-globus committed Nov 12, 2024
1 parent 81446cd commit a1df63c
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
..
.. A new scriv changelog fragment
..
.. Uncomment the header that is right (remove the leading dots).
..
.. Leave the "(:pr:`...`)" text in your change description.
.. GitHub Actions will automatically replace it when the PR is merged.
..
.. Python Support
.. ~~~~~~~~~~~~~~
..
.. - A bullet item for the Python Support category. (:pr:`NUMBER`)
..
.. Added
.. ~~~~~
..
- Add `filter_entity_type` keyword argument on `TransferClient.endpoint_search()`. (:pr:`NUMBER`)
..
.. Removed
.. ~~~~~~~
..
.. - A bullet item for the Removed category. (:pr:`NUMBER`)
..
.. Changed
.. ~~~~~~~
..
.. - A bullet item for the Changed category. (:pr:`NUMBER`)
..
.. Deprecated
.. ~~~~~~~~~~
..
.. - A bullet item for the Deprecated category. (:pr:`NUMBER`)
..
.. Fixed
.. ~~~~~
..
.. - A bullet item for the Fixed category. (:pr:`NUMBER`)
..
.. Documentation
.. ~~~~~~~~~~~~~
..
.. - A bullet item for the Documentation category. (:pr:`NUMBER`)
..
.. Security
.. ~~~~~~~~
..
.. - A bullet item for the Security category. (:pr:`NUMBER`)
..
.. Development
.. ~~~~~~~~~~~
..
.. - A bullet item for the Development category. (:pr:`NUMBER`)
..
8 changes: 7 additions & 1 deletion src/globus_sdk/services/transfer/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ def endpoint_search(
filter_owner_id: str | None = None,
filter_host_endpoint: UUIDLike | None = None,
filter_non_functional: bool | None = None,
filter_entity_type: str | None = None,
limit: int | None = None,
offset: int | None = None,
query_params: dict[str, t.Any] | None = None,
Expand All @@ -411,7 +412,10 @@ def endpoint_search(
endpoint. May cause BadRequest or PermissionDenied errors if the endpoint ID
given is not valid for this operation.
:param filter_non_functional: Limit search to endpoints which have the
'non_functional' flag set to True or False.
'non_functional' flag set to True or False. Mutually exclusive with
``filter_entity_type``.
:param filter_entity_type: Limit search to endpoints or collections by their
entity type. Mutually exclusive with ``filter_non_functional``.
:param limit: limit the number of results
:param offset: offset used in paging
:param query_params: Any additional parameters will be passed through
Expand Down Expand Up @@ -465,6 +469,8 @@ def endpoint_search(
query_params["filter_host_endpoint"] = filter_host_endpoint
if filter_non_functional is not None: # convert to int (expect bool input)
query_params["filter_non_functional"] = 1 if filter_non_functional else 0
if filter_entity_type is not None:
query_params["filter_entity_type"] = filter_entity_type
if limit is not None:
query_params["limit"] = limit
if offset is not None:
Expand Down

0 comments on commit a1df63c

Please sign in to comment.