aws-sdk-assurance 1.0.0

AWS SDK for AWS Assurance
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct ChatInput {
    /// <p>The chat message to send to the AWS Assurance agent.</p>
    pub message: ::std::option::Option<::std::string::String>,
    /// <p>The session to continue. Pass the <code>sessionId</code> returned by a previous <code>Chat</code> call to continue that session. If you omit it, AWS Assurance starts a new session. If the session doesn't exist or has expired, the operation returns <code>ResourceNotFoundException</code>. If the format isn't valid, the operation returns <code>ValidationException</code>.</p>
    pub session_id: ::std::option::Option<::std::string::String>,
    /// <p>The ARN of this governance environment.</p>
    pub environment_arn: ::std::option::Option<::std::string::String>,
    /// <p>The sequence number of the last message you received. If the service detects a more recent sequence number, the request fails with <code>ConflictException</code>, indicating a concurrent update.</p>
    pub expected_sequence_number: ::std::option::Option<i64>,
}
impl ChatInput {
    /// <p>The chat message to send to the AWS Assurance agent.</p>
    pub fn message(&self) -> ::std::option::Option<&str> {
        self.message.as_deref()
    }
    /// <p>The session to continue. Pass the <code>sessionId</code> returned by a previous <code>Chat</code> call to continue that session. If you omit it, AWS Assurance starts a new session. If the session doesn't exist or has expired, the operation returns <code>ResourceNotFoundException</code>. If the format isn't valid, the operation returns <code>ValidationException</code>.</p>
    pub fn session_id(&self) -> ::std::option::Option<&str> {
        self.session_id.as_deref()
    }
    /// <p>The ARN of this governance environment.</p>
    pub fn environment_arn(&self) -> ::std::option::Option<&str> {
        self.environment_arn.as_deref()
    }
    /// <p>The sequence number of the last message you received. If the service detects a more recent sequence number, the request fails with <code>ConflictException</code>, indicating a concurrent update.</p>
    pub fn expected_sequence_number(&self) -> ::std::option::Option<i64> {
        self.expected_sequence_number
    }
}
impl ::std::fmt::Debug for ChatInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("ChatInput");
        formatter.field("message", &"*** Sensitive Data Redacted ***");
        formatter.field("session_id", &self.session_id);
        formatter.field("environment_arn", &self.environment_arn);
        formatter.field("expected_sequence_number", &self.expected_sequence_number);
        formatter.finish()
    }
}
impl ChatInput {
    /// Creates a new builder-style object to manufacture [`ChatInput`](crate::operation::chat::ChatInput).
    pub fn builder() -> crate::operation::chat::builders::ChatInputBuilder {
        crate::operation::chat::builders::ChatInputBuilder::default()
    }
}

/// A builder for [`ChatInput`](crate::operation::chat::ChatInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct ChatInputBuilder {
    pub(crate) message: ::std::option::Option<::std::string::String>,
    pub(crate) session_id: ::std::option::Option<::std::string::String>,
    pub(crate) environment_arn: ::std::option::Option<::std::string::String>,
    pub(crate) expected_sequence_number: ::std::option::Option<i64>,
}
impl ChatInputBuilder {
    /// <p>The chat message to send to the AWS Assurance agent.</p>
    /// This field is required.
    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.message = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The chat message to send to the AWS Assurance agent.</p>
    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.message = input;
        self
    }
    /// <p>The chat message to send to the AWS Assurance agent.</p>
    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
        &self.message
    }
    /// <p>The session to continue. Pass the <code>sessionId</code> returned by a previous <code>Chat</code> call to continue that session. If you omit it, AWS Assurance starts a new session. If the session doesn't exist or has expired, the operation returns <code>ResourceNotFoundException</code>. If the format isn't valid, the operation returns <code>ValidationException</code>.</p>
    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.session_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The session to continue. Pass the <code>sessionId</code> returned by a previous <code>Chat</code> call to continue that session. If you omit it, AWS Assurance starts a new session. If the session doesn't exist or has expired, the operation returns <code>ResourceNotFoundException</code>. If the format isn't valid, the operation returns <code>ValidationException</code>.</p>
    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.session_id = input;
        self
    }
    /// <p>The session to continue. Pass the <code>sessionId</code> returned by a previous <code>Chat</code> call to continue that session. If you omit it, AWS Assurance starts a new session. If the session doesn't exist or has expired, the operation returns <code>ResourceNotFoundException</code>. If the format isn't valid, the operation returns <code>ValidationException</code>.</p>
    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.session_id
    }
    /// <p>The ARN of this governance environment.</p>
    /// This field is required.
    pub fn environment_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.environment_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of this governance environment.</p>
    pub fn set_environment_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.environment_arn = input;
        self
    }
    /// <p>The ARN of this governance environment.</p>
    pub fn get_environment_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment_arn
    }
    /// <p>The sequence number of the last message you received. If the service detects a more recent sequence number, the request fails with <code>ConflictException</code>, indicating a concurrent update.</p>
    pub fn expected_sequence_number(mut self, input: i64) -> Self {
        self.expected_sequence_number = ::std::option::Option::Some(input);
        self
    }
    /// <p>The sequence number of the last message you received. If the service detects a more recent sequence number, the request fails with <code>ConflictException</code>, indicating a concurrent update.</p>
    pub fn set_expected_sequence_number(mut self, input: ::std::option::Option<i64>) -> Self {
        self.expected_sequence_number = input;
        self
    }
    /// <p>The sequence number of the last message you received. If the service detects a more recent sequence number, the request fails with <code>ConflictException</code>, indicating a concurrent update.</p>
    pub fn get_expected_sequence_number(&self) -> &::std::option::Option<i64> {
        &self.expected_sequence_number
    }
    /// Consumes the builder and constructs a [`ChatInput`](crate::operation::chat::ChatInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::chat::ChatInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::chat::ChatInput {
            message: self.message,
            session_id: self.session_id,
            environment_arn: self.environment_arn,
            expected_sequence_number: self.expected_sequence_number,
        })
    }
}
impl ::std::fmt::Debug for ChatInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("ChatInputBuilder");
        formatter.field("message", &"*** Sensitive Data Redacted ***");
        formatter.field("session_id", &self.session_id);
        formatter.field("environment_arn", &self.environment_arn);
        formatter.field("expected_sequence_number", &self.expected_sequence_number);
        formatter.finish()
    }
}