aws_sdk_codestar/types/
_code_destination.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <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>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CodeDestination {
7    /// <p>Information about the AWS CodeCommit repository to be created in AWS CodeStar. This is where the source code files provided with the project request will be uploaded after project creation.</p>
8    pub code_commit: ::std::option::Option<crate::types::CodeCommitCodeDestination>,
9    /// <p>Information about the GitHub repository to be created in AWS CodeStar. This is where the source code files provided with the project request will be uploaded after project creation.</p>
10    pub git_hub: ::std::option::Option<crate::types::GitHubCodeDestination>,
11}
12impl CodeDestination {
13    /// <p>Information about the AWS CodeCommit repository to be created in AWS CodeStar. This is where the source code files provided with the project request will be uploaded after project creation.</p>
14    pub fn code_commit(&self) -> ::std::option::Option<&crate::types::CodeCommitCodeDestination> {
15        self.code_commit.as_ref()
16    }
17    /// <p>Information about the GitHub repository to be created in AWS CodeStar. This is where the source code files provided with the project request will be uploaded after project creation.</p>
18    pub fn git_hub(&self) -> ::std::option::Option<&crate::types::GitHubCodeDestination> {
19        self.git_hub.as_ref()
20    }
21}
22impl CodeDestination {
23    /// Creates a new builder-style object to manufacture [`CodeDestination`](crate::types::CodeDestination).
24    pub fn builder() -> crate::types::builders::CodeDestinationBuilder {
25        crate::types::builders::CodeDestinationBuilder::default()
26    }
27}
28
29/// A builder for [`CodeDestination`](crate::types::CodeDestination).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct CodeDestinationBuilder {
33    pub(crate) code_commit: ::std::option::Option<crate::types::CodeCommitCodeDestination>,
34    pub(crate) git_hub: ::std::option::Option<crate::types::GitHubCodeDestination>,
35}
36impl CodeDestinationBuilder {
37    /// <p>Information about the AWS CodeCommit repository to be created in AWS CodeStar. This is where the source code files provided with the project request will be uploaded after project creation.</p>
38    pub fn code_commit(mut self, input: crate::types::CodeCommitCodeDestination) -> Self {
39        self.code_commit = ::std::option::Option::Some(input);
40        self
41    }
42    /// <p>Information about the AWS CodeCommit repository to be created in AWS CodeStar. This is where the source code files provided with the project request will be uploaded after project creation.</p>
43    pub fn set_code_commit(mut self, input: ::std::option::Option<crate::types::CodeCommitCodeDestination>) -> Self {
44        self.code_commit = input;
45        self
46    }
47    /// <p>Information about the AWS CodeCommit repository to be created in AWS CodeStar. This is where the source code files provided with the project request will be uploaded after project creation.</p>
48    pub fn get_code_commit(&self) -> &::std::option::Option<crate::types::CodeCommitCodeDestination> {
49        &self.code_commit
50    }
51    /// <p>Information about the GitHub repository to be created in AWS CodeStar. This is where the source code files provided with the project request will be uploaded after project creation.</p>
52    pub fn git_hub(mut self, input: crate::types::GitHubCodeDestination) -> Self {
53        self.git_hub = ::std::option::Option::Some(input);
54        self
55    }
56    /// <p>Information about the GitHub repository to be created in AWS CodeStar. This is where the source code files provided with the project request will be uploaded after project creation.</p>
57    pub fn set_git_hub(mut self, input: ::std::option::Option<crate::types::GitHubCodeDestination>) -> Self {
58        self.git_hub = input;
59        self
60    }
61    /// <p>Information about the GitHub repository to be created in AWS CodeStar. This is where the source code files provided with the project request will be uploaded after project creation.</p>
62    pub fn get_git_hub(&self) -> &::std::option::Option<crate::types::GitHubCodeDestination> {
63        &self.git_hub
64    }
65    /// Consumes the builder and constructs a [`CodeDestination`](crate::types::CodeDestination).
66    pub fn build(self) -> crate::types::CodeDestination {
67        crate::types::CodeDestination {
68            code_commit: self.code_commit,
69            git_hub: self.git_hub,
70        }
71    }
72}