aws_sdk_ivschat/operation/create_room/
_create_room_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 CreateRoomInput {
6    /// <p>Room name. The value does not need to be unique.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>Maximum number of messages per second that can be sent to the room (by all clients). Default: 10.</p>
9    pub maximum_message_rate_per_second: ::std::option::Option<i32>,
10    /// <p>Maximum number of characters in a single message. Messages are expected to be UTF-8 encoded and this limit applies specifically to rune/code-point count, not number of bytes. Default: 500.</p>
11    pub maximum_message_length: ::std::option::Option<i32>,
12    /// <p>Configuration information for optional review of messages.</p>
13    pub message_review_handler: ::std::option::Option<crate::types::MessageReviewHandler>,
14    /// <p>Tags to attach to the resource. Array of maps, each of the form <code>string:string (key:value)</code>. See <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/best-practices-and-strats.html">Best practices and strategies</a> in <i>Tagging Amazon Web Services Resources and Tag Editor</i> for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS Chat has no constraints beyond what is documented there.</p>
15    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
16    /// <p>Array of logging-configuration identifiers attached to the room.</p>
17    pub logging_configuration_identifiers: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
18}
19impl CreateRoomInput {
20    /// <p>Room name. The value does not need to be unique.</p>
21    pub fn name(&self) -> ::std::option::Option<&str> {
22        self.name.as_deref()
23    }
24    /// <p>Maximum number of messages per second that can be sent to the room (by all clients). Default: 10.</p>
25    pub fn maximum_message_rate_per_second(&self) -> ::std::option::Option<i32> {
26        self.maximum_message_rate_per_second
27    }
28    /// <p>Maximum number of characters in a single message. Messages are expected to be UTF-8 encoded and this limit applies specifically to rune/code-point count, not number of bytes. Default: 500.</p>
29    pub fn maximum_message_length(&self) -> ::std::option::Option<i32> {
30        self.maximum_message_length
31    }
32    /// <p>Configuration information for optional review of messages.</p>
33    pub fn message_review_handler(&self) -> ::std::option::Option<&crate::types::MessageReviewHandler> {
34        self.message_review_handler.as_ref()
35    }
36    /// <p>Tags to attach to the resource. Array of maps, each of the form <code>string:string (key:value)</code>. See <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/best-practices-and-strats.html">Best practices and strategies</a> in <i>Tagging Amazon Web Services Resources and Tag Editor</i> for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS Chat has no constraints beyond what is documented there.</p>
37    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
38        self.tags.as_ref()
39    }
40    /// <p>Array of logging-configuration identifiers attached to the room.</p>
41    ///
42    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.logging_configuration_identifiers.is_none()`.
43    pub fn logging_configuration_identifiers(&self) -> &[::std::string::String] {
44        self.logging_configuration_identifiers.as_deref().unwrap_or_default()
45    }
46}
47impl CreateRoomInput {
48    /// Creates a new builder-style object to manufacture [`CreateRoomInput`](crate::operation::create_room::CreateRoomInput).
49    pub fn builder() -> crate::operation::create_room::builders::CreateRoomInputBuilder {
50        crate::operation::create_room::builders::CreateRoomInputBuilder::default()
51    }
52}
53
54/// A builder for [`CreateRoomInput`](crate::operation::create_room::CreateRoomInput).
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct CreateRoomInputBuilder {
58    pub(crate) name: ::std::option::Option<::std::string::String>,
59    pub(crate) maximum_message_rate_per_second: ::std::option::Option<i32>,
60    pub(crate) maximum_message_length: ::std::option::Option<i32>,
61    pub(crate) message_review_handler: ::std::option::Option<crate::types::MessageReviewHandler>,
62    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
63    pub(crate) logging_configuration_identifiers: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
64}
65impl CreateRoomInputBuilder {
66    /// <p>Room name. The value does not need to be unique.</p>
67    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        self.name = ::std::option::Option::Some(input.into());
69        self
70    }
71    /// <p>Room name. The value does not need to be unique.</p>
72    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.name = input;
74        self
75    }
76    /// <p>Room name. The value does not need to be unique.</p>
77    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
78        &self.name
79    }
80    /// <p>Maximum number of messages per second that can be sent to the room (by all clients). Default: 10.</p>
81    pub fn maximum_message_rate_per_second(mut self, input: i32) -> Self {
82        self.maximum_message_rate_per_second = ::std::option::Option::Some(input);
83        self
84    }
85    /// <p>Maximum number of messages per second that can be sent to the room (by all clients). Default: 10.</p>
86    pub fn set_maximum_message_rate_per_second(mut self, input: ::std::option::Option<i32>) -> Self {
87        self.maximum_message_rate_per_second = input;
88        self
89    }
90    /// <p>Maximum number of messages per second that can be sent to the room (by all clients). Default: 10.</p>
91    pub fn get_maximum_message_rate_per_second(&self) -> &::std::option::Option<i32> {
92        &self.maximum_message_rate_per_second
93    }
94    /// <p>Maximum number of characters in a single message. Messages are expected to be UTF-8 encoded and this limit applies specifically to rune/code-point count, not number of bytes. Default: 500.</p>
95    pub fn maximum_message_length(mut self, input: i32) -> Self {
96        self.maximum_message_length = ::std::option::Option::Some(input);
97        self
98    }
99    /// <p>Maximum number of characters in a single message. Messages are expected to be UTF-8 encoded and this limit applies specifically to rune/code-point count, not number of bytes. Default: 500.</p>
100    pub fn set_maximum_message_length(mut self, input: ::std::option::Option<i32>) -> Self {
101        self.maximum_message_length = input;
102        self
103    }
104    /// <p>Maximum number of characters in a single message. Messages are expected to be UTF-8 encoded and this limit applies specifically to rune/code-point count, not number of bytes. Default: 500.</p>
105    pub fn get_maximum_message_length(&self) -> &::std::option::Option<i32> {
106        &self.maximum_message_length
107    }
108    /// <p>Configuration information for optional review of messages.</p>
109    pub fn message_review_handler(mut self, input: crate::types::MessageReviewHandler) -> Self {
110        self.message_review_handler = ::std::option::Option::Some(input);
111        self
112    }
113    /// <p>Configuration information for optional review of messages.</p>
114    pub fn set_message_review_handler(mut self, input: ::std::option::Option<crate::types::MessageReviewHandler>) -> Self {
115        self.message_review_handler = input;
116        self
117    }
118    /// <p>Configuration information for optional review of messages.</p>
119    pub fn get_message_review_handler(&self) -> &::std::option::Option<crate::types::MessageReviewHandler> {
120        &self.message_review_handler
121    }
122    /// Adds a key-value pair to `tags`.
123    ///
124    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
125    ///
126    /// <p>Tags to attach to the resource. Array of maps, each of the form <code>string:string (key:value)</code>. See <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/best-practices-and-strats.html">Best practices and strategies</a> in <i>Tagging Amazon Web Services Resources and Tag Editor</i> for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS Chat has no constraints beyond what is documented there.</p>
127    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
128        let mut hash_map = self.tags.unwrap_or_default();
129        hash_map.insert(k.into(), v.into());
130        self.tags = ::std::option::Option::Some(hash_map);
131        self
132    }
133    /// <p>Tags to attach to the resource. Array of maps, each of the form <code>string:string (key:value)</code>. See <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/best-practices-and-strats.html">Best practices and strategies</a> in <i>Tagging Amazon Web Services Resources and Tag Editor</i> for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS Chat has no constraints beyond what is documented there.</p>
134    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
135        self.tags = input;
136        self
137    }
138    /// <p>Tags to attach to the resource. Array of maps, each of the form <code>string:string (key:value)</code>. See <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/best-practices-and-strats.html">Best practices and strategies</a> in <i>Tagging Amazon Web Services Resources and Tag Editor</i> for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS Chat has no constraints beyond what is documented there.</p>
139    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
140        &self.tags
141    }
142    /// Appends an item to `logging_configuration_identifiers`.
143    ///
144    /// To override the contents of this collection use [`set_logging_configuration_identifiers`](Self::set_logging_configuration_identifiers).
145    ///
146    /// <p>Array of logging-configuration identifiers attached to the room.</p>
147    pub fn logging_configuration_identifiers(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        let mut v = self.logging_configuration_identifiers.unwrap_or_default();
149        v.push(input.into());
150        self.logging_configuration_identifiers = ::std::option::Option::Some(v);
151        self
152    }
153    /// <p>Array of logging-configuration identifiers attached to the room.</p>
154    pub fn set_logging_configuration_identifiers(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
155        self.logging_configuration_identifiers = input;
156        self
157    }
158    /// <p>Array of logging-configuration identifiers attached to the room.</p>
159    pub fn get_logging_configuration_identifiers(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
160        &self.logging_configuration_identifiers
161    }
162    /// Consumes the builder and constructs a [`CreateRoomInput`](crate::operation::create_room::CreateRoomInput).
163    pub fn build(self) -> ::std::result::Result<crate::operation::create_room::CreateRoomInput, ::aws_smithy_types::error::operation::BuildError> {
164        ::std::result::Result::Ok(crate::operation::create_room::CreateRoomInput {
165            name: self.name,
166            maximum_message_rate_per_second: self.maximum_message_rate_per_second,
167            maximum_message_length: self.maximum_message_length,
168            message_review_handler: self.message_review_handler,
169            tags: self.tags,
170            logging_configuration_identifiers: self.logging_configuration_identifiers,
171        })
172    }
173}