aws_db_esdk/operation/resolve_attributes/
builders.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.
4pub use crate::operation::resolve_attributes::_resolve_attributes_output::ResolveAttributesOutputBuilder;
5
6pub use crate::operation::resolve_attributes::_resolve_attributes_input::ResolveAttributesInputBuilder;
7
8impl ResolveAttributesInputBuilder {
9    /// Sends a request with this input using the given client.
10    pub async fn send_with(
11        self,
12        client: &crate::client::Client,
13    ) -> ::std::result::Result<
14        crate::operation::resolve_attributes::ResolveAttributesOutput,
15        crate::types::error::Error,
16    > {
17        let mut fluent_builder = client.resolve_attributes();
18        fluent_builder.inner = self;
19        fluent_builder.send().await
20    }
21}
22/// Fluent builder constructing a request to `ResolveAttributes`.
23///
24/// Given an Item, show the intermediate values (e.g. compound beacons, virtual fields).
25#[derive(::std::clone::Clone, ::std::fmt::Debug)]
26pub struct ResolveAttributesFluentBuilder {
27    client: crate::client::Client,
28    pub(crate) inner: crate::operation::resolve_attributes::builders::ResolveAttributesInputBuilder,
29}
30impl ResolveAttributesFluentBuilder {
31    /// Creates a new `ResolveAttributes`.
32    pub(crate) fn new(client: crate::client::Client) -> Self {
33        Self {
34            client,
35            inner: ::std::default::Default::default(),
36        }
37    }
38    /// Access the ResolveAttributes as a reference.
39    pub fn as_input(
40        &self,
41    ) -> &crate::operation::resolve_attributes::builders::ResolveAttributesInputBuilder {
42        &self.inner
43    }
44    /// Sends the request and returns the response.
45    pub async fn send(
46        self,
47    ) -> ::std::result::Result<
48        crate::operation::resolve_attributes::ResolveAttributesOutput,
49        crate::types::error::Error,
50    > {
51        let input = self
52            .inner
53            .build()
54            // Using Opaque since we don't have a validation-specific error yet.
55            // Operations' models don't declare their own validation error,
56            // and smithy-rs seems to not generate a ValidationError case unless there is.
57            // Vanilla smithy-rs uses SdkError::construction_failure, but we aren't using SdkError.
58            .map_err(|mut e| {
59                let msg = format!("{:?}", e);
60                crate::types::error::Error::OpaqueWithText {
61                    obj: ::dafny_runtime::Object::from_ref(&mut e as &mut ::dafny_runtime::DynAny),
62                    objMessage: msg,
63                }
64            })?;
65        crate::operation::resolve_attributes::ResolveAttributes::send(&self.client, input).await
66    }
67
68    /// The Item to be examined.
69    pub fn item(
70        mut self,
71        input: impl ::std::convert::Into<
72            ::std::collections::HashMap<
73                ::std::string::String,
74                aws_sdk_dynamodb::types::AttributeValue,
75            >,
76        >,
77    ) -> Self {
78        self.inner = self.inner.item(input.into());
79        self
80    }
81    /// The Item to be examined.
82    pub fn set_item(
83        mut self,
84        input: ::std::option::Option<
85            ::std::collections::HashMap<
86                ::std::string::String,
87                aws_sdk_dynamodb::types::AttributeValue,
88            >,
89        >,
90    ) -> Self {
91        self.inner = self.inner.set_item(input);
92        self
93    }
94    /// The Item to be examined.
95    pub fn get_item(
96        &self,
97    ) -> &::std::option::Option<
98        ::std::collections::HashMap<::std::string::String, aws_sdk_dynamodb::types::AttributeValue>,
99    > {
100        self.inner.get_item()
101    }
102    /// Use the config for this Table.
103    pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104        self.inner = self.inner.table_name(input.into());
105        self
106    }
107    /// Use the config for this Table.
108    pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.inner = self.inner.set_table_name(input);
110        self
111    }
112    /// Use the config for this Table.
113    pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
114        self.inner.get_table_name()
115    }
116    /// The beacon version to use. Defaults to 'writeVersion'.
117    pub fn version(mut self, input: impl ::std::convert::Into<::std::primitive::i32>) -> Self {
118        self.inner = self.inner.version(input.into());
119        self
120    }
121    /// The beacon version to use. Defaults to 'writeVersion'.
122    pub fn set_version(mut self, input: ::std::option::Option<::std::primitive::i32>) -> Self {
123        self.inner = self.inner.set_version(input);
124        self
125    }
126    /// The beacon version to use. Defaults to 'writeVersion'.
127    pub fn get_version(&self) -> &::std::option::Option<::std::primitive::i32> {
128        self.inner.get_version()
129    }
130}