@@ -10,8 +10,10 @@ def __init__(self, site_id: Optional[str] = None, user_id_to_impersonate: Option
10
10
@property
11
11
@abc .abstractmethod
12
12
def credentials (self ) -> Dict [str , str ]:
13
- credentials = ("Credentials can be username/password, Personal Access Token, or JWT"
14
- "This method returns values to set as an attribute on the credentials element of the request" )
13
+ credentials = (
14
+ "Credentials can be username/password, Personal Access Token, or JWT"
15
+ "This method returns values to set as an attribute on the credentials element of the request"
16
+ )
15
17
return {"key" : "value" }
16
18
17
19
@abc .abstractmethod
@@ -30,7 +32,9 @@ def deprecate_site_attribute():
30
32
31
33
# The traditional auth type: username/password
32
34
class TableauAuth (Credentials ):
33
- def __init__ (self , username : str , password : str , site_id : Optional [str ] = None , user_id_to_impersonate : Optional [str ] = None ) -> None :
35
+ def __init__ (
36
+ self , username : str , password : str , site_id : Optional [str ] = None , user_id_to_impersonate : Optional [str ] = None
37
+ ) -> None :
34
38
super ().__init__ (site_id , user_id_to_impersonate )
35
39
if password is None :
36
40
raise TabError ("Must provide a password when using traditional authentication" )
@@ -51,7 +55,13 @@ def __repr__(self):
51
55
52
56
# A Tableau-generated Personal Access Token
53
57
class PersonalAccessTokenAuth (Credentials ):
54
- def __init__ (self , token_name : str , personal_access_token : str , site_id : Optional [str ] = None , user_id_to_impersonate : Optional [str ] = None ) -> None :
58
+ def __init__ (
59
+ self ,
60
+ token_name : str ,
61
+ personal_access_token : str ,
62
+ site_id : Optional [str ] = None ,
63
+ user_id_to_impersonate : Optional [str ] = None ,
64
+ ) -> None :
55
65
if personal_access_token is None or token_name is None :
56
66
raise TabError ("Must provide a token and token name when using PAT authentication" )
57
67
super ().__init__ (site_id = site_id , user_id_to_impersonate = user_id_to_impersonate )
0 commit comments