-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implemented retrieval of integrations
- Loading branch information
1 parent
95f315c
commit cba0a8b
Showing
16 changed files
with
312 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,24 @@ | ||
import uuid | ||
import json | ||
|
||
from apps.integrations.db.schemas import IntegrationsSchema | ||
from apps.integrations.domain import AvailableIntegrations | ||
from apps.shared.domain import InternalModel | ||
|
||
|
||
class IntegrationMeta(InternalModel): | ||
class LorisIntegration(InternalModel): | ||
hostname: str | ||
username: str | ||
password: str | ||
project: str | None | ||
|
||
|
||
class Integrations(InternalModel): | ||
applet_id: uuid.UUID | ||
type: AvailableIntegrations | ||
configuration: IntegrationMeta | ||
project: str | ||
|
||
@classmethod | ||
def from_schema(cls, schema: IntegrationsSchema): | ||
return cls(applet_id=schema.applet_id, type=schema.type, configuration=schema.configuration) | ||
|
||
|
||
class IntegrationsCreate(InternalModel): | ||
applet_id: uuid.UUID | ||
hostname: str | ||
username: str | ||
password: str | ||
new_loris_integration_dict = json.loads(schema.configuration.replace("'", '"')) | ||
new_loris_integration_dict["password"] = "*****" | ||
|
||
new_loris_integration = cls( | ||
hostname=new_loris_integration_dict["hostname"], | ||
username=new_loris_integration_dict["username"], | ||
password=new_loris_integration_dict["password"], | ||
project=new_loris_integration_dict["project"] | ||
) | ||
return new_loris_integration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.