Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sz2376 committed Sep 20, 2024
1 parent 23fb30b commit 1449a74
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 29 deletions.
19 changes: 7 additions & 12 deletions flux_sdk/flux_core/data_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,6 @@
from typing import Optional


class BaseExternalResponse:
"""The base class for all the response from the third party system."""

is_app_disconnected: bool = False
"""This indicates if the app is disconnected from the third-party system."""


class BaseExternalRequest:
"""The base class for all external request made to the third party system."""
pass


class BaseCapability(ABC):
"""The base class for all capabilities."""

Expand Down Expand Up @@ -293,4 +281,11 @@ class TerminationType(Enum):
OFFER_DECLINE = 5
RESCIND = 6
RENEGE = 7


class AppDisconnectedError(Exception):
"""
This exception is raised when the app is disconnected from the third-party system.
"""
pass

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from flux_sdk.flux_core.data_models import BaseCapability
from flux_sdk.user_management.capabilities.user_lifecycle_management.data_models import (
from flux_sdk.user_management.data_models.data_models import (
GetOrganizationsRequest,
GetOrganizationsResponse,
GetUsersRequest,
Expand Down
Empty file.
11 changes: 0 additions & 11 deletions flux_sdk/user_management/data_models/base_types.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from dataclasses import dataclass
from typing import Optional
from flux_sdk.flux_core.data_models import BaseExternalRequest, BaseExternalResponse


@dataclass(kw_only=True)
Expand Down Expand Up @@ -38,30 +37,30 @@ class User:


@dataclass(kw_only=True)
class GetUsersRequest(BaseExternalRequest):
class GetUsersRequest:
"""This represents a request to get users from the third party system."""

organizations: Optional[list[Organization]] = None
"""The organizations to get users from. If this field is not provided, the users from all organizations should be returned."""


@dataclass(kw_only=True)
class GetUsersResponse(BaseExternalResponse):
class GetUsersResponse:
"""This represents a response containing the users from the third party system."""

users: list[User]
"""The users from the third party system."""


@dataclass(kw_only=True)
class GetOrganizationsRequest(BaseExternalRequest):
class GetOrganizationsRequest:
"""This represents a request to get organizations from the third party system."""

pass


@dataclass(kw_only=True)
class GetOrganizationsResponse(BaseHttpResponse):
class GetOrganizationsResponse:
"""This represents a response containing the organizations from the third party system."""

organizations: list[Organization]
Expand Down

0 comments on commit 1449a74

Please sign in to comment.