aws-sdk-amplify 1.111.0

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

/// <p>Describes an artifact.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Artifact {
    /// <p>The file name for the artifact.</p>
    pub artifact_file_name: ::std::string::String,
    /// <p>The unique ID for the artifact.</p>
    pub artifact_id: ::std::string::String,
}
impl Artifact {
    /// <p>The file name for the artifact.</p>
    pub fn artifact_file_name(&self) -> &str {
        use std::ops::Deref;
        self.artifact_file_name.deref()
    }
    /// <p>The unique ID for the artifact.</p>
    pub fn artifact_id(&self) -> &str {
        use std::ops::Deref;
        self.artifact_id.deref()
    }
}
impl Artifact {
    /// Creates a new builder-style object to manufacture [`Artifact`](crate::types::Artifact).
    pub fn builder() -> crate::types::builders::ArtifactBuilder {
        crate::types::builders::ArtifactBuilder::default()
    }
}

/// A builder for [`Artifact`](crate::types::Artifact).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ArtifactBuilder {
    pub(crate) artifact_file_name: ::std::option::Option<::std::string::String>,
    pub(crate) artifact_id: ::std::option::Option<::std::string::String>,
}
impl ArtifactBuilder {
    /// <p>The file name for the artifact.</p>
    /// This field is required.
    pub fn artifact_file_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.artifact_file_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The file name for the artifact.</p>
    pub fn set_artifact_file_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.artifact_file_name = input;
        self
    }
    /// <p>The file name for the artifact.</p>
    pub fn get_artifact_file_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.artifact_file_name
    }
    /// <p>The unique ID for the artifact.</p>
    /// This field is required.
    pub fn artifact_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.artifact_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique ID for the artifact.</p>
    pub fn set_artifact_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.artifact_id = input;
        self
    }
    /// <p>The unique ID for the artifact.</p>
    pub fn get_artifact_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.artifact_id
    }
    /// Consumes the builder and constructs a [`Artifact`](crate::types::Artifact).
    /// This method will fail if any of the following fields are not set:
    /// - [`artifact_file_name`](crate::types::builders::ArtifactBuilder::artifact_file_name)
    /// - [`artifact_id`](crate::types::builders::ArtifactBuilder::artifact_id)
    pub fn build(self) -> ::std::result::Result<crate::types::Artifact, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Artifact {
            artifact_file_name: self.artifact_file_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "artifact_file_name",
                    "artifact_file_name was not specified but it is required when building Artifact",
                )
            })?,
            artifact_id: self.artifact_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "artifact_id",
                    "artifact_id was not specified but it is required when building Artifact",
                )
            })?,
        })
    }
}