Skip to main content

aws_sdk_redshiftserverless/operation/delete_namespace/
_delete_namespace_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 DeleteNamespaceInput {
6    /// <p>The name of the namespace to delete.</p>
7    pub namespace_name: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the snapshot to be created before the namespace is deleted.</p>
9    pub final_snapshot_name: ::std::option::Option<::std::string::String>,
10    /// <p>How long to retain the final snapshot.</p>
11    pub final_snapshot_retention_period: ::std::option::Option<i32>,
12}
13impl DeleteNamespaceInput {
14    /// <p>The name of the namespace to delete.</p>
15    pub fn namespace_name(&self) -> ::std::option::Option<&str> {
16        self.namespace_name.as_deref()
17    }
18    /// <p>The name of the snapshot to be created before the namespace is deleted.</p>
19    pub fn final_snapshot_name(&self) -> ::std::option::Option<&str> {
20        self.final_snapshot_name.as_deref()
21    }
22    /// <p>How long to retain the final snapshot.</p>
23    pub fn final_snapshot_retention_period(&self) -> ::std::option::Option<i32> {
24        self.final_snapshot_retention_period
25    }
26}
27impl DeleteNamespaceInput {
28    /// Creates a new builder-style object to manufacture [`DeleteNamespaceInput`](crate::operation::delete_namespace::DeleteNamespaceInput).
29    pub fn builder() -> crate::operation::delete_namespace::builders::DeleteNamespaceInputBuilder {
30        crate::operation::delete_namespace::builders::DeleteNamespaceInputBuilder::default()
31    }
32}
33
34/// A builder for [`DeleteNamespaceInput`](crate::operation::delete_namespace::DeleteNamespaceInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct DeleteNamespaceInputBuilder {
38    pub(crate) namespace_name: ::std::option::Option<::std::string::String>,
39    pub(crate) final_snapshot_name: ::std::option::Option<::std::string::String>,
40    pub(crate) final_snapshot_retention_period: ::std::option::Option<i32>,
41}
42impl DeleteNamespaceInputBuilder {
43    /// <p>The name of the namespace to delete.</p>
44    /// This field is required.
45    pub fn namespace_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46        self.namespace_name = ::std::option::Option::Some(input.into());
47        self
48    }
49    /// <p>The name of the namespace to delete.</p>
50    pub fn set_namespace_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51        self.namespace_name = input;
52        self
53    }
54    /// <p>The name of the namespace to delete.</p>
55    pub fn get_namespace_name(&self) -> &::std::option::Option<::std::string::String> {
56        &self.namespace_name
57    }
58    /// <p>The name of the snapshot to be created before the namespace is deleted.</p>
59    pub fn final_snapshot_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.final_snapshot_name = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>The name of the snapshot to be created before the namespace is deleted.</p>
64    pub fn set_final_snapshot_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.final_snapshot_name = input;
66        self
67    }
68    /// <p>The name of the snapshot to be created before the namespace is deleted.</p>
69    pub fn get_final_snapshot_name(&self) -> &::std::option::Option<::std::string::String> {
70        &self.final_snapshot_name
71    }
72    /// <p>How long to retain the final snapshot.</p>
73    pub fn final_snapshot_retention_period(mut self, input: i32) -> Self {
74        self.final_snapshot_retention_period = ::std::option::Option::Some(input);
75        self
76    }
77    /// <p>How long to retain the final snapshot.</p>
78    pub fn set_final_snapshot_retention_period(mut self, input: ::std::option::Option<i32>) -> Self {
79        self.final_snapshot_retention_period = input;
80        self
81    }
82    /// <p>How long to retain the final snapshot.</p>
83    pub fn get_final_snapshot_retention_period(&self) -> &::std::option::Option<i32> {
84        &self.final_snapshot_retention_period
85    }
86    /// Consumes the builder and constructs a [`DeleteNamespaceInput`](crate::operation::delete_namespace::DeleteNamespaceInput).
87    pub fn build(
88        self,
89    ) -> ::std::result::Result<crate::operation::delete_namespace::DeleteNamespaceInput, ::aws_smithy_types::error::operation::BuildError> {
90        ::std::result::Result::Ok(crate::operation::delete_namespace::DeleteNamespaceInput {
91            namespace_name: self.namespace_name,
92            final_snapshot_name: self.final_snapshot_name,
93            final_snapshot_retention_period: self.final_snapshot_retention_period,
94        })
95    }
96}