google_cloudevents/google/events/cloud/workflows/v1/mod.rs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
// This file is @generated by prost-build.
/// Workflow program to be executed by Workflows.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Workflow {
/// The resource name of the workflow.
/// Format: projects/{project}/locations/{location}/workflows/{workflow}
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Description of the workflow provided by the user.
/// Must be at most 1000 unicode characters long.
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
/// Output only. State of the workflow deployment.
#[prost(enumeration = "workflow::State", tag = "3")]
pub state: i32,
/// 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:
///
/// - [Service account][google.cloud.workflows.v1.Workflow.service_account]
/// - [Workflow code to be
/// executed][google.cloud.workflows.v1.Workflow.source_contents]
///
/// The format is "000001-a4d", where the first 6 characters define
/// the zero-padded revision ordinal number. They are followed by a hyphen and
/// 3 hexadecimal random characters.
#[prost(string, tag = "4")]
pub revision_id: ::prost::alloc::string::String,
/// Output only. The timestamp of when the workflow was created.
#[prost(message, optional, tag = "5")]
pub create_time: ::core::option::Option<::pbjson_types::Timestamp>,
/// Output only. The last update timestamp of the workflow.
#[prost(message, optional, tag = "6")]
pub update_time: ::core::option::Option<::pbjson_types::Timestamp>,
/// Output only. The timestamp that the latest revision of the workflow
/// was created.
#[prost(message, optional, tag = "7")]
pub revision_create_time: ::core::option::Option<::pbjson_types::Timestamp>,
/// 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.
#[prost(map = "string, string", tag = "8")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::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.
#[prost(string, tag = "9")]
pub service_account: ::prost::alloc::string::String,
/// Required. Location of the workflow source code.
/// Modifying this field for an existing workflow results in a new workflow
/// revision.
#[prost(oneof = "workflow::SourceCode", tags = "10")]
pub source_code: ::core::option::Option<workflow::SourceCode>,
}
/// Nested message and enum types in `Workflow`.
pub mod workflow {
/// Describes the current state of workflow deployment. More states may be
/// added in the future.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum State {
/// Invalid state.
Unspecified = 0,
/// The workflow has been deployed successfully and is serving.
Active = 1,
}
impl State {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "STATE_UNSPECIFIED",
Self::Active => "ACTIVE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STATE_UNSPECIFIED" => Some(Self::Unspecified),
"ACTIVE" => Some(Self::Active),
_ => None,
}
}
}
/// Required. Location of the workflow source code.
/// Modifying this field for an existing workflow results in a new workflow
/// revision.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum SourceCode {
/// Workflow code to be executed. The size limit is 128KB.
#[prost(string, tag = "10")]
SourceContents(::prost::alloc::string::String),
}
}
/// The data within all Workflow events.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkflowEventData {
/// Optional. The Workflow event payload. Unset for deletion events.
#[prost(message, optional, tag = "1")]
pub payload: ::core::option::Option<Workflow>,
}
/// The CloudEvent raised when a Workflow is created.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkflowCreatedEvent {
/// The data associated with the event.
#[prost(message, optional, tag = "1")]
pub data: ::core::option::Option<WorkflowEventData>,
}
/// The CloudEvent raised when a Workflow is deleted.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkflowDeletedEvent {
/// The data associated with the event.
#[prost(message, optional, tag = "1")]
pub data: ::core::option::Option<WorkflowEventData>,
}
/// The CloudEvent raised when a Workflow is updated.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkflowUpdatedEvent {
/// The data associated with the event.
#[prost(message, optional, tag = "1")]
pub data: ::core::option::Option<WorkflowEventData>,
}