aws-sdk-codestar 1.39.0

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

/// <p>Location and destination information about the source code files provided with the project request. The source code is uploaded to the new project source repository after project creation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Code {
    /// <p>The location where the source code files provided with the project request are stored. AWS CodeStar retrieves the files during project creation.</p>
    pub source: ::std::option::Option<crate::types::CodeSource>,
    /// <p>The repository to be created in AWS CodeStar. Valid values are AWS CodeCommit or GitHub. After AWS CodeStar provisions the new repository, the source code files provided with the project request are placed in the repository.</p>
    pub destination: ::std::option::Option<crate::types::CodeDestination>,
}
impl Code {
    /// <p>The location where the source code files provided with the project request are stored. AWS CodeStar retrieves the files during project creation.</p>
    pub fn source(&self) -> ::std::option::Option<&crate::types::CodeSource> {
        self.source.as_ref()
    }
    /// <p>The repository to be created in AWS CodeStar. Valid values are AWS CodeCommit or GitHub. After AWS CodeStar provisions the new repository, the source code files provided with the project request are placed in the repository.</p>
    pub fn destination(&self) -> ::std::option::Option<&crate::types::CodeDestination> {
        self.destination.as_ref()
    }
}
impl Code {
    /// Creates a new builder-style object to manufacture [`Code`](crate::types::Code).
    pub fn builder() -> crate::types::builders::CodeBuilder {
        crate::types::builders::CodeBuilder::default()
    }
}

/// A builder for [`Code`](crate::types::Code).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CodeBuilder {
    pub(crate) source: ::std::option::Option<crate::types::CodeSource>,
    pub(crate) destination: ::std::option::Option<crate::types::CodeDestination>,
}
impl CodeBuilder {
    /// <p>The location where the source code files provided with the project request are stored. AWS CodeStar retrieves the files during project creation.</p>
    /// This field is required.
    pub fn source(mut self, input: crate::types::CodeSource) -> Self {
        self.source = ::std::option::Option::Some(input);
        self
    }
    /// <p>The location where the source code files provided with the project request are stored. AWS CodeStar retrieves the files during project creation.</p>
    pub fn set_source(mut self, input: ::std::option::Option<crate::types::CodeSource>) -> Self {
        self.source = input;
        self
    }
    /// <p>The location where the source code files provided with the project request are stored. AWS CodeStar retrieves the files during project creation.</p>
    pub fn get_source(&self) -> &::std::option::Option<crate::types::CodeSource> {
        &self.source
    }
    /// <p>The repository to be created in AWS CodeStar. Valid values are AWS CodeCommit or GitHub. After AWS CodeStar provisions the new repository, the source code files provided with the project request are placed in the repository.</p>
    /// This field is required.
    pub fn destination(mut self, input: crate::types::CodeDestination) -> Self {
        self.destination = ::std::option::Option::Some(input);
        self
    }
    /// <p>The repository to be created in AWS CodeStar. Valid values are AWS CodeCommit or GitHub. After AWS CodeStar provisions the new repository, the source code files provided with the project request are placed in the repository.</p>
    pub fn set_destination(mut self, input: ::std::option::Option<crate::types::CodeDestination>) -> Self {
        self.destination = input;
        self
    }
    /// <p>The repository to be created in AWS CodeStar. Valid values are AWS CodeCommit or GitHub. After AWS CodeStar provisions the new repository, the source code files provided with the project request are placed in the repository.</p>
    pub fn get_destination(&self) -> &::std::option::Option<crate::types::CodeDestination> {
        &self.destination
    }
    /// Consumes the builder and constructs a [`Code`](crate::types::Code).
    pub fn build(self) -> crate::types::Code {
        crate::types::Code {
            source: self.source,
            destination: self.destination,
        }
    }
}