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.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateInvocationOutput {
    /// <p>The unique identifier for the session associated with the invocation.</p>
    pub session_id: ::std::string::String,
    /// <p>The unique identifier for the invocation.</p>
    pub invocation_id: ::std::string::String,
    /// <p>The timestamp for when the invocation was created.</p>
    pub created_at: ::aws_smithy_types::DateTime,
    _request_id: Option<String>,
}
impl CreateInvocationOutput {
    /// <p>The unique identifier for the session associated with the invocation.</p>
    pub fn session_id(&self) -> &str {
        use std::ops::Deref;
        self.session_id.deref()
    }
    /// <p>The unique identifier for the invocation.</p>
    pub fn invocation_id(&self) -> &str {
        use std::ops::Deref;
        self.invocation_id.deref()
    }
    /// <p>The timestamp for when the invocation was created.</p>
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
}
impl ::aws_types::request_id::RequestId for CreateInvocationOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateInvocationOutput {
    /// Creates a new builder-style object to manufacture [`CreateInvocationOutput`](crate::operation::create_invocation::CreateInvocationOutput).
    pub fn builder() -> crate::operation::create_invocation::builders::CreateInvocationOutputBuilder {
        crate::operation::create_invocation::builders::CreateInvocationOutputBuilder::default()
    }
}

/// A builder for [`CreateInvocationOutput`](crate::operation::create_invocation::CreateInvocationOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateInvocationOutputBuilder {
    pub(crate) session_id: ::std::option::Option<::std::string::String>,
    pub(crate) invocation_id: ::std::option::Option<::std::string::String>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl CreateInvocationOutputBuilder {
    /// <p>The unique identifier for the session associated with the invocation.</p>
    /// This field is required.
    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 unique identifier for the session associated with the invocation.</p>
    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.session_id = input;
        self
    }
    /// <p>The unique identifier for the session associated with the invocation.</p>
    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.session_id
    }
    /// <p>The unique identifier for the invocation.</p>
    /// This field is required.
    pub fn invocation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.invocation_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier for the invocation.</p>
    pub fn set_invocation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.invocation_id = input;
        self
    }
    /// <p>The unique identifier for the invocation.</p>
    pub fn get_invocation_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.invocation_id
    }
    /// <p>The timestamp for when the invocation was created.</p>
    /// This field is required.
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The timestamp for when the invocation was created.</p>
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// <p>The timestamp for when the invocation was created.</p>
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`CreateInvocationOutput`](crate::operation::create_invocation::CreateInvocationOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`session_id`](crate::operation::create_invocation::builders::CreateInvocationOutputBuilder::session_id)
    /// - [`invocation_id`](crate::operation::create_invocation::builders::CreateInvocationOutputBuilder::invocation_id)
    /// - [`created_at`](crate::operation::create_invocation::builders::CreateInvocationOutputBuilder::created_at)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_invocation::CreateInvocationOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_invocation::CreateInvocationOutput {
            session_id: self.session_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "session_id",
                    "session_id was not specified but it is required when building CreateInvocationOutput",
                )
            })?,
            invocation_id: self.invocation_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "invocation_id",
                    "invocation_id was not specified but it is required when building CreateInvocationOutput",
                )
            })?,
            created_at: self.created_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "created_at",
                    "created_at was not specified but it is required when building CreateInvocationOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}