docktor_api_client/client.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[derive(Debug)]
3pub(crate) struct Handle<C, M, R = aws_smithy_client::retry::Standard> {
4 pub(crate) client: aws_smithy_client::Client<C, M, R>,
5 pub(crate) conf: crate::Config,
6}
7
8/// An ergonomic service client for `DocktorApi`.
9///
10/// This client allows ergonomic access to a `DocktorApi`-shaped service.
11/// Each method corresponds to an endpoint defined in the service's Smithy model,
12/// and the request and response shapes are auto-generated from that same model.
13///
14/// # Constructing a Client
15///
16/// To construct a client, you need a few different things:
17///
18/// - A [`Config`](crate::Config) that specifies additional configuration
19/// required by the service.
20/// - A connector (`C`) that specifies how HTTP requests are translated
21/// into HTTP responses. This will typically be an HTTP client (like
22/// `hyper`), though you can also substitute in your own, like a mock
23/// mock connector for testing.
24/// - A "middleware" (`M`) that modifies requests prior to them being
25/// sent to the request. Most commonly, middleware will decide what
26/// endpoint the requests should be sent to, as well as perform
27/// authentication and authorization of requests (such as SigV4).
28/// You can also have middleware that performs request/response
29/// tracing, throttling, or other middleware-like tasks.
30/// - A retry policy (`R`) that dictates the behavior for requests that
31/// fail and should (potentially) be retried. The default type is
32/// generally what you want, as it implements a well-vetted retry
33/// policy implemented in [`RetryMode::Standard`](aws_smithy_types::retry::RetryMode::Standard).
34///
35/// To construct a client, you will generally want to call
36/// [`Client::with_config`], which takes a [`aws_smithy_client::Client`] (a
37/// Smithy client that isn't specialized to a particular service),
38/// and a [`Config`](crate::Config). Both of these are constructed using
39/// the [builder pattern] where you first construct a `Builder` type,
40/// then configure it with the necessary parameters, and then call
41/// `build` to construct the finalized output type. The
42/// [`aws_smithy_client::Client`] builder is re-exported in this crate as
43/// [`Builder`] for convenience.
44///
45/// In _most_ circumstances, you will want to use the following pattern
46/// to construct a client:
47///
48/// ```
49/// use docktor_api_client::{Builder, Client, Config};
50/// let raw_client =
51/// Builder::dyn_https()
52/// # /*
53/// .middleware(/* discussed below */)
54/// # */
55/// # .middleware_fn(|r| r)
56/// .build();
57/// let config = Config::builder().build();
58/// let client = Client::with_config(raw_client, config);
59/// ```
60///
61/// For the middleware, you'll want to use whatever matches the
62/// routing, authentication and authorization required by the target
63/// service. For example, for the standard AWS SDK which uses
64/// [SigV4-signed requests], the middleware looks like this:
65///
66// Ignored as otherwise we'd need to pull in all these dev-dependencies.
67/// ```rust,ignore
68/// use aws_endpoint::AwsEndpointStage;
69/// use aws_http::user_agent::UserAgentStage;
70/// use aws_sig_auth::middleware::SigV4SigningStage;
71/// use aws_sig_auth::signer::SigV4Signer;
72/// use aws_smithy_http_tower::map_request::MapRequestLayer;
73/// use tower::layer::util::Stack;
74/// use tower::ServiceBuilder;
75///
76/// type AwsMiddlewareStack =
77/// Stack<MapRequestLayer<SigV4SigningStage>,
78/// Stack<MapRequestLayer<UserAgentStage>,
79/// MapRequestLayer<AwsEndpointStage>>>,
80///
81/// #[derive(Debug, Default)]
82/// pub struct AwsMiddleware;
83/// impl<S> tower::Layer<S> for AwsMiddleware {
84/// type Service = <AwsMiddlewareStack as tower::Layer<S>>::Service;
85///
86/// fn layer(&self, inner: S) -> Self::Service {
87/// let signer = MapRequestLayer::for_mapper(SigV4SigningStage::new(SigV4Signer::new())); _signer: MapRequestLaye
88/// let endpoint_resolver = MapRequestLayer::for_mapper(AwsEndpointStage); _endpoint_resolver: MapRequestLayer<Aw
89/// let user_agent = MapRequestLayer::for_mapper(UserAgentStage::new()); _user_agent: MapRequestLayer<UserAgentSt
90/// // These layers can be considered as occurring in order, that is:
91/// // 1. Resolve an endpoint
92/// // 2. Add a user agent
93/// // 3. Sign
94/// // (4. Dispatch over the wire)
95/// ServiceBuilder::new() _ServiceBuilder<Identity>
96/// .layer(endpoint_resolver) _ServiceBuilder<Stack<MapRequestLayer<_>, _>>
97/// .layer(user_agent) _ServiceBuilder<Stack<MapRequestLayer<_>, _>>
98/// .layer(signer) _ServiceBuilder<Stack<MapRequestLayer<_>, _>>
99/// .service(inner)
100/// }
101/// }
102/// ```
103///
104/// # Using a Client
105///
106/// Once you have a client set up, you can access the service's endpoints
107/// by calling the appropriate method on [`Client`]. Each such method
108/// returns a request builder for that endpoint, with methods for setting
109/// the various fields of the request. Once your request is complete, use
110/// the `send` method to send the request. `send` returns a future, which
111/// you then have to `.await` to get the service's response.
112///
113/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#c-builder
114/// [SigV4-signed requests]: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html
115#[derive(std::fmt::Debug)]
116pub struct Client<C, M, R = aws_smithy_client::retry::Standard> {
117 handle: std::sync::Arc<Handle<C, M, R>>,
118}
119
120impl<C, M, R> std::clone::Clone for Client<C, M, R> {
121 fn clone(&self) -> Self {
122 Self {
123 handle: self.handle.clone(),
124 }
125 }
126}
127
128#[doc(inline)]
129pub use aws_smithy_client::Builder;
130
131impl<C, M, R> From<aws_smithy_client::Client<C, M, R>> for Client<C, M, R> {
132 fn from(client: aws_smithy_client::Client<C, M, R>) -> Self {
133 Self::with_config(client, crate::Config::builder().build())
134 }
135}
136
137impl<C, M, R> Client<C, M, R> {
138 /// Creates a client with the given service configuration.
139 pub fn with_config(client: aws_smithy_client::Client<C, M, R>, conf: crate::Config) -> Self {
140 Self {
141 handle: std::sync::Arc::new(Handle { client, conf }),
142 }
143 }
144
145 /// Returns the client's configuration.
146 pub fn conf(&self) -> &crate::Config {
147 &self.handle.conf
148 }
149}
150impl<C, M, R> Client<C, M, R>
151where
152 C: aws_smithy_client::bounds::SmithyConnector,
153 M: aws_smithy_client::bounds::SmithyMiddleware<C>,
154 R: aws_smithy_client::retry::NewRequestPolicy,
155{
156 /// Constructs a fluent builder for the [`HealthcheckOperation`](crate::client::fluent_builders::HealthcheckOperation) operation.
157 ///
158 /// - The fluent builder takes no input, just [`send`](crate::client::fluent_builders::HealthcheckOperation::send) it.
159
160 /// - On success, responds with [`HealthcheckOperationOutput`](crate::output::HealthcheckOperationOutput) with field(s):
161 /// - [`message(Option<String>)`](crate::output::HealthcheckOperationOutput::message): (undocumented)
162 /// - On failure, responds with [`SdkError<HealthcheckOperationError>`](crate::error::HealthcheckOperationError)
163 pub fn healthcheck_operation(&self) -> fluent_builders::HealthcheckOperation<C, M, R> {
164 fluent_builders::HealthcheckOperation::new(self.handle.clone())
165 }
166 /// Constructs a fluent builder for the [`ListOperation`](crate::client::fluent_builders::ListOperation) operation.
167 ///
168 /// - The fluent builder takes no input, just [`send`](crate::client::fluent_builders::ListOperation::send) it.
169
170 /// - On success, responds with [`ListOperationOutput`](crate::output::ListOperationOutput) with field(s):
171 /// - [`primary(Option<String>)`](crate::output::ListOperationOutput::primary): Is primary?
172 /// - [`host(Option<Host>)`](crate::output::ListOperationOutput::host): Host info.
173 /// - [`resources(Option<Resources>)`](crate::output::ListOperationOutput::resources): Host resources.
174 /// - [`services(Option<Vec<Service>>)`](crate::output::ListOperationOutput::services): List of available services.
175 /// - [`checksum(Option<String>)`](crate::output::ListOperationOutput::checksum): Service checksum.
176 /// - [`available_services(Option<Vec<String>>)`](crate::output::ListOperationOutput::available_services): List of services runnable by this host
177 /// - [`peers(Option<HashMap<String, ListOutput>>)`](crate::output::ListOperationOutput::peers): Map of peers configurations
178 /// - On failure, responds with [`SdkError<ListOperationError>`](crate::error::ListOperationError)
179 pub fn list_operation(&self) -> fluent_builders::ListOperation<C, M, R> {
180 fluent_builders::ListOperation::new(self.handle.clone())
181 }
182 /// Constructs a fluent builder for the [`PrometheusTargetOperation`](crate::client::fluent_builders::PrometheusTargetOperation) operation.
183 ///
184 /// - The fluent builder takes no input, just [`send`](crate::client::fluent_builders::PrometheusTargetOperation::send) it.
185
186 /// - On success, responds with [`PrometheusTargetOperationOutput`](crate::output::PrometheusTargetOperationOutput) with field(s):
187 /// - [`targets(Option<Vec<PrometheusTarget>>)`](crate::output::PrometheusTargetOperationOutput::targets): List of Prometheus targets.
188 /// - On failure, responds with [`SdkError<PrometheusTargetOperationError>`](crate::error::PrometheusTargetOperationError)
189 pub fn prometheus_target_operation(
190 &self,
191 ) -> fluent_builders::PrometheusTargetOperation<C, M, R> {
192 fluent_builders::PrometheusTargetOperation::new(self.handle.clone())
193 }
194 /// Constructs a fluent builder for the [`RestartOperation`](crate::client::fluent_builders::RestartOperation) operation.
195 ///
196 /// - The fluent builder is configurable:
197 /// - [`services(Vec<String>)`](crate::client::fluent_builders::RestartOperation::services) / [`set_services(Option<Vec<String>>)`](crate::client::fluent_builders::RestartOperation::set_services): Service name.
198 /// - [`hostname(impl Into<String>)`](crate::client::fluent_builders::RestartOperation::hostname) / [`set_hostname(Option<String>)`](crate::client::fluent_builders::RestartOperation::set_hostname): Hostname.
199 /// - On success, responds with [`RestartOperationOutput`](crate::output::RestartOperationOutput) with field(s):
200 /// - [`inner(Option<Vec<SystemdOutputInner>>)`](crate::output::RestartOperationOutput::inner): Systemd output list.
201 /// - On failure, responds with [`SdkError<RestartOperationError>`](crate::error::RestartOperationError)
202 pub fn restart_operation(&self) -> fluent_builders::RestartOperation<C, M, R> {
203 fluent_builders::RestartOperation::new(self.handle.clone())
204 }
205 /// Constructs a fluent builder for the [`StartOperation`](crate::client::fluent_builders::StartOperation) operation.
206 ///
207 /// - The fluent builder is configurable:
208 /// - [`services(Vec<String>)`](crate::client::fluent_builders::StartOperation::services) / [`set_services(Option<Vec<String>>)`](crate::client::fluent_builders::StartOperation::set_services): Service name.
209 /// - [`hostname(impl Into<String>)`](crate::client::fluent_builders::StartOperation::hostname) / [`set_hostname(Option<String>)`](crate::client::fluent_builders::StartOperation::set_hostname): Hostname.
210 /// - On success, responds with [`StartOperationOutput`](crate::output::StartOperationOutput) with field(s):
211 /// - [`inner(Option<Vec<SystemdOutputInner>>)`](crate::output::StartOperationOutput::inner): Systemd output list.
212 /// - On failure, responds with [`SdkError<StartOperationError>`](crate::error::StartOperationError)
213 pub fn start_operation(&self) -> fluent_builders::StartOperation<C, M, R> {
214 fluent_builders::StartOperation::new(self.handle.clone())
215 }
216 /// Constructs a fluent builder for the [`StopOperation`](crate::client::fluent_builders::StopOperation) operation.
217 ///
218 /// - The fluent builder is configurable:
219 /// - [`services(Vec<String>)`](crate::client::fluent_builders::StopOperation::services) / [`set_services(Option<Vec<String>>)`](crate::client::fluent_builders::StopOperation::set_services): Service name.
220 /// - [`hostname(impl Into<String>)`](crate::client::fluent_builders::StopOperation::hostname) / [`set_hostname(Option<String>)`](crate::client::fluent_builders::StopOperation::set_hostname): Hostname.
221 /// - On success, responds with [`StopOperationOutput`](crate::output::StopOperationOutput) with field(s):
222 /// - [`inner(Option<Vec<SystemdOutputInner>>)`](crate::output::StopOperationOutput::inner): Systemd output list.
223 /// - On failure, responds with [`SdkError<StopOperationError>`](crate::error::StopOperationError)
224 pub fn stop_operation(&self) -> fluent_builders::StopOperation<C, M, R> {
225 fluent_builders::StopOperation::new(self.handle.clone())
226 }
227}
228pub mod fluent_builders {
229 //!
230 //! Utilities to ergonomically construct a request to the service.
231 //!
232 //! Fluent builders are created through the [`Client`](crate::client::Client) by calling
233 //! one if its operation methods. After parameters are set using the builder methods,
234 //! the `send` method can be called to initiate the request.
235 //!
236 /// Fluent builder constructing a request to `HealthcheckOperation`.
237 ///
238 /// //////////////////////////////////// Operations //////////////////////////////////// Read-only healtcheck operation.
239 #[derive(std::clone::Clone, std::fmt::Debug)]
240 pub struct HealthcheckOperation<C, M, R = aws_smithy_client::retry::Standard> {
241 handle: std::sync::Arc<super::Handle<C, M, R>>,
242 inner: crate::input::healthcheck_operation_input::Builder,
243 }
244 impl<C, M, R> HealthcheckOperation<C, M, R>
245 where
246 C: aws_smithy_client::bounds::SmithyConnector,
247 M: aws_smithy_client::bounds::SmithyMiddleware<C>,
248 R: aws_smithy_client::retry::NewRequestPolicy,
249 {
250 /// Creates a new `HealthcheckOperation`.
251 pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
252 Self {
253 handle,
254 inner: Default::default(),
255 }
256 }
257
258 /// Sends the request and returns the response.
259 ///
260 /// If an error occurs, an `SdkError` will be returned with additional details that
261 /// can be matched against.
262 ///
263 /// By default, any retryable failures will be retried twice. Retry behavior
264 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
265 /// set when configuring the client.
266 pub async fn send(
267 self,
268 ) -> std::result::Result<
269 crate::output::HealthcheckOperationOutput,
270 aws_smithy_http::result::SdkError<crate::error::HealthcheckOperationError>,
271 >
272 where
273 R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
274 crate::input::HealthcheckOperationInputOperationOutputAlias,
275 crate::output::HealthcheckOperationOutput,
276 crate::error::HealthcheckOperationError,
277 crate::input::HealthcheckOperationInputOperationRetryAlias,
278 >,
279 {
280 let op = self
281 .inner
282 .build()
283 .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
284 .make_operation(&self.handle.conf)
285 .await
286 .map_err(|err| {
287 aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
288 })?;
289 self.handle.client.call(op).await
290 }
291 }
292 /// Fluent builder constructing a request to `ListOperation`.
293 ///
294 /// Get the current status of the cluster from this node's perspective.
295 #[derive(std::clone::Clone, std::fmt::Debug)]
296 pub struct ListOperation<C, M, R = aws_smithy_client::retry::Standard> {
297 handle: std::sync::Arc<super::Handle<C, M, R>>,
298 inner: crate::input::list_operation_input::Builder,
299 }
300 impl<C, M, R> ListOperation<C, M, R>
301 where
302 C: aws_smithy_client::bounds::SmithyConnector,
303 M: aws_smithy_client::bounds::SmithyMiddleware<C>,
304 R: aws_smithy_client::retry::NewRequestPolicy,
305 {
306 /// Creates a new `ListOperation`.
307 pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
308 Self {
309 handle,
310 inner: Default::default(),
311 }
312 }
313
314 /// Sends the request and returns the response.
315 ///
316 /// If an error occurs, an `SdkError` will be returned with additional details that
317 /// can be matched against.
318 ///
319 /// By default, any retryable failures will be retried twice. Retry behavior
320 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
321 /// set when configuring the client.
322 pub async fn send(
323 self,
324 ) -> std::result::Result<
325 crate::output::ListOperationOutput,
326 aws_smithy_http::result::SdkError<crate::error::ListOperationError>,
327 >
328 where
329 R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
330 crate::input::ListOperationInputOperationOutputAlias,
331 crate::output::ListOperationOutput,
332 crate::error::ListOperationError,
333 crate::input::ListOperationInputOperationRetryAlias,
334 >,
335 {
336 let op = self
337 .inner
338 .build()
339 .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
340 .make_operation(&self.handle.conf)
341 .await
342 .map_err(|err| {
343 aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
344 })?;
345 self.handle.client.call(op).await
346 }
347 }
348 /// Fluent builder constructing a request to `PrometheusTargetOperation`.
349 ///
350 /// Prometheus service discovery.
351 #[derive(std::clone::Clone, std::fmt::Debug)]
352 pub struct PrometheusTargetOperation<C, M, R = aws_smithy_client::retry::Standard> {
353 handle: std::sync::Arc<super::Handle<C, M, R>>,
354 inner: crate::input::prometheus_target_operation_input::Builder,
355 }
356 impl<C, M, R> PrometheusTargetOperation<C, M, R>
357 where
358 C: aws_smithy_client::bounds::SmithyConnector,
359 M: aws_smithy_client::bounds::SmithyMiddleware<C>,
360 R: aws_smithy_client::retry::NewRequestPolicy,
361 {
362 /// Creates a new `PrometheusTargetOperation`.
363 pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
364 Self {
365 handle,
366 inner: Default::default(),
367 }
368 }
369
370 /// Sends the request and returns the response.
371 ///
372 /// If an error occurs, an `SdkError` will be returned with additional details that
373 /// can be matched against.
374 ///
375 /// By default, any retryable failures will be retried twice. Retry behavior
376 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
377 /// set when configuring the client.
378 pub async fn send(
379 self,
380 ) -> std::result::Result<
381 crate::output::PrometheusTargetOperationOutput,
382 aws_smithy_http::result::SdkError<crate::error::PrometheusTargetOperationError>,
383 >
384 where
385 R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
386 crate::input::PrometheusTargetOperationInputOperationOutputAlias,
387 crate::output::PrometheusTargetOperationOutput,
388 crate::error::PrometheusTargetOperationError,
389 crate::input::PrometheusTargetOperationInputOperationRetryAlias,
390 >,
391 {
392 let op = self
393 .inner
394 .build()
395 .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
396 .make_operation(&self.handle.conf)
397 .await
398 .map_err(|err| {
399 aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
400 })?;
401 self.handle.client.call(op).await
402 }
403 }
404 /// Fluent builder constructing a request to `RestartOperation`.
405 ///
406 /// Stop a service.
407 #[derive(std::clone::Clone, std::fmt::Debug)]
408 pub struct RestartOperation<C, M, R = aws_smithy_client::retry::Standard> {
409 handle: std::sync::Arc<super::Handle<C, M, R>>,
410 inner: crate::input::restart_operation_input::Builder,
411 }
412 impl<C, M, R> RestartOperation<C, M, R>
413 where
414 C: aws_smithy_client::bounds::SmithyConnector,
415 M: aws_smithy_client::bounds::SmithyMiddleware<C>,
416 R: aws_smithy_client::retry::NewRequestPolicy,
417 {
418 /// Creates a new `RestartOperation`.
419 pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
420 Self {
421 handle,
422 inner: Default::default(),
423 }
424 }
425
426 /// Sends the request and returns the response.
427 ///
428 /// If an error occurs, an `SdkError` will be returned with additional details that
429 /// can be matched against.
430 ///
431 /// By default, any retryable failures will be retried twice. Retry behavior
432 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
433 /// set when configuring the client.
434 pub async fn send(
435 self,
436 ) -> std::result::Result<
437 crate::output::RestartOperationOutput,
438 aws_smithy_http::result::SdkError<crate::error::RestartOperationError>,
439 >
440 where
441 R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
442 crate::input::RestartOperationInputOperationOutputAlias,
443 crate::output::RestartOperationOutput,
444 crate::error::RestartOperationError,
445 crate::input::RestartOperationInputOperationRetryAlias,
446 >,
447 {
448 let op = self
449 .inner
450 .build()
451 .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
452 .make_operation(&self.handle.conf)
453 .await
454 .map_err(|err| {
455 aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
456 })?;
457 self.handle.client.call(op).await
458 }
459 /// Appends an item to `services`.
460 ///
461 /// To override the contents of this collection use [`set_services`](Self::set_services).
462 ///
463 /// Service name.
464 pub fn services(mut self, input: impl Into<std::string::String>) -> Self {
465 self.inner = self.inner.services(input.into());
466 self
467 }
468 /// Service name.
469 pub fn set_services(
470 mut self,
471 input: std::option::Option<std::vec::Vec<std::string::String>>,
472 ) -> Self {
473 self.inner = self.inner.set_services(input);
474 self
475 }
476 /// Hostname.
477 pub fn hostname(mut self, input: impl Into<std::string::String>) -> Self {
478 self.inner = self.inner.hostname(input.into());
479 self
480 }
481 /// Hostname.
482 pub fn set_hostname(mut self, input: std::option::Option<std::string::String>) -> Self {
483 self.inner = self.inner.set_hostname(input);
484 self
485 }
486 }
487 /// Fluent builder constructing a request to `StartOperation`.
488 ///
489 /// Start a service.
490 #[derive(std::clone::Clone, std::fmt::Debug)]
491 pub struct StartOperation<C, M, R = aws_smithy_client::retry::Standard> {
492 handle: std::sync::Arc<super::Handle<C, M, R>>,
493 inner: crate::input::start_operation_input::Builder,
494 }
495 impl<C, M, R> StartOperation<C, M, R>
496 where
497 C: aws_smithy_client::bounds::SmithyConnector,
498 M: aws_smithy_client::bounds::SmithyMiddleware<C>,
499 R: aws_smithy_client::retry::NewRequestPolicy,
500 {
501 /// Creates a new `StartOperation`.
502 pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
503 Self {
504 handle,
505 inner: Default::default(),
506 }
507 }
508
509 /// Sends the request and returns the response.
510 ///
511 /// If an error occurs, an `SdkError` will be returned with additional details that
512 /// can be matched against.
513 ///
514 /// By default, any retryable failures will be retried twice. Retry behavior
515 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
516 /// set when configuring the client.
517 pub async fn send(
518 self,
519 ) -> std::result::Result<
520 crate::output::StartOperationOutput,
521 aws_smithy_http::result::SdkError<crate::error::StartOperationError>,
522 >
523 where
524 R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
525 crate::input::StartOperationInputOperationOutputAlias,
526 crate::output::StartOperationOutput,
527 crate::error::StartOperationError,
528 crate::input::StartOperationInputOperationRetryAlias,
529 >,
530 {
531 let op = self
532 .inner
533 .build()
534 .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
535 .make_operation(&self.handle.conf)
536 .await
537 .map_err(|err| {
538 aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
539 })?;
540 self.handle.client.call(op).await
541 }
542 /// Appends an item to `services`.
543 ///
544 /// To override the contents of this collection use [`set_services`](Self::set_services).
545 ///
546 /// Service name.
547 pub fn services(mut self, input: impl Into<std::string::String>) -> Self {
548 self.inner = self.inner.services(input.into());
549 self
550 }
551 /// Service name.
552 pub fn set_services(
553 mut self,
554 input: std::option::Option<std::vec::Vec<std::string::String>>,
555 ) -> Self {
556 self.inner = self.inner.set_services(input);
557 self
558 }
559 /// Hostname.
560 pub fn hostname(mut self, input: impl Into<std::string::String>) -> Self {
561 self.inner = self.inner.hostname(input.into());
562 self
563 }
564 /// Hostname.
565 pub fn set_hostname(mut self, input: std::option::Option<std::string::String>) -> Self {
566 self.inner = self.inner.set_hostname(input);
567 self
568 }
569 }
570 /// Fluent builder constructing a request to `StopOperation`.
571 ///
572 /// Stop a service.
573 #[derive(std::clone::Clone, std::fmt::Debug)]
574 pub struct StopOperation<C, M, R = aws_smithy_client::retry::Standard> {
575 handle: std::sync::Arc<super::Handle<C, M, R>>,
576 inner: crate::input::stop_operation_input::Builder,
577 }
578 impl<C, M, R> StopOperation<C, M, R>
579 where
580 C: aws_smithy_client::bounds::SmithyConnector,
581 M: aws_smithy_client::bounds::SmithyMiddleware<C>,
582 R: aws_smithy_client::retry::NewRequestPolicy,
583 {
584 /// Creates a new `StopOperation`.
585 pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
586 Self {
587 handle,
588 inner: Default::default(),
589 }
590 }
591
592 /// Sends the request and returns the response.
593 ///
594 /// If an error occurs, an `SdkError` will be returned with additional details that
595 /// can be matched against.
596 ///
597 /// By default, any retryable failures will be retried twice. Retry behavior
598 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
599 /// set when configuring the client.
600 pub async fn send(
601 self,
602 ) -> std::result::Result<
603 crate::output::StopOperationOutput,
604 aws_smithy_http::result::SdkError<crate::error::StopOperationError>,
605 >
606 where
607 R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
608 crate::input::StopOperationInputOperationOutputAlias,
609 crate::output::StopOperationOutput,
610 crate::error::StopOperationError,
611 crate::input::StopOperationInputOperationRetryAlias,
612 >,
613 {
614 let op = self
615 .inner
616 .build()
617 .map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
618 .make_operation(&self.handle.conf)
619 .await
620 .map_err(|err| {
621 aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
622 })?;
623 self.handle.client.call(op).await
624 }
625 /// Appends an item to `services`.
626 ///
627 /// To override the contents of this collection use [`set_services`](Self::set_services).
628 ///
629 /// Service name.
630 pub fn services(mut self, input: impl Into<std::string::String>) -> Self {
631 self.inner = self.inner.services(input.into());
632 self
633 }
634 /// Service name.
635 pub fn set_services(
636 mut self,
637 input: std::option::Option<std::vec::Vec<std::string::String>>,
638 ) -> Self {
639 self.inner = self.inner.set_services(input);
640 self
641 }
642 /// Hostname.
643 pub fn hostname(mut self, input: impl Into<std::string::String>) -> Self {
644 self.inner = self.inner.hostname(input.into());
645 self
646 }
647 /// Hostname.
648 pub fn set_hostname(mut self, input: std::option::Option<std::string::String>) -> Self {
649 self.inner = self.inner.set_hostname(input);
650 self
651 }
652 }
653}