From 4b2ddf372bb8db115ceeba9eaddafb8d104d74aa Mon Sep 17 00:00:00 2001 From: Mark Vrijlandt Date: Fri, 1 Mar 2024 17:57:54 +0100 Subject: [PATCH] add params_dict --- python/src/omotes_sdk_protocol/job_pb2.py | 31 +++++++++++----------- python/src/omotes_sdk_protocol/job_pb2.pyi | 9 +++++-- src/job.proto | 2 ++ 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/python/src/omotes_sdk_protocol/job_pb2.py b/python/src/omotes_sdk_protocol/job_pb2.py index c5b9290..3625a26 100644 --- a/python/src/omotes_sdk_protocol/job_pb2.py +++ b/python/src/omotes_sdk_protocol/job_pb2.py @@ -12,27 +12,28 @@ _sym_db = _symbol_database.Default() +from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\tjob.proto\"j\n\rJobSubmission\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x17\n\ntimeout_ms\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x15\n\rworkflow_type\x18\x03 \x01(\t\x12\x0c\n\x04\x65sdl\x18\x04 \x01(\tB\r\n\x0b_timeout_ms\"\xb2\x01\n\tJobResult\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12*\n\x0bresult_type\x18\x02 \x01(\x0e\x32\x15.JobResult.ResultType\x12\x18\n\x0boutput_esdl\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x0c\n\x04logs\x18\x04 \x01(\t\"3\n\nResultType\x12\r\n\tSUCCEEDED\x10\x00\x12\x0b\n\x07TIMEOUT\x10\x01\x12\t\n\x05\x45RROR\x10\x02\x42\x0e\n\x0c_output_esdl\"D\n\x11JobProgressUpdate\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x10\n\x08progress\x18\x02 \x01(\x01\x12\x0f\n\x07message\x18\x03 \x01(\t\"\xa0\x01\n\x0fJobStatusUpdate\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12*\n\x06status\x18\x02 \x01(\x0e\x32\x1a.JobStatusUpdate.JobStatus\"S\n\tJobStatus\x12\x0e\n\nREGISTERED\x10\x00\x12\x0c\n\x08\x45NQUEUED\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x0c\n\x08\x46INISHED\x10\x03\x12\r\n\tCANCELLED\x10\x04\"\x19\n\tJobCancel\x12\x0c\n\x04uuid\x18\x01 \x01(\tb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\tjob.proto\x1a\x1cgoogle/protobuf/struct.proto\"\x98\x01\n\rJobSubmission\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x17\n\ntimeout_ms\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x15\n\rworkflow_type\x18\x03 \x01(\t\x12\x0c\n\x04\x65sdl\x18\x04 \x01(\t\x12,\n\x0bparams_dict\x18\x05 \x01(\x0b\x32\x17.google.protobuf.StructB\r\n\x0b_timeout_ms\"\xb2\x01\n\tJobResult\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12*\n\x0bresult_type\x18\x02 \x01(\x0e\x32\x15.JobResult.ResultType\x12\x18\n\x0boutput_esdl\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x0c\n\x04logs\x18\x04 \x01(\t\"3\n\nResultType\x12\r\n\tSUCCEEDED\x10\x00\x12\x0b\n\x07TIMEOUT\x10\x01\x12\t\n\x05\x45RROR\x10\x02\x42\x0e\n\x0c_output_esdl\"D\n\x11JobProgressUpdate\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12\x10\n\x08progress\x18\x02 \x01(\x01\x12\x0f\n\x07message\x18\x03 \x01(\t\"\xa0\x01\n\x0fJobStatusUpdate\x12\x0c\n\x04uuid\x18\x01 \x01(\t\x12*\n\x06status\x18\x02 \x01(\x0e\x32\x1a.JobStatusUpdate.JobStatus\"S\n\tJobStatus\x12\x0e\n\nREGISTERED\x10\x00\x12\x0c\n\x08\x45NQUEUED\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x0c\n\x08\x46INISHED\x10\x03\x12\r\n\tCANCELLED\x10\x04\"\x19\n\tJobCancel\x12\x0c\n\x04uuid\x18\x01 \x01(\tb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'job_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None - _globals['_JOBSUBMISSION']._serialized_start=13 - _globals['_JOBSUBMISSION']._serialized_end=119 - _globals['_JOBRESULT']._serialized_start=122 - _globals['_JOBRESULT']._serialized_end=300 - _globals['_JOBRESULT_RESULTTYPE']._serialized_start=233 - _globals['_JOBRESULT_RESULTTYPE']._serialized_end=284 - _globals['_JOBPROGRESSUPDATE']._serialized_start=302 - _globals['_JOBPROGRESSUPDATE']._serialized_end=370 - _globals['_JOBSTATUSUPDATE']._serialized_start=373 - _globals['_JOBSTATUSUPDATE']._serialized_end=533 - _globals['_JOBSTATUSUPDATE_JOBSTATUS']._serialized_start=450 - _globals['_JOBSTATUSUPDATE_JOBSTATUS']._serialized_end=533 - _globals['_JOBCANCEL']._serialized_start=535 - _globals['_JOBCANCEL']._serialized_end=560 + _globals['_JOBSUBMISSION']._serialized_start=44 + _globals['_JOBSUBMISSION']._serialized_end=196 + _globals['_JOBRESULT']._serialized_start=199 + _globals['_JOBRESULT']._serialized_end=377 + _globals['_JOBRESULT_RESULTTYPE']._serialized_start=310 + _globals['_JOBRESULT_RESULTTYPE']._serialized_end=361 + _globals['_JOBPROGRESSUPDATE']._serialized_start=379 + _globals['_JOBPROGRESSUPDATE']._serialized_end=447 + _globals['_JOBSTATUSUPDATE']._serialized_start=450 + _globals['_JOBSTATUSUPDATE']._serialized_end=610 + _globals['_JOBSTATUSUPDATE_JOBSTATUS']._serialized_start=527 + _globals['_JOBSTATUSUPDATE_JOBSTATUS']._serialized_end=610 + _globals['_JOBCANCEL']._serialized_start=612 + _globals['_JOBCANCEL']._serialized_end=637 # @@protoc_insertion_point(module_scope) diff --git a/python/src/omotes_sdk_protocol/job_pb2.pyi b/python/src/omotes_sdk_protocol/job_pb2.pyi index 56f1381..71971b3 100644 --- a/python/src/omotes_sdk_protocol/job_pb2.pyi +++ b/python/src/omotes_sdk_protocol/job_pb2.pyi @@ -6,6 +6,7 @@ import builtins import google.protobuf.descriptor import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import google.protobuf.struct_pb2 import sys import typing @@ -24,11 +25,14 @@ class JobSubmission(google.protobuf.message.Message): TIMEOUT_MS_FIELD_NUMBER: builtins.int WORKFLOW_TYPE_FIELD_NUMBER: builtins.int ESDL_FIELD_NUMBER: builtins.int + PARAMS_DICT_FIELD_NUMBER: builtins.int uuid: builtins.str timeout_ms: builtins.int workflow_type: builtins.str esdl: builtins.str """Raw XML string""" + @property + def params_dict(self) -> google.protobuf.struct_pb2.Struct: ... def __init__( self, *, @@ -36,9 +40,10 @@ class JobSubmission(google.protobuf.message.Message): timeout_ms: builtins.int | None = ..., workflow_type: builtins.str = ..., esdl: builtins.str = ..., + params_dict: google.protobuf.struct_pb2.Struct | None = ..., ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["_timeout_ms", b"_timeout_ms", "timeout_ms", b"timeout_ms"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["_timeout_ms", b"_timeout_ms", "esdl", b"esdl", "timeout_ms", b"timeout_ms", "uuid", b"uuid", "workflow_type", b"workflow_type"]) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["_timeout_ms", b"_timeout_ms", "params_dict", b"params_dict", "timeout_ms", b"timeout_ms"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["_timeout_ms", b"_timeout_ms", "esdl", b"esdl", "params_dict", b"params_dict", "timeout_ms", b"timeout_ms", "uuid", b"uuid", "workflow_type", b"workflow_type"]) -> None: ... def WhichOneof(self, oneof_group: typing_extensions.Literal["_timeout_ms", b"_timeout_ms"]) -> typing_extensions.Literal["timeout_ms"] | None: ... global___JobSubmission = JobSubmission diff --git a/src/job.proto b/src/job.proto index f7b26c4..e83bddf 100644 --- a/src/job.proto +++ b/src/job.proto @@ -1,10 +1,12 @@ syntax = "proto3"; +import "google/protobuf/struct.proto"; message JobSubmission { string uuid = 1; optional uint32 timeout_ms = 2; string workflow_type = 3; string esdl = 4; // Raw XML string + google.protobuf.Struct params_dict = 5; } message JobResult {