diff --git a/python/src/omotes_sdk_protocol/work_flow_pb2.py b/python/src/omotes_sdk_protocol/work_flow_pb2.py index 152fd1f..c3694ac 100644 --- a/python/src/omotes_sdk_protocol/work_flow_pb2.py +++ b/python/src/omotes_sdk_protocol/work_flow_pb2.py @@ -14,21 +14,21 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0fwork_flow.proto\"\x8f\x01\n\tParameter\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x30\n\x0eparameter_type\x18\x02 \x01(\x0e\x32\x18.Parameter.ParameterType\"B\n\rParameterType\x12\n\n\x06STRING\x10\x00\x12\x0b\n\x07INTEGER\x10\x01\x12\n\n\x06\x44OUBLE\x10\x02\x12\x0c\n\x08\x44\x41TETIME\x10\x03\"b\n\x08WorkFlow\x12\x11\n\ttype_name\x18\x01 \x01(\t\x12\x18\n\x10type_description\x18\x02 \x01(\t\x12)\n\x15\x61\x64\x64itional_parameters\x18\x03 \x03(\x0b\x32\n.Parameter\"3\n\x12\x41vailableWorkFlows\x12\x1d\n\nwork_flows\x18\x01 \x03(\x0b\x32\t.WorkFlow\"\x1b\n\x19RequestAvailableWorkflowsb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0fwork_flow.proto\"\xf4\x01\n\x17WorkflowParameterSchema\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\r\n\x05title\x18\x02 \x01(\t\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x07\x64\x65\x66\x61ult\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06\x66ormat\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x0c\n\x04\x65num\x18\x06 \x03(\t\x12\x14\n\x07minimum\x18\x07 \x01(\x01H\x03\x88\x01\x01\x12\x14\n\x07maximum\x18\x08 \x01(\x01H\x04\x88\x01\x01\x42\x0e\n\x0c_descriptionB\n\n\x08_defaultB\t\n\x07_formatB\n\n\x08_minimumB\n\n\x08_maximum\"O\n\x11WorkflowParameter\x12\x10\n\x08key_name\x18\x01 \x01(\t\x12(\n\x06schema\x18\x02 \x01(\x0b\x32\x18.WorkflowParameterSchema\"_\n\x08Workflow\x12\x11\n\ttype_name\x18\x01 \x01(\t\x12\x18\n\x10type_description\x18\x02 \x01(\t\x12&\n\nparameters\x18\x03 \x03(\x0b\x32\x12.WorkflowParameter\"2\n\x12\x41vailableWorkflows\x12\x1c\n\tworkflows\x18\x01 \x03(\x0b\x32\t.Workflow\"\x1b\n\x19RequestAvailableWorkflowsb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'work_flow_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None - _globals['_PARAMETER']._serialized_start=20 - _globals['_PARAMETER']._serialized_end=163 - _globals['_PARAMETER_PARAMETERTYPE']._serialized_start=97 - _globals['_PARAMETER_PARAMETERTYPE']._serialized_end=163 - _globals['_WORKFLOW']._serialized_start=165 - _globals['_WORKFLOW']._serialized_end=263 - _globals['_AVAILABLEWORKFLOWS']._serialized_start=265 - _globals['_AVAILABLEWORKFLOWS']._serialized_end=316 - _globals['_REQUESTAVAILABLEWORKFLOWS']._serialized_start=318 - _globals['_REQUESTAVAILABLEWORKFLOWS']._serialized_end=345 + _globals['_WORKFLOWPARAMETERSCHEMA']._serialized_start=20 + _globals['_WORKFLOWPARAMETERSCHEMA']._serialized_end=264 + _globals['_WORKFLOWPARAMETER']._serialized_start=266 + _globals['_WORKFLOWPARAMETER']._serialized_end=345 + _globals['_WORKFLOW']._serialized_start=347 + _globals['_WORKFLOW']._serialized_end=442 + _globals['_AVAILABLEWORKFLOWS']._serialized_start=444 + _globals['_AVAILABLEWORKFLOWS']._serialized_end=494 + _globals['_REQUESTAVAILABLEWORKFLOWS']._serialized_start=496 + _globals['_REQUESTAVAILABLEWORKFLOWS']._serialized_end=523 # @@protoc_insertion_point(module_scope) diff --git a/python/src/omotes_sdk_protocol/work_flow_pb2.pyi b/python/src/omotes_sdk_protocol/work_flow_pb2.pyi index 5bb9a22..3da9d6f 100644 --- a/python/src/omotes_sdk_protocol/work_flow_pb2.pyi +++ b/python/src/omotes_sdk_protocol/work_flow_pb2.pyi @@ -6,12 +6,11 @@ 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 sys import typing -if sys.version_info >= (3, 10): +if sys.version_info >= (3, 8): import typing as typing_extensions else: import typing_extensions @@ -19,77 +18,110 @@ else: DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @typing_extensions.final -class Parameter(google.protobuf.message.Message): +class WorkflowParameterSchema(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor - class _ParameterType: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType - - class _ParameterTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Parameter._ParameterType.ValueType], builtins.type): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - STRING: Parameter._ParameterType.ValueType # 0 - INTEGER: Parameter._ParameterType.ValueType # 1 - DOUBLE: Parameter._ParameterType.ValueType # 2 - DATETIME: Parameter._ParameterType.ValueType # 3 - - class ParameterType(_ParameterType, metaclass=_ParameterTypeEnumTypeWrapper): ... - STRING: Parameter.ParameterType.ValueType # 0 - INTEGER: Parameter.ParameterType.ValueType # 1 - DOUBLE: Parameter.ParameterType.ValueType # 2 - DATETIME: Parameter.ParameterType.ValueType # 3 - - NAME_FIELD_NUMBER: builtins.int - PARAMETER_TYPE_FIELD_NUMBER: builtins.int - name: builtins.str - parameter_type: global___Parameter.ParameterType.ValueType + TYPE_FIELD_NUMBER: builtins.int + TITLE_FIELD_NUMBER: builtins.int + DESCRIPTION_FIELD_NUMBER: builtins.int + DEFAULT_FIELD_NUMBER: builtins.int + FORMAT_FIELD_NUMBER: builtins.int + ENUM_FIELD_NUMBER: builtins.int + MINIMUM_FIELD_NUMBER: builtins.int + MAXIMUM_FIELD_NUMBER: builtins.int + type: builtins.str + title: builtins.str + description: builtins.str + default: builtins.str + format: builtins.str + @property + def enum(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ... + minimum: builtins.float + maximum: builtins.float + def __init__( + self, + *, + type: builtins.str = ..., + title: builtins.str = ..., + description: builtins.str | None = ..., + default: builtins.str | None = ..., + format: builtins.str | None = ..., + enum: collections.abc.Iterable[builtins.str] | None = ..., + minimum: builtins.float | None = ..., + maximum: builtins.float | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["_default", b"_default", "_description", b"_description", "_format", b"_format", "_maximum", b"_maximum", "_minimum", b"_minimum", "default", b"default", "description", b"description", "format", b"format", "maximum", b"maximum", "minimum", b"minimum"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["_default", b"_default", "_description", b"_description", "_format", b"_format", "_maximum", b"_maximum", "_minimum", b"_minimum", "default", b"default", "description", b"description", "enum", b"enum", "format", b"format", "maximum", b"maximum", "minimum", b"minimum", "title", b"title", "type", b"type"]) -> None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing_extensions.Literal["_default", b"_default"]) -> typing_extensions.Literal["default"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing_extensions.Literal["_description", b"_description"]) -> typing_extensions.Literal["description"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing_extensions.Literal["_format", b"_format"]) -> typing_extensions.Literal["format"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing_extensions.Literal["_maximum", b"_maximum"]) -> typing_extensions.Literal["maximum"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing_extensions.Literal["_minimum", b"_minimum"]) -> typing_extensions.Literal["minimum"] | None: ... + +global___WorkflowParameterSchema = WorkflowParameterSchema + +@typing_extensions.final +class WorkflowParameter(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + KEY_NAME_FIELD_NUMBER: builtins.int + SCHEMA_FIELD_NUMBER: builtins.int + key_name: builtins.str + @property + def schema(self) -> global___WorkflowParameterSchema: ... def __init__( self, *, - name: builtins.str = ..., - parameter_type: global___Parameter.ParameterType.ValueType = ..., + key_name: builtins.str = ..., + schema: global___WorkflowParameterSchema | None = ..., ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["name", b"name", "parameter_type", b"parameter_type"]) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["schema", b"schema"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["key_name", b"key_name", "schema", b"schema"]) -> None: ... -global___Parameter = Parameter +global___WorkflowParameter = WorkflowParameter @typing_extensions.final -class WorkFlow(google.protobuf.message.Message): +class Workflow(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor TYPE_NAME_FIELD_NUMBER: builtins.int TYPE_DESCRIPTION_FIELD_NUMBER: builtins.int - ADDITIONAL_PARAMETERS_FIELD_NUMBER: builtins.int + PARAMETERS_FIELD_NUMBER: builtins.int type_name: builtins.str type_description: builtins.str @property - def additional_parameters(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Parameter]: ... + def parameters(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___WorkflowParameter]: ... def __init__( self, *, type_name: builtins.str = ..., type_description: builtins.str = ..., - additional_parameters: collections.abc.Iterable[global___Parameter] | None = ..., + parameters: collections.abc.Iterable[global___WorkflowParameter] | None = ..., ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["additional_parameters", b"additional_parameters", "type_description", b"type_description", "type_name", b"type_name"]) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["parameters", b"parameters", "type_description", b"type_description", "type_name", b"type_name"]) -> None: ... -global___WorkFlow = WorkFlow +global___Workflow = Workflow @typing_extensions.final -class AvailableWorkFlows(google.protobuf.message.Message): +class AvailableWorkflows(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor - WORK_FLOWS_FIELD_NUMBER: builtins.int + WORKFLOWS_FIELD_NUMBER: builtins.int @property - def work_flows(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___WorkFlow]: ... + def workflows(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Workflow]: ... def __init__( self, *, - work_flows: collections.abc.Iterable[global___WorkFlow] | None = ..., + workflows: collections.abc.Iterable[global___Workflow] | None = ..., ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["work_flows", b"work_flows"]) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["workflows", b"workflows"]) -> None: ... -global___AvailableWorkFlows = AvailableWorkFlows +global___AvailableWorkflows = AvailableWorkflows @typing_extensions.final class RequestAvailableWorkflows(google.protobuf.message.Message): diff --git a/src/work_flow.proto b/src/work_flow.proto index ed8db54..4498869 100644 --- a/src/work_flow.proto +++ b/src/work_flow.proto @@ -1,25 +1,29 @@ syntax = "proto3"; -message Parameter { - string name = 1; - ParameterType parameter_type = 2; +message WorkflowParameterSchema { + string type = 1; + string title =2; + optional string description = 3; + optional string default = 4; + optional string format = 5; + repeated string enum = 6; + optional double minimum = 7; + optional double maximum = 8; +} - enum ParameterType { - STRING = 0; - INTEGER = 1; - DOUBLE = 2; - DATETIME = 3; - } +message WorkflowParameter { + string key_name = 1; + WorkflowParameterSchema schema = 2; } -message WorkFlow { +message Workflow { string type_name = 1; string type_description = 2; - repeated Parameter additional_parameters = 3; + repeated WorkflowParameter parameters = 3; } -message AvailableWorkFlows { - repeated WorkFlow work_flows = 1; +message AvailableWorkflows { + repeated Workflow workflows = 1; } message RequestAvailableWorkflows {}