aws_db_esdk/deps/com_amazonaws_kms/conversions/
grant_constraints.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#[allow(dead_code)]
5pub fn to_dafny(
6    value: &aws_sdk_kms::types::GrantConstraints,
7) -> ::dafny_runtime::Rc<
8    crate::r#software::amazon::cryptography::services::kms::internaldafny::types::GrantConstraints,
9> {
10    ::dafny_runtime::Rc::new(
11    crate::r#software::amazon::cryptography::services::kms::internaldafny::types::GrantConstraints::GrantConstraints {
12        EncryptionContextSubset:
13::dafny_runtime::Rc::new(match &value.encryption_context_subset {
14    Some(x) => crate::r#_Wrappers_Compile::Option::Some { value :
15        ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x,
16            |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k),
17            |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&v),
18        )
19    },
20    None => crate::r#_Wrappers_Compile::Option::None {}
21})
22,
23 EncryptionContextEquals:
24::dafny_runtime::Rc::new(match &value.encryption_context_equals {
25    Some(x) => crate::r#_Wrappers_Compile::Option::Some { value :
26        ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x,
27            |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k),
28            |v| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&v),
29        )
30    },
31    None => crate::r#_Wrappers_Compile::Option::None {}
32})
33,
34    }
35  )
36}
37#[allow(dead_code)]
38pub fn from_dafny(
39    dafny_value: ::dafny_runtime::Rc<
40        crate::r#software::amazon::cryptography::services::kms::internaldafny::types::GrantConstraints,
41    >,
42) -> aws_sdk_kms::types::GrantConstraints {
43    aws_sdk_kms::types::GrantConstraints::builder()
44          .set_encryption_context_subset(match (*dafny_value.EncryptionContextSubset()).as_ref() {
45    crate::r#_Wrappers_Compile::Option::Some { value } =>
46        Some(
47            ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value,
48                |k: &::dafny_runtime::dafny_runtime_conversions::DafnySequence<::dafny_runtime::dafny_runtime_conversions::DafnyCharUTF16>| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k),
49                |v: &::dafny_runtime::dafny_runtime_conversions::DafnySequence<::dafny_runtime::dafny_runtime_conversions::DafnyCharUTF16>| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(v),
50            )
51        ),
52    _ => None
53}
54)
55 .set_encryption_context_equals(match (*dafny_value.EncryptionContextEquals()).as_ref() {
56    crate::r#_Wrappers_Compile::Option::Some { value } =>
57        Some(
58            ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value,
59                |k: &::dafny_runtime::dafny_runtime_conversions::DafnySequence<::dafny_runtime::dafny_runtime_conversions::DafnyCharUTF16>| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k),
60                |v: &::dafny_runtime::dafny_runtime_conversions::DafnySequence<::dafny_runtime::dafny_runtime_conversions::DafnyCharUTF16>| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(v),
61            )
62        ),
63    _ => None
64}
65)
66          .build()
67}