aws-sdk-bedrock 1.145.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 CreateGuardrailVersionOutput {
    /// <p>The unique identifier of the guardrail.</p>
    pub guardrail_id: ::std::string::String,
    /// <p>The number of the version of the guardrail.</p>
    pub version: ::std::string::String,
    _request_id: Option<String>,
}
impl CreateGuardrailVersionOutput {
    /// <p>The unique identifier of the guardrail.</p>
    pub fn guardrail_id(&self) -> &str {
        use std::ops::Deref;
        self.guardrail_id.deref()
    }
    /// <p>The number of the version of the guardrail.</p>
    pub fn version(&self) -> &str {
        use std::ops::Deref;
        self.version.deref()
    }
}
impl ::aws_types::request_id::RequestId for CreateGuardrailVersionOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateGuardrailVersionOutput {
    /// Creates a new builder-style object to manufacture [`CreateGuardrailVersionOutput`](crate::operation::create_guardrail_version::CreateGuardrailVersionOutput).
    pub fn builder() -> crate::operation::create_guardrail_version::builders::CreateGuardrailVersionOutputBuilder {
        crate::operation::create_guardrail_version::builders::CreateGuardrailVersionOutputBuilder::default()
    }
}

/// A builder for [`CreateGuardrailVersionOutput`](crate::operation::create_guardrail_version::CreateGuardrailVersionOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateGuardrailVersionOutputBuilder {
    pub(crate) guardrail_id: ::std::option::Option<::std::string::String>,
    pub(crate) version: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl CreateGuardrailVersionOutputBuilder {
    /// <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 number of 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 number of 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 number of the version of the guardrail.</p>
    pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.version
    }
    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 [`CreateGuardrailVersionOutput`](crate::operation::create_guardrail_version::CreateGuardrailVersionOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`guardrail_id`](crate::operation::create_guardrail_version::builders::CreateGuardrailVersionOutputBuilder::guardrail_id)
    /// - [`version`](crate::operation::create_guardrail_version::builders::CreateGuardrailVersionOutputBuilder::version)
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::create_guardrail_version::CreateGuardrailVersionOutput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::create_guardrail_version::CreateGuardrailVersionOutput {
            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 CreateGuardrailVersionOutput",
                )
            })?,
            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 CreateGuardrailVersionOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}