ora_proto/generated/
ora.common.v1.rs

1// This file is @generated by prost-build.
2/// Definition of a job type.
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct JobType {
5    /// The ID of the job type.
6    #[prost(string, tag = "1")]
7    pub id: ::prost::alloc::string::String,
8    /// The name of the job type.
9    #[prost(string, optional, tag = "2")]
10    pub name: ::core::option::Option<::prost::alloc::string::String>,
11    /// The description of the job type.
12    #[prost(string, optional, tag = "3")]
13    pub description: ::core::option::Option<::prost::alloc::string::String>,
14    /// The input JSON schema of the job type.
15    #[prost(string, optional, tag = "4")]
16    pub input_schema_json: ::core::option::Option<::prost::alloc::string::String>,
17    /// The output JSON schema of the job type.
18    #[prost(string, optional, tag = "5")]
19    pub output_schema_json: ::core::option::Option<::prost::alloc::string::String>,
20}
21impl ::prost::Name for JobType {
22    const NAME: &'static str = "JobType";
23    const PACKAGE: &'static str = "ora.common.v1";
24    fn full_name() -> ::prost::alloc::string::String {
25        "ora.common.v1.JobType".into()
26    }
27    fn type_url() -> ::prost::alloc::string::String {
28        "/ora.common.v1.JobType".into()
29    }
30}
31/// Definition of a job.
32#[derive(Clone, PartialEq, ::prost::Message)]
33pub struct JobDefinition {
34    /// The ID of the job type.
35    #[prost(string, tag = "1")]
36    pub job_type_id: ::prost::alloc::string::String,
37    /// The target execution time of the job.
38    ///
39    /// If not provided, it should be set to the current time.
40    #[prost(message, optional, tag = "2")]
41    pub target_execution_time: ::core::option::Option<::prost_types::Timestamp>,
42    /// The job input payload JSON that is passed to the executor.
43    #[prost(string, tag = "3")]
44    pub input_payload_json: ::prost::alloc::string::String,
45    /// The labels of the job.
46    #[prost(message, repeated, tag = "4")]
47    pub labels: ::prost::alloc::vec::Vec<JobLabel>,
48    /// The timeout policy of the job.
49    #[prost(message, optional, tag = "5")]
50    pub timeout_policy: ::core::option::Option<JobTimeoutPolicy>,
51    /// Retry policy for the job.
52    #[prost(message, optional, tag = "6")]
53    pub retry_policy: ::core::option::Option<JobRetryPolicy>,
54    /// Arbitrary metadata in JSON format.
55    #[prost(string, optional, tag = "7")]
56    pub metadata_json: ::core::option::Option<::prost::alloc::string::String>,
57}
58impl ::prost::Name for JobDefinition {
59    const NAME: &'static str = "JobDefinition";
60    const PACKAGE: &'static str = "ora.common.v1";
61    fn full_name() -> ::prost::alloc::string::String {
62        "ora.common.v1.JobDefinition".into()
63    }
64    fn type_url() -> ::prost::alloc::string::String {
65        "/ora.common.v1.JobDefinition".into()
66    }
67}
68/// A label for a job.
69///
70/// Labels can be used to categorize, filter,
71/// and group jobs.
72///
73/// Any arbitrary metadata can be stored in a label.
74#[derive(Clone, PartialEq, ::prost::Message)]
75pub struct JobLabel {
76    /// The key of the label.
77    ///
78    /// The key must be unique within the job.
79    /// The handling of duplicate keys is undefined
80    /// and depends on the implementation.
81    #[prost(string, tag = "1")]
82    pub key: ::prost::alloc::string::String,
83    /// The value of the label.
84    #[prost(string, tag = "2")]
85    pub value: ::prost::alloc::string::String,
86}
87impl ::prost::Name for JobLabel {
88    const NAME: &'static str = "JobLabel";
89    const PACKAGE: &'static str = "ora.common.v1";
90    fn full_name() -> ::prost::alloc::string::String {
91        "ora.common.v1.JobLabel".into()
92    }
93    fn type_url() -> ::prost::alloc::string::String {
94        "/ora.common.v1.JobLabel".into()
95    }
96}
97/// Timeout policy for a job.
98#[derive(Clone, Copy, PartialEq, ::prost::Message)]
99pub struct JobTimeoutPolicy {
100    /// The timeout for the job.
101    #[prost(message, optional, tag = "1")]
102    pub timeout: ::core::option::Option<::prost_types::Duration>,
103    /// The base time for the timeout.
104    ///
105    /// The timeout is calculated from this time.
106    #[prost(enumeration = "JobTimeoutBaseTime", tag = "2")]
107    pub base_time: i32,
108}
109impl ::prost::Name for JobTimeoutPolicy {
110    const NAME: &'static str = "JobTimeoutPolicy";
111    const PACKAGE: &'static str = "ora.common.v1";
112    fn full_name() -> ::prost::alloc::string::String {
113        "ora.common.v1.JobTimeoutPolicy".into()
114    }
115    fn type_url() -> ::prost::alloc::string::String {
116        "/ora.common.v1.JobTimeoutPolicy".into()
117    }
118}
119/// Retry policy for a job.
120#[derive(Clone, Copy, PartialEq, ::prost::Message)]
121pub struct JobRetryPolicy {
122    /// The number of retries for the job.
123    ///
124    /// If the number of retries is zero, the job is not retried.
125    #[prost(uint64, tag = "1")]
126    pub retries: u64,
127}
128impl ::prost::Name for JobRetryPolicy {
129    const NAME: &'static str = "JobRetryPolicy";
130    const PACKAGE: &'static str = "ora.common.v1";
131    fn full_name() -> ::prost::alloc::string::String {
132        "ora.common.v1.JobRetryPolicy".into()
133    }
134    fn type_url() -> ::prost::alloc::string::String {
135        "/ora.common.v1.JobRetryPolicy".into()
136    }
137}
138/// The base time for the timeout.
139#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
140#[repr(i32)]
141pub enum JobTimeoutBaseTime {
142    /// The base time is unspecified and depends on the implementation.
143    Unspecified = 0,
144    /// The base time is the target execution time of the job.
145    ///
146    /// Note that if the target execution time is not set,
147    /// the timeout is calculated from the start time of the job.
148    ///
149    /// If the target execution time is in the past,
150    /// the jobs may be immediately timed out.
151    TargetExecutionTime = 1,
152    /// The base time is the start time of the job.
153    StartTime = 2,
154}
155impl JobTimeoutBaseTime {
156    /// String value of the enum field names used in the ProtoBuf definition.
157    ///
158    /// The values are not transformed in any way and thus are considered stable
159    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
160    pub fn as_str_name(&self) -> &'static str {
161        match self {
162            Self::Unspecified => "JOB_TIMEOUT_BASE_TIME_UNSPECIFIED",
163            Self::TargetExecutionTime => "JOB_TIMEOUT_BASE_TIME_TARGET_EXECUTION_TIME",
164            Self::StartTime => "JOB_TIMEOUT_BASE_TIME_START_TIME",
165        }
166    }
167    /// Creates an enum from field names used in the ProtoBuf definition.
168    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
169        match value {
170            "JOB_TIMEOUT_BASE_TIME_UNSPECIFIED" => Some(Self::Unspecified),
171            "JOB_TIMEOUT_BASE_TIME_TARGET_EXECUTION_TIME" => Some(Self::TargetExecutionTime),
172            "JOB_TIMEOUT_BASE_TIME_START_TIME" => Some(Self::StartTime),
173            _ => None,
174        }
175    }
176}
177/// A time range.
178///
179/// A time range is a range of time between two points.
180///
181/// The time range is inclusive of the start time and exclusive of the end time.
182#[derive(Clone, Copy, PartialEq, ::prost::Message)]
183pub struct TimeRange {
184    /// The start time of the time range.
185    ///
186    /// If not provided, the time range is open-ended.
187    #[prost(message, optional, tag = "1")]
188    pub start: ::core::option::Option<::prost_types::Timestamp>,
189    /// The end time of the time range.
190    ///
191    /// If not provided, the time range is open-ended.
192    #[prost(message, optional, tag = "2")]
193    pub end: ::core::option::Option<::prost_types::Timestamp>,
194}
195impl ::prost::Name for TimeRange {
196    const NAME: &'static str = "TimeRange";
197    const PACKAGE: &'static str = "ora.common.v1";
198    fn full_name() -> ::prost::alloc::string::String {
199        "ora.common.v1.TimeRange".into()
200    }
201    fn type_url() -> ::prost::alloc::string::String {
202        "/ora.common.v1.TimeRange".into()
203    }
204}
205/// An inclusive time range.
206///
207/// An inclusive time range is a range of time between two points.
208///
209/// The time range is inclusive of the start time and the end time.
210#[derive(Clone, Copy, PartialEq, ::prost::Message)]
211pub struct InclusiveTimeRange {
212    /// The start time of the time range.
213    ///
214    /// If not provided, the time range is open-ended.
215    #[prost(message, optional, tag = "1")]
216    pub start: ::core::option::Option<::prost_types::Timestamp>,
217    /// The end time of the time range.
218    ///
219    /// If not provided, the time range is open-ended.
220    #[prost(message, optional, tag = "2")]
221    pub end: ::core::option::Option<::prost_types::Timestamp>,
222}
223impl ::prost::Name for InclusiveTimeRange {
224    const NAME: &'static str = "InclusiveTimeRange";
225    const PACKAGE: &'static str = "ora.common.v1";
226    fn full_name() -> ::prost::alloc::string::String {
227        "ora.common.v1.InclusiveTimeRange".into()
228    }
229    fn type_url() -> ::prost::alloc::string::String {
230        "/ora.common.v1.InclusiveTimeRange".into()
231    }
232}
233/// A schedule is a tool for executing jobs at a specific times.
234///
235/// Schedules create new jobs based on various criteria.
236#[derive(Clone, PartialEq, ::prost::Message)]
237pub struct ScheduleDefinition {
238    /// The timing policy for the schedule.
239    #[prost(message, optional, tag = "1")]
240    pub job_timing_policy: ::core::option::Option<ScheduleJobTimingPolicy>,
241    /// The policy for creating new jobs.
242    #[prost(message, optional, tag = "2")]
243    pub job_creation_policy: ::core::option::Option<ScheduleJobCreationPolicy>,
244    /// The labels of the schedule.
245    #[prost(message, repeated, tag = "3")]
246    pub labels: ::prost::alloc::vec::Vec<ScheduleLabel>,
247    /// The time range for the schedule.
248    ///
249    /// The schedule will not create jobs outside of the time range.
250    /// If the time range is not provided, the schedule will create jobs
251    /// indefinitely.
252    #[prost(message, optional, tag = "4")]
253    pub time_range: ::core::option::Option<TimeRange>,
254    /// Arbitrary metadata in JSON format.
255    #[prost(string, optional, tag = "5")]
256    pub metadata_json: ::core::option::Option<::prost::alloc::string::String>,
257}
258impl ::prost::Name for ScheduleDefinition {
259    const NAME: &'static str = "ScheduleDefinition";
260    const PACKAGE: &'static str = "ora.common.v1";
261    fn full_name() -> ::prost::alloc::string::String {
262        "ora.common.v1.ScheduleDefinition".into()
263    }
264    fn type_url() -> ::prost::alloc::string::String {
265        "/ora.common.v1.ScheduleDefinition".into()
266    }
267}
268#[derive(Clone, PartialEq, ::prost::Message)]
269pub struct ScheduleJobTimingPolicy {
270    /// The policy for timing new jobs.
271    #[prost(oneof = "schedule_job_timing_policy::JobTiming", tags = "1, 2")]
272    pub job_timing: ::core::option::Option<schedule_job_timing_policy::JobTiming>,
273}
274/// Nested message and enum types in `ScheduleJobTimingPolicy`.
275pub mod schedule_job_timing_policy {
276    /// The policy for timing new jobs.
277    #[derive(Clone, PartialEq, ::prost::Oneof)]
278    pub enum JobTiming {
279        /// Repeat jobs with a given interval.
280        #[prost(message, tag = "1")]
281        Repeat(super::ScheduleJobTimingPolicyRepeat),
282        /// Repeat jobs with a given cron expression.
283        #[prost(message, tag = "2")]
284        Cron(super::ScheduleJobTimingPolicyCron),
285    }
286}
287impl ::prost::Name for ScheduleJobTimingPolicy {
288    const NAME: &'static str = "ScheduleJobTimingPolicy";
289    const PACKAGE: &'static str = "ora.common.v1";
290    fn full_name() -> ::prost::alloc::string::String {
291        "ora.common.v1.ScheduleJobTimingPolicy".into()
292    }
293    fn type_url() -> ::prost::alloc::string::String {
294        "/ora.common.v1.ScheduleJobTimingPolicy".into()
295    }
296}
297/// Repeat jobs with a given interval.
298#[derive(Clone, Copy, PartialEq, ::prost::Message)]
299pub struct ScheduleJobTimingPolicyRepeat {
300    /// The interval between each job.
301    #[prost(message, optional, tag = "1")]
302    pub interval: ::core::option::Option<::prost_types::Duration>,
303    /// Whether to immediately create a job
304    /// when the schedule is created.
305    #[prost(bool, tag = "2")]
306    pub immediate: bool,
307    /// The policy for missed jobs.
308    #[prost(enumeration = "ScheduleMissedTimePolicy", tag = "3")]
309    pub missed_time_policy: i32,
310}
311impl ::prost::Name for ScheduleJobTimingPolicyRepeat {
312    const NAME: &'static str = "ScheduleJobTimingPolicyRepeat";
313    const PACKAGE: &'static str = "ora.common.v1";
314    fn full_name() -> ::prost::alloc::string::String {
315        "ora.common.v1.ScheduleJobTimingPolicyRepeat".into()
316    }
317    fn type_url() -> ::prost::alloc::string::String {
318        "/ora.common.v1.ScheduleJobTimingPolicyRepeat".into()
319    }
320}
321/// Repeat jobs with a given cron expression.
322#[derive(Clone, PartialEq, ::prost::Message)]
323pub struct ScheduleJobTimingPolicyCron {
324    /// The cron expression for the schedule.
325    ///
326    /// The reference implementation uses the cron expression
327    /// format supported by the `cronexpr` Rust crate (<<https://docs.rs/cronexpr/latest/cronexpr/>>).
328    #[prost(string, tag = "1")]
329    pub cron_expression: ::prost::alloc::string::String,
330    /// Whether to immediately create a job
331    /// when the schedule is created.
332    #[prost(bool, tag = "2")]
333    pub immediate: bool,
334    /// The policy for missed jobs.
335    #[prost(enumeration = "ScheduleMissedTimePolicy", tag = "3")]
336    pub missed_time_policy: i32,
337}
338impl ::prost::Name for ScheduleJobTimingPolicyCron {
339    const NAME: &'static str = "ScheduleJobTimingPolicyCron";
340    const PACKAGE: &'static str = "ora.common.v1";
341    fn full_name() -> ::prost::alloc::string::String {
342        "ora.common.v1.ScheduleJobTimingPolicyCron".into()
343    }
344    fn type_url() -> ::prost::alloc::string::String {
345        "/ora.common.v1.ScheduleJobTimingPolicyCron".into()
346    }
347}
348/// The policy that defines how new jobs are created.
349#[derive(Clone, PartialEq, ::prost::Message)]
350pub struct ScheduleJobCreationPolicy {
351    /// The policy for creating new jobs.
352    #[prost(oneof = "schedule_job_creation_policy::JobCreation", tags = "1")]
353    pub job_creation: ::core::option::Option<schedule_job_creation_policy::JobCreation>,
354}
355/// Nested message and enum types in `ScheduleJobCreationPolicy`.
356pub mod schedule_job_creation_policy {
357    /// The policy for creating new jobs.
358    #[derive(Clone, PartialEq, ::prost::Oneof)]
359    pub enum JobCreation {
360        /// Create new jobs from a given definition,
361        /// the target execution time is altered for each job.
362        #[prost(message, tag = "1")]
363        JobDefinition(super::JobDefinition),
364    }
365}
366impl ::prost::Name for ScheduleJobCreationPolicy {
367    const NAME: &'static str = "ScheduleJobCreationPolicy";
368    const PACKAGE: &'static str = "ora.common.v1";
369    fn full_name() -> ::prost::alloc::string::String {
370        "ora.common.v1.ScheduleJobCreationPolicy".into()
371    }
372    fn type_url() -> ::prost::alloc::string::String {
373        "/ora.common.v1.ScheduleJobCreationPolicy".into()
374    }
375}
376/// A label for a schedule.
377///
378/// Labels can be used to categorize, filter,
379/// and group schedules.
380///
381/// Any arbitrary metadata can be stored in a label.
382#[derive(Clone, PartialEq, ::prost::Message)]
383pub struct ScheduleLabel {
384    /// The key of the label.
385    ///
386    /// The key must be unique within the schedule.
387    /// The handling of duplicate keys is undefined
388    /// and depends on the implementation.
389    #[prost(string, tag = "1")]
390    pub key: ::prost::alloc::string::String,
391    /// The value of the label.
392    #[prost(string, tag = "2")]
393    pub value: ::prost::alloc::string::String,
394}
395impl ::prost::Name for ScheduleLabel {
396    const NAME: &'static str = "ScheduleLabel";
397    const PACKAGE: &'static str = "ora.common.v1";
398    fn full_name() -> ::prost::alloc::string::String {
399        "ora.common.v1.ScheduleLabel".into()
400    }
401    fn type_url() -> ::prost::alloc::string::String {
402        "/ora.common.v1.ScheduleLabel".into()
403    }
404}
405#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
406#[repr(i32)]
407pub enum ScheduleMissedTimePolicy {
408    /// The policy is unspecified.
409    Unspecified = 0,
410    /// Skip the missed times.
411    Skip = 1,
412    /// Create a job for each missed time.
413    Create = 2,
414}
415impl ScheduleMissedTimePolicy {
416    /// String value of the enum field names used in the ProtoBuf definition.
417    ///
418    /// The values are not transformed in any way and thus are considered stable
419    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
420    pub fn as_str_name(&self) -> &'static str {
421        match self {
422            Self::Unspecified => "SCHEDULE_MISSED_TIME_POLICY_UNSPECIFIED",
423            Self::Skip => "SCHEDULE_MISSED_TIME_POLICY_SKIP",
424            Self::Create => "SCHEDULE_MISSED_TIME_POLICY_CREATE",
425        }
426    }
427    /// Creates an enum from field names used in the ProtoBuf definition.
428    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
429        match value {
430            "SCHEDULE_MISSED_TIME_POLICY_UNSPECIFIED" => Some(Self::Unspecified),
431            "SCHEDULE_MISSED_TIME_POLICY_SKIP" => Some(Self::Skip),
432            "SCHEDULE_MISSED_TIME_POLICY_CREATE" => Some(Self::Create),
433            _ => None,
434        }
435    }
436}