#[non_exhaustive]pub struct PushConfig {
pub push_endpoint: String,
pub attributes: HashMap<String, String>,
pub authentication_method: Option<AuthenticationMethod>,
pub wrapper: Option<Wrapper>,
/* private fields */
}Expand description
Configuration for a push delivery endpoint.
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.push_endpoint: StringOptional. A URL locating the endpoint to which messages should be pushed.
For example, a Webhook endpoint might use <https://example.com/push>.
attributes: HashMap<String, String>Optional. Endpoint configuration attributes that can be used to control different aspects of the message delivery.
The only currently supported attribute is x-goog-version, which you can
use to change the format of the pushed message. This attribute
indicates the version of the data expected by the endpoint. This
controls the shape of the pushed message (i.e., its fields and metadata).
If not present during the CreateSubscription call, it will default to
the version of the Pub/Sub API used to make such call. If not present in a
ModifyPushConfig call, its value will not be changed. GetSubscription
calls will always return a valid version, even if the subscription was
created without this attribute.
The only supported values for the x-goog-version attribute are:
v1beta1: uses the push format defined in the v1beta1 Pub/Sub API.v1orv1beta2: uses the push format defined in the v1 Pub/Sub API.
For example:
attributes { "x-goog-version": "v1" }
authentication_method: Option<AuthenticationMethod>An authentication method used by push endpoints to verify the source of push requests. This can be used with push endpoints that are private by default to allow requests only from the Pub/Sub system, for example. This field is optional and should be set only by users interested in authenticated push.
wrapper: Option<Wrapper>The format of the delivered message to the push endpoint is defined by
the chosen wrapper. When unset, PubsubWrapper is used.
Implementations§
Source§impl PushConfig
impl PushConfig
pub fn new() -> Self
Sourcepub fn set_push_endpoint<T: Into<String>>(self, v: T) -> Self
pub fn set_push_endpoint<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_attributes<T, K, V>(self, v: T) -> Self
pub fn set_attributes<T, K, V>(self, v: T) -> Self
Sets the value of attributes.
§Example
let x = PushConfig::new().set_attributes([
("key0", "abc"),
("key1", "xyz"),
]);Sourcepub fn set_authentication_method<T: Into<Option<AuthenticationMethod>>>(
self,
v: T,
) -> Self
pub fn set_authentication_method<T: Into<Option<AuthenticationMethod>>>( self, v: T, ) -> Self
Sets the value of authentication_method.
Note that all the setters affecting authentication_method are mutually
exclusive.
§Example
use google_cloud_pubsub::model::push_config::OidcToken;
let x = PushConfig::new().set_authentication_method(Some(
google_cloud_pubsub::model::push_config::AuthenticationMethod::OidcToken(OidcToken::default().into())));Sourcepub fn oidc_token(&self) -> Option<&Box<OidcToken>>
pub fn oidc_token(&self) -> Option<&Box<OidcToken>>
The value of authentication_method
if it holds a OidcToken, None if the field is not set or
holds a different branch.
Sourcepub fn set_oidc_token<T: Into<Box<OidcToken>>>(self, v: T) -> Self
pub fn set_oidc_token<T: Into<Box<OidcToken>>>(self, v: T) -> Self
Sets the value of authentication_method
to hold a OidcToken.
Note that all the setters affecting authentication_method are
mutually exclusive.
§Example
use google_cloud_pubsub::model::push_config::OidcToken;
let x = PushConfig::new().set_oidc_token(OidcToken::default()/* use setters */);
assert!(x.oidc_token().is_some());Sourcepub fn set_wrapper<T: Into<Option<Wrapper>>>(self, v: T) -> Self
pub fn set_wrapper<T: Into<Option<Wrapper>>>(self, v: T) -> Self
Sets the value of wrapper.
Note that all the setters affecting wrapper are mutually
exclusive.
§Example
use google_cloud_pubsub::model::push_config::PubsubWrapper;
let x = PushConfig::new().set_wrapper(Some(
google_cloud_pubsub::model::push_config::Wrapper::PubsubWrapper(PubsubWrapper::default().into())));Sourcepub fn pubsub_wrapper(&self) -> Option<&Box<PubsubWrapper>>
pub fn pubsub_wrapper(&self) -> Option<&Box<PubsubWrapper>>
The value of wrapper
if it holds a PubsubWrapper, None if the field is not set or
holds a different branch.
Sourcepub fn set_pubsub_wrapper<T: Into<Box<PubsubWrapper>>>(self, v: T) -> Self
pub fn set_pubsub_wrapper<T: Into<Box<PubsubWrapper>>>(self, v: T) -> Self
Sets the value of wrapper
to hold a PubsubWrapper.
Note that all the setters affecting wrapper are
mutually exclusive.
§Example
use google_cloud_pubsub::model::push_config::PubsubWrapper;
let x = PushConfig::new().set_pubsub_wrapper(PubsubWrapper::default()/* use setters */);
assert!(x.pubsub_wrapper().is_some());
assert!(x.no_wrapper().is_none());Sourcepub fn no_wrapper(&self) -> Option<&Box<NoWrapper>>
pub fn no_wrapper(&self) -> Option<&Box<NoWrapper>>
The value of wrapper
if it holds a NoWrapper, None if the field is not set or
holds a different branch.
Sourcepub fn set_no_wrapper<T: Into<Box<NoWrapper>>>(self, v: T) -> Self
pub fn set_no_wrapper<T: Into<Box<NoWrapper>>>(self, v: T) -> Self
Sets the value of wrapper
to hold a NoWrapper.
Note that all the setters affecting wrapper are
mutually exclusive.
§Example
use google_cloud_pubsub::model::push_config::NoWrapper;
let x = PushConfig::new().set_no_wrapper(NoWrapper::default()/* use setters */);
assert!(x.no_wrapper().is_some());
assert!(x.pubsub_wrapper().is_none());Trait Implementations§
Source§impl Clone for PushConfig
impl Clone for PushConfig
Source§fn clone(&self) -> PushConfig
fn clone(&self) -> PushConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PushConfig
impl Debug for PushConfig
Source§impl Default for PushConfig
impl Default for PushConfig
Source§fn default() -> PushConfig
fn default() -> PushConfig
Source§impl PartialEq for PushConfig
impl PartialEq for PushConfig
impl StructuralPartialEq for PushConfig
Auto Trait Implementations§
impl Freeze for PushConfig
impl RefUnwindSafe for PushConfig
impl Send for PushConfig
impl Sync for PushConfig
impl Unpin for PushConfig
impl UnwindSafe for PushConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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