Skip to content

Commit

Permalink
fix: self review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Giriharan219 committed Nov 7, 2024
1 parent ad7e3f0 commit bfd9308
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 8 deletions.
5 changes: 3 additions & 2 deletions examples/auth/get_workspace_id.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"""Example of getting workspace ID."""

from nisystemlink.clients.auth import AuthClient
from nisystemlink.clients.auth.utilities import get_workspace_by_name
from nisystemlink.clients.auth.utilities._get_workspace_info import (
get_workspace_by_name,
)
from nisystemlink.clients.core import ApiException, HttpConfiguration


server_url = "" # SystemLink API URL
server_api_key = "" # SystemLink API key
workspace_name = "" # Systemlink workspace name
Expand Down
9 changes: 8 additions & 1 deletion nisystemlink/clients/auth/_auth_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,12 @@ def __init__(self, configuration: Optional[core.HttpConfiguration] = None):

@get("auth")
def get_auth_info(self) -> models.AuthInfo:
"""Gets information about the authenticated API Key."""
"""Gets information about the authenticated API Key.
Returns:
models.AuthInfo: Information about the caller.
Raises:
ApiException: if unable to communicate with the Auth Service.
"""
...
8 changes: 4 additions & 4 deletions nisystemlink/clients/auth/models/_auth_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
class AuthInfo(JsonModel):
"""Information about the authenticated caller."""

user: Optional[User]
user: Optional[User] = None
"""Details of authenticated caller."""
org: Optional[Org]
org: Optional[Org] = None
"""Organization of authenticated caller."""
workspaces: Optional[List[Workspace]]
workspaces: Optional[List[Workspace]] = None
"""List of workspaces the authenticated caller has access."""
policies: Optional[List[AuthPolicy]]
policies: Optional[List[AuthPolicy]] = None
"""List of policies for the authenticated caller."""
properties: Optional[Dict[str, str]] = None
"""A map of key value properties."""
5 changes: 5 additions & 0 deletions nisystemlink/clients/auth/utilities/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from nisystemlink.clients.auth.utilities._get_workspace_info import (
get_workspace_by_name,
)

# flake8: noqa
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Utilities for Auth Client."""
"""Get workspace information."""

from typing import List, Optional

Expand Down

0 comments on commit bfd9308

Please sign in to comment.