aws_sdk_iot/operation/delete_policy/
_delete_policy_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The input for the DeletePolicy operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DeletePolicyInput {
7    /// <p>The name of the policy to delete.</p>
8    pub policy_name: ::std::option::Option<::std::string::String>,
9}
10impl DeletePolicyInput {
11    /// <p>The name of the policy to delete.</p>
12    pub fn policy_name(&self) -> ::std::option::Option<&str> {
13        self.policy_name.as_deref()
14    }
15}
16impl DeletePolicyInput {
17    /// Creates a new builder-style object to manufacture [`DeletePolicyInput`](crate::operation::delete_policy::DeletePolicyInput).
18    pub fn builder() -> crate::operation::delete_policy::builders::DeletePolicyInputBuilder {
19        crate::operation::delete_policy::builders::DeletePolicyInputBuilder::default()
20    }
21}
22
23/// A builder for [`DeletePolicyInput`](crate::operation::delete_policy::DeletePolicyInput).
24#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
25#[non_exhaustive]
26pub struct DeletePolicyInputBuilder {
27    pub(crate) policy_name: ::std::option::Option<::std::string::String>,
28}
29impl DeletePolicyInputBuilder {
30    /// <p>The name of the policy to delete.</p>
31    /// This field is required.
32    pub fn policy_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
33        self.policy_name = ::std::option::Option::Some(input.into());
34        self
35    }
36    /// <p>The name of the policy to delete.</p>
37    pub fn set_policy_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
38        self.policy_name = input;
39        self
40    }
41    /// <p>The name of the policy to delete.</p>
42    pub fn get_policy_name(&self) -> &::std::option::Option<::std::string::String> {
43        &self.policy_name
44    }
45    /// Consumes the builder and constructs a [`DeletePolicyInput`](crate::operation::delete_policy::DeletePolicyInput).
46    pub fn build(
47        self,
48    ) -> ::std::result::Result<crate::operation::delete_policy::DeletePolicyInput, ::aws_smithy_types::error::operation::BuildError> {
49        ::std::result::Result::Ok(crate::operation::delete_policy::DeletePolicyInput {
50            policy_name: self.policy_name,
51        })
52    }
53}