aws-sdk-cloudtrail 1.104.0

AWS SDK for AWS CloudTrail
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateDashboardInput {
    /// <p>The name of the dashboard. The name must be unique to your account.</p>
    /// <p>To create the Highlights dashboard, the name must be <code>AWSCloudTrail-Highlights</code>.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The refresh schedule configuration for the dashboard.</p>
    /// <p>To create the Highlights dashboard, you must set a refresh schedule and set the <code>Status</code> to <code>ENABLED</code>. The <code>Unit</code> for the refresh schedule must be <code>HOURS</code> and the <code>Value</code> must be <code>6</code>.</p>
    pub refresh_schedule: ::std::option::Option<crate::types::RefreshSchedule>,
    /// <p>A list of tags.</p>
    pub tags_list: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    /// <p>Specifies whether termination protection is enabled for the dashboard. If termination protection is enabled, you cannot delete the dashboard until termination protection is disabled.</p>
    pub termination_protection_enabled: ::std::option::Option<bool>,
    /// <p>An array of widgets for a custom dashboard. A custom dashboard can have a maximum of ten widgets.</p>
    /// <p>You do not need to specify widgets for the Highlights dashboard.</p>
    pub widgets: ::std::option::Option<::std::vec::Vec<crate::types::RequestWidget>>,
}
impl CreateDashboardInput {
    /// <p>The name of the dashboard. The name must be unique to your account.</p>
    /// <p>To create the Highlights dashboard, the name must be <code>AWSCloudTrail-Highlights</code>.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The refresh schedule configuration for the dashboard.</p>
    /// <p>To create the Highlights dashboard, you must set a refresh schedule and set the <code>Status</code> to <code>ENABLED</code>. The <code>Unit</code> for the refresh schedule must be <code>HOURS</code> and the <code>Value</code> must be <code>6</code>.</p>
    pub fn refresh_schedule(&self) -> ::std::option::Option<&crate::types::RefreshSchedule> {
        self.refresh_schedule.as_ref()
    }
    /// <p>A list of tags.</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 `.tags_list.is_none()`.
    pub fn tags_list(&self) -> &[crate::types::Tag] {
        self.tags_list.as_deref().unwrap_or_default()
    }
    /// <p>Specifies whether termination protection is enabled for the dashboard. If termination protection is enabled, you cannot delete the dashboard until termination protection is disabled.</p>
    pub fn termination_protection_enabled(&self) -> ::std::option::Option<bool> {
        self.termination_protection_enabled
    }
    /// <p>An array of widgets for a custom dashboard. A custom dashboard can have a maximum of ten widgets.</p>
    /// <p>You do not need to specify widgets for the Highlights dashboard.</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 `.widgets.is_none()`.
    pub fn widgets(&self) -> &[crate::types::RequestWidget] {
        self.widgets.as_deref().unwrap_or_default()
    }
}
impl CreateDashboardInput {
    /// Creates a new builder-style object to manufacture [`CreateDashboardInput`](crate::operation::create_dashboard::CreateDashboardInput).
    pub fn builder() -> crate::operation::create_dashboard::builders::CreateDashboardInputBuilder {
        crate::operation::create_dashboard::builders::CreateDashboardInputBuilder::default()
    }
}

/// A builder for [`CreateDashboardInput`](crate::operation::create_dashboard::CreateDashboardInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateDashboardInputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) refresh_schedule: ::std::option::Option<crate::types::RefreshSchedule>,
    pub(crate) tags_list: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    pub(crate) termination_protection_enabled: ::std::option::Option<bool>,
    pub(crate) widgets: ::std::option::Option<::std::vec::Vec<crate::types::RequestWidget>>,
}
impl CreateDashboardInputBuilder {
    /// <p>The name of the dashboard. The name must be unique to your account.</p>
    /// <p>To create the Highlights dashboard, the name must be <code>AWSCloudTrail-Highlights</code>.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the dashboard. The name must be unique to your account.</p>
    /// <p>To create the Highlights dashboard, the name must be <code>AWSCloudTrail-Highlights</code>.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the dashboard. The name must be unique to your account.</p>
    /// <p>To create the Highlights dashboard, the name must be <code>AWSCloudTrail-Highlights</code>.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The refresh schedule configuration for the dashboard.</p>
    /// <p>To create the Highlights dashboard, you must set a refresh schedule and set the <code>Status</code> to <code>ENABLED</code>. The <code>Unit</code> for the refresh schedule must be <code>HOURS</code> and the <code>Value</code> must be <code>6</code>.</p>
    pub fn refresh_schedule(mut self, input: crate::types::RefreshSchedule) -> Self {
        self.refresh_schedule = ::std::option::Option::Some(input);
        self
    }
    /// <p>The refresh schedule configuration for the dashboard.</p>
    /// <p>To create the Highlights dashboard, you must set a refresh schedule and set the <code>Status</code> to <code>ENABLED</code>. The <code>Unit</code> for the refresh schedule must be <code>HOURS</code> and the <code>Value</code> must be <code>6</code>.</p>
    pub fn set_refresh_schedule(mut self, input: ::std::option::Option<crate::types::RefreshSchedule>) -> Self {
        self.refresh_schedule = input;
        self
    }
    /// <p>The refresh schedule configuration for the dashboard.</p>
    /// <p>To create the Highlights dashboard, you must set a refresh schedule and set the <code>Status</code> to <code>ENABLED</code>. The <code>Unit</code> for the refresh schedule must be <code>HOURS</code> and the <code>Value</code> must be <code>6</code>.</p>
    pub fn get_refresh_schedule(&self) -> &::std::option::Option<crate::types::RefreshSchedule> {
        &self.refresh_schedule
    }
    /// Appends an item to `tags_list`.
    ///
    /// To override the contents of this collection use [`set_tags_list`](Self::set_tags_list).
    ///
    /// <p>A list of tags.</p>
    pub fn tags_list(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.tags_list.unwrap_or_default();
        v.push(input);
        self.tags_list = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of tags.</p>
    pub fn set_tags_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags_list = input;
        self
    }
    /// <p>A list of tags.</p>
    pub fn get_tags_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags_list
    }
    /// <p>Specifies whether termination protection is enabled for the dashboard. If termination protection is enabled, you cannot delete the dashboard until termination protection is disabled.</p>
    pub fn termination_protection_enabled(mut self, input: bool) -> Self {
        self.termination_protection_enabled = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies whether termination protection is enabled for the dashboard. If termination protection is enabled, you cannot delete the dashboard until termination protection is disabled.</p>
    pub fn set_termination_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
        self.termination_protection_enabled = input;
        self
    }
    /// <p>Specifies whether termination protection is enabled for the dashboard. If termination protection is enabled, you cannot delete the dashboard until termination protection is disabled.</p>
    pub fn get_termination_protection_enabled(&self) -> &::std::option::Option<bool> {
        &self.termination_protection_enabled
    }
    /// Appends an item to `widgets`.
    ///
    /// To override the contents of this collection use [`set_widgets`](Self::set_widgets).
    ///
    /// <p>An array of widgets for a custom dashboard. A custom dashboard can have a maximum of ten widgets.</p>
    /// <p>You do not need to specify widgets for the Highlights dashboard.</p>
    pub fn widgets(mut self, input: crate::types::RequestWidget) -> Self {
        let mut v = self.widgets.unwrap_or_default();
        v.push(input);
        self.widgets = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of widgets for a custom dashboard. A custom dashboard can have a maximum of ten widgets.</p>
    /// <p>You do not need to specify widgets for the Highlights dashboard.</p>
    pub fn set_widgets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RequestWidget>>) -> Self {
        self.widgets = input;
        self
    }
    /// <p>An array of widgets for a custom dashboard. A custom dashboard can have a maximum of ten widgets.</p>
    /// <p>You do not need to specify widgets for the Highlights dashboard.</p>
    pub fn get_widgets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RequestWidget>> {
        &self.widgets
    }
    /// Consumes the builder and constructs a [`CreateDashboardInput`](crate::operation::create_dashboard::CreateDashboardInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_dashboard::CreateDashboardInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_dashboard::CreateDashboardInput {
            name: self.name,
            refresh_schedule: self.refresh_schedule,
            tags_list: self.tags_list,
            termination_protection_enabled: self.termination_protection_enabled,
            widgets: self.widgets,
        })
    }
}