aws_sdk_kinesis/operation/merge_shards/
_merge_shards_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the input for <code>MergeShards</code>.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct MergeShardsInput {
7    /// <p>The name of the stream for the merge.</p>
8    pub stream_name: ::std::option::Option<::std::string::String>,
9    /// <p>The shard ID of the shard to combine with the adjacent shard for the merge.</p>
10    pub shard_to_merge: ::std::option::Option<::std::string::String>,
11    /// <p>The shard ID of the adjacent shard for the merge.</p>
12    pub adjacent_shard_to_merge: ::std::option::Option<::std::string::String>,
13    /// <p>The ARN of the stream.</p>
14    pub stream_arn: ::std::option::Option<::std::string::String>,
15}
16impl MergeShardsInput {
17    /// <p>The name of the stream for the merge.</p>
18    pub fn stream_name(&self) -> ::std::option::Option<&str> {
19        self.stream_name.as_deref()
20    }
21    /// <p>The shard ID of the shard to combine with the adjacent shard for the merge.</p>
22    pub fn shard_to_merge(&self) -> ::std::option::Option<&str> {
23        self.shard_to_merge.as_deref()
24    }
25    /// <p>The shard ID of the adjacent shard for the merge.</p>
26    pub fn adjacent_shard_to_merge(&self) -> ::std::option::Option<&str> {
27        self.adjacent_shard_to_merge.as_deref()
28    }
29    /// <p>The ARN of the stream.</p>
30    pub fn stream_arn(&self) -> ::std::option::Option<&str> {
31        self.stream_arn.as_deref()
32    }
33}
34impl MergeShardsInput {
35    /// Creates a new builder-style object to manufacture [`MergeShardsInput`](crate::operation::merge_shards::MergeShardsInput).
36    pub fn builder() -> crate::operation::merge_shards::builders::MergeShardsInputBuilder {
37        crate::operation::merge_shards::builders::MergeShardsInputBuilder::default()
38    }
39}
40
41/// A builder for [`MergeShardsInput`](crate::operation::merge_shards::MergeShardsInput).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct MergeShardsInputBuilder {
45    pub(crate) stream_name: ::std::option::Option<::std::string::String>,
46    pub(crate) shard_to_merge: ::std::option::Option<::std::string::String>,
47    pub(crate) adjacent_shard_to_merge: ::std::option::Option<::std::string::String>,
48    pub(crate) stream_arn: ::std::option::Option<::std::string::String>,
49}
50impl MergeShardsInputBuilder {
51    /// <p>The name of the stream for the merge.</p>
52    pub fn stream_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.stream_name = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The name of the stream for the merge.</p>
57    pub fn set_stream_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.stream_name = input;
59        self
60    }
61    /// <p>The name of the stream for the merge.</p>
62    pub fn get_stream_name(&self) -> &::std::option::Option<::std::string::String> {
63        &self.stream_name
64    }
65    /// <p>The shard ID of the shard to combine with the adjacent shard for the merge.</p>
66    /// This field is required.
67    pub fn shard_to_merge(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        self.shard_to_merge = ::std::option::Option::Some(input.into());
69        self
70    }
71    /// <p>The shard ID of the shard to combine with the adjacent shard for the merge.</p>
72    pub fn set_shard_to_merge(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.shard_to_merge = input;
74        self
75    }
76    /// <p>The shard ID of the shard to combine with the adjacent shard for the merge.</p>
77    pub fn get_shard_to_merge(&self) -> &::std::option::Option<::std::string::String> {
78        &self.shard_to_merge
79    }
80    /// <p>The shard ID of the adjacent shard for the merge.</p>
81    /// This field is required.
82    pub fn adjacent_shard_to_merge(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83        self.adjacent_shard_to_merge = ::std::option::Option::Some(input.into());
84        self
85    }
86    /// <p>The shard ID of the adjacent shard for the merge.</p>
87    pub fn set_adjacent_shard_to_merge(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88        self.adjacent_shard_to_merge = input;
89        self
90    }
91    /// <p>The shard ID of the adjacent shard for the merge.</p>
92    pub fn get_adjacent_shard_to_merge(&self) -> &::std::option::Option<::std::string::String> {
93        &self.adjacent_shard_to_merge
94    }
95    /// <p>The ARN of the stream.</p>
96    pub fn stream_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.stream_arn = ::std::option::Option::Some(input.into());
98        self
99    }
100    /// <p>The ARN of the stream.</p>
101    pub fn set_stream_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.stream_arn = input;
103        self
104    }
105    /// <p>The ARN of the stream.</p>
106    pub fn get_stream_arn(&self) -> &::std::option::Option<::std::string::String> {
107        &self.stream_arn
108    }
109    /// Consumes the builder and constructs a [`MergeShardsInput`](crate::operation::merge_shards::MergeShardsInput).
110    pub fn build(self) -> ::std::result::Result<crate::operation::merge_shards::MergeShardsInput, ::aws_smithy_types::error::operation::BuildError> {
111        ::std::result::Result::Ok(crate::operation::merge_shards::MergeShardsInput {
112            stream_name: self.stream_name,
113            shard_to_merge: self.shard_to_merge,
114            adjacent_shard_to_merge: self.adjacent_shard_to_merge,
115            stream_arn: self.stream_arn,
116        })
117    }
118}