aws_sdk_quicksight/types/
_topic_template.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The definition for a <code>TopicTemplate</code>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct TopicTemplate {
    /// <p>The template type for the <code>TopicTemplate</code>.</p>
    pub template_type: ::std::option::Option<::std::string::String>,
    /// <p>The slots for the <code>TopicTemplate</code>.</p>
    pub slots: ::std::option::Option<::std::vec::Vec<crate::types::Slot>>,
}
impl TopicTemplate {
    /// <p>The template type for the <code>TopicTemplate</code>.</p>
    pub fn template_type(&self) -> ::std::option::Option<&str> {
        self.template_type.as_deref()
    }
    /// <p>The slots for the <code>TopicTemplate</code>.</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 `.slots.is_none()`.
    pub fn slots(&self) -> &[crate::types::Slot] {
        self.slots.as_deref().unwrap_or_default()
    }
}
impl TopicTemplate {
    /// Creates a new builder-style object to manufacture [`TopicTemplate`](crate::types::TopicTemplate).
    pub fn builder() -> crate::types::builders::TopicTemplateBuilder {
        crate::types::builders::TopicTemplateBuilder::default()
    }
}

/// A builder for [`TopicTemplate`](crate::types::TopicTemplate).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct TopicTemplateBuilder {
    pub(crate) template_type: ::std::option::Option<::std::string::String>,
    pub(crate) slots: ::std::option::Option<::std::vec::Vec<crate::types::Slot>>,
}
impl TopicTemplateBuilder {
    /// <p>The template type for the <code>TopicTemplate</code>.</p>
    pub fn template_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.template_type = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The template type for the <code>TopicTemplate</code>.</p>
    pub fn set_template_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.template_type = input;
        self
    }
    /// <p>The template type for the <code>TopicTemplate</code>.</p>
    pub fn get_template_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.template_type
    }
    /// Appends an item to `slots`.
    ///
    /// To override the contents of this collection use [`set_slots`](Self::set_slots).
    ///
    /// <p>The slots for the <code>TopicTemplate</code>.</p>
    pub fn slots(mut self, input: crate::types::Slot) -> Self {
        let mut v = self.slots.unwrap_or_default();
        v.push(input);
        self.slots = ::std::option::Option::Some(v);
        self
    }
    /// <p>The slots for the <code>TopicTemplate</code>.</p>
    pub fn set_slots(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Slot>>) -> Self {
        self.slots = input;
        self
    }
    /// <p>The slots for the <code>TopicTemplate</code>.</p>
    pub fn get_slots(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Slot>> {
        &self.slots
    }
    /// Consumes the builder and constructs a [`TopicTemplate`](crate::types::TopicTemplate).
    pub fn build(self) -> crate::types::TopicTemplate {
        crate::types::TopicTemplate {
            template_type: self.template_type,
            slots: self.slots,
        }
    }
}