Skip to content

Commit

Permalink
Merge pull request #974 from globus/update-flow-subscription_ids-sc-3…
Browse files Browse the repository at this point in the history
…0163

Allow updating subscriptions assigned to flows
  • Loading branch information
kurtmckee authored Apr 8, 2024
2 parents 9ad97ee + 419eb86 commit 3c1718d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Added
~~~~~

- Support updating subscriptions assigned to flows in the Flows service. (:pr:`NUMBER`)
1 change: 1 addition & 0 deletions src/globus_sdk/_testing/data/flows/update_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
_two_hop_transfer_update_request = {
"subtitle": "Specifically, in two steps",
"description": "Transfer from source to destination, stopping off at staging",
"subscription_id": "00000000-3ba7-456e-9df7-fc40028f3331",
}


Expand Down
6 changes: 5 additions & 1 deletion src/globus_sdk/services/flows/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from globus_sdk._types import UUIDLike
from globus_sdk.authorizers import GlobusAuthorizer
from globus_sdk.scopes import ScopeBuilder
from globus_sdk.utils import MISSING, MissingType

from .errors import FlowsAPIError
from .response import (
Expand Down Expand Up @@ -324,6 +325,7 @@ def update_flow(
flow_starters: list[str] | None = None,
flow_administrators: list[str] | None = None,
keywords: list[str] | None = None,
subscription_id: UUIDLike | t.Literal["DEFAULT"] | MissingType = MISSING,
additional_fields: dict[str, t.Any] | None = None,
) -> GlobusHTTPResponse:
"""
Expand Down Expand Up @@ -393,6 +395,7 @@ def update_flow(
:param keywords: A set of terms used to categorize the flow used in query and
discovery operations (0 - 1024 items)
:param subscription_id: A subscription ID to assign to the flow.
:param additional_fields: Additional Key/Value pairs sent to the create API
.. tab-set::
Expand Down Expand Up @@ -433,8 +436,9 @@ def update_flow(
"flow_starters": flow_starters,
"flow_administrators": flow_administrators,
"keywords": keywords,
"subscription_id": subscription_id,
}.items()
if v is not None
if v is not None and v is not MISSING
}
data.update(additional_fields or {})

Expand Down

0 comments on commit 3c1718d

Please sign in to comment.