Skip to main content

aws_sdk_quicksight/types/
_template_source_analysis.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The source analysis of the template.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct TemplateSourceAnalysis {
7    /// <p>The Amazon Resource Name (ARN) of the resource.</p>
8    pub arn: ::std::string::String,
9    /// <p>A structure containing information about the dataset references used as placeholders in the template.</p>
10    pub data_set_references: ::std::vec::Vec<crate::types::DataSetReference>,
11}
12impl TemplateSourceAnalysis {
13    /// <p>The Amazon Resource Name (ARN) of the resource.</p>
14    pub fn arn(&self) -> &str {
15        use std::ops::Deref;
16        self.arn.deref()
17    }
18    /// <p>A structure containing information about the dataset references used as placeholders in the template.</p>
19    pub fn data_set_references(&self) -> &[crate::types::DataSetReference] {
20        use std::ops::Deref;
21        self.data_set_references.deref()
22    }
23}
24impl TemplateSourceAnalysis {
25    /// Creates a new builder-style object to manufacture [`TemplateSourceAnalysis`](crate::types::TemplateSourceAnalysis).
26    pub fn builder() -> crate::types::builders::TemplateSourceAnalysisBuilder {
27        crate::types::builders::TemplateSourceAnalysisBuilder::default()
28    }
29}
30
31/// A builder for [`TemplateSourceAnalysis`](crate::types::TemplateSourceAnalysis).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct TemplateSourceAnalysisBuilder {
35    pub(crate) arn: ::std::option::Option<::std::string::String>,
36    pub(crate) data_set_references: ::std::option::Option<::std::vec::Vec<crate::types::DataSetReference>>,
37}
38impl TemplateSourceAnalysisBuilder {
39    /// <p>The Amazon Resource Name (ARN) of the resource.</p>
40    /// This field is required.
41    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
42        self.arn = ::std::option::Option::Some(input.into());
43        self
44    }
45    /// <p>The Amazon Resource Name (ARN) of the resource.</p>
46    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
47        self.arn = input;
48        self
49    }
50    /// <p>The Amazon Resource Name (ARN) of the resource.</p>
51    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
52        &self.arn
53    }
54    /// Appends an item to `data_set_references`.
55    ///
56    /// To override the contents of this collection use [`set_data_set_references`](Self::set_data_set_references).
57    ///
58    /// <p>A structure containing information about the dataset references used as placeholders in the template.</p>
59    pub fn data_set_references(mut self, input: crate::types::DataSetReference) -> Self {
60        let mut v = self.data_set_references.unwrap_or_default();
61        v.push(input);
62        self.data_set_references = ::std::option::Option::Some(v);
63        self
64    }
65    /// <p>A structure containing information about the dataset references used as placeholders in the template.</p>
66    pub fn set_data_set_references(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DataSetReference>>) -> Self {
67        self.data_set_references = input;
68        self
69    }
70    /// <p>A structure containing information about the dataset references used as placeholders in the template.</p>
71    pub fn get_data_set_references(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DataSetReference>> {
72        &self.data_set_references
73    }
74    /// Consumes the builder and constructs a [`TemplateSourceAnalysis`](crate::types::TemplateSourceAnalysis).
75    /// This method will fail if any of the following fields are not set:
76    /// - [`arn`](crate::types::builders::TemplateSourceAnalysisBuilder::arn)
77    /// - [`data_set_references`](crate::types::builders::TemplateSourceAnalysisBuilder::data_set_references)
78    pub fn build(self) -> ::std::result::Result<crate::types::TemplateSourceAnalysis, ::aws_smithy_types::error::operation::BuildError> {
79        ::std::result::Result::Ok(crate::types::TemplateSourceAnalysis {
80            arn: self.arn.ok_or_else(|| {
81                ::aws_smithy_types::error::operation::BuildError::missing_field(
82                    "arn",
83                    "arn was not specified but it is required when building TemplateSourceAnalysis",
84                )
85            })?,
86            data_set_references: self.data_set_references.ok_or_else(|| {
87                ::aws_smithy_types::error::operation::BuildError::missing_field(
88                    "data_set_references",
89                    "data_set_references was not specified but it is required when building TemplateSourceAnalysis",
90                )
91            })?,
92        })
93    }
94}