aws-sdk-quicksight 1.133.0

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

/// <p>The color palette.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Palette {
    /// <p>The foreground color.</p>
    pub foreground: ::std::option::Option<::std::string::String>,
    /// <p>The background color.</p>
    pub background: ::std::option::Option<::std::string::String>,
}
impl Palette {
    /// <p>The foreground color.</p>
    pub fn foreground(&self) -> ::std::option::Option<&str> {
        self.foreground.as_deref()
    }
    /// <p>The background color.</p>
    pub fn background(&self) -> ::std::option::Option<&str> {
        self.background.as_deref()
    }
}
impl Palette {
    /// Creates a new builder-style object to manufacture [`Palette`](crate::types::Palette).
    pub fn builder() -> crate::types::builders::PaletteBuilder {
        crate::types::builders::PaletteBuilder::default()
    }
}

/// A builder for [`Palette`](crate::types::Palette).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PaletteBuilder {
    pub(crate) foreground: ::std::option::Option<::std::string::String>,
    pub(crate) background: ::std::option::Option<::std::string::String>,
}
impl PaletteBuilder {
    /// <p>The foreground color.</p>
    pub fn foreground(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.foreground = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The foreground color.</p>
    pub fn set_foreground(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.foreground = input;
        self
    }
    /// <p>The foreground color.</p>
    pub fn get_foreground(&self) -> &::std::option::Option<::std::string::String> {
        &self.foreground
    }
    /// <p>The background color.</p>
    pub fn background(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.background = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The background color.</p>
    pub fn set_background(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.background = input;
        self
    }
    /// <p>The background color.</p>
    pub fn get_background(&self) -> &::std::option::Option<::std::string::String> {
        &self.background
    }
    /// Consumes the builder and constructs a [`Palette`](crate::types::Palette).
    pub fn build(self) -> crate::types::Palette {
        crate::types::Palette {
            foreground: self.foreground,
            background: self.background,
        }
    }
}