aws_sdk_s3control/types/_access_point.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>An access point used to access a bucket.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AccessPoint {
7 /// <p>The name of this access point.</p>
8 pub name: ::std::string::String,
9 /// <p>Indicates whether this access point allows access from the public internet. If <code>VpcConfiguration</code> is specified for this access point, then <code>NetworkOrigin</code> is <code>VPC</code>, and the access point doesn't allow access from the public internet. Otherwise, <code>NetworkOrigin</code> is <code>Internet</code>, and the access point allows access from the public internet, subject to the access point and bucket access policies.</p>
10 pub network_origin: crate::types::NetworkOrigin,
11 /// <p>The virtual private cloud (VPC) configuration for this access point, if one exists.</p><note>
12 /// <p>This element is empty if this access point is an Amazon S3 on Outposts access point that is used by other Amazon Web Services services.</p>
13 /// </note>
14 pub vpc_configuration: ::std::option::Option<crate::types::VpcConfiguration>,
15 /// <p>The name of the bucket associated with this access point.</p>
16 pub bucket: ::std::string::String,
17 /// <p>The ARN for the access point.</p>
18 pub access_point_arn: ::std::option::Option<::std::string::String>,
19 /// <p>The name or alias of the access point.</p>
20 pub alias: ::std::option::Option<::std::string::String>,
21 /// <p>The Amazon Web Services account ID associated with the S3 bucket associated with this access point.</p>
22 pub bucket_account_id: ::std::option::Option<::std::string::String>,
23 /// <p>A unique identifier for the data source of the access point.</p>
24 pub data_source_id: ::std::option::Option<::std::string::String>,
25 /// <p>The type of the data source that the access point is attached to.</p>
26 pub data_source_type: ::std::option::Option<::std::string::String>,
27}
28impl AccessPoint {
29 /// <p>The name of this access point.</p>
30 pub fn name(&self) -> &str {
31 use std::ops::Deref;
32 self.name.deref()
33 }
34 /// <p>Indicates whether this access point allows access from the public internet. If <code>VpcConfiguration</code> is specified for this access point, then <code>NetworkOrigin</code> is <code>VPC</code>, and the access point doesn't allow access from the public internet. Otherwise, <code>NetworkOrigin</code> is <code>Internet</code>, and the access point allows access from the public internet, subject to the access point and bucket access policies.</p>
35 pub fn network_origin(&self) -> &crate::types::NetworkOrigin {
36 &self.network_origin
37 }
38 /// <p>The virtual private cloud (VPC) configuration for this access point, if one exists.</p><note>
39 /// <p>This element is empty if this access point is an Amazon S3 on Outposts access point that is used by other Amazon Web Services services.</p>
40 /// </note>
41 pub fn vpc_configuration(&self) -> ::std::option::Option<&crate::types::VpcConfiguration> {
42 self.vpc_configuration.as_ref()
43 }
44 /// <p>The name of the bucket associated with this access point.</p>
45 pub fn bucket(&self) -> &str {
46 use std::ops::Deref;
47 self.bucket.deref()
48 }
49 /// <p>The ARN for the access point.</p>
50 pub fn access_point_arn(&self) -> ::std::option::Option<&str> {
51 self.access_point_arn.as_deref()
52 }
53 /// <p>The name or alias of the access point.</p>
54 pub fn alias(&self) -> ::std::option::Option<&str> {
55 self.alias.as_deref()
56 }
57 /// <p>The Amazon Web Services account ID associated with the S3 bucket associated with this access point.</p>
58 pub fn bucket_account_id(&self) -> ::std::option::Option<&str> {
59 self.bucket_account_id.as_deref()
60 }
61 /// <p>A unique identifier for the data source of the access point.</p>
62 pub fn data_source_id(&self) -> ::std::option::Option<&str> {
63 self.data_source_id.as_deref()
64 }
65 /// <p>The type of the data source that the access point is attached to.</p>
66 pub fn data_source_type(&self) -> ::std::option::Option<&str> {
67 self.data_source_type.as_deref()
68 }
69}
70impl AccessPoint {
71 /// Creates a new builder-style object to manufacture [`AccessPoint`](crate::types::AccessPoint).
72 pub fn builder() -> crate::types::builders::AccessPointBuilder {
73 crate::types::builders::AccessPointBuilder::default()
74 }
75}
76
77/// A builder for [`AccessPoint`](crate::types::AccessPoint).
78#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
79#[non_exhaustive]
80pub struct AccessPointBuilder {
81 pub(crate) name: ::std::option::Option<::std::string::String>,
82 pub(crate) network_origin: ::std::option::Option<crate::types::NetworkOrigin>,
83 pub(crate) vpc_configuration: ::std::option::Option<crate::types::VpcConfiguration>,
84 pub(crate) bucket: ::std::option::Option<::std::string::String>,
85 pub(crate) access_point_arn: ::std::option::Option<::std::string::String>,
86 pub(crate) alias: ::std::option::Option<::std::string::String>,
87 pub(crate) bucket_account_id: ::std::option::Option<::std::string::String>,
88 pub(crate) data_source_id: ::std::option::Option<::std::string::String>,
89 pub(crate) data_source_type: ::std::option::Option<::std::string::String>,
90}
91impl AccessPointBuilder {
92 /// <p>The name of this access point.</p>
93 /// This field is required.
94 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95 self.name = ::std::option::Option::Some(input.into());
96 self
97 }
98 /// <p>The name of this access point.</p>
99 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100 self.name = input;
101 self
102 }
103 /// <p>The name of this access point.</p>
104 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
105 &self.name
106 }
107 /// <p>Indicates whether this access point allows access from the public internet. If <code>VpcConfiguration</code> is specified for this access point, then <code>NetworkOrigin</code> is <code>VPC</code>, and the access point doesn't allow access from the public internet. Otherwise, <code>NetworkOrigin</code> is <code>Internet</code>, and the access point allows access from the public internet, subject to the access point and bucket access policies.</p>
108 /// This field is required.
109 pub fn network_origin(mut self, input: crate::types::NetworkOrigin) -> Self {
110 self.network_origin = ::std::option::Option::Some(input);
111 self
112 }
113 /// <p>Indicates whether this access point allows access from the public internet. If <code>VpcConfiguration</code> is specified for this access point, then <code>NetworkOrigin</code> is <code>VPC</code>, and the access point doesn't allow access from the public internet. Otherwise, <code>NetworkOrigin</code> is <code>Internet</code>, and the access point allows access from the public internet, subject to the access point and bucket access policies.</p>
114 pub fn set_network_origin(mut self, input: ::std::option::Option<crate::types::NetworkOrigin>) -> Self {
115 self.network_origin = input;
116 self
117 }
118 /// <p>Indicates whether this access point allows access from the public internet. If <code>VpcConfiguration</code> is specified for this access point, then <code>NetworkOrigin</code> is <code>VPC</code>, and the access point doesn't allow access from the public internet. Otherwise, <code>NetworkOrigin</code> is <code>Internet</code>, and the access point allows access from the public internet, subject to the access point and bucket access policies.</p>
119 pub fn get_network_origin(&self) -> &::std::option::Option<crate::types::NetworkOrigin> {
120 &self.network_origin
121 }
122 /// <p>The virtual private cloud (VPC) configuration for this access point, if one exists.</p><note>
123 /// <p>This element is empty if this access point is an Amazon S3 on Outposts access point that is used by other Amazon Web Services services.</p>
124 /// </note>
125 pub fn vpc_configuration(mut self, input: crate::types::VpcConfiguration) -> Self {
126 self.vpc_configuration = ::std::option::Option::Some(input);
127 self
128 }
129 /// <p>The virtual private cloud (VPC) configuration for this access point, if one exists.</p><note>
130 /// <p>This element is empty if this access point is an Amazon S3 on Outposts access point that is used by other Amazon Web Services services.</p>
131 /// </note>
132 pub fn set_vpc_configuration(mut self, input: ::std::option::Option<crate::types::VpcConfiguration>) -> Self {
133 self.vpc_configuration = input;
134 self
135 }
136 /// <p>The virtual private cloud (VPC) configuration for this access point, if one exists.</p><note>
137 /// <p>This element is empty if this access point is an Amazon S3 on Outposts access point that is used by other Amazon Web Services services.</p>
138 /// </note>
139 pub fn get_vpc_configuration(&self) -> &::std::option::Option<crate::types::VpcConfiguration> {
140 &self.vpc_configuration
141 }
142 /// <p>The name of the bucket associated with this access point.</p>
143 /// This field is required.
144 pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145 self.bucket = ::std::option::Option::Some(input.into());
146 self
147 }
148 /// <p>The name of the bucket associated with this access point.</p>
149 pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150 self.bucket = input;
151 self
152 }
153 /// <p>The name of the bucket associated with this access point.</p>
154 pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
155 &self.bucket
156 }
157 /// <p>The ARN for the access point.</p>
158 pub fn access_point_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159 self.access_point_arn = ::std::option::Option::Some(input.into());
160 self
161 }
162 /// <p>The ARN for the access point.</p>
163 pub fn set_access_point_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164 self.access_point_arn = input;
165 self
166 }
167 /// <p>The ARN for the access point.</p>
168 pub fn get_access_point_arn(&self) -> &::std::option::Option<::std::string::String> {
169 &self.access_point_arn
170 }
171 /// <p>The name or alias of the access point.</p>
172 pub fn alias(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173 self.alias = ::std::option::Option::Some(input.into());
174 self
175 }
176 /// <p>The name or alias of the access point.</p>
177 pub fn set_alias(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178 self.alias = input;
179 self
180 }
181 /// <p>The name or alias of the access point.</p>
182 pub fn get_alias(&self) -> &::std::option::Option<::std::string::String> {
183 &self.alias
184 }
185 /// <p>The Amazon Web Services account ID associated with the S3 bucket associated with this access point.</p>
186 pub fn bucket_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
187 self.bucket_account_id = ::std::option::Option::Some(input.into());
188 self
189 }
190 /// <p>The Amazon Web Services account ID associated with the S3 bucket associated with this access point.</p>
191 pub fn set_bucket_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
192 self.bucket_account_id = input;
193 self
194 }
195 /// <p>The Amazon Web Services account ID associated with the S3 bucket associated with this access point.</p>
196 pub fn get_bucket_account_id(&self) -> &::std::option::Option<::std::string::String> {
197 &self.bucket_account_id
198 }
199 /// <p>A unique identifier for the data source of the access point.</p>
200 pub fn data_source_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
201 self.data_source_id = ::std::option::Option::Some(input.into());
202 self
203 }
204 /// <p>A unique identifier for the data source of the access point.</p>
205 pub fn set_data_source_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
206 self.data_source_id = input;
207 self
208 }
209 /// <p>A unique identifier for the data source of the access point.</p>
210 pub fn get_data_source_id(&self) -> &::std::option::Option<::std::string::String> {
211 &self.data_source_id
212 }
213 /// <p>The type of the data source that the access point is attached to.</p>
214 pub fn data_source_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
215 self.data_source_type = ::std::option::Option::Some(input.into());
216 self
217 }
218 /// <p>The type of the data source that the access point is attached to.</p>
219 pub fn set_data_source_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
220 self.data_source_type = input;
221 self
222 }
223 /// <p>The type of the data source that the access point is attached to.</p>
224 pub fn get_data_source_type(&self) -> &::std::option::Option<::std::string::String> {
225 &self.data_source_type
226 }
227 /// Consumes the builder and constructs a [`AccessPoint`](crate::types::AccessPoint).
228 /// This method will fail if any of the following fields are not set:
229 /// - [`name`](crate::types::builders::AccessPointBuilder::name)
230 /// - [`network_origin`](crate::types::builders::AccessPointBuilder::network_origin)
231 /// - [`bucket`](crate::types::builders::AccessPointBuilder::bucket)
232 pub fn build(self) -> ::std::result::Result<crate::types::AccessPoint, ::aws_smithy_types::error::operation::BuildError> {
233 ::std::result::Result::Ok(crate::types::AccessPoint {
234 name: self.name.ok_or_else(|| {
235 ::aws_smithy_types::error::operation::BuildError::missing_field(
236 "name",
237 "name was not specified but it is required when building AccessPoint",
238 )
239 })?,
240 network_origin: self.network_origin.ok_or_else(|| {
241 ::aws_smithy_types::error::operation::BuildError::missing_field(
242 "network_origin",
243 "network_origin was not specified but it is required when building AccessPoint",
244 )
245 })?,
246 vpc_configuration: self.vpc_configuration,
247 bucket: self.bucket.ok_or_else(|| {
248 ::aws_smithy_types::error::operation::BuildError::missing_field(
249 "bucket",
250 "bucket was not specified but it is required when building AccessPoint",
251 )
252 })?,
253 access_point_arn: self.access_point_arn,
254 alias: self.alias,
255 bucket_account_id: self.bucket_account_id,
256 data_source_id: self.data_source_id,
257 data_source_type: self.data_source_type,
258 })
259 }
260}