aws_sdk_elasticbeanstalk/types/
_source_build_information.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Location of the source code for an application version.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct SourceBuildInformation {
7    /// <p>The type of repository.</p>
8    /// <ul>
9    /// <li>
10    /// <p><code>Git</code></p></li>
11    /// <li>
12    /// <p><code>Zip</code></p></li>
13    /// </ul>
14    pub source_type: crate::types::SourceType,
15    /// <p>Location where the repository is stored.</p>
16    /// <ul>
17    /// <li>
18    /// <p><code>CodeCommit</code></p></li>
19    /// <li>
20    /// <p><code>S3</code></p></li>
21    /// </ul>
22    pub source_repository: crate::types::SourceRepository,
23    /// <p>The location of the source code, as a formatted string, depending on the value of <code>SourceRepository</code></p>
24    /// <ul>
25    /// <li>
26    /// <p>For <code>CodeCommit</code>, the format is the repository name and commit ID, separated by a forward slash. For example, <code>my-git-repo/265cfa0cf6af46153527f55d6503ec030551f57a</code>.</p></li>
27    /// <li>
28    /// <p>For <code>S3</code>, the format is the S3 bucket name and object key, separated by a forward slash. For example, <code>my-s3-bucket/Folders/my-source-file</code>.</p></li>
29    /// </ul>
30    pub source_location: ::std::string::String,
31}
32impl SourceBuildInformation {
33    /// <p>The type of repository.</p>
34    /// <ul>
35    /// <li>
36    /// <p><code>Git</code></p></li>
37    /// <li>
38    /// <p><code>Zip</code></p></li>
39    /// </ul>
40    pub fn source_type(&self) -> &crate::types::SourceType {
41        &self.source_type
42    }
43    /// <p>Location where the repository is stored.</p>
44    /// <ul>
45    /// <li>
46    /// <p><code>CodeCommit</code></p></li>
47    /// <li>
48    /// <p><code>S3</code></p></li>
49    /// </ul>
50    pub fn source_repository(&self) -> &crate::types::SourceRepository {
51        &self.source_repository
52    }
53    /// <p>The location of the source code, as a formatted string, depending on the value of <code>SourceRepository</code></p>
54    /// <ul>
55    /// <li>
56    /// <p>For <code>CodeCommit</code>, the format is the repository name and commit ID, separated by a forward slash. For example, <code>my-git-repo/265cfa0cf6af46153527f55d6503ec030551f57a</code>.</p></li>
57    /// <li>
58    /// <p>For <code>S3</code>, the format is the S3 bucket name and object key, separated by a forward slash. For example, <code>my-s3-bucket/Folders/my-source-file</code>.</p></li>
59    /// </ul>
60    pub fn source_location(&self) -> &str {
61        use std::ops::Deref;
62        self.source_location.deref()
63    }
64}
65impl SourceBuildInformation {
66    /// Creates a new builder-style object to manufacture [`SourceBuildInformation`](crate::types::SourceBuildInformation).
67    pub fn builder() -> crate::types::builders::SourceBuildInformationBuilder {
68        crate::types::builders::SourceBuildInformationBuilder::default()
69    }
70}
71
72/// A builder for [`SourceBuildInformation`](crate::types::SourceBuildInformation).
73#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
74#[non_exhaustive]
75pub struct SourceBuildInformationBuilder {
76    pub(crate) source_type: ::std::option::Option<crate::types::SourceType>,
77    pub(crate) source_repository: ::std::option::Option<crate::types::SourceRepository>,
78    pub(crate) source_location: ::std::option::Option<::std::string::String>,
79}
80impl SourceBuildInformationBuilder {
81    /// <p>The type of repository.</p>
82    /// <ul>
83    /// <li>
84    /// <p><code>Git</code></p></li>
85    /// <li>
86    /// <p><code>Zip</code></p></li>
87    /// </ul>
88    /// This field is required.
89    pub fn source_type(mut self, input: crate::types::SourceType) -> Self {
90        self.source_type = ::std::option::Option::Some(input);
91        self
92    }
93    /// <p>The type of repository.</p>
94    /// <ul>
95    /// <li>
96    /// <p><code>Git</code></p></li>
97    /// <li>
98    /// <p><code>Zip</code></p></li>
99    /// </ul>
100    pub fn set_source_type(mut self, input: ::std::option::Option<crate::types::SourceType>) -> Self {
101        self.source_type = input;
102        self
103    }
104    /// <p>The type of repository.</p>
105    /// <ul>
106    /// <li>
107    /// <p><code>Git</code></p></li>
108    /// <li>
109    /// <p><code>Zip</code></p></li>
110    /// </ul>
111    pub fn get_source_type(&self) -> &::std::option::Option<crate::types::SourceType> {
112        &self.source_type
113    }
114    /// <p>Location where the repository is stored.</p>
115    /// <ul>
116    /// <li>
117    /// <p><code>CodeCommit</code></p></li>
118    /// <li>
119    /// <p><code>S3</code></p></li>
120    /// </ul>
121    /// This field is required.
122    pub fn source_repository(mut self, input: crate::types::SourceRepository) -> Self {
123        self.source_repository = ::std::option::Option::Some(input);
124        self
125    }
126    /// <p>Location where the repository is stored.</p>
127    /// <ul>
128    /// <li>
129    /// <p><code>CodeCommit</code></p></li>
130    /// <li>
131    /// <p><code>S3</code></p></li>
132    /// </ul>
133    pub fn set_source_repository(mut self, input: ::std::option::Option<crate::types::SourceRepository>) -> Self {
134        self.source_repository = input;
135        self
136    }
137    /// <p>Location where the repository is stored.</p>
138    /// <ul>
139    /// <li>
140    /// <p><code>CodeCommit</code></p></li>
141    /// <li>
142    /// <p><code>S3</code></p></li>
143    /// </ul>
144    pub fn get_source_repository(&self) -> &::std::option::Option<crate::types::SourceRepository> {
145        &self.source_repository
146    }
147    /// <p>The location of the source code, as a formatted string, depending on the value of <code>SourceRepository</code></p>
148    /// <ul>
149    /// <li>
150    /// <p>For <code>CodeCommit</code>, the format is the repository name and commit ID, separated by a forward slash. For example, <code>my-git-repo/265cfa0cf6af46153527f55d6503ec030551f57a</code>.</p></li>
151    /// <li>
152    /// <p>For <code>S3</code>, the format is the S3 bucket name and object key, separated by a forward slash. For example, <code>my-s3-bucket/Folders/my-source-file</code>.</p></li>
153    /// </ul>
154    /// This field is required.
155    pub fn source_location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
156        self.source_location = ::std::option::Option::Some(input.into());
157        self
158    }
159    /// <p>The location of the source code, as a formatted string, depending on the value of <code>SourceRepository</code></p>
160    /// <ul>
161    /// <li>
162    /// <p>For <code>CodeCommit</code>, the format is the repository name and commit ID, separated by a forward slash. For example, <code>my-git-repo/265cfa0cf6af46153527f55d6503ec030551f57a</code>.</p></li>
163    /// <li>
164    /// <p>For <code>S3</code>, the format is the S3 bucket name and object key, separated by a forward slash. For example, <code>my-s3-bucket/Folders/my-source-file</code>.</p></li>
165    /// </ul>
166    pub fn set_source_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167        self.source_location = input;
168        self
169    }
170    /// <p>The location of the source code, as a formatted string, depending on the value of <code>SourceRepository</code></p>
171    /// <ul>
172    /// <li>
173    /// <p>For <code>CodeCommit</code>, the format is the repository name and commit ID, separated by a forward slash. For example, <code>my-git-repo/265cfa0cf6af46153527f55d6503ec030551f57a</code>.</p></li>
174    /// <li>
175    /// <p>For <code>S3</code>, the format is the S3 bucket name and object key, separated by a forward slash. For example, <code>my-s3-bucket/Folders/my-source-file</code>.</p></li>
176    /// </ul>
177    pub fn get_source_location(&self) -> &::std::option::Option<::std::string::String> {
178        &self.source_location
179    }
180    /// Consumes the builder and constructs a [`SourceBuildInformation`](crate::types::SourceBuildInformation).
181    /// This method will fail if any of the following fields are not set:
182    /// - [`source_type`](crate::types::builders::SourceBuildInformationBuilder::source_type)
183    /// - [`source_repository`](crate::types::builders::SourceBuildInformationBuilder::source_repository)
184    /// - [`source_location`](crate::types::builders::SourceBuildInformationBuilder::source_location)
185    pub fn build(self) -> ::std::result::Result<crate::types::SourceBuildInformation, ::aws_smithy_types::error::operation::BuildError> {
186        ::std::result::Result::Ok(crate::types::SourceBuildInformation {
187            source_type: self.source_type.ok_or_else(|| {
188                ::aws_smithy_types::error::operation::BuildError::missing_field(
189                    "source_type",
190                    "source_type was not specified but it is required when building SourceBuildInformation",
191                )
192            })?,
193            source_repository: self.source_repository.ok_or_else(|| {
194                ::aws_smithy_types::error::operation::BuildError::missing_field(
195                    "source_repository",
196                    "source_repository was not specified but it is required when building SourceBuildInformation",
197                )
198            })?,
199            source_location: self.source_location.ok_or_else(|| {
200                ::aws_smithy_types::error::operation::BuildError::missing_field(
201                    "source_location",
202                    "source_location was not specified but it is required when building SourceBuildInformation",
203                )
204            })?,
205        })
206    }
207}