Skip to main content

aws_sdk_devopsagent/operation/create_chat/
_create_chat_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// Request structure for creating a new chat
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateChatInput {
7    /// Unique identifier for an agent space (allows alphanumeric characters and hyphens; 1-64 characters)
8    pub agent_space_id: ::std::option::Option<::std::string::String>,
9    /// The user identifier for the chat
10    pub user_id: ::std::option::Option<::std::string::String>,
11    /// The authentication type of the user
12    pub user_type: ::std::option::Option<crate::types::UserType>,
13}
14impl CreateChatInput {
15    /// Unique identifier for an agent space (allows alphanumeric characters and hyphens; 1-64 characters)
16    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
17        self.agent_space_id.as_deref()
18    }
19    /// The user identifier for the chat
20    pub fn user_id(&self) -> ::std::option::Option<&str> {
21        self.user_id.as_deref()
22    }
23    /// The authentication type of the user
24    pub fn user_type(&self) -> ::std::option::Option<&crate::types::UserType> {
25        self.user_type.as_ref()
26    }
27}
28impl CreateChatInput {
29    /// Creates a new builder-style object to manufacture [`CreateChatInput`](crate::operation::create_chat::CreateChatInput).
30    pub fn builder() -> crate::operation::create_chat::builders::CreateChatInputBuilder {
31        crate::operation::create_chat::builders::CreateChatInputBuilder::default()
32    }
33}
34
35/// A builder for [`CreateChatInput`](crate::operation::create_chat::CreateChatInput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct CreateChatInputBuilder {
39    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
40    pub(crate) user_id: ::std::option::Option<::std::string::String>,
41    pub(crate) user_type: ::std::option::Option<crate::types::UserType>,
42}
43impl CreateChatInputBuilder {
44    /// Unique identifier for an agent space (allows alphanumeric characters and hyphens; 1-64 characters)
45    /// This field is required.
46    pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.agent_space_id = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// Unique identifier for an agent space (allows alphanumeric characters and hyphens; 1-64 characters)
51    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.agent_space_id = input;
53        self
54    }
55    /// Unique identifier for an agent space (allows alphanumeric characters and hyphens; 1-64 characters)
56    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
57        &self.agent_space_id
58    }
59    /// The user identifier for the chat
60    /// This field is required.
61    pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.user_id = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// The user identifier for the chat
66    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.user_id = input;
68        self
69    }
70    /// The user identifier for the chat
71    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
72        &self.user_id
73    }
74    /// The authentication type of the user
75    pub fn user_type(mut self, input: crate::types::UserType) -> Self {
76        self.user_type = ::std::option::Option::Some(input);
77        self
78    }
79    /// The authentication type of the user
80    pub fn set_user_type(mut self, input: ::std::option::Option<crate::types::UserType>) -> Self {
81        self.user_type = input;
82        self
83    }
84    /// The authentication type of the user
85    pub fn get_user_type(&self) -> &::std::option::Option<crate::types::UserType> {
86        &self.user_type
87    }
88    /// Consumes the builder and constructs a [`CreateChatInput`](crate::operation::create_chat::CreateChatInput).
89    pub fn build(self) -> ::std::result::Result<crate::operation::create_chat::CreateChatInput, ::aws_smithy_types::error::operation::BuildError> {
90        ::std::result::Result::Ok(crate::operation::create_chat::CreateChatInput {
91            agent_space_id: self.agent_space_id,
92            user_id: self.user_id,
93            user_type: self.user_type,
94        })
95    }
96}