aws_sdk_rbin/operation/lock_rule/
_lock_rule_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 LockRuleInput {
6    /// <p>The unique ID of the retention rule.</p>
7    pub identifier: ::std::option::Option<::std::string::String>,
8    /// <p>Information about the retention rule lock configuration.</p>
9    pub lock_configuration: ::std::option::Option<crate::types::LockConfiguration>,
10}
11impl LockRuleInput {
12    /// <p>The unique ID of the retention rule.</p>
13    pub fn identifier(&self) -> ::std::option::Option<&str> {
14        self.identifier.as_deref()
15    }
16    /// <p>Information about the retention rule lock configuration.</p>
17    pub fn lock_configuration(&self) -> ::std::option::Option<&crate::types::LockConfiguration> {
18        self.lock_configuration.as_ref()
19    }
20}
21impl LockRuleInput {
22    /// Creates a new builder-style object to manufacture [`LockRuleInput`](crate::operation::lock_rule::LockRuleInput).
23    pub fn builder() -> crate::operation::lock_rule::builders::LockRuleInputBuilder {
24        crate::operation::lock_rule::builders::LockRuleInputBuilder::default()
25    }
26}
27
28/// A builder for [`LockRuleInput`](crate::operation::lock_rule::LockRuleInput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct LockRuleInputBuilder {
32    pub(crate) identifier: ::std::option::Option<::std::string::String>,
33    pub(crate) lock_configuration: ::std::option::Option<crate::types::LockConfiguration>,
34}
35impl LockRuleInputBuilder {
36    /// <p>The unique ID of the retention rule.</p>
37    /// This field is required.
38    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39        self.identifier = ::std::option::Option::Some(input.into());
40        self
41    }
42    /// <p>The unique ID of the retention rule.</p>
43    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44        self.identifier = input;
45        self
46    }
47    /// <p>The unique ID of the retention rule.</p>
48    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
49        &self.identifier
50    }
51    /// <p>Information about the retention rule lock configuration.</p>
52    /// This field is required.
53    pub fn lock_configuration(mut self, input: crate::types::LockConfiguration) -> Self {
54        self.lock_configuration = ::std::option::Option::Some(input);
55        self
56    }
57    /// <p>Information about the retention rule lock configuration.</p>
58    pub fn set_lock_configuration(mut self, input: ::std::option::Option<crate::types::LockConfiguration>) -> Self {
59        self.lock_configuration = input;
60        self
61    }
62    /// <p>Information about the retention rule lock configuration.</p>
63    pub fn get_lock_configuration(&self) -> &::std::option::Option<crate::types::LockConfiguration> {
64        &self.lock_configuration
65    }
66    /// Consumes the builder and constructs a [`LockRuleInput`](crate::operation::lock_rule::LockRuleInput).
67    pub fn build(self) -> ::std::result::Result<crate::operation::lock_rule::LockRuleInput, ::aws_smithy_types::error::operation::BuildError> {
68        ::std::result::Result::Ok(crate::operation::lock_rule::LockRuleInput {
69            identifier: self.identifier,
70            lock_configuration: self.lock_configuration,
71        })
72    }
73}