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>Provides information about the execution process for different types of invocations, such as model invocation, knowledge base invocation, agent collaborator invocation, guardrail invocation, and code interpreter Invocation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Metadata {
    /// <p>In the final response, <code>startTime</code> is the start time of the agent invocation operation.</p>
    pub start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>In the final response, <code>endTime</code> is the end time of the agent invocation operation.</p>
    pub end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The total execution time for the specific invocation being processed (model, knowledge base, guardrail, agent collaborator, or code interpreter). It represents how long the individual invocation took.</p>
    pub total_time_ms: ::std::option::Option<i64>,
    /// <p>The total time it took for the agent to complete execution. This field is only set for the final response.</p>
    pub operation_total_time_ms: ::std::option::Option<i64>,
    /// <p>A unique identifier associated with the downstream invocation. This ID can be used for tracing, debugging, and identifying specific invocations in customer logs or systems.</p>
    pub client_request_id: ::std::option::Option<::std::string::String>,
    /// <p>Specific to model invocation and contains details about the usage of a foundation model.</p>
    pub usage: ::std::option::Option<crate::types::Usage>,
}
impl Metadata {
    /// <p>In the final response, <code>startTime</code> is the start time of the agent invocation operation.</p>
    pub fn start_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.start_time.as_ref()
    }
    /// <p>In the final response, <code>endTime</code> is the end time of the agent invocation operation.</p>
    pub fn end_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.end_time.as_ref()
    }
    /// <p>The total execution time for the specific invocation being processed (model, knowledge base, guardrail, agent collaborator, or code interpreter). It represents how long the individual invocation took.</p>
    pub fn total_time_ms(&self) -> ::std::option::Option<i64> {
        self.total_time_ms
    }
    /// <p>The total time it took for the agent to complete execution. This field is only set for the final response.</p>
    pub fn operation_total_time_ms(&self) -> ::std::option::Option<i64> {
        self.operation_total_time_ms
    }
    /// <p>A unique identifier associated with the downstream invocation. This ID can be used for tracing, debugging, and identifying specific invocations in customer logs or systems.</p>
    pub fn client_request_id(&self) -> ::std::option::Option<&str> {
        self.client_request_id.as_deref()
    }
    /// <p>Specific to model invocation and contains details about the usage of a foundation model.</p>
    pub fn usage(&self) -> ::std::option::Option<&crate::types::Usage> {
        self.usage.as_ref()
    }
}
impl ::std::fmt::Debug for Metadata {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("Metadata");
        formatter.field("start_time", &"*** Sensitive Data Redacted ***");
        formatter.field("end_time", &"*** Sensitive Data Redacted ***");
        formatter.field("total_time_ms", &"*** Sensitive Data Redacted ***");
        formatter.field("operation_total_time_ms", &"*** Sensitive Data Redacted ***");
        formatter.field("client_request_id", &"*** Sensitive Data Redacted ***");
        formatter.field("usage", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}
impl Metadata {
    /// Creates a new builder-style object to manufacture [`Metadata`](crate::types::Metadata).
    pub fn builder() -> crate::types::builders::MetadataBuilder {
        crate::types::builders::MetadataBuilder::default()
    }
}

/// A builder for [`Metadata`](crate::types::Metadata).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct MetadataBuilder {
    pub(crate) start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) total_time_ms: ::std::option::Option<i64>,
    pub(crate) operation_total_time_ms: ::std::option::Option<i64>,
    pub(crate) client_request_id: ::std::option::Option<::std::string::String>,
    pub(crate) usage: ::std::option::Option<crate::types::Usage>,
}
impl MetadataBuilder {
    /// <p>In the final response, <code>startTime</code> is the start time of the agent invocation operation.</p>
    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.start_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>In the final response, <code>startTime</code> is the start time of the agent invocation operation.</p>
    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.start_time = input;
        self
    }
    /// <p>In the final response, <code>startTime</code> is the start time of the agent invocation operation.</p>
    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.start_time
    }
    /// <p>In the final response, <code>endTime</code> is the end time of the agent invocation operation.</p>
    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.end_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>In the final response, <code>endTime</code> is the end time of the agent invocation operation.</p>
    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.end_time = input;
        self
    }
    /// <p>In the final response, <code>endTime</code> is the end time of the agent invocation operation.</p>
    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.end_time
    }
    /// <p>The total execution time for the specific invocation being processed (model, knowledge base, guardrail, agent collaborator, or code interpreter). It represents how long the individual invocation took.</p>
    pub fn total_time_ms(mut self, input: i64) -> Self {
        self.total_time_ms = ::std::option::Option::Some(input);
        self
    }
    /// <p>The total execution time for the specific invocation being processed (model, knowledge base, guardrail, agent collaborator, or code interpreter). It represents how long the individual invocation took.</p>
    pub fn set_total_time_ms(mut self, input: ::std::option::Option<i64>) -> Self {
        self.total_time_ms = input;
        self
    }
    /// <p>The total execution time for the specific invocation being processed (model, knowledge base, guardrail, agent collaborator, or code interpreter). It represents how long the individual invocation took.</p>
    pub fn get_total_time_ms(&self) -> &::std::option::Option<i64> {
        &self.total_time_ms
    }
    /// <p>The total time it took for the agent to complete execution. This field is only set for the final response.</p>
    pub fn operation_total_time_ms(mut self, input: i64) -> Self {
        self.operation_total_time_ms = ::std::option::Option::Some(input);
        self
    }
    /// <p>The total time it took for the agent to complete execution. This field is only set for the final response.</p>
    pub fn set_operation_total_time_ms(mut self, input: ::std::option::Option<i64>) -> Self {
        self.operation_total_time_ms = input;
        self
    }
    /// <p>The total time it took for the agent to complete execution. This field is only set for the final response.</p>
    pub fn get_operation_total_time_ms(&self) -> &::std::option::Option<i64> {
        &self.operation_total_time_ms
    }
    /// <p>A unique identifier associated with the downstream invocation. This ID can be used for tracing, debugging, and identifying specific invocations in customer logs or systems.</p>
    pub fn client_request_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_request_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique identifier associated with the downstream invocation. This ID can be used for tracing, debugging, and identifying specific invocations in customer logs or systems.</p>
    pub fn set_client_request_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_request_id = input;
        self
    }
    /// <p>A unique identifier associated with the downstream invocation. This ID can be used for tracing, debugging, and identifying specific invocations in customer logs or systems.</p>
    pub fn get_client_request_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_request_id
    }
    /// <p>Specific to model invocation and contains details about the usage of a foundation model.</p>
    pub fn usage(mut self, input: crate::types::Usage) -> Self {
        self.usage = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specific to model invocation and contains details about the usage of a foundation model.</p>
    pub fn set_usage(mut self, input: ::std::option::Option<crate::types::Usage>) -> Self {
        self.usage = input;
        self
    }
    /// <p>Specific to model invocation and contains details about the usage of a foundation model.</p>
    pub fn get_usage(&self) -> &::std::option::Option<crate::types::Usage> {
        &self.usage
    }
    /// Consumes the builder and constructs a [`Metadata`](crate::types::Metadata).
    pub fn build(self) -> crate::types::Metadata {
        crate::types::Metadata {
            start_time: self.start_time,
            end_time: self.end_time,
            total_time_ms: self.total_time_ms,
            operation_total_time_ms: self.operation_total_time_ms,
            client_request_id: self.client_request_id,
            usage: self.usage,
        }
    }
}
impl ::std::fmt::Debug for MetadataBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("MetadataBuilder");
        formatter.field("start_time", &"*** Sensitive Data Redacted ***");
        formatter.field("end_time", &"*** Sensitive Data Redacted ***");
        formatter.field("total_time_ms", &"*** Sensitive Data Redacted ***");
        formatter.field("operation_total_time_ms", &"*** Sensitive Data Redacted ***");
        formatter.field("client_request_id", &"*** Sensitive Data Redacted ***");
        formatter.field("usage", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}