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    /// Required user identifier
16    pub user_id: ::std::option::Option<::std::string::String>,
17}
18impl SendMessageInput {
19    /// The agent space identifier
20    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
21        self.agent_space_id.as_deref()
22    }
23    /// The execution identifier for the chat session
24    pub fn execution_id(&self) -> ::std::option::Option<&str> {
25        self.execution_id.as_deref()
26    }
27    /// The user message content
28    pub fn content(&self) -> ::std::option::Option<&str> {
29        self.content.as_deref()
30    }
31    /// Optional context for the message
32    pub fn context(&self) -> ::std::option::Option<&crate::types::SendMessageContext> {
33        self.context.as_ref()
34    }
35    /// Required user identifier
36    pub fn user_id(&self) -> ::std::option::Option<&str> {
37        self.user_id.as_deref()
38    }
39}
40impl SendMessageInput {
41    /// Creates a new builder-style object to manufacture [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
42    pub fn builder() -> crate::operation::send_message::builders::SendMessageInputBuilder {
43        crate::operation::send_message::builders::SendMessageInputBuilder::default()
44    }
45}
46
47/// A builder for [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
48#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
49#[non_exhaustive]
50pub struct SendMessageInputBuilder {
51    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
52    pub(crate) execution_id: ::std::option::Option<::std::string::String>,
53    pub(crate) content: ::std::option::Option<::std::string::String>,
54    pub(crate) context: ::std::option::Option<crate::types::SendMessageContext>,
55    pub(crate) user_id: ::std::option::Option<::std::string::String>,
56}
57impl SendMessageInputBuilder {
58    /// The agent space identifier
59    /// This field is required.
60    pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.agent_space_id = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// The agent space identifier
65    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.agent_space_id = input;
67        self
68    }
69    /// The agent space identifier
70    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
71        &self.agent_space_id
72    }
73    /// The execution identifier for the chat session
74    /// This field is required.
75    pub fn execution_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76        self.execution_id = ::std::option::Option::Some(input.into());
77        self
78    }
79    /// The execution identifier for the chat session
80    pub fn set_execution_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81        self.execution_id = input;
82        self
83    }
84    /// The execution identifier for the chat session
85    pub fn get_execution_id(&self) -> &::std::option::Option<::std::string::String> {
86        &self.execution_id
87    }
88    /// The user message content
89    /// This field is required.
90    pub fn content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.content = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// The user message content
95    pub fn set_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.content = input;
97        self
98    }
99    /// The user message content
100    pub fn get_content(&self) -> &::std::option::Option<::std::string::String> {
101        &self.content
102    }
103    /// Optional context for the message
104    pub fn context(mut self, input: crate::types::SendMessageContext) -> Self {
105        self.context = ::std::option::Option::Some(input);
106        self
107    }
108    /// Optional context for the message
109    pub fn set_context(mut self, input: ::std::option::Option<crate::types::SendMessageContext>) -> Self {
110        self.context = input;
111        self
112    }
113    /// Optional context for the message
114    pub fn get_context(&self) -> &::std::option::Option<crate::types::SendMessageContext> {
115        &self.context
116    }
117    /// Required user identifier
118    /// This field is required.
119    pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.user_id = ::std::option::Option::Some(input.into());
121        self
122    }
123    /// Required user identifier
124    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.user_id = input;
126        self
127    }
128    /// Required user identifier
129    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
130        &self.user_id
131    }
132    /// Consumes the builder and constructs a [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
133    pub fn build(self) -> ::std::result::Result<crate::operation::send_message::SendMessageInput, ::aws_smithy_types::error::operation::BuildError> {
134        ::std::result::Result::Ok(crate::operation::send_message::SendMessageInput {
135            agent_space_id: self.agent_space_id,
136            execution_id: self.execution_id,
137            content: self.content,
138            context: self.context,
139            user_id: self.user_id,
140        })
141    }
142}