aws-sdk-dlm 1.92.0

AWS SDK for Amazon Data Lifecycle Manager
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 GetLifecyclePoliciesInput {
    /// <p>The identifiers of the data lifecycle policies.</p>
    pub policy_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The activation state.</p>
    pub state: ::std::option::Option<crate::types::GettablePolicyStateValues>,
    /// <p>The resource type.</p>
    pub resource_types: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTypeValues>>,
    /// <p>The target tag for a policy.</p>
    /// <p>Tags are strings in the format <code>key=value</code>.</p>
    pub target_tags: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The tags to add to objects created by the policy.</p>
    /// <p>Tags are strings in the format <code>key=value</code>.</p>
    /// <p>These user-defined tags are added in addition to the Amazon Web Services-added lifecycle tags.</p>
    pub tags_to_add: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p><b>\[Default policies only\]</b> Specifies the type of default policy to get. Specify one of the following:</p>
    /// <ul>
    /// <li>
    /// <p><code>VOLUME</code> - To get only the default policy for EBS snapshots</p></li>
    /// <li>
    /// <p><code>INSTANCE</code> - To get only the default policy for EBS-backed AMIs</p></li>
    /// <li>
    /// <p><code>ALL</code> - To get all default policies</p></li>
    /// </ul>
    pub default_policy_type: ::std::option::Option<crate::types::DefaultPoliciesTypeValues>,
}
impl GetLifecyclePoliciesInput {
    /// <p>The identifiers of the data lifecycle policies.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.policy_ids.is_none()`.
    pub fn policy_ids(&self) -> &[::std::string::String] {
        self.policy_ids.as_deref().unwrap_or_default()
    }
    /// <p>The activation state.</p>
    pub fn state(&self) -> ::std::option::Option<&crate::types::GettablePolicyStateValues> {
        self.state.as_ref()
    }
    /// <p>The resource type.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resource_types.is_none()`.
    pub fn resource_types(&self) -> &[crate::types::ResourceTypeValues] {
        self.resource_types.as_deref().unwrap_or_default()
    }
    /// <p>The target tag for a policy.</p>
    /// <p>Tags are strings in the format <code>key=value</code>.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.target_tags.is_none()`.
    pub fn target_tags(&self) -> &[::std::string::String] {
        self.target_tags.as_deref().unwrap_or_default()
    }
    /// <p>The tags to add to objects created by the policy.</p>
    /// <p>Tags are strings in the format <code>key=value</code>.</p>
    /// <p>These user-defined tags are added in addition to the Amazon Web Services-added lifecycle tags.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags_to_add.is_none()`.
    pub fn tags_to_add(&self) -> &[::std::string::String] {
        self.tags_to_add.as_deref().unwrap_or_default()
    }
    /// <p><b>\[Default policies only\]</b> Specifies the type of default policy to get. Specify one of the following:</p>
    /// <ul>
    /// <li>
    /// <p><code>VOLUME</code> - To get only the default policy for EBS snapshots</p></li>
    /// <li>
    /// <p><code>INSTANCE</code> - To get only the default policy for EBS-backed AMIs</p></li>
    /// <li>
    /// <p><code>ALL</code> - To get all default policies</p></li>
    /// </ul>
    pub fn default_policy_type(&self) -> ::std::option::Option<&crate::types::DefaultPoliciesTypeValues> {
        self.default_policy_type.as_ref()
    }
}
impl GetLifecyclePoliciesInput {
    /// Creates a new builder-style object to manufacture [`GetLifecyclePoliciesInput`](crate::operation::get_lifecycle_policies::GetLifecyclePoliciesInput).
    pub fn builder() -> crate::operation::get_lifecycle_policies::builders::GetLifecyclePoliciesInputBuilder {
        crate::operation::get_lifecycle_policies::builders::GetLifecyclePoliciesInputBuilder::default()
    }
}

/// A builder for [`GetLifecyclePoliciesInput`](crate::operation::get_lifecycle_policies::GetLifecyclePoliciesInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetLifecyclePoliciesInputBuilder {
    pub(crate) policy_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) state: ::std::option::Option<crate::types::GettablePolicyStateValues>,
    pub(crate) resource_types: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTypeValues>>,
    pub(crate) target_tags: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) tags_to_add: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) default_policy_type: ::std::option::Option<crate::types::DefaultPoliciesTypeValues>,
}
impl GetLifecyclePoliciesInputBuilder {
    /// Appends an item to `policy_ids`.
    ///
    /// To override the contents of this collection use [`set_policy_ids`](Self::set_policy_ids).
    ///
    /// <p>The identifiers of the data lifecycle policies.</p>
    pub fn policy_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.policy_ids.unwrap_or_default();
        v.push(input.into());
        self.policy_ids = ::std::option::Option::Some(v);
        self
    }
    /// <p>The identifiers of the data lifecycle policies.</p>
    pub fn set_policy_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.policy_ids = input;
        self
    }
    /// <p>The identifiers of the data lifecycle policies.</p>
    pub fn get_policy_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.policy_ids
    }
    /// <p>The activation state.</p>
    pub fn state(mut self, input: crate::types::GettablePolicyStateValues) -> Self {
        self.state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The activation state.</p>
    pub fn set_state(mut self, input: ::std::option::Option<crate::types::GettablePolicyStateValues>) -> Self {
        self.state = input;
        self
    }
    /// <p>The activation state.</p>
    pub fn get_state(&self) -> &::std::option::Option<crate::types::GettablePolicyStateValues> {
        &self.state
    }
    /// Appends an item to `resource_types`.
    ///
    /// To override the contents of this collection use [`set_resource_types`](Self::set_resource_types).
    ///
    /// <p>The resource type.</p>
    pub fn resource_types(mut self, input: crate::types::ResourceTypeValues) -> Self {
        let mut v = self.resource_types.unwrap_or_default();
        v.push(input);
        self.resource_types = ::std::option::Option::Some(v);
        self
    }
    /// <p>The resource type.</p>
    pub fn set_resource_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTypeValues>>) -> Self {
        self.resource_types = input;
        self
    }
    /// <p>The resource type.</p>
    pub fn get_resource_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourceTypeValues>> {
        &self.resource_types
    }
    /// Appends an item to `target_tags`.
    ///
    /// To override the contents of this collection use [`set_target_tags`](Self::set_target_tags).
    ///
    /// <p>The target tag for a policy.</p>
    /// <p>Tags are strings in the format <code>key=value</code>.</p>
    pub fn target_tags(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.target_tags.unwrap_or_default();
        v.push(input.into());
        self.target_tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>The target tag for a policy.</p>
    /// <p>Tags are strings in the format <code>key=value</code>.</p>
    pub fn set_target_tags(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.target_tags = input;
        self
    }
    /// <p>The target tag for a policy.</p>
    /// <p>Tags are strings in the format <code>key=value</code>.</p>
    pub fn get_target_tags(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.target_tags
    }
    /// Appends an item to `tags_to_add`.
    ///
    /// To override the contents of this collection use [`set_tags_to_add`](Self::set_tags_to_add).
    ///
    /// <p>The tags to add to objects created by the policy.</p>
    /// <p>Tags are strings in the format <code>key=value</code>.</p>
    /// <p>These user-defined tags are added in addition to the Amazon Web Services-added lifecycle tags.</p>
    pub fn tags_to_add(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.tags_to_add.unwrap_or_default();
        v.push(input.into());
        self.tags_to_add = ::std::option::Option::Some(v);
        self
    }
    /// <p>The tags to add to objects created by the policy.</p>
    /// <p>Tags are strings in the format <code>key=value</code>.</p>
    /// <p>These user-defined tags are added in addition to the Amazon Web Services-added lifecycle tags.</p>
    pub fn set_tags_to_add(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.tags_to_add = input;
        self
    }
    /// <p>The tags to add to objects created by the policy.</p>
    /// <p>Tags are strings in the format <code>key=value</code>.</p>
    /// <p>These user-defined tags are added in addition to the Amazon Web Services-added lifecycle tags.</p>
    pub fn get_tags_to_add(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.tags_to_add
    }
    /// <p><b>\[Default policies only\]</b> Specifies the type of default policy to get. Specify one of the following:</p>
    /// <ul>
    /// <li>
    /// <p><code>VOLUME</code> - To get only the default policy for EBS snapshots</p></li>
    /// <li>
    /// <p><code>INSTANCE</code> - To get only the default policy for EBS-backed AMIs</p></li>
    /// <li>
    /// <p><code>ALL</code> - To get all default policies</p></li>
    /// </ul>
    pub fn default_policy_type(mut self, input: crate::types::DefaultPoliciesTypeValues) -> Self {
        self.default_policy_type = ::std::option::Option::Some(input);
        self
    }
    /// <p><b>\[Default policies only\]</b> Specifies the type of default policy to get. Specify one of the following:</p>
    /// <ul>
    /// <li>
    /// <p><code>VOLUME</code> - To get only the default policy for EBS snapshots</p></li>
    /// <li>
    /// <p><code>INSTANCE</code> - To get only the default policy for EBS-backed AMIs</p></li>
    /// <li>
    /// <p><code>ALL</code> - To get all default policies</p></li>
    /// </ul>
    pub fn set_default_policy_type(mut self, input: ::std::option::Option<crate::types::DefaultPoliciesTypeValues>) -> Self {
        self.default_policy_type = input;
        self
    }
    /// <p><b>\[Default policies only\]</b> Specifies the type of default policy to get. Specify one of the following:</p>
    /// <ul>
    /// <li>
    /// <p><code>VOLUME</code> - To get only the default policy for EBS snapshots</p></li>
    /// <li>
    /// <p><code>INSTANCE</code> - To get only the default policy for EBS-backed AMIs</p></li>
    /// <li>
    /// <p><code>ALL</code> - To get all default policies</p></li>
    /// </ul>
    pub fn get_default_policy_type(&self) -> &::std::option::Option<crate::types::DefaultPoliciesTypeValues> {
        &self.default_policy_type
    }
    /// Consumes the builder and constructs a [`GetLifecyclePoliciesInput`](crate::operation::get_lifecycle_policies::GetLifecyclePoliciesInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_lifecycle_policies::GetLifecyclePoliciesInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::get_lifecycle_policies::GetLifecyclePoliciesInput {
            policy_ids: self.policy_ids,
            state: self.state,
            resource_types: self.resource_types,
            target_tags: self.target_tags,
            tags_to_add: self.tags_to_add,
            default_policy_type: self.default_policy_type,
        })
    }
}