Skip to content

Commit ab45306

Browse files
committed
chore: add valid choices for account type arguments
1 parent 49f2575 commit ab45306

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

‎samples/audiences/create_user_list.py‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,21 @@ def main(
197197
# Configures logging.
198198
logging.basicConfig(level=logging.INFO)
199199

200+
account_type_choices = [
201+
account_type.name
202+
for account_type in datamanager_v1.ProductAccount.AccountType
203+
if account_type
204+
!= datamanager_v1.ProductAccount.AccountType.ACCOUNT_TYPE_UNSPECIFIED
205+
]
206+
200207
parser = argparse.ArgumentParser(
201208
description="Creates a user list in an operating account.",
202209
fromfile_prefix_chars="@",
203210
)
204211
# The following argument(s) should be provided to run the example.
205212
parser.add_argument(
206213
"--operating_account_type",
207-
type=str,
214+
choices=account_type_choices,
208215
required=True,
209216
help="The account type of the operating account.",
210217
)
@@ -222,7 +229,7 @@ def main(
222229
)
223230
parser.add_argument(
224231
"--login_account_type",
225-
type=str,
232+
choices=account_type_choices,
226233
required=False,
227234
help="The account type of the login account.",
228235
)
@@ -234,7 +241,7 @@ def main(
234241
)
235242
parser.add_argument(
236243
"--linked_account_type",
237-
type=str,
244+
choices=account_type_choices,
238245
required=False,
239246
help="The account type of the linked account.",
240247
)

0 commit comments

Comments
 (0)