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/// <p>Request structure for sending a chat message</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct SendMessageInput {
7    /// <p>The agent space identifier</p>
8    pub agent_space_id: ::std::option::Option<::std::string::String>,
9    /// <p>The execution identifier for the chat session</p>
10    pub execution_id: ::std::option::Option<::std::string::String>,
11    /// <p>The user message content</p>
12    pub content: ::std::option::Option<::std::string::String>,
13    /// <p>Optional context for the message</p>
14    pub context: ::std::option::Option<crate::types::SendMessageContext>,
15    /// <p>User identifier. This field is deprecated and will be ignored — the service resolves user identity from the authenticated session.</p>
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    /// <p>Optional list of asset identifiers to attach to the message</p>
19    pub asset_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
20}
21impl SendMessageInput {
22    /// <p>The agent space identifier</p>
23    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
24        self.agent_space_id.as_deref()
25    }
26    /// <p>The execution identifier for the chat session</p>
27    pub fn execution_id(&self) -> ::std::option::Option<&str> {
28        self.execution_id.as_deref()
29    }
30    /// <p>The user message content</p>
31    pub fn content(&self) -> ::std::option::Option<&str> {
32        self.content.as_deref()
33    }
34    /// <p>Optional context for the message</p>
35    pub fn context(&self) -> ::std::option::Option<&crate::types::SendMessageContext> {
36        self.context.as_ref()
37    }
38    /// <p>User identifier. This field is deprecated and will be ignored — the service resolves user identity from the authenticated session.</p>
39    #[deprecated(note = "userId is managed by the service and should not be provided by the caller", since = "2026-04-15")]
40    pub fn user_id(&self) -> ::std::option::Option<&str> {
41        self.user_id.as_deref()
42    }
43    /// <p>Optional list of asset identifiers to attach to the message</p>
44    ///
45    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.asset_ids.is_none()`.
46    pub fn asset_ids(&self) -> &[::std::string::String] {
47        self.asset_ids.as_deref().unwrap_or_default()
48    }
49}
50impl SendMessageInput {
51    /// Creates a new builder-style object to manufacture [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
52    pub fn builder() -> crate::operation::send_message::builders::SendMessageInputBuilder {
53        crate::operation::send_message::builders::SendMessageInputBuilder::default()
54    }
55}
56
57/// A builder for [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
58#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
59#[non_exhaustive]
60pub struct SendMessageInputBuilder {
61    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
62    pub(crate) execution_id: ::std::option::Option<::std::string::String>,
63    pub(crate) content: ::std::option::Option<::std::string::String>,
64    pub(crate) context: ::std::option::Option<crate::types::SendMessageContext>,
65    pub(crate) user_id: ::std::option::Option<::std::string::String>,
66    pub(crate) asset_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
67}
68impl SendMessageInputBuilder {
69    /// <p>The agent space identifier</p>
70    /// This field is required.
71    pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
72        self.agent_space_id = ::std::option::Option::Some(input.into());
73        self
74    }
75    /// <p>The agent space identifier</p>
76    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
77        self.agent_space_id = input;
78        self
79    }
80    /// <p>The agent space identifier</p>
81    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
82        &self.agent_space_id
83    }
84    /// <p>The execution identifier for the chat session</p>
85    /// This field is required.
86    pub fn execution_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87        self.execution_id = ::std::option::Option::Some(input.into());
88        self
89    }
90    /// <p>The execution identifier for the chat session</p>
91    pub fn set_execution_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92        self.execution_id = input;
93        self
94    }
95    /// <p>The execution identifier for the chat session</p>
96    pub fn get_execution_id(&self) -> &::std::option::Option<::std::string::String> {
97        &self.execution_id
98    }
99    /// <p>The user message content</p>
100    /// This field is required.
101    pub fn content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
102        self.content = ::std::option::Option::Some(input.into());
103        self
104    }
105    /// <p>The user message content</p>
106    pub fn set_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
107        self.content = input;
108        self
109    }
110    /// <p>The user message content</p>
111    pub fn get_content(&self) -> &::std::option::Option<::std::string::String> {
112        &self.content
113    }
114    /// <p>Optional context for the message</p>
115    pub fn context(mut self, input: crate::types::SendMessageContext) -> Self {
116        self.context = ::std::option::Option::Some(input);
117        self
118    }
119    /// <p>Optional context for the message</p>
120    pub fn set_context(mut self, input: ::std::option::Option<crate::types::SendMessageContext>) -> Self {
121        self.context = input;
122        self
123    }
124    /// <p>Optional context for the message</p>
125    pub fn get_context(&self) -> &::std::option::Option<crate::types::SendMessageContext> {
126        &self.context
127    }
128    /// <p>User identifier. This field is deprecated and will be ignored — the service resolves user identity from the authenticated session.</p>
129    #[deprecated(note = "userId is managed by the service and should not be provided by the caller", since = "2026-04-15")]
130    pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.user_id = ::std::option::Option::Some(input.into());
132        self
133    }
134    /// <p>User identifier. This field is deprecated and will be ignored — the service resolves user identity from the authenticated session.</p>
135    #[deprecated(note = "userId is managed by the service and should not be provided by the caller", since = "2026-04-15")]
136    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.user_id = input;
138        self
139    }
140    /// <p>User identifier. This field is deprecated and will be ignored — the service resolves user identity from the authenticated session.</p>
141    #[deprecated(note = "userId is managed by the service and should not be provided by the caller", since = "2026-04-15")]
142    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
143        &self.user_id
144    }
145    /// Appends an item to `asset_ids`.
146    ///
147    /// To override the contents of this collection use [`set_asset_ids`](Self::set_asset_ids).
148    ///
149    /// <p>Optional list of asset identifiers to attach to the message</p>
150    pub fn asset_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151        let mut v = self.asset_ids.unwrap_or_default();
152        v.push(input.into());
153        self.asset_ids = ::std::option::Option::Some(v);
154        self
155    }
156    /// <p>Optional list of asset identifiers to attach to the message</p>
157    pub fn set_asset_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
158        self.asset_ids = input;
159        self
160    }
161    /// <p>Optional list of asset identifiers to attach to the message</p>
162    pub fn get_asset_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
163        &self.asset_ids
164    }
165    /// Consumes the builder and constructs a [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
166    pub fn build(self) -> ::std::result::Result<crate::operation::send_message::SendMessageInput, ::aws_smithy_types::error::operation::BuildError> {
167        ::std::result::Result::Ok(crate::operation::send_message::SendMessageInput {
168            agent_space_id: self.agent_space_id,
169            execution_id: self.execution_id,
170            content: self.content,
171            context: self.context,
172            user_id: self.user_id,
173            asset_ids: self.asset_ids,
174        })
175    }
176}