aws-sdk-databasemigration 1.112.0

AWS SDK for AWS Database Migration Service
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)]
pub struct CreateDataMigrationInput {
    /// <p>A user-friendly name for the data migration. Data migration names have the following constraints:</p>
    /// <ul>
    /// <li>
    /// <p>Must begin with a letter, and can only contain ASCII letters, digits, and hyphens.</p></li>
    /// <li>
    /// <p>Can't end with a hyphen or contain two consecutive hyphens.</p></li>
    /// <li>
    /// <p>Length must be from 1 to 255 characters.</p></li>
    /// </ul>
    pub data_migration_name: ::std::option::Option<::std::string::String>,
    /// <p>An identifier for the migration project.</p>
    pub migration_project_identifier: ::std::option::Option<::std::string::String>,
    /// <p>Specifies if the data migration is full-load only, change data capture (CDC) only, or full-load and CDC.</p>
    pub data_migration_type: ::std::option::Option<crate::types::MigrationTypeValue>,
    /// <p>The Amazon Resource Name (ARN) for the service access role that you want to use to create the data migration.</p>
    pub service_access_role_arn: ::std::option::Option<::std::string::String>,
    /// <p>Specifies whether to enable CloudWatch logs for the data migration.</p>
    pub enable_cloudwatch_logs: ::std::option::Option<bool>,
    /// <p>Specifies information about the source data provider.</p>
    pub source_data_settings: ::std::option::Option<::std::vec::Vec<crate::types::SourceDataSetting>>,
    /// <p>Specifies information about the target data provider.</p>
    pub target_data_settings: ::std::option::Option<::std::vec::Vec<crate::types::TargetDataSetting>>,
    /// <p>The number of parallel jobs that trigger parallel threads to unload the tables from the source, and then load them to the target.</p>
    pub number_of_jobs: ::std::option::Option<i32>,
    /// <p>One or more tags to be assigned to the data migration.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    /// <p>An optional JSON string specifying what tables, views, and schemas to include or exclude from the migration.</p>
    pub selection_rules: ::std::option::Option<::std::string::String>,
}
impl CreateDataMigrationInput {
    /// <p>A user-friendly name for the data migration. Data migration names have the following constraints:</p>
    /// <ul>
    /// <li>
    /// <p>Must begin with a letter, and can only contain ASCII letters, digits, and hyphens.</p></li>
    /// <li>
    /// <p>Can't end with a hyphen or contain two consecutive hyphens.</p></li>
    /// <li>
    /// <p>Length must be from 1 to 255 characters.</p></li>
    /// </ul>
    pub fn data_migration_name(&self) -> ::std::option::Option<&str> {
        self.data_migration_name.as_deref()
    }
    /// <p>An identifier for the migration project.</p>
    pub fn migration_project_identifier(&self) -> ::std::option::Option<&str> {
        self.migration_project_identifier.as_deref()
    }
    /// <p>Specifies if the data migration is full-load only, change data capture (CDC) only, or full-load and CDC.</p>
    pub fn data_migration_type(&self) -> ::std::option::Option<&crate::types::MigrationTypeValue> {
        self.data_migration_type.as_ref()
    }
    /// <p>The Amazon Resource Name (ARN) for the service access role that you want to use to create the data migration.</p>
    pub fn service_access_role_arn(&self) -> ::std::option::Option<&str> {
        self.service_access_role_arn.as_deref()
    }
    /// <p>Specifies whether to enable CloudWatch logs for the data migration.</p>
    pub fn enable_cloudwatch_logs(&self) -> ::std::option::Option<bool> {
        self.enable_cloudwatch_logs
    }
    /// <p>Specifies information about the source data provider.</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 `.source_data_settings.is_none()`.
    pub fn source_data_settings(&self) -> &[crate::types::SourceDataSetting] {
        self.source_data_settings.as_deref().unwrap_or_default()
    }
    /// <p>Specifies information about the target data provider.</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_data_settings.is_none()`.
    pub fn target_data_settings(&self) -> &[crate::types::TargetDataSetting] {
        self.target_data_settings.as_deref().unwrap_or_default()
    }
    /// <p>The number of parallel jobs that trigger parallel threads to unload the tables from the source, and then load them to the target.</p>
    pub fn number_of_jobs(&self) -> ::std::option::Option<i32> {
        self.number_of_jobs
    }
    /// <p>One or more tags to be assigned to the data migration.</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.is_none()`.
    pub fn tags(&self) -> &[crate::types::Tag] {
        self.tags.as_deref().unwrap_or_default()
    }
    /// <p>An optional JSON string specifying what tables, views, and schemas to include or exclude from the migration.</p>
    pub fn selection_rules(&self) -> ::std::option::Option<&str> {
        self.selection_rules.as_deref()
    }
}
impl ::std::fmt::Debug for CreateDataMigrationInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateDataMigrationInput");
        formatter.field("data_migration_name", &self.data_migration_name);
        formatter.field("migration_project_identifier", &self.migration_project_identifier);
        formatter.field("data_migration_type", &self.data_migration_type);
        formatter.field("service_access_role_arn", &self.service_access_role_arn);
        formatter.field("enable_cloudwatch_logs", &self.enable_cloudwatch_logs);
        formatter.field("source_data_settings", &self.source_data_settings);
        formatter.field("target_data_settings", &self.target_data_settings);
        formatter.field("number_of_jobs", &self.number_of_jobs);
        formatter.field("tags", &self.tags);
        formatter.field("selection_rules", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}
impl CreateDataMigrationInput {
    /// Creates a new builder-style object to manufacture [`CreateDataMigrationInput`](crate::operation::create_data_migration::CreateDataMigrationInput).
    pub fn builder() -> crate::operation::create_data_migration::builders::CreateDataMigrationInputBuilder {
        crate::operation::create_data_migration::builders::CreateDataMigrationInputBuilder::default()
    }
}

/// A builder for [`CreateDataMigrationInput`](crate::operation::create_data_migration::CreateDataMigrationInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CreateDataMigrationInputBuilder {
    pub(crate) data_migration_name: ::std::option::Option<::std::string::String>,
    pub(crate) migration_project_identifier: ::std::option::Option<::std::string::String>,
    pub(crate) data_migration_type: ::std::option::Option<crate::types::MigrationTypeValue>,
    pub(crate) service_access_role_arn: ::std::option::Option<::std::string::String>,
    pub(crate) enable_cloudwatch_logs: ::std::option::Option<bool>,
    pub(crate) source_data_settings: ::std::option::Option<::std::vec::Vec<crate::types::SourceDataSetting>>,
    pub(crate) target_data_settings: ::std::option::Option<::std::vec::Vec<crate::types::TargetDataSetting>>,
    pub(crate) number_of_jobs: ::std::option::Option<i32>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    pub(crate) selection_rules: ::std::option::Option<::std::string::String>,
}
impl CreateDataMigrationInputBuilder {
    /// <p>A user-friendly name for the data migration. Data migration names have the following constraints:</p>
    /// <ul>
    /// <li>
    /// <p>Must begin with a letter, and can only contain ASCII letters, digits, and hyphens.</p></li>
    /// <li>
    /// <p>Can't end with a hyphen or contain two consecutive hyphens.</p></li>
    /// <li>
    /// <p>Length must be from 1 to 255 characters.</p></li>
    /// </ul>
    pub fn data_migration_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.data_migration_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A user-friendly name for the data migration. Data migration names have the following constraints:</p>
    /// <ul>
    /// <li>
    /// <p>Must begin with a letter, and can only contain ASCII letters, digits, and hyphens.</p></li>
    /// <li>
    /// <p>Can't end with a hyphen or contain two consecutive hyphens.</p></li>
    /// <li>
    /// <p>Length must be from 1 to 255 characters.</p></li>
    /// </ul>
    pub fn set_data_migration_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.data_migration_name = input;
        self
    }
    /// <p>A user-friendly name for the data migration. Data migration names have the following constraints:</p>
    /// <ul>
    /// <li>
    /// <p>Must begin with a letter, and can only contain ASCII letters, digits, and hyphens.</p></li>
    /// <li>
    /// <p>Can't end with a hyphen or contain two consecutive hyphens.</p></li>
    /// <li>
    /// <p>Length must be from 1 to 255 characters.</p></li>
    /// </ul>
    pub fn get_data_migration_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.data_migration_name
    }
    /// <p>An identifier for the migration project.</p>
    /// This field is required.
    pub fn migration_project_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.migration_project_identifier = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>An identifier for the migration project.</p>
    pub fn set_migration_project_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.migration_project_identifier = input;
        self
    }
    /// <p>An identifier for the migration project.</p>
    pub fn get_migration_project_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.migration_project_identifier
    }
    /// <p>Specifies if the data migration is full-load only, change data capture (CDC) only, or full-load and CDC.</p>
    /// This field is required.
    pub fn data_migration_type(mut self, input: crate::types::MigrationTypeValue) -> Self {
        self.data_migration_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies if the data migration is full-load only, change data capture (CDC) only, or full-load and CDC.</p>
    pub fn set_data_migration_type(mut self, input: ::std::option::Option<crate::types::MigrationTypeValue>) -> Self {
        self.data_migration_type = input;
        self
    }
    /// <p>Specifies if the data migration is full-load only, change data capture (CDC) only, or full-load and CDC.</p>
    pub fn get_data_migration_type(&self) -> &::std::option::Option<crate::types::MigrationTypeValue> {
        &self.data_migration_type
    }
    /// <p>The Amazon Resource Name (ARN) for the service access role that you want to use to create the data migration.</p>
    /// This field is required.
    pub fn service_access_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.service_access_role_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) for the service access role that you want to use to create the data migration.</p>
    pub fn set_service_access_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.service_access_role_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) for the service access role that you want to use to create the data migration.</p>
    pub fn get_service_access_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.service_access_role_arn
    }
    /// <p>Specifies whether to enable CloudWatch logs for the data migration.</p>
    pub fn enable_cloudwatch_logs(mut self, input: bool) -> Self {
        self.enable_cloudwatch_logs = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies whether to enable CloudWatch logs for the data migration.</p>
    pub fn set_enable_cloudwatch_logs(mut self, input: ::std::option::Option<bool>) -> Self {
        self.enable_cloudwatch_logs = input;
        self
    }
    /// <p>Specifies whether to enable CloudWatch logs for the data migration.</p>
    pub fn get_enable_cloudwatch_logs(&self) -> &::std::option::Option<bool> {
        &self.enable_cloudwatch_logs
    }
    /// Appends an item to `source_data_settings`.
    ///
    /// To override the contents of this collection use [`set_source_data_settings`](Self::set_source_data_settings).
    ///
    /// <p>Specifies information about the source data provider.</p>
    pub fn source_data_settings(mut self, input: crate::types::SourceDataSetting) -> Self {
        let mut v = self.source_data_settings.unwrap_or_default();
        v.push(input);
        self.source_data_settings = ::std::option::Option::Some(v);
        self
    }
    /// <p>Specifies information about the source data provider.</p>
    pub fn set_source_data_settings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SourceDataSetting>>) -> Self {
        self.source_data_settings = input;
        self
    }
    /// <p>Specifies information about the source data provider.</p>
    pub fn get_source_data_settings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SourceDataSetting>> {
        &self.source_data_settings
    }
    /// Appends an item to `target_data_settings`.
    ///
    /// To override the contents of this collection use [`set_target_data_settings`](Self::set_target_data_settings).
    ///
    /// <p>Specifies information about the target data provider.</p>
    pub fn target_data_settings(mut self, input: crate::types::TargetDataSetting) -> Self {
        let mut v = self.target_data_settings.unwrap_or_default();
        v.push(input);
        self.target_data_settings = ::std::option::Option::Some(v);
        self
    }
    /// <p>Specifies information about the target data provider.</p>
    pub fn set_target_data_settings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TargetDataSetting>>) -> Self {
        self.target_data_settings = input;
        self
    }
    /// <p>Specifies information about the target data provider.</p>
    pub fn get_target_data_settings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TargetDataSetting>> {
        &self.target_data_settings
    }
    /// <p>The number of parallel jobs that trigger parallel threads to unload the tables from the source, and then load them to the target.</p>
    pub fn number_of_jobs(mut self, input: i32) -> Self {
        self.number_of_jobs = ::std::option::Option::Some(input);
        self
    }
    /// <p>The number of parallel jobs that trigger parallel threads to unload the tables from the source, and then load them to the target.</p>
    pub fn set_number_of_jobs(mut self, input: ::std::option::Option<i32>) -> Self {
        self.number_of_jobs = input;
        self
    }
    /// <p>The number of parallel jobs that trigger parallel threads to unload the tables from the source, and then load them to the target.</p>
    pub fn get_number_of_jobs(&self) -> &::std::option::Option<i32> {
        &self.number_of_jobs
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>One or more tags to be assigned to the data migration.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.tags.unwrap_or_default();
        v.push(input);
        self.tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>One or more tags to be assigned to the data migration.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>One or more tags to be assigned to the data migration.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// <p>An optional JSON string specifying what tables, views, and schemas to include or exclude from the migration.</p>
    pub fn selection_rules(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.selection_rules = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>An optional JSON string specifying what tables, views, and schemas to include or exclude from the migration.</p>
    pub fn set_selection_rules(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.selection_rules = input;
        self
    }
    /// <p>An optional JSON string specifying what tables, views, and schemas to include or exclude from the migration.</p>
    pub fn get_selection_rules(&self) -> &::std::option::Option<::std::string::String> {
        &self.selection_rules
    }
    /// Consumes the builder and constructs a [`CreateDataMigrationInput`](crate::operation::create_data_migration::CreateDataMigrationInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_data_migration::CreateDataMigrationInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_data_migration::CreateDataMigrationInput {
            data_migration_name: self.data_migration_name,
            migration_project_identifier: self.migration_project_identifier,
            data_migration_type: self.data_migration_type,
            service_access_role_arn: self.service_access_role_arn,
            enable_cloudwatch_logs: self.enable_cloudwatch_logs,
            source_data_settings: self.source_data_settings,
            target_data_settings: self.target_data_settings,
            number_of_jobs: self.number_of_jobs,
            tags: self.tags,
            selection_rules: self.selection_rules,
        })
    }
}
impl ::std::fmt::Debug for CreateDataMigrationInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateDataMigrationInputBuilder");
        formatter.field("data_migration_name", &self.data_migration_name);
        formatter.field("migration_project_identifier", &self.migration_project_identifier);
        formatter.field("data_migration_type", &self.data_migration_type);
        formatter.field("service_access_role_arn", &self.service_access_role_arn);
        formatter.field("enable_cloudwatch_logs", &self.enable_cloudwatch_logs);
        formatter.field("source_data_settings", &self.source_data_settings);
        formatter.field("target_data_settings", &self.target_data_settings);
        formatter.field("number_of_jobs", &self.number_of_jobs);
        formatter.field("tags", &self.tags);
        formatter.field("selection_rules", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}