aws-sdk-quicksight 1.130.0

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

/// <p>A template object. A <i>template</i> is an entity in Quick Sight that encapsulates the metadata required to create an analysis and that you can use to create a dashboard. A template adds a layer of abstraction by using placeholders to replace the dataset associated with an analysis. You can use templates to create dashboards by replacing dataset placeholders with datasets that follow the same schema that was used to create the source analysis and template.</p>
/// <p>You can share templates across Amazon Web Services accounts by allowing users in other Amazon Web Services accounts to create a template or a dashboard from an existing template.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Template {
    /// <p>The Amazon Resource Name (ARN) of the template.</p>
    pub arn: ::std::option::Option<::std::string::String>,
    /// <p>The display name of the template.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>A structure describing the versions of the template.</p>
    pub version: ::std::option::Option<crate::types::TemplateVersion>,
    /// <p>The ID for the template. This is unique per Amazon Web Services Region for each Amazon Web Services account.</p>
    pub template_id: ::std::option::Option<::std::string::String>,
    /// <p>Time when this was last updated.</p>
    pub last_updated_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>Time when this was created.</p>
    pub created_time: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl Template {
    /// <p>The Amazon Resource Name (ARN) of the template.</p>
    pub fn arn(&self) -> ::std::option::Option<&str> {
        self.arn.as_deref()
    }
    /// <p>The display name of the template.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>A structure describing the versions of the template.</p>
    pub fn version(&self) -> ::std::option::Option<&crate::types::TemplateVersion> {
        self.version.as_ref()
    }
    /// <p>The ID for the template. This is unique per Amazon Web Services Region for each Amazon Web Services account.</p>
    pub fn template_id(&self) -> ::std::option::Option<&str> {
        self.template_id.as_deref()
    }
    /// <p>Time when this was last updated.</p>
    pub fn last_updated_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_updated_time.as_ref()
    }
    /// <p>Time when this was created.</p>
    pub fn created_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.created_time.as_ref()
    }
}
impl Template {
    /// Creates a new builder-style object to manufacture [`Template`](crate::types::Template).
    pub fn builder() -> crate::types::builders::TemplateBuilder {
        crate::types::builders::TemplateBuilder::default()
    }
}

/// A builder for [`Template`](crate::types::Template).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct TemplateBuilder {
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) version: ::std::option::Option<crate::types::TemplateVersion>,
    pub(crate) template_id: ::std::option::Option<::std::string::String>,
    pub(crate) last_updated_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) created_time: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl TemplateBuilder {
    /// <p>The Amazon Resource Name (ARN) of the template.</p>
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the template.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the template.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>The display name of the template.</p>
    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 display name of the template.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The display name of the template.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>A structure describing the versions of the template.</p>
    pub fn version(mut self, input: crate::types::TemplateVersion) -> Self {
        self.version = ::std::option::Option::Some(input);
        self
    }
    /// <p>A structure describing the versions of the template.</p>
    pub fn set_version(mut self, input: ::std::option::Option<crate::types::TemplateVersion>) -> Self {
        self.version = input;
        self
    }
    /// <p>A structure describing the versions of the template.</p>
    pub fn get_version(&self) -> &::std::option::Option<crate::types::TemplateVersion> {
        &self.version
    }
    /// <p>The ID for the template. This is unique per Amazon Web Services Region for each Amazon Web Services account.</p>
    pub fn template_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.template_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID for the template. This is unique per Amazon Web Services Region for each Amazon Web Services account.</p>
    pub fn set_template_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.template_id = input;
        self
    }
    /// <p>The ID for the template. This is unique per Amazon Web Services Region for each Amazon Web Services account.</p>
    pub fn get_template_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.template_id
    }
    /// <p>Time when this was last updated.</p>
    pub fn last_updated_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_updated_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>Time when this was last updated.</p>
    pub fn set_last_updated_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_updated_time = input;
        self
    }
    /// <p>Time when this was last updated.</p>
    pub fn get_last_updated_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_updated_time
    }
    /// <p>Time when this was created.</p>
    pub fn created_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>Time when this was created.</p>
    pub fn set_created_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_time = input;
        self
    }
    /// <p>Time when this was created.</p>
    pub fn get_created_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_time
    }
    /// Consumes the builder and constructs a [`Template`](crate::types::Template).
    pub fn build(self) -> crate::types::Template {
        crate::types::Template {
            arn: self.arn,
            name: self.name,
            version: self.version,
            template_id: self.template_id,
            last_updated_time: self.last_updated_time,
            created_time: self.created_time,
        }
    }
}