Skip to content

Commit

Permalink
fix: fixing kind oauth link response type
Browse files Browse the repository at this point in the history
  • Loading branch information
epalhares-tenchi committed May 29, 2024
1 parent bd689d8 commit 597fb43
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions zanshinsdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ def get_kind_oauth_link(
* SALESFORCE
:return: a dict with the link
"""
if kind.value not in OAuthTargetKind.__members__.values():
if kind.value not in [member.value for member in OAuthTargetKind]:
raise ValueError(f"{repr(kind.value)} is not eligible for OAuth link")

scan_type = (
Expand All @@ -1144,7 +1144,7 @@ def get_kind_oauth_link(
f"&{scan_type}={validate_uuid(scan_target_id)}"
)

return self._request("GET", path)
return self._request("GET", path).json()

def get_gworkspace_oauth_link(
self, organization_id: Union[UUID, str], scan_target_id: Union[UUID, str]
Expand Down Expand Up @@ -1246,10 +1246,11 @@ def create_scan_target_group(
"""
validate_class(kind, ScanTargetKind)
validate_class(name, str)
group_kinds = [member.value for member in ScanTargetGroupKind]

if kind not in ScanTargetGroupKind.__members__.values():
if kind not in group_kinds:
raise ValueError(
f"{repr(kind.value)} is not accepted. '{ScanTargetGroupKind.__members__.values()}' is expected"
f"{repr(kind.value)} is not accepted. '{group_kinds}' is expected"
)

body = {
Expand Down

0 comments on commit 597fb43

Please sign in to comment.