Skip to main content

aws_sdk_dsql/operation/create_stream/
_create_stream_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateStreamInput {
6    /// <p>The ID of the cluster for which to create the stream.</p>
7    pub cluster_identifier: ::std::option::Option<::std::string::String>,
8    /// <p>The target destination configuration for the stream. Contains Kinesis stream configuration including stream ARN and IAM role ARN.</p>
9    pub target_definition: ::std::option::Option<crate::types::TargetDefinition>,
10    /// <p>The ordering mode for the stream. Determines how change events are ordered when delivered to the target.</p>
11    pub ordering: ::std::option::Option<crate::types::StreamOrdering>,
12    /// <p>The format of the stream records.</p>
13    pub format: ::std::option::Option<crate::types::StreamFormat>,
14    /// <p>A map of key and value pairs to use to tag your stream.</p>
15    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
16    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
17    /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
18    pub client_token: ::std::option::Option<::std::string::String>,
19}
20impl CreateStreamInput {
21    /// <p>The ID of the cluster for which to create the stream.</p>
22    pub fn cluster_identifier(&self) -> ::std::option::Option<&str> {
23        self.cluster_identifier.as_deref()
24    }
25    /// <p>The target destination configuration for the stream. Contains Kinesis stream configuration including stream ARN and IAM role ARN.</p>
26    pub fn target_definition(&self) -> ::std::option::Option<&crate::types::TargetDefinition> {
27        self.target_definition.as_ref()
28    }
29    /// <p>The ordering mode for the stream. Determines how change events are ordered when delivered to the target.</p>
30    pub fn ordering(&self) -> ::std::option::Option<&crate::types::StreamOrdering> {
31        self.ordering.as_ref()
32    }
33    /// <p>The format of the stream records.</p>
34    pub fn format(&self) -> ::std::option::Option<&crate::types::StreamFormat> {
35        self.format.as_ref()
36    }
37    /// <p>A map of key and value pairs to use to tag your stream.</p>
38    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
39        self.tags.as_ref()
40    }
41    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
42    /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
43    pub fn client_token(&self) -> ::std::option::Option<&str> {
44        self.client_token.as_deref()
45    }
46}
47impl CreateStreamInput {
48    /// Creates a new builder-style object to manufacture [`CreateStreamInput`](crate::operation::create_stream::CreateStreamInput).
49    pub fn builder() -> crate::operation::create_stream::builders::CreateStreamInputBuilder {
50        crate::operation::create_stream::builders::CreateStreamInputBuilder::default()
51    }
52}
53
54/// A builder for [`CreateStreamInput`](crate::operation::create_stream::CreateStreamInput).
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct CreateStreamInputBuilder {
58    pub(crate) cluster_identifier: ::std::option::Option<::std::string::String>,
59    pub(crate) target_definition: ::std::option::Option<crate::types::TargetDefinition>,
60    pub(crate) ordering: ::std::option::Option<crate::types::StreamOrdering>,
61    pub(crate) format: ::std::option::Option<crate::types::StreamFormat>,
62    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
63    pub(crate) client_token: ::std::option::Option<::std::string::String>,
64}
65impl CreateStreamInputBuilder {
66    /// <p>The ID of the cluster for which to create the stream.</p>
67    /// This field is required.
68    pub fn cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.cluster_identifier = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>The ID of the cluster for which to create the stream.</p>
73    pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.cluster_identifier = input;
75        self
76    }
77    /// <p>The ID of the cluster for which to create the stream.</p>
78    pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
79        &self.cluster_identifier
80    }
81    /// <p>The target destination configuration for the stream. Contains Kinesis stream configuration including stream ARN and IAM role ARN.</p>
82    /// This field is required.
83    pub fn target_definition(mut self, input: crate::types::TargetDefinition) -> Self {
84        self.target_definition = ::std::option::Option::Some(input);
85        self
86    }
87    /// <p>The target destination configuration for the stream. Contains Kinesis stream configuration including stream ARN and IAM role ARN.</p>
88    pub fn set_target_definition(mut self, input: ::std::option::Option<crate::types::TargetDefinition>) -> Self {
89        self.target_definition = input;
90        self
91    }
92    /// <p>The target destination configuration for the stream. Contains Kinesis stream configuration including stream ARN and IAM role ARN.</p>
93    pub fn get_target_definition(&self) -> &::std::option::Option<crate::types::TargetDefinition> {
94        &self.target_definition
95    }
96    /// <p>The ordering mode for the stream. Determines how change events are ordered when delivered to the target.</p>
97    /// This field is required.
98    pub fn ordering(mut self, input: crate::types::StreamOrdering) -> Self {
99        self.ordering = ::std::option::Option::Some(input);
100        self
101    }
102    /// <p>The ordering mode for the stream. Determines how change events are ordered when delivered to the target.</p>
103    pub fn set_ordering(mut self, input: ::std::option::Option<crate::types::StreamOrdering>) -> Self {
104        self.ordering = input;
105        self
106    }
107    /// <p>The ordering mode for the stream. Determines how change events are ordered when delivered to the target.</p>
108    pub fn get_ordering(&self) -> &::std::option::Option<crate::types::StreamOrdering> {
109        &self.ordering
110    }
111    /// <p>The format of the stream records.</p>
112    /// This field is required.
113    pub fn format(mut self, input: crate::types::StreamFormat) -> Self {
114        self.format = ::std::option::Option::Some(input);
115        self
116    }
117    /// <p>The format of the stream records.</p>
118    pub fn set_format(mut self, input: ::std::option::Option<crate::types::StreamFormat>) -> Self {
119        self.format = input;
120        self
121    }
122    /// <p>The format of the stream records.</p>
123    pub fn get_format(&self) -> &::std::option::Option<crate::types::StreamFormat> {
124        &self.format
125    }
126    /// Adds a key-value pair to `tags`.
127    ///
128    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
129    ///
130    /// <p>A map of key and value pairs to use to tag your stream.</p>
131    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
132        let mut hash_map = self.tags.unwrap_or_default();
133        hash_map.insert(k.into(), v.into());
134        self.tags = ::std::option::Option::Some(hash_map);
135        self
136    }
137    /// <p>A map of key and value pairs to use to tag your stream.</p>
138    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
139        self.tags = input;
140        self
141    }
142    /// <p>A map of key and value pairs to use to tag your stream.</p>
143    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
144        &self.tags
145    }
146    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
147    /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
148    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.client_token = ::std::option::Option::Some(input.into());
150        self
151    }
152    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
153    /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
154    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155        self.client_token = input;
156        self
157    }
158    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
159    /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
160    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
161        &self.client_token
162    }
163    /// Consumes the builder and constructs a [`CreateStreamInput`](crate::operation::create_stream::CreateStreamInput).
164    pub fn build(
165        self,
166    ) -> ::std::result::Result<crate::operation::create_stream::CreateStreamInput, ::aws_smithy_types::error::operation::BuildError> {
167        ::std::result::Result::Ok(crate::operation::create_stream::CreateStreamInput {
168            cluster_identifier: self.cluster_identifier,
169            target_definition: self.target_definition,
170            ordering: self.ordering,
171            format: self.format,
172            tags: self.tags,
173            client_token: self.client_token,
174        })
175    }
176}