aws_sdk_qldb/operation/create_ledger/
_create_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 CreateLedgerOutput {
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>The permissions mode of the ledger that you created.</p>
15    pub permissions_mode: ::std::option::Option<crate::types::PermissionsMode>,
16    /// <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>
17    /// <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>
18    pub deletion_protection: ::std::option::Option<bool>,
19    /// <p>The ARN of the customer managed KMS key that the ledger uses for encryption at rest. If this parameter is undefined, the ledger uses an Amazon Web Services owned KMS key for encryption.</p>
20    pub kms_key_arn: ::std::option::Option<::std::string::String>,
21    _request_id: Option<String>,
22}
23impl CreateLedgerOutput {
24    /// <p>The name of the ledger.</p>
25    pub fn name(&self) -> ::std::option::Option<&str> {
26        self.name.as_deref()
27    }
28    /// <p>The Amazon Resource Name (ARN) for the ledger.</p>
29    pub fn arn(&self) -> ::std::option::Option<&str> {
30        self.arn.as_deref()
31    }
32    /// <p>The current status of the ledger.</p>
33    pub fn state(&self) -> ::std::option::Option<&crate::types::LedgerState> {
34        self.state.as_ref()
35    }
36    /// <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>
37    pub fn creation_date_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
38        self.creation_date_time.as_ref()
39    }
40    /// <p>The permissions mode of the ledger that you created.</p>
41    pub fn permissions_mode(&self) -> ::std::option::Option<&crate::types::PermissionsMode> {
42        self.permissions_mode.as_ref()
43    }
44    /// <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>
45    /// <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>
46    pub fn deletion_protection(&self) -> ::std::option::Option<bool> {
47        self.deletion_protection
48    }
49    /// <p>The ARN of the customer managed KMS key that the ledger uses for encryption at rest. If this parameter is undefined, the ledger uses an Amazon Web Services owned KMS key for encryption.</p>
50    pub fn kms_key_arn(&self) -> ::std::option::Option<&str> {
51        self.kms_key_arn.as_deref()
52    }
53}
54impl ::aws_types::request_id::RequestId for CreateLedgerOutput {
55    fn request_id(&self) -> Option<&str> {
56        self._request_id.as_deref()
57    }
58}
59impl CreateLedgerOutput {
60    /// Creates a new builder-style object to manufacture [`CreateLedgerOutput`](crate::operation::create_ledger::CreateLedgerOutput).
61    pub fn builder() -> crate::operation::create_ledger::builders::CreateLedgerOutputBuilder {
62        crate::operation::create_ledger::builders::CreateLedgerOutputBuilder::default()
63    }
64}
65
66/// A builder for [`CreateLedgerOutput`](crate::operation::create_ledger::CreateLedgerOutput).
67#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
68#[non_exhaustive]
69pub struct CreateLedgerOutputBuilder {
70    pub(crate) name: ::std::option::Option<::std::string::String>,
71    pub(crate) arn: ::std::option::Option<::std::string::String>,
72    pub(crate) state: ::std::option::Option<crate::types::LedgerState>,
73    pub(crate) creation_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
74    pub(crate) permissions_mode: ::std::option::Option<crate::types::PermissionsMode>,
75    pub(crate) deletion_protection: ::std::option::Option<bool>,
76    pub(crate) kms_key_arn: ::std::option::Option<::std::string::String>,
77    _request_id: Option<String>,
78}
79impl CreateLedgerOutputBuilder {
80    /// <p>The name of the ledger.</p>
81    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82        self.name = ::std::option::Option::Some(input.into());
83        self
84    }
85    /// <p>The name of the ledger.</p>
86    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.name = input;
88        self
89    }
90    /// <p>The name of the ledger.</p>
91    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
92        &self.name
93    }
94    /// <p>The Amazon Resource Name (ARN) for the ledger.</p>
95    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96        self.arn = ::std::option::Option::Some(input.into());
97        self
98    }
99    /// <p>The Amazon Resource Name (ARN) for the ledger.</p>
100    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101        self.arn = input;
102        self
103    }
104    /// <p>The Amazon Resource Name (ARN) for the ledger.</p>
105    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
106        &self.arn
107    }
108    /// <p>The current status of the ledger.</p>
109    pub fn state(mut self, input: crate::types::LedgerState) -> Self {
110        self.state = ::std::option::Option::Some(input);
111        self
112    }
113    /// <p>The current status of the ledger.</p>
114    pub fn set_state(mut self, input: ::std::option::Option<crate::types::LedgerState>) -> Self {
115        self.state = input;
116        self
117    }
118    /// <p>The current status of the ledger.</p>
119    pub fn get_state(&self) -> &::std::option::Option<crate::types::LedgerState> {
120        &self.state
121    }
122    /// <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>
123    pub fn creation_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
124        self.creation_date_time = ::std::option::Option::Some(input);
125        self
126    }
127    /// <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>
128    pub fn set_creation_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
129        self.creation_date_time = input;
130        self
131    }
132    /// <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>
133    pub fn get_creation_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
134        &self.creation_date_time
135    }
136    /// <p>The permissions mode of the ledger that you created.</p>
137    pub fn permissions_mode(mut self, input: crate::types::PermissionsMode) -> Self {
138        self.permissions_mode = ::std::option::Option::Some(input);
139        self
140    }
141    /// <p>The permissions mode of the ledger that you created.</p>
142    pub fn set_permissions_mode(mut self, input: ::std::option::Option<crate::types::PermissionsMode>) -> Self {
143        self.permissions_mode = input;
144        self
145    }
146    /// <p>The permissions mode of the ledger that you created.</p>
147    pub fn get_permissions_mode(&self) -> &::std::option::Option<crate::types::PermissionsMode> {
148        &self.permissions_mode
149    }
150    /// <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>
151    /// <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>
152    pub fn deletion_protection(mut self, input: bool) -> Self {
153        self.deletion_protection = ::std::option::Option::Some(input);
154        self
155    }
156    /// <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>
157    /// <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>
158    pub fn set_deletion_protection(mut self, input: ::std::option::Option<bool>) -> Self {
159        self.deletion_protection = input;
160        self
161    }
162    /// <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>
163    /// <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>
164    pub fn get_deletion_protection(&self) -> &::std::option::Option<bool> {
165        &self.deletion_protection
166    }
167    /// <p>The ARN of the customer managed KMS key that the ledger uses for encryption at rest. If this parameter is undefined, the ledger uses an Amazon Web Services owned KMS key for encryption.</p>
168    pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169        self.kms_key_arn = ::std::option::Option::Some(input.into());
170        self
171    }
172    /// <p>The ARN of the customer managed KMS key that the ledger uses for encryption at rest. If this parameter is undefined, the ledger uses an Amazon Web Services owned KMS key for encryption.</p>
173    pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174        self.kms_key_arn = input;
175        self
176    }
177    /// <p>The ARN of the customer managed KMS key that the ledger uses for encryption at rest. If this parameter is undefined, the ledger uses an Amazon Web Services owned KMS key for encryption.</p>
178    pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
179        &self.kms_key_arn
180    }
181    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
182        self._request_id = Some(request_id.into());
183        self
184    }
185
186    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
187        self._request_id = request_id;
188        self
189    }
190    /// Consumes the builder and constructs a [`CreateLedgerOutput`](crate::operation::create_ledger::CreateLedgerOutput).
191    pub fn build(self) -> crate::operation::create_ledger::CreateLedgerOutput {
192        crate::operation::create_ledger::CreateLedgerOutput {
193            name: self.name,
194            arn: self.arn,
195            state: self.state,
196            creation_date_time: self.creation_date_time,
197            permissions_mode: self.permissions_mode,
198            deletion_protection: self.deletion_protection,
199            kms_key_arn: self.kms_key_arn,
200            _request_id: self._request_id,
201        }
202    }
203}