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
81
82
83
84
85
// 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 PublishBatchInput {
    /// <p>The Amazon resource name (ARN) of the topic you want to batch publish to.</p>
    pub topic_arn: ::std::option::Option<::std::string::String>,
    /// <p>A list of <code>PublishBatch</code> request entries to be sent to the SNS topic.</p>
    pub publish_batch_request_entries: ::std::option::Option<::std::vec::Vec<crate::types::PublishBatchRequestEntry>>,
}
impl PublishBatchInput {
    /// <p>The Amazon resource name (ARN) of the topic you want to batch publish to.</p>
    pub fn topic_arn(&self) -> ::std::option::Option<&str> {
        self.topic_arn.as_deref()
    }
    /// <p>A list of <code>PublishBatch</code> request entries to be sent to the SNS topic.</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 `.publish_batch_request_entries.is_none()`.
    pub fn publish_batch_request_entries(&self) -> &[crate::types::PublishBatchRequestEntry] {
        self.publish_batch_request_entries.as_deref().unwrap_or_default()
    }
}
impl PublishBatchInput {
    /// Creates a new builder-style object to manufacture [`PublishBatchInput`](crate::operation::publish_batch::PublishBatchInput).
    pub fn builder() -> crate::operation::publish_batch::builders::PublishBatchInputBuilder {
        crate::operation::publish_batch::builders::PublishBatchInputBuilder::default()
    }
}

/// A builder for [`PublishBatchInput`](crate::operation::publish_batch::PublishBatchInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct PublishBatchInputBuilder {
    pub(crate) topic_arn: ::std::option::Option<::std::string::String>,
    pub(crate) publish_batch_request_entries: ::std::option::Option<::std::vec::Vec<crate::types::PublishBatchRequestEntry>>,
}
impl PublishBatchInputBuilder {
    /// <p>The Amazon resource name (ARN) of the topic you want to batch publish to.</p>
    /// This field is required.
    pub fn topic_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.topic_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon resource name (ARN) of the topic you want to batch publish to.</p>
    pub fn set_topic_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.topic_arn = input;
        self
    }
    /// <p>The Amazon resource name (ARN) of the topic you want to batch publish to.</p>
    pub fn get_topic_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.topic_arn
    }
    /// Appends an item to `publish_batch_request_entries`.
    ///
    /// To override the contents of this collection use [`set_publish_batch_request_entries`](Self::set_publish_batch_request_entries).
    ///
    /// <p>A list of <code>PublishBatch</code> request entries to be sent to the SNS topic.</p>
    pub fn publish_batch_request_entries(mut self, input: crate::types::PublishBatchRequestEntry) -> Self {
        let mut v = self.publish_batch_request_entries.unwrap_or_default();
        v.push(input);
        self.publish_batch_request_entries = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of <code>PublishBatch</code> request entries to be sent to the SNS topic.</p>
    pub fn set_publish_batch_request_entries(
        mut self,
        input: ::std::option::Option<::std::vec::Vec<crate::types::PublishBatchRequestEntry>>,
    ) -> Self {
        self.publish_batch_request_entries = input;
        self
    }
    /// <p>A list of <code>PublishBatch</code> request entries to be sent to the SNS topic.</p>
    pub fn get_publish_batch_request_entries(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PublishBatchRequestEntry>> {
        &self.publish_batch_request_entries
    }
    /// Consumes the builder and constructs a [`PublishBatchInput`](crate::operation::publish_batch::PublishBatchInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::publish_batch::PublishBatchInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::publish_batch::PublishBatchInput {
            topic_arn: self.topic_arn,
            publish_batch_request_entries: self.publish_batch_request_entries,
        })
    }
}