3 3 | #[non_exhaustive]
|
4 4 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
5 5 | pub struct GetBucketRequestPaymentInput {
|
6 6 | /// <p>The name of the bucket for which to get the payment request configuration</p>
|
7 7 | pub bucket: ::std::option::Option<::std::string::String>,
|
8 8 | /// <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>
|
9 9 | pub expected_bucket_owner: ::std::option::Option<::std::string::String>,
|
10 10 | }
|
11 11 | impl GetBucketRequestPaymentInput {
|
12 12 | /// <p>The name of the bucket for which to get the payment request configuration</p>
|
13 13 | pub fn bucket(&self) -> ::std::option::Option<&str> {
|
14 14 | self.bucket.as_deref()
|
15 15 | }
|
16 16 | /// <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>
|
17 17 | pub fn expected_bucket_owner(&self) -> ::std::option::Option<&str> {
|
18 18 | self.expected_bucket_owner.as_deref()
|
19 19 | }
|
20 20 | }
|
21 21 | static GETBUCKETREQUESTPAYMENTINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
|
22 22 | "com.amazonaws.s3.synthetic#GetBucketRequestPaymentInput",
|
23 23 | "com.amazonaws.s3.synthetic",
|
24 24 | "GetBucketRequestPaymentInput",
|
25 25 | );
|
26 26 | static GETBUCKETREQUESTPAYMENTINPUT_MEMBER_BUCKET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
27 27 | ::aws_smithy_schema::ShapeId::from_static(
|
28 28 | "com.amazonaws.s3.synthetic#GetBucketRequestPaymentInput$Bucket",
|
29 29 | "com.amazonaws.s3.synthetic",
|
30 30 | "GetBucketRequestPaymentInput",
|
31 31 | ),
|
32 32 | ::aws_smithy_schema::ShapeType::String,
|
33 - | "bucket",
|
33 + | "Bucket",
|
34 34 | 0,
|
35 35 | )
|
36 36 | .with_http_label();
|
37 37 | static GETBUCKETREQUESTPAYMENTINPUT_MEMBER_EXPECTED_BUCKET_OWNER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
38 38 | ::aws_smithy_schema::ShapeId::from_static(
|
39 39 | "com.amazonaws.s3.synthetic#GetBucketRequestPaymentInput$ExpectedBucketOwner",
|
40 40 | "com.amazonaws.s3.synthetic",
|
41 41 | "GetBucketRequestPaymentInput",
|
42 42 | ),
|
43 43 | ::aws_smithy_schema::ShapeType::String,
|
44 - | "expected_bucket_owner",
|
44 + | "ExpectedBucketOwner",
|
45 45 | 1,
|
46 46 | )
|
47 47 | .with_http_header("x-amz-expected-bucket-owner");
|
48 48 | static GETBUCKETREQUESTPAYMENTINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
49 49 | GETBUCKETREQUESTPAYMENTINPUT_SCHEMA_ID,
|
50 50 | ::aws_smithy_schema::ShapeType::Structure,
|
51 51 | &[
|
52 52 | &GETBUCKETREQUESTPAYMENTINPUT_MEMBER_BUCKET,
|
53 53 | &GETBUCKETREQUESTPAYMENTINPUT_MEMBER_EXPECTED_BUCKET_OWNER,
|
54 54 | ],
|
55 - | );
|
55 + | )
|
56 + | .with_http(aws_smithy_schema::traits::HttpTrait::new("GET", "/?requestPayment", None));
|
56 57 | impl GetBucketRequestPaymentInput {
|
57 58 | /// The schema for this shape.
|
58 59 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &GETBUCKETREQUESTPAYMENTINPUT_SCHEMA;
|
59 60 | }
|
60 61 | impl ::aws_smithy_schema::serde::SerializableStruct for GetBucketRequestPaymentInput {
|
61 62 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
62 63 | fn serialize_members(
|
63 64 | &self,
|
64 65 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
65 66 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
66 67 | if let Some(ref val) = self.bucket {
|
67 68 | ser.write_string(&GETBUCKETREQUESTPAYMENTINPUT_MEMBER_BUCKET, val)?;
|
68 69 | }
|
69 70 | if let Some(ref val) = self.expected_bucket_owner {
|
70 71 | ser.write_string(&GETBUCKETREQUESTPAYMENTINPUT_MEMBER_EXPECTED_BUCKET_OWNER, val)?;
|
71 72 | }
|
72 73 | Ok(())
|
73 74 | }
|
74 75 | }
|
75 76 | impl GetBucketRequestPaymentInput {
|
76 77 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
77 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
78 - | deserializer: &mut D,
|
78 + | pub fn deserialize(
|
79 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
79 80 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
80 81 | #[allow(unused_variables, unused_mut)]
|
81 82 | let mut builder = Self::builder();
|
82 83 | #[allow(
|
83 84 | unused_variables,
|
84 85 | unreachable_code,
|
85 86 | clippy::single_match,
|
86 87 | clippy::match_single_binding,
|
87 88 | clippy::diverging_sub_expression
|
88 89 | )]
|
89 - | deserializer.read_struct(&GETBUCKETREQUESTPAYMENTINPUT_SCHEMA, (), |_, member, deser| {
|
90 + | deserializer.read_struct(&GETBUCKETREQUESTPAYMENTINPUT_SCHEMA, &mut |member, deser| {
|
90 91 | match member.member_index() {
|
91 92 | Some(0) => {
|
92 93 | builder.bucket = Some(deser.read_string(member)?);
|
93 94 | }
|
94 95 | Some(1) => {
|
95 96 | builder.expected_bucket_owner = Some(deser.read_string(member)?);
|
96 97 | }
|
97 98 | _ => {}
|
98 99 | }
|
99 100 | Ok(())
|
100 101 | })?;
|
102 + | builder.bucket = builder.bucket.or(Some(String::new()));
|
103 + | builder
|
104 + | .build()
|
105 + | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
106 + | }
|
107 + | }
|
108 + | impl GetBucketRequestPaymentInput {
|
109 + | /// Deserializes this structure from a body deserializer and HTTP response headers.
|
110 + | /// Header-bound members are read directly from headers, avoiding runtime
|
111 + | /// member iteration overhead. Body members are read via the deserializer.
|
112 + | pub fn deserialize_with_response(
|
113 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
114 + | headers: &::aws_smithy_runtime_api::http::Headers,
|
115 + | _status: u16,
|
116 + | _body: &[u8],
|
117 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
118 + | #[allow(unused_variables, unused_mut)]
|
119 + | let mut builder = Self::builder();
|
120 + | if let Some(val) = headers.get("x-amz-expected-bucket-owner") {
|
121 + | builder.expected_bucket_owner = Some(val.to_string());
|
122 + | }
|
123 + | #[allow(
|
124 + | unused_variables,
|
125 + | unreachable_code,
|
126 + | clippy::single_match,
|
127 + | clippy::match_single_binding,
|
128 + | clippy::diverging_sub_expression
|
129 + | )]
|
130 + | deserializer.read_struct(&GETBUCKETREQUESTPAYMENTINPUT_SCHEMA, &mut |member, deser| {
|
131 + | match member.member_index() {
|
132 + | Some(0) => {
|
133 + | builder.bucket = Some(deser.read_string(member)?);
|
134 + | }
|
135 + | Some(1) => { /* read from headers above */ }
|
136 + | _ => {}
|
137 + | }
|
138 + | Ok(())
|
139 + | })?;
|
101 140 | builder
|
102 141 | .build()
|
103 142 | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
104 143 | }
|
105 144 | }
|
106 145 | impl GetBucketRequestPaymentInput {
|
107 146 | /// Creates a new builder-style object to manufacture [`GetBucketRequestPaymentInput`](crate::operation::get_bucket_request_payment::GetBucketRequestPaymentInput).
|
108 147 | pub fn builder() -> crate::operation::get_bucket_request_payment::builders::GetBucketRequestPaymentInputBuilder {
|
109 148 | crate::operation::get_bucket_request_payment::builders::GetBucketRequestPaymentInputBuilder::default()
|
110 149 | }
|