aws_sdk_codebuild/operation/create_project/
_create_project_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateProjectInput {
6    /// <p>The name of the build project.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>A description that makes the build project easy to identify.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>Information about the build input source code for the build project.</p>
11    pub source: ::std::option::Option<crate::types::ProjectSource>,
12    /// <p>An array of <code>ProjectSource</code> objects.</p>
13    pub secondary_sources: ::std::option::Option<::std::vec::Vec<crate::types::ProjectSource>>,
14    /// <p>A version of the build input to be built for this project. If not specified, the latest version is used. If specified, it must be one of:</p>
15    /// <ul>
16    /// <li>
17    /// <p>For CodeCommit: the commit ID, branch, or Git tag to use.</p></li>
18    /// <li>
19    /// <p>For GitHub: the commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a pull request ID is specified, it must use the format <code>pr/pull-request-ID</code> (for example <code>pr/25</code>). If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used.</p></li>
20    /// <li>
21    /// <p>For GitLab: the commit ID, branch, or Git tag to use.</p></li>
22    /// <li>
23    /// <p>For Bitbucket: the commit ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used.</p></li>
24    /// <li>
25    /// <p>For Amazon S3: the version ID of the object that represents the build input ZIP file to use.</p></li>
26    /// </ul>
27    /// <p>If <code>sourceVersion</code> is specified at the build level, then that version takes precedence over this <code>sourceVersion</code> (at the project level).</p>
28    /// <p>For more information, see <a href="https://docs.aws.amazon.com/codebuild/latest/userguide/sample-source-version.html">Source Version Sample with CodeBuild</a> in the <i>CodeBuild User Guide</i>.</p>
29    pub source_version: ::std::option::Option<::std::string::String>,
30    /// <p>An array of <code>ProjectSourceVersion</code> objects. If <code>secondarySourceVersions</code> is specified at the build level, then they take precedence over these <code>secondarySourceVersions</code> (at the project level).</p>
31    pub secondary_source_versions: ::std::option::Option<::std::vec::Vec<crate::types::ProjectSourceVersion>>,
32    /// <p>Information about the build output artifacts for the build project.</p>
33    pub artifacts: ::std::option::Option<crate::types::ProjectArtifacts>,
34    /// <p>An array of <code>ProjectArtifacts</code> objects.</p>
35    pub secondary_artifacts: ::std::option::Option<::std::vec::Vec<crate::types::ProjectArtifacts>>,
36    /// <p>Stores recently used information so that it can be quickly accessed at a later time.</p>
37    pub cache: ::std::option::Option<crate::types::ProjectCache>,
38    /// <p>Information about the build environment for the build project.</p>
39    pub environment: ::std::option::Option<crate::types::ProjectEnvironment>,
40    /// <p>The ARN of the IAM role that enables CodeBuild to interact with dependent Amazon Web Services services on behalf of the Amazon Web Services account.</p>
41    pub service_role: ::std::option::Option<::std::string::String>,
42    /// <p>How long, in minutes, from 5 to 2160 (36 hours), for CodeBuild to wait before it times out any build that has not been marked as completed. The default is 60 minutes.</p>
43    pub timeout_in_minutes: ::std::option::Option<i32>,
44    /// <p>The number of minutes a build is allowed to be queued before it times out.</p>
45    pub queued_timeout_in_minutes: ::std::option::Option<i32>,
46    /// <p>The Key Management Service customer master key (CMK) to be used for encrypting the build output artifacts.</p><note>
47    /// <p>You can use a cross-account KMS key to encrypt the build output artifacts if your service role has permission to that key.</p>
48    /// </note>
49    /// <p>You can specify either the Amazon Resource Name (ARN) of the CMK or, if available, the CMK's alias (using the format <code>alias/<alias-name></alias-name></code>).</p>
50    pub encryption_key: ::std::option::Option<::std::string::String>,
51    /// <p>A list of tag key and value pairs associated with this build project.</p>
52    /// <p>These tags are available for use by Amazon Web Services services that support CodeBuild build project tags.</p>
53    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
54    /// <p>VpcConfig enables CodeBuild to access resources in an Amazon VPC.</p><note>
55    /// <p>If you're using compute fleets during project creation, do not provide vpcConfig.</p>
56    /// </note>
57    pub vpc_config: ::std::option::Option<crate::types::VpcConfig>,
58    /// <p>Set this to true to generate a publicly accessible URL for your project's build badge.</p>
59    pub badge_enabled: ::std::option::Option<bool>,
60    /// <p>Information about logs for the build project. These can be logs in CloudWatch Logs, logs uploaded to a specified S3 bucket, or both.</p>
61    pub logs_config: ::std::option::Option<crate::types::LogsConfig>,
62    /// <p>An array of <code>ProjectFileSystemLocation</code> objects for a CodeBuild build project. A <code>ProjectFileSystemLocation</code> object specifies the <code>identifier</code>, <code>location</code>, <code>mountOptions</code>, <code>mountPoint</code>, and <code>type</code> of a file system created using Amazon Elastic File System.</p>
63    pub file_system_locations: ::std::option::Option<::std::vec::Vec<crate::types::ProjectFileSystemLocation>>,
64    /// <p>A <code>ProjectBuildBatchConfig</code> object that defines the batch build options for the project.</p>
65    pub build_batch_config: ::std::option::Option<crate::types::ProjectBuildBatchConfig>,
66    /// <p>The maximum number of concurrent builds that are allowed for this project.</p>
67    /// <p>New builds are only started if the current number of builds is less than or equal to this limit. If the current build count meets this limit, new builds are throttled and are not run.</p>
68    pub concurrent_build_limit: ::std::option::Option<i32>,
69    /// <p>The maximum number of additional automatic retries after a failed build. For example, if the auto-retry limit is set to 2, CodeBuild will call the <code>RetryBuild</code> API to automatically retry your build for up to 2 additional times.</p>
70    pub auto_retry_limit: ::std::option::Option<i32>,
71}
72impl CreateProjectInput {
73    /// <p>The name of the build project.</p>
74    pub fn name(&self) -> ::std::option::Option<&str> {
75        self.name.as_deref()
76    }
77    /// <p>A description that makes the build project easy to identify.</p>
78    pub fn description(&self) -> ::std::option::Option<&str> {
79        self.description.as_deref()
80    }
81    /// <p>Information about the build input source code for the build project.</p>
82    pub fn source(&self) -> ::std::option::Option<&crate::types::ProjectSource> {
83        self.source.as_ref()
84    }
85    /// <p>An array of <code>ProjectSource</code> objects.</p>
86    ///
87    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.secondary_sources.is_none()`.
88    pub fn secondary_sources(&self) -> &[crate::types::ProjectSource] {
89        self.secondary_sources.as_deref().unwrap_or_default()
90    }
91    /// <p>A version of the build input to be built for this project. If not specified, the latest version is used. If specified, it must be one of:</p>
92    /// <ul>
93    /// <li>
94    /// <p>For CodeCommit: the commit ID, branch, or Git tag to use.</p></li>
95    /// <li>
96    /// <p>For GitHub: the commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a pull request ID is specified, it must use the format <code>pr/pull-request-ID</code> (for example <code>pr/25</code>). If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used.</p></li>
97    /// <li>
98    /// <p>For GitLab: the commit ID, branch, or Git tag to use.</p></li>
99    /// <li>
100    /// <p>For Bitbucket: the commit ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used.</p></li>
101    /// <li>
102    /// <p>For Amazon S3: the version ID of the object that represents the build input ZIP file to use.</p></li>
103    /// </ul>
104    /// <p>If <code>sourceVersion</code> is specified at the build level, then that version takes precedence over this <code>sourceVersion</code> (at the project level).</p>
105    /// <p>For more information, see <a href="https://docs.aws.amazon.com/codebuild/latest/userguide/sample-source-version.html">Source Version Sample with CodeBuild</a> in the <i>CodeBuild User Guide</i>.</p>
106    pub fn source_version(&self) -> ::std::option::Option<&str> {
107        self.source_version.as_deref()
108    }
109    /// <p>An array of <code>ProjectSourceVersion</code> objects. If <code>secondarySourceVersions</code> is specified at the build level, then they take precedence over these <code>secondarySourceVersions</code> (at the project level).</p>
110    ///
111    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.secondary_source_versions.is_none()`.
112    pub fn secondary_source_versions(&self) -> &[crate::types::ProjectSourceVersion] {
113        self.secondary_source_versions.as_deref().unwrap_or_default()
114    }
115    /// <p>Information about the build output artifacts for the build project.</p>
116    pub fn artifacts(&self) -> ::std::option::Option<&crate::types::ProjectArtifacts> {
117        self.artifacts.as_ref()
118    }
119    /// <p>An array of <code>ProjectArtifacts</code> objects.</p>
120    ///
121    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.secondary_artifacts.is_none()`.
122    pub fn secondary_artifacts(&self) -> &[crate::types::ProjectArtifacts] {
123        self.secondary_artifacts.as_deref().unwrap_or_default()
124    }
125    /// <p>Stores recently used information so that it can be quickly accessed at a later time.</p>
126    pub fn cache(&self) -> ::std::option::Option<&crate::types::ProjectCache> {
127        self.cache.as_ref()
128    }
129    /// <p>Information about the build environment for the build project.</p>
130    pub fn environment(&self) -> ::std::option::Option<&crate::types::ProjectEnvironment> {
131        self.environment.as_ref()
132    }
133    /// <p>The ARN of the IAM role that enables CodeBuild to interact with dependent Amazon Web Services services on behalf of the Amazon Web Services account.</p>
134    pub fn service_role(&self) -> ::std::option::Option<&str> {
135        self.service_role.as_deref()
136    }
137    /// <p>How long, in minutes, from 5 to 2160 (36 hours), for CodeBuild to wait before it times out any build that has not been marked as completed. The default is 60 minutes.</p>
138    pub fn timeout_in_minutes(&self) -> ::std::option::Option<i32> {
139        self.timeout_in_minutes
140    }
141    /// <p>The number of minutes a build is allowed to be queued before it times out.</p>
142    pub fn queued_timeout_in_minutes(&self) -> ::std::option::Option<i32> {
143        self.queued_timeout_in_minutes
144    }
145    /// <p>The Key Management Service customer master key (CMK) to be used for encrypting the build output artifacts.</p><note>
146    /// <p>You can use a cross-account KMS key to encrypt the build output artifacts if your service role has permission to that key.</p>
147    /// </note>
148    /// <p>You can specify either the Amazon Resource Name (ARN) of the CMK or, if available, the CMK's alias (using the format <code>alias/<alias-name></alias-name></code>).</p>
149    pub fn encryption_key(&self) -> ::std::option::Option<&str> {
150        self.encryption_key.as_deref()
151    }
152    /// <p>A list of tag key and value pairs associated with this build project.</p>
153    /// <p>These tags are available for use by Amazon Web Services services that support CodeBuild build project tags.</p>
154    ///
155    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
156    pub fn tags(&self) -> &[crate::types::Tag] {
157        self.tags.as_deref().unwrap_or_default()
158    }
159    /// <p>VpcConfig enables CodeBuild to access resources in an Amazon VPC.</p><note>
160    /// <p>If you're using compute fleets during project creation, do not provide vpcConfig.</p>
161    /// </note>
162    pub fn vpc_config(&self) -> ::std::option::Option<&crate::types::VpcConfig> {
163        self.vpc_config.as_ref()
164    }
165    /// <p>Set this to true to generate a publicly accessible URL for your project's build badge.</p>
166    pub fn badge_enabled(&self) -> ::std::option::Option<bool> {
167        self.badge_enabled
168    }
169    /// <p>Information about logs for the build project. These can be logs in CloudWatch Logs, logs uploaded to a specified S3 bucket, or both.</p>
170    pub fn logs_config(&self) -> ::std::option::Option<&crate::types::LogsConfig> {
171        self.logs_config.as_ref()
172    }
173    /// <p>An array of <code>ProjectFileSystemLocation</code> objects for a CodeBuild build project. A <code>ProjectFileSystemLocation</code> object specifies the <code>identifier</code>, <code>location</code>, <code>mountOptions</code>, <code>mountPoint</code>, and <code>type</code> of a file system created using Amazon Elastic File System.</p>
174    ///
175    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.file_system_locations.is_none()`.
176    pub fn file_system_locations(&self) -> &[crate::types::ProjectFileSystemLocation] {
177        self.file_system_locations.as_deref().unwrap_or_default()
178    }
179    /// <p>A <code>ProjectBuildBatchConfig</code> object that defines the batch build options for the project.</p>
180    pub fn build_batch_config(&self) -> ::std::option::Option<&crate::types::ProjectBuildBatchConfig> {
181        self.build_batch_config.as_ref()
182    }
183    /// <p>The maximum number of concurrent builds that are allowed for this project.</p>
184    /// <p>New builds are only started if the current number of builds is less than or equal to this limit. If the current build count meets this limit, new builds are throttled and are not run.</p>
185    pub fn concurrent_build_limit(&self) -> ::std::option::Option<i32> {
186        self.concurrent_build_limit
187    }
188    /// <p>The maximum number of additional automatic retries after a failed build. For example, if the auto-retry limit is set to 2, CodeBuild will call the <code>RetryBuild</code> API to automatically retry your build for up to 2 additional times.</p>
189    pub fn auto_retry_limit(&self) -> ::std::option::Option<i32> {
190        self.auto_retry_limit
191    }
192}
193impl CreateProjectInput {
194    /// Creates a new builder-style object to manufacture [`CreateProjectInput`](crate::operation::create_project::CreateProjectInput).
195    pub fn builder() -> crate::operation::create_project::builders::CreateProjectInputBuilder {
196        crate::operation::create_project::builders::CreateProjectInputBuilder::default()
197    }
198}
199
200/// A builder for [`CreateProjectInput`](crate::operation::create_project::CreateProjectInput).
201#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
202#[non_exhaustive]
203pub struct CreateProjectInputBuilder {
204    pub(crate) name: ::std::option::Option<::std::string::String>,
205    pub(crate) description: ::std::option::Option<::std::string::String>,
206    pub(crate) source: ::std::option::Option<crate::types::ProjectSource>,
207    pub(crate) secondary_sources: ::std::option::Option<::std::vec::Vec<crate::types::ProjectSource>>,
208    pub(crate) source_version: ::std::option::Option<::std::string::String>,
209    pub(crate) secondary_source_versions: ::std::option::Option<::std::vec::Vec<crate::types::ProjectSourceVersion>>,
210    pub(crate) artifacts: ::std::option::Option<crate::types::ProjectArtifacts>,
211    pub(crate) secondary_artifacts: ::std::option::Option<::std::vec::Vec<crate::types::ProjectArtifacts>>,
212    pub(crate) cache: ::std::option::Option<crate::types::ProjectCache>,
213    pub(crate) environment: ::std::option::Option<crate::types::ProjectEnvironment>,
214    pub(crate) service_role: ::std::option::Option<::std::string::String>,
215    pub(crate) timeout_in_minutes: ::std::option::Option<i32>,
216    pub(crate) queued_timeout_in_minutes: ::std::option::Option<i32>,
217    pub(crate) encryption_key: ::std::option::Option<::std::string::String>,
218    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
219    pub(crate) vpc_config: ::std::option::Option<crate::types::VpcConfig>,
220    pub(crate) badge_enabled: ::std::option::Option<bool>,
221    pub(crate) logs_config: ::std::option::Option<crate::types::LogsConfig>,
222    pub(crate) file_system_locations: ::std::option::Option<::std::vec::Vec<crate::types::ProjectFileSystemLocation>>,
223    pub(crate) build_batch_config: ::std::option::Option<crate::types::ProjectBuildBatchConfig>,
224    pub(crate) concurrent_build_limit: ::std::option::Option<i32>,
225    pub(crate) auto_retry_limit: ::std::option::Option<i32>,
226}
227impl CreateProjectInputBuilder {
228    /// <p>The name of the build project.</p>
229    /// This field is required.
230    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
231        self.name = ::std::option::Option::Some(input.into());
232        self
233    }
234    /// <p>The name of the build project.</p>
235    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
236        self.name = input;
237        self
238    }
239    /// <p>The name of the build project.</p>
240    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
241        &self.name
242    }
243    /// <p>A description that makes the build project easy to identify.</p>
244    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
245        self.description = ::std::option::Option::Some(input.into());
246        self
247    }
248    /// <p>A description that makes the build project easy to identify.</p>
249    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
250        self.description = input;
251        self
252    }
253    /// <p>A description that makes the build project easy to identify.</p>
254    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
255        &self.description
256    }
257    /// <p>Information about the build input source code for the build project.</p>
258    /// This field is required.
259    pub fn source(mut self, input: crate::types::ProjectSource) -> Self {
260        self.source = ::std::option::Option::Some(input);
261        self
262    }
263    /// <p>Information about the build input source code for the build project.</p>
264    pub fn set_source(mut self, input: ::std::option::Option<crate::types::ProjectSource>) -> Self {
265        self.source = input;
266        self
267    }
268    /// <p>Information about the build input source code for the build project.</p>
269    pub fn get_source(&self) -> &::std::option::Option<crate::types::ProjectSource> {
270        &self.source
271    }
272    /// Appends an item to `secondary_sources`.
273    ///
274    /// To override the contents of this collection use [`set_secondary_sources`](Self::set_secondary_sources).
275    ///
276    /// <p>An array of <code>ProjectSource</code> objects.</p>
277    pub fn secondary_sources(mut self, input: crate::types::ProjectSource) -> Self {
278        let mut v = self.secondary_sources.unwrap_or_default();
279        v.push(input);
280        self.secondary_sources = ::std::option::Option::Some(v);
281        self
282    }
283    /// <p>An array of <code>ProjectSource</code> objects.</p>
284    pub fn set_secondary_sources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ProjectSource>>) -> Self {
285        self.secondary_sources = input;
286        self
287    }
288    /// <p>An array of <code>ProjectSource</code> objects.</p>
289    pub fn get_secondary_sources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ProjectSource>> {
290        &self.secondary_sources
291    }
292    /// <p>A version of the build input to be built for this project. If not specified, the latest version is used. If specified, it must be one of:</p>
293    /// <ul>
294    /// <li>
295    /// <p>For CodeCommit: the commit ID, branch, or Git tag to use.</p></li>
296    /// <li>
297    /// <p>For GitHub: the commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a pull request ID is specified, it must use the format <code>pr/pull-request-ID</code> (for example <code>pr/25</code>). If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used.</p></li>
298    /// <li>
299    /// <p>For GitLab: the commit ID, branch, or Git tag to use.</p></li>
300    /// <li>
301    /// <p>For Bitbucket: the commit ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used.</p></li>
302    /// <li>
303    /// <p>For Amazon S3: the version ID of the object that represents the build input ZIP file to use.</p></li>
304    /// </ul>
305    /// <p>If <code>sourceVersion</code> is specified at the build level, then that version takes precedence over this <code>sourceVersion</code> (at the project level).</p>
306    /// <p>For more information, see <a href="https://docs.aws.amazon.com/codebuild/latest/userguide/sample-source-version.html">Source Version Sample with CodeBuild</a> in the <i>CodeBuild User Guide</i>.</p>
307    pub fn source_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
308        self.source_version = ::std::option::Option::Some(input.into());
309        self
310    }
311    /// <p>A version of the build input to be built for this project. If not specified, the latest version is used. If specified, it must be one of:</p>
312    /// <ul>
313    /// <li>
314    /// <p>For CodeCommit: the commit ID, branch, or Git tag to use.</p></li>
315    /// <li>
316    /// <p>For GitHub: the commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a pull request ID is specified, it must use the format <code>pr/pull-request-ID</code> (for example <code>pr/25</code>). If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used.</p></li>
317    /// <li>
318    /// <p>For GitLab: the commit ID, branch, or Git tag to use.</p></li>
319    /// <li>
320    /// <p>For Bitbucket: the commit ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used.</p></li>
321    /// <li>
322    /// <p>For Amazon S3: the version ID of the object that represents the build input ZIP file to use.</p></li>
323    /// </ul>
324    /// <p>If <code>sourceVersion</code> is specified at the build level, then that version takes precedence over this <code>sourceVersion</code> (at the project level).</p>
325    /// <p>For more information, see <a href="https://docs.aws.amazon.com/codebuild/latest/userguide/sample-source-version.html">Source Version Sample with CodeBuild</a> in the <i>CodeBuild User Guide</i>.</p>
326    pub fn set_source_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
327        self.source_version = input;
328        self
329    }
330    /// <p>A version of the build input to be built for this project. If not specified, the latest version is used. If specified, it must be one of:</p>
331    /// <ul>
332    /// <li>
333    /// <p>For CodeCommit: the commit ID, branch, or Git tag to use.</p></li>
334    /// <li>
335    /// <p>For GitHub: the commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a pull request ID is specified, it must use the format <code>pr/pull-request-ID</code> (for example <code>pr/25</code>). If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used.</p></li>
336    /// <li>
337    /// <p>For GitLab: the commit ID, branch, or Git tag to use.</p></li>
338    /// <li>
339    /// <p>For Bitbucket: the commit ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used.</p></li>
340    /// <li>
341    /// <p>For Amazon S3: the version ID of the object that represents the build input ZIP file to use.</p></li>
342    /// </ul>
343    /// <p>If <code>sourceVersion</code> is specified at the build level, then that version takes precedence over this <code>sourceVersion</code> (at the project level).</p>
344    /// <p>For more information, see <a href="https://docs.aws.amazon.com/codebuild/latest/userguide/sample-source-version.html">Source Version Sample with CodeBuild</a> in the <i>CodeBuild User Guide</i>.</p>
345    pub fn get_source_version(&self) -> &::std::option::Option<::std::string::String> {
346        &self.source_version
347    }
348    /// Appends an item to `secondary_source_versions`.
349    ///
350    /// To override the contents of this collection use [`set_secondary_source_versions`](Self::set_secondary_source_versions).
351    ///
352    /// <p>An array of <code>ProjectSourceVersion</code> objects. If <code>secondarySourceVersions</code> is specified at the build level, then they take precedence over these <code>secondarySourceVersions</code> (at the project level).</p>
353    pub fn secondary_source_versions(mut self, input: crate::types::ProjectSourceVersion) -> Self {
354        let mut v = self.secondary_source_versions.unwrap_or_default();
355        v.push(input);
356        self.secondary_source_versions = ::std::option::Option::Some(v);
357        self
358    }
359    /// <p>An array of <code>ProjectSourceVersion</code> objects. If <code>secondarySourceVersions</code> is specified at the build level, then they take precedence over these <code>secondarySourceVersions</code> (at the project level).</p>
360    pub fn set_secondary_source_versions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ProjectSourceVersion>>) -> Self {
361        self.secondary_source_versions = input;
362        self
363    }
364    /// <p>An array of <code>ProjectSourceVersion</code> objects. If <code>secondarySourceVersions</code> is specified at the build level, then they take precedence over these <code>secondarySourceVersions</code> (at the project level).</p>
365    pub fn get_secondary_source_versions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ProjectSourceVersion>> {
366        &self.secondary_source_versions
367    }
368    /// <p>Information about the build output artifacts for the build project.</p>
369    /// This field is required.
370    pub fn artifacts(mut self, input: crate::types::ProjectArtifacts) -> Self {
371        self.artifacts = ::std::option::Option::Some(input);
372        self
373    }
374    /// <p>Information about the build output artifacts for the build project.</p>
375    pub fn set_artifacts(mut self, input: ::std::option::Option<crate::types::ProjectArtifacts>) -> Self {
376        self.artifacts = input;
377        self
378    }
379    /// <p>Information about the build output artifacts for the build project.</p>
380    pub fn get_artifacts(&self) -> &::std::option::Option<crate::types::ProjectArtifacts> {
381        &self.artifacts
382    }
383    /// Appends an item to `secondary_artifacts`.
384    ///
385    /// To override the contents of this collection use [`set_secondary_artifacts`](Self::set_secondary_artifacts).
386    ///
387    /// <p>An array of <code>ProjectArtifacts</code> objects.</p>
388    pub fn secondary_artifacts(mut self, input: crate::types::ProjectArtifacts) -> Self {
389        let mut v = self.secondary_artifacts.unwrap_or_default();
390        v.push(input);
391        self.secondary_artifacts = ::std::option::Option::Some(v);
392        self
393    }
394    /// <p>An array of <code>ProjectArtifacts</code> objects.</p>
395    pub fn set_secondary_artifacts(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ProjectArtifacts>>) -> Self {
396        self.secondary_artifacts = input;
397        self
398    }
399    /// <p>An array of <code>ProjectArtifacts</code> objects.</p>
400    pub fn get_secondary_artifacts(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ProjectArtifacts>> {
401        &self.secondary_artifacts
402    }
403    /// <p>Stores recently used information so that it can be quickly accessed at a later time.</p>
404    pub fn cache(mut self, input: crate::types::ProjectCache) -> Self {
405        self.cache = ::std::option::Option::Some(input);
406        self
407    }
408    /// <p>Stores recently used information so that it can be quickly accessed at a later time.</p>
409    pub fn set_cache(mut self, input: ::std::option::Option<crate::types::ProjectCache>) -> Self {
410        self.cache = input;
411        self
412    }
413    /// <p>Stores recently used information so that it can be quickly accessed at a later time.</p>
414    pub fn get_cache(&self) -> &::std::option::Option<crate::types::ProjectCache> {
415        &self.cache
416    }
417    /// <p>Information about the build environment for the build project.</p>
418    /// This field is required.
419    pub fn environment(mut self, input: crate::types::ProjectEnvironment) -> Self {
420        self.environment = ::std::option::Option::Some(input);
421        self
422    }
423    /// <p>Information about the build environment for the build project.</p>
424    pub fn set_environment(mut self, input: ::std::option::Option<crate::types::ProjectEnvironment>) -> Self {
425        self.environment = input;
426        self
427    }
428    /// <p>Information about the build environment for the build project.</p>
429    pub fn get_environment(&self) -> &::std::option::Option<crate::types::ProjectEnvironment> {
430        &self.environment
431    }
432    /// <p>The ARN of the IAM role that enables CodeBuild to interact with dependent Amazon Web Services services on behalf of the Amazon Web Services account.</p>
433    /// This field is required.
434    pub fn service_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
435        self.service_role = ::std::option::Option::Some(input.into());
436        self
437    }
438    /// <p>The ARN of the IAM role that enables CodeBuild to interact with dependent Amazon Web Services services on behalf of the Amazon Web Services account.</p>
439    pub fn set_service_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
440        self.service_role = input;
441        self
442    }
443    /// <p>The ARN of the IAM role that enables CodeBuild to interact with dependent Amazon Web Services services on behalf of the Amazon Web Services account.</p>
444    pub fn get_service_role(&self) -> &::std::option::Option<::std::string::String> {
445        &self.service_role
446    }
447    /// <p>How long, in minutes, from 5 to 2160 (36 hours), for CodeBuild to wait before it times out any build that has not been marked as completed. The default is 60 minutes.</p>
448    pub fn timeout_in_minutes(mut self, input: i32) -> Self {
449        self.timeout_in_minutes = ::std::option::Option::Some(input);
450        self
451    }
452    /// <p>How long, in minutes, from 5 to 2160 (36 hours), for CodeBuild to wait before it times out any build that has not been marked as completed. The default is 60 minutes.</p>
453    pub fn set_timeout_in_minutes(mut self, input: ::std::option::Option<i32>) -> Self {
454        self.timeout_in_minutes = input;
455        self
456    }
457    /// <p>How long, in minutes, from 5 to 2160 (36 hours), for CodeBuild to wait before it times out any build that has not been marked as completed. The default is 60 minutes.</p>
458    pub fn get_timeout_in_minutes(&self) -> &::std::option::Option<i32> {
459        &self.timeout_in_minutes
460    }
461    /// <p>The number of minutes a build is allowed to be queued before it times out.</p>
462    pub fn queued_timeout_in_minutes(mut self, input: i32) -> Self {
463        self.queued_timeout_in_minutes = ::std::option::Option::Some(input);
464        self
465    }
466    /// <p>The number of minutes a build is allowed to be queued before it times out.</p>
467    pub fn set_queued_timeout_in_minutes(mut self, input: ::std::option::Option<i32>) -> Self {
468        self.queued_timeout_in_minutes = input;
469        self
470    }
471    /// <p>The number of minutes a build is allowed to be queued before it times out.</p>
472    pub fn get_queued_timeout_in_minutes(&self) -> &::std::option::Option<i32> {
473        &self.queued_timeout_in_minutes
474    }
475    /// <p>The Key Management Service customer master key (CMK) to be used for encrypting the build output artifacts.</p><note>
476    /// <p>You can use a cross-account KMS key to encrypt the build output artifacts if your service role has permission to that key.</p>
477    /// </note>
478    /// <p>You can specify either the Amazon Resource Name (ARN) of the CMK or, if available, the CMK's alias (using the format <code>alias/<alias-name></alias-name></code>).</p>
479    pub fn encryption_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
480        self.encryption_key = ::std::option::Option::Some(input.into());
481        self
482    }
483    /// <p>The Key Management Service customer master key (CMK) to be used for encrypting the build output artifacts.</p><note>
484    /// <p>You can use a cross-account KMS key to encrypt the build output artifacts if your service role has permission to that key.</p>
485    /// </note>
486    /// <p>You can specify either the Amazon Resource Name (ARN) of the CMK or, if available, the CMK's alias (using the format <code>alias/<alias-name></alias-name></code>).</p>
487    pub fn set_encryption_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
488        self.encryption_key = input;
489        self
490    }
491    /// <p>The Key Management Service customer master key (CMK) to be used for encrypting the build output artifacts.</p><note>
492    /// <p>You can use a cross-account KMS key to encrypt the build output artifacts if your service role has permission to that key.</p>
493    /// </note>
494    /// <p>You can specify either the Amazon Resource Name (ARN) of the CMK or, if available, the CMK's alias (using the format <code>alias/<alias-name></alias-name></code>).</p>
495    pub fn get_encryption_key(&self) -> &::std::option::Option<::std::string::String> {
496        &self.encryption_key
497    }
498    /// Appends an item to `tags`.
499    ///
500    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
501    ///
502    /// <p>A list of tag key and value pairs associated with this build project.</p>
503    /// <p>These tags are available for use by Amazon Web Services services that support CodeBuild build project tags.</p>
504    pub fn tags(mut self, input: crate::types::Tag) -> Self {
505        let mut v = self.tags.unwrap_or_default();
506        v.push(input);
507        self.tags = ::std::option::Option::Some(v);
508        self
509    }
510    /// <p>A list of tag key and value pairs associated with this build project.</p>
511    /// <p>These tags are available for use by Amazon Web Services services that support CodeBuild build project tags.</p>
512    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
513        self.tags = input;
514        self
515    }
516    /// <p>A list of tag key and value pairs associated with this build project.</p>
517    /// <p>These tags are available for use by Amazon Web Services services that support CodeBuild build project tags.</p>
518    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
519        &self.tags
520    }
521    /// <p>VpcConfig enables CodeBuild to access resources in an Amazon VPC.</p><note>
522    /// <p>If you're using compute fleets during project creation, do not provide vpcConfig.</p>
523    /// </note>
524    pub fn vpc_config(mut self, input: crate::types::VpcConfig) -> Self {
525        self.vpc_config = ::std::option::Option::Some(input);
526        self
527    }
528    /// <p>VpcConfig enables CodeBuild to access resources in an Amazon VPC.</p><note>
529    /// <p>If you're using compute fleets during project creation, do not provide vpcConfig.</p>
530    /// </note>
531    pub fn set_vpc_config(mut self, input: ::std::option::Option<crate::types::VpcConfig>) -> Self {
532        self.vpc_config = input;
533        self
534    }
535    /// <p>VpcConfig enables CodeBuild to access resources in an Amazon VPC.</p><note>
536    /// <p>If you're using compute fleets during project creation, do not provide vpcConfig.</p>
537    /// </note>
538    pub fn get_vpc_config(&self) -> &::std::option::Option<crate::types::VpcConfig> {
539        &self.vpc_config
540    }
541    /// <p>Set this to true to generate a publicly accessible URL for your project's build badge.</p>
542    pub fn badge_enabled(mut self, input: bool) -> Self {
543        self.badge_enabled = ::std::option::Option::Some(input);
544        self
545    }
546    /// <p>Set this to true to generate a publicly accessible URL for your project's build badge.</p>
547    pub fn set_badge_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
548        self.badge_enabled = input;
549        self
550    }
551    /// <p>Set this to true to generate a publicly accessible URL for your project's build badge.</p>
552    pub fn get_badge_enabled(&self) -> &::std::option::Option<bool> {
553        &self.badge_enabled
554    }
555    /// <p>Information about logs for the build project. These can be logs in CloudWatch Logs, logs uploaded to a specified S3 bucket, or both.</p>
556    pub fn logs_config(mut self, input: crate::types::LogsConfig) -> Self {
557        self.logs_config = ::std::option::Option::Some(input);
558        self
559    }
560    /// <p>Information about logs for the build project. These can be logs in CloudWatch Logs, logs uploaded to a specified S3 bucket, or both.</p>
561    pub fn set_logs_config(mut self, input: ::std::option::Option<crate::types::LogsConfig>) -> Self {
562        self.logs_config = input;
563        self
564    }
565    /// <p>Information about logs for the build project. These can be logs in CloudWatch Logs, logs uploaded to a specified S3 bucket, or both.</p>
566    pub fn get_logs_config(&self) -> &::std::option::Option<crate::types::LogsConfig> {
567        &self.logs_config
568    }
569    /// Appends an item to `file_system_locations`.
570    ///
571    /// To override the contents of this collection use [`set_file_system_locations`](Self::set_file_system_locations).
572    ///
573    /// <p>An array of <code>ProjectFileSystemLocation</code> objects for a CodeBuild build project. A <code>ProjectFileSystemLocation</code> object specifies the <code>identifier</code>, <code>location</code>, <code>mountOptions</code>, <code>mountPoint</code>, and <code>type</code> of a file system created using Amazon Elastic File System.</p>
574    pub fn file_system_locations(mut self, input: crate::types::ProjectFileSystemLocation) -> Self {
575        let mut v = self.file_system_locations.unwrap_or_default();
576        v.push(input);
577        self.file_system_locations = ::std::option::Option::Some(v);
578        self
579    }
580    /// <p>An array of <code>ProjectFileSystemLocation</code> objects for a CodeBuild build project. A <code>ProjectFileSystemLocation</code> object specifies the <code>identifier</code>, <code>location</code>, <code>mountOptions</code>, <code>mountPoint</code>, and <code>type</code> of a file system created using Amazon Elastic File System.</p>
581    pub fn set_file_system_locations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ProjectFileSystemLocation>>) -> Self {
582        self.file_system_locations = input;
583        self
584    }
585    /// <p>An array of <code>ProjectFileSystemLocation</code> objects for a CodeBuild build project. A <code>ProjectFileSystemLocation</code> object specifies the <code>identifier</code>, <code>location</code>, <code>mountOptions</code>, <code>mountPoint</code>, and <code>type</code> of a file system created using Amazon Elastic File System.</p>
586    pub fn get_file_system_locations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ProjectFileSystemLocation>> {
587        &self.file_system_locations
588    }
589    /// <p>A <code>ProjectBuildBatchConfig</code> object that defines the batch build options for the project.</p>
590    pub fn build_batch_config(mut self, input: crate::types::ProjectBuildBatchConfig) -> Self {
591        self.build_batch_config = ::std::option::Option::Some(input);
592        self
593    }
594    /// <p>A <code>ProjectBuildBatchConfig</code> object that defines the batch build options for the project.</p>
595    pub fn set_build_batch_config(mut self, input: ::std::option::Option<crate::types::ProjectBuildBatchConfig>) -> Self {
596        self.build_batch_config = input;
597        self
598    }
599    /// <p>A <code>ProjectBuildBatchConfig</code> object that defines the batch build options for the project.</p>
600    pub fn get_build_batch_config(&self) -> &::std::option::Option<crate::types::ProjectBuildBatchConfig> {
601        &self.build_batch_config
602    }
603    /// <p>The maximum number of concurrent builds that are allowed for this project.</p>
604    /// <p>New builds are only started if the current number of builds is less than or equal to this limit. If the current build count meets this limit, new builds are throttled and are not run.</p>
605    pub fn concurrent_build_limit(mut self, input: i32) -> Self {
606        self.concurrent_build_limit = ::std::option::Option::Some(input);
607        self
608    }
609    /// <p>The maximum number of concurrent builds that are allowed for this project.</p>
610    /// <p>New builds are only started if the current number of builds is less than or equal to this limit. If the current build count meets this limit, new builds are throttled and are not run.</p>
611    pub fn set_concurrent_build_limit(mut self, input: ::std::option::Option<i32>) -> Self {
612        self.concurrent_build_limit = input;
613        self
614    }
615    /// <p>The maximum number of concurrent builds that are allowed for this project.</p>
616    /// <p>New builds are only started if the current number of builds is less than or equal to this limit. If the current build count meets this limit, new builds are throttled and are not run.</p>
617    pub fn get_concurrent_build_limit(&self) -> &::std::option::Option<i32> {
618        &self.concurrent_build_limit
619    }
620    /// <p>The maximum number of additional automatic retries after a failed build. For example, if the auto-retry limit is set to 2, CodeBuild will call the <code>RetryBuild</code> API to automatically retry your build for up to 2 additional times.</p>
621    pub fn auto_retry_limit(mut self, input: i32) -> Self {
622        self.auto_retry_limit = ::std::option::Option::Some(input);
623        self
624    }
625    /// <p>The maximum number of additional automatic retries after a failed build. For example, if the auto-retry limit is set to 2, CodeBuild will call the <code>RetryBuild</code> API to automatically retry your build for up to 2 additional times.</p>
626    pub fn set_auto_retry_limit(mut self, input: ::std::option::Option<i32>) -> Self {
627        self.auto_retry_limit = input;
628        self
629    }
630    /// <p>The maximum number of additional automatic retries after a failed build. For example, if the auto-retry limit is set to 2, CodeBuild will call the <code>RetryBuild</code> API to automatically retry your build for up to 2 additional times.</p>
631    pub fn get_auto_retry_limit(&self) -> &::std::option::Option<i32> {
632        &self.auto_retry_limit
633    }
634    /// Consumes the builder and constructs a [`CreateProjectInput`](crate::operation::create_project::CreateProjectInput).
635    pub fn build(
636        self,
637    ) -> ::std::result::Result<crate::operation::create_project::CreateProjectInput, ::aws_smithy_types::error::operation::BuildError> {
638        ::std::result::Result::Ok(crate::operation::create_project::CreateProjectInput {
639            name: self.name,
640            description: self.description,
641            source: self.source,
642            secondary_sources: self.secondary_sources,
643            source_version: self.source_version,
644            secondary_source_versions: self.secondary_source_versions,
645            artifacts: self.artifacts,
646            secondary_artifacts: self.secondary_artifacts,
647            cache: self.cache,
648            environment: self.environment,
649            service_role: self.service_role,
650            timeout_in_minutes: self.timeout_in_minutes,
651            queued_timeout_in_minutes: self.queued_timeout_in_minutes,
652            encryption_key: self.encryption_key,
653            tags: self.tags,
654            vpc_config: self.vpc_config,
655            badge_enabled: self.badge_enabled,
656            logs_config: self.logs_config,
657            file_system_locations: self.file_system_locations,
658            build_batch_config: self.build_batch_config,
659            concurrent_build_limit: self.concurrent_build_limit,
660            auto_retry_limit: self.auto_retry_limit,
661        })
662    }
663}