aws_sdk_datapipeline/operation/validate_pipeline_definition/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::validate_pipeline_definition::_validate_pipeline_definition_output::ValidatePipelineDefinitionOutputBuilder;
3
4pub use crate::operation::validate_pipeline_definition::_validate_pipeline_definition_input::ValidatePipelineDefinitionInputBuilder;
5
6impl crate::operation::validate_pipeline_definition::builders::ValidatePipelineDefinitionInputBuilder {
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::validate_pipeline_definition::ValidatePipelineDefinitionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::validate_pipeline_definition::ValidatePipelineDefinitionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.validate_pipeline_definition();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ValidatePipelineDefinition`.
24///
25/// <p>Validates the specified pipeline definition to ensure that it is well formed and can be run without error.</p><examples>
26/// <example>
27/// <name>
28/// Example 1
29/// </name>
30/// <description>
31/// This example sets an valid pipeline configuration and returns success.
32/// </description>
33/// <request>
34/// POST / HTTP/1.1 Content-Type: application/x-amz-json-1.1 X-Amz-Target: DataPipeline.ValidatePipelineDefinition Content-Length: 936 Host: datapipeline.us-east-1.amazonaws.com X-Amz-Date: Mon, 12 Nov 2012 17:49:52 GMT Authorization: AuthParams {"pipelineId": "df-06372391ZG65EXAMPLE", "pipelineObjects": \[ {"id": "Default", "name": "Default", "fields": \[ {"key": "workerGroup", "stringValue": "MyworkerGroup"} \] }, {"id": "Schedule", "name": "Schedule", "fields": \[ {"key": "startDateTime", "stringValue": "2012-09-25T17:00:00"}, {"key": "type", "stringValue": "Schedule"}, {"key": "period", "stringValue": "1 hour"}, {"key": "endDateTime", "stringValue": "2012-09-25T18:00:00"} \] }, {"id": "SayHello", "name": "SayHello", "fields": \[ {"key": "type", "stringValue": "ShellCommandActivity"}, {"key": "command", "stringValue": "echo hello"}, {"key": "parent", "refValue": "Default"}, {"key": "schedule", "refValue": "Schedule"} \] } \] }
35/// </request>
36/// <response>
37/// x-amzn-RequestId: 92c9f347-0776-11e2-8a14-21bb8a1f50ef Content-Type: application/x-amz-json-1.1 Content-Length: 18 Date: Mon, 12 Nov 2012 17:50:53 GMT {"errored": false}
38/// </response>
39/// </example>
40/// <example>
41/// <name>
42/// Example 2
43/// </name>
44/// <description>
45/// This example sets an invalid pipeline configuration and returns the associated set of validation errors.
46/// </description>
47/// <request>
48/// POST / HTTP/1.1 Content-Type: application/x-amz-json-1.1 X-Amz-Target: DataPipeline.ValidatePipelineDefinition Content-Length: 903 Host: datapipeline.us-east-1.amazonaws.com X-Amz-Date: Mon, 12 Nov 2012 17:49:52 GMT Authorization: AuthParams {"pipelineId": "df-06372391ZG65EXAMPLE", "pipelineObjects": \[ {"id": "Default", "name": "Default", "fields": \[ {"key": "workerGroup", "stringValue": "MyworkerGroup"} \] }, {"id": "Schedule", "name": "Schedule", "fields": \[ {"key": "startDateTime", "stringValue": "bad-time"}, {"key": "type", "stringValue": "Schedule"}, {"key": "period", "stringValue": "1 hour"}, {"key": "endDateTime", "stringValue": "2012-09-25T18:00:00"} \] }, {"id": "SayHello", "name": "SayHello", "fields": \[ {"key": "type", "stringValue": "ShellCommandActivity"}, {"key": "command", "stringValue": "echo hello"}, {"key": "parent", "refValue": "Default"}, {"key": "schedule", "refValue": "Schedule"} \] } \] }
49/// </request>
50/// <response>
51/// x-amzn-RequestId: 496a1f5a-0e6a-11e2-a61c-bd6312c92ddd Content-Type: application/x-amz-json-1.1 Content-Length: 278 Date: Mon, 12 Nov 2012 17:50:53 GMT {"errored": true, "validationErrors": \[ {"errors": \["INVALID_FIELD_VALUE: 'startDateTime' value must be a literal datetime value."\], "id": "Schedule"} \] }
52/// </response>
53/// </example>
54/// </examples>
55#[derive(::std::clone::Clone, ::std::fmt::Debug)]
56pub struct ValidatePipelineDefinitionFluentBuilder {
57    handle: ::std::sync::Arc<crate::client::Handle>,
58    inner: crate::operation::validate_pipeline_definition::builders::ValidatePipelineDefinitionInputBuilder,
59    config_override: ::std::option::Option<crate::config::Builder>,
60}
61impl
62    crate::client::customize::internal::CustomizableSend<
63        crate::operation::validate_pipeline_definition::ValidatePipelineDefinitionOutput,
64        crate::operation::validate_pipeline_definition::ValidatePipelineDefinitionError,
65    > for ValidatePipelineDefinitionFluentBuilder
66{
67    fn send(
68        self,
69        config_override: crate::config::Builder,
70    ) -> crate::client::customize::internal::BoxFuture<
71        crate::client::customize::internal::SendResult<
72            crate::operation::validate_pipeline_definition::ValidatePipelineDefinitionOutput,
73            crate::operation::validate_pipeline_definition::ValidatePipelineDefinitionError,
74        >,
75    > {
76        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
77    }
78}
79impl ValidatePipelineDefinitionFluentBuilder {
80    /// Creates a new `ValidatePipelineDefinitionFluentBuilder`.
81    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
82        Self {
83            handle,
84            inner: ::std::default::Default::default(),
85            config_override: ::std::option::Option::None,
86        }
87    }
88    /// Access the ValidatePipelineDefinition as a reference.
89    pub fn as_input(&self) -> &crate::operation::validate_pipeline_definition::builders::ValidatePipelineDefinitionInputBuilder {
90        &self.inner
91    }
92    /// Sends the request and returns the response.
93    ///
94    /// If an error occurs, an `SdkError` will be returned with additional details that
95    /// can be matched against.
96    ///
97    /// By default, any retryable failures will be retried twice. Retry behavior
98    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
99    /// set when configuring the client.
100    pub async fn send(
101        self,
102    ) -> ::std::result::Result<
103        crate::operation::validate_pipeline_definition::ValidatePipelineDefinitionOutput,
104        ::aws_smithy_runtime_api::client::result::SdkError<
105            crate::operation::validate_pipeline_definition::ValidatePipelineDefinitionError,
106            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
107        >,
108    > {
109        let input = self
110            .inner
111            .build()
112            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
113        let runtime_plugins = crate::operation::validate_pipeline_definition::ValidatePipelineDefinition::operation_runtime_plugins(
114            self.handle.runtime_plugins.clone(),
115            &self.handle.conf,
116            self.config_override,
117        );
118        crate::operation::validate_pipeline_definition::ValidatePipelineDefinition::orchestrate(&runtime_plugins, input).await
119    }
120
121    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
122    pub fn customize(
123        self,
124    ) -> crate::client::customize::CustomizableOperation<
125        crate::operation::validate_pipeline_definition::ValidatePipelineDefinitionOutput,
126        crate::operation::validate_pipeline_definition::ValidatePipelineDefinitionError,
127        Self,
128    > {
129        crate::client::customize::CustomizableOperation::new(self)
130    }
131    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
132        self.set_config_override(::std::option::Option::Some(config_override.into()));
133        self
134    }
135
136    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
137        self.config_override = config_override;
138        self
139    }
140    /// <p>The ID of the pipeline.</p>
141    pub fn pipeline_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142        self.inner = self.inner.pipeline_id(input.into());
143        self
144    }
145    /// <p>The ID of the pipeline.</p>
146    pub fn set_pipeline_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147        self.inner = self.inner.set_pipeline_id(input);
148        self
149    }
150    /// <p>The ID of the pipeline.</p>
151    pub fn get_pipeline_id(&self) -> &::std::option::Option<::std::string::String> {
152        self.inner.get_pipeline_id()
153    }
154    ///
155    /// Appends an item to `pipelineObjects`.
156    ///
157    /// To override the contents of this collection use [`set_pipeline_objects`](Self::set_pipeline_objects).
158    ///
159    /// <p>The objects that define the pipeline changes to validate against the pipeline.</p>
160    pub fn pipeline_objects(mut self, input: crate::types::PipelineObject) -> Self {
161        self.inner = self.inner.pipeline_objects(input);
162        self
163    }
164    /// <p>The objects that define the pipeline changes to validate against the pipeline.</p>
165    pub fn set_pipeline_objects(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PipelineObject>>) -> Self {
166        self.inner = self.inner.set_pipeline_objects(input);
167        self
168    }
169    /// <p>The objects that define the pipeline changes to validate against the pipeline.</p>
170    pub fn get_pipeline_objects(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PipelineObject>> {
171        self.inner.get_pipeline_objects()
172    }
173    ///
174    /// Appends an item to `parameterObjects`.
175    ///
176    /// To override the contents of this collection use [`set_parameter_objects`](Self::set_parameter_objects).
177    ///
178    /// <p>The parameter objects used with the pipeline.</p>
179    pub fn parameter_objects(mut self, input: crate::types::ParameterObject) -> Self {
180        self.inner = self.inner.parameter_objects(input);
181        self
182    }
183    /// <p>The parameter objects used with the pipeline.</p>
184    pub fn set_parameter_objects(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ParameterObject>>) -> Self {
185        self.inner = self.inner.set_parameter_objects(input);
186        self
187    }
188    /// <p>The parameter objects used with the pipeline.</p>
189    pub fn get_parameter_objects(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ParameterObject>> {
190        self.inner.get_parameter_objects()
191    }
192    ///
193    /// Appends an item to `parameterValues`.
194    ///
195    /// To override the contents of this collection use [`set_parameter_values`](Self::set_parameter_values).
196    ///
197    /// <p>The parameter values used with the pipeline.</p>
198    pub fn parameter_values(mut self, input: crate::types::ParameterValue) -> Self {
199        self.inner = self.inner.parameter_values(input);
200        self
201    }
202    /// <p>The parameter values used with the pipeline.</p>
203    pub fn set_parameter_values(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ParameterValue>>) -> Self {
204        self.inner = self.inner.set_parameter_values(input);
205        self
206    }
207    /// <p>The parameter values used with the pipeline.</p>
208    pub fn get_parameter_values(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ParameterValue>> {
209        self.inner.get_parameter_values()
210    }
211}