aws-sdk-opensearchserverless 1.100.0

AWS SDK for OpenSearch Service Serverless
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 GetAccessPolicyInput {
    /// <p>Tye type of policy. Currently, the only supported value is <code>data</code>.</p>
    pub r#type: ::std::option::Option<crate::types::AccessPolicyType>,
    /// <p>The name of the access policy.</p>
    pub name: ::std::option::Option<::std::string::String>,
}
impl GetAccessPolicyInput {
    /// <p>Tye type of policy. Currently, the only supported value is <code>data</code>.</p>
    pub fn r#type(&self) -> ::std::option::Option<&crate::types::AccessPolicyType> {
        self.r#type.as_ref()
    }
    /// <p>The name of the access policy.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
}
impl GetAccessPolicyInput {
    /// Creates a new builder-style object to manufacture [`GetAccessPolicyInput`](crate::operation::get_access_policy::GetAccessPolicyInput).
    pub fn builder() -> crate::operation::get_access_policy::builders::GetAccessPolicyInputBuilder {
        crate::operation::get_access_policy::builders::GetAccessPolicyInputBuilder::default()
    }
}

/// A builder for [`GetAccessPolicyInput`](crate::operation::get_access_policy::GetAccessPolicyInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetAccessPolicyInputBuilder {
    pub(crate) r#type: ::std::option::Option<crate::types::AccessPolicyType>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
}
impl GetAccessPolicyInputBuilder {
    /// <p>Tye type of policy. Currently, the only supported value is <code>data</code>.</p>
    /// This field is required.
    pub fn r#type(mut self, input: crate::types::AccessPolicyType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// <p>Tye type of policy. Currently, the only supported value is <code>data</code>.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::AccessPolicyType>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>Tye type of policy. Currently, the only supported value is <code>data</code>.</p>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::AccessPolicyType> {
        &self.r#type
    }
    /// <p>The name of the access policy.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the access policy.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the access policy.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// Consumes the builder and constructs a [`GetAccessPolicyInput`](crate::operation::get_access_policy::GetAccessPolicyInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_access_policy::GetAccessPolicyInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_access_policy::GetAccessPolicyInput {
            r#type: self.r#type,
            name: self.name,
        })
    }
}