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