aws_sdk_datazone/operation/list_subscriptions/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_subscriptions::_list_subscriptions_output::ListSubscriptionsOutputBuilder;
3
4pub use crate::operation::list_subscriptions::_list_subscriptions_input::ListSubscriptionsInputBuilder;
5
6impl crate::operation::list_subscriptions::builders::ListSubscriptionsInputBuilder {
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::list_subscriptions::ListSubscriptionsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_subscriptions::ListSubscriptionsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_subscriptions();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListSubscriptions`.
24///
25/// <p>Lists subscriptions in Amazon DataZone.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct ListSubscriptionsFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::list_subscriptions::builders::ListSubscriptionsInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::list_subscriptions::ListSubscriptionsOutput,
35        crate::operation::list_subscriptions::ListSubscriptionsError,
36    > for ListSubscriptionsFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::list_subscriptions::ListSubscriptionsOutput,
44            crate::operation::list_subscriptions::ListSubscriptionsError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl ListSubscriptionsFluentBuilder {
51    /// Creates a new `ListSubscriptionsFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the ListSubscriptions as a reference.
60    pub fn as_input(&self) -> &crate::operation::list_subscriptions::builders::ListSubscriptionsInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::list_subscriptions::ListSubscriptionsOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::list_subscriptions::ListSubscriptionsError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::list_subscriptions::ListSubscriptions::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::list_subscriptions::ListSubscriptions::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::list_subscriptions::ListSubscriptionsOutput,
97        crate::operation::list_subscriptions::ListSubscriptionsError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// Create a paginator for this request
112    ///
113    /// Paginators are used by calling [`send().await`](crate::operation::list_subscriptions::paginator::ListSubscriptionsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
114    pub fn into_paginator(self) -> crate::operation::list_subscriptions::paginator::ListSubscriptionsPaginator {
115        crate::operation::list_subscriptions::paginator::ListSubscriptionsPaginator::new(self.handle, self.inner)
116    }
117    /// <p>The identifier of the Amazon DataZone domain.</p>
118    pub fn domain_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.inner = self.inner.domain_identifier(input.into());
120        self
121    }
122    /// <p>The identifier of the Amazon DataZone domain.</p>
123    pub fn set_domain_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.inner = self.inner.set_domain_identifier(input);
125        self
126    }
127    /// <p>The identifier of the Amazon DataZone domain.</p>
128    pub fn get_domain_identifier(&self) -> &::std::option::Option<::std::string::String> {
129        self.inner.get_domain_identifier()
130    }
131    /// <p>The identifier of the subscription request for the subscriptions that you want to list.</p>
132    pub fn subscription_request_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.inner = self.inner.subscription_request_identifier(input.into());
134        self
135    }
136    /// <p>The identifier of the subscription request for the subscriptions that you want to list.</p>
137    pub fn set_subscription_request_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.inner = self.inner.set_subscription_request_identifier(input);
139        self
140    }
141    /// <p>The identifier of the subscription request for the subscriptions that you want to list.</p>
142    pub fn get_subscription_request_identifier(&self) -> &::std::option::Option<::std::string::String> {
143        self.inner.get_subscription_request_identifier()
144    }
145    /// <p>The status of the subscriptions that you want to list.</p><note>
146    /// <p>This is not a required parameter, but if not provided, by default, Amazon DataZone returns only <code>APPROVED</code> subscriptions.</p>
147    /// </note>
148    pub fn status(mut self, input: crate::types::SubscriptionStatus) -> Self {
149        self.inner = self.inner.status(input);
150        self
151    }
152    /// <p>The status of the subscriptions that you want to list.</p><note>
153    /// <p>This is not a required parameter, but if not provided, by default, Amazon DataZone returns only <code>APPROVED</code> subscriptions.</p>
154    /// </note>
155    pub fn set_status(mut self, input: ::std::option::Option<crate::types::SubscriptionStatus>) -> Self {
156        self.inner = self.inner.set_status(input);
157        self
158    }
159    /// <p>The status of the subscriptions that you want to list.</p><note>
160    /// <p>This is not a required parameter, but if not provided, by default, Amazon DataZone returns only <code>APPROVED</code> subscriptions.</p>
161    /// </note>
162    pub fn get_status(&self) -> &::std::option::Option<crate::types::SubscriptionStatus> {
163        self.inner.get_status()
164    }
165    /// <p>The identifier of the subscribed listing for the subscriptions that you want to list.</p>
166    pub fn subscribed_listing_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167        self.inner = self.inner.subscribed_listing_id(input.into());
168        self
169    }
170    /// <p>The identifier of the subscribed listing for the subscriptions that you want to list.</p>
171    pub fn set_subscribed_listing_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172        self.inner = self.inner.set_subscribed_listing_id(input);
173        self
174    }
175    /// <p>The identifier of the subscribed listing for the subscriptions that you want to list.</p>
176    pub fn get_subscribed_listing_id(&self) -> &::std::option::Option<::std::string::String> {
177        self.inner.get_subscribed_listing_id()
178    }
179    /// <p>The identifier of the owning project.</p>
180    pub fn owning_project_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
181        self.inner = self.inner.owning_project_id(input.into());
182        self
183    }
184    /// <p>The identifier of the owning project.</p>
185    pub fn set_owning_project_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
186        self.inner = self.inner.set_owning_project_id(input);
187        self
188    }
189    /// <p>The identifier of the owning project.</p>
190    pub fn get_owning_project_id(&self) -> &::std::option::Option<::std::string::String> {
191        self.inner.get_owning_project_id()
192    }
193    /// <p>The identifier of the project for the subscription's approver.</p>
194    pub fn approver_project_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
195        self.inner = self.inner.approver_project_id(input.into());
196        self
197    }
198    /// <p>The identifier of the project for the subscription's approver.</p>
199    pub fn set_approver_project_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
200        self.inner = self.inner.set_approver_project_id(input);
201        self
202    }
203    /// <p>The identifier of the project for the subscription's approver.</p>
204    pub fn get_approver_project_id(&self) -> &::std::option::Option<::std::string::String> {
205        self.inner.get_approver_project_id()
206    }
207    /// <p>Specifies the way in which the results of this action are to be sorted.</p>
208    pub fn sort_by(mut self, input: crate::types::SortKey) -> Self {
209        self.inner = self.inner.sort_by(input);
210        self
211    }
212    /// <p>Specifies the way in which the results of this action are to be sorted.</p>
213    pub fn set_sort_by(mut self, input: ::std::option::Option<crate::types::SortKey>) -> Self {
214        self.inner = self.inner.set_sort_by(input);
215        self
216    }
217    /// <p>Specifies the way in which the results of this action are to be sorted.</p>
218    pub fn get_sort_by(&self) -> &::std::option::Option<crate::types::SortKey> {
219        self.inner.get_sort_by()
220    }
221    /// <p>Specifies the sort order for the results of this action.</p>
222    pub fn sort_order(mut self, input: crate::types::SortOrder) -> Self {
223        self.inner = self.inner.sort_order(input);
224        self
225    }
226    /// <p>Specifies the sort order for the results of this action.</p>
227    pub fn set_sort_order(mut self, input: ::std::option::Option<crate::types::SortOrder>) -> Self {
228        self.inner = self.inner.set_sort_order(input);
229        self
230    }
231    /// <p>Specifies the sort order for the results of this action.</p>
232    pub fn get_sort_order(&self) -> &::std::option::Option<crate::types::SortOrder> {
233        self.inner.get_sort_order()
234    }
235    /// <p>The maximum number of subscriptions to return in a single call to <code>ListSubscriptions</code>. When the number of subscriptions to be listed is greater than the value of <code>MaxResults</code>, the response contains a <code>NextToken</code> value that you can use in a subsequent call to <code>ListSubscriptions</code> to list the next set of Subscriptions.</p>
236    pub fn max_results(mut self, input: i32) -> Self {
237        self.inner = self.inner.max_results(input);
238        self
239    }
240    /// <p>The maximum number of subscriptions to return in a single call to <code>ListSubscriptions</code>. When the number of subscriptions to be listed is greater than the value of <code>MaxResults</code>, the response contains a <code>NextToken</code> value that you can use in a subsequent call to <code>ListSubscriptions</code> to list the next set of Subscriptions.</p>
241    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
242        self.inner = self.inner.set_max_results(input);
243        self
244    }
245    /// <p>The maximum number of subscriptions to return in a single call to <code>ListSubscriptions</code>. When the number of subscriptions to be listed is greater than the value of <code>MaxResults</code>, the response contains a <code>NextToken</code> value that you can use in a subsequent call to <code>ListSubscriptions</code> to list the next set of Subscriptions.</p>
246    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
247        self.inner.get_max_results()
248    }
249    /// <p>When the number of subscriptions is greater than the default value for the <code>MaxResults</code> parameter, or if you explicitly specify a value for <code>MaxResults</code> that is less than the number of subscriptions, the response includes a pagination token named <code>NextToken</code>. You can specify this <code>NextToken</code> value in a subsequent call to <code>ListSubscriptions</code> to list the next set of subscriptions.</p>
250    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
251        self.inner = self.inner.next_token(input.into());
252        self
253    }
254    /// <p>When the number of subscriptions is greater than the default value for the <code>MaxResults</code> parameter, or if you explicitly specify a value for <code>MaxResults</code> that is less than the number of subscriptions, the response includes a pagination token named <code>NextToken</code>. You can specify this <code>NextToken</code> value in a subsequent call to <code>ListSubscriptions</code> to list the next set of subscriptions.</p>
255    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
256        self.inner = self.inner.set_next_token(input);
257        self
258    }
259    /// <p>When the number of subscriptions is greater than the default value for the <code>MaxResults</code> parameter, or if you explicitly specify a value for <code>MaxResults</code> that is less than the number of subscriptions, the response includes a pagination token named <code>NextToken</code>. You can specify this <code>NextToken</code> value in a subsequent call to <code>ListSubscriptions</code> to list the next set of subscriptions.</p>
260    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
261        self.inner.get_next_token()
262    }
263}