aws-sdk-backupexternal 1.0.0

AWS SDK for AWS Backup External
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 UpdateResourceProviderInput {
    /// The Amazon Resource Name (ARN) of the resource provider.
    pub arn: ::std::option::Option<::std::string::String>,
    /// The name of the resource provider.
    pub name: ::std::option::Option<::std::string::String>,
    /// The configuration of the resource provider.
    pub provider_configuration: ::std::option::Option<crate::types::ResourceProviderConfiguration>,
    /// The Amazon Resource Name (ARN) of the AWS Secrets Manager secret used to access the resource provider.
    pub secret_configuration_arn: ::std::option::Option<::std::string::String>,
    /// The default backup configurations for the resource provider's resource targets, by target type.
    pub target_configuration: ::std::option::Option<crate::types::ResourceTargetConfigurations>,
    /// The tags to apply when the resource provider's resource targets are created.
    pub target_tags_on_create: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// The tag keys whose values are synchronized from external resources to their resource targets.
    pub target_tag_keys_to_sync: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// The number of days after which resource targets with a status of `NOT_FOUND` are automatically deleted. Specify `-1` to disable automatic deletion.
    pub auto_delete_not_found_targets_after_days: ::std::option::Option<i32>,
}
impl UpdateResourceProviderInput {
    /// The Amazon Resource Name (ARN) of the resource provider.
    pub fn arn(&self) -> ::std::option::Option<&str> {
        self.arn.as_deref()
    }
    /// The name of the resource provider.
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// The configuration of the resource provider.
    pub fn provider_configuration(&self) -> ::std::option::Option<&crate::types::ResourceProviderConfiguration> {
        self.provider_configuration.as_ref()
    }
    /// The Amazon Resource Name (ARN) of the AWS Secrets Manager secret used to access the resource provider.
    pub fn secret_configuration_arn(&self) -> ::std::option::Option<&str> {
        self.secret_configuration_arn.as_deref()
    }
    /// The default backup configurations for the resource provider's resource targets, by target type.
    pub fn target_configuration(&self) -> ::std::option::Option<&crate::types::ResourceTargetConfigurations> {
        self.target_configuration.as_ref()
    }
    /// The tags to apply when the resource provider's resource targets are created.
    pub fn target_tags_on_create(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.target_tags_on_create.as_ref()
    }
    /// The tag keys whose values are synchronized from external resources to their resource targets.
    ///
    /// 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_tag_keys_to_sync.is_none()`.
    pub fn target_tag_keys_to_sync(&self) -> &[::std::string::String] {
        self.target_tag_keys_to_sync.as_deref().unwrap_or_default()
    }
    /// The number of days after which resource targets with a status of `NOT_FOUND` are automatically deleted. Specify `-1` to disable automatic deletion.
    pub fn auto_delete_not_found_targets_after_days(&self) -> ::std::option::Option<i32> {
        self.auto_delete_not_found_targets_after_days
    }
}
impl UpdateResourceProviderInput {
    /// Creates a new builder-style object to manufacture [`UpdateResourceProviderInput`](crate::operation::update_resource_provider::UpdateResourceProviderInput).
    pub fn builder() -> crate::operation::update_resource_provider::builders::UpdateResourceProviderInputBuilder {
        crate::operation::update_resource_provider::builders::UpdateResourceProviderInputBuilder::default()
    }
}

/// A builder for [`UpdateResourceProviderInput`](crate::operation::update_resource_provider::UpdateResourceProviderInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateResourceProviderInputBuilder {
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) provider_configuration: ::std::option::Option<crate::types::ResourceProviderConfiguration>,
    pub(crate) secret_configuration_arn: ::std::option::Option<::std::string::String>,
    pub(crate) target_configuration: ::std::option::Option<crate::types::ResourceTargetConfigurations>,
    pub(crate) target_tags_on_create: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) target_tag_keys_to_sync: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) auto_delete_not_found_targets_after_days: ::std::option::Option<i32>,
}
impl UpdateResourceProviderInputBuilder {
    /// The Amazon Resource Name (ARN) of the resource provider.
    /// This field is required.
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// The Amazon Resource Name (ARN) of the resource provider.
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// The Amazon Resource Name (ARN) of the resource provider.
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// The name of the resource provider.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// The name of the resource provider.
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// The name of the resource provider.
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// The configuration of the resource provider.
    pub fn provider_configuration(mut self, input: crate::types::ResourceProviderConfiguration) -> Self {
        self.provider_configuration = ::std::option::Option::Some(input);
        self
    }
    /// The configuration of the resource provider.
    pub fn set_provider_configuration(mut self, input: ::std::option::Option<crate::types::ResourceProviderConfiguration>) -> Self {
        self.provider_configuration = input;
        self
    }
    /// The configuration of the resource provider.
    pub fn get_provider_configuration(&self) -> &::std::option::Option<crate::types::ResourceProviderConfiguration> {
        &self.provider_configuration
    }
    /// The Amazon Resource Name (ARN) of the AWS Secrets Manager secret used to access the resource provider.
    pub fn secret_configuration_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.secret_configuration_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// The Amazon Resource Name (ARN) of the AWS Secrets Manager secret used to access the resource provider.
    pub fn set_secret_configuration_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.secret_configuration_arn = input;
        self
    }
    /// The Amazon Resource Name (ARN) of the AWS Secrets Manager secret used to access the resource provider.
    pub fn get_secret_configuration_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.secret_configuration_arn
    }
    /// The default backup configurations for the resource provider's resource targets, by target type.
    pub fn target_configuration(mut self, input: crate::types::ResourceTargetConfigurations) -> Self {
        self.target_configuration = ::std::option::Option::Some(input);
        self
    }
    /// The default backup configurations for the resource provider's resource targets, by target type.
    pub fn set_target_configuration(mut self, input: ::std::option::Option<crate::types::ResourceTargetConfigurations>) -> Self {
        self.target_configuration = input;
        self
    }
    /// The default backup configurations for the resource provider's resource targets, by target type.
    pub fn get_target_configuration(&self) -> &::std::option::Option<crate::types::ResourceTargetConfigurations> {
        &self.target_configuration
    }
    /// Adds a key-value pair to `target_tags_on_create`.
    ///
    /// To override the contents of this collection use [`set_target_tags_on_create`](Self::set_target_tags_on_create).
    ///
    /// The tags to apply when the resource provider's resource targets are created.
    pub fn target_tags_on_create(
        mut self,
        k: impl ::std::convert::Into<::std::string::String>,
        v: impl ::std::convert::Into<::std::string::String>,
    ) -> Self {
        let mut hash_map = self.target_tags_on_create.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.target_tags_on_create = ::std::option::Option::Some(hash_map);
        self
    }
    /// The tags to apply when the resource provider's resource targets are created.
    pub fn set_target_tags_on_create(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    ) -> Self {
        self.target_tags_on_create = input;
        self
    }
    /// The tags to apply when the resource provider's resource targets are created.
    pub fn get_target_tags_on_create(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.target_tags_on_create
    }
    /// Appends an item to `target_tag_keys_to_sync`.
    ///
    /// To override the contents of this collection use [`set_target_tag_keys_to_sync`](Self::set_target_tag_keys_to_sync).
    ///
    /// The tag keys whose values are synchronized from external resources to their resource targets.
    pub fn target_tag_keys_to_sync(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.target_tag_keys_to_sync.unwrap_or_default();
        v.push(input.into());
        self.target_tag_keys_to_sync = ::std::option::Option::Some(v);
        self
    }
    /// The tag keys whose values are synchronized from external resources to their resource targets.
    pub fn set_target_tag_keys_to_sync(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.target_tag_keys_to_sync = input;
        self
    }
    /// The tag keys whose values are synchronized from external resources to their resource targets.
    pub fn get_target_tag_keys_to_sync(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.target_tag_keys_to_sync
    }
    /// The number of days after which resource targets with a status of `NOT_FOUND` are automatically deleted. Specify `-1` to disable automatic deletion.
    pub fn auto_delete_not_found_targets_after_days(mut self, input: i32) -> Self {
        self.auto_delete_not_found_targets_after_days = ::std::option::Option::Some(input);
        self
    }
    /// The number of days after which resource targets with a status of `NOT_FOUND` are automatically deleted. Specify `-1` to disable automatic deletion.
    pub fn set_auto_delete_not_found_targets_after_days(mut self, input: ::std::option::Option<i32>) -> Self {
        self.auto_delete_not_found_targets_after_days = input;
        self
    }
    /// The number of days after which resource targets with a status of `NOT_FOUND` are automatically deleted. Specify `-1` to disable automatic deletion.
    pub fn get_auto_delete_not_found_targets_after_days(&self) -> &::std::option::Option<i32> {
        &self.auto_delete_not_found_targets_after_days
    }
    /// Consumes the builder and constructs a [`UpdateResourceProviderInput`](crate::operation::update_resource_provider::UpdateResourceProviderInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::update_resource_provider::UpdateResourceProviderInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::update_resource_provider::UpdateResourceProviderInput {
            arn: self.arn,
            name: self.name,
            provider_configuration: self.provider_configuration,
            secret_configuration_arn: self.secret_configuration_arn,
            target_configuration: self.target_configuration,
            target_tags_on_create: self.target_tags_on_create,
            target_tag_keys_to_sync: self.target_tag_keys_to_sync,
            auto_delete_not_found_targets_after_days: self.auto_delete_not_found_targets_after_days,
        })
    }
}