aws_sdk_qldb/operation/update_ledger/
_update_ledger_output.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 UpdateLedgerOutput {
6    /// <p>The name of the ledger.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>The Amazon Resource Name (ARN) for the ledger.</p>
9    pub arn: ::std::option::Option<::std::string::String>,
10    /// <p>The current status of the ledger.</p>
11    pub state: ::std::option::Option<crate::types::LedgerState>,
12    /// <p>The date and time, in epoch time format, when the ledger was created. (Epoch time format is the number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)</p>
13    pub creation_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
14    /// <p>Specifies whether the ledger is protected from being deleted by any user. If not defined during ledger creation, this feature is enabled (<code>true</code>) by default.</p>
15    /// <p>If deletion protection is enabled, you must first disable it before you can delete the ledger. You can disable it by calling the <code>UpdateLedger</code> operation to set this parameter to <code>false</code>.</p>
16    pub deletion_protection: ::std::option::Option<bool>,
17    /// <p>Information about the encryption of data at rest in the ledger. This includes the current status, the KMS key, and when the key became inaccessible (in the case of an error).</p>
18    pub encryption_description: ::std::option::Option<crate::types::LedgerEncryptionDescription>,
19    _request_id: Option<String>,
20}
21impl UpdateLedgerOutput {
22    /// <p>The name of the ledger.</p>
23    pub fn name(&self) -> ::std::option::Option<&str> {
24        self.name.as_deref()
25    }
26    /// <p>The Amazon Resource Name (ARN) for the ledger.</p>
27    pub fn arn(&self) -> ::std::option::Option<&str> {
28        self.arn.as_deref()
29    }
30    /// <p>The current status of the ledger.</p>
31    pub fn state(&self) -> ::std::option::Option<&crate::types::LedgerState> {
32        self.state.as_ref()
33    }
34    /// <p>The date and time, in epoch time format, when the ledger was created. (Epoch time format is the number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)</p>
35    pub fn creation_date_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
36        self.creation_date_time.as_ref()
37    }
38    /// <p>Specifies whether the ledger is protected from being deleted by any user. If not defined during ledger creation, this feature is enabled (<code>true</code>) by default.</p>
39    /// <p>If deletion protection is enabled, you must first disable it before you can delete the ledger. You can disable it by calling the <code>UpdateLedger</code> operation to set this parameter to <code>false</code>.</p>
40    pub fn deletion_protection(&self) -> ::std::option::Option<bool> {
41        self.deletion_protection
42    }
43    /// <p>Information about the encryption of data at rest in the ledger. This includes the current status, the KMS key, and when the key became inaccessible (in the case of an error).</p>
44    pub fn encryption_description(&self) -> ::std::option::Option<&crate::types::LedgerEncryptionDescription> {
45        self.encryption_description.as_ref()
46    }
47}
48impl ::aws_types::request_id::RequestId for UpdateLedgerOutput {
49    fn request_id(&self) -> Option<&str> {
50        self._request_id.as_deref()
51    }
52}
53impl UpdateLedgerOutput {
54    /// Creates a new builder-style object to manufacture [`UpdateLedgerOutput`](crate::operation::update_ledger::UpdateLedgerOutput).
55    pub fn builder() -> crate::operation::update_ledger::builders::UpdateLedgerOutputBuilder {
56        crate::operation::update_ledger::builders::UpdateLedgerOutputBuilder::default()
57    }
58}
59
60/// A builder for [`UpdateLedgerOutput`](crate::operation::update_ledger::UpdateLedgerOutput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct UpdateLedgerOutputBuilder {
64    pub(crate) name: ::std::option::Option<::std::string::String>,
65    pub(crate) arn: ::std::option::Option<::std::string::String>,
66    pub(crate) state: ::std::option::Option<crate::types::LedgerState>,
67    pub(crate) creation_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
68    pub(crate) deletion_protection: ::std::option::Option<bool>,
69    pub(crate) encryption_description: ::std::option::Option<crate::types::LedgerEncryptionDescription>,
70    _request_id: Option<String>,
71}
72impl UpdateLedgerOutputBuilder {
73    /// <p>The name of the ledger.</p>
74    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.name = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>The name of the ledger.</p>
79    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.name = input;
81        self
82    }
83    /// <p>The name of the ledger.</p>
84    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
85        &self.name
86    }
87    /// <p>The Amazon Resource Name (ARN) for the ledger.</p>
88    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.arn = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>The Amazon Resource Name (ARN) for the ledger.</p>
93    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.arn = input;
95        self
96    }
97    /// <p>The Amazon Resource Name (ARN) for the ledger.</p>
98    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
99        &self.arn
100    }
101    /// <p>The current status of the ledger.</p>
102    pub fn state(mut self, input: crate::types::LedgerState) -> Self {
103        self.state = ::std::option::Option::Some(input);
104        self
105    }
106    /// <p>The current status of the ledger.</p>
107    pub fn set_state(mut self, input: ::std::option::Option<crate::types::LedgerState>) -> Self {
108        self.state = input;
109        self
110    }
111    /// <p>The current status of the ledger.</p>
112    pub fn get_state(&self) -> &::std::option::Option<crate::types::LedgerState> {
113        &self.state
114    }
115    /// <p>The date and time, in epoch time format, when the ledger was created. (Epoch time format is the number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)</p>
116    pub fn creation_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
117        self.creation_date_time = ::std::option::Option::Some(input);
118        self
119    }
120    /// <p>The date and time, in epoch time format, when the ledger was created. (Epoch time format is the number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)</p>
121    pub fn set_creation_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
122        self.creation_date_time = input;
123        self
124    }
125    /// <p>The date and time, in epoch time format, when the ledger was created. (Epoch time format is the number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)</p>
126    pub fn get_creation_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
127        &self.creation_date_time
128    }
129    /// <p>Specifies whether the ledger is protected from being deleted by any user. If not defined during ledger creation, this feature is enabled (<code>true</code>) by default.</p>
130    /// <p>If deletion protection is enabled, you must first disable it before you can delete the ledger. You can disable it by calling the <code>UpdateLedger</code> operation to set this parameter to <code>false</code>.</p>
131    pub fn deletion_protection(mut self, input: bool) -> Self {
132        self.deletion_protection = ::std::option::Option::Some(input);
133        self
134    }
135    /// <p>Specifies whether the ledger is protected from being deleted by any user. If not defined during ledger creation, this feature is enabled (<code>true</code>) by default.</p>
136    /// <p>If deletion protection is enabled, you must first disable it before you can delete the ledger. You can disable it by calling the <code>UpdateLedger</code> operation to set this parameter to <code>false</code>.</p>
137    pub fn set_deletion_protection(mut self, input: ::std::option::Option<bool>) -> Self {
138        self.deletion_protection = input;
139        self
140    }
141    /// <p>Specifies whether the ledger is protected from being deleted by any user. If not defined during ledger creation, this feature is enabled (<code>true</code>) by default.</p>
142    /// <p>If deletion protection is enabled, you must first disable it before you can delete the ledger. You can disable it by calling the <code>UpdateLedger</code> operation to set this parameter to <code>false</code>.</p>
143    pub fn get_deletion_protection(&self) -> &::std::option::Option<bool> {
144        &self.deletion_protection
145    }
146    /// <p>Information about the encryption of data at rest in the ledger. This includes the current status, the KMS key, and when the key became inaccessible (in the case of an error).</p>
147    pub fn encryption_description(mut self, input: crate::types::LedgerEncryptionDescription) -> Self {
148        self.encryption_description = ::std::option::Option::Some(input);
149        self
150    }
151    /// <p>Information about the encryption of data at rest in the ledger. This includes the current status, the KMS key, and when the key became inaccessible (in the case of an error).</p>
152    pub fn set_encryption_description(mut self, input: ::std::option::Option<crate::types::LedgerEncryptionDescription>) -> Self {
153        self.encryption_description = input;
154        self
155    }
156    /// <p>Information about the encryption of data at rest in the ledger. This includes the current status, the KMS key, and when the key became inaccessible (in the case of an error).</p>
157    pub fn get_encryption_description(&self) -> &::std::option::Option<crate::types::LedgerEncryptionDescription> {
158        &self.encryption_description
159    }
160    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
161        self._request_id = Some(request_id.into());
162        self
163    }
164
165    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
166        self._request_id = request_id;
167        self
168    }
169    /// Consumes the builder and constructs a [`UpdateLedgerOutput`](crate::operation::update_ledger::UpdateLedgerOutput).
170    pub fn build(self) -> crate::operation::update_ledger::UpdateLedgerOutput {
171        crate::operation::update_ledger::UpdateLedgerOutput {
172            name: self.name,
173            arn: self.arn,
174            state: self.state,
175            creation_date_time: self.creation_date_time,
176            deletion_protection: self.deletion_protection,
177            encryption_description: self.encryption_description,
178            _request_id: self._request_id,
179        }
180    }
181}