aws-sdk-opensearchserverless 1.111.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 CreateLifecyclePolicyInput {
    /// <p>The type of lifecycle policy.</p>
    pub r#type: ::std::option::Option<crate::types::LifecyclePolicyType>,
    /// <p>The name of the lifecycle policy.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>A description of the lifecycle policy.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The JSON policy document to use as the content for the lifecycle policy.</p>
    pub policy: ::std::option::Option<::std::string::String>,
    /// <p>A unique, case-sensitive identifier to ensure idempotency of the request.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
}
impl CreateLifecyclePolicyInput {
    /// <p>The type of lifecycle policy.</p>
    pub fn r#type(&self) -> ::std::option::Option<&crate::types::LifecyclePolicyType> {
        self.r#type.as_ref()
    }
    /// <p>The name of the lifecycle policy.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>A description of the lifecycle policy.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The JSON policy document to use as the content for the lifecycle policy.</p>
    pub fn policy(&self) -> ::std::option::Option<&str> {
        self.policy.as_deref()
    }
    /// <p>A unique, case-sensitive identifier to ensure idempotency of the request.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
}
impl CreateLifecyclePolicyInput {
    /// Creates a new builder-style object to manufacture [`CreateLifecyclePolicyInput`](crate::operation::create_lifecycle_policy::CreateLifecyclePolicyInput).
    pub fn builder() -> crate::operation::create_lifecycle_policy::builders::CreateLifecyclePolicyInputBuilder {
        crate::operation::create_lifecycle_policy::builders::CreateLifecyclePolicyInputBuilder::default()
    }
}

/// A builder for [`CreateLifecyclePolicyInput`](crate::operation::create_lifecycle_policy::CreateLifecyclePolicyInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateLifecyclePolicyInputBuilder {
    pub(crate) r#type: ::std::option::Option<crate::types::LifecyclePolicyType>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) policy: ::std::option::Option<::std::string::String>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
}
impl CreateLifecyclePolicyInputBuilder {
    /// <p>The type of lifecycle policy.</p>
    /// This field is required.
    pub fn r#type(mut self, input: crate::types::LifecyclePolicyType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of lifecycle policy.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::LifecyclePolicyType>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>The type of lifecycle policy.</p>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::LifecyclePolicyType> {
        &self.r#type
    }
    /// <p>The name of the lifecycle 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 lifecycle 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 lifecycle policy.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>A description of the lifecycle policy.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A description of the lifecycle policy.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>A description of the lifecycle policy.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The JSON policy document to use as the content for the lifecycle policy.</p>
    /// This field is required.
    pub fn policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.policy = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The JSON policy document to use as the content for the lifecycle policy.</p>
    pub fn set_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.policy = input;
        self
    }
    /// <p>The JSON policy document to use as the content for the lifecycle policy.</p>
    pub fn get_policy(&self) -> &::std::option::Option<::std::string::String> {
        &self.policy
    }
    /// <p>A unique, case-sensitive identifier to ensure idempotency of the request.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique, case-sensitive identifier to ensure idempotency of the request.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>A unique, case-sensitive identifier to ensure idempotency of the request.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// Consumes the builder and constructs a [`CreateLifecyclePolicyInput`](crate::operation::create_lifecycle_policy::CreateLifecyclePolicyInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_lifecycle_policy::CreateLifecyclePolicyInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_lifecycle_policy::CreateLifecyclePolicyInput {
            r#type: self.r#type,
            name: self.name,
            description: self.description,
            policy: self.policy,
            client_token: self.client_token,
        })
    }
}