aws_db_esdk/deps/com_amazonaws_kms/conversions/
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.
4// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
5// SPDX-License-Identifier: Apache-2.0
6// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
7#[allow(dead_code)]
8use std::any::Any;
9
10pub fn to_dafny(
11    value: &crate::deps::com_amazonaws_kms::client::Client,
12) -> ::dafny_runtime::Object<
13    dyn crate::r#software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient,
14> {
15    let x: dafny_runtime::Rc<crate::deps::com_amazonaws_kms::client::Client> =
16        dafny_runtime::Rc::new(value.clone());
17    let y = x as dafny_runtime::Rc<dyn crate::r#software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient>;
18    unsafe { ::dafny_runtime::dafny_runtime_conversions::object::rc_struct_to_dafny_class(y) }
19}
20
21#[allow(dead_code)]
22pub fn from_dafny(
23    dafny_value: ::dafny_runtime::Object<
24      dyn crate::r#software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient
25    >,
26) -> crate::deps::com_amazonaws_kms::client::Client {
27    let as_boxed_any = dafny_runtime::cast_any_object!(dafny_value);
28    if (dafny_runtime::is_object!(as_boxed_any, crate::deps::com_amazonaws_kms::client::Client)) {
29        let as_boxed_client = ::dafny_runtime::object::downcast::<
30            crate::deps::com_amazonaws_kms::client::Client,
31        >(as_boxed_any);
32        unsafe {
33            ::dafny_runtime::dafny_runtime_conversions::object::dafny_class_to_rc_struct(
34                as_boxed_client,
35            )
36            .as_ref()
37            .clone()
38        }
39    } else {
40        panic!("Unexpected implementation of Dafny client interface");
41    }
42}