@@ -107,6 +107,8 @@ def to_test_request(
107
107
self ,
108
108
password : Optional [str ] = None ,
109
109
token : Optional [str ] = None ,
110
+ private_key : Optional [str ] = None ,
111
+ private_key_passphrase : Optional [str ] = None ,
110
112
) -> TestDefinitionRequest :
111
113
kwargs : dict [str , Any ] = {"schema" : self .schema }
112
114
if password is not None :
@@ -115,6 +117,10 @@ def to_test_request(
115
117
kwargs ["token" ] = token
116
118
if self .username is not None :
117
119
kwargs ["username" ] = self .username
120
+ if private_key is not None :
121
+ kwargs ["private_key" ] = private_key
122
+ if private_key_passphrase is not None :
123
+ kwargs ["private_key_passphrase" ] = private_key
118
124
return TestDefinitionRequest (type = self .type , url = self .url , ** kwargs )
119
125
120
126
@staticmethod
@@ -127,12 +133,22 @@ def data_source_folder(data_sources_folder: Path, data_source_id: str) -> Path:
127
133
create_directory (data_source_folder )
128
134
return data_source_folder
129
135
130
- def to_api (self , password : Optional [str ] = None , token : Optional [str ] = None ) -> DeclarativeDataSource :
136
+ def to_api (
137
+ self ,
138
+ password : Optional [str ] = None ,
139
+ token : Optional [str ] = None ,
140
+ private_key : Optional [str ] = None ,
141
+ private_key_passphrase : Optional [str ] = None ,
142
+ ) -> DeclarativeDataSource :
131
143
dictionary = self ._get_snake_dict ()
132
144
if password is not None :
133
145
dictionary ["password" ] = password
134
146
if token is not None :
135
147
dictionary ["token" ] = token
148
+ if private_key is not None :
149
+ dictionary ["private_key" ] = private_key
150
+ if private_key_passphrase is not None :
151
+ dictionary ["private_key_passphrase" ] = private_key_passphrase
136
152
return self .client_class ().from_dict (dictionary )
137
153
138
154
def store_to_disk (self , data_sources_folder : Path ) -> None :
0 commit comments