aws_sdk_kafka/operation/create_topic/
_create_topic_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateTopicInput {
6 pub cluster_arn: ::std::option::Option<::std::string::String>,
8 pub topic_name: ::std::option::Option<::std::string::String>,
10 pub partition_count: ::std::option::Option<i32>,
12 pub replication_factor: ::std::option::Option<i32>,
14 pub configs: ::std::option::Option<::std::string::String>,
16}
17impl CreateTopicInput {
18 pub fn cluster_arn(&self) -> ::std::option::Option<&str> {
20 self.cluster_arn.as_deref()
21 }
22 pub fn topic_name(&self) -> ::std::option::Option<&str> {
24 self.topic_name.as_deref()
25 }
26 pub fn partition_count(&self) -> ::std::option::Option<i32> {
28 self.partition_count
29 }
30 pub fn replication_factor(&self) -> ::std::option::Option<i32> {
32 self.replication_factor
33 }
34 pub fn configs(&self) -> ::std::option::Option<&str> {
36 self.configs.as_deref()
37 }
38}
39impl CreateTopicInput {
40 pub fn builder() -> crate::operation::create_topic::builders::CreateTopicInputBuilder {
42 crate::operation::create_topic::builders::CreateTopicInputBuilder::default()
43 }
44}
45
46#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct CreateTopicInputBuilder {
50 pub(crate) cluster_arn: ::std::option::Option<::std::string::String>,
51 pub(crate) topic_name: ::std::option::Option<::std::string::String>,
52 pub(crate) partition_count: ::std::option::Option<i32>,
53 pub(crate) replication_factor: ::std::option::Option<i32>,
54 pub(crate) configs: ::std::option::Option<::std::string::String>,
55}
56impl CreateTopicInputBuilder {
57 pub fn cluster_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60 self.cluster_arn = ::std::option::Option::Some(input.into());
61 self
62 }
63 pub fn set_cluster_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65 self.cluster_arn = input;
66 self
67 }
68 pub fn get_cluster_arn(&self) -> &::std::option::Option<::std::string::String> {
70 &self.cluster_arn
71 }
72 pub fn topic_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75 self.topic_name = ::std::option::Option::Some(input.into());
76 self
77 }
78 pub fn set_topic_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80 self.topic_name = input;
81 self
82 }
83 pub fn get_topic_name(&self) -> &::std::option::Option<::std::string::String> {
85 &self.topic_name
86 }
87 pub fn partition_count(mut self, input: i32) -> Self {
90 self.partition_count = ::std::option::Option::Some(input);
91 self
92 }
93 pub fn set_partition_count(mut self, input: ::std::option::Option<i32>) -> Self {
95 self.partition_count = input;
96 self
97 }
98 pub fn get_partition_count(&self) -> &::std::option::Option<i32> {
100 &self.partition_count
101 }
102 pub fn replication_factor(mut self, input: i32) -> Self {
105 self.replication_factor = ::std::option::Option::Some(input);
106 self
107 }
108 pub fn set_replication_factor(mut self, input: ::std::option::Option<i32>) -> Self {
110 self.replication_factor = input;
111 self
112 }
113 pub fn get_replication_factor(&self) -> &::std::option::Option<i32> {
115 &self.replication_factor
116 }
117 pub fn configs(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119 self.configs = ::std::option::Option::Some(input.into());
120 self
121 }
122 pub fn set_configs(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124 self.configs = input;
125 self
126 }
127 pub fn get_configs(&self) -> &::std::option::Option<::std::string::String> {
129 &self.configs
130 }
131 pub fn build(self) -> ::std::result::Result<crate::operation::create_topic::CreateTopicInput, ::aws_smithy_types::error::operation::BuildError> {
133 ::std::result::Result::Ok(crate::operation::create_topic::CreateTopicInput {
134 cluster_arn: self.cluster_arn,
135 topic_name: self.topic_name,
136 partition_count: self.partition_count,
137 replication_factor: self.replication_factor,
138 configs: self.configs,
139 })
140 }
141}