restate-sdk-shared-core 0.10.0

SDK Shared core
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
// This file is @generated by prost-build.
/// Type: 0x0000 + 0
#[allow(dead_code)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartMessage {
    /// Unique id of the invocation. This id is unique across invocations and won't change when replaying the journal.
    #[prost(bytes = "bytes", tag = "1")]
    pub id: ::prost::bytes::Bytes,
    /// Invocation id that can be used for logging.
    /// The user can use this id to address this invocation in admin and status introspection apis.
    #[prost(string, tag = "2")]
    pub debug_id: ::prost::alloc::string::String,
    /// This is the sum of known commands + notifications
    #[prost(uint32, tag = "3")]
    pub known_entries: u32,
    /// protolint:disable:next REPEATED_FIELD_NAMES_PLURALIZED
    #[prost(message, repeated, tag = "4")]
    pub state_map: ::prost::alloc::vec::Vec<start_message::StateEntry>,
    #[prost(bool, tag = "5")]
    pub partial_state: bool,
    /// If this invocation has a key associated (e.g. for objects and workflows), then this key is filled in. Empty otherwise.
    #[prost(string, tag = "6")]
    pub key: ::prost::alloc::string::String,
    /// Retry count since the last stored entry.
    ///
    /// Please note that this count might not be accurate, as it's not durably stored,
    /// thus it might get reset in case Restate crashes/changes leader.
    #[prost(uint32, tag = "7")]
    pub retry_count_since_last_stored_entry: u32,
    /// Duration since the last stored entry, in milliseconds.
    ///
    /// Please note this duration might not be accurate,
    /// and might change depending on which Restate replica executes the request.
    #[prost(uint64, tag = "8")]
    pub duration_since_last_stored_entry: u64,
    /// Random seed to use to seed the deterministic RNG exposed in the context API.
    /// This will be stable across restarts.
    #[prost(uint64, tag = "9")]
    pub random_seed: u64,
}
/// Nested message and enum types in `StartMessage`.
pub mod start_message {
    #[allow(dead_code)]
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct StateEntry {
        #[prost(bytes = "bytes", tag = "1")]
        pub key: ::prost::bytes::Bytes,
        /// If value is an empty byte array,
        /// then it means the value is empty and not "missing" (e.g. empty string).
        #[prost(bytes = "bytes", tag = "2")]
        pub value: ::prost::bytes::Bytes,
    }
}
/// Type: 0x0000 + 1
/// Implementations MUST send this message when suspending an invocation.
///
/// These lists represent any of the notification_idx and/or notification_name the invocation is waiting on to progress.
/// The runtime will resume the invocation as soon as either one of the given notification_idx or notification_name is completed.
/// Between the two lists there MUST be at least one element.
#[allow(dead_code)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SuspensionMessage {
    #[prost(uint32, repeated, tag = "1")]
    pub waiting_completions: ::prost::alloc::vec::Vec<u32>,
    #[prost(uint32, repeated, tag = "2")]
    pub waiting_signals: ::prost::alloc::vec::Vec<u32>,
    #[prost(string, repeated, tag = "3")]
    pub waiting_named_signals: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Type: 0x0000 + 2
#[allow(dead_code)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ErrorMessage {
    /// The code can be any HTTP status code, as described <https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml.>
    /// In addition, we define the following error codes that MAY be used by the SDK for better error reporting:
    /// * JOURNAL_MISMATCH = 570, that is when the SDK cannot replay a journal due to the mismatch between the journal and the actual code.
    /// * PROTOCOL_VIOLATION = 571, that is when the SDK receives an unexpected message or an expected message variant, given its state.
    #[prost(uint32, tag = "1")]
    pub code: u32,
    /// Contains a concise error message, e.g. Throwable#getMessage() in Java.
    #[prost(string, tag = "2")]
    pub message: ::prost::alloc::string::String,
    /// The exception stacktrace, if available.
    #[prost(string, tag = "3")]
    pub stacktrace: ::prost::alloc::string::String,
    /// Command that caused the failure. This may be outside the current stored journal size.
    /// If no specific entry caused the failure, the current replayed/processed entry can be used.
    #[prost(uint32, optional, tag = "4")]
    pub related_command_index: ::core::option::Option<u32>,
    /// Name of the entry that caused the failure.
    #[prost(string, optional, tag = "5")]
    pub related_command_name: ::core::option::Option<::prost::alloc::string::String>,
    /// Command type.
    #[prost(uint32, optional, tag = "6")]
    pub related_command_type: ::core::option::Option<u32>,
    /// Delay before executing the next retry, specified as duration in milliseconds.
    /// If provided, it will override the default retry policy used by Restate's invoker ONLY for the next retry attempt.
    #[prost(uint64, optional, tag = "8")]
    pub next_retry_delay: ::core::option::Option<u64>,
}
/// Type: 0x0000 + 3
/// Implementations MUST send this message when the invocation lifecycle ends.
#[allow(dead_code)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EndMessage {}
/// Type: 0x0000 + 4
#[allow(dead_code)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CommandAckMessage {
    #[prost(uint32, tag = "1")]
    pub command_index: u32,
}
/// This is a special control message to propose ctx.run completions to the runtime.
/// This won't be written to the journal immediately, but will appear later as a new notification (meaning the result was stored).
///
/// Type: 0x0000 + 5
#[allow(dead_code)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProposeRunCompletionMessage {
    #[prost(uint32, tag = "1")]
    pub result_completion_id: u32,
    #[prost(oneof = "propose_run_completion_message::Result", tags = "14, 15")]
    pub result: ::core::option::Option<propose_run_completion_message::Result>,
}
/// Nested message and enum types in `ProposeRunCompletionMessage`.
pub mod propose_run_completion_message {
    #[allow(dead_code)]
    #[allow(clippy::enum_variant_names)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Result {
        #[prost(bytes, tag = "14")]
        Value(::prost::bytes::Bytes),
        #[prost(message, tag = "15")]
        Failure(super::Failure),
    }
}
/// A notification message follows the following duck-type:
///
#[allow(dead_code)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NotificationTemplate {
    #[prost(oneof = "notification_template::Id", tags = "1, 2, 3")]
    pub id: ::core::option::Option<notification_template::Id>,
    #[prost(oneof = "notification_template::Result", tags = "4, 5, 6, 16, 17")]
    pub result: ::core::option::Option<notification_template::Result>,
}
/// Nested message and enum types in `NotificationTemplate`.
pub mod notification_template {
    #[allow(dead_code)]
    #[allow(clippy::enum_variant_names)]
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Id {
        #[prost(uint32, tag = "1")]
        CompletionId(u32),
        #[prost(uint32, tag = "2")]
        SignalId(u32),
        #[prost(string, tag = "3")]
        SignalName(::prost::alloc::string::String),
    }
    #[allow(dead_code)]
    #[allow(clippy::enum_variant_names)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Result {
        #[prost(message, tag = "4")]
        Void(super::Void),
        #[prost(message, tag = "5")]
        Value(super::Value),
        #[prost(message, tag = "6")]
        Failure(super::Failure),
        /// Used by specific commands
        #[prost(string, tag = "16")]
        InvocationId(::prost::alloc::string::String),
        #[prost(message, tag = "17")]
        StateKeys(super::StateKeys),
    }
}
/// Completable: No
/// Fallible: No
/// Type: 0x0400 + 0
#[allow(dead_code)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InputCommandMessage {
    #[prost(message, repeated, tag = "1")]
    pub headers: ::prost::alloc::vec::Vec<Header>,
    #[prost(message, optional, tag = "14")]
    pub value: ::core::option::Option<Value>,
    /// Entry name
    #[prost(string, tag = "12")]
    pub name: ::prost::alloc::string::String,
}
/// Completable: No
/// Fallible: No
/// Type: 0x0400 + 1
#[allow(dead_code)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OutputCommandMessage {
    /// Entry name
    #[prost(string, tag = "12")]
    pub name: ::prost::alloc::string::String,
    #[prost(oneof = "output_command_message::Result", tags = "14, 15")]
    pub result: ::core::option::Option<output_command_message::Result>,
}
/// Nested message and enum types in `OutputCommandMessage`.
pub mod output_command_message {
    #[allow(dead_code)]
    #[allow(clippy::enum_variant_names)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Result {
        #[prost(message, tag = "14")]
        Value(super::Value),
        #[prost(message, tag = "15")]
        Failure(super::Failure),
    }
}
/// Completable: Yes
/// Fallible: No
/// Type: 0x0400 + 2
#[allow(dead_code)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetLazyStateCommandMessage {
    #[prost(bytes = "bytes", tag = "1")]
    pub key: ::prost::bytes::Bytes,
    #[prost(uint32, tag = "11")]
    pub result_completion_id: u32,
    #[prost(string, tag = "12")]
    pub name: ::prost::alloc::string::String,
}
/// Notification for GetLazyStateCommandMessage
/// Type: 0x8000 + 2
#[allow(dead_code)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetLazyStateCompletionNotificationMessage {
    #[prost(uint32, tag = "1")]
    pub completion_id: u32,
    #[prost(
        oneof = "get_lazy_state_completion_notification_message::Result",
        tags = "4, 5"
    )]
    pub result: ::core::option::Option<
        get_lazy_state_completion_notification_message::Result,
    >,
}
/// Nested message and enum types in `GetLazyStateCompletionNotificationMessage`.
pub mod get_lazy_state_completion_notification_message {
    #[allow(dead_code)]
    #[allow(clippy::enum_variant_names)]
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Result {
        #[prost(message, tag = "4")]
        Void(super::Void),
        #[prost(message, tag = "5")]
        Value(super::Value),
    }
}
/// Completable: No
/// Fallible: No
/// Type: 0x0400 + 3
#[allow(dead_code)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SetStateCommandMessage {
    #[prost(bytes = "bytes", tag = "1")]
    pub key: ::prost::bytes::Bytes,
    #[prost(message, optional, tag = "3")]
    pub value: ::core::option::Option<Value>,
    /// Entry name
    #[prost(string, tag = "12")]
    pub name: ::prost::alloc::string::String,
}
/// Completable: No
/// Fallible: No
/// Type: 0x0400 + 4
#[allow(dead_code)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ClearStateCommandMessage {
    #[prost(bytes = "bytes", tag = "1")]
    pub key: ::prost::bytes::Bytes,
    /// Entry name
    #[prost(string, tag = "12")]
    pub name: ::prost::alloc::string::String,
}
/// Completable: No
/// Fallible: No
/// Type: 0x0400 + 5
#[allow(dead_code)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ClearAllStateCommandMessage {
    /// Entry name
    #[prost(string, tag = "12")]
    pub name: ::prost::alloc::string::String,
}
/// Completable: Yes
/// Fallible: No
/// Type: 0x0400 + 6
#[allow(dead_code)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetLazyStateKeysCommandMessage {
    #[prost(uint32, tag = "11")]
    pub result_completion_id: u32,
    #[prost(string, tag = "12")]
    pub name: ::prost::alloc::string::String,
}
/// Notification for GetLazyStateKeysCommandMessage
/// Type: 0x8000 + 6
#[allow(dead_code)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetLazyStateKeysCompletionNotificationMessage {
    #[prost(uint32, tag = "1")]
    pub completion_id: u32,
    #[prost(message, optional, tag = "17")]
    pub state_keys: ::core::option::Option<StateKeys>,
}
/// Completable: No
/// Fallible: No
/// Type: 0x0400 + 7
#[allow(dead_code)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetEagerStateCommandMessage {
    #[prost(bytes = "bytes", tag = "1")]
    pub key: ::prost::bytes::Bytes,
    /// Entry name
    #[prost(string, tag = "12")]
    pub name: ::prost::alloc::string::String,
    #[prost(oneof = "get_eager_state_command_message::Result", tags = "13, 14")]
    pub result: ::core::option::Option<get_eager_state_command_message::Result>,
}
/// Nested message and enum types in `GetEagerStateCommandMessage`.
pub mod get_eager_state_command_message {
    #[allow(dead_code)]
    #[allow(clippy::enum_variant_names)]
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Result {
        #[prost(message, tag = "13")]
        Void(super::Void),
        #[prost(message, tag = "14")]
        Value(super::Value),
    }
}
/// Completable: No
/// Fallible: No
/// Type: 0x0400 + 8
#[allow(dead_code)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetEagerStateKeysCommandMessage {
    #[prost(message, optional, tag = "14")]
    pub value: ::core::option::Option<StateKeys>,
    /// Entry name
    #[prost(string, tag = "12")]
    pub name: ::prost::alloc::string::String,
}
/// Completable: Yes
/// Fallible: No
/// Type: 0x0400 + 9
#[allow(dead_code)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetPromiseCommandMessage {
    #[prost(string, tag = "1")]
    pub key: ::prost::alloc::string::String,
    #[prost(uint32, tag = "11")]
    pub result_completion_id: u32,
    #[prost(string, tag = "12")]
    pub name: ::prost::alloc::string::String,
}
/// Notification for GetPromiseCommandMessage
/// Type: 0x8000 + 9
#[allow(dead_code)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetPromiseCompletionNotificationMessage {
    #[prost(uint32, tag = "1")]
    pub completion_id: u32,
    #[prost(
        oneof = "get_promise_completion_notification_message::Result",
        tags = "5, 6"
    )]
    pub result: ::core::option::Option<
        get_promise_completion_notification_message::Result,
    >,
}
/// Nested message and enum types in `GetPromiseCompletionNotificationMessage`.
pub mod get_promise_completion_notification_message {
    #[allow(dead_code)]
    #[allow(clippy::enum_variant_names)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Result {
        #[prost(message, tag = "5")]
        Value(super::Value),
        #[prost(message, tag = "6")]
        Failure(super::Failure),
    }
}
/// Completable: Yes
/// Fallible: No
/// Type: 0x0400 + A
#[allow(dead_code)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PeekPromiseCommandMessage {
    #[prost(string, tag = "1")]
    pub key: ::prost::alloc::string::String,
    #[prost(uint32, tag = "11")]
    pub result_completion_id: u32,
    #[prost(string, tag = "12")]
    pub name: ::prost::alloc::string::String,
}
/// Notification for PeekPromiseCommandMessage
/// Type: 0x8000 + A
#[allow(dead_code)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PeekPromiseCompletionNotificationMessage {
    #[prost(uint32, tag = "1")]
    pub completion_id: u32,
    #[prost(
        oneof = "peek_promise_completion_notification_message::Result",
        tags = "4, 5, 6"
    )]
    pub result: ::core::option::Option<
        peek_promise_completion_notification_message::Result,
    >,
}
/// Nested message and enum types in `PeekPromiseCompletionNotificationMessage`.
pub mod peek_promise_completion_notification_message {
    #[allow(dead_code)]
    #[allow(clippy::enum_variant_names)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Result {
        #[prost(message, tag = "4")]
        Void(super::Void),
        #[prost(message, tag = "5")]
        Value(super::Value),
        #[prost(message, tag = "6")]
        Failure(super::Failure),
    }
}
/// Completable: Yes
/// Fallible: No
/// Type: 0x0400 + B
#[allow(dead_code)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompletePromiseCommandMessage {
    #[prost(string, tag = "1")]
    pub key: ::prost::alloc::string::String,
    #[prost(uint32, tag = "11")]
    pub result_completion_id: u32,
    #[prost(string, tag = "12")]
    pub name: ::prost::alloc::string::String,
    /// The value to use to complete the promise
    #[prost(oneof = "complete_promise_command_message::Completion", tags = "2, 3")]
    pub completion: ::core::option::Option<complete_promise_command_message::Completion>,
}
/// Nested message and enum types in `CompletePromiseCommandMessage`.
pub mod complete_promise_command_message {
    /// The value to use to complete the promise
    #[allow(dead_code)]
    #[allow(clippy::enum_variant_names)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Completion {
        #[prost(message, tag = "2")]
        CompletionValue(super::Value),
        #[prost(message, tag = "3")]
        CompletionFailure(super::Failure),
    }
}
/// Notification for CompletePromiseCommandMessage
/// Type: 0x8000 + B
#[allow(dead_code)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompletePromiseCompletionNotificationMessage {
    #[prost(uint32, tag = "1")]
    pub completion_id: u32,
    #[prost(
        oneof = "complete_promise_completion_notification_message::Result",
        tags = "4, 6"
    )]
    pub result: ::core::option::Option<
        complete_promise_completion_notification_message::Result,
    >,
}
/// Nested message and enum types in `CompletePromiseCompletionNotificationMessage`.
pub mod complete_promise_completion_notification_message {
    #[allow(dead_code)]
    #[allow(clippy::enum_variant_names)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Result {
        #[prost(message, tag = "4")]
        Void(super::Void),
        #[prost(message, tag = "6")]
        Failure(super::Failure),
    }
}
/// Completable: Yes
/// Fallible: No
/// Type: 0x0400 + C
#[allow(dead_code)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SleepCommandMessage {
    /// Wake up time.
    /// The time is set as duration since UNIX Epoch.
    #[prost(uint64, tag = "1")]
    pub wake_up_time: u64,
    #[prost(uint32, tag = "11")]
    pub result_completion_id: u32,
    #[prost(string, tag = "12")]
    pub name: ::prost::alloc::string::String,
}
/// Notification for SleepCommandMessage
/// Type: 0x8000 + C
#[allow(dead_code)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SleepCompletionNotificationMessage {
    #[prost(uint32, tag = "1")]
    pub completion_id: u32,
    #[prost(message, optional, tag = "4")]
    pub void: ::core::option::Option<Void>,
}
/// Completable: Yes (two notifications: one with invocation id, then one with the actual result)
/// Fallible: Yes
/// Type: 0x0400 + D
#[allow(dead_code)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CallCommandMessage {
    #[prost(string, tag = "1")]
    pub service_name: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub handler_name: ::prost::alloc::string::String,
    #[prost(bytes = "bytes", tag = "3")]
    pub parameter: ::prost::bytes::Bytes,
    #[prost(message, repeated, tag = "4")]
    pub headers: ::prost::alloc::vec::Vec<Header>,
    /// If this invocation has a key associated (e.g. for objects and workflows), then this key is filled in. Empty otherwise.
    #[prost(string, tag = "5")]
    pub key: ::prost::alloc::string::String,
    /// If present, it must be non empty.
    #[prost(string, optional, tag = "6")]
    pub idempotency_key: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(uint32, tag = "10")]
    pub invocation_id_notification_idx: u32,
    #[prost(uint32, tag = "11")]
    pub result_completion_id: u32,
    #[prost(string, tag = "12")]
    pub name: ::prost::alloc::string::String,
}
/// Notification for CallCommandMessage and OneWayCallCommandMessage
/// Type: 0x8000 + E
#[allow(dead_code)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CallInvocationIdCompletionNotificationMessage {
    #[prost(uint32, tag = "1")]
    pub completion_id: u32,
    #[prost(string, tag = "16")]
    pub invocation_id: ::prost::alloc::string::String,
}
/// Notification for CallCommandMessage
/// Type: 0x8000 + D
#[allow(dead_code)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CallCompletionNotificationMessage {
    #[prost(uint32, tag = "1")]
    pub completion_id: u32,
    #[prost(oneof = "call_completion_notification_message::Result", tags = "5, 6")]
    pub result: ::core::option::Option<call_completion_notification_message::Result>,
}
/// Nested message and enum types in `CallCompletionNotificationMessage`.
pub mod call_completion_notification_message {
    #[allow(dead_code)]
    #[allow(clippy::enum_variant_names)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Result {
        #[prost(message, tag = "5")]
        Value(super::Value),
        #[prost(message, tag = "6")]
        Failure(super::Failure),
    }
}
/// Completable: Yes (only one notification with invocation id)
/// Fallible: Yes
/// Type: 0x0400 + E
#[allow(dead_code)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OneWayCallCommandMessage {
    #[prost(string, tag = "1")]
    pub service_name: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub handler_name: ::prost::alloc::string::String,
    #[prost(bytes = "bytes", tag = "3")]
    pub parameter: ::prost::bytes::Bytes,
    /// Time when this BackgroundInvoke should be executed.
    /// The time is set as duration since UNIX Epoch.
    /// If this value is not set, equal to 0, or past in time,
    /// the runtime will execute this BackgroundInvoke as soon as possible.
    #[prost(uint64, tag = "4")]
    pub invoke_time: u64,
    #[prost(message, repeated, tag = "5")]
    pub headers: ::prost::alloc::vec::Vec<Header>,
    /// If this invocation has a key associated (e.g. for objects and workflows), then this key is filled in. Empty otherwise.
    #[prost(string, tag = "6")]
    pub key: ::prost::alloc::string::String,
    /// If present, it must be non empty.
    #[prost(string, optional, tag = "7")]
    pub idempotency_key: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(uint32, tag = "10")]
    pub invocation_id_notification_idx: u32,
    #[prost(string, tag = "12")]
    pub name: ::prost::alloc::string::String,
}
/// Completable: No
/// Fallible: Yes
/// Type: 0x04000 + 10
#[allow(dead_code)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SendSignalCommandMessage {
    #[prost(string, tag = "1")]
    pub target_invocation_id: ::prost::alloc::string::String,
    /// Cannot use the field 'name' here because used above
    #[prost(string, tag = "12")]
    pub entry_name: ::prost::alloc::string::String,
    #[prost(oneof = "send_signal_command_message::SignalId", tags = "2, 3")]
    pub signal_id: ::core::option::Option<send_signal_command_message::SignalId>,
    #[prost(oneof = "send_signal_command_message::Result", tags = "4, 5, 6")]
    pub result: ::core::option::Option<send_signal_command_message::Result>,
}
/// Nested message and enum types in `SendSignalCommandMessage`.
pub mod send_signal_command_message {
    #[allow(dead_code)]
    #[allow(clippy::enum_variant_names)]
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum SignalId {
        #[prost(uint32, tag = "2")]
        Idx(u32),
        #[prost(string, tag = "3")]
        Name(::prost::alloc::string::String),
    }
    #[allow(dead_code)]
    #[allow(clippy::enum_variant_names)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Result {
        #[prost(message, tag = "4")]
        Void(super::Void),
        #[prost(message, tag = "5")]
        Value(super::Value),
        #[prost(message, tag = "6")]
        Failure(super::Failure),
    }
}
/// Proposals for Run completions are sent through ProposeRunCompletionMessage
///
/// Completable: Yes
/// Fallible: No
/// Type: 0x0400 + 11
#[allow(dead_code)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RunCommandMessage {
    #[prost(uint32, tag = "11")]
    pub result_completion_id: u32,
    #[prost(string, tag = "12")]
    pub name: ::prost::alloc::string::String,
}
/// Notification for RunCommandMessage
/// Type: 0x8000 + 11
#[allow(dead_code)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RunCompletionNotificationMessage {
    #[prost(uint32, tag = "1")]
    pub completion_id: u32,
    #[prost(oneof = "run_completion_notification_message::Result", tags = "5, 6")]
    pub result: ::core::option::Option<run_completion_notification_message::Result>,
}
/// Nested message and enum types in `RunCompletionNotificationMessage`.
pub mod run_completion_notification_message {
    #[allow(dead_code)]
    #[allow(clippy::enum_variant_names)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Result {
        #[prost(message, tag = "5")]
        Value(super::Value),
        #[prost(message, tag = "6")]
        Failure(super::Failure),
    }
}
/// Completable: Yes
/// Fallible: Yes
/// Type: 0x0400 + 12
#[allow(dead_code)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AttachInvocationCommandMessage {
    #[prost(uint32, tag = "11")]
    pub result_completion_id: u32,
    #[prost(string, tag = "12")]
    pub name: ::prost::alloc::string::String,
    #[prost(oneof = "attach_invocation_command_message::Target", tags = "1, 3, 4")]
    pub target: ::core::option::Option<attach_invocation_command_message::Target>,
}
/// Nested message and enum types in `AttachInvocationCommandMessage`.
pub mod attach_invocation_command_message {
    #[allow(dead_code)]
    #[allow(clippy::enum_variant_names)]
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Target {
        /// Target invocation id
        #[prost(string, tag = "1")]
        InvocationId(::prost::alloc::string::String),
        /// Target idempotent request
        #[prost(message, tag = "3")]
        IdempotentRequestTarget(super::IdempotentRequestTarget),
        /// Target workflow target
        #[prost(message, tag = "4")]
        WorkflowTarget(super::WorkflowTarget),
    }
}
/// Notification for AttachInvocationCommandMessage
/// Type: 0x8000 + 12
#[allow(dead_code)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AttachInvocationCompletionNotificationMessage {
    #[prost(uint32, tag = "1")]
    pub completion_id: u32,
    #[prost(
        oneof = "attach_invocation_completion_notification_message::Result",
        tags = "5, 6"
    )]
    pub result: ::core::option::Option<
        attach_invocation_completion_notification_message::Result,
    >,
}
/// Nested message and enum types in `AttachInvocationCompletionNotificationMessage`.
pub mod attach_invocation_completion_notification_message {
    #[allow(dead_code)]
    #[allow(clippy::enum_variant_names)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Result {
        #[prost(message, tag = "5")]
        Value(super::Value),
        #[prost(message, tag = "6")]
        Failure(super::Failure),
    }
}
/// Completable: Yes
/// Fallible: Yes
/// Type: 0x0400 + 13
#[allow(dead_code)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetInvocationOutputCommandMessage {
    #[prost(uint32, tag = "11")]
    pub result_completion_id: u32,
    #[prost(string, tag = "12")]
    pub name: ::prost::alloc::string::String,
    #[prost(oneof = "get_invocation_output_command_message::Target", tags = "1, 3, 4")]
    pub target: ::core::option::Option<get_invocation_output_command_message::Target>,
}
/// Nested message and enum types in `GetInvocationOutputCommandMessage`.
pub mod get_invocation_output_command_message {
    #[allow(dead_code)]
    #[allow(clippy::enum_variant_names)]
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Target {
        /// Target invocation id
        #[prost(string, tag = "1")]
        InvocationId(::prost::alloc::string::String),
        /// Target idempotent request
        #[prost(message, tag = "3")]
        IdempotentRequestTarget(super::IdempotentRequestTarget),
        /// Target workflow target
        #[prost(message, tag = "4")]
        WorkflowTarget(super::WorkflowTarget),
    }
}
/// Notification for GetInvocationOutputCommandMessage
/// Type: 0x8000 + 13
#[allow(dead_code)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetInvocationOutputCompletionNotificationMessage {
    #[prost(uint32, tag = "1")]
    pub completion_id: u32,
    #[prost(
        oneof = "get_invocation_output_completion_notification_message::Result",
        tags = "4, 5, 6"
    )]
    pub result: ::core::option::Option<
        get_invocation_output_completion_notification_message::Result,
    >,
}
/// Nested message and enum types in `GetInvocationOutputCompletionNotificationMessage`.
pub mod get_invocation_output_completion_notification_message {
    #[allow(dead_code)]
    #[allow(clippy::enum_variant_names)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Result {
        #[prost(message, tag = "4")]
        Void(super::Void),
        #[prost(message, tag = "5")]
        Value(super::Value),
        #[prost(message, tag = "6")]
        Failure(super::Failure),
    }
}
/// We have this for backward compatibility, because we need to parse both old and new awakeable id.
/// Completable: No
/// Fallible: Yes
/// Type: 0x0400 + 14
#[allow(dead_code)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompleteAwakeableCommandMessage {
    #[prost(string, tag = "1")]
    pub awakeable_id: ::prost::alloc::string::String,
    /// Cannot use the field 'name' here because used above
    #[prost(string, tag = "12")]
    pub name: ::prost::alloc::string::String,
    #[prost(oneof = "complete_awakeable_command_message::Result", tags = "2, 3")]
    pub result: ::core::option::Option<complete_awakeable_command_message::Result>,
}
/// Nested message and enum types in `CompleteAwakeableCommandMessage`.
pub mod complete_awakeable_command_message {
    #[allow(dead_code)]
    #[allow(clippy::enum_variant_names)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Result {
        #[prost(message, tag = "2")]
        Value(super::Value),
        #[prost(message, tag = "3")]
        Failure(super::Failure),
    }
}
/// Notification message for signals
/// Type: 0xFBFF
#[allow(dead_code)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SignalNotificationMessage {
    #[prost(oneof = "signal_notification_message::SignalId", tags = "2, 3")]
    pub signal_id: ::core::option::Option<signal_notification_message::SignalId>,
    #[prost(oneof = "signal_notification_message::Result", tags = "4, 5, 6")]
    pub result: ::core::option::Option<signal_notification_message::Result>,
}
/// Nested message and enum types in `SignalNotificationMessage`.
pub mod signal_notification_message {
    #[allow(dead_code)]
    #[allow(clippy::enum_variant_names)]
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum SignalId {
        #[prost(uint32, tag = "2")]
        Idx(u32),
        #[prost(string, tag = "3")]
        Name(::prost::alloc::string::String),
    }
    #[allow(dead_code)]
    #[allow(clippy::enum_variant_names)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Result {
        #[prost(message, tag = "4")]
        Void(super::Void),
        #[prost(message, tag = "5")]
        Value(super::Value),
        #[prost(message, tag = "6")]
        Failure(super::Failure),
    }
}
#[allow(dead_code)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StateKeys {
    #[prost(bytes = "bytes", repeated, tag = "1")]
    pub keys: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
}
#[allow(dead_code)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Value {
    #[prost(bytes = "bytes", tag = "1")]
    pub content: ::prost::bytes::Bytes,
}
/// This failure object carries user visible errors,
/// e.g. invocation failure return value or failure result of an InvokeCommandMessage.
#[allow(dead_code)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Failure {
    /// The code can be any HTTP status code, as described <https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml.>
    #[prost(uint32, tag = "1")]
    pub code: u32,
    /// Contains a concise error message, e.g. Throwable#getMessage() in Java.
    #[prost(string, tag = "2")]
    pub message: ::prost::alloc::string::String,
    /// Error metadata
    #[prost(message, repeated, tag = "3")]
    pub metadata: ::prost::alloc::vec::Vec<FailureMetadata>,
}
#[allow(dead_code)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FailureMetadata {
    #[prost(string, tag = "1")]
    pub key: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub value: ::prost::alloc::string::String,
}
#[allow(dead_code)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Header {
    #[prost(string, tag = "1")]
    pub key: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub value: ::prost::alloc::string::String,
}
#[allow(dead_code)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct WorkflowTarget {
    #[prost(string, tag = "1")]
    pub workflow_name: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub workflow_key: ::prost::alloc::string::String,
}
#[allow(dead_code)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct IdempotentRequestTarget {
    #[prost(string, tag = "1")]
    pub service_name: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "2")]
    pub service_key: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, tag = "3")]
    pub handler_name: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub idempotency_key: ::prost::alloc::string::String,
}
#[allow(dead_code)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Void {}
/// Service protocol version.
#[allow(dead_code)]
#[allow(clippy::enum_variant_names)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ServiceProtocolVersion {
    Unspecified = 0,
    /// initial service protocol version
    V1 = 1,
    /// Added
    /// * Entry retry mechanism: ErrorMessage.next_retry_delay, StartMessage.retry_count_since_last_stored_entry and StartMessage.duration_since_last_stored_entry
    V2 = 2,
    /// **Yanked**
    V3 = 3,
    /// **Yanked**
    V4 = 4,
    /// Immutable journal. Added:
    /// * New command to cancel invocations
    /// * Both Call and Send commands now return an additional notification to return the invocation id
    /// * New field to set idempotency key for Call/Send commands
    /// * New command to attach to existing invocation
    /// * New command to get output of existing invocation
    V5 = 5,
    /// Added:
    /// * StartMessage.random_seed
    /// * Failure.metadata
    V6 = 6,
}
impl ServiceProtocolVersion {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "SERVICE_PROTOCOL_VERSION_UNSPECIFIED",
            Self::V1 => "V1",
            Self::V2 => "V2",
            Self::V3 => "V3",
            Self::V4 => "V4",
            Self::V5 => "V5",
            Self::V6 => "V6",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "SERVICE_PROTOCOL_VERSION_UNSPECIFIED" => Some(Self::Unspecified),
            "V1" => Some(Self::V1),
            "V2" => Some(Self::V2),
            "V3" => Some(Self::V3),
            "V4" => Some(Self::V4),
            "V5" => Some(Self::V5),
            "V6" => Some(Self::V6),
            _ => None,
        }
    }
}
#[allow(dead_code)]
#[allow(clippy::enum_variant_names)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum BuiltInSignal {
    Unknown = 0,
    Cancel = 1,
}
impl BuiltInSignal {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unknown => "UNKNOWN",
            Self::Cancel => "CANCEL",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "UNKNOWN" => Some(Self::Unknown),
            "CANCEL" => Some(Self::Cancel),
            _ => None,
        }
    }
}