aws-sdk-endusermessaging 1.0.0

AWS SDK for AWS End User Messaging
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// Information about an async job tracked by the service. GetJob returns the full `Job`, which may grow detail-only fields that are not part of the `JobSummary` list view.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetJobOutput {
    /// <p>The unique identifier of the asynchronous job. Use the GetJob operation to check the status of the job and to retrieve its results.</p>
    pub job_id: ::std::string::String,
    /// <p>The current lifecycle status of the job.</p>
    pub status: crate::types::JobStatus,
    /// <p>The type of mutating operation that created the job.</p>
    pub operation_type: ::std::string::String,
    /// <p>The time when the resource was created, in Unix epoch time.</p>
    pub created_at: ::aws_smithy_types::DateTime,
    /// <p>The time when the resource was last updated, in Unix epoch time.</p>
    pub updated_at: ::aws_smithy_types::DateTime,
    /// <p>The brand profile that the job operates on. This value is absent for operations that create a brand profile.</p>
    pub brand_profile_id: ::std::option::Option<::std::string::String>,
    /// <p>A machine-readable code that identifies why the job failed. This value is present only when the job status is FAILED.</p>
    pub error_code: ::std::option::Option<::std::string::String>,
    /// <p>A human-readable description of why the job failed. This value is present only when the job status is FAILED.</p>
    pub error_message: ::std::option::Option<::std::string::String>,
    /// <p>The resources that were created or updated by the job.</p>
    pub resources: ::std::option::Option<::std::vec::Vec<crate::types::JobResource>>,
    _request_id: Option<String>,
}
impl GetJobOutput {
    /// <p>The unique identifier of the asynchronous job. Use the GetJob operation to check the status of the job and to retrieve its results.</p>
    pub fn job_id(&self) -> &str {
        use std::ops::Deref;
        self.job_id.deref()
    }
    /// <p>The current lifecycle status of the job.</p>
    pub fn status(&self) -> &crate::types::JobStatus {
        &self.status
    }
    /// <p>The type of mutating operation that created the job.</p>
    pub fn operation_type(&self) -> &str {
        use std::ops::Deref;
        self.operation_type.deref()
    }
    /// <p>The time when the resource was created, in Unix epoch time.</p>
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    /// <p>The time when the resource was last updated, in Unix epoch time.</p>
    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
        &self.updated_at
    }
    /// <p>The brand profile that the job operates on. This value is absent for operations that create a brand profile.</p>
    pub fn brand_profile_id(&self) -> ::std::option::Option<&str> {
        self.brand_profile_id.as_deref()
    }
    /// <p>A machine-readable code that identifies why the job failed. This value is present only when the job status is FAILED.</p>
    pub fn error_code(&self) -> ::std::option::Option<&str> {
        self.error_code.as_deref()
    }
    /// <p>A human-readable description of why the job failed. This value is present only when the job status is FAILED.</p>
    pub fn error_message(&self) -> ::std::option::Option<&str> {
        self.error_message.as_deref()
    }
    /// <p>The resources that were created or updated by the job.</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 `.resources.is_none()`.
    pub fn resources(&self) -> &[crate::types::JobResource] {
        self.resources.as_deref().unwrap_or_default()
    }
}
impl ::aws_types::request_id::RequestId for GetJobOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetJobOutput {
    /// Creates a new builder-style object to manufacture [`GetJobOutput`](crate::operation::get_job::GetJobOutput).
    pub fn builder() -> crate::operation::get_job::builders::GetJobOutputBuilder {
        crate::operation::get_job::builders::GetJobOutputBuilder::default()
    }
}

/// A builder for [`GetJobOutput`](crate::operation::get_job::GetJobOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetJobOutputBuilder {
    pub(crate) job_id: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::JobStatus>,
    pub(crate) operation_type: ::std::option::Option<::std::string::String>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) brand_profile_id: ::std::option::Option<::std::string::String>,
    pub(crate) error_code: ::std::option::Option<::std::string::String>,
    pub(crate) error_message: ::std::option::Option<::std::string::String>,
    pub(crate) resources: ::std::option::Option<::std::vec::Vec<crate::types::JobResource>>,
    _request_id: Option<String>,
}
impl GetJobOutputBuilder {
    /// <p>The unique identifier of the asynchronous job. Use the GetJob operation to check the status of the job and to retrieve its results.</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 asynchronous job. Use the GetJob operation to check the status of the job and to retrieve its results.</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 asynchronous job. Use the GetJob operation to check the status of the job and to retrieve its results.</p>
    pub fn get_job_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.job_id
    }
    /// <p>The current lifecycle 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 lifecycle 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 lifecycle status of the job.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::JobStatus> {
        &self.status
    }
    /// <p>The type of mutating operation that created the job.</p>
    /// This field is required.
    pub fn operation_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.operation_type = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The type of mutating operation that created the job.</p>
    pub fn set_operation_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.operation_type = input;
        self
    }
    /// <p>The type of mutating operation that created the job.</p>
    pub fn get_operation_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.operation_type
    }
    /// <p>The time when the resource was created, in Unix epoch time.</p>
    /// This field is required.
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time when the resource was created, in Unix epoch time.</p>
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// <p>The time when the resource was created, in Unix epoch time.</p>
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// <p>The time when the resource was last updated, in Unix epoch time.</p>
    /// This field is required.
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time when the resource was last updated, in Unix epoch time.</p>
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// <p>The time when the resource was last updated, in Unix epoch time.</p>
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    /// <p>The brand profile that the job operates on. This value is absent for operations that create a brand profile.</p>
    pub fn brand_profile_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.brand_profile_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The brand profile that the job operates on. This value is absent for operations that create a brand profile.</p>
    pub fn set_brand_profile_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.brand_profile_id = input;
        self
    }
    /// <p>The brand profile that the job operates on. This value is absent for operations that create a brand profile.</p>
    pub fn get_brand_profile_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.brand_profile_id
    }
    /// <p>A machine-readable code that identifies why the job failed. This value is present only when the job status is FAILED.</p>
    pub fn error_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.error_code = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A machine-readable code that identifies why the job failed. This value is present only when the job status is FAILED.</p>
    pub fn set_error_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.error_code = input;
        self
    }
    /// <p>A machine-readable code that identifies why the job failed. This value is present only when the job status is FAILED.</p>
    pub fn get_error_code(&self) -> &::std::option::Option<::std::string::String> {
        &self.error_code
    }
    /// <p>A human-readable description of why the job failed. This value is present only when the job status is FAILED.</p>
    pub fn error_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.error_message = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A human-readable description of why the job failed. This value is present only when the job status is FAILED.</p>
    pub fn set_error_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.error_message = input;
        self
    }
    /// <p>A human-readable description of why the job failed. This value is present only when the job status is FAILED.</p>
    pub fn get_error_message(&self) -> &::std::option::Option<::std::string::String> {
        &self.error_message
    }
    /// Appends an item to `resources`.
    ///
    /// To override the contents of this collection use [`set_resources`](Self::set_resources).
    ///
    /// <p>The resources that were created or updated by the job.</p>
    pub fn resources(mut self, input: crate::types::JobResource) -> Self {
        let mut v = self.resources.unwrap_or_default();
        v.push(input);
        self.resources = ::std::option::Option::Some(v);
        self
    }
    /// <p>The resources that were created or updated by the job.</p>
    pub fn set_resources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::JobResource>>) -> Self {
        self.resources = input;
        self
    }
    /// <p>The resources that were created or updated by the job.</p>
    pub fn get_resources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::JobResource>> {
        &self.resources
    }
    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 [`GetJobOutput`](crate::operation::get_job::GetJobOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`job_id`](crate::operation::get_job::builders::GetJobOutputBuilder::job_id)
    /// - [`status`](crate::operation::get_job::builders::GetJobOutputBuilder::status)
    /// - [`operation_type`](crate::operation::get_job::builders::GetJobOutputBuilder::operation_type)
    /// - [`created_at`](crate::operation::get_job::builders::GetJobOutputBuilder::created_at)
    /// - [`updated_at`](crate::operation::get_job::builders::GetJobOutputBuilder::updated_at)
    pub fn build(self) -> ::std::result::Result<crate::operation::get_job::GetJobOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_job::GetJobOutput {
            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 GetJobOutput",
                )
            })?,
            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 GetJobOutput",
                )
            })?,
            operation_type: self.operation_type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "operation_type",
                    "operation_type was not specified but it is required when building GetJobOutput",
                )
            })?,
            created_at: self.created_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "created_at",
                    "created_at was not specified but it is required when building GetJobOutput",
                )
            })?,
            updated_at: self.updated_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "updated_at",
                    "updated_at was not specified but it is required when building GetJobOutput",
                )
            })?,
            brand_profile_id: self.brand_profile_id,
            error_code: self.error_code,
            error_message: self.error_message,
            resources: self.resources,
            _request_id: self._request_id,
        })
    }
}