Skip to content

Commit

Permalink
add quota_source_label to quota creation and update
Browse files Browse the repository at this point in the history
  • Loading branch information
bernt-matthias committed Oct 14, 2024
1 parent 062a3c9 commit 9bbd9a9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions bioblend/galaxy/quotas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def create_quota(
amount: str,
operation: QuotaOperations,
default: Optional[DefaultQuotaValues] = "no",
quota_source_label: Optional[str] = None,
in_users: Optional[List[str]] = None,
in_groups: Optional[List[str]] = None,
) -> Dict[str, Any]:
Expand All @@ -105,6 +106,9 @@ def create_quota(
are "no", "unregistered", "registered" and None. None is
equivalent to "no".
:type quota_source_label: str
:param quota_source_label: If set, quota source label to apply this quota operation to. Otherwise, the default quota is used.
:type in_users: list of str
:param in_users: A list of user IDs or user emails.
Expand All @@ -127,6 +131,7 @@ def create_quota(
"amount": amount,
"operation": operation,
"default": default,
"quota_source_label": quota_source_label,
}
if in_users:
payload["in_users"] = in_users
Expand All @@ -144,6 +149,7 @@ def update_quota(
amount: Optional[str] = None,
operation: Optional[QuotaOperations] = "=",
default: Optional[DefaultQuotaValues] = None,
quota_source_label: Optional[str] = None,
in_users: Optional[List[str]] = None,
in_groups: Optional[List[str]] = None,
) -> str:
Expand Down Expand Up @@ -175,6 +181,11 @@ def update_quota(
non-default quota will throw an error. Passing None is
equivalent to not changing the current status.
:type default: str
:param default: Whether or not this is a default quota. Valid values
are "no", "unregistered", "registered" and None. None is
equivalent to "no".
:type in_users: list of str
:param in_users: A list of user IDs or user emails.
Expand All @@ -200,6 +211,9 @@ def update_quota(
if operation:
payload["operation"] = operation

if quota_source_label:
payload["quota_source_label"] = quota_source_label

if in_users:
payload["in_users"] = in_users

Expand Down

0 comments on commit 9bbd9a9

Please sign in to comment.