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" => {
172                Some(Self::TargetExecutionTime)
173            }
174            "JOB_TIMEOUT_BASE_TIME_START_TIME" => Some(Self::StartTime),
175            _ => None,
176        }
177    }
178}
179/// A time range.
180///
181/// A time range is a range of time between two points.
182///
183/// The time range is inclusive of the start time and exclusive of the end time.
184#[derive(Clone, Copy, PartialEq, ::prost::Message)]
185pub struct TimeRange {
186    /// The start time of the time range.
187    ///
188    /// If not provided, the time range is open-ended.
189    #[prost(message, optional, tag = "1")]
190    pub start: ::core::option::Option<::prost_types::Timestamp>,
191    /// The end time of the time range.
192    ///
193    /// If not provided, the time range is open-ended.
194    #[prost(message, optional, tag = "2")]
195    pub end: ::core::option::Option<::prost_types::Timestamp>,
196}
197impl ::prost::Name for TimeRange {
198    const NAME: &'static str = "TimeRange";
199    const PACKAGE: &'static str = "ora.common.v1";
200    fn full_name() -> ::prost::alloc::string::String {
201        "ora.common.v1.TimeRange".into()
202    }
203    fn type_url() -> ::prost::alloc::string::String {
204        "/ora.common.v1.TimeRange".into()
205    }
206}
207/// An inclusive time range.
208///
209/// An inclusive time range is a range of time between two points.
210///
211/// The time range is inclusive of the start time and the end time.
212#[derive(Clone, Copy, PartialEq, ::prost::Message)]
213pub struct InclusiveTimeRange {
214    /// The start time of the time range.
215    ///
216    /// If not provided, the time range is open-ended.
217    #[prost(message, optional, tag = "1")]
218    pub start: ::core::option::Option<::prost_types::Timestamp>,
219    /// The end time of the time range.
220    ///
221    /// If not provided, the time range is open-ended.
222    #[prost(message, optional, tag = "2")]
223    pub end: ::core::option::Option<::prost_types::Timestamp>,
224}
225impl ::prost::Name for InclusiveTimeRange {
226    const NAME: &'static str = "InclusiveTimeRange";
227    const PACKAGE: &'static str = "ora.common.v1";
228    fn full_name() -> ::prost::alloc::string::String {
229        "ora.common.v1.InclusiveTimeRange".into()
230    }
231    fn type_url() -> ::prost::alloc::string::String {
232        "/ora.common.v1.InclusiveTimeRange".into()
233    }
234}
235/// A schedule is a tool for executing jobs at a specific times.
236///
237/// Schedules create new jobs based on various criteria.
238#[derive(Clone, PartialEq, ::prost::Message)]
239pub struct ScheduleDefinition {
240    /// The timing policy for the schedule.
241    #[prost(message, optional, tag = "1")]
242    pub job_timing_policy: ::core::option::Option<ScheduleJobTimingPolicy>,
243    /// The policy for creating new jobs.
244    #[prost(message, optional, tag = "2")]
245    pub job_creation_policy: ::core::option::Option<ScheduleJobCreationPolicy>,
246    /// The labels of the schedule.
247    #[prost(message, repeated, tag = "3")]
248    pub labels: ::prost::alloc::vec::Vec<ScheduleLabel>,
249    /// The time range for the schedule.
250    ///
251    /// The schedule will not create jobs outside of the time range.
252    /// If the time range is not provided, the schedule will create jobs
253    /// indefinitely.
254    #[prost(message, optional, tag = "4")]
255    pub time_range: ::core::option::Option<TimeRange>,
256    /// Arbitrary metadata in JSON format.
257    #[prost(string, optional, tag = "5")]
258    pub metadata_json: ::core::option::Option<::prost::alloc::string::String>,
259}
260impl ::prost::Name for ScheduleDefinition {
261    const NAME: &'static str = "ScheduleDefinition";
262    const PACKAGE: &'static str = "ora.common.v1";
263    fn full_name() -> ::prost::alloc::string::String {
264        "ora.common.v1.ScheduleDefinition".into()
265    }
266    fn type_url() -> ::prost::alloc::string::String {
267        "/ora.common.v1.ScheduleDefinition".into()
268    }
269}
270#[derive(Clone, PartialEq, ::prost::Message)]
271pub struct ScheduleJobTimingPolicy {
272    /// The policy for timing new jobs.
273    #[prost(oneof = "schedule_job_timing_policy::JobTiming", tags = "1, 2")]
274    pub job_timing: ::core::option::Option<schedule_job_timing_policy::JobTiming>,
275}
276/// Nested message and enum types in `ScheduleJobTimingPolicy`.
277pub mod schedule_job_timing_policy {
278    /// The policy for timing new jobs.
279    #[derive(Clone, PartialEq, ::prost::Oneof)]
280    pub enum JobTiming {
281        /// Repeat jobs with a given interval.
282        #[prost(message, tag = "1")]
283        Repeat(super::ScheduleJobTimingPolicyRepeat),
284        /// Repeat jobs with a given cron expression.
285        #[prost(message, tag = "2")]
286        Cron(super::ScheduleJobTimingPolicyCron),
287    }
288}
289impl ::prost::Name for ScheduleJobTimingPolicy {
290    const NAME: &'static str = "ScheduleJobTimingPolicy";
291    const PACKAGE: &'static str = "ora.common.v1";
292    fn full_name() -> ::prost::alloc::string::String {
293        "ora.common.v1.ScheduleJobTimingPolicy".into()
294    }
295    fn type_url() -> ::prost::alloc::string::String {
296        "/ora.common.v1.ScheduleJobTimingPolicy".into()
297    }
298}
299/// Repeat jobs with a given interval.
300#[derive(Clone, Copy, PartialEq, ::prost::Message)]
301pub struct ScheduleJobTimingPolicyRepeat {
302    /// The interval between each job.
303    #[prost(message, optional, tag = "1")]
304    pub interval: ::core::option::Option<::prost_types::Duration>,
305    /// Whether to immediately create a job
306    /// when the schedule is created.
307    #[prost(bool, tag = "2")]
308    pub immediate: bool,
309    /// The policy for missed jobs.
310    #[prost(enumeration = "ScheduleMissedTimePolicy", tag = "3")]
311    pub missed_time_policy: i32,
312}
313impl ::prost::Name for ScheduleJobTimingPolicyRepeat {
314    const NAME: &'static str = "ScheduleJobTimingPolicyRepeat";
315    const PACKAGE: &'static str = "ora.common.v1";
316    fn full_name() -> ::prost::alloc::string::String {
317        "ora.common.v1.ScheduleJobTimingPolicyRepeat".into()
318    }
319    fn type_url() -> ::prost::alloc::string::String {
320        "/ora.common.v1.ScheduleJobTimingPolicyRepeat".into()
321    }
322}
323/// Repeat jobs with a given cron expression.
324#[derive(Clone, PartialEq, ::prost::Message)]
325pub struct ScheduleJobTimingPolicyCron {
326    /// The cron expression for the schedule.
327    ///
328    /// The reference implementation uses the cron expression
329    /// format supported by the `cronexpr` Rust crate (<<https://docs.rs/cronexpr/latest/cronexpr/>>).
330    #[prost(string, tag = "1")]
331    pub cron_expression: ::prost::alloc::string::String,
332    /// Whether to immediately create a job
333    /// when the schedule is created.
334    #[prost(bool, tag = "2")]
335    pub immediate: bool,
336    /// The policy for missed jobs.
337    #[prost(enumeration = "ScheduleMissedTimePolicy", tag = "3")]
338    pub missed_time_policy: i32,
339}
340impl ::prost::Name for ScheduleJobTimingPolicyCron {
341    const NAME: &'static str = "ScheduleJobTimingPolicyCron";
342    const PACKAGE: &'static str = "ora.common.v1";
343    fn full_name() -> ::prost::alloc::string::String {
344        "ora.common.v1.ScheduleJobTimingPolicyCron".into()
345    }
346    fn type_url() -> ::prost::alloc::string::String {
347        "/ora.common.v1.ScheduleJobTimingPolicyCron".into()
348    }
349}
350/// The policy that defines how new jobs are created.
351#[derive(Clone, PartialEq, ::prost::Message)]
352pub struct ScheduleJobCreationPolicy {
353    /// The policy for creating new jobs.
354    #[prost(oneof = "schedule_job_creation_policy::JobCreation", tags = "1")]
355    pub job_creation: ::core::option::Option<schedule_job_creation_policy::JobCreation>,
356}
357/// Nested message and enum types in `ScheduleJobCreationPolicy`.
358pub mod schedule_job_creation_policy {
359    /// The policy for creating new jobs.
360    #[derive(Clone, PartialEq, ::prost::Oneof)]
361    pub enum JobCreation {
362        /// Create new jobs from a given definition,
363        /// the target execution time is altered for each job.
364        #[prost(message, tag = "1")]
365        JobDefinition(super::JobDefinition),
366    }
367}
368impl ::prost::Name for ScheduleJobCreationPolicy {
369    const NAME: &'static str = "ScheduleJobCreationPolicy";
370    const PACKAGE: &'static str = "ora.common.v1";
371    fn full_name() -> ::prost::alloc::string::String {
372        "ora.common.v1.ScheduleJobCreationPolicy".into()
373    }
374    fn type_url() -> ::prost::alloc::string::String {
375        "/ora.common.v1.ScheduleJobCreationPolicy".into()
376    }
377}
378/// A label for a schedule.
379///
380/// Labels can be used to categorize, filter,
381/// and group schedules.
382///
383/// Any arbitrary metadata can be stored in a label.
384#[derive(Clone, PartialEq, ::prost::Message)]
385pub struct ScheduleLabel {
386    /// The key of the label.
387    ///
388    /// The key must be unique within the schedule.
389    /// The handling of duplicate keys is undefined
390    /// and depends on the implementation.
391    #[prost(string, tag = "1")]
392    pub key: ::prost::alloc::string::String,
393    /// The value of the label.
394    #[prost(string, tag = "2")]
395    pub value: ::prost::alloc::string::String,
396}
397impl ::prost::Name for ScheduleLabel {
398    const NAME: &'static str = "ScheduleLabel";
399    const PACKAGE: &'static str = "ora.common.v1";
400    fn full_name() -> ::prost::alloc::string::String {
401        "ora.common.v1.ScheduleLabel".into()
402    }
403    fn type_url() -> ::prost::alloc::string::String {
404        "/ora.common.v1.ScheduleLabel".into()
405    }
406}
407#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
408#[repr(i32)]
409pub enum ScheduleMissedTimePolicy {
410    /// The policy is unspecified.
411    Unspecified = 0,
412    /// Skip the missed times.
413    Skip = 1,
414    /// Create a job for each missed time.
415    Create = 2,
416}
417impl ScheduleMissedTimePolicy {
418    /// String value of the enum field names used in the ProtoBuf definition.
419    ///
420    /// The values are not transformed in any way and thus are considered stable
421    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
422    pub fn as_str_name(&self) -> &'static str {
423        match self {
424            Self::Unspecified => "SCHEDULE_MISSED_TIME_POLICY_UNSPECIFIED",
425            Self::Skip => "SCHEDULE_MISSED_TIME_POLICY_SKIP",
426            Self::Create => "SCHEDULE_MISSED_TIME_POLICY_CREATE",
427        }
428    }
429    /// Creates an enum from field names used in the ProtoBuf definition.
430    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
431        match value {
432            "SCHEDULE_MISSED_TIME_POLICY_UNSPECIFIED" => Some(Self::Unspecified),
433            "SCHEDULE_MISSED_TIME_POLICY_SKIP" => Some(Self::Skip),
434            "SCHEDULE_MISSED_TIME_POLICY_CREATE" => Some(Self::Create),
435            _ => None,
436        }
437    }
438}