Workflow

Struct Workflow 

Source
#[non_exhaustive]
pub struct Workflow {
Show 19 fields pub name: String, pub description: String, pub state: State, pub revision_id: String, pub create_time: Option<Timestamp>, pub update_time: Option<Timestamp>, pub revision_create_time: Option<Timestamp>, pub labels: HashMap<String, String>, pub service_account: String, pub crypto_key_name: String, pub state_error: Option<StateError>, pub call_log_level: CallLogLevel, pub user_env_vars: HashMap<String, String>, pub execution_history_level: ExecutionHistoryLevel, pub all_kms_keys: Vec<String>, pub all_kms_keys_versions: Vec<String>, pub crypto_key_version: String, pub tags: HashMap<String, String>, pub source_code: Option<SourceCode>, /* private fields */
}
Expand description

Workflow program to be executed by Workflows.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: String

The resource name of the workflow. Format: projects/{project}/locations/{location}/workflows/{workflow}. This is a workflow-wide field and is not tied to a specific revision.

§description: String

Description of the workflow provided by the user. Must be at most 1000 Unicode characters long. This is a workflow-wide field and is not tied to a specific revision.

§state: State

Output only. State of the workflow deployment.

§revision_id: String

Output only. The revision of the workflow. A new revision of a workflow is created as a result of updating the following properties of a workflow:

The format is “000001-a4d”, where the first six characters define the zero-padded revision ordinal number. They are followed by a hyphen and three hexadecimal random characters.

§create_time: Option<Timestamp>

Output only. The timestamp for when the workflow was created. This is a workflow-wide field and is not tied to a specific revision.

§update_time: Option<Timestamp>

Output only. The timestamp for when the workflow was last updated. This is a workflow-wide field and is not tied to a specific revision.

§revision_create_time: Option<Timestamp>

Output only. The timestamp for the latest revision of the workflow’s creation.

§labels: HashMap<String, String>

Labels associated with this workflow. Labels can contain at most 64 entries. Keys and values can be no longer than 63 characters and can only contain lowercase letters, numeric characters, underscores, and dashes. Label keys must start with a letter. International characters are allowed. This is a workflow-wide field and is not tied to a specific revision.

§service_account: String

The service account associated with the latest workflow version. This service account represents the identity of the workflow and determines what permissions the workflow has. Format: projects/{project}/serviceAccounts/{account} or {account}

Using - as a wildcard for the {project} or not providing one at all will infer the project from the account. The {account} value can be the email address or the unique_id of the service account.

If not provided, workflow will use the project’s default service account. Modifying this field for an existing workflow results in a new workflow revision.

§crypto_key_name: String

Optional. The resource name of a KMS crypto key used to encrypt or decrypt the data associated with the workflow.

Format: projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}

Using - as a wildcard for the {project} or not providing one at all will infer the project from the account.

If not provided, data associated with the workflow will not be CMEK-encrypted.

§state_error: Option<StateError>

Output only. Error regarding the state of the workflow. For example, this field will have error details if the execution data is unavailable due to revoked KMS key permissions.

§call_log_level: CallLogLevel

Optional. Describes the level of platform logging to apply to calls and call responses during executions of this workflow. If both the workflow and the execution specify a logging level, the execution level takes precedence.

§user_env_vars: HashMap<String, String>

Optional. User-defined environment variables associated with this workflow revision. This map has a maximum length of 20. Each string can take up to 4KiB. Keys cannot be empty strings and cannot start with “GOOGLE” or “WORKFLOWS”.

§execution_history_level: ExecutionHistoryLevel

Optional. Describes the execution history level to apply to this workflow.

§all_kms_keys: Vec<String>

Output only. A list of all KMS crypto keys used to encrypt or decrypt the data associated with the workflow.

§all_kms_keys_versions: Vec<String>

Output only. A list of all KMS crypto key versions used to encrypt or decrypt the data associated with the workflow.

§crypto_key_version: String

Output only. The resource name of a KMS crypto key version used to encrypt or decrypt the data associated with the workflow.

Format: projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}/cryptoKeyVersions/{cryptoKeyVersion}

§tags: HashMap<String, String>

Optional. Input only. Immutable. Tags associated with this workflow.

§source_code: Option<SourceCode>

Required. Location of the workflow source code. Modifying this field for an existing workflow results in a new workflow revision.

Implementations§

Source§

impl Workflow

Source

pub fn new() -> Self

Source

pub fn set_name<T: Into<String>>(self, v: T) -> Self

Sets the value of name.

§Example
let x = Workflow::new().set_name("example");
Source

pub fn set_description<T: Into<String>>(self, v: T) -> Self

Sets the value of description.

§Example
let x = Workflow::new().set_description("example");
Source

pub fn set_state<T: Into<State>>(self, v: T) -> Self

Sets the value of state.

§Example
use google_cloud_workflows_v1::model::workflow::State;
let x0 = Workflow::new().set_state(State::Active);
let x1 = Workflow::new().set_state(State::Unavailable);
Source

pub fn set_revision_id<T: Into<String>>(self, v: T) -> Self

Sets the value of revision_id.

§Example
let x = Workflow::new().set_revision_id("example");
Source

pub fn set_create_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of create_time.

§Example
use wkt::Timestamp;
let x = Workflow::new().set_create_time(Timestamp::default()/* use setters */);
Source

pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
where T: Into<Timestamp>,

Sets or clears the value of create_time.

§Example
use wkt::Timestamp;
let x = Workflow::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = Workflow::new().set_or_clear_create_time(None::<Timestamp>);
Source

pub fn set_update_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of update_time.

§Example
use wkt::Timestamp;
let x = Workflow::new().set_update_time(Timestamp::default()/* use setters */);
Source

pub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
where T: Into<Timestamp>,

Sets or clears the value of update_time.

§Example
use wkt::Timestamp;
let x = Workflow::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
let x = Workflow::new().set_or_clear_update_time(None::<Timestamp>);
Source

pub fn set_revision_create_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of revision_create_time.

§Example
use wkt::Timestamp;
let x = Workflow::new().set_revision_create_time(Timestamp::default()/* use setters */);
Source

pub fn set_or_clear_revision_create_time<T>(self, v: Option<T>) -> Self
where T: Into<Timestamp>,

Sets or clears the value of revision_create_time.

§Example
use wkt::Timestamp;
let x = Workflow::new().set_or_clear_revision_create_time(Some(Timestamp::default()/* use setters */));
let x = Workflow::new().set_or_clear_revision_create_time(None::<Timestamp>);
Source

pub fn set_labels<T, K, V>(self, v: T) -> Self
where T: IntoIterator<Item = (K, V)>, K: Into<String>, V: Into<String>,

Sets the value of labels.

§Example
let x = Workflow::new().set_labels([
    ("key0", "abc"),
    ("key1", "xyz"),
]);
Source

pub fn set_service_account<T: Into<String>>(self, v: T) -> Self

Sets the value of service_account.

§Example
let x = Workflow::new().set_service_account("example");
Source

pub fn set_crypto_key_name<T: Into<String>>(self, v: T) -> Self

Sets the value of crypto_key_name.

§Example
let x = Workflow::new().set_crypto_key_name("example");
Source

pub fn set_state_error<T>(self, v: T) -> Self
where T: Into<StateError>,

Sets the value of state_error.

§Example
use google_cloud_workflows_v1::model::workflow::StateError;
let x = Workflow::new().set_state_error(StateError::default()/* use setters */);
Source

pub fn set_or_clear_state_error<T>(self, v: Option<T>) -> Self
where T: Into<StateError>,

Sets or clears the value of state_error.

§Example
use google_cloud_workflows_v1::model::workflow::StateError;
let x = Workflow::new().set_or_clear_state_error(Some(StateError::default()/* use setters */));
let x = Workflow::new().set_or_clear_state_error(None::<StateError>);
Source

pub fn set_call_log_level<T: Into<CallLogLevel>>(self, v: T) -> Self

Sets the value of call_log_level.

§Example
use google_cloud_workflows_v1::model::workflow::CallLogLevel;
let x0 = Workflow::new().set_call_log_level(CallLogLevel::LogAllCalls);
let x1 = Workflow::new().set_call_log_level(CallLogLevel::LogErrorsOnly);
let x2 = Workflow::new().set_call_log_level(CallLogLevel::LogNone);
Source

pub fn set_user_env_vars<T, K, V>(self, v: T) -> Self
where T: IntoIterator<Item = (K, V)>, K: Into<String>, V: Into<String>,

Sets the value of user_env_vars.

§Example
let x = Workflow::new().set_user_env_vars([
    ("key0", "abc"),
    ("key1", "xyz"),
]);
Source

pub fn set_execution_history_level<T: Into<ExecutionHistoryLevel>>( self, v: T, ) -> Self

Sets the value of execution_history_level.

§Example
use google_cloud_workflows_v1::model::ExecutionHistoryLevel;
let x0 = Workflow::new().set_execution_history_level(ExecutionHistoryLevel::ExecutionHistoryBasic);
let x1 = Workflow::new().set_execution_history_level(ExecutionHistoryLevel::ExecutionHistoryDetailed);
Source

pub fn set_all_kms_keys<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<String>,

Sets the value of all_kms_keys.

§Example
let x = Workflow::new().set_all_kms_keys(["a", "b", "c"]);
Source

pub fn set_all_kms_keys_versions<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<String>,

Sets the value of all_kms_keys_versions.

§Example
let x = Workflow::new().set_all_kms_keys_versions(["a", "b", "c"]);
Source

pub fn set_crypto_key_version<T: Into<String>>(self, v: T) -> Self

Sets the value of crypto_key_version.

§Example
let x = Workflow::new().set_crypto_key_version("example");
Source

pub fn set_tags<T, K, V>(self, v: T) -> Self
where T: IntoIterator<Item = (K, V)>, K: Into<String>, V: Into<String>,

Sets the value of tags.

§Example
let x = Workflow::new().set_tags([
    ("key0", "abc"),
    ("key1", "xyz"),
]);
Source

pub fn set_source_code<T: Into<Option<SourceCode>>>(self, v: T) -> Self

Sets the value of source_code.

Note that all the setters affecting source_code are mutually exclusive.

§Example
use google_cloud_workflows_v1::model::workflow::SourceCode;
let x = Workflow::new().set_source_code(Some(SourceCode::SourceContents("example".to_string())));
Source

pub fn source_contents(&self) -> Option<&String>

The value of source_code if it holds a SourceContents, None if the field is not set or holds a different branch.

Source

pub fn set_source_contents<T: Into<String>>(self, v: T) -> Self

Sets the value of source_code to hold a SourceContents.

Note that all the setters affecting source_code are mutually exclusive.

§Example
let x = Workflow::new().set_source_contents("example");
assert!(x.source_contents().is_some());

Trait Implementations§

Source§

impl Clone for Workflow

Source§

fn clone(&self) -> Workflow

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Workflow

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Workflow

Source§

fn default() -> Workflow

Returns the “default value” for a type. Read more
Source§

impl Message for Workflow

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for Workflow

Source§

fn eq(&self, other: &Workflow) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Workflow

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,