aws-sdk-codeguruprofiler 1.98.0

AWS SDK for Amazon CodeGuru Profiler
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The structure representing the AddNotificationChannelsRequest.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct AddNotificationChannelsInput {
    /// <p>The name of the profiling group that we are setting up notifications for.</p>
    pub profiling_group_name: ::std::option::Option<::std::string::String>,
    /// <p>One or 2 channels to report to when anomalies are detected.</p>
    pub channels: ::std::option::Option<::std::vec::Vec<crate::types::Channel>>,
}
impl AddNotificationChannelsInput {
    /// <p>The name of the profiling group that we are setting up notifications for.</p>
    pub fn profiling_group_name(&self) -> ::std::option::Option<&str> {
        self.profiling_group_name.as_deref()
    }
    /// <p>One or 2 channels to report to when anomalies are detected.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.channels.is_none()`.
    pub fn channels(&self) -> &[crate::types::Channel] {
        self.channels.as_deref().unwrap_or_default()
    }
}
impl AddNotificationChannelsInput {
    /// Creates a new builder-style object to manufacture [`AddNotificationChannelsInput`](crate::operation::add_notification_channels::AddNotificationChannelsInput).
    pub fn builder() -> crate::operation::add_notification_channels::builders::AddNotificationChannelsInputBuilder {
        crate::operation::add_notification_channels::builders::AddNotificationChannelsInputBuilder::default()
    }
}

/// A builder for [`AddNotificationChannelsInput`](crate::operation::add_notification_channels::AddNotificationChannelsInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct AddNotificationChannelsInputBuilder {
    pub(crate) profiling_group_name: ::std::option::Option<::std::string::String>,
    pub(crate) channels: ::std::option::Option<::std::vec::Vec<crate::types::Channel>>,
}
impl AddNotificationChannelsInputBuilder {
    /// <p>The name of the profiling group that we are setting up notifications for.</p>
    /// This field is required.
    pub fn profiling_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.profiling_group_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the profiling group that we are setting up notifications for.</p>
    pub fn set_profiling_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.profiling_group_name = input;
        self
    }
    /// <p>The name of the profiling group that we are setting up notifications for.</p>
    pub fn get_profiling_group_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.profiling_group_name
    }
    /// Appends an item to `channels`.
    ///
    /// To override the contents of this collection use [`set_channels`](Self::set_channels).
    ///
    /// <p>One or 2 channels to report to when anomalies are detected.</p>
    pub fn channels(mut self, input: crate::types::Channel) -> Self {
        let mut v = self.channels.unwrap_or_default();
        v.push(input);
        self.channels = ::std::option::Option::Some(v);
        self
    }
    /// <p>One or 2 channels to report to when anomalies are detected.</p>
    pub fn set_channels(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Channel>>) -> Self {
        self.channels = input;
        self
    }
    /// <p>One or 2 channels to report to when anomalies are detected.</p>
    pub fn get_channels(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Channel>> {
        &self.channels
    }
    /// Consumes the builder and constructs a [`AddNotificationChannelsInput`](crate::operation::add_notification_channels::AddNotificationChannelsInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::add_notification_channels::AddNotificationChannelsInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::add_notification_channels::AddNotificationChannelsInput {
            profiling_group_name: self.profiling_group_name,
            channels: self.channels,
        })
    }
}