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 about where the text with a citation begins and ends in the generated output.</p>
/// <p>This data type is used in the following API operations:</p>
/// <ul>
/// <li>
/// <p><a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax">RetrieveAndGenerate response</a> – in the <code>span</code> field</p></li>
/// <li>
/// <p><a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax">InvokeAgent response</a> – in the <code>span</code> field</p></li>
/// </ul>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Span {
    /// <p>Where the text with a citation starts in the generated output.</p>
    pub start: ::std::option::Option<i32>,
    /// <p>Where the text with a citation ends in the generated output.</p>
    pub end: ::std::option::Option<i32>,
}
impl Span {
    /// <p>Where the text with a citation starts in the generated output.</p>
    pub fn start(&self) -> ::std::option::Option<i32> {
        self.start
    }
    /// <p>Where the text with a citation ends in the generated output.</p>
    pub fn end(&self) -> ::std::option::Option<i32> {
        self.end
    }
}
impl Span {
    /// Creates a new builder-style object to manufacture [`Span`](crate::types::Span).
    pub fn builder() -> crate::types::builders::SpanBuilder {
        crate::types::builders::SpanBuilder::default()
    }
}

/// A builder for [`Span`](crate::types::Span).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SpanBuilder {
    pub(crate) start: ::std::option::Option<i32>,
    pub(crate) end: ::std::option::Option<i32>,
}
impl SpanBuilder {
    /// <p>Where the text with a citation starts in the generated output.</p>
    pub fn start(mut self, input: i32) -> Self {
        self.start = ::std::option::Option::Some(input);
        self
    }
    /// <p>Where the text with a citation starts in the generated output.</p>
    pub fn set_start(mut self, input: ::std::option::Option<i32>) -> Self {
        self.start = input;
        self
    }
    /// <p>Where the text with a citation starts in the generated output.</p>
    pub fn get_start(&self) -> &::std::option::Option<i32> {
        &self.start
    }
    /// <p>Where the text with a citation ends in the generated output.</p>
    pub fn end(mut self, input: i32) -> Self {
        self.end = ::std::option::Option::Some(input);
        self
    }
    /// <p>Where the text with a citation ends in the generated output.</p>
    pub fn set_end(mut self, input: ::std::option::Option<i32>) -> Self {
        self.end = input;
        self
    }
    /// <p>Where the text with a citation ends in the generated output.</p>
    pub fn get_end(&self) -> &::std::option::Option<i32> {
        &self.end
    }
    /// Consumes the builder and constructs a [`Span`](crate::types::Span).
    pub fn build(self) -> crate::types::Span {
        crate::types::Span {
            start: self.start,
            end: self.end,
        }
    }
}