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
// This file is @generated by prost-build.
/// Definition of a job type.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobType {
/// The ID of the job type.
///
/// The ID must only contain ASCII letters (a-z, A-Z), digits (0-9), and underscores.
/// It must start with an ASCII letter (a-z, A-Z).
///
/// Examples of valid job IDs: "MyJob", "MyJob123", "send_email", "data_backup"
///
/// Optionally the ID can be prefixed with one or more namespaces
/// separated by dots. Each namespace must follow the same rules as the ID.
///
/// Examples of valid namespaced job IDs: "com.example.SendEmail", "org.myorg.jobs.MyJob", "data_service.CreateBackup"
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
/// The description of the job type.
#[prost(string, optional, tag = "3")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
/// The input JSON schema of the job type.
#[prost(string, optional, tag = "4")]
pub input_schema_json: ::core::option::Option<::prost::alloc::string::String>,
/// The output JSON schema of the job type.
#[prost(string, optional, tag = "5")]
pub output_schema_json: ::core::option::Option<::prost::alloc::string::String>,
}
impl ::prost::Name for JobType {
const NAME: &'static str = "JobType";
const PACKAGE: &'static str = "ora.jobs.v1";
fn full_name() -> ::prost::alloc::string::String {
"ora.jobs.v1.JobType".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ora.jobs.v1.JobType".into()
}
}
/// Definition of a job.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Job {
/// The ID of the job type.
#[prost(string, tag = "1")]
pub job_type_id: ::prost::alloc::string::String,
/// The target execution time of the job.
#[prost(message, optional, tag = "2")]
pub target_execution_time: ::core::option::Option<::prost_types::Timestamp>,
/// The job input payload JSON that is passed to the executor.
#[prost(string, tag = "3")]
pub input_payload_json: ::prost::alloc::string::String,
/// The labels of the job.
#[prost(message, repeated, tag = "4")]
pub labels: ::prost::alloc::vec::Vec<super::super::common::v1::Label>,
/// The timeout policy of the job.
#[prost(message, optional, tag = "5")]
pub timeout_policy: ::core::option::Option<TimeoutPolicy>,
/// Retry policy for the job.
#[prost(message, optional, tag = "6")]
pub retry_policy: ::core::option::Option<RetryPolicy>,
}
impl ::prost::Name for Job {
const NAME: &'static str = "Job";
const PACKAGE: &'static str = "ora.jobs.v1";
fn full_name() -> ::prost::alloc::string::String {
"ora.jobs.v1.Job".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ora.jobs.v1.Job".into()
}
}
/// Timeout policy for a job.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TimeoutPolicy {
/// The timeout for the job.
#[prost(message, optional, tag = "1")]
pub timeout: ::core::option::Option<::prost_types::Duration>,
/// The base time for the timeout.
///
/// The timeout is calculated from this time.
#[prost(enumeration = "TimeoutBaseTime", tag = "2")]
pub base_time: i32,
}
impl ::prost::Name for TimeoutPolicy {
const NAME: &'static str = "TimeoutPolicy";
const PACKAGE: &'static str = "ora.jobs.v1";
fn full_name() -> ::prost::alloc::string::String {
"ora.jobs.v1.TimeoutPolicy".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ora.jobs.v1.TimeoutPolicy".into()
}
}
/// Retry policy for a job.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RetryPolicy {
/// The number of retries for the job.
///
/// If the number of retries is zero, the job is not retried.
#[prost(uint64, tag = "1")]
pub retries: u64,
/// The backoff duration between retries.
///
/// By default, the backoff duration is zero,
/// which means that the job is retried immediately after a failure.
#[prost(message, optional, tag = "2")]
pub backoff_duration: ::core::option::Option<::prost_types::Duration>,
/// The maximum backoff duration between retries.
///
/// If the backoff duration is greater than the maximum backoff duration,
/// the backoff duration is capped at the maximum backoff duration.
///
/// This option is only applicable when the backoff strategy is exponential.
#[prost(message, optional, tag = "3")]
pub max_backoff_duration: ::core::option::Option<::prost_types::Duration>,
/// The backoff strategy for retries.
#[prost(enumeration = "BackoffStrategy", tag = "4")]
pub backoff_strategy: i32,
}
impl ::prost::Name for RetryPolicy {
const NAME: &'static str = "RetryPolicy";
const PACKAGE: &'static str = "ora.jobs.v1";
fn full_name() -> ::prost::alloc::string::String {
"ora.jobs.v1.RetryPolicy".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ora.jobs.v1.RetryPolicy".into()
}
}
/// The base time for the timeout.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TimeoutBaseTime {
/// The base time is unspecified and depends on the implementation.
Unspecified = 0,
/// The base time is the target execution time of the job.
///
/// Note that if the target execution time is not set,
/// the timeout is calculated from the start time of the job.
///
/// If the target execution time is in the past,
/// the jobs may be immediately timed out.
TargetExecutionTime = 1,
/// The base time is the start time of the job.
StartTime = 2,
}
impl TimeoutBaseTime {
/// 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 => "TIMEOUT_BASE_TIME_UNSPECIFIED",
Self::TargetExecutionTime => "TIMEOUT_BASE_TIME_TARGET_EXECUTION_TIME",
Self::StartTime => "TIMEOUT_BASE_TIME_START_TIME",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TIMEOUT_BASE_TIME_UNSPECIFIED" => Some(Self::Unspecified),
"TIMEOUT_BASE_TIME_TARGET_EXECUTION_TIME" => Some(Self::TargetExecutionTime),
"TIMEOUT_BASE_TIME_START_TIME" => Some(Self::StartTime),
_ => None,
}
}
}
/// The backoff strategy for retries.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum BackoffStrategy {
/// The backoff strategy is unspecified and depends on the implementation.
Unspecified = 0,
/// The backoff strategy is fixed, which means that the backoff duration is constant between retries.
Fixed = 1,
/// The backoff strategy is exponential, which means that the backoff duration increases exponentially between retries.
Exponential = 2,
}
impl BackoffStrategy {
/// 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 => "BACKOFF_STRATEGY_UNSPECIFIED",
Self::Fixed => "BACKOFF_STRATEGY_FIXED",
Self::Exponential => "BACKOFF_STRATEGY_EXPONENTIAL",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"BACKOFF_STRATEGY_UNSPECIFIED" => Some(Self::Unspecified),
"BACKOFF_STRATEGY_FIXED" => Some(Self::Fixed),
"BACKOFF_STRATEGY_EXPONENTIAL" => Some(Self::Exponential),
_ => None,
}
}
}