aws_sdk_gamelift/operation/list_container_group_definitions/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_container_group_definitions::_list_container_group_definitions_output::ListContainerGroupDefinitionsOutputBuilder;
3
4pub use crate::operation::list_container_group_definitions::_list_container_group_definitions_input::ListContainerGroupDefinitionsInputBuilder;
5
6impl crate::operation::list_container_group_definitions::builders::ListContainerGroupDefinitionsInputBuilder {
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_container_group_definitions::ListContainerGroupDefinitionsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_container_group_definitions::ListContainerGroupDefinitionsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_container_group_definitions();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListContainerGroupDefinitions`.
24///
25/// <p><b>This API works with the following fleet types:</b> Container</p>
26/// <p>Retrieves container group definitions for the Amazon Web Services account and Amazon Web Services Region. Use the pagination parameters to retrieve results in a set of sequential pages.</p>
27/// <p>This operation returns only the latest version of each definition. To retrieve all versions of a container group definition, use <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_ListContainerGroupDefinitionVersions.html">ListContainerGroupDefinitionVersions</a>.</p>
28/// <p><b>Request options:</b></p>
29/// <ul>
30/// <li>
31/// <p>Retrieve the most recent versions of all container group definitions.</p></li>
32/// <li>
33/// <p>Retrieve the most recent versions of all container group definitions, filtered by type. Specify the container group type to filter on.</p></li>
34/// </ul>
35/// <p><b>Results:</b></p>
36/// <p>If successful, this operation returns the complete properties of a set of container group definition versions that match the request.</p><note>
37/// <p>This operation returns the list of container group definitions in no particular order.</p>
38/// </note>
39#[derive(::std::clone::Clone, ::std::fmt::Debug)]
40pub struct ListContainerGroupDefinitionsFluentBuilder {
41    handle: ::std::sync::Arc<crate::client::Handle>,
42    inner: crate::operation::list_container_group_definitions::builders::ListContainerGroupDefinitionsInputBuilder,
43    config_override: ::std::option::Option<crate::config::Builder>,
44}
45impl
46    crate::client::customize::internal::CustomizableSend<
47        crate::operation::list_container_group_definitions::ListContainerGroupDefinitionsOutput,
48        crate::operation::list_container_group_definitions::ListContainerGroupDefinitionsError,
49    > for ListContainerGroupDefinitionsFluentBuilder
50{
51    fn send(
52        self,
53        config_override: crate::config::Builder,
54    ) -> crate::client::customize::internal::BoxFuture<
55        crate::client::customize::internal::SendResult<
56            crate::operation::list_container_group_definitions::ListContainerGroupDefinitionsOutput,
57            crate::operation::list_container_group_definitions::ListContainerGroupDefinitionsError,
58        >,
59    > {
60        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
61    }
62}
63impl ListContainerGroupDefinitionsFluentBuilder {
64    /// Creates a new `ListContainerGroupDefinitionsFluentBuilder`.
65    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
66        Self {
67            handle,
68            inner: ::std::default::Default::default(),
69            config_override: ::std::option::Option::None,
70        }
71    }
72    /// Access the ListContainerGroupDefinitions as a reference.
73    pub fn as_input(&self) -> &crate::operation::list_container_group_definitions::builders::ListContainerGroupDefinitionsInputBuilder {
74        &self.inner
75    }
76    /// Sends the request and returns the response.
77    ///
78    /// If an error occurs, an `SdkError` will be returned with additional details that
79    /// can be matched against.
80    ///
81    /// By default, any retryable failures will be retried twice. Retry behavior
82    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
83    /// set when configuring the client.
84    pub async fn send(
85        self,
86    ) -> ::std::result::Result<
87        crate::operation::list_container_group_definitions::ListContainerGroupDefinitionsOutput,
88        ::aws_smithy_runtime_api::client::result::SdkError<
89            crate::operation::list_container_group_definitions::ListContainerGroupDefinitionsError,
90            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
91        >,
92    > {
93        let input = self
94            .inner
95            .build()
96            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
97        let runtime_plugins = crate::operation::list_container_group_definitions::ListContainerGroupDefinitions::operation_runtime_plugins(
98            self.handle.runtime_plugins.clone(),
99            &self.handle.conf,
100            self.config_override,
101        );
102        crate::operation::list_container_group_definitions::ListContainerGroupDefinitions::orchestrate(&runtime_plugins, input).await
103    }
104
105    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
106    pub fn customize(
107        self,
108    ) -> crate::client::customize::CustomizableOperation<
109        crate::operation::list_container_group_definitions::ListContainerGroupDefinitionsOutput,
110        crate::operation::list_container_group_definitions::ListContainerGroupDefinitionsError,
111        Self,
112    > {
113        crate::client::customize::CustomizableOperation::new(self)
114    }
115    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
116        self.set_config_override(::std::option::Option::Some(config_override.into()));
117        self
118    }
119
120    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
121        self.config_override = config_override;
122        self
123    }
124    /// Create a paginator for this request
125    ///
126    /// Paginators are used by calling [`send().await`](crate::operation::list_container_group_definitions::paginator::ListContainerGroupDefinitionsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
127    pub fn into_paginator(self) -> crate::operation::list_container_group_definitions::paginator::ListContainerGroupDefinitionsPaginator {
128        crate::operation::list_container_group_definitions::paginator::ListContainerGroupDefinitionsPaginator::new(self.handle, self.inner)
129    }
130    /// <p>The type of container group to retrieve. Container group type determines how Amazon GameLift Servers deploys the container group on each fleet instance.</p>
131    pub fn container_group_type(mut self, input: crate::types::ContainerGroupType) -> Self {
132        self.inner = self.inner.container_group_type(input);
133        self
134    }
135    /// <p>The type of container group to retrieve. Container group type determines how Amazon GameLift Servers deploys the container group on each fleet instance.</p>
136    pub fn set_container_group_type(mut self, input: ::std::option::Option<crate::types::ContainerGroupType>) -> Self {
137        self.inner = self.inner.set_container_group_type(input);
138        self
139    }
140    /// <p>The type of container group to retrieve. Container group type determines how Amazon GameLift Servers deploys the container group on each fleet instance.</p>
141    pub fn get_container_group_type(&self) -> &::std::option::Option<crate::types::ContainerGroupType> {
142        self.inner.get_container_group_type()
143    }
144    /// <p>The maximum number of results to return. Use this parameter with <code>NextToken</code> to get results as a set of sequential pages.</p>
145    pub fn limit(mut self, input: i32) -> Self {
146        self.inner = self.inner.limit(input);
147        self
148    }
149    /// <p>The maximum number of results to return. Use this parameter with <code>NextToken</code> to get results as a set of sequential pages.</p>
150    pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
151        self.inner = self.inner.set_limit(input);
152        self
153    }
154    /// <p>The maximum number of results to return. Use this parameter with <code>NextToken</code> to get results as a set of sequential pages.</p>
155    pub fn get_limit(&self) -> &::std::option::Option<i32> {
156        self.inner.get_limit()
157    }
158    /// <p>A token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this operation. To start at the beginning of the result set, do not specify a value.</p>
159    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160        self.inner = self.inner.next_token(input.into());
161        self
162    }
163    /// <p>A token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this operation. To start at the beginning of the result set, do not specify a value.</p>
164    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165        self.inner = self.inner.set_next_token(input);
166        self
167    }
168    /// <p>A token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this operation. To start at the beginning of the result set, do not specify a value.</p>
169    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
170        self.inner.get_next_token()
171    }
172}