aws_sdk_datapipeline/operation/set_status/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::set_status::_set_status_output::SetStatusOutputBuilder;
3
4pub use crate::operation::set_status::_set_status_input::SetStatusInputBuilder;
5
6impl crate::operation::set_status::builders::SetStatusInputBuilder {
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::set_status::SetStatusOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::set_status::SetStatusError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.set_status();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `SetStatus`.
24///
25/// <p>Requests that the status of the specified physical or logical pipeline objects be updated in the specified pipeline. This update might not occur immediately, but is eventually consistent. The status that can be set depends on the type of object (for example, DataNode or Activity). You cannot perform this operation on <code>FINISHED</code> pipelines and attempting to do so returns <code>InvalidRequestException</code>.</p><examples>
26/// <request>
27/// POST / HTTP/1.1 Content-Type: application/x-amz-json-1.1 X-Amz-Target: DataPipeline.SetStatus Content-Length: 100 Host: datapipeline.us-east-1.amazonaws.com X-Amz-Date: Mon, 12 Nov 2012 17:49:52 GMT Authorization: AuthParams {"pipelineId": "df-0634701J7KEXAMPLE", "objectIds": \["o-08600941GHJWMBR9E2"\], "status": "pause"}
28/// </request>
29/// <response>
30/// x-amzn-RequestId: e83b8ab7-076a-11e2-af6f-6bc7a6be60d9 Content-Type: application/x-amz-json-1.1 Content-Length: 0 Date: Mon, 12 Nov 2012 17:50:53 GMT Unexpected response: 200, OK, undefined
31/// </response>
32/// </examples>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct SetStatusFluentBuilder {
35    handle: ::std::sync::Arc<crate::client::Handle>,
36    inner: crate::operation::set_status::builders::SetStatusInputBuilder,
37    config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl crate::client::customize::internal::CustomizableSend<crate::operation::set_status::SetStatusOutput, crate::operation::set_status::SetStatusError>
40    for SetStatusFluentBuilder
41{
42    fn send(
43        self,
44        config_override: crate::config::Builder,
45    ) -> crate::client::customize::internal::BoxFuture<
46        crate::client::customize::internal::SendResult<crate::operation::set_status::SetStatusOutput, crate::operation::set_status::SetStatusError>,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl SetStatusFluentBuilder {
52    /// Creates a new `SetStatusFluentBuilder`.
53    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54        Self {
55            handle,
56            inner: ::std::default::Default::default(),
57            config_override: ::std::option::Option::None,
58        }
59    }
60    /// Access the SetStatus as a reference.
61    pub fn as_input(&self) -> &crate::operation::set_status::builders::SetStatusInputBuilder {
62        &self.inner
63    }
64    /// Sends the request and returns the response.
65    ///
66    /// If an error occurs, an `SdkError` will be returned with additional details that
67    /// can be matched against.
68    ///
69    /// By default, any retryable failures will be retried twice. Retry behavior
70    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71    /// set when configuring the client.
72    pub async fn send(
73        self,
74    ) -> ::std::result::Result<
75        crate::operation::set_status::SetStatusOutput,
76        ::aws_smithy_runtime_api::client::result::SdkError<
77            crate::operation::set_status::SetStatusError,
78            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79        >,
80    > {
81        let input = self
82            .inner
83            .build()
84            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85        let runtime_plugins = crate::operation::set_status::SetStatus::operation_runtime_plugins(
86            self.handle.runtime_plugins.clone(),
87            &self.handle.conf,
88            self.config_override,
89        );
90        crate::operation::set_status::SetStatus::orchestrate(&runtime_plugins, input).await
91    }
92
93    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94    pub fn customize(
95        self,
96    ) -> crate::client::customize::CustomizableOperation<
97        crate::operation::set_status::SetStatusOutput,
98        crate::operation::set_status::SetStatusError,
99        Self,
100    > {
101        crate::client::customize::CustomizableOperation::new(self)
102    }
103    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104        self.set_config_override(::std::option::Option::Some(config_override.into()));
105        self
106    }
107
108    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109        self.config_override = config_override;
110        self
111    }
112    /// <p>The ID of the pipeline that contains the objects.</p>
113    pub fn pipeline_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.inner = self.inner.pipeline_id(input.into());
115        self
116    }
117    /// <p>The ID of the pipeline that contains the objects.</p>
118    pub fn set_pipeline_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119        self.inner = self.inner.set_pipeline_id(input);
120        self
121    }
122    /// <p>The ID of the pipeline that contains the objects.</p>
123    pub fn get_pipeline_id(&self) -> &::std::option::Option<::std::string::String> {
124        self.inner.get_pipeline_id()
125    }
126    ///
127    /// Appends an item to `objectIds`.
128    ///
129    /// To override the contents of this collection use [`set_object_ids`](Self::set_object_ids).
130    ///
131    /// <p>The IDs of the objects. The corresponding objects can be either physical or components, but not a mix of both types.</p>
132    pub fn object_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.inner = self.inner.object_ids(input.into());
134        self
135    }
136    /// <p>The IDs of the objects. The corresponding objects can be either physical or components, but not a mix of both types.</p>
137    pub fn set_object_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
138        self.inner = self.inner.set_object_ids(input);
139        self
140    }
141    /// <p>The IDs of the objects. The corresponding objects can be either physical or components, but not a mix of both types.</p>
142    pub fn get_object_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
143        self.inner.get_object_ids()
144    }
145    /// <p>The status to be set on all the objects specified in <code>objectIds</code>. For components, use <code>PAUSE</code> or <code>RESUME</code>. For instances, use <code>TRY_CANCEL</code>, <code>RERUN</code>, or <code>MARK_FINISHED</code>.</p>
146    pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.inner = self.inner.status(input.into());
148        self
149    }
150    /// <p>The status to be set on all the objects specified in <code>objectIds</code>. For components, use <code>PAUSE</code> or <code>RESUME</code>. For instances, use <code>TRY_CANCEL</code>, <code>RERUN</code>, or <code>MARK_FINISHED</code>.</p>
151    pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.inner = self.inner.set_status(input);
153        self
154    }
155    /// <p>The status to be set on all the objects specified in <code>objectIds</code>. For components, use <code>PAUSE</code> or <code>RESUME</code>. For instances, use <code>TRY_CANCEL</code>, <code>RERUN</code>, or <code>MARK_FINISHED</code>.</p>
156    pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
157        self.inner.get_status()
158    }
159}