aws-sdk-bedrock 1.146.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 UpdateGuardrailOutput {
    /// <p>The unique identifier of the guardrail</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.</p>
    pub version: ::std::string::String,
    /// <p>The date and time at which the guardrail was updated.</p>
    pub updated_at: ::aws_smithy_types::DateTime,
    _request_id: Option<String>,
}
impl UpdateGuardrailOutput {
    /// <p>The unique identifier of the guardrail</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.</p>
    pub fn version(&self) -> &str {
        use std::ops::Deref;
        self.version.deref()
    }
    /// <p>The date and time at which the guardrail was updated.</p>
    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
        &self.updated_at
    }
}
impl ::aws_types::request_id::RequestId for UpdateGuardrailOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl UpdateGuardrailOutput {
    /// Creates a new builder-style object to manufacture [`UpdateGuardrailOutput`](crate::operation::update_guardrail::UpdateGuardrailOutput).
    pub fn builder() -> crate::operation::update_guardrail::builders::UpdateGuardrailOutputBuilder {
        crate::operation::update_guardrail::builders::UpdateGuardrailOutputBuilder::default()
    }
}

/// A builder for [`UpdateGuardrailOutput`](crate::operation::update_guardrail::UpdateGuardrailOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateGuardrailOutputBuilder {
    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) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl UpdateGuardrailOutputBuilder {
    /// <p>The unique identifier of the guardrail</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</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</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.</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.</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.</p>
    pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.version
    }
    /// <p>The date and time at which the guardrail was updated.</p>
    /// This field is required.
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time at which the guardrail was updated.</p>
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// <p>The date and time at which the guardrail was updated.</p>
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_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 [`UpdateGuardrailOutput`](crate::operation::update_guardrail::UpdateGuardrailOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`guardrail_id`](crate::operation::update_guardrail::builders::UpdateGuardrailOutputBuilder::guardrail_id)
    /// - [`guardrail_arn`](crate::operation::update_guardrail::builders::UpdateGuardrailOutputBuilder::guardrail_arn)
    /// - [`version`](crate::operation::update_guardrail::builders::UpdateGuardrailOutputBuilder::version)
    /// - [`updated_at`](crate::operation::update_guardrail::builders::UpdateGuardrailOutputBuilder::updated_at)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_guardrail::UpdateGuardrailOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_guardrail::UpdateGuardrailOutput {
            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 UpdateGuardrailOutput",
                )
            })?,
            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 UpdateGuardrailOutput",
                )
            })?,
            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 UpdateGuardrailOutput",
                )
            })?,
            updated_at: self.updated_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "updated_at",
                    "updated_at was not specified but it is required when building UpdateGuardrailOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}