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 information of the usage of the foundation model.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Usage {
    /// <p>Contains information about the input tokens from the foundation model usage.</p>
    pub input_tokens: ::std::option::Option<i32>,
    /// <p>Contains information about the output tokens from the foundation model usage.</p>
    pub output_tokens: ::std::option::Option<i32>,
}
impl Usage {
    /// <p>Contains information about the input tokens from the foundation model usage.</p>
    pub fn input_tokens(&self) -> ::std::option::Option<i32> {
        self.input_tokens
    }
    /// <p>Contains information about the output tokens from the foundation model usage.</p>
    pub fn output_tokens(&self) -> ::std::option::Option<i32> {
        self.output_tokens
    }
}
impl ::std::fmt::Debug for Usage {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("Usage");
        formatter.field("input_tokens", &"*** Sensitive Data Redacted ***");
        formatter.field("output_tokens", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}
impl Usage {
    /// Creates a new builder-style object to manufacture [`Usage`](crate::types::Usage).
    pub fn builder() -> crate::types::builders::UsageBuilder {
        crate::types::builders::UsageBuilder::default()
    }
}

/// A builder for [`Usage`](crate::types::Usage).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct UsageBuilder {
    pub(crate) input_tokens: ::std::option::Option<i32>,
    pub(crate) output_tokens: ::std::option::Option<i32>,
}
impl UsageBuilder {
    /// <p>Contains information about the input tokens from the foundation model usage.</p>
    pub fn input_tokens(mut self, input: i32) -> Self {
        self.input_tokens = ::std::option::Option::Some(input);
        self
    }
    /// <p>Contains information about the input tokens from the foundation model usage.</p>
    pub fn set_input_tokens(mut self, input: ::std::option::Option<i32>) -> Self {
        self.input_tokens = input;
        self
    }
    /// <p>Contains information about the input tokens from the foundation model usage.</p>
    pub fn get_input_tokens(&self) -> &::std::option::Option<i32> {
        &self.input_tokens
    }
    /// <p>Contains information about the output tokens from the foundation model usage.</p>
    pub fn output_tokens(mut self, input: i32) -> Self {
        self.output_tokens = ::std::option::Option::Some(input);
        self
    }
    /// <p>Contains information about the output tokens from the foundation model usage.</p>
    pub fn set_output_tokens(mut self, input: ::std::option::Option<i32>) -> Self {
        self.output_tokens = input;
        self
    }
    /// <p>Contains information about the output tokens from the foundation model usage.</p>
    pub fn get_output_tokens(&self) -> &::std::option::Option<i32> {
        &self.output_tokens
    }
    /// Consumes the builder and constructs a [`Usage`](crate::types::Usage).
    pub fn build(self) -> crate::types::Usage {
        crate::types::Usage {
            input_tokens: self.input_tokens,
            output_tokens: self.output_tokens,
        }
    }
}
impl ::std::fmt::Debug for UsageBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("UsageBuilder");
        formatter.field("input_tokens", &"*** Sensitive Data Redacted ***");
        formatter.field("output_tokens", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}