aws_sdk_wickr/operation/create_bot/
_create_bot_output.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 CreateBotOutput {
6    /// <p>A message indicating the result of the bot creation operation.</p>
7    pub message: ::std::option::Option<::std::string::String>,
8    /// <p>The unique identifier assigned to the newly created bot.</p>
9    pub bot_id: ::std::string::String,
10    /// <p>The ID of the network where the bot was created.</p>
11    pub network_id: ::std::option::Option<::std::string::String>,
12    /// <p>The username of the newly created bot.</p>
13    pub username: ::std::option::Option<::std::string::String>,
14    /// <p>The display name of the newly created bot.</p>
15    pub display_name: ::std::option::Option<::std::string::String>,
16    /// <p>The ID of the security group to which the bot was assigned.</p>
17    pub group_id: ::std::option::Option<::std::string::String>,
18    _request_id: Option<String>,
19}
20impl CreateBotOutput {
21    /// <p>A message indicating the result of the bot creation operation.</p>
22    pub fn message(&self) -> ::std::option::Option<&str> {
23        self.message.as_deref()
24    }
25    /// <p>The unique identifier assigned to the newly created bot.</p>
26    pub fn bot_id(&self) -> &str {
27        use std::ops::Deref;
28        self.bot_id.deref()
29    }
30    /// <p>The ID of the network where the bot was created.</p>
31    pub fn network_id(&self) -> ::std::option::Option<&str> {
32        self.network_id.as_deref()
33    }
34    /// <p>The username of the newly created bot.</p>
35    pub fn username(&self) -> ::std::option::Option<&str> {
36        self.username.as_deref()
37    }
38    /// <p>The display name of the newly created bot.</p>
39    pub fn display_name(&self) -> ::std::option::Option<&str> {
40        self.display_name.as_deref()
41    }
42    /// <p>The ID of the security group to which the bot was assigned.</p>
43    pub fn group_id(&self) -> ::std::option::Option<&str> {
44        self.group_id.as_deref()
45    }
46}
47impl ::aws_types::request_id::RequestId for CreateBotOutput {
48    fn request_id(&self) -> Option<&str> {
49        self._request_id.as_deref()
50    }
51}
52impl CreateBotOutput {
53    /// Creates a new builder-style object to manufacture [`CreateBotOutput`](crate::operation::create_bot::CreateBotOutput).
54    pub fn builder() -> crate::operation::create_bot::builders::CreateBotOutputBuilder {
55        crate::operation::create_bot::builders::CreateBotOutputBuilder::default()
56    }
57}
58
59/// A builder for [`CreateBotOutput`](crate::operation::create_bot::CreateBotOutput).
60#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
61#[non_exhaustive]
62pub struct CreateBotOutputBuilder {
63    pub(crate) message: ::std::option::Option<::std::string::String>,
64    pub(crate) bot_id: ::std::option::Option<::std::string::String>,
65    pub(crate) network_id: ::std::option::Option<::std::string::String>,
66    pub(crate) username: ::std::option::Option<::std::string::String>,
67    pub(crate) display_name: ::std::option::Option<::std::string::String>,
68    pub(crate) group_id: ::std::option::Option<::std::string::String>,
69    _request_id: Option<String>,
70}
71impl CreateBotOutputBuilder {
72    /// <p>A message indicating the result of the bot creation operation.</p>
73    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74        self.message = ::std::option::Option::Some(input.into());
75        self
76    }
77    /// <p>A message indicating the result of the bot creation operation.</p>
78    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79        self.message = input;
80        self
81    }
82    /// <p>A message indicating the result of the bot creation operation.</p>
83    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
84        &self.message
85    }
86    /// <p>The unique identifier assigned to the newly created bot.</p>
87    /// This field is required.
88    pub fn bot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.bot_id = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>The unique identifier assigned to the newly created bot.</p>
93    pub fn set_bot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.bot_id = input;
95        self
96    }
97    /// <p>The unique identifier assigned to the newly created bot.</p>
98    pub fn get_bot_id(&self) -> &::std::option::Option<::std::string::String> {
99        &self.bot_id
100    }
101    /// <p>The ID of the network where the bot was created.</p>
102    pub fn network_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103        self.network_id = ::std::option::Option::Some(input.into());
104        self
105    }
106    /// <p>The ID of the network where the bot was created.</p>
107    pub fn set_network_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108        self.network_id = input;
109        self
110    }
111    /// <p>The ID of the network where the bot was created.</p>
112    pub fn get_network_id(&self) -> &::std::option::Option<::std::string::String> {
113        &self.network_id
114    }
115    /// <p>The username of the newly created bot.</p>
116    pub fn username(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        self.username = ::std::option::Option::Some(input.into());
118        self
119    }
120    /// <p>The username of the newly created bot.</p>
121    pub fn set_username(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.username = input;
123        self
124    }
125    /// <p>The username of the newly created bot.</p>
126    pub fn get_username(&self) -> &::std::option::Option<::std::string::String> {
127        &self.username
128    }
129    /// <p>The display name of the newly created bot.</p>
130    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.display_name = ::std::option::Option::Some(input.into());
132        self
133    }
134    /// <p>The display name of the newly created bot.</p>
135    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.display_name = input;
137        self
138    }
139    /// <p>The display name of the newly created bot.</p>
140    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
141        &self.display_name
142    }
143    /// <p>The ID of the security group to which the bot was assigned.</p>
144    pub fn group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.group_id = ::std::option::Option::Some(input.into());
146        self
147    }
148    /// <p>The ID of the security group to which the bot was assigned.</p>
149    pub fn set_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.group_id = input;
151        self
152    }
153    /// <p>The ID of the security group to which the bot was assigned.</p>
154    pub fn get_group_id(&self) -> &::std::option::Option<::std::string::String> {
155        &self.group_id
156    }
157    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
158        self._request_id = Some(request_id.into());
159        self
160    }
161
162    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
163        self._request_id = request_id;
164        self
165    }
166    /// Consumes the builder and constructs a [`CreateBotOutput`](crate::operation::create_bot::CreateBotOutput).
167    /// This method will fail if any of the following fields are not set:
168    /// - [`bot_id`](crate::operation::create_bot::builders::CreateBotOutputBuilder::bot_id)
169    pub fn build(self) -> ::std::result::Result<crate::operation::create_bot::CreateBotOutput, ::aws_smithy_types::error::operation::BuildError> {
170        ::std::result::Result::Ok(crate::operation::create_bot::CreateBotOutput {
171            message: self.message,
172            bot_id: self.bot_id.ok_or_else(|| {
173                ::aws_smithy_types::error::operation::BuildError::missing_field(
174                    "bot_id",
175                    "bot_id was not specified but it is required when building CreateBotOutput",
176                )
177            })?,
178            network_id: self.network_id,
179            username: self.username,
180            display_name: self.display_name,
181            group_id: self.group_id,
182            _request_id: self._request_id,
183        })
184    }
185}