ora_proto/generated/
ora.common.v1.rs

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
// This file is @generated by prost-build.
/// Definition of a job type.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JobType {
    /// The ID of the job type.
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    /// The name of the job type.
    #[prost(string, optional, tag = "2")]
    pub name: ::core::option::Option<::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.common.v1";
    fn full_name() -> ::prost::alloc::string::String {
        "ora.common.v1.JobType".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "/ora.common.v1.JobType".into()
    }
}
/// Definition of a job.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JobDefinition {
    /// 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.
    ///
    /// If not provided, it should be set to the current time.
    #[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<JobLabel>,
    /// The timeout policy of the job.
    #[prost(message, optional, tag = "5")]
    pub timeout_policy: ::core::option::Option<JobTimeoutPolicy>,
    /// Retry policy for the job.
    #[prost(message, optional, tag = "6")]
    pub retry_policy: ::core::option::Option<JobRetryPolicy>,
    /// Arbitrary metadata in JSON format.
    #[prost(string, optional, tag = "7")]
    pub metadata_json: ::core::option::Option<::prost::alloc::string::String>,
}
impl ::prost::Name for JobDefinition {
    const NAME: &'static str = "JobDefinition";
    const PACKAGE: &'static str = "ora.common.v1";
    fn full_name() -> ::prost::alloc::string::String {
        "ora.common.v1.JobDefinition".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "/ora.common.v1.JobDefinition".into()
    }
}
/// A label for a job.
///
/// Labels can be used to categorize, filter,
/// and group jobs.
///
/// Any arbitrary metadata can be stored in a label.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JobLabel {
    /// The key of the label.
    ///
    /// The key must be unique within the job.
    /// The handling of duplicate keys is undefined
    /// and depends on the implementation.
    #[prost(string, tag = "1")]
    pub key: ::prost::alloc::string::String,
    /// The value of the label.
    #[prost(string, tag = "2")]
    pub value: ::prost::alloc::string::String,
}
impl ::prost::Name for JobLabel {
    const NAME: &'static str = "JobLabel";
    const PACKAGE: &'static str = "ora.common.v1";
    fn full_name() -> ::prost::alloc::string::String {
        "ora.common.v1.JobLabel".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "/ora.common.v1.JobLabel".into()
    }
}
/// Timeout policy for a job.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct JobTimeoutPolicy {
    /// 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 = "JobTimeoutBaseTime", tag = "2")]
    pub base_time: i32,
}
impl ::prost::Name for JobTimeoutPolicy {
    const NAME: &'static str = "JobTimeoutPolicy";
    const PACKAGE: &'static str = "ora.common.v1";
    fn full_name() -> ::prost::alloc::string::String {
        "ora.common.v1.JobTimeoutPolicy".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "/ora.common.v1.JobTimeoutPolicy".into()
    }
}
/// Retry policy for a job.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct JobRetryPolicy {
    /// 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,
}
impl ::prost::Name for JobRetryPolicy {
    const NAME: &'static str = "JobRetryPolicy";
    const PACKAGE: &'static str = "ora.common.v1";
    fn full_name() -> ::prost::alloc::string::String {
        "ora.common.v1.JobRetryPolicy".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "/ora.common.v1.JobRetryPolicy".into()
    }
}
/// The base time for the timeout.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum JobTimeoutBaseTime {
    /// 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 JobTimeoutBaseTime {
    /// 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 => "JOB_TIMEOUT_BASE_TIME_UNSPECIFIED",
            Self::TargetExecutionTime => "JOB_TIMEOUT_BASE_TIME_TARGET_EXECUTION_TIME",
            Self::StartTime => "JOB_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 {
            "JOB_TIMEOUT_BASE_TIME_UNSPECIFIED" => Some(Self::Unspecified),
            "JOB_TIMEOUT_BASE_TIME_TARGET_EXECUTION_TIME" => Some(Self::TargetExecutionTime),
            "JOB_TIMEOUT_BASE_TIME_START_TIME" => Some(Self::StartTime),
            _ => None,
        }
    }
}
/// A time range.
///
/// A time range is a range of time between two points.
///
/// The time range is inclusive of the start time and exclusive of the end time.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TimeRange {
    /// The start time of the time range.
    ///
    /// If not provided, the time range is open-ended.
    #[prost(message, optional, tag = "1")]
    pub start: ::core::option::Option<::prost_types::Timestamp>,
    /// The end time of the time range.
    ///
    /// If not provided, the time range is open-ended.
    #[prost(message, optional, tag = "2")]
    pub end: ::core::option::Option<::prost_types::Timestamp>,
}
impl ::prost::Name for TimeRange {
    const NAME: &'static str = "TimeRange";
    const PACKAGE: &'static str = "ora.common.v1";
    fn full_name() -> ::prost::alloc::string::String {
        "ora.common.v1.TimeRange".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "/ora.common.v1.TimeRange".into()
    }
}
/// An inclusive time range.
///
/// An inclusive time range is a range of time between two points.
///
/// The time range is inclusive of the start time and the end time.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct InclusiveTimeRange {
    /// The start time of the time range.
    ///
    /// If not provided, the time range is open-ended.
    #[prost(message, optional, tag = "1")]
    pub start: ::core::option::Option<::prost_types::Timestamp>,
    /// The end time of the time range.
    ///
    /// If not provided, the time range is open-ended.
    #[prost(message, optional, tag = "2")]
    pub end: ::core::option::Option<::prost_types::Timestamp>,
}
impl ::prost::Name for InclusiveTimeRange {
    const NAME: &'static str = "InclusiveTimeRange";
    const PACKAGE: &'static str = "ora.common.v1";
    fn full_name() -> ::prost::alloc::string::String {
        "ora.common.v1.InclusiveTimeRange".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "/ora.common.v1.InclusiveTimeRange".into()
    }
}
/// A schedule is a tool for executing jobs at a specific times.
///
/// Schedules create new jobs based on various criteria.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ScheduleDefinition {
    /// The timing policy for the schedule.
    #[prost(message, optional, tag = "1")]
    pub job_timing_policy: ::core::option::Option<ScheduleJobTimingPolicy>,
    /// The policy for creating new jobs.
    #[prost(message, optional, tag = "2")]
    pub job_creation_policy: ::core::option::Option<ScheduleJobCreationPolicy>,
    /// The labels of the schedule.
    #[prost(message, repeated, tag = "3")]
    pub labels: ::prost::alloc::vec::Vec<ScheduleLabel>,
    /// The time range for the schedule.
    ///
    /// The schedule will not create jobs outside of the time range.
    /// If the time range is not provided, the schedule will create jobs
    /// indefinitely.
    #[prost(message, optional, tag = "4")]
    pub time_range: ::core::option::Option<TimeRange>,
    /// Arbitrary metadata in JSON format.
    #[prost(string, optional, tag = "5")]
    pub metadata_json: ::core::option::Option<::prost::alloc::string::String>,
}
impl ::prost::Name for ScheduleDefinition {
    const NAME: &'static str = "ScheduleDefinition";
    const PACKAGE: &'static str = "ora.common.v1";
    fn full_name() -> ::prost::alloc::string::String {
        "ora.common.v1.ScheduleDefinition".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "/ora.common.v1.ScheduleDefinition".into()
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ScheduleJobTimingPolicy {
    /// The policy for timing new jobs.
    #[prost(oneof = "schedule_job_timing_policy::JobTiming", tags = "1, 2")]
    pub job_timing: ::core::option::Option<schedule_job_timing_policy::JobTiming>,
}
/// Nested message and enum types in `ScheduleJobTimingPolicy`.
pub mod schedule_job_timing_policy {
    /// The policy for timing new jobs.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum JobTiming {
        /// Repeat jobs with a given interval.
        #[prost(message, tag = "1")]
        Repeat(super::ScheduleJobTimingPolicyRepeat),
        /// Repeat jobs with a given cron expression.
        #[prost(message, tag = "2")]
        Cron(super::ScheduleJobTimingPolicyCron),
    }
}
impl ::prost::Name for ScheduleJobTimingPolicy {
    const NAME: &'static str = "ScheduleJobTimingPolicy";
    const PACKAGE: &'static str = "ora.common.v1";
    fn full_name() -> ::prost::alloc::string::String {
        "ora.common.v1.ScheduleJobTimingPolicy".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "/ora.common.v1.ScheduleJobTimingPolicy".into()
    }
}
/// Repeat jobs with a given interval.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ScheduleJobTimingPolicyRepeat {
    /// The interval between each job.
    #[prost(message, optional, tag = "1")]
    pub interval: ::core::option::Option<::prost_types::Duration>,
    /// Whether to immediately create a job
    /// when the schedule is created.
    #[prost(bool, tag = "2")]
    pub immediate: bool,
    /// The policy for missed jobs.
    #[prost(enumeration = "ScheduleMissedTimePolicy", tag = "3")]
    pub missed_time_policy: i32,
}
impl ::prost::Name for ScheduleJobTimingPolicyRepeat {
    const NAME: &'static str = "ScheduleJobTimingPolicyRepeat";
    const PACKAGE: &'static str = "ora.common.v1";
    fn full_name() -> ::prost::alloc::string::String {
        "ora.common.v1.ScheduleJobTimingPolicyRepeat".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "/ora.common.v1.ScheduleJobTimingPolicyRepeat".into()
    }
}
/// Repeat jobs with a given cron expression.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ScheduleJobTimingPolicyCron {
    /// The cron expression for the schedule.
    ///
    /// The reference implementation uses the cron expression
    /// format supported by the `cronexpr` Rust crate (<<https://docs.rs/cronexpr/latest/cronexpr/>>).
    #[prost(string, tag = "1")]
    pub cron_expression: ::prost::alloc::string::String,
    /// Whether to immediately create a job
    /// when the schedule is created.
    #[prost(bool, tag = "2")]
    pub immediate: bool,
    /// The policy for missed jobs.
    #[prost(enumeration = "ScheduleMissedTimePolicy", tag = "3")]
    pub missed_time_policy: i32,
}
impl ::prost::Name for ScheduleJobTimingPolicyCron {
    const NAME: &'static str = "ScheduleJobTimingPolicyCron";
    const PACKAGE: &'static str = "ora.common.v1";
    fn full_name() -> ::prost::alloc::string::String {
        "ora.common.v1.ScheduleJobTimingPolicyCron".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "/ora.common.v1.ScheduleJobTimingPolicyCron".into()
    }
}
/// The policy that defines how new jobs are created.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ScheduleJobCreationPolicy {
    /// The policy for creating new jobs.
    #[prost(oneof = "schedule_job_creation_policy::JobCreation", tags = "1")]
    pub job_creation: ::core::option::Option<schedule_job_creation_policy::JobCreation>,
}
/// Nested message and enum types in `ScheduleJobCreationPolicy`.
pub mod schedule_job_creation_policy {
    /// The policy for creating new jobs.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum JobCreation {
        /// Create new jobs from a given definition,
        /// the target execution time is altered for each job.
        #[prost(message, tag = "1")]
        JobDefinition(super::JobDefinition),
    }
}
impl ::prost::Name for ScheduleJobCreationPolicy {
    const NAME: &'static str = "ScheduleJobCreationPolicy";
    const PACKAGE: &'static str = "ora.common.v1";
    fn full_name() -> ::prost::alloc::string::String {
        "ora.common.v1.ScheduleJobCreationPolicy".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "/ora.common.v1.ScheduleJobCreationPolicy".into()
    }
}
/// A label for a schedule.
///
/// Labels can be used to categorize, filter,
/// and group schedules.
///
/// Any arbitrary metadata can be stored in a label.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ScheduleLabel {
    /// The key of the label.
    ///
    /// The key must be unique within the schedule.
    /// The handling of duplicate keys is undefined
    /// and depends on the implementation.
    #[prost(string, tag = "1")]
    pub key: ::prost::alloc::string::String,
    /// The value of the label.
    #[prost(string, tag = "2")]
    pub value: ::prost::alloc::string::String,
}
impl ::prost::Name for ScheduleLabel {
    const NAME: &'static str = "ScheduleLabel";
    const PACKAGE: &'static str = "ora.common.v1";
    fn full_name() -> ::prost::alloc::string::String {
        "ora.common.v1.ScheduleLabel".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "/ora.common.v1.ScheduleLabel".into()
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ScheduleMissedTimePolicy {
    /// The policy is unspecified.
    Unspecified = 0,
    /// Skip the missed times.
    Skip = 1,
    /// Create a job for each missed time.
    Create = 2,
}
impl ScheduleMissedTimePolicy {
    /// 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 => "SCHEDULE_MISSED_TIME_POLICY_UNSPECIFIED",
            Self::Skip => "SCHEDULE_MISSED_TIME_POLICY_SKIP",
            Self::Create => "SCHEDULE_MISSED_TIME_POLICY_CREATE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "SCHEDULE_MISSED_TIME_POLICY_UNSPECIFIED" => Some(Self::Unspecified),
            "SCHEDULE_MISSED_TIME_POLICY_SKIP" => Some(Self::Skip),
            "SCHEDULE_MISSED_TIME_POLICY_CREATE" => Some(Self::Create),
            _ => None,
        }
    }
}