aws_sdk_s3/operation/get_object_retention/
_get_object_retention_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 GetObjectRetentionInput {
6    /// <p>The bucket name containing the object whose retention settings you want to retrieve.</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    pub bucket: ::std::option::Option<::std::string::String>,
9    /// <p>The key name for the object whose retention settings you want to retrieve.</p>
10    pub key: ::std::option::Option<::std::string::String>,
11    /// <p>The version ID for the object whose retention settings you want to retrieve.</p>
12    pub version_id: ::std::option::Option<::std::string::String>,
13    /// <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>
14    /// <p>This functionality is not supported for directory buckets.</p>
15    /// </note>
16    pub request_payer: ::std::option::Option<crate::types::RequestPayer>,
17    /// <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>
18    pub expected_bucket_owner: ::std::option::Option<::std::string::String>,
19}
20impl GetObjectRetentionInput {
21    /// <p>The bucket name containing the object whose retention settings you want to retrieve.</p>
22    /// <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>
23    pub fn bucket(&self) -> ::std::option::Option<&str> {
24        self.bucket.as_deref()
25    }
26    /// <p>The key name for the object whose retention settings you want to retrieve.</p>
27    pub fn key(&self) -> ::std::option::Option<&str> {
28        self.key.as_deref()
29    }
30    /// <p>The version ID for the object whose retention settings you want to retrieve.</p>
31    pub fn version_id(&self) -> ::std::option::Option<&str> {
32        self.version_id.as_deref()
33    }
34    /// <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>
35    /// <p>This functionality is not supported for directory buckets.</p>
36    /// </note>
37    pub fn request_payer(&self) -> ::std::option::Option<&crate::types::RequestPayer> {
38        self.request_payer.as_ref()
39    }
40    /// <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>
41    pub fn expected_bucket_owner(&self) -> ::std::option::Option<&str> {
42        self.expected_bucket_owner.as_deref()
43    }
44}
45impl GetObjectRetentionInput {
46    /// Creates a new builder-style object to manufacture [`GetObjectRetentionInput`](crate::operation::get_object_retention::GetObjectRetentionInput).
47    pub fn builder() -> crate::operation::get_object_retention::builders::GetObjectRetentionInputBuilder {
48        crate::operation::get_object_retention::builders::GetObjectRetentionInputBuilder::default()
49    }
50}
51
52/// A builder for [`GetObjectRetentionInput`](crate::operation::get_object_retention::GetObjectRetentionInput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct GetObjectRetentionInputBuilder {
56    pub(crate) bucket: ::std::option::Option<::std::string::String>,
57    pub(crate) key: ::std::option::Option<::std::string::String>,
58    pub(crate) version_id: ::std::option::Option<::std::string::String>,
59    pub(crate) request_payer: ::std::option::Option<crate::types::RequestPayer>,
60    pub(crate) expected_bucket_owner: ::std::option::Option<::std::string::String>,
61}
62impl GetObjectRetentionInputBuilder {
63    /// <p>The bucket name containing the object whose retention settings you want to retrieve.</p>
64    /// <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>
65    /// This field is required.
66    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.bucket = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>The bucket name containing the object whose retention settings you want to retrieve.</p>
71    /// <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>
72    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.bucket = input;
74        self
75    }
76    /// <p>The bucket name containing the object whose retention settings you want to retrieve.</p>
77    /// <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>
78    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
79        &self.bucket
80    }
81    /// <p>The key name for the object whose retention settings you want to retrieve.</p>
82    /// This field is required.
83    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84        self.key = ::std::option::Option::Some(input.into());
85        self
86    }
87    /// <p>The key name for the object whose retention settings you want to retrieve.</p>
88    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89        self.key = input;
90        self
91    }
92    /// <p>The key name for the object whose retention settings you want to retrieve.</p>
93    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
94        &self.key
95    }
96    /// <p>The version ID for the object whose retention settings you want to retrieve.</p>
97    pub fn version_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
98        self.version_id = ::std::option::Option::Some(input.into());
99        self
100    }
101    /// <p>The version ID for the object whose retention settings you want to retrieve.</p>
102    pub fn set_version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103        self.version_id = input;
104        self
105    }
106    /// <p>The version ID for the object whose retention settings you want to retrieve.</p>
107    pub fn get_version_id(&self) -> &::std::option::Option<::std::string::String> {
108        &self.version_id
109    }
110    /// <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>
111    /// <p>This functionality is not supported for directory buckets.</p>
112    /// </note>
113    pub fn request_payer(mut self, input: crate::types::RequestPayer) -> Self {
114        self.request_payer = ::std::option::Option::Some(input);
115        self
116    }
117    /// <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>
118    /// <p>This functionality is not supported for directory buckets.</p>
119    /// </note>
120    pub fn set_request_payer(mut self, input: ::std::option::Option<crate::types::RequestPayer>) -> Self {
121        self.request_payer = input;
122        self
123    }
124    /// <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>
125    /// <p>This functionality is not supported for directory buckets.</p>
126    /// </note>
127    pub fn get_request_payer(&self) -> &::std::option::Option<crate::types::RequestPayer> {
128        &self.request_payer
129    }
130    /// <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>
131    pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.expected_bucket_owner = ::std::option::Option::Some(input.into());
133        self
134    }
135    /// <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>
136    pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.expected_bucket_owner = input;
138        self
139    }
140    /// <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>
141    pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
142        &self.expected_bucket_owner
143    }
144    /// Consumes the builder and constructs a [`GetObjectRetentionInput`](crate::operation::get_object_retention::GetObjectRetentionInput).
145    pub fn build(
146        self,
147    ) -> ::std::result::Result<crate::operation::get_object_retention::GetObjectRetentionInput, ::aws_smithy_types::error::operation::BuildError>
148    {
149        ::std::result::Result::Ok(crate::operation::get_object_retention::GetObjectRetentionInput {
150            bucket: self.bucket,
151            key: self.key,
152            version_id: self.version_id,
153            request_payer: self.request_payer,
154            expected_bucket_owner: self.expected_bucket_owner,
155        })
156    }
157}