aws_sdk_gamelift/operation/list_builds/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_builds::_list_builds_output::ListBuildsOutputBuilder;
3
4pub use crate::operation::list_builds::_list_builds_input::ListBuildsInputBuilder;
5
6impl crate::operation::list_builds::builders::ListBuildsInputBuilder {
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_builds::ListBuildsOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::list_builds::ListBuildsError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.list_builds();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `ListBuilds`.
24///
25/// <p>Retrieves build resources for all builds associated with the Amazon Web Services account in use. You can limit results to builds that are in a specific status by using the <code>Status</code> parameter. Use the pagination parameters to retrieve results in a set of sequential pages.</p><note>
26/// <p>Build resources are not listed in any particular order.</p>
27/// </note>
28/// <p><b>Learn more</b></p>
29/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-intro.html"> Upload a Custom Server Build</a></p>
30/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets">All APIs by task</a></p>
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct ListBuildsFluentBuilder {
33 handle: ::std::sync::Arc<crate::client::Handle>,
34 inner: crate::operation::list_builds::builders::ListBuildsInputBuilder,
35 config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38 crate::client::customize::internal::CustomizableSend<
39 crate::operation::list_builds::ListBuildsOutput,
40 crate::operation::list_builds::ListBuildsError,
41 > for ListBuildsFluentBuilder
42{
43 fn send(
44 self,
45 config_override: crate::config::Builder,
46 ) -> crate::client::customize::internal::BoxFuture<
47 crate::client::customize::internal::SendResult<
48 crate::operation::list_builds::ListBuildsOutput,
49 crate::operation::list_builds::ListBuildsError,
50 >,
51 > {
52 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53 }
54}
55impl ListBuildsFluentBuilder {
56 /// Creates a new `ListBuildsFluentBuilder`.
57 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
58 Self {
59 handle,
60 inner: ::std::default::Default::default(),
61 config_override: ::std::option::Option::None,
62 }
63 }
64 /// Access the ListBuilds as a reference.
65 pub fn as_input(&self) -> &crate::operation::list_builds::builders::ListBuildsInputBuilder {
66 &self.inner
67 }
68 /// Sends the request and returns the response.
69 ///
70 /// If an error occurs, an `SdkError` will be returned with additional details that
71 /// can be matched against.
72 ///
73 /// By default, any retryable failures will be retried twice. Retry behavior
74 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
75 /// set when configuring the client.
76 pub async fn send(
77 self,
78 ) -> ::std::result::Result<
79 crate::operation::list_builds::ListBuildsOutput,
80 ::aws_smithy_runtime_api::client::result::SdkError<
81 crate::operation::list_builds::ListBuildsError,
82 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
83 >,
84 > {
85 let input = self
86 .inner
87 .build()
88 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
89 let runtime_plugins = crate::operation::list_builds::ListBuilds::operation_runtime_plugins(
90 self.handle.runtime_plugins.clone(),
91 &self.handle.conf,
92 self.config_override,
93 );
94 crate::operation::list_builds::ListBuilds::orchestrate(&runtime_plugins, input).await
95 }
96
97 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98 pub fn customize(
99 self,
100 ) -> crate::client::customize::CustomizableOperation<
101 crate::operation::list_builds::ListBuildsOutput,
102 crate::operation::list_builds::ListBuildsError,
103 Self,
104 > {
105 crate::client::customize::CustomizableOperation::new(self)
106 }
107 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108 self.set_config_override(::std::option::Option::Some(config_override.into()));
109 self
110 }
111
112 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113 self.config_override = config_override;
114 self
115 }
116 /// Create a paginator for this request
117 ///
118 /// Paginators are used by calling [`send().await`](crate::operation::list_builds::paginator::ListBuildsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
119 pub fn into_paginator(self) -> crate::operation::list_builds::paginator::ListBuildsPaginator {
120 crate::operation::list_builds::paginator::ListBuildsPaginator::new(self.handle, self.inner)
121 }
122 /// <p>Build status to filter results by. To retrieve all builds, leave this parameter empty.</p>
123 /// <p>Possible build statuses include the following:</p>
124 /// <ul>
125 /// <li>
126 /// <p><b>INITIALIZED</b> -- A new build has been defined, but no files have been uploaded. You cannot create fleets for builds that are in this status. When a build is successfully created, the build status is set to this value.</p></li>
127 /// <li>
128 /// <p><b>READY</b> -- The game build has been successfully uploaded. You can now create new fleets for this build.</p></li>
129 /// <li>
130 /// <p><b>FAILED</b> -- The game build upload failed. You cannot create new fleets for this build.</p></li>
131 /// </ul>
132 pub fn status(mut self, input: crate::types::BuildStatus) -> Self {
133 self.inner = self.inner.status(input);
134 self
135 }
136 /// <p>Build status to filter results by. To retrieve all builds, leave this parameter empty.</p>
137 /// <p>Possible build statuses include the following:</p>
138 /// <ul>
139 /// <li>
140 /// <p><b>INITIALIZED</b> -- A new build has been defined, but no files have been uploaded. You cannot create fleets for builds that are in this status. When a build is successfully created, the build status is set to this value.</p></li>
141 /// <li>
142 /// <p><b>READY</b> -- The game build has been successfully uploaded. You can now create new fleets for this build.</p></li>
143 /// <li>
144 /// <p><b>FAILED</b> -- The game build upload failed. You cannot create new fleets for this build.</p></li>
145 /// </ul>
146 pub fn set_status(mut self, input: ::std::option::Option<crate::types::BuildStatus>) -> Self {
147 self.inner = self.inner.set_status(input);
148 self
149 }
150 /// <p>Build status to filter results by. To retrieve all builds, leave this parameter empty.</p>
151 /// <p>Possible build statuses include the following:</p>
152 /// <ul>
153 /// <li>
154 /// <p><b>INITIALIZED</b> -- A new build has been defined, but no files have been uploaded. You cannot create fleets for builds that are in this status. When a build is successfully created, the build status is set to this value.</p></li>
155 /// <li>
156 /// <p><b>READY</b> -- The game build has been successfully uploaded. You can now create new fleets for this build.</p></li>
157 /// <li>
158 /// <p><b>FAILED</b> -- The game build upload failed. You cannot create new fleets for this build.</p></li>
159 /// </ul>
160 pub fn get_status(&self) -> &::std::option::Option<crate::types::BuildStatus> {
161 self.inner.get_status()
162 }
163 /// <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>
164 pub fn limit(mut self, input: i32) -> Self {
165 self.inner = self.inner.limit(input);
166 self
167 }
168 /// <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>
169 pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
170 self.inner = self.inner.set_limit(input);
171 self
172 }
173 /// <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>
174 pub fn get_limit(&self) -> &::std::option::Option<i32> {
175 self.inner.get_limit()
176 }
177 /// <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>
178 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
179 self.inner = self.inner.next_token(input.into());
180 self
181 }
182 /// <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>
183 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
184 self.inner = self.inner.set_next_token(input);
185 self
186 }
187 /// <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>
188 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
189 self.inner.get_next_token()
190 }
191}