google_cloud_workflows_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::bare_urls)]
21#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gax;
25extern crate gaxi;
26extern crate lazy_static;
27extern crate location;
28extern crate longrunning;
29extern crate lro;
30extern crate reqwest;
31extern crate serde;
32extern crate serde_json;
33extern crate serde_with;
34extern crate std;
35extern crate tracing;
36extern crate wkt;
37
38mod debug;
39mod deserialize;
40mod serialize;
41
42/// Workflow program to be executed by Workflows.
43#[derive(Clone, Default, PartialEq)]
44#[non_exhaustive]
45pub struct Workflow {
46    /// The resource name of the workflow.
47    /// Format: projects/{project}/locations/{location}/workflows/{workflow}.
48    /// This is a workflow-wide field and is not tied to a specific revision.
49    pub name: std::string::String,
50
51    /// Description of the workflow provided by the user.
52    /// Must be at most 1000 Unicode characters long.
53    /// This is a workflow-wide field and is not tied to a specific revision.
54    pub description: std::string::String,
55
56    /// Output only. State of the workflow deployment.
57    pub state: crate::model::workflow::State,
58
59    /// Output only. The revision of the workflow.
60    /// A new revision of a workflow is created as a result of updating the
61    /// following properties of a workflow:
62    ///
63    /// - [Service account][google.cloud.workflows.v1.Workflow.service_account]
64    /// - [Workflow code to be
65    ///   executed][google.cloud.workflows.v1.Workflow.source_contents]
66    ///
67    /// The format is "000001-a4d", where the first six characters define
68    /// the zero-padded revision ordinal number. They are followed by a hyphen and
69    /// three hexadecimal random characters.
70    ///
71    /// [google.cloud.workflows.v1.Workflow.service_account]: crate::model::Workflow::service_account
72    /// [google.cloud.workflows.v1.Workflow.source_contents]: crate::model::Workflow::source_code
73    pub revision_id: std::string::String,
74
75    /// Output only. The timestamp for when the workflow was created.
76    /// This is a workflow-wide field and is not tied to a specific revision.
77    pub create_time: std::option::Option<wkt::Timestamp>,
78
79    /// Output only. The timestamp for when the workflow was last updated.
80    /// This is a workflow-wide field and is not tied to a specific revision.
81    pub update_time: std::option::Option<wkt::Timestamp>,
82
83    /// Output only. The timestamp for the latest revision of the workflow's
84    /// creation.
85    pub revision_create_time: std::option::Option<wkt::Timestamp>,
86
87    /// Labels associated with this workflow.
88    /// Labels can contain at most 64 entries. Keys and values can be no longer
89    /// than 63 characters and can only contain lowercase letters, numeric
90    /// characters, underscores, and dashes. Label keys must start with a letter.
91    /// International characters are allowed.
92    /// This is a workflow-wide field and is not tied to a specific revision.
93    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
94
95    /// The service account associated with the latest workflow version.
96    /// This service account represents the identity of the workflow and determines
97    /// what permissions the workflow has.
98    /// Format: projects/{project}/serviceAccounts/{account} or {account}
99    ///
100    /// Using `-` as a wildcard for the `{project}` or not providing one at all
101    /// will infer the project from the account. The `{account}` value can be the
102    /// `email` address or the `unique_id` of the service account.
103    ///
104    /// If not provided, workflow will use the project's default service account.
105    /// Modifying this field for an existing workflow results in a new workflow
106    /// revision.
107    pub service_account: std::string::String,
108
109    /// Optional. The resource name of a KMS crypto key used to encrypt or decrypt
110    /// the data associated with the workflow.
111    ///
112    /// Format:
113    /// projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}
114    ///
115    /// Using `-` as a wildcard for the `{project}` or not providing one at all
116    /// will infer the project from the account.
117    ///
118    /// If not provided, data associated with the workflow will not be
119    /// CMEK-encrypted.
120    pub crypto_key_name: std::string::String,
121
122    /// Output only. Error regarding the state of the workflow. For example, this
123    /// field will have error details if the execution data is unavailable due to
124    /// revoked KMS key permissions.
125    pub state_error: std::option::Option<crate::model::workflow::StateError>,
126
127    /// Optional. Describes the level of platform logging to apply to calls and
128    /// call responses during executions of this workflow. If both the workflow and
129    /// the execution specify a logging level, the execution level takes
130    /// precedence.
131    pub call_log_level: crate::model::workflow::CallLogLevel,
132
133    /// Optional. User-defined environment variables associated with this workflow
134    /// revision. This map has a maximum length of 20. Each string can take up to
135    /// 4KiB. Keys cannot be empty strings and cannot start with "GOOGLE" or
136    /// "WORKFLOWS".
137    pub user_env_vars: std::collections::HashMap<std::string::String, std::string::String>,
138
139    /// Optional. Describes the execution history level to apply to this workflow.
140    pub execution_history_level: crate::model::ExecutionHistoryLevel,
141
142    /// Output only. A list of all KMS crypto keys used to encrypt or decrypt the
143    /// data associated with the workflow.
144    pub all_kms_keys: std::vec::Vec<std::string::String>,
145
146    /// Output only. A list of all KMS crypto key versions used to encrypt or
147    /// decrypt the data associated with the workflow.
148    pub all_kms_keys_versions: std::vec::Vec<std::string::String>,
149
150    /// Output only. The resource name of a KMS crypto key version used to encrypt
151    /// or decrypt the data associated with the workflow.
152    ///
153    /// Format:
154    /// projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}/cryptoKeyVersions/{cryptoKeyVersion}
155    pub crypto_key_version: std::string::String,
156
157    /// Optional. Input only. Immutable. Tags associated with this workflow.
158    pub tags: std::collections::HashMap<std::string::String, std::string::String>,
159
160    /// Required. Location of the workflow source code.
161    /// Modifying this field for an existing workflow results in a new workflow
162    /// revision.
163    pub source_code: std::option::Option<crate::model::workflow::SourceCode>,
164
165    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
166}
167
168impl Workflow {
169    pub fn new() -> Self {
170        std::default::Default::default()
171    }
172
173    /// Sets the value of [name][crate::model::Workflow::name].
174    ///
175    /// # Example
176    /// ```
177    /// # use google_cloud_workflows_v1::model::Workflow;
178    /// let x = Workflow::new().set_name("example");
179    /// ```
180    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
181        self.name = v.into();
182        self
183    }
184
185    /// Sets the value of [description][crate::model::Workflow::description].
186    ///
187    /// # Example
188    /// ```
189    /// # use google_cloud_workflows_v1::model::Workflow;
190    /// let x = Workflow::new().set_description("example");
191    /// ```
192    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
193        self.description = v.into();
194        self
195    }
196
197    /// Sets the value of [state][crate::model::Workflow::state].
198    ///
199    /// # Example
200    /// ```
201    /// # use google_cloud_workflows_v1::model::Workflow;
202    /// use google_cloud_workflows_v1::model::workflow::State;
203    /// let x0 = Workflow::new().set_state(State::Active);
204    /// let x1 = Workflow::new().set_state(State::Unavailable);
205    /// ```
206    pub fn set_state<T: std::convert::Into<crate::model::workflow::State>>(mut self, v: T) -> Self {
207        self.state = v.into();
208        self
209    }
210
211    /// Sets the value of [revision_id][crate::model::Workflow::revision_id].
212    ///
213    /// # Example
214    /// ```
215    /// # use google_cloud_workflows_v1::model::Workflow;
216    /// let x = Workflow::new().set_revision_id("example");
217    /// ```
218    pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
219        self.revision_id = v.into();
220        self
221    }
222
223    /// Sets the value of [create_time][crate::model::Workflow::create_time].
224    ///
225    /// # Example
226    /// ```
227    /// # use google_cloud_workflows_v1::model::Workflow;
228    /// use wkt::Timestamp;
229    /// let x = Workflow::new().set_create_time(Timestamp::default()/* use setters */);
230    /// ```
231    pub fn set_create_time<T>(mut self, v: T) -> Self
232    where
233        T: std::convert::Into<wkt::Timestamp>,
234    {
235        self.create_time = std::option::Option::Some(v.into());
236        self
237    }
238
239    /// Sets or clears the value of [create_time][crate::model::Workflow::create_time].
240    ///
241    /// # Example
242    /// ```
243    /// # use google_cloud_workflows_v1::model::Workflow;
244    /// use wkt::Timestamp;
245    /// let x = Workflow::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
246    /// let x = Workflow::new().set_or_clear_create_time(None::<Timestamp>);
247    /// ```
248    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
249    where
250        T: std::convert::Into<wkt::Timestamp>,
251    {
252        self.create_time = v.map(|x| x.into());
253        self
254    }
255
256    /// Sets the value of [update_time][crate::model::Workflow::update_time].
257    ///
258    /// # Example
259    /// ```
260    /// # use google_cloud_workflows_v1::model::Workflow;
261    /// use wkt::Timestamp;
262    /// let x = Workflow::new().set_update_time(Timestamp::default()/* use setters */);
263    /// ```
264    pub fn set_update_time<T>(mut self, v: T) -> Self
265    where
266        T: std::convert::Into<wkt::Timestamp>,
267    {
268        self.update_time = std::option::Option::Some(v.into());
269        self
270    }
271
272    /// Sets or clears the value of [update_time][crate::model::Workflow::update_time].
273    ///
274    /// # Example
275    /// ```
276    /// # use google_cloud_workflows_v1::model::Workflow;
277    /// use wkt::Timestamp;
278    /// let x = Workflow::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
279    /// let x = Workflow::new().set_or_clear_update_time(None::<Timestamp>);
280    /// ```
281    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
282    where
283        T: std::convert::Into<wkt::Timestamp>,
284    {
285        self.update_time = v.map(|x| x.into());
286        self
287    }
288
289    /// Sets the value of [revision_create_time][crate::model::Workflow::revision_create_time].
290    ///
291    /// # Example
292    /// ```
293    /// # use google_cloud_workflows_v1::model::Workflow;
294    /// use wkt::Timestamp;
295    /// let x = Workflow::new().set_revision_create_time(Timestamp::default()/* use setters */);
296    /// ```
297    pub fn set_revision_create_time<T>(mut self, v: T) -> Self
298    where
299        T: std::convert::Into<wkt::Timestamp>,
300    {
301        self.revision_create_time = std::option::Option::Some(v.into());
302        self
303    }
304
305    /// Sets or clears the value of [revision_create_time][crate::model::Workflow::revision_create_time].
306    ///
307    /// # Example
308    /// ```
309    /// # use google_cloud_workflows_v1::model::Workflow;
310    /// use wkt::Timestamp;
311    /// let x = Workflow::new().set_or_clear_revision_create_time(Some(Timestamp::default()/* use setters */));
312    /// let x = Workflow::new().set_or_clear_revision_create_time(None::<Timestamp>);
313    /// ```
314    pub fn set_or_clear_revision_create_time<T>(mut self, v: std::option::Option<T>) -> Self
315    where
316        T: std::convert::Into<wkt::Timestamp>,
317    {
318        self.revision_create_time = v.map(|x| x.into());
319        self
320    }
321
322    /// Sets the value of [labels][crate::model::Workflow::labels].
323    ///
324    /// # Example
325    /// ```
326    /// # use google_cloud_workflows_v1::model::Workflow;
327    /// let x = Workflow::new().set_labels([
328    ///     ("key0", "abc"),
329    ///     ("key1", "xyz"),
330    /// ]);
331    /// ```
332    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
333    where
334        T: std::iter::IntoIterator<Item = (K, V)>,
335        K: std::convert::Into<std::string::String>,
336        V: std::convert::Into<std::string::String>,
337    {
338        use std::iter::Iterator;
339        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
340        self
341    }
342
343    /// Sets the value of [service_account][crate::model::Workflow::service_account].
344    ///
345    /// # Example
346    /// ```
347    /// # use google_cloud_workflows_v1::model::Workflow;
348    /// let x = Workflow::new().set_service_account("example");
349    /// ```
350    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
351        self.service_account = v.into();
352        self
353    }
354
355    /// Sets the value of [crypto_key_name][crate::model::Workflow::crypto_key_name].
356    ///
357    /// # Example
358    /// ```
359    /// # use google_cloud_workflows_v1::model::Workflow;
360    /// let x = Workflow::new().set_crypto_key_name("example");
361    /// ```
362    pub fn set_crypto_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
363        self.crypto_key_name = v.into();
364        self
365    }
366
367    /// Sets the value of [state_error][crate::model::Workflow::state_error].
368    ///
369    /// # Example
370    /// ```
371    /// # use google_cloud_workflows_v1::model::Workflow;
372    /// use google_cloud_workflows_v1::model::workflow::StateError;
373    /// let x = Workflow::new().set_state_error(StateError::default()/* use setters */);
374    /// ```
375    pub fn set_state_error<T>(mut self, v: T) -> Self
376    where
377        T: std::convert::Into<crate::model::workflow::StateError>,
378    {
379        self.state_error = std::option::Option::Some(v.into());
380        self
381    }
382
383    /// Sets or clears the value of [state_error][crate::model::Workflow::state_error].
384    ///
385    /// # Example
386    /// ```
387    /// # use google_cloud_workflows_v1::model::Workflow;
388    /// use google_cloud_workflows_v1::model::workflow::StateError;
389    /// let x = Workflow::new().set_or_clear_state_error(Some(StateError::default()/* use setters */));
390    /// let x = Workflow::new().set_or_clear_state_error(None::<StateError>);
391    /// ```
392    pub fn set_or_clear_state_error<T>(mut self, v: std::option::Option<T>) -> Self
393    where
394        T: std::convert::Into<crate::model::workflow::StateError>,
395    {
396        self.state_error = v.map(|x| x.into());
397        self
398    }
399
400    /// Sets the value of [call_log_level][crate::model::Workflow::call_log_level].
401    ///
402    /// # Example
403    /// ```
404    /// # use google_cloud_workflows_v1::model::Workflow;
405    /// use google_cloud_workflows_v1::model::workflow::CallLogLevel;
406    /// let x0 = Workflow::new().set_call_log_level(CallLogLevel::LogAllCalls);
407    /// let x1 = Workflow::new().set_call_log_level(CallLogLevel::LogErrorsOnly);
408    /// let x2 = Workflow::new().set_call_log_level(CallLogLevel::LogNone);
409    /// ```
410    pub fn set_call_log_level<T: std::convert::Into<crate::model::workflow::CallLogLevel>>(
411        mut self,
412        v: T,
413    ) -> Self {
414        self.call_log_level = v.into();
415        self
416    }
417
418    /// Sets the value of [user_env_vars][crate::model::Workflow::user_env_vars].
419    ///
420    /// # Example
421    /// ```
422    /// # use google_cloud_workflows_v1::model::Workflow;
423    /// let x = Workflow::new().set_user_env_vars([
424    ///     ("key0", "abc"),
425    ///     ("key1", "xyz"),
426    /// ]);
427    /// ```
428    pub fn set_user_env_vars<T, K, V>(mut self, v: T) -> Self
429    where
430        T: std::iter::IntoIterator<Item = (K, V)>,
431        K: std::convert::Into<std::string::String>,
432        V: std::convert::Into<std::string::String>,
433    {
434        use std::iter::Iterator;
435        self.user_env_vars = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
436        self
437    }
438
439    /// Sets the value of [execution_history_level][crate::model::Workflow::execution_history_level].
440    ///
441    /// # Example
442    /// ```
443    /// # use google_cloud_workflows_v1::model::Workflow;
444    /// use google_cloud_workflows_v1::model::ExecutionHistoryLevel;
445    /// let x0 = Workflow::new().set_execution_history_level(ExecutionHistoryLevel::ExecutionHistoryBasic);
446    /// let x1 = Workflow::new().set_execution_history_level(ExecutionHistoryLevel::ExecutionHistoryDetailed);
447    /// ```
448    pub fn set_execution_history_level<
449        T: std::convert::Into<crate::model::ExecutionHistoryLevel>,
450    >(
451        mut self,
452        v: T,
453    ) -> Self {
454        self.execution_history_level = v.into();
455        self
456    }
457
458    /// Sets the value of [all_kms_keys][crate::model::Workflow::all_kms_keys].
459    ///
460    /// # Example
461    /// ```
462    /// # use google_cloud_workflows_v1::model::Workflow;
463    /// let x = Workflow::new().set_all_kms_keys(["a", "b", "c"]);
464    /// ```
465    pub fn set_all_kms_keys<T, V>(mut self, v: T) -> Self
466    where
467        T: std::iter::IntoIterator<Item = V>,
468        V: std::convert::Into<std::string::String>,
469    {
470        use std::iter::Iterator;
471        self.all_kms_keys = v.into_iter().map(|i| i.into()).collect();
472        self
473    }
474
475    /// Sets the value of [all_kms_keys_versions][crate::model::Workflow::all_kms_keys_versions].
476    ///
477    /// # Example
478    /// ```
479    /// # use google_cloud_workflows_v1::model::Workflow;
480    /// let x = Workflow::new().set_all_kms_keys_versions(["a", "b", "c"]);
481    /// ```
482    pub fn set_all_kms_keys_versions<T, V>(mut self, v: T) -> Self
483    where
484        T: std::iter::IntoIterator<Item = V>,
485        V: std::convert::Into<std::string::String>,
486    {
487        use std::iter::Iterator;
488        self.all_kms_keys_versions = v.into_iter().map(|i| i.into()).collect();
489        self
490    }
491
492    /// Sets the value of [crypto_key_version][crate::model::Workflow::crypto_key_version].
493    ///
494    /// # Example
495    /// ```
496    /// # use google_cloud_workflows_v1::model::Workflow;
497    /// let x = Workflow::new().set_crypto_key_version("example");
498    /// ```
499    pub fn set_crypto_key_version<T: std::convert::Into<std::string::String>>(
500        mut self,
501        v: T,
502    ) -> Self {
503        self.crypto_key_version = v.into();
504        self
505    }
506
507    /// Sets the value of [tags][crate::model::Workflow::tags].
508    ///
509    /// # Example
510    /// ```
511    /// # use google_cloud_workflows_v1::model::Workflow;
512    /// let x = Workflow::new().set_tags([
513    ///     ("key0", "abc"),
514    ///     ("key1", "xyz"),
515    /// ]);
516    /// ```
517    pub fn set_tags<T, K, V>(mut self, v: T) -> Self
518    where
519        T: std::iter::IntoIterator<Item = (K, V)>,
520        K: std::convert::Into<std::string::String>,
521        V: std::convert::Into<std::string::String>,
522    {
523        use std::iter::Iterator;
524        self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
525        self
526    }
527
528    /// Sets the value of [source_code][crate::model::Workflow::source_code].
529    ///
530    /// Note that all the setters affecting `source_code` are mutually
531    /// exclusive.
532    ///
533    /// # Example
534    /// ```
535    /// # use google_cloud_workflows_v1::model::Workflow;
536    /// use google_cloud_workflows_v1::model::workflow;
537    /// let x = Workflow::new().set_source_code(Some(workflow::SourceCode::SourceContents("example".to_string())));
538    /// ```
539    pub fn set_source_code<
540        T: std::convert::Into<std::option::Option<crate::model::workflow::SourceCode>>,
541    >(
542        mut self,
543        v: T,
544    ) -> Self {
545        self.source_code = v.into();
546        self
547    }
548
549    /// The value of [source_code][crate::model::Workflow::source_code]
550    /// if it holds a `SourceContents`, `None` if the field is not set or
551    /// holds a different branch.
552    pub fn source_contents(&self) -> std::option::Option<&std::string::String> {
553        #[allow(unreachable_patterns)]
554        self.source_code.as_ref().and_then(|v| match v {
555            crate::model::workflow::SourceCode::SourceContents(v) => std::option::Option::Some(v),
556            _ => std::option::Option::None,
557        })
558    }
559
560    /// Sets the value of [source_code][crate::model::Workflow::source_code]
561    /// to hold a `SourceContents`.
562    ///
563    /// Note that all the setters affecting `source_code` are
564    /// mutually exclusive.
565    ///
566    /// # Example
567    /// ```
568    /// # use google_cloud_workflows_v1::model::Workflow;
569    /// let x = Workflow::new().set_source_contents("example");
570    /// assert!(x.source_contents().is_some());
571    /// ```
572    pub fn set_source_contents<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
573        self.source_code =
574            std::option::Option::Some(crate::model::workflow::SourceCode::SourceContents(v.into()));
575        self
576    }
577}
578
579impl wkt::message::Message for Workflow {
580    fn typename() -> &'static str {
581        "type.googleapis.com/google.cloud.workflows.v1.Workflow"
582    }
583}
584
585/// Defines additional types related to [Workflow].
586pub mod workflow {
587    #[allow(unused_imports)]
588    use super::*;
589
590    /// Describes an error related to the current state of the workflow.
591    #[derive(Clone, Default, PartialEq)]
592    #[non_exhaustive]
593    pub struct StateError {
594        /// Provides specifics about the error.
595        pub details: std::string::String,
596
597        /// The type of this state error.
598        pub r#type: crate::model::workflow::state_error::Type,
599
600        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
601    }
602
603    impl StateError {
604        pub fn new() -> Self {
605            std::default::Default::default()
606        }
607
608        /// Sets the value of [details][crate::model::workflow::StateError::details].
609        ///
610        /// # Example
611        /// ```
612        /// # use google_cloud_workflows_v1::model::workflow::StateError;
613        /// let x = StateError::new().set_details("example");
614        /// ```
615        pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
616            self.details = v.into();
617            self
618        }
619
620        /// Sets the value of [r#type][crate::model::workflow::StateError::type].
621        ///
622        /// # Example
623        /// ```
624        /// # use google_cloud_workflows_v1::model::workflow::StateError;
625        /// use google_cloud_workflows_v1::model::workflow::state_error::Type;
626        /// let x0 = StateError::new().set_type(Type::KmsError);
627        /// ```
628        pub fn set_type<T: std::convert::Into<crate::model::workflow::state_error::Type>>(
629            mut self,
630            v: T,
631        ) -> Self {
632            self.r#type = v.into();
633            self
634        }
635    }
636
637    impl wkt::message::Message for StateError {
638        fn typename() -> &'static str {
639            "type.googleapis.com/google.cloud.workflows.v1.Workflow.StateError"
640        }
641    }
642
643    /// Defines additional types related to [StateError].
644    pub mod state_error {
645        #[allow(unused_imports)]
646        use super::*;
647
648        /// Describes the possibled types of a state error.
649        ///
650        /// # Working with unknown values
651        ///
652        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
653        /// additional enum variants at any time. Adding new variants is not considered
654        /// a breaking change. Applications should write their code in anticipation of:
655        ///
656        /// - New values appearing in future releases of the client library, **and**
657        /// - New values received dynamically, without application changes.
658        ///
659        /// Please consult the [Working with enums] section in the user guide for some
660        /// guidelines.
661        ///
662        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
663        #[derive(Clone, Debug, PartialEq)]
664        #[non_exhaustive]
665        pub enum Type {
666            /// No type specified.
667            Unspecified,
668            /// Caused by an issue with KMS.
669            KmsError,
670            /// If set, the enum was initialized with an unknown value.
671            ///
672            /// Applications can examine the value using [Type::value] or
673            /// [Type::name].
674            UnknownValue(r#type::UnknownValue),
675        }
676
677        #[doc(hidden)]
678        pub mod r#type {
679            #[allow(unused_imports)]
680            use super::*;
681            #[derive(Clone, Debug, PartialEq)]
682            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
683        }
684
685        impl Type {
686            /// Gets the enum value.
687            ///
688            /// Returns `None` if the enum contains an unknown value deserialized from
689            /// the string representation of enums.
690            pub fn value(&self) -> std::option::Option<i32> {
691                match self {
692                    Self::Unspecified => std::option::Option::Some(0),
693                    Self::KmsError => std::option::Option::Some(1),
694                    Self::UnknownValue(u) => u.0.value(),
695                }
696            }
697
698            /// Gets the enum value as a string.
699            ///
700            /// Returns `None` if the enum contains an unknown value deserialized from
701            /// the integer representation of enums.
702            pub fn name(&self) -> std::option::Option<&str> {
703                match self {
704                    Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
705                    Self::KmsError => std::option::Option::Some("KMS_ERROR"),
706                    Self::UnknownValue(u) => u.0.name(),
707                }
708            }
709        }
710
711        impl std::default::Default for Type {
712            fn default() -> Self {
713                use std::convert::From;
714                Self::from(0)
715            }
716        }
717
718        impl std::fmt::Display for Type {
719            fn fmt(
720                &self,
721                f: &mut std::fmt::Formatter<'_>,
722            ) -> std::result::Result<(), std::fmt::Error> {
723                wkt::internal::display_enum(f, self.name(), self.value())
724            }
725        }
726
727        impl std::convert::From<i32> for Type {
728            fn from(value: i32) -> Self {
729                match value {
730                    0 => Self::Unspecified,
731                    1 => Self::KmsError,
732                    _ => Self::UnknownValue(r#type::UnknownValue(
733                        wkt::internal::UnknownEnumValue::Integer(value),
734                    )),
735                }
736            }
737        }
738
739        impl std::convert::From<&str> for Type {
740            fn from(value: &str) -> Self {
741                use std::string::ToString;
742                match value {
743                    "TYPE_UNSPECIFIED" => Self::Unspecified,
744                    "KMS_ERROR" => Self::KmsError,
745                    _ => Self::UnknownValue(r#type::UnknownValue(
746                        wkt::internal::UnknownEnumValue::String(value.to_string()),
747                    )),
748                }
749            }
750        }
751
752        impl serde::ser::Serialize for Type {
753            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
754            where
755                S: serde::Serializer,
756            {
757                match self {
758                    Self::Unspecified => serializer.serialize_i32(0),
759                    Self::KmsError => serializer.serialize_i32(1),
760                    Self::UnknownValue(u) => u.0.serialize(serializer),
761                }
762            }
763        }
764
765        impl<'de> serde::de::Deserialize<'de> for Type {
766            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
767            where
768                D: serde::Deserializer<'de>,
769            {
770                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
771                    ".google.cloud.workflows.v1.Workflow.StateError.Type",
772                ))
773            }
774        }
775    }
776
777    /// Describes the current state of workflow deployment.
778    ///
779    /// # Working with unknown values
780    ///
781    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
782    /// additional enum variants at any time. Adding new variants is not considered
783    /// a breaking change. Applications should write their code in anticipation of:
784    ///
785    /// - New values appearing in future releases of the client library, **and**
786    /// - New values received dynamically, without application changes.
787    ///
788    /// Please consult the [Working with enums] section in the user guide for some
789    /// guidelines.
790    ///
791    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
792    #[derive(Clone, Debug, PartialEq)]
793    #[non_exhaustive]
794    pub enum State {
795        /// Invalid state.
796        Unspecified,
797        /// The workflow has been deployed successfully and is serving.
798        Active,
799        /// Workflow data is unavailable. See the `state_error` field.
800        Unavailable,
801        /// If set, the enum was initialized with an unknown value.
802        ///
803        /// Applications can examine the value using [State::value] or
804        /// [State::name].
805        UnknownValue(state::UnknownValue),
806    }
807
808    #[doc(hidden)]
809    pub mod state {
810        #[allow(unused_imports)]
811        use super::*;
812        #[derive(Clone, Debug, PartialEq)]
813        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
814    }
815
816    impl State {
817        /// Gets the enum value.
818        ///
819        /// Returns `None` if the enum contains an unknown value deserialized from
820        /// the string representation of enums.
821        pub fn value(&self) -> std::option::Option<i32> {
822            match self {
823                Self::Unspecified => std::option::Option::Some(0),
824                Self::Active => std::option::Option::Some(1),
825                Self::Unavailable => std::option::Option::Some(2),
826                Self::UnknownValue(u) => u.0.value(),
827            }
828        }
829
830        /// Gets the enum value as a string.
831        ///
832        /// Returns `None` if the enum contains an unknown value deserialized from
833        /// the integer representation of enums.
834        pub fn name(&self) -> std::option::Option<&str> {
835            match self {
836                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
837                Self::Active => std::option::Option::Some("ACTIVE"),
838                Self::Unavailable => std::option::Option::Some("UNAVAILABLE"),
839                Self::UnknownValue(u) => u.0.name(),
840            }
841        }
842    }
843
844    impl std::default::Default for State {
845        fn default() -> Self {
846            use std::convert::From;
847            Self::from(0)
848        }
849    }
850
851    impl std::fmt::Display for State {
852        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
853            wkt::internal::display_enum(f, self.name(), self.value())
854        }
855    }
856
857    impl std::convert::From<i32> for State {
858        fn from(value: i32) -> Self {
859            match value {
860                0 => Self::Unspecified,
861                1 => Self::Active,
862                2 => Self::Unavailable,
863                _ => Self::UnknownValue(state::UnknownValue(
864                    wkt::internal::UnknownEnumValue::Integer(value),
865                )),
866            }
867        }
868    }
869
870    impl std::convert::From<&str> for State {
871        fn from(value: &str) -> Self {
872            use std::string::ToString;
873            match value {
874                "STATE_UNSPECIFIED" => Self::Unspecified,
875                "ACTIVE" => Self::Active,
876                "UNAVAILABLE" => Self::Unavailable,
877                _ => Self::UnknownValue(state::UnknownValue(
878                    wkt::internal::UnknownEnumValue::String(value.to_string()),
879                )),
880            }
881        }
882    }
883
884    impl serde::ser::Serialize for State {
885        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
886        where
887            S: serde::Serializer,
888        {
889            match self {
890                Self::Unspecified => serializer.serialize_i32(0),
891                Self::Active => serializer.serialize_i32(1),
892                Self::Unavailable => serializer.serialize_i32(2),
893                Self::UnknownValue(u) => u.0.serialize(serializer),
894            }
895        }
896    }
897
898    impl<'de> serde::de::Deserialize<'de> for State {
899        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
900        where
901            D: serde::Deserializer<'de>,
902        {
903            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
904                ".google.cloud.workflows.v1.Workflow.State",
905            ))
906        }
907    }
908
909    /// Describes the level of platform logging to apply to calls and call
910    /// responses during workflow executions.
911    ///
912    /// # Working with unknown values
913    ///
914    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
915    /// additional enum variants at any time. Adding new variants is not considered
916    /// a breaking change. Applications should write their code in anticipation of:
917    ///
918    /// - New values appearing in future releases of the client library, **and**
919    /// - New values received dynamically, without application changes.
920    ///
921    /// Please consult the [Working with enums] section in the user guide for some
922    /// guidelines.
923    ///
924    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
925    #[derive(Clone, Debug, PartialEq)]
926    #[non_exhaustive]
927    pub enum CallLogLevel {
928        /// No call logging level specified.
929        Unspecified,
930        /// Log all call steps within workflows, all call returns, and all exceptions
931        /// raised.
932        LogAllCalls,
933        /// Log only exceptions that are raised from call steps within workflows.
934        LogErrorsOnly,
935        /// Explicitly log nothing.
936        LogNone,
937        /// If set, the enum was initialized with an unknown value.
938        ///
939        /// Applications can examine the value using [CallLogLevel::value] or
940        /// [CallLogLevel::name].
941        UnknownValue(call_log_level::UnknownValue),
942    }
943
944    #[doc(hidden)]
945    pub mod call_log_level {
946        #[allow(unused_imports)]
947        use super::*;
948        #[derive(Clone, Debug, PartialEq)]
949        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
950    }
951
952    impl CallLogLevel {
953        /// Gets the enum value.
954        ///
955        /// Returns `None` if the enum contains an unknown value deserialized from
956        /// the string representation of enums.
957        pub fn value(&self) -> std::option::Option<i32> {
958            match self {
959                Self::Unspecified => std::option::Option::Some(0),
960                Self::LogAllCalls => std::option::Option::Some(1),
961                Self::LogErrorsOnly => std::option::Option::Some(2),
962                Self::LogNone => std::option::Option::Some(3),
963                Self::UnknownValue(u) => u.0.value(),
964            }
965        }
966
967        /// Gets the enum value as a string.
968        ///
969        /// Returns `None` if the enum contains an unknown value deserialized from
970        /// the integer representation of enums.
971        pub fn name(&self) -> std::option::Option<&str> {
972            match self {
973                Self::Unspecified => std::option::Option::Some("CALL_LOG_LEVEL_UNSPECIFIED"),
974                Self::LogAllCalls => std::option::Option::Some("LOG_ALL_CALLS"),
975                Self::LogErrorsOnly => std::option::Option::Some("LOG_ERRORS_ONLY"),
976                Self::LogNone => std::option::Option::Some("LOG_NONE"),
977                Self::UnknownValue(u) => u.0.name(),
978            }
979        }
980    }
981
982    impl std::default::Default for CallLogLevel {
983        fn default() -> Self {
984            use std::convert::From;
985            Self::from(0)
986        }
987    }
988
989    impl std::fmt::Display for CallLogLevel {
990        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
991            wkt::internal::display_enum(f, self.name(), self.value())
992        }
993    }
994
995    impl std::convert::From<i32> for CallLogLevel {
996        fn from(value: i32) -> Self {
997            match value {
998                0 => Self::Unspecified,
999                1 => Self::LogAllCalls,
1000                2 => Self::LogErrorsOnly,
1001                3 => Self::LogNone,
1002                _ => Self::UnknownValue(call_log_level::UnknownValue(
1003                    wkt::internal::UnknownEnumValue::Integer(value),
1004                )),
1005            }
1006        }
1007    }
1008
1009    impl std::convert::From<&str> for CallLogLevel {
1010        fn from(value: &str) -> Self {
1011            use std::string::ToString;
1012            match value {
1013                "CALL_LOG_LEVEL_UNSPECIFIED" => Self::Unspecified,
1014                "LOG_ALL_CALLS" => Self::LogAllCalls,
1015                "LOG_ERRORS_ONLY" => Self::LogErrorsOnly,
1016                "LOG_NONE" => Self::LogNone,
1017                _ => Self::UnknownValue(call_log_level::UnknownValue(
1018                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1019                )),
1020            }
1021        }
1022    }
1023
1024    impl serde::ser::Serialize for CallLogLevel {
1025        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1026        where
1027            S: serde::Serializer,
1028        {
1029            match self {
1030                Self::Unspecified => serializer.serialize_i32(0),
1031                Self::LogAllCalls => serializer.serialize_i32(1),
1032                Self::LogErrorsOnly => serializer.serialize_i32(2),
1033                Self::LogNone => serializer.serialize_i32(3),
1034                Self::UnknownValue(u) => u.0.serialize(serializer),
1035            }
1036        }
1037    }
1038
1039    impl<'de> serde::de::Deserialize<'de> for CallLogLevel {
1040        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1041        where
1042            D: serde::Deserializer<'de>,
1043        {
1044            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CallLogLevel>::new(
1045                ".google.cloud.workflows.v1.Workflow.CallLogLevel",
1046            ))
1047        }
1048    }
1049
1050    /// Required. Location of the workflow source code.
1051    /// Modifying this field for an existing workflow results in a new workflow
1052    /// revision.
1053    #[derive(Clone, Debug, PartialEq)]
1054    #[non_exhaustive]
1055    pub enum SourceCode {
1056        /// Workflow code to be executed. The size limit is 128KB.
1057        SourceContents(std::string::String),
1058    }
1059}
1060
1061/// Request for the
1062/// [ListWorkflows][google.cloud.workflows.v1.Workflows.ListWorkflows]
1063/// method.
1064///
1065/// [google.cloud.workflows.v1.Workflows.ListWorkflows]: crate::client::Workflows::list_workflows
1066#[derive(Clone, Default, PartialEq)]
1067#[non_exhaustive]
1068pub struct ListWorkflowsRequest {
1069    /// Required. Project and location from which the workflows should be listed.
1070    /// Format: projects/{project}/locations/{location}
1071    pub parent: std::string::String,
1072
1073    /// Maximum number of workflows to return per call. The service might return
1074    /// fewer than this value even if not at the end of the collection. If a value
1075    /// is not specified, a default value of 500 is used. The maximum permitted
1076    /// value is 1000 and values greater than 1000 are coerced down to 1000.
1077    pub page_size: i32,
1078
1079    /// A page token, received from a previous `ListWorkflows` call.
1080    /// Provide this to retrieve the subsequent page.
1081    ///
1082    /// When paginating, all other parameters provided to `ListWorkflows` must
1083    /// match the call that provided the page token.
1084    pub page_token: std::string::String,
1085
1086    /// Filter to restrict results to specific workflows.
1087    /// For details, see <a href="https://google.aip.dev/160"
1088    /// class="external"\>AIP-160</a>.
1089    ///
1090    /// For example, if you are using the Google APIs Explorer:
1091    ///
1092    /// `state="SUCCEEDED"`
1093    ///
1094    /// or
1095    ///
1096    /// `createTime>"2023-08-01" AND state="FAILED"`
1097    pub filter: std::string::String,
1098
1099    /// Comma-separated list of fields that specify the order of the results.
1100    /// Default sorting order for a field is ascending. To specify descending order
1101    /// for a field, append a "desc" suffix.
1102    /// If not specified, the results are returned in an unspecified order.
1103    pub order_by: std::string::String,
1104
1105    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1106}
1107
1108impl ListWorkflowsRequest {
1109    pub fn new() -> Self {
1110        std::default::Default::default()
1111    }
1112
1113    /// Sets the value of [parent][crate::model::ListWorkflowsRequest::parent].
1114    ///
1115    /// # Example
1116    /// ```
1117    /// # use google_cloud_workflows_v1::model::ListWorkflowsRequest;
1118    /// let x = ListWorkflowsRequest::new().set_parent("example");
1119    /// ```
1120    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1121        self.parent = v.into();
1122        self
1123    }
1124
1125    /// Sets the value of [page_size][crate::model::ListWorkflowsRequest::page_size].
1126    ///
1127    /// # Example
1128    /// ```
1129    /// # use google_cloud_workflows_v1::model::ListWorkflowsRequest;
1130    /// let x = ListWorkflowsRequest::new().set_page_size(42);
1131    /// ```
1132    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1133        self.page_size = v.into();
1134        self
1135    }
1136
1137    /// Sets the value of [page_token][crate::model::ListWorkflowsRequest::page_token].
1138    ///
1139    /// # Example
1140    /// ```
1141    /// # use google_cloud_workflows_v1::model::ListWorkflowsRequest;
1142    /// let x = ListWorkflowsRequest::new().set_page_token("example");
1143    /// ```
1144    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1145        self.page_token = v.into();
1146        self
1147    }
1148
1149    /// Sets the value of [filter][crate::model::ListWorkflowsRequest::filter].
1150    ///
1151    /// # Example
1152    /// ```
1153    /// # use google_cloud_workflows_v1::model::ListWorkflowsRequest;
1154    /// let x = ListWorkflowsRequest::new().set_filter("example");
1155    /// ```
1156    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1157        self.filter = v.into();
1158        self
1159    }
1160
1161    /// Sets the value of [order_by][crate::model::ListWorkflowsRequest::order_by].
1162    ///
1163    /// # Example
1164    /// ```
1165    /// # use google_cloud_workflows_v1::model::ListWorkflowsRequest;
1166    /// let x = ListWorkflowsRequest::new().set_order_by("example");
1167    /// ```
1168    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1169        self.order_by = v.into();
1170        self
1171    }
1172}
1173
1174impl wkt::message::Message for ListWorkflowsRequest {
1175    fn typename() -> &'static str {
1176        "type.googleapis.com/google.cloud.workflows.v1.ListWorkflowsRequest"
1177    }
1178}
1179
1180/// Response for the
1181/// [ListWorkflows][google.cloud.workflows.v1.Workflows.ListWorkflows]
1182/// method.
1183///
1184/// [google.cloud.workflows.v1.Workflows.ListWorkflows]: crate::client::Workflows::list_workflows
1185#[derive(Clone, Default, PartialEq)]
1186#[non_exhaustive]
1187pub struct ListWorkflowsResponse {
1188    /// The workflows that match the request.
1189    pub workflows: std::vec::Vec<crate::model::Workflow>,
1190
1191    /// A token, which can be sent as `page_token` to retrieve the next page.
1192    /// If this field is omitted, there are no subsequent pages.
1193    pub next_page_token: std::string::String,
1194
1195    /// Unreachable resources.
1196    pub unreachable: std::vec::Vec<std::string::String>,
1197
1198    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1199}
1200
1201impl ListWorkflowsResponse {
1202    pub fn new() -> Self {
1203        std::default::Default::default()
1204    }
1205
1206    /// Sets the value of [workflows][crate::model::ListWorkflowsResponse::workflows].
1207    ///
1208    /// # Example
1209    /// ```
1210    /// # use google_cloud_workflows_v1::model::ListWorkflowsResponse;
1211    /// use google_cloud_workflows_v1::model::Workflow;
1212    /// let x = ListWorkflowsResponse::new()
1213    ///     .set_workflows([
1214    ///         Workflow::default()/* use setters */,
1215    ///         Workflow::default()/* use (different) setters */,
1216    ///     ]);
1217    /// ```
1218    pub fn set_workflows<T, V>(mut self, v: T) -> Self
1219    where
1220        T: std::iter::IntoIterator<Item = V>,
1221        V: std::convert::Into<crate::model::Workflow>,
1222    {
1223        use std::iter::Iterator;
1224        self.workflows = v.into_iter().map(|i| i.into()).collect();
1225        self
1226    }
1227
1228    /// Sets the value of [next_page_token][crate::model::ListWorkflowsResponse::next_page_token].
1229    ///
1230    /// # Example
1231    /// ```
1232    /// # use google_cloud_workflows_v1::model::ListWorkflowsResponse;
1233    /// let x = ListWorkflowsResponse::new().set_next_page_token("example");
1234    /// ```
1235    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1236        self.next_page_token = v.into();
1237        self
1238    }
1239
1240    /// Sets the value of [unreachable][crate::model::ListWorkflowsResponse::unreachable].
1241    ///
1242    /// # Example
1243    /// ```
1244    /// # use google_cloud_workflows_v1::model::ListWorkflowsResponse;
1245    /// let x = ListWorkflowsResponse::new().set_unreachable(["a", "b", "c"]);
1246    /// ```
1247    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1248    where
1249        T: std::iter::IntoIterator<Item = V>,
1250        V: std::convert::Into<std::string::String>,
1251    {
1252        use std::iter::Iterator;
1253        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1254        self
1255    }
1256}
1257
1258impl wkt::message::Message for ListWorkflowsResponse {
1259    fn typename() -> &'static str {
1260        "type.googleapis.com/google.cloud.workflows.v1.ListWorkflowsResponse"
1261    }
1262}
1263
1264#[doc(hidden)]
1265impl gax::paginator::internal::PageableResponse for ListWorkflowsResponse {
1266    type PageItem = crate::model::Workflow;
1267
1268    fn items(self) -> std::vec::Vec<Self::PageItem> {
1269        self.workflows
1270    }
1271
1272    fn next_page_token(&self) -> std::string::String {
1273        use std::clone::Clone;
1274        self.next_page_token.clone()
1275    }
1276}
1277
1278/// Request for the
1279/// [GetWorkflow][google.cloud.workflows.v1.Workflows.GetWorkflow] method.
1280///
1281/// [google.cloud.workflows.v1.Workflows.GetWorkflow]: crate::client::Workflows::get_workflow
1282#[derive(Clone, Default, PartialEq)]
1283#[non_exhaustive]
1284pub struct GetWorkflowRequest {
1285    /// Required. Name of the workflow for which information should be retrieved.
1286    /// Format: projects/{project}/locations/{location}/workflows/{workflow}
1287    pub name: std::string::String,
1288
1289    /// Optional. The revision of the workflow to retrieve. If the revision_id is
1290    /// empty, the latest revision is retrieved.
1291    /// The format is "000001-a4d", where the first six characters define
1292    /// the zero-padded decimal revision number. They are followed by a hyphen and
1293    /// three hexadecimal characters.
1294    pub revision_id: std::string::String,
1295
1296    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1297}
1298
1299impl GetWorkflowRequest {
1300    pub fn new() -> Self {
1301        std::default::Default::default()
1302    }
1303
1304    /// Sets the value of [name][crate::model::GetWorkflowRequest::name].
1305    ///
1306    /// # Example
1307    /// ```
1308    /// # use google_cloud_workflows_v1::model::GetWorkflowRequest;
1309    /// let x = GetWorkflowRequest::new().set_name("example");
1310    /// ```
1311    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1312        self.name = v.into();
1313        self
1314    }
1315
1316    /// Sets the value of [revision_id][crate::model::GetWorkflowRequest::revision_id].
1317    ///
1318    /// # Example
1319    /// ```
1320    /// # use google_cloud_workflows_v1::model::GetWorkflowRequest;
1321    /// let x = GetWorkflowRequest::new().set_revision_id("example");
1322    /// ```
1323    pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1324        self.revision_id = v.into();
1325        self
1326    }
1327}
1328
1329impl wkt::message::Message for GetWorkflowRequest {
1330    fn typename() -> &'static str {
1331        "type.googleapis.com/google.cloud.workflows.v1.GetWorkflowRequest"
1332    }
1333}
1334
1335/// Request for the
1336/// [CreateWorkflow][google.cloud.workflows.v1.Workflows.CreateWorkflow]
1337/// method.
1338///
1339/// [google.cloud.workflows.v1.Workflows.CreateWorkflow]: crate::client::Workflows::create_workflow
1340#[derive(Clone, Default, PartialEq)]
1341#[non_exhaustive]
1342pub struct CreateWorkflowRequest {
1343    /// Required. Project and location in which the workflow should be created.
1344    /// Format:  projects/{project}/locations/{location}
1345    pub parent: std::string::String,
1346
1347    /// Required. Workflow to be created.
1348    pub workflow: std::option::Option<crate::model::Workflow>,
1349
1350    /// Required. The ID of the workflow to be created. It has to fulfill the
1351    /// following requirements:
1352    ///
1353    /// * Must contain only letters, numbers, underscores and hyphens.
1354    /// * Must start with a letter.
1355    /// * Must be between 1-64 characters.
1356    /// * Must end with a number or a letter.
1357    /// * Must be unique within the customer project and location.
1358    pub workflow_id: std::string::String,
1359
1360    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1361}
1362
1363impl CreateWorkflowRequest {
1364    pub fn new() -> Self {
1365        std::default::Default::default()
1366    }
1367
1368    /// Sets the value of [parent][crate::model::CreateWorkflowRequest::parent].
1369    ///
1370    /// # Example
1371    /// ```
1372    /// # use google_cloud_workflows_v1::model::CreateWorkflowRequest;
1373    /// let x = CreateWorkflowRequest::new().set_parent("example");
1374    /// ```
1375    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1376        self.parent = v.into();
1377        self
1378    }
1379
1380    /// Sets the value of [workflow][crate::model::CreateWorkflowRequest::workflow].
1381    ///
1382    /// # Example
1383    /// ```
1384    /// # use google_cloud_workflows_v1::model::CreateWorkflowRequest;
1385    /// use google_cloud_workflows_v1::model::Workflow;
1386    /// let x = CreateWorkflowRequest::new().set_workflow(Workflow::default()/* use setters */);
1387    /// ```
1388    pub fn set_workflow<T>(mut self, v: T) -> Self
1389    where
1390        T: std::convert::Into<crate::model::Workflow>,
1391    {
1392        self.workflow = std::option::Option::Some(v.into());
1393        self
1394    }
1395
1396    /// Sets or clears the value of [workflow][crate::model::CreateWorkflowRequest::workflow].
1397    ///
1398    /// # Example
1399    /// ```
1400    /// # use google_cloud_workflows_v1::model::CreateWorkflowRequest;
1401    /// use google_cloud_workflows_v1::model::Workflow;
1402    /// let x = CreateWorkflowRequest::new().set_or_clear_workflow(Some(Workflow::default()/* use setters */));
1403    /// let x = CreateWorkflowRequest::new().set_or_clear_workflow(None::<Workflow>);
1404    /// ```
1405    pub fn set_or_clear_workflow<T>(mut self, v: std::option::Option<T>) -> Self
1406    where
1407        T: std::convert::Into<crate::model::Workflow>,
1408    {
1409        self.workflow = v.map(|x| x.into());
1410        self
1411    }
1412
1413    /// Sets the value of [workflow_id][crate::model::CreateWorkflowRequest::workflow_id].
1414    ///
1415    /// # Example
1416    /// ```
1417    /// # use google_cloud_workflows_v1::model::CreateWorkflowRequest;
1418    /// let x = CreateWorkflowRequest::new().set_workflow_id("example");
1419    /// ```
1420    pub fn set_workflow_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1421        self.workflow_id = v.into();
1422        self
1423    }
1424}
1425
1426impl wkt::message::Message for CreateWorkflowRequest {
1427    fn typename() -> &'static str {
1428        "type.googleapis.com/google.cloud.workflows.v1.CreateWorkflowRequest"
1429    }
1430}
1431
1432/// Request for the
1433/// [DeleteWorkflow][google.cloud.workflows.v1.Workflows.DeleteWorkflow]
1434/// method.
1435///
1436/// [google.cloud.workflows.v1.Workflows.DeleteWorkflow]: crate::client::Workflows::delete_workflow
1437#[derive(Clone, Default, PartialEq)]
1438#[non_exhaustive]
1439pub struct DeleteWorkflowRequest {
1440    /// Required. Name of the workflow to be deleted.
1441    /// Format: projects/{project}/locations/{location}/workflows/{workflow}
1442    pub name: std::string::String,
1443
1444    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1445}
1446
1447impl DeleteWorkflowRequest {
1448    pub fn new() -> Self {
1449        std::default::Default::default()
1450    }
1451
1452    /// Sets the value of [name][crate::model::DeleteWorkflowRequest::name].
1453    ///
1454    /// # Example
1455    /// ```
1456    /// # use google_cloud_workflows_v1::model::DeleteWorkflowRequest;
1457    /// let x = DeleteWorkflowRequest::new().set_name("example");
1458    /// ```
1459    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1460        self.name = v.into();
1461        self
1462    }
1463}
1464
1465impl wkt::message::Message for DeleteWorkflowRequest {
1466    fn typename() -> &'static str {
1467        "type.googleapis.com/google.cloud.workflows.v1.DeleteWorkflowRequest"
1468    }
1469}
1470
1471/// Request for the
1472/// [UpdateWorkflow][google.cloud.workflows.v1.Workflows.UpdateWorkflow]
1473/// method.
1474///
1475/// [google.cloud.workflows.v1.Workflows.UpdateWorkflow]: crate::client::Workflows::update_workflow
1476#[derive(Clone, Default, PartialEq)]
1477#[non_exhaustive]
1478pub struct UpdateWorkflowRequest {
1479    /// Required. Workflow to be updated.
1480    pub workflow: std::option::Option<crate::model::Workflow>,
1481
1482    /// List of fields to be updated. If not present, the entire workflow
1483    /// will be updated.
1484    pub update_mask: std::option::Option<wkt::FieldMask>,
1485
1486    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1487}
1488
1489impl UpdateWorkflowRequest {
1490    pub fn new() -> Self {
1491        std::default::Default::default()
1492    }
1493
1494    /// Sets the value of [workflow][crate::model::UpdateWorkflowRequest::workflow].
1495    ///
1496    /// # Example
1497    /// ```
1498    /// # use google_cloud_workflows_v1::model::UpdateWorkflowRequest;
1499    /// use google_cloud_workflows_v1::model::Workflow;
1500    /// let x = UpdateWorkflowRequest::new().set_workflow(Workflow::default()/* use setters */);
1501    /// ```
1502    pub fn set_workflow<T>(mut self, v: T) -> Self
1503    where
1504        T: std::convert::Into<crate::model::Workflow>,
1505    {
1506        self.workflow = std::option::Option::Some(v.into());
1507        self
1508    }
1509
1510    /// Sets or clears the value of [workflow][crate::model::UpdateWorkflowRequest::workflow].
1511    ///
1512    /// # Example
1513    /// ```
1514    /// # use google_cloud_workflows_v1::model::UpdateWorkflowRequest;
1515    /// use google_cloud_workflows_v1::model::Workflow;
1516    /// let x = UpdateWorkflowRequest::new().set_or_clear_workflow(Some(Workflow::default()/* use setters */));
1517    /// let x = UpdateWorkflowRequest::new().set_or_clear_workflow(None::<Workflow>);
1518    /// ```
1519    pub fn set_or_clear_workflow<T>(mut self, v: std::option::Option<T>) -> Self
1520    where
1521        T: std::convert::Into<crate::model::Workflow>,
1522    {
1523        self.workflow = v.map(|x| x.into());
1524        self
1525    }
1526
1527    /// Sets the value of [update_mask][crate::model::UpdateWorkflowRequest::update_mask].
1528    ///
1529    /// # Example
1530    /// ```
1531    /// # use google_cloud_workflows_v1::model::UpdateWorkflowRequest;
1532    /// use wkt::FieldMask;
1533    /// let x = UpdateWorkflowRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1534    /// ```
1535    pub fn set_update_mask<T>(mut self, v: T) -> Self
1536    where
1537        T: std::convert::Into<wkt::FieldMask>,
1538    {
1539        self.update_mask = std::option::Option::Some(v.into());
1540        self
1541    }
1542
1543    /// Sets or clears the value of [update_mask][crate::model::UpdateWorkflowRequest::update_mask].
1544    ///
1545    /// # Example
1546    /// ```
1547    /// # use google_cloud_workflows_v1::model::UpdateWorkflowRequest;
1548    /// use wkt::FieldMask;
1549    /// let x = UpdateWorkflowRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1550    /// let x = UpdateWorkflowRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1551    /// ```
1552    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1553    where
1554        T: std::convert::Into<wkt::FieldMask>,
1555    {
1556        self.update_mask = v.map(|x| x.into());
1557        self
1558    }
1559}
1560
1561impl wkt::message::Message for UpdateWorkflowRequest {
1562    fn typename() -> &'static str {
1563        "type.googleapis.com/google.cloud.workflows.v1.UpdateWorkflowRequest"
1564    }
1565}
1566
1567/// Represents the metadata of the long-running operation.
1568#[derive(Clone, Default, PartialEq)]
1569#[non_exhaustive]
1570pub struct OperationMetadata {
1571    /// The time the operation was created.
1572    pub create_time: std::option::Option<wkt::Timestamp>,
1573
1574    /// The time the operation finished running.
1575    pub end_time: std::option::Option<wkt::Timestamp>,
1576
1577    /// Server-defined resource path for the target of the operation.
1578    pub target: std::string::String,
1579
1580    /// Name of the verb executed by the operation.
1581    pub verb: std::string::String,
1582
1583    /// API version used to start the operation.
1584    pub api_version: std::string::String,
1585
1586    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1587}
1588
1589impl OperationMetadata {
1590    pub fn new() -> Self {
1591        std::default::Default::default()
1592    }
1593
1594    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
1595    ///
1596    /// # Example
1597    /// ```
1598    /// # use google_cloud_workflows_v1::model::OperationMetadata;
1599    /// use wkt::Timestamp;
1600    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
1601    /// ```
1602    pub fn set_create_time<T>(mut self, v: T) -> Self
1603    where
1604        T: std::convert::Into<wkt::Timestamp>,
1605    {
1606        self.create_time = std::option::Option::Some(v.into());
1607        self
1608    }
1609
1610    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
1611    ///
1612    /// # Example
1613    /// ```
1614    /// # use google_cloud_workflows_v1::model::OperationMetadata;
1615    /// use wkt::Timestamp;
1616    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1617    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
1618    /// ```
1619    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1620    where
1621        T: std::convert::Into<wkt::Timestamp>,
1622    {
1623        self.create_time = v.map(|x| x.into());
1624        self
1625    }
1626
1627    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
1628    ///
1629    /// # Example
1630    /// ```
1631    /// # use google_cloud_workflows_v1::model::OperationMetadata;
1632    /// use wkt::Timestamp;
1633    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
1634    /// ```
1635    pub fn set_end_time<T>(mut self, v: T) -> Self
1636    where
1637        T: std::convert::Into<wkt::Timestamp>,
1638    {
1639        self.end_time = std::option::Option::Some(v.into());
1640        self
1641    }
1642
1643    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
1644    ///
1645    /// # Example
1646    /// ```
1647    /// # use google_cloud_workflows_v1::model::OperationMetadata;
1648    /// use wkt::Timestamp;
1649    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
1650    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
1651    /// ```
1652    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1653    where
1654        T: std::convert::Into<wkt::Timestamp>,
1655    {
1656        self.end_time = v.map(|x| x.into());
1657        self
1658    }
1659
1660    /// Sets the value of [target][crate::model::OperationMetadata::target].
1661    ///
1662    /// # Example
1663    /// ```
1664    /// # use google_cloud_workflows_v1::model::OperationMetadata;
1665    /// let x = OperationMetadata::new().set_target("example");
1666    /// ```
1667    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1668        self.target = v.into();
1669        self
1670    }
1671
1672    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
1673    ///
1674    /// # Example
1675    /// ```
1676    /// # use google_cloud_workflows_v1::model::OperationMetadata;
1677    /// let x = OperationMetadata::new().set_verb("example");
1678    /// ```
1679    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1680        self.verb = v.into();
1681        self
1682    }
1683
1684    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
1685    ///
1686    /// # Example
1687    /// ```
1688    /// # use google_cloud_workflows_v1::model::OperationMetadata;
1689    /// let x = OperationMetadata::new().set_api_version("example");
1690    /// ```
1691    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1692        self.api_version = v.into();
1693        self
1694    }
1695}
1696
1697impl wkt::message::Message for OperationMetadata {
1698    fn typename() -> &'static str {
1699        "type.googleapis.com/google.cloud.workflows.v1.OperationMetadata"
1700    }
1701}
1702
1703/// Request for the
1704/// [ListWorkflowRevisions][google.cloud.workflows.v1.Workflows.ListWorkflowRevisions]
1705/// method.
1706///
1707/// [google.cloud.workflows.v1.Workflows.ListWorkflowRevisions]: crate::client::Workflows::list_workflow_revisions
1708#[derive(Clone, Default, PartialEq)]
1709#[non_exhaustive]
1710pub struct ListWorkflowRevisionsRequest {
1711    /// Required. Workflow for which the revisions should be listed.
1712    /// Format: projects/{project}/locations/{location}/workflows/{workflow}
1713    pub name: std::string::String,
1714
1715    /// The maximum number of revisions to return per page. If a value is not
1716    /// specified, a default value of 20 is used. The maximum permitted value is
1717    /// 100. Values greater than 100 are coerced down to 100.
1718    pub page_size: i32,
1719
1720    /// The page token, received from a previous ListWorkflowRevisions call.
1721    /// Provide this to retrieve the subsequent page.
1722    pub page_token: std::string::String,
1723
1724    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1725}
1726
1727impl ListWorkflowRevisionsRequest {
1728    pub fn new() -> Self {
1729        std::default::Default::default()
1730    }
1731
1732    /// Sets the value of [name][crate::model::ListWorkflowRevisionsRequest::name].
1733    ///
1734    /// # Example
1735    /// ```
1736    /// # use google_cloud_workflows_v1::model::ListWorkflowRevisionsRequest;
1737    /// let x = ListWorkflowRevisionsRequest::new().set_name("example");
1738    /// ```
1739    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1740        self.name = v.into();
1741        self
1742    }
1743
1744    /// Sets the value of [page_size][crate::model::ListWorkflowRevisionsRequest::page_size].
1745    ///
1746    /// # Example
1747    /// ```
1748    /// # use google_cloud_workflows_v1::model::ListWorkflowRevisionsRequest;
1749    /// let x = ListWorkflowRevisionsRequest::new().set_page_size(42);
1750    /// ```
1751    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1752        self.page_size = v.into();
1753        self
1754    }
1755
1756    /// Sets the value of [page_token][crate::model::ListWorkflowRevisionsRequest::page_token].
1757    ///
1758    /// # Example
1759    /// ```
1760    /// # use google_cloud_workflows_v1::model::ListWorkflowRevisionsRequest;
1761    /// let x = ListWorkflowRevisionsRequest::new().set_page_token("example");
1762    /// ```
1763    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1764        self.page_token = v.into();
1765        self
1766    }
1767}
1768
1769impl wkt::message::Message for ListWorkflowRevisionsRequest {
1770    fn typename() -> &'static str {
1771        "type.googleapis.com/google.cloud.workflows.v1.ListWorkflowRevisionsRequest"
1772    }
1773}
1774
1775/// Response for the
1776/// [ListWorkflowRevisions][google.cloud.workflows.v1.Workflows.ListWorkflowRevisions]
1777/// method.
1778///
1779/// [google.cloud.workflows.v1.Workflows.ListWorkflowRevisions]: crate::client::Workflows::list_workflow_revisions
1780#[derive(Clone, Default, PartialEq)]
1781#[non_exhaustive]
1782pub struct ListWorkflowRevisionsResponse {
1783    /// The revisions of the workflow, ordered in reverse chronological order.
1784    pub workflows: std::vec::Vec<crate::model::Workflow>,
1785
1786    /// A token, which can be sent as `page_token` to retrieve the next page.
1787    /// If this field is omitted, there are no subsequent pages.
1788    pub next_page_token: std::string::String,
1789
1790    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1791}
1792
1793impl ListWorkflowRevisionsResponse {
1794    pub fn new() -> Self {
1795        std::default::Default::default()
1796    }
1797
1798    /// Sets the value of [workflows][crate::model::ListWorkflowRevisionsResponse::workflows].
1799    ///
1800    /// # Example
1801    /// ```
1802    /// # use google_cloud_workflows_v1::model::ListWorkflowRevisionsResponse;
1803    /// use google_cloud_workflows_v1::model::Workflow;
1804    /// let x = ListWorkflowRevisionsResponse::new()
1805    ///     .set_workflows([
1806    ///         Workflow::default()/* use setters */,
1807    ///         Workflow::default()/* use (different) setters */,
1808    ///     ]);
1809    /// ```
1810    pub fn set_workflows<T, V>(mut self, v: T) -> Self
1811    where
1812        T: std::iter::IntoIterator<Item = V>,
1813        V: std::convert::Into<crate::model::Workflow>,
1814    {
1815        use std::iter::Iterator;
1816        self.workflows = v.into_iter().map(|i| i.into()).collect();
1817        self
1818    }
1819
1820    /// Sets the value of [next_page_token][crate::model::ListWorkflowRevisionsResponse::next_page_token].
1821    ///
1822    /// # Example
1823    /// ```
1824    /// # use google_cloud_workflows_v1::model::ListWorkflowRevisionsResponse;
1825    /// let x = ListWorkflowRevisionsResponse::new().set_next_page_token("example");
1826    /// ```
1827    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1828        self.next_page_token = v.into();
1829        self
1830    }
1831}
1832
1833impl wkt::message::Message for ListWorkflowRevisionsResponse {
1834    fn typename() -> &'static str {
1835        "type.googleapis.com/google.cloud.workflows.v1.ListWorkflowRevisionsResponse"
1836    }
1837}
1838
1839#[doc(hidden)]
1840impl gax::paginator::internal::PageableResponse for ListWorkflowRevisionsResponse {
1841    type PageItem = crate::model::Workflow;
1842
1843    fn items(self) -> std::vec::Vec<Self::PageItem> {
1844        self.workflows
1845    }
1846
1847    fn next_page_token(&self) -> std::string::String {
1848        use std::clone::Clone;
1849        self.next_page_token.clone()
1850    }
1851}
1852
1853/// Define possible options for enabling the execution history level.
1854///
1855/// # Working with unknown values
1856///
1857/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1858/// additional enum variants at any time. Adding new variants is not considered
1859/// a breaking change. Applications should write their code in anticipation of:
1860///
1861/// - New values appearing in future releases of the client library, **and**
1862/// - New values received dynamically, without application changes.
1863///
1864/// Please consult the [Working with enums] section in the user guide for some
1865/// guidelines.
1866///
1867/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1868#[derive(Clone, Debug, PartialEq)]
1869#[non_exhaustive]
1870pub enum ExecutionHistoryLevel {
1871    /// The default/unset value.
1872    Unspecified,
1873    /// Enable execution history basic feature.
1874    ExecutionHistoryBasic,
1875    /// Enable execution history detailed feature.
1876    ExecutionHistoryDetailed,
1877    /// If set, the enum was initialized with an unknown value.
1878    ///
1879    /// Applications can examine the value using [ExecutionHistoryLevel::value] or
1880    /// [ExecutionHistoryLevel::name].
1881    UnknownValue(execution_history_level::UnknownValue),
1882}
1883
1884#[doc(hidden)]
1885pub mod execution_history_level {
1886    #[allow(unused_imports)]
1887    use super::*;
1888    #[derive(Clone, Debug, PartialEq)]
1889    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1890}
1891
1892impl ExecutionHistoryLevel {
1893    /// Gets the enum value.
1894    ///
1895    /// Returns `None` if the enum contains an unknown value deserialized from
1896    /// the string representation of enums.
1897    pub fn value(&self) -> std::option::Option<i32> {
1898        match self {
1899            Self::Unspecified => std::option::Option::Some(0),
1900            Self::ExecutionHistoryBasic => std::option::Option::Some(1),
1901            Self::ExecutionHistoryDetailed => std::option::Option::Some(2),
1902            Self::UnknownValue(u) => u.0.value(),
1903        }
1904    }
1905
1906    /// Gets the enum value as a string.
1907    ///
1908    /// Returns `None` if the enum contains an unknown value deserialized from
1909    /// the integer representation of enums.
1910    pub fn name(&self) -> std::option::Option<&str> {
1911        match self {
1912            Self::Unspecified => std::option::Option::Some("EXECUTION_HISTORY_LEVEL_UNSPECIFIED"),
1913            Self::ExecutionHistoryBasic => std::option::Option::Some("EXECUTION_HISTORY_BASIC"),
1914            Self::ExecutionHistoryDetailed => {
1915                std::option::Option::Some("EXECUTION_HISTORY_DETAILED")
1916            }
1917            Self::UnknownValue(u) => u.0.name(),
1918        }
1919    }
1920}
1921
1922impl std::default::Default for ExecutionHistoryLevel {
1923    fn default() -> Self {
1924        use std::convert::From;
1925        Self::from(0)
1926    }
1927}
1928
1929impl std::fmt::Display for ExecutionHistoryLevel {
1930    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1931        wkt::internal::display_enum(f, self.name(), self.value())
1932    }
1933}
1934
1935impl std::convert::From<i32> for ExecutionHistoryLevel {
1936    fn from(value: i32) -> Self {
1937        match value {
1938            0 => Self::Unspecified,
1939            1 => Self::ExecutionHistoryBasic,
1940            2 => Self::ExecutionHistoryDetailed,
1941            _ => Self::UnknownValue(execution_history_level::UnknownValue(
1942                wkt::internal::UnknownEnumValue::Integer(value),
1943            )),
1944        }
1945    }
1946}
1947
1948impl std::convert::From<&str> for ExecutionHistoryLevel {
1949    fn from(value: &str) -> Self {
1950        use std::string::ToString;
1951        match value {
1952            "EXECUTION_HISTORY_LEVEL_UNSPECIFIED" => Self::Unspecified,
1953            "EXECUTION_HISTORY_BASIC" => Self::ExecutionHistoryBasic,
1954            "EXECUTION_HISTORY_DETAILED" => Self::ExecutionHistoryDetailed,
1955            _ => Self::UnknownValue(execution_history_level::UnknownValue(
1956                wkt::internal::UnknownEnumValue::String(value.to_string()),
1957            )),
1958        }
1959    }
1960}
1961
1962impl serde::ser::Serialize for ExecutionHistoryLevel {
1963    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1964    where
1965        S: serde::Serializer,
1966    {
1967        match self {
1968            Self::Unspecified => serializer.serialize_i32(0),
1969            Self::ExecutionHistoryBasic => serializer.serialize_i32(1),
1970            Self::ExecutionHistoryDetailed => serializer.serialize_i32(2),
1971            Self::UnknownValue(u) => u.0.serialize(serializer),
1972        }
1973    }
1974}
1975
1976impl<'de> serde::de::Deserialize<'de> for ExecutionHistoryLevel {
1977    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1978    where
1979        D: serde::Deserializer<'de>,
1980    {
1981        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExecutionHistoryLevel>::new(
1982            ".google.cloud.workflows.v1.ExecutionHistoryLevel",
1983        ))
1984    }
1985}