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. This field is deprecated and will be ignored — the service resolves user identity from the authenticated session.
10    #[deprecated(note = "userId is managed by the service and should not be provided by the caller", since = "2026-04-15")]
11    pub user_id: ::std::option::Option<::std::string::String>,
12    /// The authentication type of the user
13    pub user_type: ::std::option::Option<crate::types::UserType>,
14}
15impl CreateChatInput {
16    /// Unique identifier for an agent space (allows alphanumeric characters and hyphens; 1-64 characters)
17    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
18        self.agent_space_id.as_deref()
19    }
20    /// The user identifier for the chat. This field is deprecated and will be ignored — the service resolves user identity from the authenticated session.
21    #[deprecated(note = "userId is managed by the service and should not be provided by the caller", since = "2026-04-15")]
22    pub fn user_id(&self) -> ::std::option::Option<&str> {
23        self.user_id.as_deref()
24    }
25    /// The authentication type of the user
26    pub fn user_type(&self) -> ::std::option::Option<&crate::types::UserType> {
27        self.user_type.as_ref()
28    }
29}
30impl CreateChatInput {
31    /// Creates a new builder-style object to manufacture [`CreateChatInput`](crate::operation::create_chat::CreateChatInput).
32    pub fn builder() -> crate::operation::create_chat::builders::CreateChatInputBuilder {
33        crate::operation::create_chat::builders::CreateChatInputBuilder::default()
34    }
35}
36
37/// A builder for [`CreateChatInput`](crate::operation::create_chat::CreateChatInput).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct CreateChatInputBuilder {
41    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
42    pub(crate) user_id: ::std::option::Option<::std::string::String>,
43    pub(crate) user_type: ::std::option::Option<crate::types::UserType>,
44}
45impl CreateChatInputBuilder {
46    /// Unique identifier for an agent space (allows alphanumeric characters and hyphens; 1-64 characters)
47    /// This field is required.
48    pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
49        self.agent_space_id = ::std::option::Option::Some(input.into());
50        self
51    }
52    /// Unique identifier for an agent space (allows alphanumeric characters and hyphens; 1-64 characters)
53    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
54        self.agent_space_id = input;
55        self
56    }
57    /// Unique identifier for an agent space (allows alphanumeric characters and hyphens; 1-64 characters)
58    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
59        &self.agent_space_id
60    }
61    /// The user identifier for the chat. This field is deprecated and will be ignored — the service resolves user identity from the authenticated session.
62    #[deprecated(note = "userId is managed by the service and should not be provided by the caller", since = "2026-04-15")]
63    pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
64        self.user_id = ::std::option::Option::Some(input.into());
65        self
66    }
67    /// The user identifier for the chat. This field is deprecated and will be ignored — the service resolves user identity from the authenticated session.
68    #[deprecated(note = "userId is managed by the service and should not be provided by the caller", since = "2026-04-15")]
69    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
70        self.user_id = input;
71        self
72    }
73    /// The user identifier for the chat. This field is deprecated and will be ignored — the service resolves user identity from the authenticated session.
74    #[deprecated(note = "userId is managed by the service and should not be provided by the caller", since = "2026-04-15")]
75    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
76        &self.user_id
77    }
78    /// The authentication type of the user
79    pub fn user_type(mut self, input: crate::types::UserType) -> Self {
80        self.user_type = ::std::option::Option::Some(input);
81        self
82    }
83    /// The authentication type of the user
84    pub fn set_user_type(mut self, input: ::std::option::Option<crate::types::UserType>) -> Self {
85        self.user_type = input;
86        self
87    }
88    /// The authentication type of the user
89    pub fn get_user_type(&self) -> &::std::option::Option<crate::types::UserType> {
90        &self.user_type
91    }
92    /// Consumes the builder and constructs a [`CreateChatInput`](crate::operation::create_chat::CreateChatInput).
93    pub fn build(self) -> ::std::result::Result<crate::operation::create_chat::CreateChatInput, ::aws_smithy_types::error::operation::BuildError> {
94        ::std::result::Result::Ok(crate::operation::create_chat::CreateChatInput {
95            agent_space_id: self.agent_space_id,
96            user_id: self.user_id,
97            user_type: self.user_type,
98        })
99    }
100}