Skip to content

Commit

Permalink
Add Result and Error to JobResult.
Browse files Browse the repository at this point in the history
  • Loading branch information
lfse-slafleur committed Feb 1, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent ae80619 commit 571a1f4
Showing 4 changed files with 71 additions and 19 deletions.
9 changes: 4 additions & 5 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[project]
name = "omotes_sdk_protocol"
name = "omotes-sdk-protocol"
requires-python = ">=3.8"
dynamic = ["version"]
authors = [{ name = "Sebastiaan la Fleur", email = "[email protected]" }]
description = "Python implementation of OMOTES SDK protocol through which jobs may be submitted and administered. Messages include checking on progress, cancelling a job and receiving status updates."
@@ -26,7 +27,8 @@ dependencies = [
dev = [
"pip-tools ~= 7.3.0",
"build ~= 1.0.3",
"setuptools-git-versioning < 2"
"setuptools-git-versioning < 2",
"setuptools ~= 69.0.3"
]

[project.urls]
@@ -39,8 +41,5 @@ changelog = "https://github.com/Project-OMOTES/omotes_sdk_protocol/blob/main/CHA
build-backend = "setuptools.build_meta"
requires = ["setuptools ~= 69.0.3", "wheel ~= 0.40.0", "setuptools-git-versioning<2"]

[tools.setuptools]
packages = ["src/omotes_sdk_protocol"]

[tool.setuptools-git-versioning]
enabled = true
30 changes: 17 additions & 13 deletions python/src/omotes_sdk_protocol/job_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 37 additions & 1 deletion python/src/omotes_sdk_protocol/job_pb2.pyi
Original file line number Diff line number Diff line change
@@ -61,17 +61,53 @@ class JobResult(google.protobuf.message.Message):
TIMEOUT: JobResult.ResultType.ValueType # 1
ERROR: JobResult.ResultType.ValueType # 2

@typing_extensions.final
class Succes(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor

OUTPUT_ESDL_FIELD_NUMBER: builtins.int
output_esdl: builtins.bytes
def __init__(
self,
*,
output_esdl: builtins.bytes = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["output_esdl", b"output_esdl"]) -> None: ...

@typing_extensions.final
class Error(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor

LOGS_FIELD_NUMBER: builtins.int
logs: builtins.str
def __init__(
self,
*,
logs: builtins.str = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["logs", b"logs"]) -> None: ...

UUID_FIELD_NUMBER: builtins.int
RESULT_TYPE_FIELD_NUMBER: builtins.int
ERROR_FIELD_NUMBER: builtins.int
SUCCESS_FIELD_NUMBER: builtins.int
uuid: builtins.str
result_type: global___JobResult.ResultType.ValueType
@property
def error(self) -> global___JobResult.Error: ...
@property
def success(self) -> global___JobResult.Succes: ...
def __init__(
self,
*,
uuid: builtins.str = ...,
result_type: global___JobResult.ResultType.ValueType = ...,
error: global___JobResult.Error | None = ...,
success: global___JobResult.Succes | None = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["result_type", b"result_type", "uuid", b"uuid"]) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["error", b"error", "result", b"result", "success", b"success"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["error", b"error", "result", b"result", "result_type", b"result_type", "success", b"success", "uuid", b"uuid"]) -> None: ...
def WhichOneof(self, oneof_group: typing_extensions.Literal["result", b"result"]) -> typing_extensions.Literal["error", "success"] | None: ...

global___JobResult = JobResult

13 changes: 13 additions & 0 deletions src/job.proto
Original file line number Diff line number Diff line change
@@ -12,6 +12,19 @@ message JobResult {
string uuid = 1;
ResultType result_type = 2;

message Succes {
bytes output_esdl = 1;
}

message Error {
string logs = 1;
}

oneof result {
Error error = 3;
Succes success = 4;
}

enum ResultType {
SUCCEEDED = 0;
TIMEOUT = 1;

0 comments on commit 571a1f4

Please sign in to comment.