5
5
6
6
from pyatlan .client .common import ApiCaller
7
7
from pyatlan .client .constants import (
8
+ CREATE_CREDENTIALS ,
9
+ DELETE_CREDENTIALS_BY_GUID ,
8
10
GET_ALL_CREDENTIALS ,
9
11
GET_CREDENTIAL_BY_GUID ,
10
12
TEST_CREDENTIAL ,
11
13
UPDATE_CREDENTIAL_BY_GUID ,
12
- CREATE_CREDENTIALS ,
13
- DELETE_CREDENTIALS_BY_GUID ,
14
14
)
15
15
from pyatlan .errors import ErrorCode
16
16
from pyatlan .model .credential import (
@@ -37,17 +37,19 @@ def __init__(self, client: ApiCaller):
37
37
self ._client = client
38
38
39
39
@validate_arguments
40
- def creator (self , credential : Credential ) -> CredentialResponse :
40
+ def creator (self , credential : Credential , test : bool = True ) -> CredentialResponse :
41
41
"""
42
42
Create a new credential.
43
43
44
44
:param credential: provide full details of the credential's to be created.
45
+ :param test: whether to validate the credentials (`True`) or skip validation
46
+ (`False`) before creation, defaults to `True`.
45
47
:returns: A CredentialResponse instance.
46
48
:raises ValidationError: If the provided `credential` is invalid.
47
49
"""
48
50
raw_json = self ._client ._call_api (
49
51
api = CREATE_CREDENTIALS .format_path_with_params (),
50
- query_params = {"testCredential" : "true" },
52
+ query_params = {"testCredential" : test },
51
53
request_obj = credential ,
52
54
)
53
55
return CredentialResponse (** raw_json )
0 commit comments