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