pub struct NotificationChannelService { /* private fields */ }Expand description
Implements a client for the Cloud Monitoring API.
§Service Description
The Notification Channel API provides access to configuration that controls how messages related to incidents are sent.
§Configuration
NotificationChannelService has various configuration parameters, the defaults should
work with most applications.
§Pooling and Cloning
NotificationChannelService holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap NotificationChannelService in
an Rc or Arc to reuse it, because it already uses an Arc
internally.
Implementations§
Source§impl NotificationChannelService
impl NotificationChannelService
Sourcepub async fn new_with_config(conf: ClientConfig) -> Result<Self>
pub async fn new_with_config(conf: ClientConfig) -> Result<Self>
Creates a new client with the specified configuration.
Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: NotificationChannelService + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: NotificationChannelService + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is when mocking the client.
Sourcepub fn list_notification_channel_descriptors(
&self,
name: impl Into<String>,
) -> ListNotificationChannelDescriptors
pub fn list_notification_channel_descriptors( &self, name: impl Into<String>, ) -> ListNotificationChannelDescriptors
Lists the descriptors for supported channel types. The use of descriptors makes it possible for new channel types to be dynamically added.
Sourcepub fn get_notification_channel_descriptor(
&self,
name: impl Into<String>,
) -> GetNotificationChannelDescriptor
pub fn get_notification_channel_descriptor( &self, name: impl Into<String>, ) -> GetNotificationChannelDescriptor
Gets a single channel descriptor. The descriptor indicates which fields are expected / permitted for a notification channel of the given type.
Sourcepub fn list_notification_channels(
&self,
name: impl Into<String>,
) -> ListNotificationChannels
pub fn list_notification_channels( &self, name: impl Into<String>, ) -> ListNotificationChannels
Lists the notification channels that have been created for the project.
To list the types of notification channels that are supported, use
the ListNotificationChannelDescriptors method.
Sourcepub fn get_notification_channel(
&self,
name: impl Into<String>,
) -> GetNotificationChannel
pub fn get_notification_channel( &self, name: impl Into<String>, ) -> GetNotificationChannel
Gets a single notification channel. The channel includes the relevant configuration details with which the channel was created. However, the response may truncate or omit passwords, API keys, or other private key matter and thus the response may not be 100% identical to the information that was supplied in the call to the create method.
Sourcepub fn create_notification_channel(
&self,
name: impl Into<String>,
) -> CreateNotificationChannel
pub fn create_notification_channel( &self, name: impl Into<String>, ) -> CreateNotificationChannel
Creates a new notification channel, representing a single notification endpoint such as an email address, SMS number, or PagerDuty service.
Design your application to single-thread API calls that modify the state of notification channels in a single project. This includes calls to CreateNotificationChannel, DeleteNotificationChannel and UpdateNotificationChannel.
Sourcepub fn update_notification_channel(
&self,
notification_channel: impl Into<NotificationChannel>,
) -> UpdateNotificationChannel
pub fn update_notification_channel( &self, notification_channel: impl Into<NotificationChannel>, ) -> UpdateNotificationChannel
Updates a notification channel. Fields not specified in the field mask remain unchanged.
Design your application to single-thread API calls that modify the state of notification channels in a single project. This includes calls to CreateNotificationChannel, DeleteNotificationChannel and UpdateNotificationChannel.
Sourcepub fn delete_notification_channel(
&self,
name: impl Into<String>,
) -> DeleteNotificationChannel
pub fn delete_notification_channel( &self, name: impl Into<String>, ) -> DeleteNotificationChannel
Deletes a notification channel.
Design your application to single-thread API calls that modify the state of notification channels in a single project. This includes calls to CreateNotificationChannel, DeleteNotificationChannel and UpdateNotificationChannel.
Sourcepub fn send_notification_channel_verification_code(
&self,
name: impl Into<String>,
) -> SendNotificationChannelVerificationCode
pub fn send_notification_channel_verification_code( &self, name: impl Into<String>, ) -> SendNotificationChannelVerificationCode
Causes a verification code to be delivered to the channel. The code
can then be supplied in VerifyNotificationChannel to verify the channel.
Sourcepub fn get_notification_channel_verification_code(
&self,
name: impl Into<String>,
) -> GetNotificationChannelVerificationCode
pub fn get_notification_channel_verification_code( &self, name: impl Into<String>, ) -> GetNotificationChannelVerificationCode
Requests a verification code for an already verified channel that can then be used in a call to VerifyNotificationChannel() on a different channel with an equivalent identity in the same or in a different project. This makes it possible to copy a channel between projects without requiring manual reverification of the channel. If the channel is not in the verified state, this method will fail (in other words, this may only be used if the SendNotificationChannelVerificationCode and VerifyNotificationChannel paths have already been used to put the given channel into the verified state).
There is no guarantee that the verification codes returned by this method will be of a similar structure or form as the ones that are delivered to the channel via SendNotificationChannelVerificationCode; while VerifyNotificationChannel() will recognize both the codes delivered via SendNotificationChannelVerificationCode() and returned from GetNotificationChannelVerificationCode(), it is typically the case that the verification codes delivered via SendNotificationChannelVerificationCode() will be shorter and also have a shorter expiration (e.g. codes such as “G-123456”) whereas GetVerificationCode() will typically return a much longer, websafe base 64 encoded string that has a longer expiration time.
Sourcepub fn verify_notification_channel(
&self,
name: impl Into<String>,
) -> VerifyNotificationChannel
pub fn verify_notification_channel( &self, name: impl Into<String>, ) -> VerifyNotificationChannel
Verifies a NotificationChannel by proving receipt of the code
delivered to the channel as a result of calling
SendNotificationChannelVerificationCode.
Trait Implementations§
Source§impl Clone for NotificationChannelService
impl Clone for NotificationChannelService
Source§fn clone(&self) -> NotificationChannelService
fn clone(&self) -> NotificationChannelService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more