aws_sdk_iotthingsgraph/operation/get_entities/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_entities::_get_entities_output::GetEntitiesOutputBuilder;
3
4pub use crate::operation::get_entities::_get_entities_input::GetEntitiesInputBuilder;
5
6impl crate::operation::get_entities::builders::GetEntitiesInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::get_entities::GetEntitiesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_entities::GetEntitiesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_entities();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetEntities`.
24///
25/// <p>Gets definitions of the specified entities. Uses the latest version of the user's namespace by default. This API returns the following TDM entities.</p>
26/// <ul>
27/// <li>
28/// <p>Properties</p></li>
29/// <li>
30/// <p>States</p></li>
31/// <li>
32/// <p>Events</p></li>
33/// <li>
34/// <p>Actions</p></li>
35/// <li>
36/// <p>Capabilities</p></li>
37/// <li>
38/// <p>Mappings</p></li>
39/// <li>
40/// <p>Devices</p></li>
41/// <li>
42/// <p>Device Models</p></li>
43/// <li>
44/// <p>Services</p></li>
45/// </ul>
46/// <p>This action doesn't return definitions for systems, flows, and deployments.</p>
47#[deprecated(note = "since: 2022-08-30")]
48#[derive(::std::clone::Clone, ::std::fmt::Debug)]
49pub struct GetEntitiesFluentBuilder {
50    handle: ::std::sync::Arc<crate::client::Handle>,
51    inner: crate::operation::get_entities::builders::GetEntitiesInputBuilder,
52    config_override: ::std::option::Option<crate::config::Builder>,
53}
54impl
55    crate::client::customize::internal::CustomizableSend<
56        crate::operation::get_entities::GetEntitiesOutput,
57        crate::operation::get_entities::GetEntitiesError,
58    > for GetEntitiesFluentBuilder
59{
60    fn send(
61        self,
62        config_override: crate::config::Builder,
63    ) -> crate::client::customize::internal::BoxFuture<
64        crate::client::customize::internal::SendResult<
65            crate::operation::get_entities::GetEntitiesOutput,
66            crate::operation::get_entities::GetEntitiesError,
67        >,
68    > {
69        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
70    }
71}
72impl GetEntitiesFluentBuilder {
73    /// Creates a new `GetEntitiesFluentBuilder`.
74    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
75        Self {
76            handle,
77            inner: ::std::default::Default::default(),
78            config_override: ::std::option::Option::None,
79        }
80    }
81    /// Access the GetEntities as a reference.
82    pub fn as_input(&self) -> &crate::operation::get_entities::builders::GetEntitiesInputBuilder {
83        &self.inner
84    }
85    /// Sends the request and returns the response.
86    ///
87    /// If an error occurs, an `SdkError` will be returned with additional details that
88    /// can be matched against.
89    ///
90    /// By default, any retryable failures will be retried twice. Retry behavior
91    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
92    /// set when configuring the client.
93    pub async fn send(
94        self,
95    ) -> ::std::result::Result<
96        crate::operation::get_entities::GetEntitiesOutput,
97        ::aws_smithy_runtime_api::client::result::SdkError<
98            crate::operation::get_entities::GetEntitiesError,
99            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
100        >,
101    > {
102        let input = self
103            .inner
104            .build()
105            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
106        let runtime_plugins = crate::operation::get_entities::GetEntities::operation_runtime_plugins(
107            self.handle.runtime_plugins.clone(),
108            &self.handle.conf,
109            self.config_override,
110        );
111        crate::operation::get_entities::GetEntities::orchestrate(&runtime_plugins, input).await
112    }
113
114    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
115    pub fn customize(
116        self,
117    ) -> crate::client::customize::CustomizableOperation<
118        crate::operation::get_entities::GetEntitiesOutput,
119        crate::operation::get_entities::GetEntitiesError,
120        Self,
121    > {
122        crate::client::customize::CustomizableOperation::new(self)
123    }
124    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
125        self.set_config_override(::std::option::Option::Some(config_override.into()));
126        self
127    }
128
129    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
130        self.config_override = config_override;
131        self
132    }
133    ///
134    /// Appends an item to `ids`.
135    ///
136    /// To override the contents of this collection use [`set_ids`](Self::set_ids).
137    ///
138    /// <p>An array of entity IDs.</p>
139    /// <p>The IDs should be in the following format.</p>
140    /// <p><code>urn:tdm:REGION/ACCOUNT ID/default:device:DEVICENAME</code></p>
141    pub fn ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142        self.inner = self.inner.ids(input.into());
143        self
144    }
145    /// <p>An array of entity IDs.</p>
146    /// <p>The IDs should be in the following format.</p>
147    /// <p><code>urn:tdm:REGION/ACCOUNT ID/default:device:DEVICENAME</code></p>
148    pub fn set_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
149        self.inner = self.inner.set_ids(input);
150        self
151    }
152    /// <p>An array of entity IDs.</p>
153    /// <p>The IDs should be in the following format.</p>
154    /// <p><code>urn:tdm:REGION/ACCOUNT ID/default:device:DEVICENAME</code></p>
155    pub fn get_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
156        self.inner.get_ids()
157    }
158    /// <p>The version of the user's namespace. Defaults to the latest version of the user's namespace.</p>
159    pub fn namespace_version(mut self, input: i64) -> Self {
160        self.inner = self.inner.namespace_version(input);
161        self
162    }
163    /// <p>The version of the user's namespace. Defaults to the latest version of the user's namespace.</p>
164    pub fn set_namespace_version(mut self, input: ::std::option::Option<i64>) -> Self {
165        self.inner = self.inner.set_namespace_version(input);
166        self
167    }
168    /// <p>The version of the user's namespace. Defaults to the latest version of the user's namespace.</p>
169    pub fn get_namespace_version(&self) -> &::std::option::Option<i64> {
170        self.inner.get_namespace_version()
171    }
172}