aws-sdk-bedrockagentruntime 1.126.0

AWS SDK for Agents for Amazon Bedrock Runtime
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Contains the reasoning, based on the input, that the agent uses to justify carrying out an action group or getting information from a knowledge base.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Rationale {
    /// <p>The unique identifier of the trace step.</p>
    pub trace_id: ::std::option::Option<::std::string::String>,
    /// <p>The reasoning or thought process of the agent, based on the input.</p>
    pub text: ::std::option::Option<::std::string::String>,
}
impl Rationale {
    /// <p>The unique identifier of the trace step.</p>
    pub fn trace_id(&self) -> ::std::option::Option<&str> {
        self.trace_id.as_deref()
    }
    /// <p>The reasoning or thought process of the agent, based on the input.</p>
    pub fn text(&self) -> ::std::option::Option<&str> {
        self.text.as_deref()
    }
}
impl ::std::fmt::Debug for Rationale {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("Rationale");
        formatter.field("trace_id", &"*** Sensitive Data Redacted ***");
        formatter.field("text", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}
impl Rationale {
    /// Creates a new builder-style object to manufacture [`Rationale`](crate::types::Rationale).
    pub fn builder() -> crate::types::builders::RationaleBuilder {
        crate::types::builders::RationaleBuilder::default()
    }
}

/// A builder for [`Rationale`](crate::types::Rationale).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct RationaleBuilder {
    pub(crate) trace_id: ::std::option::Option<::std::string::String>,
    pub(crate) text: ::std::option::Option<::std::string::String>,
}
impl RationaleBuilder {
    /// <p>The unique identifier of the trace step.</p>
    pub fn trace_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.trace_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the trace step.</p>
    pub fn set_trace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.trace_id = input;
        self
    }
    /// <p>The unique identifier of the trace step.</p>
    pub fn get_trace_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.trace_id
    }
    /// <p>The reasoning or thought process of the agent, based on the input.</p>
    pub fn text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.text = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The reasoning or thought process of the agent, based on the input.</p>
    pub fn set_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.text = input;
        self
    }
    /// <p>The reasoning or thought process of the agent, based on the input.</p>
    pub fn get_text(&self) -> &::std::option::Option<::std::string::String> {
        &self.text
    }
    /// Consumes the builder and constructs a [`Rationale`](crate::types::Rationale).
    pub fn build(self) -> crate::types::Rationale {
        crate::types::Rationale {
            trace_id: self.trace_id,
            text: self.text,
        }
    }
}
impl ::std::fmt::Debug for RationaleBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("RationaleBuilder");
        formatter.field("trace_id", &"*** Sensitive Data Redacted ***");
        formatter.field("text", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}