aws_sdk_dynamodb/operation/delete_resource_policy/_delete_resource_policy_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 DeleteResourcePolicyInput {
6 /// <p>The Amazon Resource Name (ARN) of the DynamoDB resource from which the policy will be removed. The resources you can specify include tables and streams. If you remove the policy of a table, it will also remove the permissions for the table's indexes defined in that policy document. This is because index permissions are defined in the table's policy.</p>
7 pub resource_arn: ::std::option::Option<::std::string::String>,
8 /// <p>A string value that you can use to conditionally delete your policy. When you provide an expected revision ID, if the revision ID of the existing policy on the resource doesn't match or if there's no policy attached to the resource, the request will fail and return a <code>PolicyNotFoundException</code>.</p>
9 pub expected_revision_id: ::std::option::Option<::std::string::String>,
10}
11impl DeleteResourcePolicyInput {
12 /// <p>The Amazon Resource Name (ARN) of the DynamoDB resource from which the policy will be removed. The resources you can specify include tables and streams. If you remove the policy of a table, it will also remove the permissions for the table's indexes defined in that policy document. This is because index permissions are defined in the table's policy.</p>
13 pub fn resource_arn(&self) -> ::std::option::Option<&str> {
14 self.resource_arn.as_deref()
15 }
16 /// <p>A string value that you can use to conditionally delete your policy. When you provide an expected revision ID, if the revision ID of the existing policy on the resource doesn't match or if there's no policy attached to the resource, the request will fail and return a <code>PolicyNotFoundException</code>.</p>
17 pub fn expected_revision_id(&self) -> ::std::option::Option<&str> {
18 self.expected_revision_id.as_deref()
19 }
20}
21impl DeleteResourcePolicyInput {
22 /// Creates a new builder-style object to manufacture [`DeleteResourcePolicyInput`](crate::operation::delete_resource_policy::DeleteResourcePolicyInput).
23 pub fn builder() -> crate::operation::delete_resource_policy::builders::DeleteResourcePolicyInputBuilder {
24 crate::operation::delete_resource_policy::builders::DeleteResourcePolicyInputBuilder::default()
25 }
26}
27
28/// A builder for [`DeleteResourcePolicyInput`](crate::operation::delete_resource_policy::DeleteResourcePolicyInput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct DeleteResourcePolicyInputBuilder {
32 pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
33 pub(crate) expected_revision_id: ::std::option::Option<::std::string::String>,
34}
35impl DeleteResourcePolicyInputBuilder {
36 /// <p>The Amazon Resource Name (ARN) of the DynamoDB resource from which the policy will be removed. The resources you can specify include tables and streams. If you remove the policy of a table, it will also remove the permissions for the table's indexes defined in that policy document. This is because index permissions are defined in the table's policy.</p>
37 /// This field is required.
38 pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39 self.resource_arn = ::std::option::Option::Some(input.into());
40 self
41 }
42 /// <p>The Amazon Resource Name (ARN) of the DynamoDB resource from which the policy will be removed. The resources you can specify include tables and streams. If you remove the policy of a table, it will also remove the permissions for the table's indexes defined in that policy document. This is because index permissions are defined in the table's policy.</p>
43 pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44 self.resource_arn = input;
45 self
46 }
47 /// <p>The Amazon Resource Name (ARN) of the DynamoDB resource from which the policy will be removed. The resources you can specify include tables and streams. If you remove the policy of a table, it will also remove the permissions for the table's indexes defined in that policy document. This is because index permissions are defined in the table's policy.</p>
48 pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
49 &self.resource_arn
50 }
51 /// <p>A string value that you can use to conditionally delete your policy. When you provide an expected revision ID, if the revision ID of the existing policy on the resource doesn't match or if there's no policy attached to the resource, the request will fail and return a <code>PolicyNotFoundException</code>.</p>
52 pub fn expected_revision_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53 self.expected_revision_id = ::std::option::Option::Some(input.into());
54 self
55 }
56 /// <p>A string value that you can use to conditionally delete your policy. When you provide an expected revision ID, if the revision ID of the existing policy on the resource doesn't match or if there's no policy attached to the resource, the request will fail and return a <code>PolicyNotFoundException</code>.</p>
57 pub fn set_expected_revision_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58 self.expected_revision_id = input;
59 self
60 }
61 /// <p>A string value that you can use to conditionally delete your policy. When you provide an expected revision ID, if the revision ID of the existing policy on the resource doesn't match or if there's no policy attached to the resource, the request will fail and return a <code>PolicyNotFoundException</code>.</p>
62 pub fn get_expected_revision_id(&self) -> &::std::option::Option<::std::string::String> {
63 &self.expected_revision_id
64 }
65 /// Consumes the builder and constructs a [`DeleteResourcePolicyInput`](crate::operation::delete_resource_policy::DeleteResourcePolicyInput).
66 pub fn build(
67 self,
68 ) -> ::std::result::Result<crate::operation::delete_resource_policy::DeleteResourcePolicyInput, ::aws_smithy_types::error::operation::BuildError>
69 {
70 ::std::result::Result::Ok(crate::operation::delete_resource_policy::DeleteResourcePolicyInput {
71 resource_arn: self.resource_arn,
72 expected_revision_id: self.expected_revision_id,
73 })
74 }
75}