diff --git a/src/dispatch/proto.py b/src/dispatch/proto.py index 7910413..90f6ec4 100644 --- a/src/dispatch/proto.py +++ b/src/dispatch/proto.py @@ -55,6 +55,8 @@ class Input: "dispatch_id", "parent_dispatch_id", "root_dispatch_id", + "creation_time", + "expiration_time", "_has_input", "_input", "_coroutine_state", @@ -66,6 +68,12 @@ def __init__(self, req: function_pb.RunRequest): self.dispatch_id = req.dispatch_id self.parent_dispatch_id = req.parent_dispatch_id self.root_dispatch_id = req.root_dispatch_id + self.creation_time = ( + req.creation_time.ToDatetime() if req.creation_time else None + ) + self.expiration_time = ( + req.expiration_time.ToDatetime() if req.expiration_time else None + ) self._has_input = req.HasField("input") if self._has_input: diff --git a/src/dispatch/sdk/v1/function_pb2.py b/src/dispatch/sdk/v1/function_pb2.py index c5e970f..4d7224e 100644 --- a/src/dispatch/sdk/v1/function_pb2.py +++ b/src/dispatch/sdk/v1/function_pb2.py @@ -14,13 +14,14 @@ from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 from dispatch.sdk.v1 import exit_pb2 as dispatch_dot_sdk_dot_v1_dot_exit__pb2 from dispatch.sdk.v1 import poll_pb2 as dispatch_dot_sdk_dot_v1_dot_poll__pb2 from dispatch.sdk.v1 import status_pb2 as dispatch_dot_sdk_dot_v1_dot_status__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x1e\x64ispatch/sdk/v1/function.proto\x12\x0f\x64ispatch.sdk.v1\x1a\x1a\x64ispatch/sdk/v1/exit.proto\x1a\x1a\x64ispatch/sdk/v1/poll.proto\x1a\x1c\x64ispatch/sdk/v1/status.proto\x1a\x19google/protobuf/any.proto"\x9c\x02\n\nRunRequest\x12\x1a\n\x08\x66unction\x18\x01 \x01(\tR\x08\x66unction\x12,\n\x05input\x18\x02 \x01(\x0b\x32\x14.google.protobuf.AnyH\x00R\x05input\x12>\n\x0bpoll_result\x18\x03 \x01(\x0b\x32\x1b.dispatch.sdk.v1.PollResultH\x00R\npollResult\x12\x1f\n\x0b\x64ispatch_id\x18\x04 \x01(\tR\ndispatchId\x12,\n\x12parent_dispatch_id\x18\x05 \x01(\tR\x10parentDispatchId\x12(\n\x10root_dispatch_id\x18\x06 \x01(\tR\x0erootDispatchIdB\x0b\n\tdirective"\xa5\x01\n\x0bRunResponse\x12/\n\x06status\x18\x01 \x01(\x0e\x32\x17.dispatch.sdk.v1.StatusR\x06status\x12+\n\x04\x65xit\x18\x02 \x01(\x0b\x32\x15.dispatch.sdk.v1.ExitH\x00R\x04\x65xit\x12+\n\x04poll\x18\x03 \x01(\x0b\x32\x15.dispatch.sdk.v1.PollH\x00R\x04pollB\x0b\n\tdirective2U\n\x0f\x46unctionService\x12\x42\n\x03Run\x12\x1b.dispatch.sdk.v1.RunRequest\x1a\x1c.dispatch.sdk.v1.RunResponse"\x00\x42\x82\x01\n\x13\x63om.dispatch.sdk.v1B\rFunctionProtoP\x01\xa2\x02\x03\x44SX\xaa\x02\x0f\x44ispatch.Sdk.V1\xca\x02\x0f\x44ispatch\\Sdk\\V1\xe2\x02\x1b\x44ispatch\\Sdk\\V1\\GPBMetadata\xea\x02\x11\x44ispatch::Sdk::V1b\x06proto3' + b'\n\x1e\x64ispatch/sdk/v1/function.proto\x12\x0f\x64ispatch.sdk.v1\x1a\x1a\x64ispatch/sdk/v1/exit.proto\x1a\x1a\x64ispatch/sdk/v1/poll.proto\x1a\x1c\x64ispatch/sdk/v1/status.proto\x1a\x19google/protobuf/any.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xa2\x03\n\nRunRequest\x12\x1a\n\x08\x66unction\x18\x01 \x01(\tR\x08\x66unction\x12,\n\x05input\x18\x02 \x01(\x0b\x32\x14.google.protobuf.AnyH\x00R\x05input\x12>\n\x0bpoll_result\x18\x03 \x01(\x0b\x32\x1b.dispatch.sdk.v1.PollResultH\x00R\npollResult\x12\x1f\n\x0b\x64ispatch_id\x18\x04 \x01(\tR\ndispatchId\x12,\n\x12parent_dispatch_id\x18\x05 \x01(\tR\x10parentDispatchId\x12(\n\x10root_dispatch_id\x18\x06 \x01(\tR\x0erootDispatchId\x12?\n\rcreation_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x0c\x63reationTime\x12\x43\n\x0f\x65xpiration_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x0e\x65xpirationTimeB\x0b\n\tdirective"\xa5\x01\n\x0bRunResponse\x12/\n\x06status\x18\x01 \x01(\x0e\x32\x17.dispatch.sdk.v1.StatusR\x06status\x12+\n\x04\x65xit\x18\x02 \x01(\x0b\x32\x15.dispatch.sdk.v1.ExitH\x00R\x04\x65xit\x12+\n\x04poll\x18\x03 \x01(\x0b\x32\x15.dispatch.sdk.v1.PollH\x00R\x04pollB\x0b\n\tdirective2U\n\x0f\x46unctionService\x12\x42\n\x03Run\x12\x1b.dispatch.sdk.v1.RunRequest\x1a\x1c.dispatch.sdk.v1.RunResponse"\x00\x42\x82\x01\n\x13\x63om.dispatch.sdk.v1B\rFunctionProtoP\x01\xa2\x02\x03\x44SX\xaa\x02\x0f\x44ispatch.Sdk.V1\xca\x02\x0f\x44ispatch\\Sdk\\V1\xe2\x02\x1b\x44ispatch\\Sdk\\V1\\GPBMetadata\xea\x02\x11\x44ispatch::Sdk::V1b\x06proto3' ) _globals = globals() @@ -33,10 +34,10 @@ _globals["DESCRIPTOR"]._serialized_options = ( b"\n\023com.dispatch.sdk.v1B\rFunctionProtoP\001\242\002\003DSX\252\002\017Dispatch.Sdk.V1\312\002\017Dispatch\\Sdk\\V1\342\002\033Dispatch\\Sdk\\V1\\GPBMetadata\352\002\021Dispatch::Sdk::V1" ) - _globals["_RUNREQUEST"]._serialized_start = 165 - _globals["_RUNREQUEST"]._serialized_end = 449 - _globals["_RUNRESPONSE"]._serialized_start = 452 - _globals["_RUNRESPONSE"]._serialized_end = 617 - _globals["_FUNCTIONSERVICE"]._serialized_start = 619 - _globals["_FUNCTIONSERVICE"]._serialized_end = 704 + _globals["_RUNREQUEST"]._serialized_start = 198 + _globals["_RUNREQUEST"]._serialized_end = 616 + _globals["_RUNRESPONSE"]._serialized_start = 619 + _globals["_RUNRESPONSE"]._serialized_end = 784 + _globals["_FUNCTIONSERVICE"]._serialized_start = 786 + _globals["_FUNCTIONSERVICE"]._serialized_end = 871 # @@protoc_insertion_point(module_scope) diff --git a/src/dispatch/sdk/v1/function_pb2.pyi b/src/dispatch/sdk/v1/function_pb2.pyi index d291f1a..44d449b 100644 --- a/src/dispatch/sdk/v1/function_pb2.pyi +++ b/src/dispatch/sdk/v1/function_pb2.pyi @@ -6,6 +6,7 @@ from typing import Union as _Union from google.protobuf import any_pb2 as _any_pb2 from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message +from google.protobuf import timestamp_pb2 as _timestamp_pb2 from dispatch.sdk.v1 import exit_pb2 as _exit_pb2 from dispatch.sdk.v1 import poll_pb2 as _poll_pb2 @@ -21,6 +22,8 @@ class RunRequest(_message.Message): "dispatch_id", "parent_dispatch_id", "root_dispatch_id", + "creation_time", + "expiration_time", ) FUNCTION_FIELD_NUMBER: _ClassVar[int] INPUT_FIELD_NUMBER: _ClassVar[int] @@ -28,12 +31,16 @@ class RunRequest(_message.Message): DISPATCH_ID_FIELD_NUMBER: _ClassVar[int] PARENT_DISPATCH_ID_FIELD_NUMBER: _ClassVar[int] ROOT_DISPATCH_ID_FIELD_NUMBER: _ClassVar[int] + CREATION_TIME_FIELD_NUMBER: _ClassVar[int] + EXPIRATION_TIME_FIELD_NUMBER: _ClassVar[int] function: str input: _any_pb2.Any poll_result: _poll_pb2.PollResult dispatch_id: str parent_dispatch_id: str root_dispatch_id: str + creation_time: _timestamp_pb2.Timestamp + expiration_time: _timestamp_pb2.Timestamp def __init__( self, function: _Optional[str] = ..., @@ -42,6 +49,8 @@ class RunRequest(_message.Message): dispatch_id: _Optional[str] = ..., parent_dispatch_id: _Optional[str] = ..., root_dispatch_id: _Optional[str] = ..., + creation_time: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., + expiration_time: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., ) -> None: ... class RunResponse(_message.Message):