-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
480 additions
and
230 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
11 changes: 11 additions & 0 deletions
11
src/api/src/backend/serializers/ApplicationTaskSerializer.py
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from backend.serializers import BaseTaskSerializer | ||
|
||
|
||
class ApplicationTaskSerializer: | ||
@staticmethod | ||
def serialize(model, base=None): | ||
task = base if base != None else BaseTaskSerializer.serialize(model) | ||
|
||
task["image"] = model.image | ||
|
||
return task |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from backend.serializers.CredentialsSerializer import CredentialsSerializer | ||
from backend.serializers.UUIDSerializer import UUIDSerializer | ||
|
||
|
||
class ContextSerializer: | ||
@staticmethod | ||
def serialize(model): | ||
if model == None: | ||
return None | ||
context = {} | ||
context["branch"] = model.branch | ||
context["credentials"] = CredentialsSerializer.serialize(model.credentials) | ||
context["recipe_file_path"] = model.recipe_file_path | ||
context["sub_path"] = model.sub_path | ||
context["tag"] = model.tag | ||
context["type"] = model.type | ||
context["url"] = model.url | ||
context["visibility"] = model.visibility | ||
context["uuid"] = UUIDSerializer.serialize(model.uuid) | ||
|
||
return context |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from backend.serializers.UUIDSerializer import UUIDSerializer | ||
|
||
|
||
class CredentialsSerializer: | ||
@staticmethod | ||
def serialize(model): | ||
if model == None: | ||
return None | ||
|
||
credential = {} | ||
credential["sk_id"] = model.sk_id | ||
credential["owner"] = model.owner | ||
credential["created_at"] = model.created_at | ||
credential["uuid"] = UUIDSerializer.serialize(model.uuid) | ||
|
||
|
||
return credential |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from backend.serializers.CredentialsSerializer import CredentialsSerializer | ||
from backend.serializers.UUIDSerializer import UUIDSerializer | ||
|
||
|
||
class DestinationSerializer: | ||
@staticmethod | ||
def serialize(model): | ||
if model == None: | ||
return None | ||
destination = {} | ||
destination["tag"] = model.tag | ||
destination["type"] = model.type | ||
destination["url"] = model.url | ||
destination["filename"] = model.filename | ||
destination["credentials"] = CredentialsSerializer.serialize(model.credentials) | ||
destination["uuid"] = UUIDSerializer.serialize(model.uuid) | ||
|
||
return destination |
Oops, something went wrong.