14
14
15
15
import click
16
16
import pathlib
17
- from typing import Any , Callable
17
+ from typing import Any , Callable , Optional
18
18
19
19
from planet_auth_utils .constants import EnvironmentVariables
20
20
25
25
# TODO: Should we make "required" param universal for all options?
26
26
# Maybe rather than being so prescriptive, we pass **kwargs to click options?
27
27
def opt_api_key (
28
- default = None , hidden : bool = False , envvar : str = EnvironmentVariables .AUTH_API_KEY
28
+ default = None , hidden : bool = False , envvar : Optional [ str ] = EnvironmentVariables .AUTH_API_KEY
29
29
) -> _click_option_decorator_type :
30
30
"""
31
31
Click option for specifying an API key
@@ -48,7 +48,7 @@ def decorator(function) -> _click_option_decorator_type:
48
48
49
49
50
50
def opt_audience (
51
- default = None , hidden : bool = False , required = False , envvar : str = EnvironmentVariables .AUTH_AUDIENCE
51
+ default = None , hidden : bool = False , required = False , envvar : Optional [ str ] = EnvironmentVariables .AUTH_AUDIENCE
52
52
) -> _click_option_decorator_type :
53
53
"""
54
54
Click option for specifying an OAuth token audience for the
@@ -76,7 +76,7 @@ def decorator(function) -> _click_option_decorator_type:
76
76
77
77
78
78
def opt_client_id (
79
- default = None , hidden : bool = False , envvar : str = EnvironmentVariables .AUTH_CLIENT_ID
79
+ default = None , hidden : bool = False , envvar : Optional [ str ] = EnvironmentVariables .AUTH_CLIENT_ID
80
80
) -> _click_option_decorator_type :
81
81
"""
82
82
Click option for specifying an OAuth client ID.
@@ -99,7 +99,7 @@ def decorator(function) -> _click_option_decorator_type:
99
99
100
100
101
101
def opt_client_secret (
102
- default = None , hidden : bool = False , envvar : str = EnvironmentVariables .AUTH_CLIENT_SECRET
102
+ default = None , hidden : bool = False , envvar : Optional [ str ] = EnvironmentVariables .AUTH_CLIENT_SECRET
103
103
) -> _click_option_decorator_type :
104
104
"""
105
105
Click option for specifying an OAuth client secret.
@@ -122,7 +122,7 @@ def decorator(function) -> _click_option_decorator_type:
122
122
123
123
124
124
def opt_extra (
125
- default = None , hidden : bool = False , envvar : str = EnvironmentVariables .AUTH_EXTRA
125
+ default = None , hidden : bool = False , envvar : Optional [ str ] = EnvironmentVariables .AUTH_EXTRA
126
126
) -> _click_option_decorator_type :
127
127
"""
128
128
Click option for specifying extra options.
@@ -169,7 +169,7 @@ def decorator(function) -> _click_option_decorator_type:
169
169
170
170
171
171
def opt_issuer (
172
- default = None , hidden : bool = False , required = False , envvar : str = EnvironmentVariables .AUTH_ISSUER
172
+ default = None , hidden : bool = False , required = False , envvar : Optional [ str ] = EnvironmentVariables .AUTH_ISSUER
173
173
) -> _click_option_decorator_type :
174
174
"""
175
175
Click option for specifying an OAuth token issuer for the
@@ -194,7 +194,7 @@ def decorator(function) -> _click_option_decorator_type:
194
194
195
195
196
196
def opt_loglevel (
197
- default = "INFO" , hidden : bool = False , envvar : str = EnvironmentVariables .AUTH_LOGLEVEL
197
+ default = "INFO" , hidden : bool = False , envvar : Optional [ str ] = EnvironmentVariables .AUTH_LOGLEVEL
198
198
) -> _click_option_decorator_type :
199
199
"""
200
200
Click option for specifying a log level.
@@ -257,7 +257,7 @@ def decorator(function) -> _click_option_decorator_type:
257
257
258
258
259
259
def opt_organization (
260
- default = None , hidden : bool = False , envvar : str = EnvironmentVariables .AUTH_ORGANIZATION
260
+ default = None , hidden : bool = False , envvar : Optional [ str ] = EnvironmentVariables .AUTH_ORGANIZATION
261
261
) -> _click_option_decorator_type :
262
262
"""
263
263
Click option for specifying an Organization.
@@ -287,7 +287,7 @@ def decorator(function) -> _click_option_decorator_type:
287
287
# lib also handles things like browser interaction this is not entirely easy to abstract
288
288
# away.
289
289
def opt_password (
290
- default = None , hidden : bool = True , envvar : str = EnvironmentVariables .AUTH_PASSWORD
290
+ default = None , hidden : bool = True , envvar : Optional [ str ] = EnvironmentVariables .AUTH_PASSWORD
291
291
) -> _click_option_decorator_type :
292
292
"""
293
293
Click option for specifying a password for the
@@ -311,7 +311,7 @@ def decorator(function) -> _click_option_decorator_type:
311
311
312
312
313
313
def opt_profile (
314
- default = None , hidden : bool = False , envvar : str = EnvironmentVariables .AUTH_PROFILE
314
+ default = None , hidden : bool = False , envvar : Optional [ str ] = EnvironmentVariables .AUTH_PROFILE
315
315
) -> _click_option_decorator_type :
316
316
"""
317
317
Click option for specifying an auth profile for the
@@ -336,7 +336,7 @@ def decorator(function) -> _click_option_decorator_type:
336
336
337
337
338
338
def opt_project (
339
- default = None , hidden : bool = False , envvar : str = EnvironmentVariables .AUTH_PROJECT
339
+ default = None , hidden : bool = False , envvar : Optional [ str ] = EnvironmentVariables .AUTH_PROJECT
340
340
) -> _click_option_decorator_type :
341
341
"""
342
342
Click option for specifying a project ID.
@@ -397,7 +397,7 @@ def decorator(function) -> _click_option_decorator_type:
397
397
398
398
399
399
def opt_token (
400
- default = None , hidden : bool = False , envvar : str = EnvironmentVariables .AUTH_TOKEN
400
+ default = None , hidden : bool = False , envvar : Optional [ str ] = EnvironmentVariables .AUTH_TOKEN
401
401
) -> _click_option_decorator_type :
402
402
"""
403
403
Click option for specifying a token literal.
@@ -421,7 +421,7 @@ def decorator(function) -> _click_option_decorator_type:
421
421
422
422
423
423
def opt_scope (
424
- default = None , hidden : bool = False , envvar : str = EnvironmentVariables .AUTH_SCOPE
424
+ default = None , hidden : bool = False , envvar : Optional [ str ] = EnvironmentVariables .AUTH_SCOPE
425
425
) -> _click_option_decorator_type :
426
426
"""
427
427
Click option for specifying an OAuth token scope for the
@@ -468,7 +468,7 @@ def decorator(function) -> _click_option_decorator_type:
468
468
469
469
470
470
def opt_token_file (
471
- default = None , hidden : bool = False , envvar : str = EnvironmentVariables .AUTH_TOKEN_FILE
471
+ default = None , hidden : bool = False , envvar : Optional [ str ] = EnvironmentVariables .AUTH_TOKEN_FILE
472
472
) -> _click_option_decorator_type :
473
473
"""
474
474
Click option for specifying a token file location for the
@@ -492,7 +492,7 @@ def decorator(function) -> _click_option_decorator_type:
492
492
493
493
494
494
def opt_username (
495
- default = None , hidden : bool = True , envvar : str = EnvironmentVariables .AUTH_USERNAME
495
+ default = None , hidden : bool = True , envvar : Optional [ str ] = EnvironmentVariables .AUTH_USERNAME
496
496
) -> _click_option_decorator_type :
497
497
"""
498
498
Click option for specifying a username for the
0 commit comments