aws_esdk/
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::encryptionsdk::internaldafny::types::IAwsEncryptionSdkClient>
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::types::aws_encryption_sdk_config::AwsEncryptionSdkConfig,
17    ) -> Result<Self, crate::types::error::Error> {
18        crate::validation::validate_aws_Pcryptography_PencryptionSdk_HAwsEncryptionSdkConfig(
19            &input,
20        )
21        .map_err(crate::types::error::Error::wrap_validation_err)?;
22        let inner =
23            crate::software::amazon::cryptography::encryptionsdk::internaldafny::_default::ESDK(
24                &crate::conversions::aws_encryption_sdk_config::_aws_encryption_sdk_config::to_dafny(input),
25            );
26        if matches!(
27            inner.as_ref(),
28            crate::_Wrappers_Compile::Result::Failure { .. }
29        ) {
30            return Err(crate::conversions::error::from_dafny(
31                inner.as_ref().error().clone(),
32            ));
33        }
34        Ok(Self {
35            dafny_client: ::dafny_runtime::upcast_object()(inner.Extract()),
36        })
37    }
38}
39
40mod encrypt;
41
42mod decrypt;