#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Workflow {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
#[prost(enumeration = "workflow::State", tag = "3")]
pub state: i32,
#[prost(string, tag = "4")]
pub revision_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "6")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "7")]
pub revision_create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(map = "string, string", tag = "8")]
pub labels:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
#[prost(string, tag = "9")]
pub service_account: ::prost::alloc::string::String,
#[prost(oneof = "workflow::SourceCode", tags = "10")]
pub source_code: ::core::option::Option<workflow::SourceCode>,
}
pub mod workflow {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum State {
Unspecified = 0,
Active = 1,
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum SourceCode {
#[prost(string, tag = "10")]
SourceContents(::prost::alloc::string::String),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListWorkflowsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub page_size: i32,
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub filter: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub order_by: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListWorkflowsResponse {
#[prost(message, repeated, tag = "1")]
pub workflows: ::prost::alloc::vec::Vec<Workflow>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "3")]
pub unreachable: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetWorkflowRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateWorkflowRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub workflow: ::core::option::Option<Workflow>,
#[prost(string, tag = "3")]
pub workflow_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteWorkflowRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateWorkflowRequest {
#[prost(message, optional, tag = "1")]
pub workflow: ::core::option::Option<Workflow>,
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OperationMetadata {
#[prost(message, optional, tag = "1")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "2")]
pub end_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "3")]
pub target: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub verb: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub api_version: ::prost::alloc::string::String,
}
#[doc = r" Generated client implementations."]
pub mod workflows_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " Workflows is used to deploy and execute workflow programs."]
#[doc = " Workflows makes sure the program executes reliably, despite hardware and"]
#[doc = " networking interruptions."]
#[derive(Debug, Clone)]
pub struct WorkflowsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> WorkflowsClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::ResponseBody: Body + Send + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> WorkflowsClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
Into<StdError> + Send + Sync,
{
WorkflowsClient::new(InterceptedService::new(inner, interceptor))
}
#[doc = r" Compress requests with `gzip`."]
#[doc = r""]
#[doc = r" This requires the server to support it otherwise it might respond with an"]
#[doc = r" error."]
pub fn send_gzip(mut self) -> Self {
self.inner = self.inner.send_gzip();
self
}
#[doc = r" Enable decompressing responses with `gzip`."]
pub fn accept_gzip(mut self) -> Self {
self.inner = self.inner.accept_gzip();
self
}
#[doc = " Lists Workflows in a given project and location."]
#[doc = " The default order is not specified."]
pub async fn list_workflows(
&mut self,
request: impl tonic::IntoRequest<super::ListWorkflowsRequest>,
) -> Result<tonic::Response<super::ListWorkflowsResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.workflows.v1beta.Workflows/ListWorkflows",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets details of a single Workflow."]
pub async fn get_workflow(
&mut self,
request: impl tonic::IntoRequest<super::GetWorkflowRequest>,
) -> Result<tonic::Response<super::Workflow>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.workflows.v1beta.Workflows/GetWorkflow",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Creates a new workflow. If a workflow with the specified name already"]
#[doc = " exists in the specified project and location, the long running operation"]
#[doc = " will return [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error."]
pub async fn create_workflow(
&mut self,
request: impl tonic::IntoRequest<super::CreateWorkflowRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.workflows.v1beta.Workflows/CreateWorkflow",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Deletes a workflow with the specified name."]
#[doc = " This method also cancels and deletes all running executions of the"]
#[doc = " workflow."]
pub async fn delete_workflow(
&mut self,
request: impl tonic::IntoRequest<super::DeleteWorkflowRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.workflows.v1beta.Workflows/DeleteWorkflow",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Updates an existing workflow."]
#[doc = " Running this method has no impact on already running executions of the"]
#[doc = " workflow. A new revision of the workflow may be created as a result of a"]
#[doc = " successful update operation. In that case, such revision will be used"]
#[doc = " in new workflow executions."]
pub async fn update_workflow(
&mut self,
request: impl tonic::IntoRequest<super::UpdateWorkflowRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.workflows.v1beta.Workflows/UpdateWorkflow",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}