#[non_exhaustive]pub struct Function {Show 14 fields
pub name: String,
pub description: String,
pub build_config: Option<BuildConfig>,
pub service_config: Option<ServiceConfig>,
pub event_trigger: Option<EventTrigger>,
pub state: State,
pub update_time: Option<Timestamp>,
pub labels: HashMap<String, String>,
pub state_messages: Vec<StateMessage>,
pub environment: Environment,
pub url: String,
pub kms_key_name: String,
pub satisfies_pzs: bool,
pub create_time: Option<Timestamp>,
/* private fields */
}Expand description
Describes a Cloud Function that contains user computation executed in response to an event. It encapsulates function and trigger configurations.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringA user-defined name of the function. Function names must be unique
globally and match pattern projects/*/locations/*/functions/*
description: StringUser-provided description of a function.
build_config: Option<BuildConfig>Describes the Build step of the function that builds a container from the given source.
service_config: Option<ServiceConfig>Describes the Service being deployed. Currently deploys services to Cloud Run (fully managed).
event_trigger: Option<EventTrigger>An Eventarc trigger managed by Google Cloud Functions that fires events in response to a condition in another service.
state: StateOutput only. State of the function.
update_time: Option<Timestamp>Output only. The last update timestamp of a Cloud Function.
labels: HashMap<String, String>Labels associated with this Cloud Function.
state_messages: Vec<StateMessage>Output only. State Messages for this Cloud Function.
environment: EnvironmentDescribe whether the function is 1st Gen or 2nd Gen.
url: StringOutput only. The deployed url for the function.
kms_key_name: StringResource name of a KMS crypto key (managed by the user) used to encrypt/decrypt function resources.
It must match the pattern
projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}.
satisfies_pzs: boolOutput only. Reserved for future use.
create_time: Option<Timestamp>Output only. The create timestamp of a Cloud Function. This is only applicable to 2nd Gen functions.
Implementations§
Source§impl Function
impl Function
Sourcepub fn set_description<T: Into<String>>(self, v: T) -> Self
pub fn set_description<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_build_config<T>(self, v: T) -> Selfwhere
T: Into<BuildConfig>,
pub fn set_build_config<T>(self, v: T) -> Selfwhere
T: Into<BuildConfig>,
Sets the value of build_config.
§Example
use google_cloud_functions_v2::model::BuildConfig;
let x = Function::new().set_build_config(BuildConfig::default()/* use setters */);Sourcepub fn set_or_clear_build_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<BuildConfig>,
pub fn set_or_clear_build_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<BuildConfig>,
Sets or clears the value of build_config.
§Example
use google_cloud_functions_v2::model::BuildConfig;
let x = Function::new().set_or_clear_build_config(Some(BuildConfig::default()/* use setters */));
let x = Function::new().set_or_clear_build_config(None::<BuildConfig>);Sourcepub fn set_service_config<T>(self, v: T) -> Selfwhere
T: Into<ServiceConfig>,
pub fn set_service_config<T>(self, v: T) -> Selfwhere
T: Into<ServiceConfig>,
Sets the value of service_config.
§Example
use google_cloud_functions_v2::model::ServiceConfig;
let x = Function::new().set_service_config(ServiceConfig::default()/* use setters */);Sourcepub fn set_or_clear_service_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<ServiceConfig>,
pub fn set_or_clear_service_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<ServiceConfig>,
Sets or clears the value of service_config.
§Example
use google_cloud_functions_v2::model::ServiceConfig;
let x = Function::new().set_or_clear_service_config(Some(ServiceConfig::default()/* use setters */));
let x = Function::new().set_or_clear_service_config(None::<ServiceConfig>);Sourcepub fn set_event_trigger<T>(self, v: T) -> Selfwhere
T: Into<EventTrigger>,
pub fn set_event_trigger<T>(self, v: T) -> Selfwhere
T: Into<EventTrigger>,
Sets the value of event_trigger.
§Example
use google_cloud_functions_v2::model::EventTrigger;
let x = Function::new().set_event_trigger(EventTrigger::default()/* use setters */);Sourcepub fn set_or_clear_event_trigger<T>(self, v: Option<T>) -> Selfwhere
T: Into<EventTrigger>,
pub fn set_or_clear_event_trigger<T>(self, v: Option<T>) -> Selfwhere
T: Into<EventTrigger>,
Sets or clears the value of event_trigger.
§Example
use google_cloud_functions_v2::model::EventTrigger;
let x = Function::new().set_or_clear_event_trigger(Some(EventTrigger::default()/* use setters */));
let x = Function::new().set_or_clear_event_trigger(None::<EventTrigger>);Sourcepub fn set_update_time<T>(self, v: T) -> Self
pub fn set_update_time<T>(self, v: T) -> Self
Sets the value of update_time.
§Example
use wkt::Timestamp;
let x = Function::new().set_update_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of update_time.
§Example
use wkt::Timestamp;
let x = Function::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
let x = Function::new().set_or_clear_update_time(None::<Timestamp>);Sourcepub fn set_labels<T, K, V>(self, v: T) -> Self
pub fn set_labels<T, K, V>(self, v: T) -> Self
Sourcepub fn set_state_messages<T, V>(self, v: T) -> Self
pub fn set_state_messages<T, V>(self, v: T) -> Self
Sets the value of state_messages.
§Example
use google_cloud_functions_v2::model::StateMessage;
let x = Function::new()
.set_state_messages([
StateMessage::default()/* use setters */,
StateMessage::default()/* use (different) setters */,
]);Sourcepub fn set_environment<T: Into<Environment>>(self, v: T) -> Self
pub fn set_environment<T: Into<Environment>>(self, v: T) -> Self
Sets the value of environment.
§Example
use google_cloud_functions_v2::model::Environment;
let x0 = Function::new().set_environment(Environment::Gen1);
let x1 = Function::new().set_environment(Environment::Gen2);Sourcepub fn set_kms_key_name<T: Into<String>>(self, v: T) -> Self
pub fn set_kms_key_name<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_satisfies_pzs<T: Into<bool>>(self, v: T) -> Self
pub fn set_satisfies_pzs<T: Into<bool>>(self, v: T) -> Self
Sourcepub fn set_create_time<T>(self, v: T) -> Self
pub fn set_create_time<T>(self, v: T) -> Self
Sets the value of create_time.
§Example
use wkt::Timestamp;
let x = Function::new().set_create_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of create_time.
§Example
use wkt::Timestamp;
let x = Function::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = Function::new().set_or_clear_create_time(None::<Timestamp>);Trait Implementations§
impl StructuralPartialEq for Function
Auto Trait Implementations§
impl Freeze for Function
impl RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl UnsafeUnpin for Function
impl UnwindSafe for Function
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request