aws_sdk_codebuild/types/
_s3_logs_config.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Information about S3 logs for a build project.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct S3LogsConfig {
7    /// <p>The current status of the S3 build logs. Valid values are:</p>
8    /// <ul>
9    /// <li>
10    /// <p><code>ENABLED</code>: S3 build logs are enabled for this build project.</p></li>
11    /// <li>
12    /// <p><code>DISABLED</code>: S3 build logs are not enabled for this build project.</p></li>
13    /// </ul>
14    pub status: crate::types::LogsConfigStatusType,
15    /// <p>The ARN of an S3 bucket and the path prefix for S3 logs. If your Amazon S3 bucket name is <code>my-bucket</code>, and your path prefix is <code>build-log</code>, then acceptable formats are <code>my-bucket/build-log</code> or <code>arn:aws:s3:::my-bucket/build-log</code>.</p>
16    pub location: ::std::option::Option<::std::string::String>,
17    /// <p>Set to true if you do not want your S3 build log output encrypted. By default S3 build logs are encrypted.</p>
18    pub encryption_disabled: ::std::option::Option<bool>,
19    /// <p>Specifies the bucket owner's access for objects that another account uploads to their Amazon S3 bucket. By default, only the account that uploads the objects to the bucket has access to these objects. This property allows you to give the bucket owner access to these objects.</p><note>
20    /// <p>To use this property, your CodeBuild service role must have the <code>s3:PutBucketAcl</code> permission. This permission allows CodeBuild to modify the access control list for the bucket.</p>
21    /// </note>
22    /// <p>This property can be one of the following values:</p>
23    /// <dl>
24    /// <dt>
25    /// NONE
26    /// </dt>
27    /// <dd>
28    /// <p>The bucket owner does not have access to the objects. This is the default.</p>
29    /// </dd>
30    /// <dt>
31    /// READ_ONLY
32    /// </dt>
33    /// <dd>
34    /// <p>The bucket owner has read-only access to the objects. The uploading account retains ownership of the objects.</p>
35    /// </dd>
36    /// <dt>
37    /// FULL
38    /// </dt>
39    /// <dd>
40    /// <p>The bucket owner has full access to the objects. Object ownership is determined by the following criteria:</p>
41    /// <ul>
42    /// <li>
43    /// <p>If the bucket is configured with the <b>Bucket owner preferred</b> setting, the bucket owner owns the objects. The uploading account will have object access as specified by the bucket's policy.</p></li>
44    /// <li>
45    /// <p>Otherwise, the uploading account retains ownership of the objects.</p></li>
46    /// </ul>
47    /// <p>For more information about Amazon S3 object ownership, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html">Controlling ownership of uploaded objects using S3 Object Ownership</a> in the <i>Amazon Simple Storage Service User Guide</i>.</p>
48    /// </dd>
49    /// </dl>
50    pub bucket_owner_access: ::std::option::Option<crate::types::BucketOwnerAccess>,
51}
52impl S3LogsConfig {
53    /// <p>The current status of the S3 build logs. Valid values are:</p>
54    /// <ul>
55    /// <li>
56    /// <p><code>ENABLED</code>: S3 build logs are enabled for this build project.</p></li>
57    /// <li>
58    /// <p><code>DISABLED</code>: S3 build logs are not enabled for this build project.</p></li>
59    /// </ul>
60    pub fn status(&self) -> &crate::types::LogsConfigStatusType {
61        &self.status
62    }
63    /// <p>The ARN of an S3 bucket and the path prefix for S3 logs. If your Amazon S3 bucket name is <code>my-bucket</code>, and your path prefix is <code>build-log</code>, then acceptable formats are <code>my-bucket/build-log</code> or <code>arn:aws:s3:::my-bucket/build-log</code>.</p>
64    pub fn location(&self) -> ::std::option::Option<&str> {
65        self.location.as_deref()
66    }
67    /// <p>Set to true if you do not want your S3 build log output encrypted. By default S3 build logs are encrypted.</p>
68    pub fn encryption_disabled(&self) -> ::std::option::Option<bool> {
69        self.encryption_disabled
70    }
71    /// <p>Specifies the bucket owner's access for objects that another account uploads to their Amazon S3 bucket. By default, only the account that uploads the objects to the bucket has access to these objects. This property allows you to give the bucket owner access to these objects.</p><note>
72    /// <p>To use this property, your CodeBuild service role must have the <code>s3:PutBucketAcl</code> permission. This permission allows CodeBuild to modify the access control list for the bucket.</p>
73    /// </note>
74    /// <p>This property can be one of the following values:</p>
75    /// <dl>
76    /// <dt>
77    /// NONE
78    /// </dt>
79    /// <dd>
80    /// <p>The bucket owner does not have access to the objects. This is the default.</p>
81    /// </dd>
82    /// <dt>
83    /// READ_ONLY
84    /// </dt>
85    /// <dd>
86    /// <p>The bucket owner has read-only access to the objects. The uploading account retains ownership of the objects.</p>
87    /// </dd>
88    /// <dt>
89    /// FULL
90    /// </dt>
91    /// <dd>
92    /// <p>The bucket owner has full access to the objects. Object ownership is determined by the following criteria:</p>
93    /// <ul>
94    /// <li>
95    /// <p>If the bucket is configured with the <b>Bucket owner preferred</b> setting, the bucket owner owns the objects. The uploading account will have object access as specified by the bucket's policy.</p></li>
96    /// <li>
97    /// <p>Otherwise, the uploading account retains ownership of the objects.</p></li>
98    /// </ul>
99    /// <p>For more information about Amazon S3 object ownership, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html">Controlling ownership of uploaded objects using S3 Object Ownership</a> in the <i>Amazon Simple Storage Service User Guide</i>.</p>
100    /// </dd>
101    /// </dl>
102    pub fn bucket_owner_access(&self) -> ::std::option::Option<&crate::types::BucketOwnerAccess> {
103        self.bucket_owner_access.as_ref()
104    }
105}
106impl S3LogsConfig {
107    /// Creates a new builder-style object to manufacture [`S3LogsConfig`](crate::types::S3LogsConfig).
108    pub fn builder() -> crate::types::builders::S3LogsConfigBuilder {
109        crate::types::builders::S3LogsConfigBuilder::default()
110    }
111}
112
113/// A builder for [`S3LogsConfig`](crate::types::S3LogsConfig).
114#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
115#[non_exhaustive]
116pub struct S3LogsConfigBuilder {
117    pub(crate) status: ::std::option::Option<crate::types::LogsConfigStatusType>,
118    pub(crate) location: ::std::option::Option<::std::string::String>,
119    pub(crate) encryption_disabled: ::std::option::Option<bool>,
120    pub(crate) bucket_owner_access: ::std::option::Option<crate::types::BucketOwnerAccess>,
121}
122impl S3LogsConfigBuilder {
123    /// <p>The current status of the S3 build logs. Valid values are:</p>
124    /// <ul>
125    /// <li>
126    /// <p><code>ENABLED</code>: S3 build logs are enabled for this build project.</p></li>
127    /// <li>
128    /// <p><code>DISABLED</code>: S3 build logs are not enabled for this build project.</p></li>
129    /// </ul>
130    /// This field is required.
131    pub fn status(mut self, input: crate::types::LogsConfigStatusType) -> Self {
132        self.status = ::std::option::Option::Some(input);
133        self
134    }
135    /// <p>The current status of the S3 build logs. Valid values are:</p>
136    /// <ul>
137    /// <li>
138    /// <p><code>ENABLED</code>: S3 build logs are enabled for this build project.</p></li>
139    /// <li>
140    /// <p><code>DISABLED</code>: S3 build logs are not enabled for this build project.</p></li>
141    /// </ul>
142    pub fn set_status(mut self, input: ::std::option::Option<crate::types::LogsConfigStatusType>) -> Self {
143        self.status = input;
144        self
145    }
146    /// <p>The current status of the S3 build logs. Valid values are:</p>
147    /// <ul>
148    /// <li>
149    /// <p><code>ENABLED</code>: S3 build logs are enabled for this build project.</p></li>
150    /// <li>
151    /// <p><code>DISABLED</code>: S3 build logs are not enabled for this build project.</p></li>
152    /// </ul>
153    pub fn get_status(&self) -> &::std::option::Option<crate::types::LogsConfigStatusType> {
154        &self.status
155    }
156    /// <p>The ARN of an S3 bucket and the path prefix for S3 logs. If your Amazon S3 bucket name is <code>my-bucket</code>, and your path prefix is <code>build-log</code>, then acceptable formats are <code>my-bucket/build-log</code> or <code>arn:aws:s3:::my-bucket/build-log</code>.</p>
157    pub fn location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.location = ::std::option::Option::Some(input.into());
159        self
160    }
161    /// <p>The ARN of an S3 bucket and the path prefix for S3 logs. If your Amazon S3 bucket name is <code>my-bucket</code>, and your path prefix is <code>build-log</code>, then acceptable formats are <code>my-bucket/build-log</code> or <code>arn:aws:s3:::my-bucket/build-log</code>.</p>
162    pub fn set_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163        self.location = input;
164        self
165    }
166    /// <p>The ARN of an S3 bucket and the path prefix for S3 logs. If your Amazon S3 bucket name is <code>my-bucket</code>, and your path prefix is <code>build-log</code>, then acceptable formats are <code>my-bucket/build-log</code> or <code>arn:aws:s3:::my-bucket/build-log</code>.</p>
167    pub fn get_location(&self) -> &::std::option::Option<::std::string::String> {
168        &self.location
169    }
170    /// <p>Set to true if you do not want your S3 build log output encrypted. By default S3 build logs are encrypted.</p>
171    pub fn encryption_disabled(mut self, input: bool) -> Self {
172        self.encryption_disabled = ::std::option::Option::Some(input);
173        self
174    }
175    /// <p>Set to true if you do not want your S3 build log output encrypted. By default S3 build logs are encrypted.</p>
176    pub fn set_encryption_disabled(mut self, input: ::std::option::Option<bool>) -> Self {
177        self.encryption_disabled = input;
178        self
179    }
180    /// <p>Set to true if you do not want your S3 build log output encrypted. By default S3 build logs are encrypted.</p>
181    pub fn get_encryption_disabled(&self) -> &::std::option::Option<bool> {
182        &self.encryption_disabled
183    }
184    /// <p>Specifies the bucket owner's access for objects that another account uploads to their Amazon S3 bucket. By default, only the account that uploads the objects to the bucket has access to these objects. This property allows you to give the bucket owner access to these objects.</p><note>
185    /// <p>To use this property, your CodeBuild service role must have the <code>s3:PutBucketAcl</code> permission. This permission allows CodeBuild to modify the access control list for the bucket.</p>
186    /// </note>
187    /// <p>This property can be one of the following values:</p>
188    /// <dl>
189    /// <dt>
190    /// NONE
191    /// </dt>
192    /// <dd>
193    /// <p>The bucket owner does not have access to the objects. This is the default.</p>
194    /// </dd>
195    /// <dt>
196    /// READ_ONLY
197    /// </dt>
198    /// <dd>
199    /// <p>The bucket owner has read-only access to the objects. The uploading account retains ownership of the objects.</p>
200    /// </dd>
201    /// <dt>
202    /// FULL
203    /// </dt>
204    /// <dd>
205    /// <p>The bucket owner has full access to the objects. Object ownership is determined by the following criteria:</p>
206    /// <ul>
207    /// <li>
208    /// <p>If the bucket is configured with the <b>Bucket owner preferred</b> setting, the bucket owner owns the objects. The uploading account will have object access as specified by the bucket's policy.</p></li>
209    /// <li>
210    /// <p>Otherwise, the uploading account retains ownership of the objects.</p></li>
211    /// </ul>
212    /// <p>For more information about Amazon S3 object ownership, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html">Controlling ownership of uploaded objects using S3 Object Ownership</a> in the <i>Amazon Simple Storage Service User Guide</i>.</p>
213    /// </dd>
214    /// </dl>
215    pub fn bucket_owner_access(mut self, input: crate::types::BucketOwnerAccess) -> Self {
216        self.bucket_owner_access = ::std::option::Option::Some(input);
217        self
218    }
219    /// <p>Specifies the bucket owner's access for objects that another account uploads to their Amazon S3 bucket. By default, only the account that uploads the objects to the bucket has access to these objects. This property allows you to give the bucket owner access to these objects.</p><note>
220    /// <p>To use this property, your CodeBuild service role must have the <code>s3:PutBucketAcl</code> permission. This permission allows CodeBuild to modify the access control list for the bucket.</p>
221    /// </note>
222    /// <p>This property can be one of the following values:</p>
223    /// <dl>
224    /// <dt>
225    /// NONE
226    /// </dt>
227    /// <dd>
228    /// <p>The bucket owner does not have access to the objects. This is the default.</p>
229    /// </dd>
230    /// <dt>
231    /// READ_ONLY
232    /// </dt>
233    /// <dd>
234    /// <p>The bucket owner has read-only access to the objects. The uploading account retains ownership of the objects.</p>
235    /// </dd>
236    /// <dt>
237    /// FULL
238    /// </dt>
239    /// <dd>
240    /// <p>The bucket owner has full access to the objects. Object ownership is determined by the following criteria:</p>
241    /// <ul>
242    /// <li>
243    /// <p>If the bucket is configured with the <b>Bucket owner preferred</b> setting, the bucket owner owns the objects. The uploading account will have object access as specified by the bucket's policy.</p></li>
244    /// <li>
245    /// <p>Otherwise, the uploading account retains ownership of the objects.</p></li>
246    /// </ul>
247    /// <p>For more information about Amazon S3 object ownership, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html">Controlling ownership of uploaded objects using S3 Object Ownership</a> in the <i>Amazon Simple Storage Service User Guide</i>.</p>
248    /// </dd>
249    /// </dl>
250    pub fn set_bucket_owner_access(mut self, input: ::std::option::Option<crate::types::BucketOwnerAccess>) -> Self {
251        self.bucket_owner_access = input;
252        self
253    }
254    /// <p>Specifies the bucket owner's access for objects that another account uploads to their Amazon S3 bucket. By default, only the account that uploads the objects to the bucket has access to these objects. This property allows you to give the bucket owner access to these objects.</p><note>
255    /// <p>To use this property, your CodeBuild service role must have the <code>s3:PutBucketAcl</code> permission. This permission allows CodeBuild to modify the access control list for the bucket.</p>
256    /// </note>
257    /// <p>This property can be one of the following values:</p>
258    /// <dl>
259    /// <dt>
260    /// NONE
261    /// </dt>
262    /// <dd>
263    /// <p>The bucket owner does not have access to the objects. This is the default.</p>
264    /// </dd>
265    /// <dt>
266    /// READ_ONLY
267    /// </dt>
268    /// <dd>
269    /// <p>The bucket owner has read-only access to the objects. The uploading account retains ownership of the objects.</p>
270    /// </dd>
271    /// <dt>
272    /// FULL
273    /// </dt>
274    /// <dd>
275    /// <p>The bucket owner has full access to the objects. Object ownership is determined by the following criteria:</p>
276    /// <ul>
277    /// <li>
278    /// <p>If the bucket is configured with the <b>Bucket owner preferred</b> setting, the bucket owner owns the objects. The uploading account will have object access as specified by the bucket's policy.</p></li>
279    /// <li>
280    /// <p>Otherwise, the uploading account retains ownership of the objects.</p></li>
281    /// </ul>
282    /// <p>For more information about Amazon S3 object ownership, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html">Controlling ownership of uploaded objects using S3 Object Ownership</a> in the <i>Amazon Simple Storage Service User Guide</i>.</p>
283    /// </dd>
284    /// </dl>
285    pub fn get_bucket_owner_access(&self) -> &::std::option::Option<crate::types::BucketOwnerAccess> {
286        &self.bucket_owner_access
287    }
288    /// Consumes the builder and constructs a [`S3LogsConfig`](crate::types::S3LogsConfig).
289    /// This method will fail if any of the following fields are not set:
290    /// - [`status`](crate::types::builders::S3LogsConfigBuilder::status)
291    pub fn build(self) -> ::std::result::Result<crate::types::S3LogsConfig, ::aws_smithy_types::error::operation::BuildError> {
292        ::std::result::Result::Ok(crate::types::S3LogsConfig {
293            status: self.status.ok_or_else(|| {
294                ::aws_smithy_types::error::operation::BuildError::missing_field(
295                    "status",
296                    "status was not specified but it is required when building S3LogsConfig",
297                )
298            })?,
299            location: self.location,
300            encryption_disabled: self.encryption_disabled,
301            bucket_owner_access: self.bucket_owner_access,
302        })
303    }
304}