#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OperationMetadataV1Beta2 {
#[prost(string, tag="1")]
pub target: std::string::String,
#[prost(enumeration="OperationType", tag="2")]
pub r#type: i32,
#[prost(message, optional, tag="3")]
pub request: ::std::option::Option<::prost_types::Any>,
#[prost(int64, tag="4")]
pub version_id: i64,
#[prost(message, optional, tag="5")]
pub update_time: ::std::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OperationType {
OperationUnspecified = 0,
CreateFunction = 1,
UpdateFunction = 2,
DeleteFunction = 3,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CloudFunction {
#[prost(string, tag="1")]
pub name: std::string::String,
#[prost(enumeration="CloudFunctionStatus", tag="7")]
pub status: i32,
#[prost(string, tag="8")]
pub latest_operation: std::string::String,
#[prost(string, tag="9")]
pub entry_point: std::string::String,
#[prost(string, tag="23")]
pub runtime: std::string::String,
#[prost(message, optional, tag="10")]
pub timeout: ::std::option::Option<::prost_types::Duration>,
#[prost(int32, tag="11")]
pub available_memory_mb: i32,
#[prost(string, tag="13")]
pub service_account: std::string::String,
#[prost(message, optional, tag="15")]
pub update_time: ::std::option::Option<::prost_types::Timestamp>,
#[prost(int64, tag="20")]
pub version_id: i64,
#[prost(map="string, string", tag="21")]
pub labels: ::std::collections::HashMap<std::string::String, std::string::String>,
#[prost(map="string, string", tag="22")]
pub environment_variables: ::std::collections::HashMap<std::string::String, std::string::String>,
#[prost(int32, tag="24")]
pub max_instances: i32,
#[prost(string, tag="25")]
pub network: std::string::String,
#[prost(string, tag="26")]
pub vpc_connector: std::string::String,
#[prost(oneof="cloud_function::SourceCode", tags="14, 3, 18, 16")]
pub source_code: ::std::option::Option<cloud_function::SourceCode>,
#[prost(oneof="cloud_function::Trigger", tags="6, 12")]
pub trigger: ::std::option::Option<cloud_function::Trigger>,
}
pub mod cloud_function {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum SourceCode {
#[prost(string, tag="14")]
SourceArchiveUrl(std::string::String),
#[prost(message, tag="3")]
SourceRepository(super::SourceRepository),
#[prost(string, tag="18")]
SourceRepositoryUrl(std::string::String),
#[prost(string, tag="16")]
SourceUploadUrl(std::string::String),
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Trigger {
#[prost(message, tag="6")]
HttpsTrigger(super::HttpsTrigger),
#[prost(message, tag="12")]
EventTrigger(super::EventTrigger),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HttpsTrigger {
#[prost(string, tag="1")]
pub url: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventTrigger {
#[prost(string, tag="1")]
pub event_type: std::string::String,
#[prost(string, tag="2")]
pub resource: std::string::String,
#[prost(string, tag="6")]
pub service: std::string::String,
#[prost(message, optional, tag="5")]
pub failure_policy: ::std::option::Option<FailurePolicy>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SourceRepository {
#[prost(string, tag="1")]
pub repository_url: std::string::String,
#[prost(string, tag="2")]
pub source_path: std::string::String,
#[prost(string, tag="6")]
pub deployed_revision: std::string::String,
#[prost(oneof="source_repository::Version", tags="3, 4, 5")]
pub version: ::std::option::Option<source_repository::Version>,
}
pub mod source_repository {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Version {
#[prost(string, tag="3")]
Branch(std::string::String),
#[prost(string, tag="4")]
Tag(std::string::String),
#[prost(string, tag="5")]
Revision(std::string::String),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FailurePolicy {
#[prost(oneof="failure_policy::Action", tags="1")]
pub action: ::std::option::Option<failure_policy::Action>,
}
pub mod failure_policy {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Retry {
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Action {
#[prost(message, tag="1")]
Retry(Retry),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateFunctionRequest {
#[prost(string, tag="1")]
pub location: std::string::String,
#[prost(message, optional, tag="2")]
pub function: ::std::option::Option<CloudFunction>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateFunctionRequest {
#[prost(string, tag="1")]
pub name: std::string::String,
#[prost(message, optional, tag="2")]
pub function: ::std::option::Option<CloudFunction>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetFunctionRequest {
#[prost(string, tag="1")]
pub name: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFunctionsRequest {
#[prost(string, tag="1")]
pub location: std::string::String,
#[prost(int32, tag="2")]
pub page_size: i32,
#[prost(string, tag="3")]
pub page_token: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFunctionsResponse {
#[prost(message, repeated, tag="1")]
pub functions: ::std::vec::Vec<CloudFunction>,
#[prost(string, tag="2")]
pub next_page_token: std::string::String,
#[prost(string, repeated, tag="3")]
pub unreachable: ::std::vec::Vec<std::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteFunctionRequest {
#[prost(string, tag="1")]
pub name: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CallFunctionRequest {
#[prost(string, tag="1")]
pub name: std::string::String,
#[prost(string, tag="2")]
pub data: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CallFunctionResponse {
#[prost(string, tag="1")]
pub execution_id: std::string::String,
#[prost(string, tag="2")]
pub result: std::string::String,
#[prost(string, tag="3")]
pub error: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenerateUploadUrlRequest {
#[prost(string, tag="1")]
pub parent: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenerateUploadUrlResponse {
#[prost(string, tag="1")]
pub upload_url: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenerateDownloadUrlRequest {
#[prost(string, tag="1")]
pub name: std::string::String,
#[prost(uint64, tag="2")]
pub version_id: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenerateDownloadUrlResponse {
#[prost(string, tag="1")]
pub download_url: std::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum CloudFunctionStatus {
StatusUnspecified = 0,
Ready = 1,
Failed = 2,
Deploying = 3,
Deleting = 4,
}
# [ doc = r" Generated client implementations." ] pub mod cloud_functions_service_client { # ! [ allow ( unused_variables , dead_code , missing_docs ) ] use tonic :: codegen :: * ; # [ doc = " A service that application uses to manipulate triggers and functions." ] pub struct CloudFunctionsServiceClient < T > { inner : tonic :: client :: Grpc < T > , } impl < T > CloudFunctionsServiceClient < T > where T : tonic :: client :: GrpcService < tonic :: body :: BoxBody > , T :: ResponseBody : Body + HttpBody + Send + 'static , T :: Error : Into < StdError > , < T :: ResponseBody as HttpBody > :: Error : Into < StdError > + Send , { pub fn new ( inner : T ) -> Self { let inner = tonic :: client :: Grpc :: new ( inner ) ; Self { inner } } pub fn with_interceptor ( inner : T , interceptor : impl Into < tonic :: Interceptor > ) -> Self { let inner = tonic :: client :: Grpc :: with_interceptor ( inner , interceptor ) ; Self { inner } } # [ doc = " Returns a list of functions that belong to the requested project." ] pub async fn list_functions ( & mut self , request : impl tonic :: IntoRequest < super :: ListFunctionsRequest > , ) -> Result < tonic :: Response < super :: ListFunctionsResponse > , 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.functions.v1beta2.CloudFunctionsService/ListFunctions" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Returns a function with the given name from the requested project." ] pub async fn get_function ( & mut self , request : impl tonic :: IntoRequest < super :: GetFunctionRequest > , ) -> Result < tonic :: Response < super :: CloudFunction > , 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.functions.v1beta2.CloudFunctionsService/GetFunction" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Creates a new function. If a function with the given name already exists in" ] # [ doc = " the specified project, the long running operation will return" ] # [ doc = " `ALREADY_EXISTS` error." ] pub async fn create_function ( & mut self , request : impl tonic :: IntoRequest < super :: CreateFunctionRequest > , ) -> 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.functions.v1beta2.CloudFunctionsService/CreateFunction" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Updates existing function." ] pub async fn update_function ( & mut self , request : impl tonic :: IntoRequest < super :: UpdateFunctionRequest > , ) -> 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.functions.v1beta2.CloudFunctionsService/UpdateFunction" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Deletes a function with the given name from the specified project. If the" ] # [ doc = " given function is used by some trigger, the trigger will be updated to" ] # [ doc = " remove this function." ] pub async fn delete_function ( & mut self , request : impl tonic :: IntoRequest < super :: DeleteFunctionRequest > , ) -> 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.functions.v1beta2.CloudFunctionsService/DeleteFunction" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Synchronously invokes a deployed Cloud Function. To be used for testing" ] # [ doc = " purposes as very limited traffic is allowed. For more information on" ] # [ doc = " the actual limits refer to [API Calls](" ] # [ doc = " https://cloud.google.com/functions/quotas#rate_limits)." ] pub async fn call_function ( & mut self , request : impl tonic :: IntoRequest < super :: CallFunctionRequest > , ) -> Result < tonic :: Response < super :: CallFunctionResponse > , 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.functions.v1beta2.CloudFunctionsService/CallFunction" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Returns a signed URL for uploading a function source code." ] # [ doc = " For more information about the signed URL usage see:" ] # [ doc = " https://cloud.google.com/storage/docs/access-control/signed-urls" ] # [ doc = " Once the function source code upload is complete, the used signed" ] # [ doc = " URL should be provided in CreateFunction or UpdateFunction request" ] # [ doc = " as a reference to the function source code." ] # [ doc = "" ] # [ doc = " When uploading source code to the generated signed URL, please follow" ] # [ doc = " these restrictions:" ] # [ doc = "" ] # [ doc = " * Source file type should be a zip file." ] # [ doc = " * Source file size should not exceed 100MB limit." ] # [ doc = " * No credentials should be attached - the signed URLs provide access to the" ] # [ doc = " target bucket using internal service identity; if credentials were" ] # [ doc = " attached, the identity from the credentials would be used, but that" ] # [ doc = " identity does not have permissions to upload files to the URL." ] # [ doc = "" ] # [ doc = " When making a HTTP PUT request, these two headers need to be specified:" ] # [ doc = "" ] # [ doc = " * `content-type: application/zip`" ] # [ doc = " * `x-goog-content-length-range: 0,104857600`" ] # [ doc = "" ] # [ doc = " And this header SHOULD NOT be specified:" ] # [ doc = "" ] # [ doc = " * `Authorization: Bearer YOUR_TOKEN`" ] pub async fn generate_upload_url ( & mut self , request : impl tonic :: IntoRequest < super :: GenerateUploadUrlRequest > , ) -> Result < tonic :: Response < super :: GenerateUploadUrlResponse > , 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.functions.v1beta2.CloudFunctionsService/GenerateUploadUrl" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } # [ doc = " Returns a signed URL for downloading deployed function source code." ] # [ doc = " The URL is only valid for a limited period and should be used within" ] # [ doc = " minutes after generation." ] # [ doc = " For more information about the signed URL usage see:" ] # [ doc = " https://cloud.google.com/storage/docs/access-control/signed-urls" ] pub async fn generate_download_url ( & mut self , request : impl tonic :: IntoRequest < super :: GenerateDownloadUrlRequest > , ) -> Result < tonic :: Response < super :: GenerateDownloadUrlResponse > , 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.functions.v1beta2.CloudFunctionsService/GenerateDownloadUrl" ) ; self . inner . unary ( request . into_request ( ) , path , codec ) . await } } impl < T : Clone > Clone for CloudFunctionsServiceClient < T > { fn clone ( & self ) -> Self { Self { inner : self . inner . clone ( ) , } } } impl < T > std :: fmt :: Debug for CloudFunctionsServiceClient < T > { fn fmt ( & self , f : & mut std :: fmt :: Formatter < '_ > ) -> std :: fmt :: Result { write ! ( f , "CloudFunctionsServiceClient {{ ... }}" ) } } }use serde :: { Serialize , Deserialize } ;