aws_sdk_paymentcryptography/operation/delete_key/
_delete_key_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 DeleteKeyInput {
6    /// <p>The <code>KeyARN</code> of the key that is scheduled for deletion.</p>
7    pub key_identifier: ::std::option::Option<::std::string::String>,
8    /// <p>The waiting period for key deletion. The default value is seven days.</p>
9    pub delete_key_in_days: ::std::option::Option<i32>,
10}
11impl DeleteKeyInput {
12    /// <p>The <code>KeyARN</code> of the key that is scheduled for deletion.</p>
13    pub fn key_identifier(&self) -> ::std::option::Option<&str> {
14        self.key_identifier.as_deref()
15    }
16    /// <p>The waiting period for key deletion. The default value is seven days.</p>
17    pub fn delete_key_in_days(&self) -> ::std::option::Option<i32> {
18        self.delete_key_in_days
19    }
20}
21impl DeleteKeyInput {
22    /// Creates a new builder-style object to manufacture [`DeleteKeyInput`](crate::operation::delete_key::DeleteKeyInput).
23    pub fn builder() -> crate::operation::delete_key::builders::DeleteKeyInputBuilder {
24        crate::operation::delete_key::builders::DeleteKeyInputBuilder::default()
25    }
26}
27
28/// A builder for [`DeleteKeyInput`](crate::operation::delete_key::DeleteKeyInput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct DeleteKeyInputBuilder {
32    pub(crate) key_identifier: ::std::option::Option<::std::string::String>,
33    pub(crate) delete_key_in_days: ::std::option::Option<i32>,
34}
35impl DeleteKeyInputBuilder {
36    /// <p>The <code>KeyARN</code> of the key that is scheduled for deletion.</p>
37    /// This field is required.
38    pub fn key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39        self.key_identifier = ::std::option::Option::Some(input.into());
40        self
41    }
42    /// <p>The <code>KeyARN</code> of the key that is scheduled for deletion.</p>
43    pub fn set_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44        self.key_identifier = input;
45        self
46    }
47    /// <p>The <code>KeyARN</code> of the key that is scheduled for deletion.</p>
48    pub fn get_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
49        &self.key_identifier
50    }
51    /// <p>The waiting period for key deletion. The default value is seven days.</p>
52    pub fn delete_key_in_days(mut self, input: i32) -> Self {
53        self.delete_key_in_days = ::std::option::Option::Some(input);
54        self
55    }
56    /// <p>The waiting period for key deletion. The default value is seven days.</p>
57    pub fn set_delete_key_in_days(mut self, input: ::std::option::Option<i32>) -> Self {
58        self.delete_key_in_days = input;
59        self
60    }
61    /// <p>The waiting period for key deletion. The default value is seven days.</p>
62    pub fn get_delete_key_in_days(&self) -> &::std::option::Option<i32> {
63        &self.delete_key_in_days
64    }
65    /// Consumes the builder and constructs a [`DeleteKeyInput`](crate::operation::delete_key::DeleteKeyInput).
66    pub fn build(self) -> ::std::result::Result<crate::operation::delete_key::DeleteKeyInput, ::aws_smithy_types::error::operation::BuildError> {
67        ::std::result::Result::Ok(crate::operation::delete_key::DeleteKeyInput {
68            key_identifier: self.key_identifier,
69            delete_key_in_days: self.delete_key_in_days,
70        })
71    }
72}