aws-sdk-codepipeline 1.112.0

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

/// <p>Artifacts are the files that are worked on by actions in the pipeline. See the action configuration for each action for details about artifact parameters. For example, the S3 source action artifact is a file name (or file path), and the files are generally provided as a ZIP file. Example artifact name: SampleApp_Windows.zip</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Artifact {
    /// <p>The artifact's name.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The artifact's revision ID. Depending on the type of object, this could be a commit ID (GitHub) or a revision ID (Amazon S3).</p>
    pub revision: ::std::option::Option<::std::string::String>,
    /// <p>The location of an artifact.</p>
    pub location: ::std::option::Option<crate::types::ArtifactLocation>,
}
impl Artifact {
    /// <p>The artifact's name.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The artifact's revision ID. Depending on the type of object, this could be a commit ID (GitHub) or a revision ID (Amazon S3).</p>
    pub fn revision(&self) -> ::std::option::Option<&str> {
        self.revision.as_deref()
    }
    /// <p>The location of an artifact.</p>
    pub fn location(&self) -> ::std::option::Option<&crate::types::ArtifactLocation> {
        self.location.as_ref()
    }
}
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) name: ::std::option::Option<::std::string::String>,
    pub(crate) revision: ::std::option::Option<::std::string::String>,
    pub(crate) location: ::std::option::Option<crate::types::ArtifactLocation>,
}
impl ArtifactBuilder {
    /// <p>The artifact's name.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The artifact's name.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The artifact's name.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The artifact's revision ID. Depending on the type of object, this could be a commit ID (GitHub) or a revision ID (Amazon S3).</p>
    pub fn revision(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.revision = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The artifact's revision ID. Depending on the type of object, this could be a commit ID (GitHub) or a revision ID (Amazon S3).</p>
    pub fn set_revision(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.revision = input;
        self
    }
    /// <p>The artifact's revision ID. Depending on the type of object, this could be a commit ID (GitHub) or a revision ID (Amazon S3).</p>
    pub fn get_revision(&self) -> &::std::option::Option<::std::string::String> {
        &self.revision
    }
    /// <p>The location of an artifact.</p>
    pub fn location(mut self, input: crate::types::ArtifactLocation) -> Self {
        self.location = ::std::option::Option::Some(input);
        self
    }
    /// <p>The location of an artifact.</p>
    pub fn set_location(mut self, input: ::std::option::Option<crate::types::ArtifactLocation>) -> Self {
        self.location = input;
        self
    }
    /// <p>The location of an artifact.</p>
    pub fn get_location(&self) -> &::std::option::Option<crate::types::ArtifactLocation> {
        &self.location
    }
    /// Consumes the builder and constructs a [`Artifact`](crate::types::Artifact).
    pub fn build(self) -> crate::types::Artifact {
        crate::types::Artifact {
            name: self.name,
            revision: self.revision,
            location: self.location,
        }
    }
}