1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Settings for an AWS CodeBuild build.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct BuildConfiguration {
/// <p>The name of the artifact of the CodeBuild build. If provided, Elastic Beanstalk stores the build artifact in the S3 location <i>S3-bucket</i>/resources/<i>application-name</i>/codebuild/codebuild-<i>version-label</i>-<i>artifact-name</i>.zip. If not provided, Elastic Beanstalk stores the build artifact in the S3 location <i>S3-bucket</i>/resources/<i>application-name</i>/codebuild/codebuild-<i>version-label</i>.zip.</p>
pub artifact_name: ::std::option::Option<::std::string::String>,
/// <p>The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that enables AWS CodeBuild to interact with dependent AWS services on behalf of the AWS account.</p>
pub code_build_service_role: ::std::string::String,
/// <p>Information about the compute resources the build project will use.</p>
/// <ul>
/// <li>
/// <p><code>BUILD_GENERAL1_SMALL: Use up to 3 GB memory and 2 vCPUs for builds</code></p></li>
/// <li>
/// <p><code>BUILD_GENERAL1_MEDIUM: Use up to 7 GB memory and 4 vCPUs for builds</code></p></li>
/// <li>
/// <p><code>BUILD_GENERAL1_LARGE: Use up to 15 GB memory and 8 vCPUs for builds</code></p></li>
/// </ul>
pub compute_type: ::std::option::Option<crate::types::ComputeType>,
/// <p>The ID of the Docker image to use for this build project.</p>
pub image: ::std::string::String,
/// <p>How long in minutes, from 5 to 480 (8 hours), for AWS CodeBuild to wait until timing out any related build that does not get marked as completed. The default is 60 minutes.</p>
pub timeout_in_minutes: ::std::option::Option<i32>,
}
impl BuildConfiguration {
/// <p>The name of the artifact of the CodeBuild build. If provided, Elastic Beanstalk stores the build artifact in the S3 location <i>S3-bucket</i>/resources/<i>application-name</i>/codebuild/codebuild-<i>version-label</i>-<i>artifact-name</i>.zip. If not provided, Elastic Beanstalk stores the build artifact in the S3 location <i>S3-bucket</i>/resources/<i>application-name</i>/codebuild/codebuild-<i>version-label</i>.zip.</p>
pub fn artifact_name(&self) -> ::std::option::Option<&str> {
self.artifact_name.as_deref()
}
/// <p>The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that enables AWS CodeBuild to interact with dependent AWS services on behalf of the AWS account.</p>
pub fn code_build_service_role(&self) -> &str {
use std::ops::Deref;
self.code_build_service_role.deref()
}
/// <p>Information about the compute resources the build project will use.</p>
/// <ul>
/// <li>
/// <p><code>BUILD_GENERAL1_SMALL: Use up to 3 GB memory and 2 vCPUs for builds</code></p></li>
/// <li>
/// <p><code>BUILD_GENERAL1_MEDIUM: Use up to 7 GB memory and 4 vCPUs for builds</code></p></li>
/// <li>
/// <p><code>BUILD_GENERAL1_LARGE: Use up to 15 GB memory and 8 vCPUs for builds</code></p></li>
/// </ul>
pub fn compute_type(&self) -> ::std::option::Option<&crate::types::ComputeType> {
self.compute_type.as_ref()
}
/// <p>The ID of the Docker image to use for this build project.</p>
pub fn image(&self) -> &str {
use std::ops::Deref;
self.image.deref()
}
/// <p>How long in minutes, from 5 to 480 (8 hours), for AWS CodeBuild to wait until timing out any related build that does not get marked as completed. The default is 60 minutes.</p>
pub fn timeout_in_minutes(&self) -> ::std::option::Option<i32> {
self.timeout_in_minutes
}
}
impl BuildConfiguration {
/// Creates a new builder-style object to manufacture [`BuildConfiguration`](crate::types::BuildConfiguration).
pub fn builder() -> crate::types::builders::BuildConfigurationBuilder {
crate::types::builders::BuildConfigurationBuilder::default()
}
}
/// A builder for [`BuildConfiguration`](crate::types::BuildConfiguration).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct BuildConfigurationBuilder {
pub(crate) artifact_name: ::std::option::Option<::std::string::String>,
pub(crate) code_build_service_role: ::std::option::Option<::std::string::String>,
pub(crate) compute_type: ::std::option::Option<crate::types::ComputeType>,
pub(crate) image: ::std::option::Option<::std::string::String>,
pub(crate) timeout_in_minutes: ::std::option::Option<i32>,
}
impl BuildConfigurationBuilder {
/// <p>The name of the artifact of the CodeBuild build. If provided, Elastic Beanstalk stores the build artifact in the S3 location <i>S3-bucket</i>/resources/<i>application-name</i>/codebuild/codebuild-<i>version-label</i>-<i>artifact-name</i>.zip. If not provided, Elastic Beanstalk stores the build artifact in the S3 location <i>S3-bucket</i>/resources/<i>application-name</i>/codebuild/codebuild-<i>version-label</i>.zip.</p>
pub fn artifact_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.artifact_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the artifact of the CodeBuild build. If provided, Elastic Beanstalk stores the build artifact in the S3 location <i>S3-bucket</i>/resources/<i>application-name</i>/codebuild/codebuild-<i>version-label</i>-<i>artifact-name</i>.zip. If not provided, Elastic Beanstalk stores the build artifact in the S3 location <i>S3-bucket</i>/resources/<i>application-name</i>/codebuild/codebuild-<i>version-label</i>.zip.</p>
pub fn set_artifact_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.artifact_name = input;
self
}
/// <p>The name of the artifact of the CodeBuild build. If provided, Elastic Beanstalk stores the build artifact in the S3 location <i>S3-bucket</i>/resources/<i>application-name</i>/codebuild/codebuild-<i>version-label</i>-<i>artifact-name</i>.zip. If not provided, Elastic Beanstalk stores the build artifact in the S3 location <i>S3-bucket</i>/resources/<i>application-name</i>/codebuild/codebuild-<i>version-label</i>.zip.</p>
pub fn get_artifact_name(&self) -> &::std::option::Option<::std::string::String> {
&self.artifact_name
}
/// <p>The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that enables AWS CodeBuild to interact with dependent AWS services on behalf of the AWS account.</p>
/// This field is required.
pub fn code_build_service_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.code_build_service_role = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that enables AWS CodeBuild to interact with dependent AWS services on behalf of the AWS account.</p>
pub fn set_code_build_service_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.code_build_service_role = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that enables AWS CodeBuild to interact with dependent AWS services on behalf of the AWS account.</p>
pub fn get_code_build_service_role(&self) -> &::std::option::Option<::std::string::String> {
&self.code_build_service_role
}
/// <p>Information about the compute resources the build project will use.</p>
/// <ul>
/// <li>
/// <p><code>BUILD_GENERAL1_SMALL: Use up to 3 GB memory and 2 vCPUs for builds</code></p></li>
/// <li>
/// <p><code>BUILD_GENERAL1_MEDIUM: Use up to 7 GB memory and 4 vCPUs for builds</code></p></li>
/// <li>
/// <p><code>BUILD_GENERAL1_LARGE: Use up to 15 GB memory and 8 vCPUs for builds</code></p></li>
/// </ul>
pub fn compute_type(mut self, input: crate::types::ComputeType) -> Self {
self.compute_type = ::std::option::Option::Some(input);
self
}
/// <p>Information about the compute resources the build project will use.</p>
/// <ul>
/// <li>
/// <p><code>BUILD_GENERAL1_SMALL: Use up to 3 GB memory and 2 vCPUs for builds</code></p></li>
/// <li>
/// <p><code>BUILD_GENERAL1_MEDIUM: Use up to 7 GB memory and 4 vCPUs for builds</code></p></li>
/// <li>
/// <p><code>BUILD_GENERAL1_LARGE: Use up to 15 GB memory and 8 vCPUs for builds</code></p></li>
/// </ul>
pub fn set_compute_type(mut self, input: ::std::option::Option<crate::types::ComputeType>) -> Self {
self.compute_type = input;
self
}
/// <p>Information about the compute resources the build project will use.</p>
/// <ul>
/// <li>
/// <p><code>BUILD_GENERAL1_SMALL: Use up to 3 GB memory and 2 vCPUs for builds</code></p></li>
/// <li>
/// <p><code>BUILD_GENERAL1_MEDIUM: Use up to 7 GB memory and 4 vCPUs for builds</code></p></li>
/// <li>
/// <p><code>BUILD_GENERAL1_LARGE: Use up to 15 GB memory and 8 vCPUs for builds</code></p></li>
/// </ul>
pub fn get_compute_type(&self) -> &::std::option::Option<crate::types::ComputeType> {
&self.compute_type
}
/// <p>The ID of the Docker image to use for this build project.</p>
/// This field is required.
pub fn image(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.image = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the Docker image to use for this build project.</p>
pub fn set_image(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.image = input;
self
}
/// <p>The ID of the Docker image to use for this build project.</p>
pub fn get_image(&self) -> &::std::option::Option<::std::string::String> {
&self.image
}
/// <p>How long in minutes, from 5 to 480 (8 hours), for AWS CodeBuild to wait until timing out any related build that does not get marked as completed. The default is 60 minutes.</p>
pub fn timeout_in_minutes(mut self, input: i32) -> Self {
self.timeout_in_minutes = ::std::option::Option::Some(input);
self
}
/// <p>How long in minutes, from 5 to 480 (8 hours), for AWS CodeBuild to wait until timing out any related build that does not get marked as completed. The default is 60 minutes.</p>
pub fn set_timeout_in_minutes(mut self, input: ::std::option::Option<i32>) -> Self {
self.timeout_in_minutes = input;
self
}
/// <p>How long in minutes, from 5 to 480 (8 hours), for AWS CodeBuild to wait until timing out any related build that does not get marked as completed. The default is 60 minutes.</p>
pub fn get_timeout_in_minutes(&self) -> &::std::option::Option<i32> {
&self.timeout_in_minutes
}
/// Consumes the builder and constructs a [`BuildConfiguration`](crate::types::BuildConfiguration).
/// This method will fail if any of the following fields are not set:
/// - [`code_build_service_role`](crate::types::builders::BuildConfigurationBuilder::code_build_service_role)
/// - [`image`](crate::types::builders::BuildConfigurationBuilder::image)
pub fn build(self) -> ::std::result::Result<crate::types::BuildConfiguration, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::BuildConfiguration {
artifact_name: self.artifact_name,
code_build_service_role: self.code_build_service_role.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"code_build_service_role",
"code_build_service_role was not specified but it is required when building BuildConfiguration",
)
})?,
compute_type: self.compute_type,
image: self.image.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"image",
"image was not specified but it is required when building BuildConfiguration",
)
})?,
timeout_in_minutes: self.timeout_in_minutes,
})
}
}