aws_sdk_s3/operation/get_object_legal_hold/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_object_legal_hold::_get_object_legal_hold_output::GetObjectLegalHoldOutputBuilder;
3
4pub use crate::operation::get_object_legal_hold::_get_object_legal_hold_input::GetObjectLegalHoldInputBuilder;
5
6impl crate::operation::get_object_legal_hold::builders::GetObjectLegalHoldInputBuilder {
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_legal_hold::GetObjectLegalHoldOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_object_legal_hold::GetObjectLegalHoldError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_object_legal_hold();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetObjectLegalHold`.
24///
25/// <note>
26/// <p>This operation is not supported for directory buckets.</p>
27/// </note>
28/// <p>Gets an object's current legal hold status. 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>GetObjectLegalHold</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>
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct GetObjectLegalHoldFluentBuilder {
37    handle: ::std::sync::Arc<crate::client::Handle>,
38    inner: crate::operation::get_object_legal_hold::builders::GetObjectLegalHoldInputBuilder,
39    config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42    crate::client::customize::internal::CustomizableSend<
43        crate::operation::get_object_legal_hold::GetObjectLegalHoldOutput,
44        crate::operation::get_object_legal_hold::GetObjectLegalHoldError,
45    > for GetObjectLegalHoldFluentBuilder
46{
47    fn send(
48        self,
49        config_override: crate::config::Builder,
50    ) -> crate::client::customize::internal::BoxFuture<
51        crate::client::customize::internal::SendResult<
52            crate::operation::get_object_legal_hold::GetObjectLegalHoldOutput,
53            crate::operation::get_object_legal_hold::GetObjectLegalHoldError,
54        >,
55    > {
56        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57    }
58}
59impl GetObjectLegalHoldFluentBuilder {
60    /// Creates a new `GetObjectLegalHoldFluentBuilder`.
61    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
62        Self {
63            handle,
64            inner: ::std::default::Default::default(),
65            config_override: ::std::option::Option::None,
66        }
67    }
68    /// Access the GetObjectLegalHold as a reference.
69    pub fn as_input(&self) -> &crate::operation::get_object_legal_hold::builders::GetObjectLegalHoldInputBuilder {
70        &self.inner
71    }
72    /// Sends the request and returns the response.
73    ///
74    /// If an error occurs, an `SdkError` will be returned with additional details that
75    /// can be matched against.
76    ///
77    /// By default, any retryable failures will be retried twice. Retry behavior
78    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
79    /// set when configuring the client.
80    pub async fn send(
81        self,
82    ) -> ::std::result::Result<
83        crate::operation::get_object_legal_hold::GetObjectLegalHoldOutput,
84        ::aws_smithy_runtime_api::client::result::SdkError<
85            crate::operation::get_object_legal_hold::GetObjectLegalHoldError,
86            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
87        >,
88    > {
89        let input = self
90            .inner
91            .build()
92            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
93        let runtime_plugins = crate::operation::get_object_legal_hold::GetObjectLegalHold::operation_runtime_plugins(
94            self.handle.runtime_plugins.clone(),
95            &self.handle.conf,
96            self.config_override,
97        );
98        crate::operation::get_object_legal_hold::GetObjectLegalHold::orchestrate(&runtime_plugins, input).await
99    }
100
101    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
102    pub fn customize(
103        self,
104    ) -> crate::client::customize::CustomizableOperation<
105        crate::operation::get_object_legal_hold::GetObjectLegalHoldOutput,
106        crate::operation::get_object_legal_hold::GetObjectLegalHoldError,
107        Self,
108    > {
109        crate::client::customize::CustomizableOperation::new(self)
110    }
111    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
112        self.set_config_override(::std::option::Option::Some(config_override.into()));
113        self
114    }
115
116    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
117        self.config_override = config_override;
118        self
119    }
120    /// <p>The bucket name containing the object whose legal hold status you want to retrieve.</p>
121    /// <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>
122    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        self.inner = self.inner.bucket(input.into());
124        self
125    }
126    /// <p>The bucket name containing the object whose legal hold status you want to retrieve.</p>
127    /// <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>
128    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129        self.inner = self.inner.set_bucket(input);
130        self
131    }
132    /// <p>The bucket name containing the object whose legal hold status you want to retrieve.</p>
133    /// <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>
134    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
135        self.inner.get_bucket()
136    }
137    /// <p>The key name for the object whose legal hold status you want to retrieve.</p>
138    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139        self.inner = self.inner.key(input.into());
140        self
141    }
142    /// <p>The key name for the object whose legal hold status you want to retrieve.</p>
143    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144        self.inner = self.inner.set_key(input);
145        self
146    }
147    /// <p>The key name for the object whose legal hold status you want to retrieve.</p>
148    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
149        self.inner.get_key()
150    }
151    /// <p>The version ID of the object whose legal hold status you want to retrieve.</p>
152    pub fn version_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153        self.inner = self.inner.version_id(input.into());
154        self
155    }
156    /// <p>The version ID of the object whose legal hold status you want to retrieve.</p>
157    pub fn set_version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158        self.inner = self.inner.set_version_id(input);
159        self
160    }
161    /// <p>The version ID of the object whose legal hold status you want to retrieve.</p>
162    pub fn get_version_id(&self) -> &::std::option::Option<::std::string::String> {
163        self.inner.get_version_id()
164    }
165    /// <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>
166    /// <p>This functionality is not supported for directory buckets.</p>
167    /// </note>
168    pub fn request_payer(mut self, input: crate::types::RequestPayer) -> Self {
169        self.inner = self.inner.request_payer(input);
170        self
171    }
172    /// <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>
173    /// <p>This functionality is not supported for directory buckets.</p>
174    /// </note>
175    pub fn set_request_payer(mut self, input: ::std::option::Option<crate::types::RequestPayer>) -> Self {
176        self.inner = self.inner.set_request_payer(input);
177        self
178    }
179    /// <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>
180    /// <p>This functionality is not supported for directory buckets.</p>
181    /// </note>
182    pub fn get_request_payer(&self) -> &::std::option::Option<crate::types::RequestPayer> {
183        self.inner.get_request_payer()
184    }
185    /// <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>
186    pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
187        self.inner = self.inner.expected_bucket_owner(input.into());
188        self
189    }
190    /// <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>
191    pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
192        self.inner = self.inner.set_expected_bucket_owner(input);
193        self
194    }
195    /// <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>
196    pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
197        self.inner.get_expected_bucket_owner()
198    }
199}