Skip to main content

aws_sdk_devopsagent/operation/send_message/
_send_message_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// Request structure for sending a chat message
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct SendMessageInput {
7    /// The agent space identifier
8    pub agent_space_id: ::std::option::Option<::std::string::String>,
9    /// The execution identifier for the chat session
10    pub execution_id: ::std::option::Option<::std::string::String>,
11    /// The user message content
12    pub content: ::std::option::Option<::std::string::String>,
13    /// Optional context for the message
14    pub context: ::std::option::Option<crate::types::SendMessageContext>,
15    /// User identifier. This field is deprecated and will be ignored — the service resolves user identity from the authenticated session.
16    #[deprecated(note = "userId is managed by the service and should not be provided by the caller", since = "2026-04-15")]
17    pub user_id: ::std::option::Option<::std::string::String>,
18}
19impl SendMessageInput {
20    /// The agent space identifier
21    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
22        self.agent_space_id.as_deref()
23    }
24    /// The execution identifier for the chat session
25    pub fn execution_id(&self) -> ::std::option::Option<&str> {
26        self.execution_id.as_deref()
27    }
28    /// The user message content
29    pub fn content(&self) -> ::std::option::Option<&str> {
30        self.content.as_deref()
31    }
32    /// Optional context for the message
33    pub fn context(&self) -> ::std::option::Option<&crate::types::SendMessageContext> {
34        self.context.as_ref()
35    }
36    /// User identifier. This field is deprecated and will be ignored — the service resolves user identity from the authenticated session.
37    #[deprecated(note = "userId is managed by the service and should not be provided by the caller", since = "2026-04-15")]
38    pub fn user_id(&self) -> ::std::option::Option<&str> {
39        self.user_id.as_deref()
40    }
41}
42impl SendMessageInput {
43    /// Creates a new builder-style object to manufacture [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
44    pub fn builder() -> crate::operation::send_message::builders::SendMessageInputBuilder {
45        crate::operation::send_message::builders::SendMessageInputBuilder::default()
46    }
47}
48
49/// A builder for [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
50#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
51#[non_exhaustive]
52pub struct SendMessageInputBuilder {
53    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
54    pub(crate) execution_id: ::std::option::Option<::std::string::String>,
55    pub(crate) content: ::std::option::Option<::std::string::String>,
56    pub(crate) context: ::std::option::Option<crate::types::SendMessageContext>,
57    pub(crate) user_id: ::std::option::Option<::std::string::String>,
58}
59impl SendMessageInputBuilder {
60    /// The agent space identifier
61    /// This field is required.
62    pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
63        self.agent_space_id = ::std::option::Option::Some(input.into());
64        self
65    }
66    /// The agent space identifier
67    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68        self.agent_space_id = input;
69        self
70    }
71    /// The agent space identifier
72    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
73        &self.agent_space_id
74    }
75    /// The execution identifier for the chat session
76    /// This field is required.
77    pub fn execution_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78        self.execution_id = ::std::option::Option::Some(input.into());
79        self
80    }
81    /// The execution identifier for the chat session
82    pub fn set_execution_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83        self.execution_id = input;
84        self
85    }
86    /// The execution identifier for the chat session
87    pub fn get_execution_id(&self) -> &::std::option::Option<::std::string::String> {
88        &self.execution_id
89    }
90    /// The user message content
91    /// This field is required.
92    pub fn content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
93        self.content = ::std::option::Option::Some(input.into());
94        self
95    }
96    /// The user message content
97    pub fn set_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
98        self.content = input;
99        self
100    }
101    /// The user message content
102    pub fn get_content(&self) -> &::std::option::Option<::std::string::String> {
103        &self.content
104    }
105    /// Optional context for the message
106    pub fn context(mut self, input: crate::types::SendMessageContext) -> Self {
107        self.context = ::std::option::Option::Some(input);
108        self
109    }
110    /// Optional context for the message
111    pub fn set_context(mut self, input: ::std::option::Option<crate::types::SendMessageContext>) -> Self {
112        self.context = input;
113        self
114    }
115    /// Optional context for the message
116    pub fn get_context(&self) -> &::std::option::Option<crate::types::SendMessageContext> {
117        &self.context
118    }
119    /// User identifier. This field is deprecated and will be ignored — the service resolves user identity from the authenticated session.
120    #[deprecated(note = "userId is managed by the service and should not be provided by the caller", since = "2026-04-15")]
121    pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.user_id = ::std::option::Option::Some(input.into());
123        self
124    }
125    /// User identifier. This field is deprecated and will be ignored — the service resolves user identity from the authenticated session.
126    #[deprecated(note = "userId is managed by the service and should not be provided by the caller", since = "2026-04-15")]
127    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128        self.user_id = input;
129        self
130    }
131    /// User identifier. This field is deprecated and will be ignored — the service resolves user identity from the authenticated session.
132    #[deprecated(note = "userId is managed by the service and should not be provided by the caller", since = "2026-04-15")]
133    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
134        &self.user_id
135    }
136    /// Consumes the builder and constructs a [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
137    pub fn build(self) -> ::std::result::Result<crate::operation::send_message::SendMessageInput, ::aws_smithy_types::error::operation::BuildError> {
138        ::std::result::Result::Ok(crate::operation::send_message::SendMessageInput {
139            agent_space_id: self.agent_space_id,
140            execution_id: self.execution_id,
141            content: self.content,
142            context: self.context,
143            user_id: self.user_id,
144        })
145    }
146}