aws_db_esdk/deps/aws_cryptography_dbEncryptionSdk_dynamoDb_itemEncryptor/
client.rs

1// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
2// SPDX-License-Identifier: Apache-2.0
3// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
4use aws_smithy_types::error::operation::BuildError;
5
6#[derive(::std::clone::Clone, ::std::fmt::Debug, ::std::cmp::PartialEq)]
7#[allow(missing_docs)]
8pub struct Client {
9    pub(crate) dafny_client: ::dafny_runtime::Object<dyn crate::r#software::amazon::cryptography::dbencryptionsdk::dynamodb::itemencryptor::internaldafny::types::IDynamoDbItemEncryptorClient>
10}
11
12impl Client {
13    /// Creates a new client from the service [`Config`](crate::Config).
14    #[track_caller]
15    pub fn from_conf(
16        input: crate::deps::aws_cryptography_dbEncryptionSdk_dynamoDb_itemEncryptor::types::dynamo_db_item_encryptor_config::DynamoDbItemEncryptorConfig,
17    ) -> Result<
18        Self,
19        crate::deps::aws_cryptography_dbEncryptionSdk_dynamoDb_itemEncryptor::types::error::Error,
20    > {
21        crate::deps::aws_cryptography_dbEncryptionSdk_dynamoDb_itemEncryptor::validation::validate_aws_Pcryptography_PdbEncryptionSdk_PdynamoDb_PitemEncryptor_HDynamoDbItemEncryptorConfig(&input)
22            .map_err(crate::deps::aws_cryptography_dbEncryptionSdk_dynamoDb_itemEncryptor::types::error::Error::wrap_validation_err)?;
23        let inner =
24            crate::software::amazon::cryptography::dbencryptionsdk::dynamodb::itemencryptor::internaldafny::_default::DynamoDbItemEncryptor(
25                &crate::deps::aws_cryptography_dbEncryptionSdk_dynamoDb_itemEncryptor::conversions::dynamo_db_item_encryptor_config::_dynamo_db_item_encryptor_config::to_dafny(input),
26            );
27        if matches!(
28            inner.as_ref(),
29            crate::_Wrappers_Compile::Result::Failure { .. }
30        ) {
31            return Err(crate::deps::aws_cryptography_dbEncryptionSdk_dynamoDb_itemEncryptor::conversions::error::from_dafny(inner.as_ref().error().clone()));
32        }
33        Ok(Self {
34            dafny_client: ::dafny_runtime::upcast_object()(inner.Extract()),
35        })
36    }
37}
38
39mod encrypt_item;
40
41mod decrypt_item;