Skip to content

Commit 7133a2a

Browse files
authored
Merge pull request #498 from atlanhq/APP-5297
APP-5297: Make 'test' parameter optional in credential `creator()` method
2 parents 08eb6e2 + 2bf8d68 commit 7133a2a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pyatlan/client/credential.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55

66
from pyatlan.client.common import ApiCaller
77
from pyatlan.client.constants import (
8+
CREATE_CREDENTIALS,
9+
DELETE_CREDENTIALS_BY_GUID,
810
GET_ALL_CREDENTIALS,
911
GET_CREDENTIAL_BY_GUID,
1012
TEST_CREDENTIAL,
1113
UPDATE_CREDENTIAL_BY_GUID,
12-
CREATE_CREDENTIALS,
13-
DELETE_CREDENTIALS_BY_GUID,
1414
)
1515
from pyatlan.errors import ErrorCode
1616
from pyatlan.model.credential import (
@@ -37,17 +37,19 @@ def __init__(self, client: ApiCaller):
3737
self._client = client
3838

3939
@validate_arguments
40-
def creator(self, credential: Credential) -> CredentialResponse:
40+
def creator(self, credential: Credential, test: bool = True) -> CredentialResponse:
4141
"""
4242
Create a new credential.
4343
4444
: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`.
4547
:returns: A CredentialResponse instance.
4648
:raises ValidationError: If the provided `credential` is invalid.
4749
"""
4850
raw_json = self._client._call_api(
4951
api=CREATE_CREDENTIALS.format_path_with_params(),
50-
query_params={"testCredential": "true"},
52+
query_params={"testCredential": test},
5153
request_obj=credential,
5254
)
5355
return CredentialResponse(**raw_json)

0 commit comments

Comments
 (0)