aws_sdk_iot/operation/describe_endpoint/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_endpoint::_describe_endpoint_output::DescribeEndpointOutputBuilder;
3
4pub use crate::operation::describe_endpoint::_describe_endpoint_input::DescribeEndpointInputBuilder;
5
6impl crate::operation::describe_endpoint::builders::DescribeEndpointInputBuilder {
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::describe_endpoint::DescribeEndpointOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::describe_endpoint::DescribeEndpointError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.describe_endpoint();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DescribeEndpoint`.
24///
25/// <p>Returns or creates a unique endpoint specific to the Amazon Web Services account making the call.</p><note>
26/// <p>The first time <code>DescribeEndpoint</code> is called, an endpoint is created. All subsequent calls to <code>DescribeEndpoint</code> return the same endpoint.</p>
27/// </note>
28/// <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">DescribeEndpoint</a> action.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct DescribeEndpointFluentBuilder {
31 handle: ::std::sync::Arc<crate::client::Handle>,
32 inner: crate::operation::describe_endpoint::builders::DescribeEndpointInputBuilder,
33 config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36 crate::client::customize::internal::CustomizableSend<
37 crate::operation::describe_endpoint::DescribeEndpointOutput,
38 crate::operation::describe_endpoint::DescribeEndpointError,
39 > for DescribeEndpointFluentBuilder
40{
41 fn send(
42 self,
43 config_override: crate::config::Builder,
44 ) -> crate::client::customize::internal::BoxFuture<
45 crate::client::customize::internal::SendResult<
46 crate::operation::describe_endpoint::DescribeEndpointOutput,
47 crate::operation::describe_endpoint::DescribeEndpointError,
48 >,
49 > {
50 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51 }
52}
53impl DescribeEndpointFluentBuilder {
54 /// Creates a new `DescribeEndpointFluentBuilder`.
55 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56 Self {
57 handle,
58 inner: ::std::default::Default::default(),
59 config_override: ::std::option::Option::None,
60 }
61 }
62 /// Access the DescribeEndpoint as a reference.
63 pub fn as_input(&self) -> &crate::operation::describe_endpoint::builders::DescribeEndpointInputBuilder {
64 &self.inner
65 }
66 /// Sends the request and returns the response.
67 ///
68 /// If an error occurs, an `SdkError` will be returned with additional details that
69 /// can be matched against.
70 ///
71 /// By default, any retryable failures will be retried twice. Retry behavior
72 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73 /// set when configuring the client.
74 pub async fn send(
75 self,
76 ) -> ::std::result::Result<
77 crate::operation::describe_endpoint::DescribeEndpointOutput,
78 ::aws_smithy_runtime_api::client::result::SdkError<
79 crate::operation::describe_endpoint::DescribeEndpointError,
80 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81 >,
82 > {
83 let input = self
84 .inner
85 .build()
86 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87 let runtime_plugins = crate::operation::describe_endpoint::DescribeEndpoint::operation_runtime_plugins(
88 self.handle.runtime_plugins.clone(),
89 &self.handle.conf,
90 self.config_override,
91 );
92 crate::operation::describe_endpoint::DescribeEndpoint::orchestrate(&runtime_plugins, input).await
93 }
94
95 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96 pub fn customize(
97 self,
98 ) -> crate::client::customize::CustomizableOperation<
99 crate::operation::describe_endpoint::DescribeEndpointOutput,
100 crate::operation::describe_endpoint::DescribeEndpointError,
101 Self,
102 > {
103 crate::client::customize::CustomizableOperation::new(self)
104 }
105 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106 self.set_config_override(::std::option::Option::Some(config_override.into()));
107 self
108 }
109
110 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111 self.config_override = config_override;
112 self
113 }
114 /// <p>The endpoint type. Valid endpoint types include:</p>
115 /// <ul>
116 /// <li>
117 /// <p><code>iot:Data</code> - Returns a VeriSign signed data endpoint.</p></li>
118 /// </ul>
119 /// <ul>
120 /// <li>
121 /// <p><code>iot:Data-ATS</code> - Returns an ATS signed data endpoint.</p></li>
122 /// </ul>
123 /// <ul>
124 /// <li>
125 /// <p><code>iot:CredentialProvider</code> - Returns an IoT credentials provider API endpoint.</p></li>
126 /// </ul>
127 /// <ul>
128 /// <li>
129 /// <p><code>iot:Jobs</code> - Returns an IoT device management Jobs API endpoint.</p></li>
130 /// </ul>
131 /// <p>We strongly recommend that customers use the newer <code>iot:Data-ATS</code> endpoint type to avoid issues related to the widespread distrust of Symantec certificate authorities. ATS Signed Certificates are more secure and are trusted by most popular browsers.</p>
132 pub fn endpoint_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133 self.inner = self.inner.endpoint_type(input.into());
134 self
135 }
136 /// <p>The endpoint type. Valid endpoint types include:</p>
137 /// <ul>
138 /// <li>
139 /// <p><code>iot:Data</code> - Returns a VeriSign signed data endpoint.</p></li>
140 /// </ul>
141 /// <ul>
142 /// <li>
143 /// <p><code>iot:Data-ATS</code> - Returns an ATS signed data endpoint.</p></li>
144 /// </ul>
145 /// <ul>
146 /// <li>
147 /// <p><code>iot:CredentialProvider</code> - Returns an IoT credentials provider API endpoint.</p></li>
148 /// </ul>
149 /// <ul>
150 /// <li>
151 /// <p><code>iot:Jobs</code> - Returns an IoT device management Jobs API endpoint.</p></li>
152 /// </ul>
153 /// <p>We strongly recommend that customers use the newer <code>iot:Data-ATS</code> endpoint type to avoid issues related to the widespread distrust of Symantec certificate authorities. ATS Signed Certificates are more secure and are trusted by most popular browsers.</p>
154 pub fn set_endpoint_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155 self.inner = self.inner.set_endpoint_type(input);
156 self
157 }
158 /// <p>The endpoint type. Valid endpoint types include:</p>
159 /// <ul>
160 /// <li>
161 /// <p><code>iot:Data</code> - Returns a VeriSign signed data endpoint.</p></li>
162 /// </ul>
163 /// <ul>
164 /// <li>
165 /// <p><code>iot:Data-ATS</code> - Returns an ATS signed data endpoint.</p></li>
166 /// </ul>
167 /// <ul>
168 /// <li>
169 /// <p><code>iot:CredentialProvider</code> - Returns an IoT credentials provider API endpoint.</p></li>
170 /// </ul>
171 /// <ul>
172 /// <li>
173 /// <p><code>iot:Jobs</code> - Returns an IoT device management Jobs API endpoint.</p></li>
174 /// </ul>
175 /// <p>We strongly recommend that customers use the newer <code>iot:Data-ATS</code> endpoint type to avoid issues related to the widespread distrust of Symantec certificate authorities. ATS Signed Certificates are more secure and are trusted by most popular browsers.</p>
176 pub fn get_endpoint_type(&self) -> &::std::option::Option<::std::string::String> {
177 self.inner.get_endpoint_type()
178 }
179}