aws_sdk_bedrock/operation/get_guardrail/
_get_guardrail_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetGuardrailInput {
6    /// <p>The unique identifier of the guardrail for which to get details. This can be an ID or the ARN.</p>
7    pub guardrail_identifier: ::std::option::Option<::std::string::String>,
8    /// <p>The version of the guardrail for which to get details. If you don't specify a version, the response returns details for the <code>DRAFT</code> version.</p>
9    pub guardrail_version: ::std::option::Option<::std::string::String>,
10}
11impl GetGuardrailInput {
12    /// <p>The unique identifier of the guardrail for which to get details. This can be an ID or the ARN.</p>
13    pub fn guardrail_identifier(&self) -> ::std::option::Option<&str> {
14        self.guardrail_identifier.as_deref()
15    }
16    /// <p>The version of the guardrail for which to get details. If you don't specify a version, the response returns details for the <code>DRAFT</code> version.</p>
17    pub fn guardrail_version(&self) -> ::std::option::Option<&str> {
18        self.guardrail_version.as_deref()
19    }
20}
21impl GetGuardrailInput {
22    /// Creates a new builder-style object to manufacture [`GetGuardrailInput`](crate::operation::get_guardrail::GetGuardrailInput).
23    pub fn builder() -> crate::operation::get_guardrail::builders::GetGuardrailInputBuilder {
24        crate::operation::get_guardrail::builders::GetGuardrailInputBuilder::default()
25    }
26}
27
28/// A builder for [`GetGuardrailInput`](crate::operation::get_guardrail::GetGuardrailInput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct GetGuardrailInputBuilder {
32    pub(crate) guardrail_identifier: ::std::option::Option<::std::string::String>,
33    pub(crate) guardrail_version: ::std::option::Option<::std::string::String>,
34}
35impl GetGuardrailInputBuilder {
36    /// <p>The unique identifier of the guardrail for which to get details. This can be an ID or the ARN.</p>
37    /// This field is required.
38    pub fn guardrail_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39        self.guardrail_identifier = ::std::option::Option::Some(input.into());
40        self
41    }
42    /// <p>The unique identifier of the guardrail for which to get details. This can be an ID or the ARN.</p>
43    pub fn set_guardrail_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44        self.guardrail_identifier = input;
45        self
46    }
47    /// <p>The unique identifier of the guardrail for which to get details. This can be an ID or the ARN.</p>
48    pub fn get_guardrail_identifier(&self) -> &::std::option::Option<::std::string::String> {
49        &self.guardrail_identifier
50    }
51    /// <p>The version of the guardrail for which to get details. If you don't specify a version, the response returns details for the <code>DRAFT</code> version.</p>
52    pub fn guardrail_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.guardrail_version = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The version of the guardrail for which to get details. If you don't specify a version, the response returns details for the <code>DRAFT</code> version.</p>
57    pub fn set_guardrail_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.guardrail_version = input;
59        self
60    }
61    /// <p>The version of the guardrail for which to get details. If you don't specify a version, the response returns details for the <code>DRAFT</code> version.</p>
62    pub fn get_guardrail_version(&self) -> &::std::option::Option<::std::string::String> {
63        &self.guardrail_version
64    }
65    /// Consumes the builder and constructs a [`GetGuardrailInput`](crate::operation::get_guardrail::GetGuardrailInput).
66    pub fn build(
67        self,
68    ) -> ::std::result::Result<crate::operation::get_guardrail::GetGuardrailInput, ::aws_smithy_types::error::operation::BuildError> {
69        ::std::result::Result::Ok(crate::operation::get_guardrail::GetGuardrailInput {
70            guardrail_identifier: self.guardrail_identifier,
71            guardrail_version: self.guardrail_version,
72        })
73    }
74}