aws-sdk-entityresolution 1.108.0

AWS SDK for AWS EntityResolution
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 GetMatchingJobOutput {
    /// <p>The unique identifier of the matching job.</p>
    pub job_id: ::std::string::String,
    /// <p>The current status of the job.</p>
    pub status: crate::types::JobStatus,
    /// <p>The time at which the job was started.</p>
    pub start_time: ::aws_smithy_types::DateTime,
    /// <p>The time at which the job has finished.</p>
    pub end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>Metrics associated with the execution, specifically total records processed, unique IDs generated, and records the execution skipped.</p>
    pub metrics: ::std::option::Option<crate::types::JobMetrics>,
    /// <p>An object containing an error message, if there was an error.</p>
    pub error_details: ::std::option::Option<crate::types::ErrorDetails>,
    /// <p>A list of <code>OutputSource</code> objects.</p>
    pub output_source_config: ::std::option::Option<::std::vec::Vec<crate::types::JobOutputSource>>,
    _request_id: Option<String>,
}
impl GetMatchingJobOutput {
    /// <p>The unique identifier of the matching job.</p>
    pub fn job_id(&self) -> &str {
        use std::ops::Deref;
        self.job_id.deref()
    }
    /// <p>The current status of the job.</p>
    pub fn status(&self) -> &crate::types::JobStatus {
        &self.status
    }
    /// <p>The time at which the job was started.</p>
    pub fn start_time(&self) -> &::aws_smithy_types::DateTime {
        &self.start_time
    }
    /// <p>The time at which the job has finished.</p>
    pub fn end_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.end_time.as_ref()
    }
    /// <p>Metrics associated with the execution, specifically total records processed, unique IDs generated, and records the execution skipped.</p>
    pub fn metrics(&self) -> ::std::option::Option<&crate::types::JobMetrics> {
        self.metrics.as_ref()
    }
    /// <p>An object containing an error message, if there was an error.</p>
    pub fn error_details(&self) -> ::std::option::Option<&crate::types::ErrorDetails> {
        self.error_details.as_ref()
    }
    /// <p>A list of <code>OutputSource</code> objects.</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 `.output_source_config.is_none()`.
    pub fn output_source_config(&self) -> &[crate::types::JobOutputSource] {
        self.output_source_config.as_deref().unwrap_or_default()
    }
}
impl ::aws_types::request_id::RequestId for GetMatchingJobOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetMatchingJobOutput {
    /// Creates a new builder-style object to manufacture [`GetMatchingJobOutput`](crate::operation::get_matching_job::GetMatchingJobOutput).
    pub fn builder() -> crate::operation::get_matching_job::builders::GetMatchingJobOutputBuilder {
        crate::operation::get_matching_job::builders::GetMatchingJobOutputBuilder::default()
    }
}

/// A builder for [`GetMatchingJobOutput`](crate::operation::get_matching_job::GetMatchingJobOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetMatchingJobOutputBuilder {
    pub(crate) job_id: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::JobStatus>,
    pub(crate) start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) metrics: ::std::option::Option<crate::types::JobMetrics>,
    pub(crate) error_details: ::std::option::Option<crate::types::ErrorDetails>,
    pub(crate) output_source_config: ::std::option::Option<::std::vec::Vec<crate::types::JobOutputSource>>,
    _request_id: Option<String>,
}
impl GetMatchingJobOutputBuilder {
    /// <p>The unique identifier of the matching job.</p>
    /// This field is required.
    pub fn job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.job_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the matching job.</p>
    pub fn set_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.job_id = input;
        self
    }
    /// <p>The unique identifier of the matching job.</p>
    pub fn get_job_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.job_id
    }
    /// <p>The current status of the job.</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::JobStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current status of the job.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::JobStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The current status of the job.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::JobStatus> {
        &self.status
    }
    /// <p>The time at which the job was started.</p>
    /// This field is required.
    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.start_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time at which the job was started.</p>
    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.start_time = input;
        self
    }
    /// <p>The time at which the job was started.</p>
    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.start_time
    }
    /// <p>The time at which the job has finished.</p>
    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.end_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time at which the job has finished.</p>
    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.end_time = input;
        self
    }
    /// <p>The time at which the job has finished.</p>
    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.end_time
    }
    /// <p>Metrics associated with the execution, specifically total records processed, unique IDs generated, and records the execution skipped.</p>
    pub fn metrics(mut self, input: crate::types::JobMetrics) -> Self {
        self.metrics = ::std::option::Option::Some(input);
        self
    }
    /// <p>Metrics associated with the execution, specifically total records processed, unique IDs generated, and records the execution skipped.</p>
    pub fn set_metrics(mut self, input: ::std::option::Option<crate::types::JobMetrics>) -> Self {
        self.metrics = input;
        self
    }
    /// <p>Metrics associated with the execution, specifically total records processed, unique IDs generated, and records the execution skipped.</p>
    pub fn get_metrics(&self) -> &::std::option::Option<crate::types::JobMetrics> {
        &self.metrics
    }
    /// <p>An object containing an error message, if there was an error.</p>
    pub fn error_details(mut self, input: crate::types::ErrorDetails) -> Self {
        self.error_details = ::std::option::Option::Some(input);
        self
    }
    /// <p>An object containing an error message, if there was an error.</p>
    pub fn set_error_details(mut self, input: ::std::option::Option<crate::types::ErrorDetails>) -> Self {
        self.error_details = input;
        self
    }
    /// <p>An object containing an error message, if there was an error.</p>
    pub fn get_error_details(&self) -> &::std::option::Option<crate::types::ErrorDetails> {
        &self.error_details
    }
    /// Appends an item to `output_source_config`.
    ///
    /// To override the contents of this collection use [`set_output_source_config`](Self::set_output_source_config).
    ///
    /// <p>A list of <code>OutputSource</code> objects.</p>
    pub fn output_source_config(mut self, input: crate::types::JobOutputSource) -> Self {
        let mut v = self.output_source_config.unwrap_or_default();
        v.push(input);
        self.output_source_config = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of <code>OutputSource</code> objects.</p>
    pub fn set_output_source_config(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::JobOutputSource>>) -> Self {
        self.output_source_config = input;
        self
    }
    /// <p>A list of <code>OutputSource</code> objects.</p>
    pub fn get_output_source_config(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::JobOutputSource>> {
        &self.output_source_config
    }
    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 [`GetMatchingJobOutput`](crate::operation::get_matching_job::GetMatchingJobOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`job_id`](crate::operation::get_matching_job::builders::GetMatchingJobOutputBuilder::job_id)
    /// - [`status`](crate::operation::get_matching_job::builders::GetMatchingJobOutputBuilder::status)
    /// - [`start_time`](crate::operation::get_matching_job::builders::GetMatchingJobOutputBuilder::start_time)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_matching_job::GetMatchingJobOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_matching_job::GetMatchingJobOutput {
            job_id: self.job_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "job_id",
                    "job_id was not specified but it is required when building GetMatchingJobOutput",
                )
            })?,
            status: self.status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "status",
                    "status was not specified but it is required when building GetMatchingJobOutput",
                )
            })?,
            start_time: self.start_time.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "start_time",
                    "start_time was not specified but it is required when building GetMatchingJobOutput",
                )
            })?,
            end_time: self.end_time,
            metrics: self.metrics,
            error_details: self.error_details,
            output_source_config: self.output_source_config,
            _request_id: self._request_id,
        })
    }
}