rusoto_qldb/
generated.rs

1// =================================================================
2//
3//                           * WARNING *
4//
5//                    This file is generated!
6//
7//  Changes made to this file will be overwritten. If changes are
8//  required to the generated code, the service_crategen project
9//  must be updated to generate the changes.
10//
11// =================================================================
12
13use std::error::Error;
14use std::fmt;
15
16use async_trait::async_trait;
17use rusoto_core::credential::ProvideAwsCredentials;
18use rusoto_core::region;
19use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
20use rusoto_core::{Client, RusotoError};
21
22use rusoto_core::param::{Params, ServiceParams};
23use rusoto_core::proto;
24use rusoto_core::signature::SignedRequest;
25#[allow(unused_imports)]
26use serde::{Deserialize, Serialize};
27use serde_json;
28#[derive(Clone, Debug, Default, PartialEq, Serialize)]
29#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
30pub struct CancelJournalKinesisStreamRequest {
31    /// <p>The name of the ledger.</p>
32    #[serde(rename = "LedgerName")]
33    pub ledger_name: String,
34    /// <p>The unique ID that QLDB assigns to each QLDB journal stream.</p>
35    #[serde(rename = "StreamId")]
36    pub stream_id: String,
37}
38
39#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
40#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
41pub struct CancelJournalKinesisStreamResponse {
42    /// <p>The unique ID that QLDB assigns to each QLDB journal stream.</p>
43    #[serde(rename = "StreamId")]
44    #[serde(skip_serializing_if = "Option::is_none")]
45    pub stream_id: Option<String>,
46}
47
48#[derive(Clone, Debug, Default, PartialEq, Serialize)]
49#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
50pub struct CreateLedgerRequest {
51    /// <p>The flag that prevents a ledger from being deleted by any user. If not provided on ledger creation, this feature is enabled (<code>true</code>) by default.</p> <p>If deletion protection is enabled, you must first disable it before you can delete the ledger using the QLDB API or the AWS Command Line Interface (AWS CLI). You can disable it by calling the <code>UpdateLedger</code> operation to set the flag to <code>false</code>. The QLDB console disables deletion protection for you when you use it to delete a ledger.</p>
52    #[serde(rename = "DeletionProtection")]
53    #[serde(skip_serializing_if = "Option::is_none")]
54    pub deletion_protection: Option<bool>,
55    /// <p>The name of the ledger that you want to create. The name must be unique among all of your ledgers in the current AWS Region.</p> <p>Naming constraints for ledger names are defined in <a href="https://docs.aws.amazon.com/qldb/latest/developerguide/limits.html#limits.naming">Quotas in Amazon QLDB</a> in the <i>Amazon QLDB Developer Guide</i>.</p>
56    #[serde(rename = "Name")]
57    pub name: String,
58    /// <p>The permissions mode to assign to the ledger that you want to create.</p>
59    #[serde(rename = "PermissionsMode")]
60    pub permissions_mode: String,
61    /// <p>The key-value pairs to add as tags to the ledger that you want to create. Tag keys are case sensitive. Tag values are case sensitive and can be null.</p>
62    #[serde(rename = "Tags")]
63    #[serde(skip_serializing_if = "Option::is_none")]
64    pub tags: Option<::std::collections::HashMap<String, String>>,
65}
66
67#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
68#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
69pub struct CreateLedgerResponse {
70    /// <p>The Amazon Resource Name (ARN) for the ledger.</p>
71    #[serde(rename = "Arn")]
72    #[serde(skip_serializing_if = "Option::is_none")]
73    pub arn: Option<String>,
74    /// <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>
75    #[serde(rename = "CreationDateTime")]
76    #[serde(skip_serializing_if = "Option::is_none")]
77    pub creation_date_time: Option<f64>,
78    /// <p>The flag that prevents a ledger from being deleted by any user. If not provided on ledger creation, this feature is enabled (<code>true</code>) by default.</p> <p>If deletion protection is enabled, you must first disable it before you can delete the ledger using the QLDB API or the AWS Command Line Interface (AWS CLI). You can disable it by calling the <code>UpdateLedger</code> operation to set the flag to <code>false</code>. The QLDB console disables deletion protection for you when you use it to delete a ledger.</p>
79    #[serde(rename = "DeletionProtection")]
80    #[serde(skip_serializing_if = "Option::is_none")]
81    pub deletion_protection: Option<bool>,
82    /// <p>The name of the ledger.</p>
83    #[serde(rename = "Name")]
84    #[serde(skip_serializing_if = "Option::is_none")]
85    pub name: Option<String>,
86    /// <p>The current status of the ledger.</p>
87    #[serde(rename = "State")]
88    #[serde(skip_serializing_if = "Option::is_none")]
89    pub state: Option<String>,
90}
91
92#[derive(Clone, Debug, Default, PartialEq, Serialize)]
93#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
94pub struct DeleteLedgerRequest {
95    /// <p>The name of the ledger that you want to delete.</p>
96    #[serde(rename = "Name")]
97    pub name: String,
98}
99
100#[derive(Clone, Debug, Default, PartialEq, Serialize)]
101#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
102pub struct DescribeJournalKinesisStreamRequest {
103    /// <p>The name of the ledger.</p>
104    #[serde(rename = "LedgerName")]
105    pub ledger_name: String,
106    /// <p>The unique ID that QLDB assigns to each QLDB journal stream.</p>
107    #[serde(rename = "StreamId")]
108    pub stream_id: String,
109}
110
111#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
112#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
113pub struct DescribeJournalKinesisStreamResponse {
114    /// <p>Information about the QLDB journal stream returned by a <code>DescribeJournalS3Export</code> request.</p>
115    #[serde(rename = "Stream")]
116    #[serde(skip_serializing_if = "Option::is_none")]
117    pub stream: Option<JournalKinesisStreamDescription>,
118}
119
120#[derive(Clone, Debug, Default, PartialEq, Serialize)]
121#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
122pub struct DescribeJournalS3ExportRequest {
123    /// <p>The unique ID of the journal export job that you want to describe.</p>
124    #[serde(rename = "ExportId")]
125    pub export_id: String,
126    /// <p>The name of the ledger.</p>
127    #[serde(rename = "Name")]
128    pub name: String,
129}
130
131#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
132#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
133pub struct DescribeJournalS3ExportResponse {
134    /// <p>Information about the journal export job returned by a <code>DescribeJournalS3Export</code> request.</p>
135    #[serde(rename = "ExportDescription")]
136    pub export_description: JournalS3ExportDescription,
137}
138
139#[derive(Clone, Debug, Default, PartialEq, Serialize)]
140#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
141pub struct DescribeLedgerRequest {
142    /// <p>The name of the ledger that you want to describe.</p>
143    #[serde(rename = "Name")]
144    pub name: String,
145}
146
147#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
148#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
149pub struct DescribeLedgerResponse {
150    /// <p>The Amazon Resource Name (ARN) for the ledger.</p>
151    #[serde(rename = "Arn")]
152    #[serde(skip_serializing_if = "Option::is_none")]
153    pub arn: Option<String>,
154    /// <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>
155    #[serde(rename = "CreationDateTime")]
156    #[serde(skip_serializing_if = "Option::is_none")]
157    pub creation_date_time: Option<f64>,
158    /// <p>The flag that prevents a ledger from being deleted by any user. If not provided on ledger creation, this feature is enabled (<code>true</code>) by default.</p> <p>If deletion protection is enabled, you must first disable it before you can delete the ledger using the QLDB API or the AWS Command Line Interface (AWS CLI). You can disable it by calling the <code>UpdateLedger</code> operation to set the flag to <code>false</code>. The QLDB console disables deletion protection for you when you use it to delete a ledger.</p>
159    #[serde(rename = "DeletionProtection")]
160    #[serde(skip_serializing_if = "Option::is_none")]
161    pub deletion_protection: Option<bool>,
162    /// <p>The name of the ledger.</p>
163    #[serde(rename = "Name")]
164    #[serde(skip_serializing_if = "Option::is_none")]
165    pub name: Option<String>,
166    /// <p>The current status of the ledger.</p>
167    #[serde(rename = "State")]
168    #[serde(skip_serializing_if = "Option::is_none")]
169    pub state: Option<String>,
170}
171
172#[derive(Clone, Debug, Default, PartialEq, Serialize)]
173#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
174pub struct ExportJournalToS3Request {
175    /// <p>The exclusive end date and time for the range of journal contents that you want to export.</p> <p>The <code>ExclusiveEndTime</code> must be in <code>ISO 8601</code> date and time format and in Universal Coordinated Time (UTC). For example: <code>2019-06-13T21:36:34Z</code> </p> <p>The <code>ExclusiveEndTime</code> must be less than or equal to the current UTC date and time.</p>
176    #[serde(rename = "ExclusiveEndTime")]
177    pub exclusive_end_time: f64,
178    /// <p>The inclusive start date and time for the range of journal contents that you want to export.</p> <p>The <code>InclusiveStartTime</code> must be in <code>ISO 8601</code> date and time format and in Universal Coordinated Time (UTC). For example: <code>2019-06-13T21:36:34Z</code> </p> <p>The <code>InclusiveStartTime</code> must be before <code>ExclusiveEndTime</code>.</p> <p>If you provide an <code>InclusiveStartTime</code> that is before the ledger's <code>CreationDateTime</code>, Amazon QLDB defaults it to the ledger's <code>CreationDateTime</code>.</p>
179    #[serde(rename = "InclusiveStartTime")]
180    pub inclusive_start_time: f64,
181    /// <p>The name of the ledger.</p>
182    #[serde(rename = "Name")]
183    pub name: String,
184    /// <p><p>The Amazon Resource Name (ARN) of the IAM role that grants QLDB permissions for a journal export job to do the following:</p> <ul> <li> <p>Write objects into your Amazon Simple Storage Service (Amazon S3) bucket.</p> </li> <li> <p>(Optional) Use your customer master key (CMK) in AWS Key Management Service (AWS KMS) for server-side encryption of your exported data.</p> </li> </ul></p>
185    #[serde(rename = "RoleArn")]
186    pub role_arn: String,
187    /// <p>The configuration settings of the Amazon S3 bucket destination for your export request.</p>
188    #[serde(rename = "S3ExportConfiguration")]
189    pub s3_export_configuration: S3ExportConfiguration,
190}
191
192#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
193#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
194pub struct ExportJournalToS3Response {
195    /// <p>The unique ID that QLDB assigns to each journal export job.</p> <p>To describe your export request and check the status of the job, you can use <code>ExportId</code> to call <code>DescribeJournalS3Export</code>.</p>
196    #[serde(rename = "ExportId")]
197    pub export_id: String,
198}
199
200#[derive(Clone, Debug, Default, PartialEq, Serialize)]
201#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
202pub struct GetBlockRequest {
203    /// <p>The location of the block that you want to request. An address is an Amazon Ion structure that has two fields: <code>strandId</code> and <code>sequenceNo</code>.</p> <p>For example: <code>{strandId:"BlFTjlSXze9BIh1KOszcE3",sequenceNo:14}</code> </p>
204    #[serde(rename = "BlockAddress")]
205    pub block_address: ValueHolder,
206    /// <p>The latest block location covered by the digest for which to request a proof. An address is an Amazon Ion structure that has two fields: <code>strandId</code> and <code>sequenceNo</code>.</p> <p>For example: <code>{strandId:"BlFTjlSXze9BIh1KOszcE3",sequenceNo:49}</code> </p>
207    #[serde(rename = "DigestTipAddress")]
208    #[serde(skip_serializing_if = "Option::is_none")]
209    pub digest_tip_address: Option<ValueHolder>,
210    /// <p>The name of the ledger.</p>
211    #[serde(rename = "Name")]
212    pub name: String,
213}
214
215#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
216#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
217pub struct GetBlockResponse {
218    /// <p>The block data object in Amazon Ion format.</p>
219    #[serde(rename = "Block")]
220    pub block: ValueHolder,
221    /// <p>The proof object in Amazon Ion format returned by a <code>GetBlock</code> request. A proof contains the list of hash values required to recalculate the specified digest using a Merkle tree, starting with the specified block.</p>
222    #[serde(rename = "Proof")]
223    #[serde(skip_serializing_if = "Option::is_none")]
224    pub proof: Option<ValueHolder>,
225}
226
227#[derive(Clone, Debug, Default, PartialEq, Serialize)]
228#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
229pub struct GetDigestRequest {
230    /// <p>The name of the ledger.</p>
231    #[serde(rename = "Name")]
232    pub name: String,
233}
234
235#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
236#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
237pub struct GetDigestResponse {
238    /// <p>The 256-bit hash value representing the digest returned by a <code>GetDigest</code> request.</p>
239    #[serde(rename = "Digest")]
240    #[serde(
241        deserialize_with = "::rusoto_core::serialization::SerdeBlob::deserialize_blob",
242        serialize_with = "::rusoto_core::serialization::SerdeBlob::serialize_blob",
243        default
244    )]
245    pub digest: bytes::Bytes,
246    /// <p>The latest block location covered by the digest that you requested. An address is an Amazon Ion structure that has two fields: <code>strandId</code> and <code>sequenceNo</code>.</p>
247    #[serde(rename = "DigestTipAddress")]
248    pub digest_tip_address: ValueHolder,
249}
250
251#[derive(Clone, Debug, Default, PartialEq, Serialize)]
252#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
253pub struct GetRevisionRequest {
254    /// <p>The block location of the document revision to be verified. An address is an Amazon Ion structure that has two fields: <code>strandId</code> and <code>sequenceNo</code>.</p> <p>For example: <code>{strandId:"BlFTjlSXze9BIh1KOszcE3",sequenceNo:14}</code> </p>
255    #[serde(rename = "BlockAddress")]
256    pub block_address: ValueHolder,
257    /// <p>The latest block location covered by the digest for which to request a proof. An address is an Amazon Ion structure that has two fields: <code>strandId</code> and <code>sequenceNo</code>.</p> <p>For example: <code>{strandId:"BlFTjlSXze9BIh1KOszcE3",sequenceNo:49}</code> </p>
258    #[serde(rename = "DigestTipAddress")]
259    #[serde(skip_serializing_if = "Option::is_none")]
260    pub digest_tip_address: Option<ValueHolder>,
261    /// <p>The unique ID of the document to be verified.</p>
262    #[serde(rename = "DocumentId")]
263    pub document_id: String,
264    /// <p>The name of the ledger.</p>
265    #[serde(rename = "Name")]
266    pub name: String,
267}
268
269#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
270#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
271pub struct GetRevisionResponse {
272    /// <p>The proof object in Amazon Ion format returned by a <code>GetRevision</code> request. A proof contains the list of hash values that are required to recalculate the specified digest using a Merkle tree, starting with the specified document revision.</p>
273    #[serde(rename = "Proof")]
274    #[serde(skip_serializing_if = "Option::is_none")]
275    pub proof: Option<ValueHolder>,
276    /// <p>The document revision data object in Amazon Ion format.</p>
277    #[serde(rename = "Revision")]
278    pub revision: ValueHolder,
279}
280
281/// <p>The information about an Amazon QLDB journal stream, including the Amazon Resource Name (ARN), stream name, creation time, current status, and the parameters of your original stream creation request.</p>
282#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
283#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
284pub struct JournalKinesisStreamDescription {
285    /// <p>The Amazon Resource Name (ARN) of the QLDB journal stream.</p>
286    #[serde(rename = "Arn")]
287    #[serde(skip_serializing_if = "Option::is_none")]
288    pub arn: Option<String>,
289    /// <p>The date and time, in epoch time format, when the QLDB journal stream was created. (Epoch time format is the number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)</p>
290    #[serde(rename = "CreationTime")]
291    #[serde(skip_serializing_if = "Option::is_none")]
292    pub creation_time: Option<f64>,
293    /// <p>The error message that describes the reason that a stream has a status of <code>IMPAIRED</code> or <code>FAILED</code>. This is not applicable to streams that have other status values.</p>
294    #[serde(rename = "ErrorCause")]
295    #[serde(skip_serializing_if = "Option::is_none")]
296    pub error_cause: Option<String>,
297    /// <p>The exclusive date and time that specifies when the stream ends. If this parameter is blank, the stream runs indefinitely until you cancel it.</p>
298    #[serde(rename = "ExclusiveEndTime")]
299    #[serde(skip_serializing_if = "Option::is_none")]
300    pub exclusive_end_time: Option<f64>,
301    /// <p>The inclusive start date and time from which to start streaming journal data.</p>
302    #[serde(rename = "InclusiveStartTime")]
303    #[serde(skip_serializing_if = "Option::is_none")]
304    pub inclusive_start_time: Option<f64>,
305    /// <p>The configuration settings of the Amazon Kinesis Data Streams destination for your QLDB journal stream.</p>
306    #[serde(rename = "KinesisConfiguration")]
307    pub kinesis_configuration: KinesisConfiguration,
308    /// <p>The name of the ledger.</p>
309    #[serde(rename = "LedgerName")]
310    pub ledger_name: String,
311    /// <p>The Amazon Resource Name (ARN) of the IAM role that grants QLDB permissions for a journal stream to write data records to a Kinesis Data Streams resource.</p>
312    #[serde(rename = "RoleArn")]
313    pub role_arn: String,
314    /// <p>The current state of the QLDB journal stream.</p>
315    #[serde(rename = "Status")]
316    pub status: String,
317    /// <p>The unique ID that QLDB assigns to each QLDB journal stream.</p>
318    #[serde(rename = "StreamId")]
319    pub stream_id: String,
320    /// <p>The user-defined name of the QLDB journal stream.</p>
321    #[serde(rename = "StreamName")]
322    pub stream_name: String,
323}
324
325/// <p>The information about a journal export job, including the ledger name, export ID, when it was created, current status, and its start and end time export parameters.</p>
326#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
327#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
328pub struct JournalS3ExportDescription {
329    /// <p>The exclusive end date and time for the range of journal contents that are specified in the original export request.</p>
330    #[serde(rename = "ExclusiveEndTime")]
331    pub exclusive_end_time: f64,
332    /// <p>The date and time, in epoch time format, when the export job was created. (Epoch time format is the number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)</p>
333    #[serde(rename = "ExportCreationTime")]
334    pub export_creation_time: f64,
335    /// <p>The unique ID of the journal export job.</p>
336    #[serde(rename = "ExportId")]
337    pub export_id: String,
338    /// <p>The inclusive start date and time for the range of journal contents that are specified in the original export request.</p>
339    #[serde(rename = "InclusiveStartTime")]
340    pub inclusive_start_time: f64,
341    /// <p>The name of the ledger.</p>
342    #[serde(rename = "LedgerName")]
343    pub ledger_name: String,
344    /// <p><p>The Amazon Resource Name (ARN) of the IAM role that grants QLDB permissions for a journal export job to do the following:</p> <ul> <li> <p>Write objects into your Amazon Simple Storage Service (Amazon S3) bucket.</p> </li> <li> <p>(Optional) Use your customer master key (CMK) in AWS Key Management Service (AWS KMS) for server-side encryption of your exported data.</p> </li> </ul></p>
345    #[serde(rename = "RoleArn")]
346    pub role_arn: String,
347    #[serde(rename = "S3ExportConfiguration")]
348    pub s3_export_configuration: S3ExportConfiguration,
349    /// <p>The current state of the journal export job.</p>
350    #[serde(rename = "Status")]
351    pub status: String,
352}
353
354/// <p>The configuration settings of the Amazon Kinesis Data Streams destination for your Amazon QLDB journal stream.</p>
355#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
356pub struct KinesisConfiguration {
357    /// <p>Enables QLDB to publish multiple data records in a single Kinesis Data Streams record. To learn more, see <a href="https://docs.aws.amazon.com/streams/latest/dev/kinesis-kpl-concepts.html">KPL Key Concepts</a> in the <i>Amazon Kinesis Data Streams Developer Guide</i>.</p>
358    #[serde(rename = "AggregationEnabled")]
359    #[serde(skip_serializing_if = "Option::is_none")]
360    pub aggregation_enabled: Option<bool>,
361    /// <p>The Amazon Resource Name (ARN) of the Kinesis data stream resource.</p>
362    #[serde(rename = "StreamArn")]
363    pub stream_arn: String,
364}
365
366/// <p>Information about a ledger, including its name, state, and when it was created.</p>
367#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
368#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
369pub struct LedgerSummary {
370    /// <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>
371    #[serde(rename = "CreationDateTime")]
372    #[serde(skip_serializing_if = "Option::is_none")]
373    pub creation_date_time: Option<f64>,
374    /// <p>The name of the ledger.</p>
375    #[serde(rename = "Name")]
376    #[serde(skip_serializing_if = "Option::is_none")]
377    pub name: Option<String>,
378    /// <p>The current status of the ledger.</p>
379    #[serde(rename = "State")]
380    #[serde(skip_serializing_if = "Option::is_none")]
381    pub state: Option<String>,
382}
383
384#[derive(Clone, Debug, Default, PartialEq, Serialize)]
385#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
386pub struct ListJournalKinesisStreamsForLedgerRequest {
387    /// <p>The name of the ledger.</p>
388    #[serde(rename = "LedgerName")]
389    pub ledger_name: String,
390    /// <p>The maximum number of results to return in a single <code>ListJournalKinesisStreamsForLedger</code> request. (The actual number of results returned might be fewer.)</p>
391    #[serde(rename = "MaxResults")]
392    #[serde(skip_serializing_if = "Option::is_none")]
393    pub max_results: Option<i64>,
394    /// <p>A pagination token, indicating that you want to retrieve the next page of results. If you received a value for <code>NextToken</code> in the response from a previous <code>ListJournalKinesisStreamsForLedger</code> call, you should use that value as input here.</p>
395    #[serde(rename = "NextToken")]
396    #[serde(skip_serializing_if = "Option::is_none")]
397    pub next_token: Option<String>,
398}
399
400#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
401#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
402pub struct ListJournalKinesisStreamsForLedgerResponse {
403    /// <ul> <li> <p>If <code>NextToken</code> is empty, the last page of results has been processed and there are no more results to be retrieved.</p> </li> <li> <p>If <code>NextToken</code> is <i>not</i> empty, more results are available. To retrieve the next page of results, use the value of <code>NextToken</code> in a subsequent <code>ListJournalKinesisStreamsForLedger</code> call.</p> </li> </ul>
404    #[serde(rename = "NextToken")]
405    #[serde(skip_serializing_if = "Option::is_none")]
406    pub next_token: Option<String>,
407    /// <p>The array of QLDB journal stream descriptors that are associated with the given ledger.</p>
408    #[serde(rename = "Streams")]
409    #[serde(skip_serializing_if = "Option::is_none")]
410    pub streams: Option<Vec<JournalKinesisStreamDescription>>,
411}
412
413#[derive(Clone, Debug, Default, PartialEq, Serialize)]
414#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
415pub struct ListJournalS3ExportsForLedgerRequest {
416    /// <p>The maximum number of results to return in a single <code>ListJournalS3ExportsForLedger</code> request. (The actual number of results returned might be fewer.)</p>
417    #[serde(rename = "MaxResults")]
418    #[serde(skip_serializing_if = "Option::is_none")]
419    pub max_results: Option<i64>,
420    /// <p>The name of the ledger.</p>
421    #[serde(rename = "Name")]
422    pub name: String,
423    /// <p>A pagination token, indicating that you want to retrieve the next page of results. If you received a value for <code>NextToken</code> in the response from a previous <code>ListJournalS3ExportsForLedger</code> call, then you should use that value as input here.</p>
424    #[serde(rename = "NextToken")]
425    #[serde(skip_serializing_if = "Option::is_none")]
426    pub next_token: Option<String>,
427}
428
429#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
430#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
431pub struct ListJournalS3ExportsForLedgerResponse {
432    /// <p>The array of journal export job descriptions that are associated with the specified ledger.</p>
433    #[serde(rename = "JournalS3Exports")]
434    #[serde(skip_serializing_if = "Option::is_none")]
435    pub journal_s3_exports: Option<Vec<JournalS3ExportDescription>>,
436    /// <ul> <li> <p>If <code>NextToken</code> is empty, then the last page of results has been processed and there are no more results to be retrieved.</p> </li> <li> <p>If <code>NextToken</code> is <i>not</i> empty, then there are more results available. To retrieve the next page of results, use the value of <code>NextToken</code> in a subsequent <code>ListJournalS3ExportsForLedger</code> call.</p> </li> </ul>
437    #[serde(rename = "NextToken")]
438    #[serde(skip_serializing_if = "Option::is_none")]
439    pub next_token: Option<String>,
440}
441
442#[derive(Clone, Debug, Default, PartialEq, Serialize)]
443#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
444pub struct ListJournalS3ExportsRequest {
445    /// <p>The maximum number of results to return in a single <code>ListJournalS3Exports</code> request. (The actual number of results returned might be fewer.)</p>
446    #[serde(rename = "MaxResults")]
447    #[serde(skip_serializing_if = "Option::is_none")]
448    pub max_results: Option<i64>,
449    /// <p>A pagination token, indicating that you want to retrieve the next page of results. If you received a value for <code>NextToken</code> in the response from a previous <code>ListJournalS3Exports</code> call, then you should use that value as input here.</p>
450    #[serde(rename = "NextToken")]
451    #[serde(skip_serializing_if = "Option::is_none")]
452    pub next_token: Option<String>,
453}
454
455#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
456#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
457pub struct ListJournalS3ExportsResponse {
458    /// <p>The array of journal export job descriptions for all ledgers that are associated with the current AWS account and Region.</p>
459    #[serde(rename = "JournalS3Exports")]
460    #[serde(skip_serializing_if = "Option::is_none")]
461    pub journal_s3_exports: Option<Vec<JournalS3ExportDescription>>,
462    /// <ul> <li> <p>If <code>NextToken</code> is empty, then the last page of results has been processed and there are no more results to be retrieved.</p> </li> <li> <p>If <code>NextToken</code> is <i>not</i> empty, then there are more results available. To retrieve the next page of results, use the value of <code>NextToken</code> in a subsequent <code>ListJournalS3Exports</code> call.</p> </li> </ul>
463    #[serde(rename = "NextToken")]
464    #[serde(skip_serializing_if = "Option::is_none")]
465    pub next_token: Option<String>,
466}
467
468#[derive(Clone, Debug, Default, PartialEq, Serialize)]
469#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
470pub struct ListLedgersRequest {
471    /// <p>The maximum number of results to return in a single <code>ListLedgers</code> request. (The actual number of results returned might be fewer.)</p>
472    #[serde(rename = "MaxResults")]
473    #[serde(skip_serializing_if = "Option::is_none")]
474    pub max_results: Option<i64>,
475    /// <p>A pagination token, indicating that you want to retrieve the next page of results. If you received a value for <code>NextToken</code> in the response from a previous <code>ListLedgers</code> call, then you should use that value as input here.</p>
476    #[serde(rename = "NextToken")]
477    #[serde(skip_serializing_if = "Option::is_none")]
478    pub next_token: Option<String>,
479}
480
481#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
482#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
483pub struct ListLedgersResponse {
484    /// <p>The array of ledger summaries that are associated with the current AWS account and Region.</p>
485    #[serde(rename = "Ledgers")]
486    #[serde(skip_serializing_if = "Option::is_none")]
487    pub ledgers: Option<Vec<LedgerSummary>>,
488    /// <p><p>A pagination token, indicating whether there are more results available:</p> <ul> <li> <p>If <code>NextToken</code> is empty, then the last page of results has been processed and there are no more results to be retrieved.</p> </li> <li> <p>If <code>NextToken</code> is <i>not</i> empty, then there are more results available. To retrieve the next page of results, use the value of <code>NextToken</code> in a subsequent <code>ListLedgers</code> call.</p> </li> </ul></p>
489    #[serde(rename = "NextToken")]
490    #[serde(skip_serializing_if = "Option::is_none")]
491    pub next_token: Option<String>,
492}
493
494#[derive(Clone, Debug, Default, PartialEq, Serialize)]
495#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
496pub struct ListTagsForResourceRequest {
497    /// <p>The Amazon Resource Name (ARN) for which you want to list the tags. For example:</p> <p> <code>arn:aws:qldb:us-east-1:123456789012:ledger/exampleLedger</code> </p>
498    #[serde(rename = "ResourceArn")]
499    pub resource_arn: String,
500}
501
502#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
503#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
504pub struct ListTagsForResourceResponse {
505    /// <p>The tags that are currently associated with the specified Amazon QLDB resource.</p>
506    #[serde(rename = "Tags")]
507    #[serde(skip_serializing_if = "Option::is_none")]
508    pub tags: Option<::std::collections::HashMap<String, String>>,
509}
510
511/// <p>The encryption settings that are used by a journal export job to write data in an Amazon Simple Storage Service (Amazon S3) bucket.</p>
512#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
513pub struct S3EncryptionConfiguration {
514    /// <p>The Amazon Resource Name (ARN) for a symmetric customer master key (CMK) in AWS Key Management Service (AWS KMS). Amazon QLDB does not support asymmetric CMKs.</p> <p>You must provide a <code>KmsKeyArn</code> if you specify <code>SSE_KMS</code> as the <code>ObjectEncryptionType</code>.</p> <p> <code>KmsKeyArn</code> is not required if you specify <code>SSE_S3</code> as the <code>ObjectEncryptionType</code>.</p>
515    #[serde(rename = "KmsKeyArn")]
516    #[serde(skip_serializing_if = "Option::is_none")]
517    pub kms_key_arn: Option<String>,
518    /// <p>The Amazon S3 object encryption type.</p> <p>To learn more about server-side encryption options in Amazon S3, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html">Protecting Data Using Server-Side Encryption</a> in the <i>Amazon S3 Developer Guide</i>.</p>
519    #[serde(rename = "ObjectEncryptionType")]
520    pub object_encryption_type: String,
521}
522
523/// <p>The Amazon Simple Storage Service (Amazon S3) bucket location in which a journal export job writes the journal contents.</p>
524#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
525pub struct S3ExportConfiguration {
526    /// <p>The Amazon S3 bucket name in which a journal export job writes the journal contents.</p> <p>The bucket name must comply with the Amazon S3 bucket naming conventions. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html">Bucket Restrictions and Limitations</a> in the <i>Amazon S3 Developer Guide</i>.</p>
527    #[serde(rename = "Bucket")]
528    pub bucket: String,
529    /// <p>The encryption settings that are used by a journal export job to write data in an Amazon S3 bucket.</p>
530    #[serde(rename = "EncryptionConfiguration")]
531    pub encryption_configuration: S3EncryptionConfiguration,
532    /// <p><p>The prefix for the Amazon S3 bucket in which a journal export job writes the journal contents.</p> <p>The prefix must comply with Amazon S3 key naming rules and restrictions. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html">Object Key and Metadata</a> in the <i>Amazon S3 Developer Guide</i>.</p> <p>The following are examples of valid <code>Prefix</code> values:</p> <ul> <li> <p> <code>JournalExports-ForMyLedger/Testing/</code> </p> </li> <li> <p> <code>JournalExports</code> </p> </li> <li> <p> <code>My:Tests/</code> </p> </li> </ul></p>
533    #[serde(rename = "Prefix")]
534    pub prefix: String,
535}
536
537#[derive(Clone, Debug, Default, PartialEq, Serialize)]
538#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
539pub struct StreamJournalToKinesisRequest {
540    /// <p>The exclusive date and time that specifies when the stream ends. If you don't define this parameter, the stream runs indefinitely until you cancel it.</p> <p>The <code>ExclusiveEndTime</code> must be in <code>ISO 8601</code> date and time format and in Universal Coordinated Time (UTC). For example: <code>2019-06-13T21:36:34Z</code> </p>
541    #[serde(rename = "ExclusiveEndTime")]
542    #[serde(skip_serializing_if = "Option::is_none")]
543    pub exclusive_end_time: Option<f64>,
544    /// <p>The inclusive start date and time from which to start streaming journal data. This parameter must be in <code>ISO 8601</code> date and time format and in Universal Coordinated Time (UTC). For example: <code>2019-06-13T21:36:34Z</code> </p> <p>The <code>InclusiveStartTime</code> cannot be in the future and must be before <code>ExclusiveEndTime</code>.</p> <p>If you provide an <code>InclusiveStartTime</code> that is before the ledger's <code>CreationDateTime</code>, QLDB effectively defaults it to the ledger's <code>CreationDateTime</code>.</p>
545    #[serde(rename = "InclusiveStartTime")]
546    pub inclusive_start_time: f64,
547    /// <p>The configuration settings of the Kinesis Data Streams destination for your stream request.</p>
548    #[serde(rename = "KinesisConfiguration")]
549    pub kinesis_configuration: KinesisConfiguration,
550    /// <p>The name of the ledger.</p>
551    #[serde(rename = "LedgerName")]
552    pub ledger_name: String,
553    /// <p>The Amazon Resource Name (ARN) of the IAM role that grants QLDB permissions for a journal stream to write data records to a Kinesis Data Streams resource.</p>
554    #[serde(rename = "RoleArn")]
555    pub role_arn: String,
556    /// <p>The name that you want to assign to the QLDB journal stream. User-defined names can help identify and indicate the purpose of a stream.</p> <p>Your stream name must be unique among other <i>active</i> streams for a given ledger. Stream names have the same naming constraints as ledger names, as defined in <a href="https://docs.aws.amazon.com/qldb/latest/developerguide/limits.html#limits.naming">Quotas in Amazon QLDB</a> in the <i>Amazon QLDB Developer Guide</i>.</p>
557    #[serde(rename = "StreamName")]
558    pub stream_name: String,
559    /// <p>The key-value pairs to add as tags to the stream that you want to create. Tag keys are case sensitive. Tag values are case sensitive and can be null.</p>
560    #[serde(rename = "Tags")]
561    #[serde(skip_serializing_if = "Option::is_none")]
562    pub tags: Option<::std::collections::HashMap<String, String>>,
563}
564
565#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
566#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
567pub struct StreamJournalToKinesisResponse {
568    /// <p>The unique ID that QLDB assigns to each QLDB journal stream.</p>
569    #[serde(rename = "StreamId")]
570    #[serde(skip_serializing_if = "Option::is_none")]
571    pub stream_id: Option<String>,
572}
573
574#[derive(Clone, Debug, Default, PartialEq, Serialize)]
575#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
576pub struct TagResourceRequest {
577    /// <p>The Amazon Resource Name (ARN) to which you want to add the tags. For example:</p> <p> <code>arn:aws:qldb:us-east-1:123456789012:ledger/exampleLedger</code> </p>
578    #[serde(rename = "ResourceArn")]
579    pub resource_arn: String,
580    /// <p>The key-value pairs to add as tags to the specified QLDB resource. Tag keys are case sensitive. If you specify a key that already exists for the resource, your request fails and returns an error. Tag values are case sensitive and can be null.</p>
581    #[serde(rename = "Tags")]
582    pub tags: ::std::collections::HashMap<String, String>,
583}
584
585#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
586#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
587pub struct TagResourceResponse {}
588
589#[derive(Clone, Debug, Default, PartialEq, Serialize)]
590#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
591pub struct UntagResourceRequest {
592    /// <p>The Amazon Resource Name (ARN) from which you want to remove the tags. For example:</p> <p> <code>arn:aws:qldb:us-east-1:123456789012:ledger/exampleLedger</code> </p>
593    #[serde(rename = "ResourceArn")]
594    pub resource_arn: String,
595    /// <p>The list of tag keys that you want to remove.</p>
596    #[serde(rename = "TagKeys")]
597    pub tag_keys: Vec<String>,
598}
599
600#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
601#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
602pub struct UntagResourceResponse {}
603
604#[derive(Clone, Debug, Default, PartialEq, Serialize)]
605#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
606pub struct UpdateLedgerRequest {
607    /// <p>The flag that prevents a ledger from being deleted by any user. If not provided on ledger creation, this feature is enabled (<code>true</code>) by default.</p> <p>If deletion protection is enabled, you must first disable it before you can delete the ledger using the QLDB API or the AWS Command Line Interface (AWS CLI). You can disable it by calling the <code>UpdateLedger</code> operation to set the flag to <code>false</code>. The QLDB console disables deletion protection for you when you use it to delete a ledger.</p>
608    #[serde(rename = "DeletionProtection")]
609    #[serde(skip_serializing_if = "Option::is_none")]
610    pub deletion_protection: Option<bool>,
611    /// <p>The name of the ledger.</p>
612    #[serde(rename = "Name")]
613    pub name: String,
614}
615
616#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
617#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
618pub struct UpdateLedgerResponse {
619    /// <p>The Amazon Resource Name (ARN) for the ledger.</p>
620    #[serde(rename = "Arn")]
621    #[serde(skip_serializing_if = "Option::is_none")]
622    pub arn: Option<String>,
623    /// <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>
624    #[serde(rename = "CreationDateTime")]
625    #[serde(skip_serializing_if = "Option::is_none")]
626    pub creation_date_time: Option<f64>,
627    /// <p>The flag that prevents a ledger from being deleted by any user. If not provided on ledger creation, this feature is enabled (<code>true</code>) by default.</p> <p>If deletion protection is enabled, you must first disable it before you can delete the ledger using the QLDB API or the AWS Command Line Interface (AWS CLI). You can disable it by calling the <code>UpdateLedger</code> operation to set the flag to <code>false</code>. The QLDB console disables deletion protection for you when you use it to delete a ledger.</p>
628    #[serde(rename = "DeletionProtection")]
629    #[serde(skip_serializing_if = "Option::is_none")]
630    pub deletion_protection: Option<bool>,
631    /// <p>The name of the ledger.</p>
632    #[serde(rename = "Name")]
633    #[serde(skip_serializing_if = "Option::is_none")]
634    pub name: Option<String>,
635    /// <p>The current status of the ledger.</p>
636    #[serde(rename = "State")]
637    #[serde(skip_serializing_if = "Option::is_none")]
638    pub state: Option<String>,
639}
640
641/// <p>A structure that can contain a value in multiple encoding formats.</p>
642#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
643pub struct ValueHolder {
644    /// <p>An Amazon Ion plaintext value contained in a <code>ValueHolder</code> structure.</p>
645    #[serde(rename = "IonText")]
646    #[serde(skip_serializing_if = "Option::is_none")]
647    pub ion_text: Option<String>,
648}
649
650/// Errors returned by CancelJournalKinesisStream
651#[derive(Debug, PartialEq)]
652pub enum CancelJournalKinesisStreamError {
653    /// <p>One or more parameters in the request aren't valid.</p>
654    InvalidParameter(String),
655    /// <p>The specified resource doesn't exist.</p>
656    ResourceNotFound(String),
657    /// <p>The operation failed because a condition wasn't satisfied in advance.</p>
658    ResourcePreconditionNotMet(String),
659}
660
661impl CancelJournalKinesisStreamError {
662    pub fn from_response(
663        res: BufferedHttpResponse,
664    ) -> RusotoError<CancelJournalKinesisStreamError> {
665        if let Some(err) = proto::json::Error::parse_rest(&res) {
666            match err.typ.as_str() {
667                "InvalidParameterException" => {
668                    return RusotoError::Service(CancelJournalKinesisStreamError::InvalidParameter(
669                        err.msg,
670                    ))
671                }
672                "ResourceNotFoundException" => {
673                    return RusotoError::Service(CancelJournalKinesisStreamError::ResourceNotFound(
674                        err.msg,
675                    ))
676                }
677                "ResourcePreconditionNotMetException" => {
678                    return RusotoError::Service(
679                        CancelJournalKinesisStreamError::ResourcePreconditionNotMet(err.msg),
680                    )
681                }
682                "ValidationException" => return RusotoError::Validation(err.msg),
683                _ => {}
684            }
685        }
686        RusotoError::Unknown(res)
687    }
688}
689impl fmt::Display for CancelJournalKinesisStreamError {
690    #[allow(unused_variables)]
691    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
692        match *self {
693            CancelJournalKinesisStreamError::InvalidParameter(ref cause) => write!(f, "{}", cause),
694            CancelJournalKinesisStreamError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
695            CancelJournalKinesisStreamError::ResourcePreconditionNotMet(ref cause) => {
696                write!(f, "{}", cause)
697            }
698        }
699    }
700}
701impl Error for CancelJournalKinesisStreamError {}
702/// Errors returned by CreateLedger
703#[derive(Debug, PartialEq)]
704pub enum CreateLedgerError {
705    /// <p>One or more parameters in the request aren't valid.</p>
706    InvalidParameter(String),
707    /// <p>You have reached the limit on the maximum number of resources allowed.</p>
708    LimitExceeded(String),
709    /// <p>The specified resource already exists.</p>
710    ResourceAlreadyExists(String),
711    /// <p>The specified resource can't be modified at this time.</p>
712    ResourceInUse(String),
713}
714
715impl CreateLedgerError {
716    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateLedgerError> {
717        if let Some(err) = proto::json::Error::parse_rest(&res) {
718            match err.typ.as_str() {
719                "InvalidParameterException" => {
720                    return RusotoError::Service(CreateLedgerError::InvalidParameter(err.msg))
721                }
722                "LimitExceededException" => {
723                    return RusotoError::Service(CreateLedgerError::LimitExceeded(err.msg))
724                }
725                "ResourceAlreadyExistsException" => {
726                    return RusotoError::Service(CreateLedgerError::ResourceAlreadyExists(err.msg))
727                }
728                "ResourceInUseException" => {
729                    return RusotoError::Service(CreateLedgerError::ResourceInUse(err.msg))
730                }
731                "ValidationException" => return RusotoError::Validation(err.msg),
732                _ => {}
733            }
734        }
735        RusotoError::Unknown(res)
736    }
737}
738impl fmt::Display for CreateLedgerError {
739    #[allow(unused_variables)]
740    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
741        match *self {
742            CreateLedgerError::InvalidParameter(ref cause) => write!(f, "{}", cause),
743            CreateLedgerError::LimitExceeded(ref cause) => write!(f, "{}", cause),
744            CreateLedgerError::ResourceAlreadyExists(ref cause) => write!(f, "{}", cause),
745            CreateLedgerError::ResourceInUse(ref cause) => write!(f, "{}", cause),
746        }
747    }
748}
749impl Error for CreateLedgerError {}
750/// Errors returned by DeleteLedger
751#[derive(Debug, PartialEq)]
752pub enum DeleteLedgerError {
753    /// <p>One or more parameters in the request aren't valid.</p>
754    InvalidParameter(String),
755    /// <p>The specified resource can't be modified at this time.</p>
756    ResourceInUse(String),
757    /// <p>The specified resource doesn't exist.</p>
758    ResourceNotFound(String),
759    /// <p>The operation failed because a condition wasn't satisfied in advance.</p>
760    ResourcePreconditionNotMet(String),
761}
762
763impl DeleteLedgerError {
764    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteLedgerError> {
765        if let Some(err) = proto::json::Error::parse_rest(&res) {
766            match err.typ.as_str() {
767                "InvalidParameterException" => {
768                    return RusotoError::Service(DeleteLedgerError::InvalidParameter(err.msg))
769                }
770                "ResourceInUseException" => {
771                    return RusotoError::Service(DeleteLedgerError::ResourceInUse(err.msg))
772                }
773                "ResourceNotFoundException" => {
774                    return RusotoError::Service(DeleteLedgerError::ResourceNotFound(err.msg))
775                }
776                "ResourcePreconditionNotMetException" => {
777                    return RusotoError::Service(DeleteLedgerError::ResourcePreconditionNotMet(
778                        err.msg,
779                    ))
780                }
781                "ValidationException" => return RusotoError::Validation(err.msg),
782                _ => {}
783            }
784        }
785        RusotoError::Unknown(res)
786    }
787}
788impl fmt::Display for DeleteLedgerError {
789    #[allow(unused_variables)]
790    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
791        match *self {
792            DeleteLedgerError::InvalidParameter(ref cause) => write!(f, "{}", cause),
793            DeleteLedgerError::ResourceInUse(ref cause) => write!(f, "{}", cause),
794            DeleteLedgerError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
795            DeleteLedgerError::ResourcePreconditionNotMet(ref cause) => write!(f, "{}", cause),
796        }
797    }
798}
799impl Error for DeleteLedgerError {}
800/// Errors returned by DescribeJournalKinesisStream
801#[derive(Debug, PartialEq)]
802pub enum DescribeJournalKinesisStreamError {
803    /// <p>One or more parameters in the request aren't valid.</p>
804    InvalidParameter(String),
805    /// <p>The specified resource doesn't exist.</p>
806    ResourceNotFound(String),
807    /// <p>The operation failed because a condition wasn't satisfied in advance.</p>
808    ResourcePreconditionNotMet(String),
809}
810
811impl DescribeJournalKinesisStreamError {
812    pub fn from_response(
813        res: BufferedHttpResponse,
814    ) -> RusotoError<DescribeJournalKinesisStreamError> {
815        if let Some(err) = proto::json::Error::parse_rest(&res) {
816            match err.typ.as_str() {
817                "InvalidParameterException" => {
818                    return RusotoError::Service(
819                        DescribeJournalKinesisStreamError::InvalidParameter(err.msg),
820                    )
821                }
822                "ResourceNotFoundException" => {
823                    return RusotoError::Service(
824                        DescribeJournalKinesisStreamError::ResourceNotFound(err.msg),
825                    )
826                }
827                "ResourcePreconditionNotMetException" => {
828                    return RusotoError::Service(
829                        DescribeJournalKinesisStreamError::ResourcePreconditionNotMet(err.msg),
830                    )
831                }
832                "ValidationException" => return RusotoError::Validation(err.msg),
833                _ => {}
834            }
835        }
836        RusotoError::Unknown(res)
837    }
838}
839impl fmt::Display for DescribeJournalKinesisStreamError {
840    #[allow(unused_variables)]
841    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
842        match *self {
843            DescribeJournalKinesisStreamError::InvalidParameter(ref cause) => {
844                write!(f, "{}", cause)
845            }
846            DescribeJournalKinesisStreamError::ResourceNotFound(ref cause) => {
847                write!(f, "{}", cause)
848            }
849            DescribeJournalKinesisStreamError::ResourcePreconditionNotMet(ref cause) => {
850                write!(f, "{}", cause)
851            }
852        }
853    }
854}
855impl Error for DescribeJournalKinesisStreamError {}
856/// Errors returned by DescribeJournalS3Export
857#[derive(Debug, PartialEq)]
858pub enum DescribeJournalS3ExportError {
859    /// <p>The specified resource doesn't exist.</p>
860    ResourceNotFound(String),
861}
862
863impl DescribeJournalS3ExportError {
864    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeJournalS3ExportError> {
865        if let Some(err) = proto::json::Error::parse_rest(&res) {
866            match err.typ.as_str() {
867                "ResourceNotFoundException" => {
868                    return RusotoError::Service(DescribeJournalS3ExportError::ResourceNotFound(
869                        err.msg,
870                    ))
871                }
872                "ValidationException" => return RusotoError::Validation(err.msg),
873                _ => {}
874            }
875        }
876        RusotoError::Unknown(res)
877    }
878}
879impl fmt::Display for DescribeJournalS3ExportError {
880    #[allow(unused_variables)]
881    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
882        match *self {
883            DescribeJournalS3ExportError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
884        }
885    }
886}
887impl Error for DescribeJournalS3ExportError {}
888/// Errors returned by DescribeLedger
889#[derive(Debug, PartialEq)]
890pub enum DescribeLedgerError {
891    /// <p>One or more parameters in the request aren't valid.</p>
892    InvalidParameter(String),
893    /// <p>The specified resource doesn't exist.</p>
894    ResourceNotFound(String),
895}
896
897impl DescribeLedgerError {
898    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeLedgerError> {
899        if let Some(err) = proto::json::Error::parse_rest(&res) {
900            match err.typ.as_str() {
901                "InvalidParameterException" => {
902                    return RusotoError::Service(DescribeLedgerError::InvalidParameter(err.msg))
903                }
904                "ResourceNotFoundException" => {
905                    return RusotoError::Service(DescribeLedgerError::ResourceNotFound(err.msg))
906                }
907                "ValidationException" => return RusotoError::Validation(err.msg),
908                _ => {}
909            }
910        }
911        RusotoError::Unknown(res)
912    }
913}
914impl fmt::Display for DescribeLedgerError {
915    #[allow(unused_variables)]
916    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
917        match *self {
918            DescribeLedgerError::InvalidParameter(ref cause) => write!(f, "{}", cause),
919            DescribeLedgerError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
920        }
921    }
922}
923impl Error for DescribeLedgerError {}
924/// Errors returned by ExportJournalToS3
925#[derive(Debug, PartialEq)]
926pub enum ExportJournalToS3Error {
927    /// <p>The specified resource doesn't exist.</p>
928    ResourceNotFound(String),
929    /// <p>The operation failed because a condition wasn't satisfied in advance.</p>
930    ResourcePreconditionNotMet(String),
931}
932
933impl ExportJournalToS3Error {
934    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ExportJournalToS3Error> {
935        if let Some(err) = proto::json::Error::parse_rest(&res) {
936            match err.typ.as_str() {
937                "ResourceNotFoundException" => {
938                    return RusotoError::Service(ExportJournalToS3Error::ResourceNotFound(err.msg))
939                }
940                "ResourcePreconditionNotMetException" => {
941                    return RusotoError::Service(
942                        ExportJournalToS3Error::ResourcePreconditionNotMet(err.msg),
943                    )
944                }
945                "ValidationException" => return RusotoError::Validation(err.msg),
946                _ => {}
947            }
948        }
949        RusotoError::Unknown(res)
950    }
951}
952impl fmt::Display for ExportJournalToS3Error {
953    #[allow(unused_variables)]
954    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
955        match *self {
956            ExportJournalToS3Error::ResourceNotFound(ref cause) => write!(f, "{}", cause),
957            ExportJournalToS3Error::ResourcePreconditionNotMet(ref cause) => write!(f, "{}", cause),
958        }
959    }
960}
961impl Error for ExportJournalToS3Error {}
962/// Errors returned by GetBlock
963#[derive(Debug, PartialEq)]
964pub enum GetBlockError {
965    /// <p>One or more parameters in the request aren't valid.</p>
966    InvalidParameter(String),
967    /// <p>The specified resource doesn't exist.</p>
968    ResourceNotFound(String),
969    /// <p>The operation failed because a condition wasn't satisfied in advance.</p>
970    ResourcePreconditionNotMet(String),
971}
972
973impl GetBlockError {
974    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetBlockError> {
975        if let Some(err) = proto::json::Error::parse_rest(&res) {
976            match err.typ.as_str() {
977                "InvalidParameterException" => {
978                    return RusotoError::Service(GetBlockError::InvalidParameter(err.msg))
979                }
980                "ResourceNotFoundException" => {
981                    return RusotoError::Service(GetBlockError::ResourceNotFound(err.msg))
982                }
983                "ResourcePreconditionNotMetException" => {
984                    return RusotoError::Service(GetBlockError::ResourcePreconditionNotMet(err.msg))
985                }
986                "ValidationException" => return RusotoError::Validation(err.msg),
987                _ => {}
988            }
989        }
990        RusotoError::Unknown(res)
991    }
992}
993impl fmt::Display for GetBlockError {
994    #[allow(unused_variables)]
995    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
996        match *self {
997            GetBlockError::InvalidParameter(ref cause) => write!(f, "{}", cause),
998            GetBlockError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
999            GetBlockError::ResourcePreconditionNotMet(ref cause) => write!(f, "{}", cause),
1000        }
1001    }
1002}
1003impl Error for GetBlockError {}
1004/// Errors returned by GetDigest
1005#[derive(Debug, PartialEq)]
1006pub enum GetDigestError {
1007    /// <p>One or more parameters in the request aren't valid.</p>
1008    InvalidParameter(String),
1009    /// <p>The specified resource doesn't exist.</p>
1010    ResourceNotFound(String),
1011    /// <p>The operation failed because a condition wasn't satisfied in advance.</p>
1012    ResourcePreconditionNotMet(String),
1013}
1014
1015impl GetDigestError {
1016    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetDigestError> {
1017        if let Some(err) = proto::json::Error::parse_rest(&res) {
1018            match err.typ.as_str() {
1019                "InvalidParameterException" => {
1020                    return RusotoError::Service(GetDigestError::InvalidParameter(err.msg))
1021                }
1022                "ResourceNotFoundException" => {
1023                    return RusotoError::Service(GetDigestError::ResourceNotFound(err.msg))
1024                }
1025                "ResourcePreconditionNotMetException" => {
1026                    return RusotoError::Service(GetDigestError::ResourcePreconditionNotMet(
1027                        err.msg,
1028                    ))
1029                }
1030                "ValidationException" => return RusotoError::Validation(err.msg),
1031                _ => {}
1032            }
1033        }
1034        RusotoError::Unknown(res)
1035    }
1036}
1037impl fmt::Display for GetDigestError {
1038    #[allow(unused_variables)]
1039    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1040        match *self {
1041            GetDigestError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1042            GetDigestError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1043            GetDigestError::ResourcePreconditionNotMet(ref cause) => write!(f, "{}", cause),
1044        }
1045    }
1046}
1047impl Error for GetDigestError {}
1048/// Errors returned by GetRevision
1049#[derive(Debug, PartialEq)]
1050pub enum GetRevisionError {
1051    /// <p>One or more parameters in the request aren't valid.</p>
1052    InvalidParameter(String),
1053    /// <p>The specified resource doesn't exist.</p>
1054    ResourceNotFound(String),
1055    /// <p>The operation failed because a condition wasn't satisfied in advance.</p>
1056    ResourcePreconditionNotMet(String),
1057}
1058
1059impl GetRevisionError {
1060    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetRevisionError> {
1061        if let Some(err) = proto::json::Error::parse_rest(&res) {
1062            match err.typ.as_str() {
1063                "InvalidParameterException" => {
1064                    return RusotoError::Service(GetRevisionError::InvalidParameter(err.msg))
1065                }
1066                "ResourceNotFoundException" => {
1067                    return RusotoError::Service(GetRevisionError::ResourceNotFound(err.msg))
1068                }
1069                "ResourcePreconditionNotMetException" => {
1070                    return RusotoError::Service(GetRevisionError::ResourcePreconditionNotMet(
1071                        err.msg,
1072                    ))
1073                }
1074                "ValidationException" => return RusotoError::Validation(err.msg),
1075                _ => {}
1076            }
1077        }
1078        RusotoError::Unknown(res)
1079    }
1080}
1081impl fmt::Display for GetRevisionError {
1082    #[allow(unused_variables)]
1083    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1084        match *self {
1085            GetRevisionError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1086            GetRevisionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1087            GetRevisionError::ResourcePreconditionNotMet(ref cause) => write!(f, "{}", cause),
1088        }
1089    }
1090}
1091impl Error for GetRevisionError {}
1092/// Errors returned by ListJournalKinesisStreamsForLedger
1093#[derive(Debug, PartialEq)]
1094pub enum ListJournalKinesisStreamsForLedgerError {
1095    /// <p>One or more parameters in the request aren't valid.</p>
1096    InvalidParameter(String),
1097    /// <p>The specified resource doesn't exist.</p>
1098    ResourceNotFound(String),
1099    /// <p>The operation failed because a condition wasn't satisfied in advance.</p>
1100    ResourcePreconditionNotMet(String),
1101}
1102
1103impl ListJournalKinesisStreamsForLedgerError {
1104    pub fn from_response(
1105        res: BufferedHttpResponse,
1106    ) -> RusotoError<ListJournalKinesisStreamsForLedgerError> {
1107        if let Some(err) = proto::json::Error::parse_rest(&res) {
1108            match err.typ.as_str() {
1109                "InvalidParameterException" => {
1110                    return RusotoError::Service(
1111                        ListJournalKinesisStreamsForLedgerError::InvalidParameter(err.msg),
1112                    )
1113                }
1114                "ResourceNotFoundException" => {
1115                    return RusotoError::Service(
1116                        ListJournalKinesisStreamsForLedgerError::ResourceNotFound(err.msg),
1117                    )
1118                }
1119                "ResourcePreconditionNotMetException" => {
1120                    return RusotoError::Service(
1121                        ListJournalKinesisStreamsForLedgerError::ResourcePreconditionNotMet(
1122                            err.msg,
1123                        ),
1124                    )
1125                }
1126                "ValidationException" => return RusotoError::Validation(err.msg),
1127                _ => {}
1128            }
1129        }
1130        RusotoError::Unknown(res)
1131    }
1132}
1133impl fmt::Display for ListJournalKinesisStreamsForLedgerError {
1134    #[allow(unused_variables)]
1135    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1136        match *self {
1137            ListJournalKinesisStreamsForLedgerError::InvalidParameter(ref cause) => {
1138                write!(f, "{}", cause)
1139            }
1140            ListJournalKinesisStreamsForLedgerError::ResourceNotFound(ref cause) => {
1141                write!(f, "{}", cause)
1142            }
1143            ListJournalKinesisStreamsForLedgerError::ResourcePreconditionNotMet(ref cause) => {
1144                write!(f, "{}", cause)
1145            }
1146        }
1147    }
1148}
1149impl Error for ListJournalKinesisStreamsForLedgerError {}
1150/// Errors returned by ListJournalS3Exports
1151#[derive(Debug, PartialEq)]
1152pub enum ListJournalS3ExportsError {}
1153
1154impl ListJournalS3ExportsError {
1155    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListJournalS3ExportsError> {
1156        if let Some(err) = proto::json::Error::parse_rest(&res) {
1157            match err.typ.as_str() {
1158                "ValidationException" => return RusotoError::Validation(err.msg),
1159                _ => {}
1160            }
1161        }
1162        RusotoError::Unknown(res)
1163    }
1164}
1165impl fmt::Display for ListJournalS3ExportsError {
1166    #[allow(unused_variables)]
1167    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1168        match *self {}
1169    }
1170}
1171impl Error for ListJournalS3ExportsError {}
1172/// Errors returned by ListJournalS3ExportsForLedger
1173#[derive(Debug, PartialEq)]
1174pub enum ListJournalS3ExportsForLedgerError {}
1175
1176impl ListJournalS3ExportsForLedgerError {
1177    pub fn from_response(
1178        res: BufferedHttpResponse,
1179    ) -> RusotoError<ListJournalS3ExportsForLedgerError> {
1180        if let Some(err) = proto::json::Error::parse_rest(&res) {
1181            match err.typ.as_str() {
1182                "ValidationException" => return RusotoError::Validation(err.msg),
1183                _ => {}
1184            }
1185        }
1186        RusotoError::Unknown(res)
1187    }
1188}
1189impl fmt::Display for ListJournalS3ExportsForLedgerError {
1190    #[allow(unused_variables)]
1191    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1192        match *self {}
1193    }
1194}
1195impl Error for ListJournalS3ExportsForLedgerError {}
1196/// Errors returned by ListLedgers
1197#[derive(Debug, PartialEq)]
1198pub enum ListLedgersError {}
1199
1200impl ListLedgersError {
1201    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListLedgersError> {
1202        if let Some(err) = proto::json::Error::parse_rest(&res) {
1203            match err.typ.as_str() {
1204                "ValidationException" => return RusotoError::Validation(err.msg),
1205                _ => {}
1206            }
1207        }
1208        RusotoError::Unknown(res)
1209    }
1210}
1211impl fmt::Display for ListLedgersError {
1212    #[allow(unused_variables)]
1213    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1214        match *self {}
1215    }
1216}
1217impl Error for ListLedgersError {}
1218/// Errors returned by ListTagsForResource
1219#[derive(Debug, PartialEq)]
1220pub enum ListTagsForResourceError {
1221    /// <p>One or more parameters in the request aren't valid.</p>
1222    InvalidParameter(String),
1223    /// <p>The specified resource doesn't exist.</p>
1224    ResourceNotFound(String),
1225}
1226
1227impl ListTagsForResourceError {
1228    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsForResourceError> {
1229        if let Some(err) = proto::json::Error::parse_rest(&res) {
1230            match err.typ.as_str() {
1231                "InvalidParameterException" => {
1232                    return RusotoError::Service(ListTagsForResourceError::InvalidParameter(
1233                        err.msg,
1234                    ))
1235                }
1236                "ResourceNotFoundException" => {
1237                    return RusotoError::Service(ListTagsForResourceError::ResourceNotFound(
1238                        err.msg,
1239                    ))
1240                }
1241                "ValidationException" => return RusotoError::Validation(err.msg),
1242                _ => {}
1243            }
1244        }
1245        RusotoError::Unknown(res)
1246    }
1247}
1248impl fmt::Display for ListTagsForResourceError {
1249    #[allow(unused_variables)]
1250    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1251        match *self {
1252            ListTagsForResourceError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1253            ListTagsForResourceError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1254        }
1255    }
1256}
1257impl Error for ListTagsForResourceError {}
1258/// Errors returned by StreamJournalToKinesis
1259#[derive(Debug, PartialEq)]
1260pub enum StreamJournalToKinesisError {
1261    /// <p>One or more parameters in the request aren't valid.</p>
1262    InvalidParameter(String),
1263    /// <p>The specified resource doesn't exist.</p>
1264    ResourceNotFound(String),
1265    /// <p>The operation failed because a condition wasn't satisfied in advance.</p>
1266    ResourcePreconditionNotMet(String),
1267}
1268
1269impl StreamJournalToKinesisError {
1270    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StreamJournalToKinesisError> {
1271        if let Some(err) = proto::json::Error::parse_rest(&res) {
1272            match err.typ.as_str() {
1273                "InvalidParameterException" => {
1274                    return RusotoError::Service(StreamJournalToKinesisError::InvalidParameter(
1275                        err.msg,
1276                    ))
1277                }
1278                "ResourceNotFoundException" => {
1279                    return RusotoError::Service(StreamJournalToKinesisError::ResourceNotFound(
1280                        err.msg,
1281                    ))
1282                }
1283                "ResourcePreconditionNotMetException" => {
1284                    return RusotoError::Service(
1285                        StreamJournalToKinesisError::ResourcePreconditionNotMet(err.msg),
1286                    )
1287                }
1288                "ValidationException" => return RusotoError::Validation(err.msg),
1289                _ => {}
1290            }
1291        }
1292        RusotoError::Unknown(res)
1293    }
1294}
1295impl fmt::Display for StreamJournalToKinesisError {
1296    #[allow(unused_variables)]
1297    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1298        match *self {
1299            StreamJournalToKinesisError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1300            StreamJournalToKinesisError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1301            StreamJournalToKinesisError::ResourcePreconditionNotMet(ref cause) => {
1302                write!(f, "{}", cause)
1303            }
1304        }
1305    }
1306}
1307impl Error for StreamJournalToKinesisError {}
1308/// Errors returned by TagResource
1309#[derive(Debug, PartialEq)]
1310pub enum TagResourceError {
1311    /// <p>One or more parameters in the request aren't valid.</p>
1312    InvalidParameter(String),
1313    /// <p>The specified resource doesn't exist.</p>
1314    ResourceNotFound(String),
1315}
1316
1317impl TagResourceError {
1318    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagResourceError> {
1319        if let Some(err) = proto::json::Error::parse_rest(&res) {
1320            match err.typ.as_str() {
1321                "InvalidParameterException" => {
1322                    return RusotoError::Service(TagResourceError::InvalidParameter(err.msg))
1323                }
1324                "ResourceNotFoundException" => {
1325                    return RusotoError::Service(TagResourceError::ResourceNotFound(err.msg))
1326                }
1327                "ValidationException" => return RusotoError::Validation(err.msg),
1328                _ => {}
1329            }
1330        }
1331        RusotoError::Unknown(res)
1332    }
1333}
1334impl fmt::Display for TagResourceError {
1335    #[allow(unused_variables)]
1336    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1337        match *self {
1338            TagResourceError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1339            TagResourceError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1340        }
1341    }
1342}
1343impl Error for TagResourceError {}
1344/// Errors returned by UntagResource
1345#[derive(Debug, PartialEq)]
1346pub enum UntagResourceError {
1347    /// <p>One or more parameters in the request aren't valid.</p>
1348    InvalidParameter(String),
1349    /// <p>The specified resource doesn't exist.</p>
1350    ResourceNotFound(String),
1351}
1352
1353impl UntagResourceError {
1354    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagResourceError> {
1355        if let Some(err) = proto::json::Error::parse_rest(&res) {
1356            match err.typ.as_str() {
1357                "InvalidParameterException" => {
1358                    return RusotoError::Service(UntagResourceError::InvalidParameter(err.msg))
1359                }
1360                "ResourceNotFoundException" => {
1361                    return RusotoError::Service(UntagResourceError::ResourceNotFound(err.msg))
1362                }
1363                "ValidationException" => return RusotoError::Validation(err.msg),
1364                _ => {}
1365            }
1366        }
1367        RusotoError::Unknown(res)
1368    }
1369}
1370impl fmt::Display for UntagResourceError {
1371    #[allow(unused_variables)]
1372    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1373        match *self {
1374            UntagResourceError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1375            UntagResourceError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1376        }
1377    }
1378}
1379impl Error for UntagResourceError {}
1380/// Errors returned by UpdateLedger
1381#[derive(Debug, PartialEq)]
1382pub enum UpdateLedgerError {
1383    /// <p>One or more parameters in the request aren't valid.</p>
1384    InvalidParameter(String),
1385    /// <p>The specified resource doesn't exist.</p>
1386    ResourceNotFound(String),
1387}
1388
1389impl UpdateLedgerError {
1390    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateLedgerError> {
1391        if let Some(err) = proto::json::Error::parse_rest(&res) {
1392            match err.typ.as_str() {
1393                "InvalidParameterException" => {
1394                    return RusotoError::Service(UpdateLedgerError::InvalidParameter(err.msg))
1395                }
1396                "ResourceNotFoundException" => {
1397                    return RusotoError::Service(UpdateLedgerError::ResourceNotFound(err.msg))
1398                }
1399                "ValidationException" => return RusotoError::Validation(err.msg),
1400                _ => {}
1401            }
1402        }
1403        RusotoError::Unknown(res)
1404    }
1405}
1406impl fmt::Display for UpdateLedgerError {
1407    #[allow(unused_variables)]
1408    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1409        match *self {
1410            UpdateLedgerError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1411            UpdateLedgerError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1412        }
1413    }
1414}
1415impl Error for UpdateLedgerError {}
1416/// Trait representing the capabilities of the QLDB API. QLDB clients implement this trait.
1417#[async_trait]
1418pub trait Qldb {
1419    /// <p>Ends a given Amazon QLDB journal stream. Before a stream can be canceled, its current status must be <code>ACTIVE</code>.</p> <p>You can't restart a stream after you cancel it. Canceled QLDB stream resources are subject to a 7-day retention period, so they are automatically deleted after this limit expires.</p>
1420    async fn cancel_journal_kinesis_stream(
1421        &self,
1422        input: CancelJournalKinesisStreamRequest,
1423    ) -> Result<CancelJournalKinesisStreamResponse, RusotoError<CancelJournalKinesisStreamError>>;
1424
1425    /// <p>Creates a new ledger in your AWS account.</p>
1426    async fn create_ledger(
1427        &self,
1428        input: CreateLedgerRequest,
1429    ) -> Result<CreateLedgerResponse, RusotoError<CreateLedgerError>>;
1430
1431    /// <p>Deletes a ledger and all of its contents. This action is irreversible.</p> <p>If deletion protection is enabled, you must first disable it before you can delete the ledger using the QLDB API or the AWS Command Line Interface (AWS CLI). You can disable it by calling the <code>UpdateLedger</code> operation to set the flag to <code>false</code>. The QLDB console disables deletion protection for you when you use it to delete a ledger.</p>
1432    async fn delete_ledger(
1433        &self,
1434        input: DeleteLedgerRequest,
1435    ) -> Result<(), RusotoError<DeleteLedgerError>>;
1436
1437    /// <p>Returns detailed information about a given Amazon QLDB journal stream. The output includes the Amazon Resource Name (ARN), stream name, current status, creation time, and the parameters of your original stream creation request.</p>
1438    async fn describe_journal_kinesis_stream(
1439        &self,
1440        input: DescribeJournalKinesisStreamRequest,
1441    ) -> Result<DescribeJournalKinesisStreamResponse, RusotoError<DescribeJournalKinesisStreamError>>;
1442
1443    /// <p>Returns information about a journal export job, including the ledger name, export ID, when it was created, current status, and its start and end time export parameters.</p> <p>This action does not return any expired export jobs. For more information, see <a href="https://docs.aws.amazon.com/qldb/latest/developerguide/export-journal.request.html#export-journal.request.expiration">Export Job Expiration</a> in the <i>Amazon QLDB Developer Guide</i>.</p> <p>If the export job with the given <code>ExportId</code> doesn't exist, then throws <code>ResourceNotFoundException</code>.</p> <p>If the ledger with the given <code>Name</code> doesn't exist, then throws <code>ResourceNotFoundException</code>.</p>
1444    async fn describe_journal_s3_export(
1445        &self,
1446        input: DescribeJournalS3ExportRequest,
1447    ) -> Result<DescribeJournalS3ExportResponse, RusotoError<DescribeJournalS3ExportError>>;
1448
1449    /// <p>Returns information about a ledger, including its state and when it was created.</p>
1450    async fn describe_ledger(
1451        &self,
1452        input: DescribeLedgerRequest,
1453    ) -> Result<DescribeLedgerResponse, RusotoError<DescribeLedgerError>>;
1454
1455    /// <p>Exports journal contents within a date and time range from a ledger into a specified Amazon Simple Storage Service (Amazon S3) bucket. The data is written as files in Amazon Ion format.</p> <p>If the ledger with the given <code>Name</code> doesn't exist, then throws <code>ResourceNotFoundException</code>.</p> <p>If the ledger with the given <code>Name</code> is in <code>CREATING</code> status, then throws <code>ResourcePreconditionNotMetException</code>.</p> <p>You can initiate up to two concurrent journal export requests for each ledger. Beyond this limit, journal export requests throw <code>LimitExceededException</code>.</p>
1456    async fn export_journal_to_s3(
1457        &self,
1458        input: ExportJournalToS3Request,
1459    ) -> Result<ExportJournalToS3Response, RusotoError<ExportJournalToS3Error>>;
1460
1461    /// <p>Returns a block object at a specified address in a journal. Also returns a proof of the specified block for verification if <code>DigestTipAddress</code> is provided.</p> <p>For information about the data contents in a block, see <a href="https://docs.aws.amazon.com/qldb/latest/developerguide/journal-contents.html">Journal contents</a> in the <i>Amazon QLDB Developer Guide</i>.</p> <p>If the specified ledger doesn't exist or is in <code>DELETING</code> status, then throws <code>ResourceNotFoundException</code>.</p> <p>If the specified ledger is in <code>CREATING</code> status, then throws <code>ResourcePreconditionNotMetException</code>.</p> <p>If no block exists with the specified address, then throws <code>InvalidParameterException</code>.</p>
1462    async fn get_block(
1463        &self,
1464        input: GetBlockRequest,
1465    ) -> Result<GetBlockResponse, RusotoError<GetBlockError>>;
1466
1467    /// <p>Returns the digest of a ledger at the latest committed block in the journal. The response includes a 256-bit hash value and a block address.</p>
1468    async fn get_digest(
1469        &self,
1470        input: GetDigestRequest,
1471    ) -> Result<GetDigestResponse, RusotoError<GetDigestError>>;
1472
1473    /// <p>Returns a revision data object for a specified document ID and block address. Also returns a proof of the specified revision for verification if <code>DigestTipAddress</code> is provided.</p>
1474    async fn get_revision(
1475        &self,
1476        input: GetRevisionRequest,
1477    ) -> Result<GetRevisionResponse, RusotoError<GetRevisionError>>;
1478
1479    /// <p>Returns an array of all Amazon QLDB journal stream descriptors for a given ledger. The output of each stream descriptor includes the same details that are returned by <code>DescribeJournalKinesisStream</code>.</p> <p>This action returns a maximum of <code>MaxResults</code> items. It is paginated so that you can retrieve all the items by calling <code>ListJournalKinesisStreamsForLedger</code> multiple times.</p>
1480    async fn list_journal_kinesis_streams_for_ledger(
1481        &self,
1482        input: ListJournalKinesisStreamsForLedgerRequest,
1483    ) -> Result<
1484        ListJournalKinesisStreamsForLedgerResponse,
1485        RusotoError<ListJournalKinesisStreamsForLedgerError>,
1486    >;
1487
1488    /// <p>Returns an array of journal export job descriptions for all ledgers that are associated with the current AWS account and Region.</p> <p>This action returns a maximum of <code>MaxResults</code> items, and is paginated so that you can retrieve all the items by calling <code>ListJournalS3Exports</code> multiple times.</p> <p>This action does not return any expired export jobs. For more information, see <a href="https://docs.aws.amazon.com/qldb/latest/developerguide/export-journal.request.html#export-journal.request.expiration">Export Job Expiration</a> in the <i>Amazon QLDB Developer Guide</i>.</p>
1489    async fn list_journal_s3_exports(
1490        &self,
1491        input: ListJournalS3ExportsRequest,
1492    ) -> Result<ListJournalS3ExportsResponse, RusotoError<ListJournalS3ExportsError>>;
1493
1494    /// <p>Returns an array of journal export job descriptions for a specified ledger.</p> <p>This action returns a maximum of <code>MaxResults</code> items, and is paginated so that you can retrieve all the items by calling <code>ListJournalS3ExportsForLedger</code> multiple times.</p> <p>This action does not return any expired export jobs. For more information, see <a href="https://docs.aws.amazon.com/qldb/latest/developerguide/export-journal.request.html#export-journal.request.expiration">Export Job Expiration</a> in the <i>Amazon QLDB Developer Guide</i>.</p>
1495    async fn list_journal_s3_exports_for_ledger(
1496        &self,
1497        input: ListJournalS3ExportsForLedgerRequest,
1498    ) -> Result<
1499        ListJournalS3ExportsForLedgerResponse,
1500        RusotoError<ListJournalS3ExportsForLedgerError>,
1501    >;
1502
1503    /// <p>Returns an array of ledger summaries that are associated with the current AWS account and Region.</p> <p>This action returns a maximum of 100 items and is paginated so that you can retrieve all the items by calling <code>ListLedgers</code> multiple times.</p>
1504    async fn list_ledgers(
1505        &self,
1506        input: ListLedgersRequest,
1507    ) -> Result<ListLedgersResponse, RusotoError<ListLedgersError>>;
1508
1509    /// <p>Returns all tags for a specified Amazon QLDB resource.</p>
1510    async fn list_tags_for_resource(
1511        &self,
1512        input: ListTagsForResourceRequest,
1513    ) -> Result<ListTagsForResourceResponse, RusotoError<ListTagsForResourceError>>;
1514
1515    /// <p>Creates a journal stream for a given Amazon QLDB ledger. The stream captures every document revision that is committed to the ledger's journal and delivers the data to a specified Amazon Kinesis Data Streams resource.</p>
1516    async fn stream_journal_to_kinesis(
1517        &self,
1518        input: StreamJournalToKinesisRequest,
1519    ) -> Result<StreamJournalToKinesisResponse, RusotoError<StreamJournalToKinesisError>>;
1520
1521    /// <p>Adds one or more tags to a specified Amazon QLDB resource.</p> <p>A resource can have up to 50 tags. If you try to create more than 50 tags for a resource, your request fails and returns an error.</p>
1522    async fn tag_resource(
1523        &self,
1524        input: TagResourceRequest,
1525    ) -> Result<TagResourceResponse, RusotoError<TagResourceError>>;
1526
1527    /// <p>Removes one or more tags from a specified Amazon QLDB resource. You can specify up to 50 tag keys to remove.</p>
1528    async fn untag_resource(
1529        &self,
1530        input: UntagResourceRequest,
1531    ) -> Result<UntagResourceResponse, RusotoError<UntagResourceError>>;
1532
1533    /// <p>Updates properties on a ledger.</p>
1534    async fn update_ledger(
1535        &self,
1536        input: UpdateLedgerRequest,
1537    ) -> Result<UpdateLedgerResponse, RusotoError<UpdateLedgerError>>;
1538}
1539/// A client for the QLDB API.
1540#[derive(Clone)]
1541pub struct QldbClient {
1542    client: Client,
1543    region: region::Region,
1544}
1545
1546impl QldbClient {
1547    /// Creates a client backed by the default tokio event loop.
1548    ///
1549    /// The client will use the default credentials provider and tls client.
1550    pub fn new(region: region::Region) -> QldbClient {
1551        QldbClient {
1552            client: Client::shared(),
1553            region,
1554        }
1555    }
1556
1557    pub fn new_with<P, D>(
1558        request_dispatcher: D,
1559        credentials_provider: P,
1560        region: region::Region,
1561    ) -> QldbClient
1562    where
1563        P: ProvideAwsCredentials + Send + Sync + 'static,
1564        D: DispatchSignedRequest + Send + Sync + 'static,
1565    {
1566        QldbClient {
1567            client: Client::new_with(credentials_provider, request_dispatcher),
1568            region,
1569        }
1570    }
1571
1572    pub fn new_with_client(client: Client, region: region::Region) -> QldbClient {
1573        QldbClient { client, region }
1574    }
1575}
1576
1577#[async_trait]
1578impl Qldb for QldbClient {
1579    /// <p>Ends a given Amazon QLDB journal stream. Before a stream can be canceled, its current status must be <code>ACTIVE</code>.</p> <p>You can't restart a stream after you cancel it. Canceled QLDB stream resources are subject to a 7-day retention period, so they are automatically deleted after this limit expires.</p>
1580    #[allow(unused_mut)]
1581    async fn cancel_journal_kinesis_stream(
1582        &self,
1583        input: CancelJournalKinesisStreamRequest,
1584    ) -> Result<CancelJournalKinesisStreamResponse, RusotoError<CancelJournalKinesisStreamError>>
1585    {
1586        let request_uri = format!(
1587            "/ledgers/{name}/journal-kinesis-streams/{stream_id}",
1588            name = input.ledger_name,
1589            stream_id = input.stream_id
1590        );
1591
1592        let mut request = SignedRequest::new("DELETE", "qldb", &self.region, &request_uri);
1593        request.set_content_type("application/x-amz-json-1.1".to_owned());
1594
1595        let mut response = self
1596            .client
1597            .sign_and_dispatch(request)
1598            .await
1599            .map_err(RusotoError::from)?;
1600        if response.status.is_success() {
1601            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1602            let result = proto::json::ResponsePayload::new(&response)
1603                .deserialize::<CancelJournalKinesisStreamResponse, _>()?;
1604
1605            Ok(result)
1606        } else {
1607            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1608            Err(CancelJournalKinesisStreamError::from_response(response))
1609        }
1610    }
1611
1612    /// <p>Creates a new ledger in your AWS account.</p>
1613    #[allow(unused_mut)]
1614    async fn create_ledger(
1615        &self,
1616        input: CreateLedgerRequest,
1617    ) -> Result<CreateLedgerResponse, RusotoError<CreateLedgerError>> {
1618        let request_uri = "/ledgers";
1619
1620        let mut request = SignedRequest::new("POST", "qldb", &self.region, &request_uri);
1621        request.set_content_type("application/x-amz-json-1.1".to_owned());
1622
1623        let encoded = Some(serde_json::to_vec(&input).unwrap());
1624        request.set_payload(encoded);
1625
1626        let mut response = self
1627            .client
1628            .sign_and_dispatch(request)
1629            .await
1630            .map_err(RusotoError::from)?;
1631        if response.status.is_success() {
1632            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1633            let result = proto::json::ResponsePayload::new(&response)
1634                .deserialize::<CreateLedgerResponse, _>()?;
1635
1636            Ok(result)
1637        } else {
1638            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1639            Err(CreateLedgerError::from_response(response))
1640        }
1641    }
1642
1643    /// <p>Deletes a ledger and all of its contents. This action is irreversible.</p> <p>If deletion protection is enabled, you must first disable it before you can delete the ledger using the QLDB API or the AWS Command Line Interface (AWS CLI). You can disable it by calling the <code>UpdateLedger</code> operation to set the flag to <code>false</code>. The QLDB console disables deletion protection for you when you use it to delete a ledger.</p>
1644    #[allow(unused_mut)]
1645    async fn delete_ledger(
1646        &self,
1647        input: DeleteLedgerRequest,
1648    ) -> Result<(), RusotoError<DeleteLedgerError>> {
1649        let request_uri = format!("/ledgers/{name}", name = input.name);
1650
1651        let mut request = SignedRequest::new("DELETE", "qldb", &self.region, &request_uri);
1652        request.set_content_type("application/x-amz-json-1.1".to_owned());
1653
1654        let mut response = self
1655            .client
1656            .sign_and_dispatch(request)
1657            .await
1658            .map_err(RusotoError::from)?;
1659        if response.status.is_success() {
1660            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1661            let result = ::std::mem::drop(response);
1662
1663            Ok(result)
1664        } else {
1665            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1666            Err(DeleteLedgerError::from_response(response))
1667        }
1668    }
1669
1670    /// <p>Returns detailed information about a given Amazon QLDB journal stream. The output includes the Amazon Resource Name (ARN), stream name, current status, creation time, and the parameters of your original stream creation request.</p>
1671    #[allow(unused_mut)]
1672    async fn describe_journal_kinesis_stream(
1673        &self,
1674        input: DescribeJournalKinesisStreamRequest,
1675    ) -> Result<DescribeJournalKinesisStreamResponse, RusotoError<DescribeJournalKinesisStreamError>>
1676    {
1677        let request_uri = format!(
1678            "/ledgers/{name}/journal-kinesis-streams/{stream_id}",
1679            name = input.ledger_name,
1680            stream_id = input.stream_id
1681        );
1682
1683        let mut request = SignedRequest::new("GET", "qldb", &self.region, &request_uri);
1684        request.set_content_type("application/x-amz-json-1.1".to_owned());
1685
1686        let mut response = self
1687            .client
1688            .sign_and_dispatch(request)
1689            .await
1690            .map_err(RusotoError::from)?;
1691        if response.status.is_success() {
1692            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1693            let result = proto::json::ResponsePayload::new(&response)
1694                .deserialize::<DescribeJournalKinesisStreamResponse, _>()?;
1695
1696            Ok(result)
1697        } else {
1698            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1699            Err(DescribeJournalKinesisStreamError::from_response(response))
1700        }
1701    }
1702
1703    /// <p>Returns information about a journal export job, including the ledger name, export ID, when it was created, current status, and its start and end time export parameters.</p> <p>This action does not return any expired export jobs. For more information, see <a href="https://docs.aws.amazon.com/qldb/latest/developerguide/export-journal.request.html#export-journal.request.expiration">Export Job Expiration</a> in the <i>Amazon QLDB Developer Guide</i>.</p> <p>If the export job with the given <code>ExportId</code> doesn't exist, then throws <code>ResourceNotFoundException</code>.</p> <p>If the ledger with the given <code>Name</code> doesn't exist, then throws <code>ResourceNotFoundException</code>.</p>
1704    #[allow(unused_mut)]
1705    async fn describe_journal_s3_export(
1706        &self,
1707        input: DescribeJournalS3ExportRequest,
1708    ) -> Result<DescribeJournalS3ExportResponse, RusotoError<DescribeJournalS3ExportError>> {
1709        let request_uri = format!(
1710            "/ledgers/{name}/journal-s3-exports/{export_id}",
1711            export_id = input.export_id,
1712            name = input.name
1713        );
1714
1715        let mut request = SignedRequest::new("GET", "qldb", &self.region, &request_uri);
1716        request.set_content_type("application/x-amz-json-1.1".to_owned());
1717
1718        let mut response = self
1719            .client
1720            .sign_and_dispatch(request)
1721            .await
1722            .map_err(RusotoError::from)?;
1723        if response.status.is_success() {
1724            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1725            let result = proto::json::ResponsePayload::new(&response)
1726                .deserialize::<DescribeJournalS3ExportResponse, _>()?;
1727
1728            Ok(result)
1729        } else {
1730            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1731            Err(DescribeJournalS3ExportError::from_response(response))
1732        }
1733    }
1734
1735    /// <p>Returns information about a ledger, including its state and when it was created.</p>
1736    #[allow(unused_mut)]
1737    async fn describe_ledger(
1738        &self,
1739        input: DescribeLedgerRequest,
1740    ) -> Result<DescribeLedgerResponse, RusotoError<DescribeLedgerError>> {
1741        let request_uri = format!("/ledgers/{name}", name = input.name);
1742
1743        let mut request = SignedRequest::new("GET", "qldb", &self.region, &request_uri);
1744        request.set_content_type("application/x-amz-json-1.1".to_owned());
1745
1746        let mut response = self
1747            .client
1748            .sign_and_dispatch(request)
1749            .await
1750            .map_err(RusotoError::from)?;
1751        if response.status.is_success() {
1752            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1753            let result = proto::json::ResponsePayload::new(&response)
1754                .deserialize::<DescribeLedgerResponse, _>()?;
1755
1756            Ok(result)
1757        } else {
1758            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1759            Err(DescribeLedgerError::from_response(response))
1760        }
1761    }
1762
1763    /// <p>Exports journal contents within a date and time range from a ledger into a specified Amazon Simple Storage Service (Amazon S3) bucket. The data is written as files in Amazon Ion format.</p> <p>If the ledger with the given <code>Name</code> doesn't exist, then throws <code>ResourceNotFoundException</code>.</p> <p>If the ledger with the given <code>Name</code> is in <code>CREATING</code> status, then throws <code>ResourcePreconditionNotMetException</code>.</p> <p>You can initiate up to two concurrent journal export requests for each ledger. Beyond this limit, journal export requests throw <code>LimitExceededException</code>.</p>
1764    #[allow(unused_mut)]
1765    async fn export_journal_to_s3(
1766        &self,
1767        input: ExportJournalToS3Request,
1768    ) -> Result<ExportJournalToS3Response, RusotoError<ExportJournalToS3Error>> {
1769        let request_uri = format!("/ledgers/{name}/journal-s3-exports", name = input.name);
1770
1771        let mut request = SignedRequest::new("POST", "qldb", &self.region, &request_uri);
1772        request.set_content_type("application/x-amz-json-1.1".to_owned());
1773
1774        let encoded = Some(serde_json::to_vec(&input).unwrap());
1775        request.set_payload(encoded);
1776
1777        let mut response = self
1778            .client
1779            .sign_and_dispatch(request)
1780            .await
1781            .map_err(RusotoError::from)?;
1782        if response.status.is_success() {
1783            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1784            let result = proto::json::ResponsePayload::new(&response)
1785                .deserialize::<ExportJournalToS3Response, _>()?;
1786
1787            Ok(result)
1788        } else {
1789            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1790            Err(ExportJournalToS3Error::from_response(response))
1791        }
1792    }
1793
1794    /// <p>Returns a block object at a specified address in a journal. Also returns a proof of the specified block for verification if <code>DigestTipAddress</code> is provided.</p> <p>For information about the data contents in a block, see <a href="https://docs.aws.amazon.com/qldb/latest/developerguide/journal-contents.html">Journal contents</a> in the <i>Amazon QLDB Developer Guide</i>.</p> <p>If the specified ledger doesn't exist or is in <code>DELETING</code> status, then throws <code>ResourceNotFoundException</code>.</p> <p>If the specified ledger is in <code>CREATING</code> status, then throws <code>ResourcePreconditionNotMetException</code>.</p> <p>If no block exists with the specified address, then throws <code>InvalidParameterException</code>.</p>
1795    #[allow(unused_mut)]
1796    async fn get_block(
1797        &self,
1798        input: GetBlockRequest,
1799    ) -> Result<GetBlockResponse, RusotoError<GetBlockError>> {
1800        let request_uri = format!("/ledgers/{name}/block", name = input.name);
1801
1802        let mut request = SignedRequest::new("POST", "qldb", &self.region, &request_uri);
1803        request.set_content_type("application/x-amz-json-1.1".to_owned());
1804
1805        let encoded = Some(serde_json::to_vec(&input).unwrap());
1806        request.set_payload(encoded);
1807
1808        let mut response = self
1809            .client
1810            .sign_and_dispatch(request)
1811            .await
1812            .map_err(RusotoError::from)?;
1813        if response.status.is_success() {
1814            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1815            let result = proto::json::ResponsePayload::new(&response)
1816                .deserialize::<GetBlockResponse, _>()?;
1817
1818            Ok(result)
1819        } else {
1820            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1821            Err(GetBlockError::from_response(response))
1822        }
1823    }
1824
1825    /// <p>Returns the digest of a ledger at the latest committed block in the journal. The response includes a 256-bit hash value and a block address.</p>
1826    #[allow(unused_mut)]
1827    async fn get_digest(
1828        &self,
1829        input: GetDigestRequest,
1830    ) -> Result<GetDigestResponse, RusotoError<GetDigestError>> {
1831        let request_uri = format!("/ledgers/{name}/digest", name = input.name);
1832
1833        let mut request = SignedRequest::new("POST", "qldb", &self.region, &request_uri);
1834        request.set_content_type("application/x-amz-json-1.1".to_owned());
1835
1836        let mut response = self
1837            .client
1838            .sign_and_dispatch(request)
1839            .await
1840            .map_err(RusotoError::from)?;
1841        if response.status.is_success() {
1842            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1843            let result = proto::json::ResponsePayload::new(&response)
1844                .deserialize::<GetDigestResponse, _>()?;
1845
1846            Ok(result)
1847        } else {
1848            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1849            Err(GetDigestError::from_response(response))
1850        }
1851    }
1852
1853    /// <p>Returns a revision data object for a specified document ID and block address. Also returns a proof of the specified revision for verification if <code>DigestTipAddress</code> is provided.</p>
1854    #[allow(unused_mut)]
1855    async fn get_revision(
1856        &self,
1857        input: GetRevisionRequest,
1858    ) -> Result<GetRevisionResponse, RusotoError<GetRevisionError>> {
1859        let request_uri = format!("/ledgers/{name}/revision", name = input.name);
1860
1861        let mut request = SignedRequest::new("POST", "qldb", &self.region, &request_uri);
1862        request.set_content_type("application/x-amz-json-1.1".to_owned());
1863
1864        let encoded = Some(serde_json::to_vec(&input).unwrap());
1865        request.set_payload(encoded);
1866
1867        let mut response = self
1868            .client
1869            .sign_and_dispatch(request)
1870            .await
1871            .map_err(RusotoError::from)?;
1872        if response.status.is_success() {
1873            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1874            let result = proto::json::ResponsePayload::new(&response)
1875                .deserialize::<GetRevisionResponse, _>()?;
1876
1877            Ok(result)
1878        } else {
1879            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1880            Err(GetRevisionError::from_response(response))
1881        }
1882    }
1883
1884    /// <p>Returns an array of all Amazon QLDB journal stream descriptors for a given ledger. The output of each stream descriptor includes the same details that are returned by <code>DescribeJournalKinesisStream</code>.</p> <p>This action returns a maximum of <code>MaxResults</code> items. It is paginated so that you can retrieve all the items by calling <code>ListJournalKinesisStreamsForLedger</code> multiple times.</p>
1885    #[allow(unused_mut)]
1886    async fn list_journal_kinesis_streams_for_ledger(
1887        &self,
1888        input: ListJournalKinesisStreamsForLedgerRequest,
1889    ) -> Result<
1890        ListJournalKinesisStreamsForLedgerResponse,
1891        RusotoError<ListJournalKinesisStreamsForLedgerError>,
1892    > {
1893        let request_uri = format!(
1894            "/ledgers/{name}/journal-kinesis-streams",
1895            name = input.ledger_name
1896        );
1897
1898        let mut request = SignedRequest::new("GET", "qldb", &self.region, &request_uri);
1899        request.set_content_type("application/x-amz-json-1.1".to_owned());
1900
1901        let mut params = Params::new();
1902        if let Some(ref x) = input.max_results {
1903            params.put("max_results", x);
1904        }
1905        if let Some(ref x) = input.next_token {
1906            params.put("next_token", x);
1907        }
1908        request.set_params(params);
1909
1910        let mut response = self
1911            .client
1912            .sign_and_dispatch(request)
1913            .await
1914            .map_err(RusotoError::from)?;
1915        if response.status.is_success() {
1916            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1917            let result = proto::json::ResponsePayload::new(&response)
1918                .deserialize::<ListJournalKinesisStreamsForLedgerResponse, _>()?;
1919
1920            Ok(result)
1921        } else {
1922            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1923            Err(ListJournalKinesisStreamsForLedgerError::from_response(
1924                response,
1925            ))
1926        }
1927    }
1928
1929    /// <p>Returns an array of journal export job descriptions for all ledgers that are associated with the current AWS account and Region.</p> <p>This action returns a maximum of <code>MaxResults</code> items, and is paginated so that you can retrieve all the items by calling <code>ListJournalS3Exports</code> multiple times.</p> <p>This action does not return any expired export jobs. For more information, see <a href="https://docs.aws.amazon.com/qldb/latest/developerguide/export-journal.request.html#export-journal.request.expiration">Export Job Expiration</a> in the <i>Amazon QLDB Developer Guide</i>.</p>
1930    #[allow(unused_mut)]
1931    async fn list_journal_s3_exports(
1932        &self,
1933        input: ListJournalS3ExportsRequest,
1934    ) -> Result<ListJournalS3ExportsResponse, RusotoError<ListJournalS3ExportsError>> {
1935        let request_uri = "/journal-s3-exports";
1936
1937        let mut request = SignedRequest::new("GET", "qldb", &self.region, &request_uri);
1938        request.set_content_type("application/x-amz-json-1.1".to_owned());
1939
1940        let mut params = Params::new();
1941        if let Some(ref x) = input.max_results {
1942            params.put("max_results", x);
1943        }
1944        if let Some(ref x) = input.next_token {
1945            params.put("next_token", x);
1946        }
1947        request.set_params(params);
1948
1949        let mut response = self
1950            .client
1951            .sign_and_dispatch(request)
1952            .await
1953            .map_err(RusotoError::from)?;
1954        if response.status.is_success() {
1955            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1956            let result = proto::json::ResponsePayload::new(&response)
1957                .deserialize::<ListJournalS3ExportsResponse, _>()?;
1958
1959            Ok(result)
1960        } else {
1961            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1962            Err(ListJournalS3ExportsError::from_response(response))
1963        }
1964    }
1965
1966    /// <p>Returns an array of journal export job descriptions for a specified ledger.</p> <p>This action returns a maximum of <code>MaxResults</code> items, and is paginated so that you can retrieve all the items by calling <code>ListJournalS3ExportsForLedger</code> multiple times.</p> <p>This action does not return any expired export jobs. For more information, see <a href="https://docs.aws.amazon.com/qldb/latest/developerguide/export-journal.request.html#export-journal.request.expiration">Export Job Expiration</a> in the <i>Amazon QLDB Developer Guide</i>.</p>
1967    #[allow(unused_mut)]
1968    async fn list_journal_s3_exports_for_ledger(
1969        &self,
1970        input: ListJournalS3ExportsForLedgerRequest,
1971    ) -> Result<
1972        ListJournalS3ExportsForLedgerResponse,
1973        RusotoError<ListJournalS3ExportsForLedgerError>,
1974    > {
1975        let request_uri = format!("/ledgers/{name}/journal-s3-exports", name = input.name);
1976
1977        let mut request = SignedRequest::new("GET", "qldb", &self.region, &request_uri);
1978        request.set_content_type("application/x-amz-json-1.1".to_owned());
1979
1980        let mut params = Params::new();
1981        if let Some(ref x) = input.max_results {
1982            params.put("max_results", x);
1983        }
1984        if let Some(ref x) = input.next_token {
1985            params.put("next_token", x);
1986        }
1987        request.set_params(params);
1988
1989        let mut response = self
1990            .client
1991            .sign_and_dispatch(request)
1992            .await
1993            .map_err(RusotoError::from)?;
1994        if response.status.is_success() {
1995            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1996            let result = proto::json::ResponsePayload::new(&response)
1997                .deserialize::<ListJournalS3ExportsForLedgerResponse, _>()?;
1998
1999            Ok(result)
2000        } else {
2001            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2002            Err(ListJournalS3ExportsForLedgerError::from_response(response))
2003        }
2004    }
2005
2006    /// <p>Returns an array of ledger summaries that are associated with the current AWS account and Region.</p> <p>This action returns a maximum of 100 items and is paginated so that you can retrieve all the items by calling <code>ListLedgers</code> multiple times.</p>
2007    #[allow(unused_mut)]
2008    async fn list_ledgers(
2009        &self,
2010        input: ListLedgersRequest,
2011    ) -> Result<ListLedgersResponse, RusotoError<ListLedgersError>> {
2012        let request_uri = "/ledgers";
2013
2014        let mut request = SignedRequest::new("GET", "qldb", &self.region, &request_uri);
2015        request.set_content_type("application/x-amz-json-1.1".to_owned());
2016
2017        let mut params = Params::new();
2018        if let Some(ref x) = input.max_results {
2019            params.put("max_results", x);
2020        }
2021        if let Some(ref x) = input.next_token {
2022            params.put("next_token", x);
2023        }
2024        request.set_params(params);
2025
2026        let mut response = self
2027            .client
2028            .sign_and_dispatch(request)
2029            .await
2030            .map_err(RusotoError::from)?;
2031        if response.status.is_success() {
2032            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2033            let result = proto::json::ResponsePayload::new(&response)
2034                .deserialize::<ListLedgersResponse, _>()?;
2035
2036            Ok(result)
2037        } else {
2038            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2039            Err(ListLedgersError::from_response(response))
2040        }
2041    }
2042
2043    /// <p>Returns all tags for a specified Amazon QLDB resource.</p>
2044    #[allow(unused_mut)]
2045    async fn list_tags_for_resource(
2046        &self,
2047        input: ListTagsForResourceRequest,
2048    ) -> Result<ListTagsForResourceResponse, RusotoError<ListTagsForResourceError>> {
2049        let request_uri = format!("/tags/{resource_arn}", resource_arn = input.resource_arn);
2050
2051        let mut request = SignedRequest::new("GET", "qldb", &self.region, &request_uri);
2052        request.set_content_type("application/x-amz-json-1.1".to_owned());
2053
2054        let mut response = self
2055            .client
2056            .sign_and_dispatch(request)
2057            .await
2058            .map_err(RusotoError::from)?;
2059        if response.status.is_success() {
2060            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2061            let result = proto::json::ResponsePayload::new(&response)
2062                .deserialize::<ListTagsForResourceResponse, _>()?;
2063
2064            Ok(result)
2065        } else {
2066            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2067            Err(ListTagsForResourceError::from_response(response))
2068        }
2069    }
2070
2071    /// <p>Creates a journal stream for a given Amazon QLDB ledger. The stream captures every document revision that is committed to the ledger's journal and delivers the data to a specified Amazon Kinesis Data Streams resource.</p>
2072    #[allow(unused_mut)]
2073    async fn stream_journal_to_kinesis(
2074        &self,
2075        input: StreamJournalToKinesisRequest,
2076    ) -> Result<StreamJournalToKinesisResponse, RusotoError<StreamJournalToKinesisError>> {
2077        let request_uri = format!(
2078            "/ledgers/{name}/journal-kinesis-streams",
2079            name = input.ledger_name
2080        );
2081
2082        let mut request = SignedRequest::new("POST", "qldb", &self.region, &request_uri);
2083        request.set_content_type("application/x-amz-json-1.1".to_owned());
2084
2085        let encoded = Some(serde_json::to_vec(&input).unwrap());
2086        request.set_payload(encoded);
2087
2088        let mut response = self
2089            .client
2090            .sign_and_dispatch(request)
2091            .await
2092            .map_err(RusotoError::from)?;
2093        if response.status.is_success() {
2094            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2095            let result = proto::json::ResponsePayload::new(&response)
2096                .deserialize::<StreamJournalToKinesisResponse, _>()?;
2097
2098            Ok(result)
2099        } else {
2100            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2101            Err(StreamJournalToKinesisError::from_response(response))
2102        }
2103    }
2104
2105    /// <p>Adds one or more tags to a specified Amazon QLDB resource.</p> <p>A resource can have up to 50 tags. If you try to create more than 50 tags for a resource, your request fails and returns an error.</p>
2106    #[allow(unused_mut)]
2107    async fn tag_resource(
2108        &self,
2109        input: TagResourceRequest,
2110    ) -> Result<TagResourceResponse, RusotoError<TagResourceError>> {
2111        let request_uri = format!("/tags/{resource_arn}", resource_arn = input.resource_arn);
2112
2113        let mut request = SignedRequest::new("POST", "qldb", &self.region, &request_uri);
2114        request.set_content_type("application/x-amz-json-1.1".to_owned());
2115
2116        let encoded = Some(serde_json::to_vec(&input).unwrap());
2117        request.set_payload(encoded);
2118
2119        let mut response = self
2120            .client
2121            .sign_and_dispatch(request)
2122            .await
2123            .map_err(RusotoError::from)?;
2124        if response.status.is_success() {
2125            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2126            let result = proto::json::ResponsePayload::new(&response)
2127                .deserialize::<TagResourceResponse, _>()?;
2128
2129            Ok(result)
2130        } else {
2131            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2132            Err(TagResourceError::from_response(response))
2133        }
2134    }
2135
2136    /// <p>Removes one or more tags from a specified Amazon QLDB resource. You can specify up to 50 tag keys to remove.</p>
2137    #[allow(unused_mut)]
2138    async fn untag_resource(
2139        &self,
2140        input: UntagResourceRequest,
2141    ) -> Result<UntagResourceResponse, RusotoError<UntagResourceError>> {
2142        let request_uri = format!("/tags/{resource_arn}", resource_arn = input.resource_arn);
2143
2144        let mut request = SignedRequest::new("DELETE", "qldb", &self.region, &request_uri);
2145        request.set_content_type("application/x-amz-json-1.1".to_owned());
2146
2147        let mut params = Params::new();
2148        for item in input.tag_keys.iter() {
2149            params.put("tagKeys", item);
2150        }
2151        request.set_params(params);
2152
2153        let mut response = self
2154            .client
2155            .sign_and_dispatch(request)
2156            .await
2157            .map_err(RusotoError::from)?;
2158        if response.status.is_success() {
2159            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2160            let result = proto::json::ResponsePayload::new(&response)
2161                .deserialize::<UntagResourceResponse, _>()?;
2162
2163            Ok(result)
2164        } else {
2165            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2166            Err(UntagResourceError::from_response(response))
2167        }
2168    }
2169
2170    /// <p>Updates properties on a ledger.</p>
2171    #[allow(unused_mut)]
2172    async fn update_ledger(
2173        &self,
2174        input: UpdateLedgerRequest,
2175    ) -> Result<UpdateLedgerResponse, RusotoError<UpdateLedgerError>> {
2176        let request_uri = format!("/ledgers/{name}", name = input.name);
2177
2178        let mut request = SignedRequest::new("PATCH", "qldb", &self.region, &request_uri);
2179        request.set_content_type("application/x-amz-json-1.1".to_owned());
2180
2181        let encoded = Some(serde_json::to_vec(&input).unwrap());
2182        request.set_payload(encoded);
2183
2184        let mut response = self
2185            .client
2186            .sign_and_dispatch(request)
2187            .await
2188            .map_err(RusotoError::from)?;
2189        if response.status.is_success() {
2190            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2191            let result = proto::json::ResponsePayload::new(&response)
2192                .deserialize::<UpdateLedgerResponse, _>()?;
2193
2194            Ok(result)
2195        } else {
2196            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2197            Err(UpdateLedgerError::from_response(response))
2198        }
2199    }
2200}