Skip to main content

aws_sdk_location/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 name of the API key to delete.</p>
7    pub key_name: ::std::option::Option<::std::string::String>,
8    /// <p>ForceDelete bypasses an API key's expiry conditions and deletes the key. Set the parameter <code>true</code> to delete the key or to <code>false</code> to not preemptively delete the API key.</p>
9    /// <p>Valid values: <code>true</code>, or <code>false</code>.</p>
10    /// <p>Required: No</p><note>
11    /// <p>This action is irreversible. Only use ForceDelete if you are certain the key is no longer in use.</p>
12    /// </note>
13    pub force_delete: ::std::option::Option<bool>,
14}
15impl DeleteKeyInput {
16    /// <p>The name of the API key to delete.</p>
17    pub fn key_name(&self) -> ::std::option::Option<&str> {
18        self.key_name.as_deref()
19    }
20    /// <p>ForceDelete bypasses an API key's expiry conditions and deletes the key. Set the parameter <code>true</code> to delete the key or to <code>false</code> to not preemptively delete the API key.</p>
21    /// <p>Valid values: <code>true</code>, or <code>false</code>.</p>
22    /// <p>Required: No</p><note>
23    /// <p>This action is irreversible. Only use ForceDelete if you are certain the key is no longer in use.</p>
24    /// </note>
25    pub fn force_delete(&self) -> ::std::option::Option<bool> {
26        self.force_delete
27    }
28}
29impl DeleteKeyInput {
30    /// Creates a new builder-style object to manufacture [`DeleteKeyInput`](crate::operation::delete_key::DeleteKeyInput).
31    pub fn builder() -> crate::operation::delete_key::builders::DeleteKeyInputBuilder {
32        crate::operation::delete_key::builders::DeleteKeyInputBuilder::default()
33    }
34}
35
36/// A builder for [`DeleteKeyInput`](crate::operation::delete_key::DeleteKeyInput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct DeleteKeyInputBuilder {
40    pub(crate) key_name: ::std::option::Option<::std::string::String>,
41    pub(crate) force_delete: ::std::option::Option<bool>,
42}
43impl DeleteKeyInputBuilder {
44    /// <p>The name of the API key to delete.</p>
45    /// This field is required.
46    pub fn key_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.key_name = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// <p>The name of the API key to delete.</p>
51    pub fn set_key_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.key_name = input;
53        self
54    }
55    /// <p>The name of the API key to delete.</p>
56    pub fn get_key_name(&self) -> &::std::option::Option<::std::string::String> {
57        &self.key_name
58    }
59    /// <p>ForceDelete bypasses an API key's expiry conditions and deletes the key. Set the parameter <code>true</code> to delete the key or to <code>false</code> to not preemptively delete the API key.</p>
60    /// <p>Valid values: <code>true</code>, or <code>false</code>.</p>
61    /// <p>Required: No</p><note>
62    /// <p>This action is irreversible. Only use ForceDelete if you are certain the key is no longer in use.</p>
63    /// </note>
64    pub fn force_delete(mut self, input: bool) -> Self {
65        self.force_delete = ::std::option::Option::Some(input);
66        self
67    }
68    /// <p>ForceDelete bypasses an API key's expiry conditions and deletes the key. Set the parameter <code>true</code> to delete the key or to <code>false</code> to not preemptively delete the API key.</p>
69    /// <p>Valid values: <code>true</code>, or <code>false</code>.</p>
70    /// <p>Required: No</p><note>
71    /// <p>This action is irreversible. Only use ForceDelete if you are certain the key is no longer in use.</p>
72    /// </note>
73    pub fn set_force_delete(mut self, input: ::std::option::Option<bool>) -> Self {
74        self.force_delete = input;
75        self
76    }
77    /// <p>ForceDelete bypasses an API key's expiry conditions and deletes the key. Set the parameter <code>true</code> to delete the key or to <code>false</code> to not preemptively delete the API key.</p>
78    /// <p>Valid values: <code>true</code>, or <code>false</code>.</p>
79    /// <p>Required: No</p><note>
80    /// <p>This action is irreversible. Only use ForceDelete if you are certain the key is no longer in use.</p>
81    /// </note>
82    pub fn get_force_delete(&self) -> &::std::option::Option<bool> {
83        &self.force_delete
84    }
85    /// Consumes the builder and constructs a [`DeleteKeyInput`](crate::operation::delete_key::DeleteKeyInput).
86    pub fn build(self) -> ::std::result::Result<crate::operation::delete_key::DeleteKeyInput, ::aws_smithy_types::error::operation::BuildError> {
87        ::std::result::Result::Ok(crate::operation::delete_key::DeleteKeyInput {
88            key_name: self.key_name,
89            force_delete: self.force_delete,
90        })
91    }
92}