aws-sdk-bedrock 1.143.0

AWS SDK for Amazon Bedrock
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 CreateGuardrailOutput {
    /// <p>The unique identifier of the guardrail that was created.</p>
    pub guardrail_id: ::std::string::String,
    /// <p>The ARN of the guardrail.</p>
    pub guardrail_arn: ::std::string::String,
    /// <p>The version of the guardrail that was created. This value will always be <code>DRAFT</code>.</p>
    pub version: ::std::string::String,
    /// <p>The time at which the guardrail was created.</p>
    pub created_at: ::aws_smithy_types::DateTime,
    _request_id: Option<String>,
}
impl CreateGuardrailOutput {
    /// <p>The unique identifier of the guardrail that was created.</p>
    pub fn guardrail_id(&self) -> &str {
        use std::ops::Deref;
        self.guardrail_id.deref()
    }
    /// <p>The ARN of the guardrail.</p>
    pub fn guardrail_arn(&self) -> &str {
        use std::ops::Deref;
        self.guardrail_arn.deref()
    }
    /// <p>The version of the guardrail that was created. This value will always be <code>DRAFT</code>.</p>
    pub fn version(&self) -> &str {
        use std::ops::Deref;
        self.version.deref()
    }
    /// <p>The time at which the guardrail was created.</p>
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
}
impl ::aws_types::request_id::RequestId for CreateGuardrailOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateGuardrailOutput {
    /// Creates a new builder-style object to manufacture [`CreateGuardrailOutput`](crate::operation::create_guardrail::CreateGuardrailOutput).
    pub fn builder() -> crate::operation::create_guardrail::builders::CreateGuardrailOutputBuilder {
        crate::operation::create_guardrail::builders::CreateGuardrailOutputBuilder::default()
    }
}

/// A builder for [`CreateGuardrailOutput`](crate::operation::create_guardrail::CreateGuardrailOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateGuardrailOutputBuilder {
    pub(crate) guardrail_id: ::std::option::Option<::std::string::String>,
    pub(crate) guardrail_arn: ::std::option::Option<::std::string::String>,
    pub(crate) version: ::std::option::Option<::std::string::String>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl CreateGuardrailOutputBuilder {
    /// <p>The unique identifier of the guardrail that was created.</p>
    /// This field is required.
    pub fn guardrail_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.guardrail_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the guardrail that was created.</p>
    pub fn set_guardrail_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.guardrail_id = input;
        self
    }
    /// <p>The unique identifier of the guardrail that was created.</p>
    pub fn get_guardrail_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.guardrail_id
    }
    /// <p>The ARN of the guardrail.</p>
    /// This field is required.
    pub fn guardrail_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.guardrail_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the guardrail.</p>
    pub fn set_guardrail_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.guardrail_arn = input;
        self
    }
    /// <p>The ARN of the guardrail.</p>
    pub fn get_guardrail_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.guardrail_arn
    }
    /// <p>The version of the guardrail that was created. This value will always be <code>DRAFT</code>.</p>
    /// This field is required.
    pub fn version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The version of the guardrail that was created. This value will always be <code>DRAFT</code>.</p>
    pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.version = input;
        self
    }
    /// <p>The version of the guardrail that was created. This value will always be <code>DRAFT</code>.</p>
    pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.version
    }
    /// <p>The time at which the guardrail 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 time at which the guardrail 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 time at which the guardrail 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 [`CreateGuardrailOutput`](crate::operation::create_guardrail::CreateGuardrailOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`guardrail_id`](crate::operation::create_guardrail::builders::CreateGuardrailOutputBuilder::guardrail_id)
    /// - [`guardrail_arn`](crate::operation::create_guardrail::builders::CreateGuardrailOutputBuilder::guardrail_arn)
    /// - [`version`](crate::operation::create_guardrail::builders::CreateGuardrailOutputBuilder::version)
    /// - [`created_at`](crate::operation::create_guardrail::builders::CreateGuardrailOutputBuilder::created_at)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_guardrail::CreateGuardrailOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_guardrail::CreateGuardrailOutput {
            guardrail_id: self.guardrail_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "guardrail_id",
                    "guardrail_id was not specified but it is required when building CreateGuardrailOutput",
                )
            })?,
            guardrail_arn: self.guardrail_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "guardrail_arn",
                    "guardrail_arn was not specified but it is required when building CreateGuardrailOutput",
                )
            })?,
            version: self.version.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "version",
                    "version was not specified but it is required when building CreateGuardrailOutput",
                )
            })?,
            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 CreateGuardrailOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}