Skip to main content

aws_sdk_cloudwatchlogs/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 name of the policy to be revoked. This parameter is required.</p>
7    pub policy_name: ::std::option::Option<::std::string::String>,
8    /// <p>The ARN of the CloudWatch Logs resource for which the resource policy needs to be deleted</p>
9    pub resource_arn: ::std::option::Option<::std::string::String>,
10    /// <p>The expected revision ID of the resource policy. Required when deleting a resource-scoped policy to prevent concurrent modifications.</p>
11    pub expected_revision_id: ::std::option::Option<::std::string::String>,
12}
13impl DeleteResourcePolicyInput {
14    /// <p>The name of the policy to be revoked. This parameter is required.</p>
15    pub fn policy_name(&self) -> ::std::option::Option<&str> {
16        self.policy_name.as_deref()
17    }
18    /// <p>The ARN of the CloudWatch Logs resource for which the resource policy needs to be deleted</p>
19    pub fn resource_arn(&self) -> ::std::option::Option<&str> {
20        self.resource_arn.as_deref()
21    }
22    /// <p>The expected revision ID of the resource policy. Required when deleting a resource-scoped policy to prevent concurrent modifications.</p>
23    pub fn expected_revision_id(&self) -> ::std::option::Option<&str> {
24        self.expected_revision_id.as_deref()
25    }
26}
27impl DeleteResourcePolicyInput {
28    /// Creates a new builder-style object to manufacture [`DeleteResourcePolicyInput`](crate::operation::delete_resource_policy::DeleteResourcePolicyInput).
29    pub fn builder() -> crate::operation::delete_resource_policy::builders::DeleteResourcePolicyInputBuilder {
30        crate::operation::delete_resource_policy::builders::DeleteResourcePolicyInputBuilder::default()
31    }
32}
33
34/// A builder for [`DeleteResourcePolicyInput`](crate::operation::delete_resource_policy::DeleteResourcePolicyInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct DeleteResourcePolicyInputBuilder {
38    pub(crate) policy_name: ::std::option::Option<::std::string::String>,
39    pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
40    pub(crate) expected_revision_id: ::std::option::Option<::std::string::String>,
41}
42impl DeleteResourcePolicyInputBuilder {
43    /// <p>The name of the policy to be revoked. This parameter is required.</p>
44    pub fn policy_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
45        self.policy_name = ::std::option::Option::Some(input.into());
46        self
47    }
48    /// <p>The name of the policy to be revoked. This parameter is required.</p>
49    pub fn set_policy_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
50        self.policy_name = input;
51        self
52    }
53    /// <p>The name of the policy to be revoked. This parameter is required.</p>
54    pub fn get_policy_name(&self) -> &::std::option::Option<::std::string::String> {
55        &self.policy_name
56    }
57    /// <p>The ARN of the CloudWatch Logs resource for which the resource policy needs to be deleted</p>
58    pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59        self.resource_arn = ::std::option::Option::Some(input.into());
60        self
61    }
62    /// <p>The ARN of the CloudWatch Logs resource for which the resource policy needs to be deleted</p>
63    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
64        self.resource_arn = input;
65        self
66    }
67    /// <p>The ARN of the CloudWatch Logs resource for which the resource policy needs to be deleted</p>
68    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
69        &self.resource_arn
70    }
71    /// <p>The expected revision ID of the resource policy. Required when deleting a resource-scoped policy to prevent concurrent modifications.</p>
72    pub fn expected_revision_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
73        self.expected_revision_id = ::std::option::Option::Some(input.into());
74        self
75    }
76    /// <p>The expected revision ID of the resource policy. Required when deleting a resource-scoped policy to prevent concurrent modifications.</p>
77    pub fn set_expected_revision_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
78        self.expected_revision_id = input;
79        self
80    }
81    /// <p>The expected revision ID of the resource policy. Required when deleting a resource-scoped policy to prevent concurrent modifications.</p>
82    pub fn get_expected_revision_id(&self) -> &::std::option::Option<::std::string::String> {
83        &self.expected_revision_id
84    }
85    /// Consumes the builder and constructs a [`DeleteResourcePolicyInput`](crate::operation::delete_resource_policy::DeleteResourcePolicyInput).
86    pub fn build(
87        self,
88    ) -> ::std::result::Result<crate::operation::delete_resource_policy::DeleteResourcePolicyInput, ::aws_smithy_types::error::operation::BuildError>
89    {
90        ::std::result::Result::Ok(crate::operation::delete_resource_policy::DeleteResourcePolicyInput {
91            policy_name: self.policy_name,
92            resource_arn: self.resource_arn,
93            expected_revision_id: self.expected_revision_id,
94        })
95    }
96}