aws-sdk-opensearch 1.138.0

AWS SDK for Amazon OpenSearch 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, ::std::fmt::Debug)]
pub struct GetMigrationOutput {
    /// <p>The unique identifier of the migration job.</p>
    pub migration_id: ::std::option::Option<::std::string::String>,
    /// <p>The current status of the migration job. Valid values are <code>PENDING</code>, <code>IN_PROGRESS</code>, <code>SUCCEEDED</code>, and <code>FAILED</code>.</p>
    pub status: ::std::option::Option<::std::string::String>,
    /// <p>The unique identifier of the OpenSearch application associated with the migration.</p>
    pub application_id: ::std::option::Option<::std::string::String>,
    /// <p>The source configuration for the migration, including the data source ARN.</p>
    pub source: ::std::option::Option<crate::types::MigrationSource>,
    /// <p>The number of saved objects exported from the source data source.</p>
    pub exported_count: i32,
    /// <p>The number of saved objects successfully imported into the target workspace.</p>
    pub imported_count: i32,
    /// <p>Error details if the migration failed or completed with errors.</p>
    pub error: ::std::option::Option<crate::types::MigrationError>,
    /// <p>The date and time when the migration job was created.</p>
    pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The date and time when the migration job was last updated.</p>
    pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetMigrationOutput {
    /// <p>The unique identifier of the migration job.</p>
    pub fn migration_id(&self) -> ::std::option::Option<&str> {
        self.migration_id.as_deref()
    }
    /// <p>The current status of the migration job. Valid values are <code>PENDING</code>, <code>IN_PROGRESS</code>, <code>SUCCEEDED</code>, and <code>FAILED</code>.</p>
    pub fn status(&self) -> ::std::option::Option<&str> {
        self.status.as_deref()
    }
    /// <p>The unique identifier of the OpenSearch application associated with the migration.</p>
    pub fn application_id(&self) -> ::std::option::Option<&str> {
        self.application_id.as_deref()
    }
    /// <p>The source configuration for the migration, including the data source ARN.</p>
    pub fn source(&self) -> ::std::option::Option<&crate::types::MigrationSource> {
        self.source.as_ref()
    }
    /// <p>The number of saved objects exported from the source data source.</p>
    pub fn exported_count(&self) -> i32 {
        self.exported_count
    }
    /// <p>The number of saved objects successfully imported into the target workspace.</p>
    pub fn imported_count(&self) -> i32 {
        self.imported_count
    }
    /// <p>Error details if the migration failed or completed with errors.</p>
    pub fn error(&self) -> ::std::option::Option<&crate::types::MigrationError> {
        self.error.as_ref()
    }
    /// <p>The date and time when the migration job was created.</p>
    pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.created_at.as_ref()
    }
    /// <p>The date and time when the migration job was last updated.</p>
    pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.updated_at.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for GetMigrationOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetMigrationOutput {
    /// Creates a new builder-style object to manufacture [`GetMigrationOutput`](crate::operation::get_migration::GetMigrationOutput).
    pub fn builder() -> crate::operation::get_migration::builders::GetMigrationOutputBuilder {
        crate::operation::get_migration::builders::GetMigrationOutputBuilder::default()
    }
}

/// A builder for [`GetMigrationOutput`](crate::operation::get_migration::GetMigrationOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetMigrationOutputBuilder {
    pub(crate) migration_id: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<::std::string::String>,
    pub(crate) application_id: ::std::option::Option<::std::string::String>,
    pub(crate) source: ::std::option::Option<crate::types::MigrationSource>,
    pub(crate) exported_count: ::std::option::Option<i32>,
    pub(crate) imported_count: ::std::option::Option<i32>,
    pub(crate) error: ::std::option::Option<crate::types::MigrationError>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetMigrationOutputBuilder {
    /// <p>The unique identifier of the migration job.</p>
    pub fn migration_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.migration_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the migration job.</p>
    pub fn set_migration_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.migration_id = input;
        self
    }
    /// <p>The unique identifier of the migration job.</p>
    pub fn get_migration_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.migration_id
    }
    /// <p>The current status of the migration job. Valid values are <code>PENDING</code>, <code>IN_PROGRESS</code>, <code>SUCCEEDED</code>, and <code>FAILED</code>.</p>
    pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.status = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The current status of the migration job. Valid values are <code>PENDING</code>, <code>IN_PROGRESS</code>, <code>SUCCEEDED</code>, and <code>FAILED</code>.</p>
    pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.status = input;
        self
    }
    /// <p>The current status of the migration job. Valid values are <code>PENDING</code>, <code>IN_PROGRESS</code>, <code>SUCCEEDED</code>, and <code>FAILED</code>.</p>
    pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
        &self.status
    }
    /// <p>The unique identifier of the OpenSearch application associated with the migration.</p>
    pub fn application_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.application_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the OpenSearch application associated with the migration.</p>
    pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.application_id = input;
        self
    }
    /// <p>The unique identifier of the OpenSearch application associated with the migration.</p>
    pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.application_id
    }
    /// <p>The source configuration for the migration, including the data source ARN.</p>
    pub fn source(mut self, input: crate::types::MigrationSource) -> Self {
        self.source = ::std::option::Option::Some(input);
        self
    }
    /// <p>The source configuration for the migration, including the data source ARN.</p>
    pub fn set_source(mut self, input: ::std::option::Option<crate::types::MigrationSource>) -> Self {
        self.source = input;
        self
    }
    /// <p>The source configuration for the migration, including the data source ARN.</p>
    pub fn get_source(&self) -> &::std::option::Option<crate::types::MigrationSource> {
        &self.source
    }
    /// <p>The number of saved objects exported from the source data source.</p>
    pub fn exported_count(mut self, input: i32) -> Self {
        self.exported_count = ::std::option::Option::Some(input);
        self
    }
    /// <p>The number of saved objects exported from the source data source.</p>
    pub fn set_exported_count(mut self, input: ::std::option::Option<i32>) -> Self {
        self.exported_count = input;
        self
    }
    /// <p>The number of saved objects exported from the source data source.</p>
    pub fn get_exported_count(&self) -> &::std::option::Option<i32> {
        &self.exported_count
    }
    /// <p>The number of saved objects successfully imported into the target workspace.</p>
    pub fn imported_count(mut self, input: i32) -> Self {
        self.imported_count = ::std::option::Option::Some(input);
        self
    }
    /// <p>The number of saved objects successfully imported into the target workspace.</p>
    pub fn set_imported_count(mut self, input: ::std::option::Option<i32>) -> Self {
        self.imported_count = input;
        self
    }
    /// <p>The number of saved objects successfully imported into the target workspace.</p>
    pub fn get_imported_count(&self) -> &::std::option::Option<i32> {
        &self.imported_count
    }
    /// <p>Error details if the migration failed or completed with errors.</p>
    pub fn error(mut self, input: crate::types::MigrationError) -> Self {
        self.error = ::std::option::Option::Some(input);
        self
    }
    /// <p>Error details if the migration failed or completed with errors.</p>
    pub fn set_error(mut self, input: ::std::option::Option<crate::types::MigrationError>) -> Self {
        self.error = input;
        self
    }
    /// <p>Error details if the migration failed or completed with errors.</p>
    pub fn get_error(&self) -> &::std::option::Option<crate::types::MigrationError> {
        &self.error
    }
    /// <p>The date and time when the migration job was created.</p>
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time when the migration job was created.</p>
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// <p>The date and time when the migration job was created.</p>
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// <p>The date and time when the migration job was last updated.</p>
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time when the migration job was last updated.</p>
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// <p>The date and time when the migration job was last updated.</p>
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetMigrationOutput`](crate::operation::get_migration::GetMigrationOutput).
    pub fn build(self) -> crate::operation::get_migration::GetMigrationOutput {
        crate::operation::get_migration::GetMigrationOutput {
            migration_id: self.migration_id,
            status: self.status,
            application_id: self.application_id,
            source: self.source,
            exported_count: self.exported_count.unwrap_or_default(),
            imported_count: self.imported_count.unwrap_or_default(),
            error: self.error,
            created_at: self.created_at,
            updated_at: self.updated_at,
            _request_id: self._request_id,
        }
    }
}