aws_sdk_datapipeline/operation/query_objects/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::query_objects::_query_objects_output::QueryObjectsOutputBuilder;
3
4pub use crate::operation::query_objects::_query_objects_input::QueryObjectsInputBuilder;
5
6impl crate::operation::query_objects::builders::QueryObjectsInputBuilder {
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::query_objects::QueryObjectsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::query_objects::QueryObjectsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.query_objects();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `QueryObjects`.
24///
25/// <p>Queries the specified pipeline for the names of objects that match the specified set of conditions.</p><examples>
26/// <request>
27/// POST / HTTP/1.1 Content-Type: application/x-amz-json-1.1 X-Amz-Target: DataPipeline.QueryObjects Content-Length: 123 Host: datapipeline.us-east-1.amazonaws.com X-Amz-Date: Mon, 12 Nov 2012 17:49:52 GMT Authorization: AuthParams {"pipelineId": "df-06372391ZG65EXAMPLE", "query": {"selectors": \[ \] }, "sphere": "INSTANCE", "marker": "", "limit": 10}
28/// </request>
29/// <response>
30/// x-amzn-RequestId: 14d704c1-0775-11e2-af6f-6bc7a6be60d9 Content-Type: application/x-amz-json-1.1 Content-Length: 72 Date: Mon, 12 Nov 2012 17:50:53 GMT {"hasMoreResults": false, "ids": \["@SayHello_1_2012-09-25T17:00:00"\] }
31/// </response>
32/// </examples>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct QueryObjectsFluentBuilder {
35    handle: ::std::sync::Arc<crate::client::Handle>,
36    inner: crate::operation::query_objects::builders::QueryObjectsInputBuilder,
37    config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40    crate::client::customize::internal::CustomizableSend<
41        crate::operation::query_objects::QueryObjectsOutput,
42        crate::operation::query_objects::QueryObjectsError,
43    > for QueryObjectsFluentBuilder
44{
45    fn send(
46        self,
47        config_override: crate::config::Builder,
48    ) -> crate::client::customize::internal::BoxFuture<
49        crate::client::customize::internal::SendResult<
50            crate::operation::query_objects::QueryObjectsOutput,
51            crate::operation::query_objects::QueryObjectsError,
52        >,
53    > {
54        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55    }
56}
57impl QueryObjectsFluentBuilder {
58    /// Creates a new `QueryObjectsFluentBuilder`.
59    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
60        Self {
61            handle,
62            inner: ::std::default::Default::default(),
63            config_override: ::std::option::Option::None,
64        }
65    }
66    /// Access the QueryObjects as a reference.
67    pub fn as_input(&self) -> &crate::operation::query_objects::builders::QueryObjectsInputBuilder {
68        &self.inner
69    }
70    /// Sends the request and returns the response.
71    ///
72    /// If an error occurs, an `SdkError` will be returned with additional details that
73    /// can be matched against.
74    ///
75    /// By default, any retryable failures will be retried twice. Retry behavior
76    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
77    /// set when configuring the client.
78    pub async fn send(
79        self,
80    ) -> ::std::result::Result<
81        crate::operation::query_objects::QueryObjectsOutput,
82        ::aws_smithy_runtime_api::client::result::SdkError<
83            crate::operation::query_objects::QueryObjectsError,
84            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
85        >,
86    > {
87        let input = self
88            .inner
89            .build()
90            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
91        let runtime_plugins = crate::operation::query_objects::QueryObjects::operation_runtime_plugins(
92            self.handle.runtime_plugins.clone(),
93            &self.handle.conf,
94            self.config_override,
95        );
96        crate::operation::query_objects::QueryObjects::orchestrate(&runtime_plugins, input).await
97    }
98
99    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
100    pub fn customize(
101        self,
102    ) -> crate::client::customize::CustomizableOperation<
103        crate::operation::query_objects::QueryObjectsOutput,
104        crate::operation::query_objects::QueryObjectsError,
105        Self,
106    > {
107        crate::client::customize::CustomizableOperation::new(self)
108    }
109    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
110        self.set_config_override(::std::option::Option::Some(config_override.into()));
111        self
112    }
113
114    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
115        self.config_override = config_override;
116        self
117    }
118    /// Create a paginator for this request
119    ///
120    /// Paginators are used by calling [`send().await`](crate::operation::query_objects::paginator::QueryObjectsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
121    pub fn into_paginator(self) -> crate::operation::query_objects::paginator::QueryObjectsPaginator {
122        crate::operation::query_objects::paginator::QueryObjectsPaginator::new(self.handle, self.inner)
123    }
124    /// <p>The ID of the pipeline.</p>
125    pub fn pipeline_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126        self.inner = self.inner.pipeline_id(input.into());
127        self
128    }
129    /// <p>The ID of the pipeline.</p>
130    pub fn set_pipeline_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.inner = self.inner.set_pipeline_id(input);
132        self
133    }
134    /// <p>The ID of the pipeline.</p>
135    pub fn get_pipeline_id(&self) -> &::std::option::Option<::std::string::String> {
136        self.inner.get_pipeline_id()
137    }
138    /// <p>The query that defines the objects to be returned. The <code>Query</code> object can contain a maximum of ten selectors. The conditions in the query are limited to top-level String fields in the object. These filters can be applied to components, instances, and attempts.</p>
139    pub fn query(mut self, input: crate::types::Query) -> Self {
140        self.inner = self.inner.query(input);
141        self
142    }
143    /// <p>The query that defines the objects to be returned. The <code>Query</code> object can contain a maximum of ten selectors. The conditions in the query are limited to top-level String fields in the object. These filters can be applied to components, instances, and attempts.</p>
144    pub fn set_query(mut self, input: ::std::option::Option<crate::types::Query>) -> Self {
145        self.inner = self.inner.set_query(input);
146        self
147    }
148    /// <p>The query that defines the objects to be returned. The <code>Query</code> object can contain a maximum of ten selectors. The conditions in the query are limited to top-level String fields in the object. These filters can be applied to components, instances, and attempts.</p>
149    pub fn get_query(&self) -> &::std::option::Option<crate::types::Query> {
150        self.inner.get_query()
151    }
152    /// <p>Indicates whether the query applies to components or instances. The possible values are: <code>COMPONENT</code>, <code>INSTANCE</code>, and <code>ATTEMPT</code>.</p>
153    pub fn sphere(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154        self.inner = self.inner.sphere(input.into());
155        self
156    }
157    /// <p>Indicates whether the query applies to components or instances. The possible values are: <code>COMPONENT</code>, <code>INSTANCE</code>, and <code>ATTEMPT</code>.</p>
158    pub fn set_sphere(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159        self.inner = self.inner.set_sphere(input);
160        self
161    }
162    /// <p>Indicates whether the query applies to components or instances. The possible values are: <code>COMPONENT</code>, <code>INSTANCE</code>, and <code>ATTEMPT</code>.</p>
163    pub fn get_sphere(&self) -> &::std::option::Option<::std::string::String> {
164        self.inner.get_sphere()
165    }
166    /// <p>The starting point for the results to be returned. For the first call, this value should be empty. As long as there are more results, continue to call <code>QueryObjects</code> with the marker value from the previous call to retrieve the next set of results.</p>
167    pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
168        self.inner = self.inner.marker(input.into());
169        self
170    }
171    /// <p>The starting point for the results to be returned. For the first call, this value should be empty. As long as there are more results, continue to call <code>QueryObjects</code> with the marker value from the previous call to retrieve the next set of results.</p>
172    pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
173        self.inner = self.inner.set_marker(input);
174        self
175    }
176    /// <p>The starting point for the results to be returned. For the first call, this value should be empty. As long as there are more results, continue to call <code>QueryObjects</code> with the marker value from the previous call to retrieve the next set of results.</p>
177    pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
178        self.inner.get_marker()
179    }
180    /// <p>The maximum number of object names that <code>QueryObjects</code> will return in a single call. The default value is 100.</p>
181    pub fn limit(mut self, input: i32) -> Self {
182        self.inner = self.inner.limit(input);
183        self
184    }
185    /// <p>The maximum number of object names that <code>QueryObjects</code> will return in a single call. The default value is 100.</p>
186    pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
187        self.inner = self.inner.set_limit(input);
188        self
189    }
190    /// <p>The maximum number of object names that <code>QueryObjects</code> will return in a single call. The default value is 100.</p>
191    pub fn get_limit(&self) -> &::std::option::Option<i32> {
192        self.inner.get_limit()
193    }
194}