aws-sdk-devopsagent 1.10.0

AWS SDK for AWS DevOps Agent Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Request structure for sending a chat message</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct SendMessageInput {
    /// <p>The agent space identifier</p>
    pub agent_space_id: ::std::option::Option<::std::string::String>,
    /// <p>The execution identifier for the chat session</p>
    pub execution_id: ::std::option::Option<::std::string::String>,
    /// <p>The user message content</p>
    pub content: ::std::option::Option<::std::string::String>,
    /// <p>Optional context for the message</p>
    pub context: ::std::option::Option<crate::types::SendMessageContext>,
    /// <p>User identifier. This field is deprecated and will be ignored — the service resolves user identity from the authenticated session.</p>
    #[deprecated(note = "userId is managed by the service and should not be provided by the caller", since = "2026-04-15")]
    pub user_id: ::std::option::Option<::std::string::String>,
    /// <p>Optional list of asset identifiers to attach to the message</p>
    pub asset_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl SendMessageInput {
    /// <p>The agent space identifier</p>
    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
        self.agent_space_id.as_deref()
    }
    /// <p>The execution identifier for the chat session</p>
    pub fn execution_id(&self) -> ::std::option::Option<&str> {
        self.execution_id.as_deref()
    }
    /// <p>The user message content</p>
    pub fn content(&self) -> ::std::option::Option<&str> {
        self.content.as_deref()
    }
    /// <p>Optional context for the message</p>
    pub fn context(&self) -> ::std::option::Option<&crate::types::SendMessageContext> {
        self.context.as_ref()
    }
    /// <p>User identifier. This field is deprecated and will be ignored — the service resolves user identity from the authenticated session.</p>
    #[deprecated(note = "userId is managed by the service and should not be provided by the caller", since = "2026-04-15")]
    pub fn user_id(&self) -> ::std::option::Option<&str> {
        self.user_id.as_deref()
    }
    /// <p>Optional list of asset identifiers to attach to the message</p>
    ///
    /// 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()`.
    pub fn asset_ids(&self) -> &[::std::string::String] {
        self.asset_ids.as_deref().unwrap_or_default()
    }
}
impl SendMessageInput {
    /// Creates a new builder-style object to manufacture [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
    pub fn builder() -> crate::operation::send_message::builders::SendMessageInputBuilder {
        crate::operation::send_message::builders::SendMessageInputBuilder::default()
    }
}

/// A builder for [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SendMessageInputBuilder {
    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
    pub(crate) execution_id: ::std::option::Option<::std::string::String>,
    pub(crate) content: ::std::option::Option<::std::string::String>,
    pub(crate) context: ::std::option::Option<crate::types::SendMessageContext>,
    pub(crate) user_id: ::std::option::Option<::std::string::String>,
    pub(crate) asset_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl SendMessageInputBuilder {
    /// <p>The agent space identifier</p>
    /// This field is required.
    pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.agent_space_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The agent space identifier</p>
    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.agent_space_id = input;
        self
    }
    /// <p>The agent space identifier</p>
    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.agent_space_id
    }
    /// <p>The execution identifier for the chat session</p>
    /// This field is required.
    pub fn execution_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.execution_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The execution identifier for the chat session</p>
    pub fn set_execution_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.execution_id = input;
        self
    }
    /// <p>The execution identifier for the chat session</p>
    pub fn get_execution_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.execution_id
    }
    /// <p>The user message content</p>
    /// This field is required.
    pub fn content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.content = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The user message content</p>
    pub fn set_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.content = input;
        self
    }
    /// <p>The user message content</p>
    pub fn get_content(&self) -> &::std::option::Option<::std::string::String> {
        &self.content
    }
    /// <p>Optional context for the message</p>
    pub fn context(mut self, input: crate::types::SendMessageContext) -> Self {
        self.context = ::std::option::Option::Some(input);
        self
    }
    /// <p>Optional context for the message</p>
    pub fn set_context(mut self, input: ::std::option::Option<crate::types::SendMessageContext>) -> Self {
        self.context = input;
        self
    }
    /// <p>Optional context for the message</p>
    pub fn get_context(&self) -> &::std::option::Option<crate::types::SendMessageContext> {
        &self.context
    }
    /// <p>User identifier. This field is deprecated and will be ignored — the service resolves user identity from the authenticated session.</p>
    #[deprecated(note = "userId is managed by the service and should not be provided by the caller", since = "2026-04-15")]
    pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.user_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>User identifier. This field is deprecated and will be ignored — the service resolves user identity from the authenticated session.</p>
    #[deprecated(note = "userId is managed by the service and should not be provided by the caller", since = "2026-04-15")]
    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.user_id = input;
        self
    }
    /// <p>User identifier. This field is deprecated and will be ignored — the service resolves user identity from the authenticated session.</p>
    #[deprecated(note = "userId is managed by the service and should not be provided by the caller", since = "2026-04-15")]
    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.user_id
    }
    /// Appends an item to `asset_ids`.
    ///
    /// To override the contents of this collection use [`set_asset_ids`](Self::set_asset_ids).
    ///
    /// <p>Optional list of asset identifiers to attach to the message</p>
    pub fn asset_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.asset_ids.unwrap_or_default();
        v.push(input.into());
        self.asset_ids = ::std::option::Option::Some(v);
        self
    }
    /// <p>Optional list of asset identifiers to attach to the message</p>
    pub fn set_asset_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.asset_ids = input;
        self
    }
    /// <p>Optional list of asset identifiers to attach to the message</p>
    pub fn get_asset_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.asset_ids
    }
    /// Consumes the builder and constructs a [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::send_message::SendMessageInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::send_message::SendMessageInput {
            agent_space_id: self.agent_space_id,
            execution_id: self.execution_id,
            content: self.content,
            context: self.context,
            user_id: self.user_id,
            asset_ids: self.asset_ids,
        })
    }
}