aws_sdk_codebuild/operation/update_project_visibility/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_project_visibility::_update_project_visibility_output::UpdateProjectVisibilityOutputBuilder;
3
4pub use crate::operation::update_project_visibility::_update_project_visibility_input::UpdateProjectVisibilityInputBuilder;
5
6impl crate::operation::update_project_visibility::builders::UpdateProjectVisibilityInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::update_project_visibility::UpdateProjectVisibilityOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_project_visibility::UpdateProjectVisibilityError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_project_visibility();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateProjectVisibility`.
24///
25/// <p>Changes the public visibility for a project. The project's build results, logs, and artifacts are available to the general public. For more information, see <a href="https://docs.aws.amazon.com/codebuild/latest/userguide/public-builds.html">Public build projects</a> in the <i>CodeBuild User Guide</i>.</p><important>
26/// <p>The following should be kept in mind when making your projects public:</p>
27/// <ul>
28/// <li>
29/// <p>All of a project's build results, logs, and artifacts, including builds that were run when the project was private, are available to the general public.</p></li>
30/// <li>
31/// <p>All build logs and artifacts are available to the public. Environment variables, source code, and other sensitive information may have been output to the build logs and artifacts. You must be careful about what information is output to the build logs. Some best practice are:</p>
32/// <ul>
33/// <li>
34/// <p>Do not store sensitive values in environment variables. We recommend that you use an Amazon EC2 Systems Manager Parameter Store or Secrets Manager to store sensitive values.</p></li>
35/// <li>
36/// <p>Follow <a href="https://docs.aws.amazon.com/codebuild/latest/userguide/webhooks.html#webhook-best-practices">Best practices for using webhooks</a> in the <i>CodeBuild User Guide</i> to limit which entities can trigger a build, and do not store the buildspec in the project itself, to ensure that your webhooks are as secure as possible.</p></li>
37/// </ul></li>
38/// <li>
39/// <p>A malicious user can use public builds to distribute malicious artifacts. We recommend that you review all pull requests to verify that the pull request is a legitimate change. We also recommend that you validate any artifacts with their checksums to make sure that the correct artifacts are being downloaded.</p></li>
40/// </ul>
41/// </important>
42#[derive(::std::clone::Clone, ::std::fmt::Debug)]
43pub struct UpdateProjectVisibilityFluentBuilder {
44    handle: ::std::sync::Arc<crate::client::Handle>,
45    inner: crate::operation::update_project_visibility::builders::UpdateProjectVisibilityInputBuilder,
46    config_override: ::std::option::Option<crate::config::Builder>,
47}
48impl
49    crate::client::customize::internal::CustomizableSend<
50        crate::operation::update_project_visibility::UpdateProjectVisibilityOutput,
51        crate::operation::update_project_visibility::UpdateProjectVisibilityError,
52    > for UpdateProjectVisibilityFluentBuilder
53{
54    fn send(
55        self,
56        config_override: crate::config::Builder,
57    ) -> crate::client::customize::internal::BoxFuture<
58        crate::client::customize::internal::SendResult<
59            crate::operation::update_project_visibility::UpdateProjectVisibilityOutput,
60            crate::operation::update_project_visibility::UpdateProjectVisibilityError,
61        >,
62    > {
63        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
64    }
65}
66impl UpdateProjectVisibilityFluentBuilder {
67    /// Creates a new `UpdateProjectVisibilityFluentBuilder`.
68    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
69        Self {
70            handle,
71            inner: ::std::default::Default::default(),
72            config_override: ::std::option::Option::None,
73        }
74    }
75    /// Access the UpdateProjectVisibility as a reference.
76    pub fn as_input(&self) -> &crate::operation::update_project_visibility::builders::UpdateProjectVisibilityInputBuilder {
77        &self.inner
78    }
79    /// Sends the request and returns the response.
80    ///
81    /// If an error occurs, an `SdkError` will be returned with additional details that
82    /// can be matched against.
83    ///
84    /// By default, any retryable failures will be retried twice. Retry behavior
85    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
86    /// set when configuring the client.
87    pub async fn send(
88        self,
89    ) -> ::std::result::Result<
90        crate::operation::update_project_visibility::UpdateProjectVisibilityOutput,
91        ::aws_smithy_runtime_api::client::result::SdkError<
92            crate::operation::update_project_visibility::UpdateProjectVisibilityError,
93            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
94        >,
95    > {
96        let input = self
97            .inner
98            .build()
99            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
100        let runtime_plugins = crate::operation::update_project_visibility::UpdateProjectVisibility::operation_runtime_plugins(
101            self.handle.runtime_plugins.clone(),
102            &self.handle.conf,
103            self.config_override,
104        );
105        crate::operation::update_project_visibility::UpdateProjectVisibility::orchestrate(&runtime_plugins, input).await
106    }
107
108    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
109    pub fn customize(
110        self,
111    ) -> crate::client::customize::CustomizableOperation<
112        crate::operation::update_project_visibility::UpdateProjectVisibilityOutput,
113        crate::operation::update_project_visibility::UpdateProjectVisibilityError,
114        Self,
115    > {
116        crate::client::customize::CustomizableOperation::new(self)
117    }
118    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
119        self.set_config_override(::std::option::Option::Some(config_override.into()));
120        self
121    }
122
123    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
124        self.config_override = config_override;
125        self
126    }
127    /// <p>The Amazon Resource Name (ARN) of the build project.</p>
128    pub fn project_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.inner = self.inner.project_arn(input.into());
130        self
131    }
132    /// <p>The Amazon Resource Name (ARN) of the build project.</p>
133    pub fn set_project_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.inner = self.inner.set_project_arn(input);
135        self
136    }
137    /// <p>The Amazon Resource Name (ARN) of the build project.</p>
138    pub fn get_project_arn(&self) -> &::std::option::Option<::std::string::String> {
139        self.inner.get_project_arn()
140    }
141    /// <p>Specifies the visibility of the project's builds. Possible values are:</p>
142    /// <dl>
143    /// <dt>
144    /// PUBLIC_READ
145    /// </dt>
146    /// <dd>
147    /// <p>The project builds are visible to the public.</p>
148    /// </dd>
149    /// <dt>
150    /// PRIVATE
151    /// </dt>
152    /// <dd>
153    /// <p>The project builds are not visible to the public.</p>
154    /// </dd>
155    /// </dl>
156    pub fn project_visibility(mut self, input: crate::types::ProjectVisibilityType) -> Self {
157        self.inner = self.inner.project_visibility(input);
158        self
159    }
160    /// <p>Specifies the visibility of the project's builds. Possible values are:</p>
161    /// <dl>
162    /// <dt>
163    /// PUBLIC_READ
164    /// </dt>
165    /// <dd>
166    /// <p>The project builds are visible to the public.</p>
167    /// </dd>
168    /// <dt>
169    /// PRIVATE
170    /// </dt>
171    /// <dd>
172    /// <p>The project builds are not visible to the public.</p>
173    /// </dd>
174    /// </dl>
175    pub fn set_project_visibility(mut self, input: ::std::option::Option<crate::types::ProjectVisibilityType>) -> Self {
176        self.inner = self.inner.set_project_visibility(input);
177        self
178    }
179    /// <p>Specifies the visibility of the project's builds. Possible values are:</p>
180    /// <dl>
181    /// <dt>
182    /// PUBLIC_READ
183    /// </dt>
184    /// <dd>
185    /// <p>The project builds are visible to the public.</p>
186    /// </dd>
187    /// <dt>
188    /// PRIVATE
189    /// </dt>
190    /// <dd>
191    /// <p>The project builds are not visible to the public.</p>
192    /// </dd>
193    /// </dl>
194    pub fn get_project_visibility(&self) -> &::std::option::Option<crate::types::ProjectVisibilityType> {
195        self.inner.get_project_visibility()
196    }
197    /// <p>The ARN of the IAM role that enables CodeBuild to access the CloudWatch Logs and Amazon S3 artifacts for the project's builds.</p>
198    pub fn resource_access_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
199        self.inner = self.inner.resource_access_role(input.into());
200        self
201    }
202    /// <p>The ARN of the IAM role that enables CodeBuild to access the CloudWatch Logs and Amazon S3 artifacts for the project's builds.</p>
203    pub fn set_resource_access_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
204        self.inner = self.inner.set_resource_access_role(input);
205        self
206    }
207    /// <p>The ARN of the IAM role that enables CodeBuild to access the CloudWatch Logs and Amazon S3 artifacts for the project's builds.</p>
208    pub fn get_resource_access_role(&self) -> &::std::option::Option<::std::string::String> {
209        self.inner.get_resource_access_role()
210    }
211}