aws_sdk_s3/operation/get_object_retention/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_object_retention::_get_object_retention_output::GetObjectRetentionOutputBuilder;
3
4pub use crate::operation::get_object_retention::_get_object_retention_input::GetObjectRetentionInputBuilder;
5
6impl crate::operation::get_object_retention::builders::GetObjectRetentionInputBuilder {
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_retention::GetObjectRetentionOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::get_object_retention::GetObjectRetentionError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.get_object_retention();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `GetObjectRetention`.
24///
25/// <note>
26/// <p>This operation is not supported for directory buckets.</p>
27/// </note>
28/// <p>Retrieves an object's retention settings. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html">Locking Objects</a>.</p>
29/// <p>This functionality is not supported for Amazon S3 on Outposts.</p>
30/// <p>The following action is related to <code>GetObjectRetention</code>:</p>
31/// <ul>
32/// <li>
33/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html">GetObjectAttributes</a></p></li>
34/// </ul><important>
35/// <p>You must URL encode any signed header values that contain spaces. For example, if your header value is <code>my file.txt</code>, containing two spaces after <code>my</code>, you must URL encode this value to <code>my%20%20file.txt</code>.</p>
36/// </important>
37#[derive(::std::clone::Clone, ::std::fmt::Debug)]
38pub struct GetObjectRetentionFluentBuilder {
39 handle: ::std::sync::Arc<crate::client::Handle>,
40 inner: crate::operation::get_object_retention::builders::GetObjectRetentionInputBuilder,
41 config_override: ::std::option::Option<crate::config::Builder>,
42}
43impl
44 crate::client::customize::internal::CustomizableSend<
45 crate::operation::get_object_retention::GetObjectRetentionOutput,
46 crate::operation::get_object_retention::GetObjectRetentionError,
47 > for GetObjectRetentionFluentBuilder
48{
49 fn send(
50 self,
51 config_override: crate::config::Builder,
52 ) -> crate::client::customize::internal::BoxFuture<
53 crate::client::customize::internal::SendResult<
54 crate::operation::get_object_retention::GetObjectRetentionOutput,
55 crate::operation::get_object_retention::GetObjectRetentionError,
56 >,
57 > {
58 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
59 }
60}
61impl GetObjectRetentionFluentBuilder {
62 /// Creates a new `GetObjectRetentionFluentBuilder`.
63 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
64 Self {
65 handle,
66 inner: ::std::default::Default::default(),
67 config_override: ::std::option::Option::None,
68 }
69 }
70 /// Access the GetObjectRetention as a reference.
71 pub fn as_input(&self) -> &crate::operation::get_object_retention::builders::GetObjectRetentionInputBuilder {
72 &self.inner
73 }
74 /// Sends the request and returns the response.
75 ///
76 /// If an error occurs, an `SdkError` will be returned with additional details that
77 /// can be matched against.
78 ///
79 /// By default, any retryable failures will be retried twice. Retry behavior
80 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
81 /// set when configuring the client.
82 pub async fn send(
83 self,
84 ) -> ::std::result::Result<
85 crate::operation::get_object_retention::GetObjectRetentionOutput,
86 ::aws_smithy_runtime_api::client::result::SdkError<
87 crate::operation::get_object_retention::GetObjectRetentionError,
88 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
89 >,
90 > {
91 let input = self
92 .inner
93 .build()
94 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
95 let runtime_plugins = crate::operation::get_object_retention::GetObjectRetention::operation_runtime_plugins(
96 self.handle.runtime_plugins.clone(),
97 &self.handle.conf,
98 self.config_override,
99 );
100 crate::operation::get_object_retention::GetObjectRetention::orchestrate(&runtime_plugins, input).await
101 }
102
103 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
104 pub fn customize(
105 self,
106 ) -> crate::client::customize::CustomizableOperation<
107 crate::operation::get_object_retention::GetObjectRetentionOutput,
108 crate::operation::get_object_retention::GetObjectRetentionError,
109 Self,
110 > {
111 crate::client::customize::CustomizableOperation::new(self)
112 }
113 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
114 self.set_config_override(::std::option::Option::Some(config_override.into()));
115 self
116 }
117
118 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
119 self.config_override = config_override;
120 self
121 }
122 /// <p>The bucket name containing the object whose retention settings you want to retrieve.</p>
123 /// <p><b>Access points</b> - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. 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>
124 pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125 self.inner = self.inner.bucket(input.into());
126 self
127 }
128 /// <p>The bucket name containing the object whose retention settings you want to retrieve.</p>
129 /// <p><b>Access points</b> - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. 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>
130 pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131 self.inner = self.inner.set_bucket(input);
132 self
133 }
134 /// <p>The bucket name containing the object whose retention settings you want to retrieve.</p>
135 /// <p><b>Access points</b> - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. 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>
136 pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
137 self.inner.get_bucket()
138 }
139 /// <p>The key name for the object whose retention settings you want to retrieve.</p>
140 pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141 self.inner = self.inner.key(input.into());
142 self
143 }
144 /// <p>The key name for the object whose retention settings you want to retrieve.</p>
145 pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146 self.inner = self.inner.set_key(input);
147 self
148 }
149 /// <p>The key name for the object whose retention settings you want to retrieve.</p>
150 pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
151 self.inner.get_key()
152 }
153 /// <p>The version ID for the object whose retention settings you want to retrieve.</p>
154 pub fn version_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155 self.inner = self.inner.version_id(input.into());
156 self
157 }
158 /// <p>The version ID for the object whose retention settings you want to retrieve.</p>
159 pub fn set_version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160 self.inner = self.inner.set_version_id(input);
161 self
162 }
163 /// <p>The version ID for the object whose retention settings you want to retrieve.</p>
164 pub fn get_version_id(&self) -> &::std::option::Option<::std::string::String> {
165 self.inner.get_version_id()
166 }
167 /// <p>Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html">Downloading Objects in Requester Pays Buckets</a> in the <i>Amazon S3 User Guide</i>.</p><note>
168 /// <p>This functionality is not supported for directory buckets.</p>
169 /// </note>
170 pub fn request_payer(mut self, input: crate::types::RequestPayer) -> Self {
171 self.inner = self.inner.request_payer(input);
172 self
173 }
174 /// <p>Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html">Downloading Objects in Requester Pays Buckets</a> in the <i>Amazon S3 User Guide</i>.</p><note>
175 /// <p>This functionality is not supported for directory buckets.</p>
176 /// </note>
177 pub fn set_request_payer(mut self, input: ::std::option::Option<crate::types::RequestPayer>) -> Self {
178 self.inner = self.inner.set_request_payer(input);
179 self
180 }
181 /// <p>Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html">Downloading Objects in Requester Pays Buckets</a> in the <i>Amazon S3 User Guide</i>.</p><note>
182 /// <p>This functionality is not supported for directory buckets.</p>
183 /// </note>
184 pub fn get_request_payer(&self) -> &::std::option::Option<crate::types::RequestPayer> {
185 self.inner.get_request_payer()
186 }
187 /// <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>
188 pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
189 self.inner = self.inner.expected_bucket_owner(input.into());
190 self
191 }
192 /// <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>
193 pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
194 self.inner = self.inner.set_expected_bucket_owner(input);
195 self
196 }
197 /// <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>
198 pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
199 self.inner.get_expected_bucket_owner()
200 }
201}