Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add esdl messages to job result #33

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions ci/linux/gen_protocol.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ fi

rm -Rf python/src/omotes_sdk_protocol/
mkdir -p python/src/omotes_sdk_protocol/
protoc -I include/ -I src/ --python_out python/src/omotes_sdk_protocol/ ./src/job.proto
protoc -I include/ -I src/ --mypy_out python/src/omotes_sdk_protocol/ ./src/job.proto
protoc -I include/ -I src/ --python_out python/src/omotes_sdk_protocol/ ./src/workflow.proto
protoc -I include/ -I src/ --mypy_out python/src/omotes_sdk_protocol/ ./src/workflow.proto
protoc -I include/ -I src/ --python_out python/src/ --mypy_out python/src/ omotes_sdk_protocol/job.proto omotes_sdk_protocol/workflow.proto omotes_sdk_protocol/internal/task.proto
touch python/src/omotes_sdk_protocol/internal/__init__.py
touch python/src/omotes_sdk_protocol/__init__.py
touch python/src/omotes_sdk_protocol/py.typed
Empty file.
33 changes: 33 additions & 0 deletions python/src/omotes_sdk_protocol/internal/task_pb2.py

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

112 changes: 112 additions & 0 deletions python/src/omotes_sdk_protocol/internal/task_pb2.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
"""
@generated by mypy-protobuf. Do not edit manually!
isort:skip_file
"""
import builtins
import collections.abc
import google.protobuf.descriptor
import google.protobuf.internal.containers
import google.protobuf.internal.enum_type_wrapper
import google.protobuf.message
import omotes_sdk_protocol.job_pb2
import sys
import typing

if sys.version_info >= (3, 10):
import typing as typing_extensions
else:
import typing_extensions

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

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

class _ResultType:
ValueType = typing.NewType("ValueType", builtins.int)
V: typing_extensions.TypeAlias = ValueType

class _ResultTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[TaskResult._ResultType.ValueType], builtins.type):
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
SUCCEEDED: TaskResult._ResultType.ValueType # 0
ERROR: TaskResult._ResultType.ValueType # 1

class ResultType(_ResultType, metaclass=_ResultTypeEnumTypeWrapper): ...
SUCCEEDED: TaskResult.ResultType.ValueType # 0
ERROR: TaskResult.ResultType.ValueType # 1

JOB_ID_FIELD_NUMBER: builtins.int
CELERY_TASK_ID_FIELD_NUMBER: builtins.int
CELERY_TASK_TYPE_FIELD_NUMBER: builtins.int
RESULT_TYPE_FIELD_NUMBER: builtins.int
OUTPUT_ESDL_FIELD_NUMBER: builtins.int
LOGS_FIELD_NUMBER: builtins.int
ESDL_MESSAGES_FIELD_NUMBER: builtins.int
job_id: builtins.str
celery_task_id: builtins.str
celery_task_type: builtins.str
result_type: global___TaskResult.ResultType.ValueType
output_esdl: builtins.str
logs: builtins.str
@property
def esdl_messages(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[omotes_sdk_protocol.job_pb2.EsdlMessage]: ...
def __init__(
self,
*,
job_id: builtins.str = ...,
celery_task_id: builtins.str = ...,
celery_task_type: builtins.str = ...,
result_type: global___TaskResult.ResultType.ValueType = ...,
output_esdl: builtins.str | None = ...,
logs: builtins.str = ...,
esdl_messages: collections.abc.Iterable[omotes_sdk_protocol.job_pb2.EsdlMessage] | None = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["_output_esdl", b"_output_esdl", "output_esdl", b"output_esdl"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["_output_esdl", b"_output_esdl", "celery_task_id", b"celery_task_id", "celery_task_type", b"celery_task_type", "esdl_messages", b"esdl_messages", "job_id", b"job_id", "logs", b"logs", "output_esdl", b"output_esdl", "result_type", b"result_type"]) -> None: ...
def WhichOneof(self, oneof_group: typing_extensions.Literal["_output_esdl", b"_output_esdl"]) -> typing_extensions.Literal["output_esdl"] | None: ...

global___TaskResult = TaskResult

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

class _ProgressStatus:
ValueType = typing.NewType("ValueType", builtins.int)
V: typing_extensions.TypeAlias = ValueType

class _ProgressStatusEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[TaskProgressUpdate._ProgressStatus.ValueType], builtins.type):
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
START: TaskProgressUpdate._ProgressStatus.ValueType # 0

class ProgressStatus(_ProgressStatus, metaclass=_ProgressStatusEnumTypeWrapper): ...
START: TaskProgressUpdate.ProgressStatus.ValueType # 0

JOB_ID_FIELD_NUMBER: builtins.int
CELERY_TASK_ID_FIELD_NUMBER: builtins.int
CELERY_TASK_TYPE_FIELD_NUMBER: builtins.int
STATUS_FIELD_NUMBER: builtins.int
PROGRESS_FIELD_NUMBER: builtins.int
MESSAGE_FIELD_NUMBER: builtins.int
job_id: builtins.str
celery_task_id: builtins.str
celery_task_type: builtins.str
status: global___TaskProgressUpdate.ProgressStatus.ValueType
progress: builtins.float
message: builtins.str
def __init__(
self,
*,
job_id: builtins.str = ...,
celery_task_id: builtins.str = ...,
celery_task_type: builtins.str = ...,
status: global___TaskProgressUpdate.ProgressStatus.ValueType = ...,
progress: builtins.float = ...,
message: builtins.str = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["progress", b"progress", "progress_type", b"progress_type", "status", b"status"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["celery_task_id", b"celery_task_id", "celery_task_type", b"celery_task_type", "job_id", b"job_id", "message", b"message", "progress", b"progress", "progress_type", b"progress_type", "status", b"status"]) -> None: ...
def WhichOneof(self, oneof_group: typing_extensions.Literal["progress_type", b"progress_type"]) -> typing_extensions.Literal["status", "progress"] | None: ...

global___TaskProgressUpdate = TaskProgressUpdate
88 changes: 25 additions & 63 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.

49 changes: 48 additions & 1 deletion python/src/omotes_sdk_protocol/job_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
isort:skip_file
"""
import builtins
import collections.abc
import google.protobuf.descriptor
import google.protobuf.internal.containers
import google.protobuf.internal.enum_type_wrapper
import google.protobuf.message
import google.protobuf.struct_pb2
Expand Down Expand Up @@ -79,25 +81,70 @@ class JobResult(google.protobuf.message.Message):
RESULT_TYPE_FIELD_NUMBER: builtins.int
OUTPUT_ESDL_FIELD_NUMBER: builtins.int
LOGS_FIELD_NUMBER: builtins.int
ESDL_MESSAGES_FIELD_NUMBER: builtins.int
uuid: builtins.str
result_type: global___JobResult.ResultType.ValueType
output_esdl: builtins.str
"""Raw XML string"""
logs: builtins.str
@property
def esdl_messages(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___EsdlMessage]: ...
def __init__(
self,
*,
uuid: builtins.str = ...,
result_type: global___JobResult.ResultType.ValueType = ...,
output_esdl: builtins.str | None = ...,
logs: builtins.str = ...,
esdl_messages: collections.abc.Iterable[global___EsdlMessage] | None = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["_output_esdl", b"_output_esdl", "output_esdl", b"output_esdl"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["_output_esdl", b"_output_esdl", "logs", b"logs", "output_esdl", b"output_esdl", "result_type", b"result_type", "uuid", b"uuid"]) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["_output_esdl", b"_output_esdl", "esdl_messages", b"esdl_messages", "logs", b"logs", "output_esdl", b"output_esdl", "result_type", b"result_type", "uuid", b"uuid"]) -> None: ...
def WhichOneof(self, oneof_group: typing_extensions.Literal["_output_esdl", b"_output_esdl"]) -> typing_extensions.Literal["output_esdl"] | None: ...

global___JobResult = JobResult

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

class _Severity:
ValueType = typing.NewType("ValueType", builtins.int)
V: typing_extensions.TypeAlias = ValueType

class _SeverityEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[EsdlMessage._Severity.ValueType], builtins.type):
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
DEBUG: EsdlMessage._Severity.ValueType # 0
INFO: EsdlMessage._Severity.ValueType # 1
WARNING: EsdlMessage._Severity.ValueType # 2
ERROR: EsdlMessage._Severity.ValueType # 3

class Severity(_Severity, metaclass=_SeverityEnumTypeWrapper): ...
DEBUG: EsdlMessage.Severity.ValueType # 0
INFO: EsdlMessage.Severity.ValueType # 1
WARNING: EsdlMessage.Severity.ValueType # 2
ERROR: EsdlMessage.Severity.ValueType # 3

TECHNICAL_MESSAGE_FIELD_NUMBER: builtins.int
SEVERITY_FIELD_NUMBER: builtins.int
ESDL_OBJECT_ID_FIELD_NUMBER: builtins.int
technical_message: builtins.str
severity: global___EsdlMessage.Severity.ValueType
esdl_object_id: builtins.str
"""can be omitted for general energy system messages"""
def __init__(
self,
*,
technical_message: builtins.str = ...,
severity: global___EsdlMessage.Severity.ValueType = ...,
esdl_object_id: builtins.str | None = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["_esdl_object_id", b"_esdl_object_id", "esdl_object_id", b"esdl_object_id"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["_esdl_object_id", b"_esdl_object_id", "esdl_object_id", b"esdl_object_id", "severity", b"severity", "technical_message", b"technical_message"]) -> None: ...
def WhichOneof(self, oneof_group: typing_extensions.Literal["_esdl_object_id", b"_esdl_object_id"]) -> typing_extensions.Literal["esdl_object_id"] | None: ...

global___EsdlMessage = EsdlMessage

@typing_extensions.final
class JobProgressUpdate(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
Expand Down
Loading
Loading