#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![allow(rustdoc::invalid_html_tags)]
#![allow(rustdoc::bare_urls)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gaxi;
extern crate google_cloud_gax;
extern crate google_cloud_location;
extern crate google_cloud_longrunning;
extern crate google_cloud_lro;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;
mod debug;
mod deserialize;
mod serialize;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Workflow {
pub name: std::string::String,
pub description: std::string::String,
pub state: crate::model::workflow::State,
pub revision_id: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub revision_create_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub service_account: std::string::String,
pub crypto_key_name: std::string::String,
pub state_error: std::option::Option<crate::model::workflow::StateError>,
pub call_log_level: crate::model::workflow::CallLogLevel,
pub user_env_vars: std::collections::HashMap<std::string::String, std::string::String>,
pub execution_history_level: crate::model::ExecutionHistoryLevel,
pub all_kms_keys: std::vec::Vec<std::string::String>,
pub all_kms_keys_versions: std::vec::Vec<std::string::String>,
pub crypto_key_version: std::string::String,
pub tags: std::collections::HashMap<std::string::String, std::string::String>,
pub source_code: std::option::Option<crate::model::workflow::SourceCode>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Workflow {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::workflow::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.revision_id = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_revision_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.revision_create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_revision_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.revision_create_time = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service_account = v.into();
self
}
pub fn set_crypto_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.crypto_key_name = v.into();
self
}
pub fn set_state_error<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::workflow::StateError>,
{
self.state_error = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_state_error<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::workflow::StateError>,
{
self.state_error = v.map(|x| x.into());
self
}
pub fn set_call_log_level<T: std::convert::Into<crate::model::workflow::CallLogLevel>>(
mut self,
v: T,
) -> Self {
self.call_log_level = v.into();
self
}
pub fn set_user_env_vars<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.user_env_vars = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_execution_history_level<
T: std::convert::Into<crate::model::ExecutionHistoryLevel>,
>(
mut self,
v: T,
) -> Self {
self.execution_history_level = v.into();
self
}
pub fn set_all_kms_keys<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.all_kms_keys = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_all_kms_keys_versions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.all_kms_keys_versions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_crypto_key_version<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.crypto_key_version = v.into();
self
}
pub fn set_tags<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_source_code<
T: std::convert::Into<std::option::Option<crate::model::workflow::SourceCode>>,
>(
mut self,
v: T,
) -> Self {
self.source_code = v.into();
self
}
pub fn source_contents(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.source_code.as_ref().and_then(|v| match v {
crate::model::workflow::SourceCode::SourceContents(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_source_contents<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source_code =
std::option::Option::Some(crate::model::workflow::SourceCode::SourceContents(v.into()));
self
}
}
impl wkt::message::Message for Workflow {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.workflows.v1.Workflow"
}
}
pub mod workflow {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StateError {
pub details: std::string::String,
pub r#type: crate::model::workflow::state_error::Type,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StateError {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.details = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::workflow::state_error::Type>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
}
impl wkt::message::Message for StateError {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.workflows.v1.Workflow.StateError"
}
}
pub mod state_error {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
Unspecified,
KmsError,
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::KmsError => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::KmsError => std::option::Option::Some("KMS_ERROR"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::KmsError,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"KMS_ERROR" => Self::KmsError,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::KmsError => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.cloud.workflows.v1.Workflow.StateError.Type",
))
}
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Active,
Unavailable,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Active => std::option::Option::Some(1),
Self::Unavailable => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::Unavailable => std::option::Option::Some("UNAVAILABLE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Active,
2 => Self::Unavailable,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"ACTIVE" => Self::Active,
"UNAVAILABLE" => Self::Unavailable,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Active => serializer.serialize_i32(1),
Self::Unavailable => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.workflows.v1.Workflow.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CallLogLevel {
Unspecified,
LogAllCalls,
LogErrorsOnly,
LogNone,
UnknownValue(call_log_level::UnknownValue),
}
#[doc(hidden)]
pub mod call_log_level {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl CallLogLevel {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::LogAllCalls => std::option::Option::Some(1),
Self::LogErrorsOnly => std::option::Option::Some(2),
Self::LogNone => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("CALL_LOG_LEVEL_UNSPECIFIED"),
Self::LogAllCalls => std::option::Option::Some("LOG_ALL_CALLS"),
Self::LogErrorsOnly => std::option::Option::Some("LOG_ERRORS_ONLY"),
Self::LogNone => std::option::Option::Some("LOG_NONE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for CallLogLevel {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for CallLogLevel {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for CallLogLevel {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::LogAllCalls,
2 => Self::LogErrorsOnly,
3 => Self::LogNone,
_ => Self::UnknownValue(call_log_level::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for CallLogLevel {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CALL_LOG_LEVEL_UNSPECIFIED" => Self::Unspecified,
"LOG_ALL_CALLS" => Self::LogAllCalls,
"LOG_ERRORS_ONLY" => Self::LogErrorsOnly,
"LOG_NONE" => Self::LogNone,
_ => Self::UnknownValue(call_log_level::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for CallLogLevel {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::LogAllCalls => serializer.serialize_i32(1),
Self::LogErrorsOnly => serializer.serialize_i32(2),
Self::LogNone => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for CallLogLevel {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<CallLogLevel>::new(
".google.cloud.workflows.v1.Workflow.CallLogLevel",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SourceCode {
SourceContents(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListWorkflowsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListWorkflowsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListWorkflowsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.workflows.v1.ListWorkflowsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListWorkflowsResponse {
pub workflows: std::vec::Vec<crate::model::Workflow>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListWorkflowsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_workflows<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Workflow>,
{
use std::iter::Iterator;
self.workflows = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListWorkflowsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.workflows.v1.ListWorkflowsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListWorkflowsResponse {
type PageItem = crate::model::Workflow;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.workflows
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetWorkflowRequest {
pub name: std::string::String,
pub revision_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetWorkflowRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.revision_id = v.into();
self
}
}
impl wkt::message::Message for GetWorkflowRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.workflows.v1.GetWorkflowRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateWorkflowRequest {
pub parent: std::string::String,
pub workflow: std::option::Option<crate::model::Workflow>,
pub workflow_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateWorkflowRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_workflow<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Workflow>,
{
self.workflow = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_workflow<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Workflow>,
{
self.workflow = v.map(|x| x.into());
self
}
pub fn set_workflow_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.workflow_id = v.into();
self
}
}
impl wkt::message::Message for CreateWorkflowRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.workflows.v1.CreateWorkflowRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteWorkflowRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteWorkflowRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteWorkflowRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.workflows.v1.DeleteWorkflowRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateWorkflowRequest {
pub workflow: std::option::Option<crate::model::Workflow>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateWorkflowRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_workflow<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Workflow>,
{
self.workflow = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_workflow<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Workflow>,
{
self.workflow = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateWorkflowRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.workflows.v1.UpdateWorkflowRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationMetadata {
pub create_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub target: std::string::String,
pub verb: std::string::String,
pub api_version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OperationMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target = v.into();
self
}
pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.verb = v.into();
self
}
pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.api_version = v.into();
self
}
}
impl wkt::message::Message for OperationMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.workflows.v1.OperationMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListWorkflowRevisionsRequest {
pub name: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListWorkflowRevisionsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListWorkflowRevisionsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.workflows.v1.ListWorkflowRevisionsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListWorkflowRevisionsResponse {
pub workflows: std::vec::Vec<crate::model::Workflow>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListWorkflowRevisionsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_workflows<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Workflow>,
{
use std::iter::Iterator;
self.workflows = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListWorkflowRevisionsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.workflows.v1.ListWorkflowRevisionsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListWorkflowRevisionsResponse {
type PageItem = crate::model::Workflow;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.workflows
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ExecutionHistoryLevel {
Unspecified,
ExecutionHistoryBasic,
ExecutionHistoryDetailed,
UnknownValue(execution_history_level::UnknownValue),
}
#[doc(hidden)]
pub mod execution_history_level {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ExecutionHistoryLevel {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ExecutionHistoryBasic => std::option::Option::Some(1),
Self::ExecutionHistoryDetailed => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("EXECUTION_HISTORY_LEVEL_UNSPECIFIED"),
Self::ExecutionHistoryBasic => std::option::Option::Some("EXECUTION_HISTORY_BASIC"),
Self::ExecutionHistoryDetailed => {
std::option::Option::Some("EXECUTION_HISTORY_DETAILED")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ExecutionHistoryLevel {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ExecutionHistoryLevel {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ExecutionHistoryLevel {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ExecutionHistoryBasic,
2 => Self::ExecutionHistoryDetailed,
_ => Self::UnknownValue(execution_history_level::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ExecutionHistoryLevel {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"EXECUTION_HISTORY_LEVEL_UNSPECIFIED" => Self::Unspecified,
"EXECUTION_HISTORY_BASIC" => Self::ExecutionHistoryBasic,
"EXECUTION_HISTORY_DETAILED" => Self::ExecutionHistoryDetailed,
_ => Self::UnknownValue(execution_history_level::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ExecutionHistoryLevel {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::ExecutionHistoryBasic => serializer.serialize_i32(1),
Self::ExecutionHistoryDetailed => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ExecutionHistoryLevel {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExecutionHistoryLevel>::new(
".google.cloud.workflows.v1.ExecutionHistoryLevel",
))
}
}