aws_sdk_s3/operation/get_object_lock_configuration/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_object_lock_configuration::_get_object_lock_configuration_output::GetObjectLockConfigurationOutputBuilder;
3
4pub use crate::operation::get_object_lock_configuration::_get_object_lock_configuration_input::GetObjectLockConfigurationInputBuilder;
5
6impl crate::operation::get_object_lock_configuration::builders::GetObjectLockConfigurationInputBuilder {
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::get_object_lock_configuration::GetObjectLockConfigurationOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::get_object_lock_configuration::GetObjectLockConfigurationError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.get_object_lock_configuration();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `GetObjectLockConfiguration`.
24///
25/// <note>
26/// <p>This operation is not supported for directory buckets.</p>
27/// </note>
28/// <p>Gets the Object Lock configuration for a bucket. The rule specified in the Object Lock configuration will be applied by default to every new object placed in the specified bucket. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html">Locking Objects</a>.</p>
29/// <p>The following action is related to <code>GetObjectLockConfiguration</code>:</p>
30/// <ul>
31/// <li>
32/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html">GetObjectAttributes</a></p></li>
33/// </ul>
34#[derive(::std::clone::Clone, ::std::fmt::Debug)]
35pub struct GetObjectLockConfigurationFluentBuilder {
36 handle: ::std::sync::Arc<crate::client::Handle>,
37 inner: crate::operation::get_object_lock_configuration::builders::GetObjectLockConfigurationInputBuilder,
38 config_override: ::std::option::Option<crate::config::Builder>,
39}
40impl
41 crate::client::customize::internal::CustomizableSend<
42 crate::operation::get_object_lock_configuration::GetObjectLockConfigurationOutput,
43 crate::operation::get_object_lock_configuration::GetObjectLockConfigurationError,
44 > for GetObjectLockConfigurationFluentBuilder
45{
46 fn send(
47 self,
48 config_override: crate::config::Builder,
49 ) -> crate::client::customize::internal::BoxFuture<
50 crate::client::customize::internal::SendResult<
51 crate::operation::get_object_lock_configuration::GetObjectLockConfigurationOutput,
52 crate::operation::get_object_lock_configuration::GetObjectLockConfigurationError,
53 >,
54 > {
55 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
56 }
57}
58impl GetObjectLockConfigurationFluentBuilder {
59 /// Creates a new `GetObjectLockConfigurationFluentBuilder`.
60 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
61 Self {
62 handle,
63 inner: ::std::default::Default::default(),
64 config_override: ::std::option::Option::None,
65 }
66 }
67 /// Access the GetObjectLockConfiguration as a reference.
68 pub fn as_input(&self) -> &crate::operation::get_object_lock_configuration::builders::GetObjectLockConfigurationInputBuilder {
69 &self.inner
70 }
71 /// Sends the request and returns the response.
72 ///
73 /// If an error occurs, an `SdkError` will be returned with additional details that
74 /// can be matched against.
75 ///
76 /// By default, any retryable failures will be retried twice. Retry behavior
77 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
78 /// set when configuring the client.
79 pub async fn send(
80 self,
81 ) -> ::std::result::Result<
82 crate::operation::get_object_lock_configuration::GetObjectLockConfigurationOutput,
83 ::aws_smithy_runtime_api::client::result::SdkError<
84 crate::operation::get_object_lock_configuration::GetObjectLockConfigurationError,
85 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
86 >,
87 > {
88 let input = self
89 .inner
90 .build()
91 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
92 let runtime_plugins = crate::operation::get_object_lock_configuration::GetObjectLockConfiguration::operation_runtime_plugins(
93 self.handle.runtime_plugins.clone(),
94 &self.handle.conf,
95 self.config_override,
96 );
97 crate::operation::get_object_lock_configuration::GetObjectLockConfiguration::orchestrate(&runtime_plugins, input).await
98 }
99
100 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
101 pub fn customize(
102 self,
103 ) -> crate::client::customize::CustomizableOperation<
104 crate::operation::get_object_lock_configuration::GetObjectLockConfigurationOutput,
105 crate::operation::get_object_lock_configuration::GetObjectLockConfigurationError,
106 Self,
107 > {
108 crate::client::customize::CustomizableOperation::new(self)
109 }
110 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
111 self.set_config_override(::std::option::Option::Some(config_override.into()));
112 self
113 }
114
115 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
116 self.config_override = config_override;
117 self
118 }
119 /// <p>The bucket whose Object Lock configuration you want to retrieve.</p>
120 /// <p><b>Access points</b> - When you use this action with an access point, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form <i>AccessPointName</i>-<i>AccountId</i>.s3-accesspoint.<i>Region</i>.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html">Using access points</a> in the <i>Amazon S3 User Guide</i>.</p>
121 pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122 self.inner = self.inner.bucket(input.into());
123 self
124 }
125 /// <p>The bucket whose Object Lock configuration you want to retrieve.</p>
126 /// <p><b>Access points</b> - When you use this action with an access point, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form <i>AccessPointName</i>-<i>AccountId</i>.s3-accesspoint.<i>Region</i>.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html">Using access points</a> in the <i>Amazon S3 User Guide</i>.</p>
127 pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128 self.inner = self.inner.set_bucket(input);
129 self
130 }
131 /// <p>The bucket whose Object Lock configuration you want to retrieve.</p>
132 /// <p><b>Access points</b> - When you use this action with an access point, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form <i>AccessPointName</i>-<i>AccountId</i>.s3-accesspoint.<i>Region</i>.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html">Using access points</a> in the <i>Amazon S3 User Guide</i>.</p>
133 pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
134 self.inner.get_bucket()
135 }
136 /// <p>The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code <code>403 Forbidden</code> (access denied).</p>
137 pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138 self.inner = self.inner.expected_bucket_owner(input.into());
139 self
140 }
141 /// <p>The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code <code>403 Forbidden</code> (access denied).</p>
142 pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143 self.inner = self.inner.set_expected_bucket_owner(input);
144 self
145 }
146 /// <p>The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code <code>403 Forbidden</code> (access denied).</p>
147 pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
148 self.inner.get_expected_bucket_owner()
149 }
150}