Skip to content

Commit fb0214b

Browse files
authored
Merge pull request #157 from stealthrocket/creation-expiration-time
Creation/expiration time
2 parents a47ae12 + 34e0f66 commit fb0214b

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

src/dispatch/proto.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ class Input:
5555
"dispatch_id",
5656
"parent_dispatch_id",
5757
"root_dispatch_id",
58+
"creation_time",
59+
"expiration_time",
5860
"_has_input",
5961
"_input",
6062
"_coroutine_state",
@@ -66,6 +68,12 @@ def __init__(self, req: function_pb.RunRequest):
6668
self.dispatch_id = req.dispatch_id
6769
self.parent_dispatch_id = req.parent_dispatch_id
6870
self.root_dispatch_id = req.root_dispatch_id
71+
self.creation_time = (
72+
req.creation_time.ToDatetime() if req.creation_time else None
73+
)
74+
self.expiration_time = (
75+
req.expiration_time.ToDatetime() if req.expiration_time else None
76+
)
6977

7078
self._has_input = req.HasField("input")
7179
if self._has_input:

src/dispatch/sdk/v1/function_pb2.py

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/dispatch/sdk/v1/function_pb2.pyi

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ from typing import Union as _Union
66
from google.protobuf import any_pb2 as _any_pb2
77
from google.protobuf import descriptor as _descriptor
88
from google.protobuf import message as _message
9+
from google.protobuf import timestamp_pb2 as _timestamp_pb2
910

1011
from dispatch.sdk.v1 import exit_pb2 as _exit_pb2
1112
from dispatch.sdk.v1 import poll_pb2 as _poll_pb2
@@ -21,19 +22,25 @@ class RunRequest(_message.Message):
2122
"dispatch_id",
2223
"parent_dispatch_id",
2324
"root_dispatch_id",
25+
"creation_time",
26+
"expiration_time",
2427
)
2528
FUNCTION_FIELD_NUMBER: _ClassVar[int]
2629
INPUT_FIELD_NUMBER: _ClassVar[int]
2730
POLL_RESULT_FIELD_NUMBER: _ClassVar[int]
2831
DISPATCH_ID_FIELD_NUMBER: _ClassVar[int]
2932
PARENT_DISPATCH_ID_FIELD_NUMBER: _ClassVar[int]
3033
ROOT_DISPATCH_ID_FIELD_NUMBER: _ClassVar[int]
34+
CREATION_TIME_FIELD_NUMBER: _ClassVar[int]
35+
EXPIRATION_TIME_FIELD_NUMBER: _ClassVar[int]
3136
function: str
3237
input: _any_pb2.Any
3338
poll_result: _poll_pb2.PollResult
3439
dispatch_id: str
3540
parent_dispatch_id: str
3641
root_dispatch_id: str
42+
creation_time: _timestamp_pb2.Timestamp
43+
expiration_time: _timestamp_pb2.Timestamp
3744
def __init__(
3845
self,
3946
function: _Optional[str] = ...,
@@ -42,6 +49,8 @@ class RunRequest(_message.Message):
4249
dispatch_id: _Optional[str] = ...,
4350
parent_dispatch_id: _Optional[str] = ...,
4451
root_dispatch_id: _Optional[str] = ...,
52+
creation_time: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ...,
53+
expiration_time: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ...,
4554
) -> None: ...
4655

4756
class RunResponse(_message.Message):

0 commit comments

Comments
 (0)