aws_sdk_s3/operation/restore_object/
_restore_object_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct RestoreObjectInput {
6    /// <p>The bucket name containing the object to restore.</p>
7    /// <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>
8    /// <p><b>S3 on Outposts</b> - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form <code> <i>AccessPointName</i>-<i>AccountId</i>.<i>outpostID</i>.s3-outposts.<i>Region</i>.amazonaws.com</code>. When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">What is S3 on Outposts?</a> in the <i>Amazon S3 User Guide</i>.</p>
9    pub bucket: ::std::option::Option<::std::string::String>,
10    /// <p>Object key for which the action was initiated.</p>
11    pub key: ::std::option::Option<::std::string::String>,
12    /// <p>VersionId used to reference a specific version of the object.</p>
13    pub version_id: ::std::option::Option<::std::string::String>,
14    /// <p>Container for restore job parameters.</p>
15    pub restore_request: ::std::option::Option<crate::types::RestoreRequest>,
16    /// <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>
17    /// <p>This functionality is not supported for directory buckets.</p>
18    /// </note>
19    pub request_payer: ::std::option::Option<crate::types::RequestPayer>,
20    /// <p>Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding <code>x-amz-checksum</code> or <code>x-amz-trailer</code> header sent. Otherwise, Amazon S3 fails the request with the HTTP status code <code>400 Bad Request</code>. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
21    /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
22    pub checksum_algorithm: ::std::option::Option<crate::types::ChecksumAlgorithm>,
23    /// <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>
24    pub expected_bucket_owner: ::std::option::Option<::std::string::String>,
25}
26impl RestoreObjectInput {
27    /// <p>The bucket name containing the object to restore.</p>
28    /// <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>
29    /// <p><b>S3 on Outposts</b> - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form <code> <i>AccessPointName</i>-<i>AccountId</i>.<i>outpostID</i>.s3-outposts.<i>Region</i>.amazonaws.com</code>. When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">What is S3 on Outposts?</a> in the <i>Amazon S3 User Guide</i>.</p>
30    pub fn bucket(&self) -> ::std::option::Option<&str> {
31        self.bucket.as_deref()
32    }
33    /// <p>Object key for which the action was initiated.</p>
34    pub fn key(&self) -> ::std::option::Option<&str> {
35        self.key.as_deref()
36    }
37    /// <p>VersionId used to reference a specific version of the object.</p>
38    pub fn version_id(&self) -> ::std::option::Option<&str> {
39        self.version_id.as_deref()
40    }
41    /// <p>Container for restore job parameters.</p>
42    pub fn restore_request(&self) -> ::std::option::Option<&crate::types::RestoreRequest> {
43        self.restore_request.as_ref()
44    }
45    /// <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>
46    /// <p>This functionality is not supported for directory buckets.</p>
47    /// </note>
48    pub fn request_payer(&self) -> ::std::option::Option<&crate::types::RequestPayer> {
49        self.request_payer.as_ref()
50    }
51    /// <p>Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding <code>x-amz-checksum</code> or <code>x-amz-trailer</code> header sent. Otherwise, Amazon S3 fails the request with the HTTP status code <code>400 Bad Request</code>. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
52    /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
53    pub fn checksum_algorithm(&self) -> ::std::option::Option<&crate::types::ChecksumAlgorithm> {
54        self.checksum_algorithm.as_ref()
55    }
56    /// <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>
57    pub fn expected_bucket_owner(&self) -> ::std::option::Option<&str> {
58        self.expected_bucket_owner.as_deref()
59    }
60}
61impl RestoreObjectInput {
62    /// Creates a new builder-style object to manufacture [`RestoreObjectInput`](crate::operation::restore_object::RestoreObjectInput).
63    pub fn builder() -> crate::operation::restore_object::builders::RestoreObjectInputBuilder {
64        crate::operation::restore_object::builders::RestoreObjectInputBuilder::default()
65    }
66}
67
68/// A builder for [`RestoreObjectInput`](crate::operation::restore_object::RestoreObjectInput).
69#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
70#[non_exhaustive]
71pub struct RestoreObjectInputBuilder {
72    pub(crate) bucket: ::std::option::Option<::std::string::String>,
73    pub(crate) key: ::std::option::Option<::std::string::String>,
74    pub(crate) version_id: ::std::option::Option<::std::string::String>,
75    pub(crate) restore_request: ::std::option::Option<crate::types::RestoreRequest>,
76    pub(crate) request_payer: ::std::option::Option<crate::types::RequestPayer>,
77    pub(crate) checksum_algorithm: ::std::option::Option<crate::types::ChecksumAlgorithm>,
78    pub(crate) expected_bucket_owner: ::std::option::Option<::std::string::String>,
79}
80impl RestoreObjectInputBuilder {
81    /// <p>The bucket name containing the object to restore.</p>
82    /// <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>
83    /// <p><b>S3 on Outposts</b> - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form <code> <i>AccessPointName</i>-<i>AccountId</i>.<i>outpostID</i>.s3-outposts.<i>Region</i>.amazonaws.com</code>. When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">What is S3 on Outposts?</a> in the <i>Amazon S3 User Guide</i>.</p>
84    /// This field is required.
85    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
86        self.bucket = ::std::option::Option::Some(input.into());
87        self
88    }
89    /// <p>The bucket name containing the object to restore.</p>
90    /// <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>
91    /// <p><b>S3 on Outposts</b> - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form <code> <i>AccessPointName</i>-<i>AccountId</i>.<i>outpostID</i>.s3-outposts.<i>Region</i>.amazonaws.com</code>. When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">What is S3 on Outposts?</a> in the <i>Amazon S3 User Guide</i>.</p>
92    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
93        self.bucket = input;
94        self
95    }
96    /// <p>The bucket name containing the object to restore.</p>
97    /// <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>
98    /// <p><b>S3 on Outposts</b> - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form <code> <i>AccessPointName</i>-<i>AccountId</i>.<i>outpostID</i>.s3-outposts.<i>Region</i>.amazonaws.com</code>. When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">What is S3 on Outposts?</a> in the <i>Amazon S3 User Guide</i>.</p>
99    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
100        &self.bucket
101    }
102    /// <p>Object key for which the action was initiated.</p>
103    /// This field is required.
104    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105        self.key = ::std::option::Option::Some(input.into());
106        self
107    }
108    /// <p>Object key for which the action was initiated.</p>
109    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110        self.key = input;
111        self
112    }
113    /// <p>Object key for which the action was initiated.</p>
114    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
115        &self.key
116    }
117    /// <p>VersionId used to reference a specific version of the object.</p>
118    pub fn version_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.version_id = ::std::option::Option::Some(input.into());
120        self
121    }
122    /// <p>VersionId used to reference a specific version of the object.</p>
123    pub fn set_version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.version_id = input;
125        self
126    }
127    /// <p>VersionId used to reference a specific version of the object.</p>
128    pub fn get_version_id(&self) -> &::std::option::Option<::std::string::String> {
129        &self.version_id
130    }
131    /// <p>Container for restore job parameters.</p>
132    pub fn restore_request(mut self, input: crate::types::RestoreRequest) -> Self {
133        self.restore_request = ::std::option::Option::Some(input);
134        self
135    }
136    /// <p>Container for restore job parameters.</p>
137    pub fn set_restore_request(mut self, input: ::std::option::Option<crate::types::RestoreRequest>) -> Self {
138        self.restore_request = input;
139        self
140    }
141    /// <p>Container for restore job parameters.</p>
142    pub fn get_restore_request(&self) -> &::std::option::Option<crate::types::RestoreRequest> {
143        &self.restore_request
144    }
145    /// <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>
146    /// <p>This functionality is not supported for directory buckets.</p>
147    /// </note>
148    pub fn request_payer(mut self, input: crate::types::RequestPayer) -> Self {
149        self.request_payer = ::std::option::Option::Some(input);
150        self
151    }
152    /// <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>
153    /// <p>This functionality is not supported for directory buckets.</p>
154    /// </note>
155    pub fn set_request_payer(mut self, input: ::std::option::Option<crate::types::RequestPayer>) -> Self {
156        self.request_payer = input;
157        self
158    }
159    /// <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>
160    /// <p>This functionality is not supported for directory buckets.</p>
161    /// </note>
162    pub fn get_request_payer(&self) -> &::std::option::Option<crate::types::RequestPayer> {
163        &self.request_payer
164    }
165    /// <p>Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding <code>x-amz-checksum</code> or <code>x-amz-trailer</code> header sent. Otherwise, Amazon S3 fails the request with the HTTP status code <code>400 Bad Request</code>. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
166    /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
167    pub fn checksum_algorithm(mut self, input: crate::types::ChecksumAlgorithm) -> Self {
168        self.checksum_algorithm = ::std::option::Option::Some(input);
169        self
170    }
171    /// <p>Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding <code>x-amz-checksum</code> or <code>x-amz-trailer</code> header sent. Otherwise, Amazon S3 fails the request with the HTTP status code <code>400 Bad Request</code>. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
172    /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
173    pub fn set_checksum_algorithm(mut self, input: ::std::option::Option<crate::types::ChecksumAlgorithm>) -> Self {
174        self.checksum_algorithm = input;
175        self
176    }
177    /// <p>Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding <code>x-amz-checksum</code> or <code>x-amz-trailer</code> header sent. Otherwise, Amazon S3 fails the request with the HTTP status code <code>400 Bad Request</code>. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking object integrity</a> in the <i>Amazon S3 User Guide</i>.</p>
178    /// <p>If you provide an individual checksum, Amazon S3 ignores any provided <code>ChecksumAlgorithm</code> parameter.</p>
179    pub fn get_checksum_algorithm(&self) -> &::std::option::Option<crate::types::ChecksumAlgorithm> {
180        &self.checksum_algorithm
181    }
182    /// <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>
183    pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
184        self.expected_bucket_owner = ::std::option::Option::Some(input.into());
185        self
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 set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
189        self.expected_bucket_owner = input;
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 get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
194        &self.expected_bucket_owner
195    }
196    /// Consumes the builder and constructs a [`RestoreObjectInput`](crate::operation::restore_object::RestoreObjectInput).
197    pub fn build(
198        self,
199    ) -> ::std::result::Result<crate::operation::restore_object::RestoreObjectInput, ::aws_smithy_types::error::operation::BuildError> {
200        ::std::result::Result::Ok(crate::operation::restore_object::RestoreObjectInput {
201            bucket: self.bucket,
202            key: self.key,
203            version_id: self.version_id,
204            restore_request: self.restore_request,
205            request_payer: self.request_payer,
206            checksum_algorithm: self.checksum_algorithm,
207            expected_bucket_owner: self.expected_bucket_owner,
208        })
209    }
210}