aws_db_esdk/deps/com_amazonaws_dynamodb/conversions/query/
_query_response.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_dynamodb::operation::query::QueryOutput,
7) -> ::dafny_runtime::Rc<
8    crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::QueryOutput,
9> {
10    ::dafny_runtime::Rc::new(crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::QueryOutput::QueryOutput {
11        Items: ::dafny_runtime::Rc::new(match &value.items {
12    Some(x) => crate::r#_Wrappers_Compile::Option::Some { value :
13        ::dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(x,
14            |e| ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(&e.clone(),
15    |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k),
16    |v| crate::deps::com_amazonaws_dynamodb::conversions::attribute_value::to_dafny(v)
17,
18)
19,
20        )
21    },
22    None => crate::r#_Wrappers_Compile::Option::None {}
23})
24,
25 Count: crate::standard_library_conversions::oint_to_dafny(Some(value.count)),
26 ScannedCount: crate::standard_library_conversions::oint_to_dafny(Some(value.scanned_count)),
27 LastEvaluatedKey:
28::dafny_runtime::Rc::new(match &value.last_evaluated_key {
29    Some(x) => crate::r#_Wrappers_Compile::Option::Some { value :
30        ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x,
31            |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k),
32            |v| crate::deps::com_amazonaws_dynamodb::conversions::attribute_value::to_dafny(v)
33,
34        )
35    },
36    None => crate::r#_Wrappers_Compile::Option::None {}
37})
38,
39 ConsumedCapacity: ::dafny_runtime::Rc::new(match &value.consumed_capacity {
40    Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::deps::com_amazonaws_dynamodb::conversions::consumed_capacity::to_dafny(x) },
41    None => crate::_Wrappers_Compile::Option::None { }
42})
43,
44    })
45}
46#[allow(dead_code)]
47pub fn from_dafny(
48    dafny_value: ::dafny_runtime::Rc<
49        crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::QueryOutput,
50    >,
51) -> aws_sdk_dynamodb::operation::query::QueryOutput {
52    aws_sdk_dynamodb::operation::query::QueryOutput::builder()
53          .set_items(match (*dafny_value.Items()).as_ref() {
54    crate::r#_Wrappers_Compile::Option::Some { value } =>
55        Some(
56            ::dafny_runtime::dafny_runtime_conversions::dafny_sequence_to_vec(value,
57                |e: &::dafny_runtime::dafny_runtime_conversions::DafnyMap<::dafny_runtime::dafny_runtime_conversions::DafnySequence<::dafny_runtime::dafny_runtime_conversions::DafnyCharUTF16>, ::dafny_runtime::Rc<crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>| ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(&e,
58    |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),
59    |v: &::dafny_runtime::Rc<crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>| crate::deps::com_amazonaws_dynamodb::conversions::attribute_value::from_dafny(v.clone())
60,
61)
62,
63            )
64        ),
65    _ => None
66}
67)
68 .set_count(crate::standard_library_conversions::oint_from_dafny(dafny_value.Count().clone()))
69 .set_scanned_count(crate::standard_library_conversions::oint_from_dafny(dafny_value.ScannedCount().clone()))
70 .set_last_evaluated_key(match (*dafny_value.LastEvaluatedKey()).as_ref() {
71    crate::r#_Wrappers_Compile::Option::Some { value } =>
72        Some(
73            ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value,
74                |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),
75                |v: &::dafny_runtime::Rc<crate::r#software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>| crate::deps::com_amazonaws_dynamodb::conversions::attribute_value::from_dafny(v.clone())
76,
77            )
78        ),
79    _ => None
80}
81)
82 .set_consumed_capacity(match (*dafny_value.ConsumedCapacity()).as_ref() {
83    crate::r#_Wrappers_Compile::Option::Some { value } =>
84        Some(crate::deps::com_amazonaws_dynamodb::conversions::consumed_capacity::from_dafny(value.clone())),
85    _ => None,
86}
87)
88          .build()
89}