aws_sdk_gamelift/operation/create_game_session_queue/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_game_session_queue::_create_game_session_queue_output::CreateGameSessionQueueOutputBuilder;
3
4pub use crate::operation::create_game_session_queue::_create_game_session_queue_input::CreateGameSessionQueueInputBuilder;
5
6impl crate::operation::create_game_session_queue::builders::CreateGameSessionQueueInputBuilder {
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::create_game_session_queue::CreateGameSessionQueueOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_game_session_queue::CreateGameSessionQueueError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_game_session_queue();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateGameSessionQueue`.
24///
25/// <p><b>This API works with the following fleet types:</b> EC2, Anywhere, Container</p>
26/// <p>Creates a placement queue that processes requests for new game sessions. A queue uses FleetIQ algorithms to locate the best available placement locations for a new game session, and then prompts the game server process to start a new game session.</p>
27/// <p>A game session queue is configured with a set of destinations (Amazon GameLift Servers fleets or aliases) that determine where the queue can place new game sessions. These destinations can span multiple Amazon Web Services Regions, can use different instance types, and can include both Spot and On-Demand fleets. If the queue includes multi-location fleets, the queue can place game sessions in any of a fleet's remote locations.</p>
28/// <p>You can configure a queue to determine how it selects the best available placement for a new game session. Queues can prioritize placement decisions based on a combination of location, hosting cost, and player latency. You can set up the queue to use the default prioritization or provide alternate instructions using <code>PriorityConfiguration</code>.</p>
29/// <p><b>Request options</b></p>
30/// <p>Use this operation to make these common types of requests.</p>
31/// <ul>
32/// <li>
33/// <p>Create a queue with the minimum required parameters.</p>
34/// <ul>
35/// <li>
36/// <p><code>Name</code></p></li>
37/// <li>
38/// <p><code>Destinations</code> (This parameter isn't required, but a queue can't make placements without at least one destination.)</p></li>
39/// </ul></li>
40/// <li>
41/// <p>Create a queue with placement notification. Queues that have high placement activity must use a notification system, such as with Amazon Simple Notification Service (Amazon SNS) or Amazon CloudWatch.</p>
42/// <ul>
43/// <li>
44/// <p>Required parameters <code>Name</code> and <code>Destinations</code></p></li>
45/// <li>
46/// <p><code>NotificationTarget</code></p></li>
47/// </ul></li>
48/// <li>
49/// <p>Create a queue with custom prioritization settings. These custom settings replace the default prioritization configuration for a queue.</p>
50/// <ul>
51/// <li>
52/// <p>Required parameters <code>Name</code> and <code>Destinations</code></p></li>
53/// <li>
54/// <p><code>PriorityConfiguration</code></p></li>
55/// </ul></li>
56/// <li>
57/// <p>Create a queue with special rules for processing player latency data.</p>
58/// <ul>
59/// <li>
60/// <p>Required parameters <code>Name</code> and <code>Destinations</code></p></li>
61/// <li>
62/// <p><code>PlayerLatencyPolicies</code></p></li>
63/// </ul></li>
64/// </ul>
65/// <p><b>Results</b></p>
66/// <p>If successful, this operation returns a new <code>GameSessionQueue</code> object with an assigned queue ARN. Use the queue's name or ARN when submitting new game session requests with <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_StartGameSessionPlacement.html">StartGameSessionPlacement</a> or <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_StartMatchmaking.html">StartMatchmaking</a>.</p>
67/// <p><b>Learn more</b></p>
68/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/queues-design.html"> Design a game session queue</a></p>
69/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/queues-creating.html"> Create a game session queue</a></p>
70/// <p><b>Related actions</b></p>
71/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_CreateGameSessionQueue.html">CreateGameSessionQueue</a> | <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeGameSessionQueues.html">DescribeGameSessionQueues</a> | <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_UpdateGameSessionQueue.html">UpdateGameSessionQueue</a> | <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_DeleteGameSessionQueue.html">DeleteGameSessionQueue</a> | <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets">All APIs by task</a></p>
72#[derive(::std::clone::Clone, ::std::fmt::Debug)]
73pub struct CreateGameSessionQueueFluentBuilder {
74 handle: ::std::sync::Arc<crate::client::Handle>,
75 inner: crate::operation::create_game_session_queue::builders::CreateGameSessionQueueInputBuilder,
76 config_override: ::std::option::Option<crate::config::Builder>,
77}
78impl
79 crate::client::customize::internal::CustomizableSend<
80 crate::operation::create_game_session_queue::CreateGameSessionQueueOutput,
81 crate::operation::create_game_session_queue::CreateGameSessionQueueError,
82 > for CreateGameSessionQueueFluentBuilder
83{
84 fn send(
85 self,
86 config_override: crate::config::Builder,
87 ) -> crate::client::customize::internal::BoxFuture<
88 crate::client::customize::internal::SendResult<
89 crate::operation::create_game_session_queue::CreateGameSessionQueueOutput,
90 crate::operation::create_game_session_queue::CreateGameSessionQueueError,
91 >,
92 > {
93 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
94 }
95}
96impl CreateGameSessionQueueFluentBuilder {
97 /// Creates a new `CreateGameSessionQueueFluentBuilder`.
98 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
99 Self {
100 handle,
101 inner: ::std::default::Default::default(),
102 config_override: ::std::option::Option::None,
103 }
104 }
105 /// Access the CreateGameSessionQueue as a reference.
106 pub fn as_input(&self) -> &crate::operation::create_game_session_queue::builders::CreateGameSessionQueueInputBuilder {
107 &self.inner
108 }
109 /// Sends the request and returns the response.
110 ///
111 /// If an error occurs, an `SdkError` will be returned with additional details that
112 /// can be matched against.
113 ///
114 /// By default, any retryable failures will be retried twice. Retry behavior
115 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
116 /// set when configuring the client.
117 pub async fn send(
118 self,
119 ) -> ::std::result::Result<
120 crate::operation::create_game_session_queue::CreateGameSessionQueueOutput,
121 ::aws_smithy_runtime_api::client::result::SdkError<
122 crate::operation::create_game_session_queue::CreateGameSessionQueueError,
123 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
124 >,
125 > {
126 let input = self
127 .inner
128 .build()
129 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
130 let runtime_plugins = crate::operation::create_game_session_queue::CreateGameSessionQueue::operation_runtime_plugins(
131 self.handle.runtime_plugins.clone(),
132 &self.handle.conf,
133 self.config_override,
134 );
135 crate::operation::create_game_session_queue::CreateGameSessionQueue::orchestrate(&runtime_plugins, input).await
136 }
137
138 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
139 pub fn customize(
140 self,
141 ) -> crate::client::customize::CustomizableOperation<
142 crate::operation::create_game_session_queue::CreateGameSessionQueueOutput,
143 crate::operation::create_game_session_queue::CreateGameSessionQueueError,
144 Self,
145 > {
146 crate::client::customize::CustomizableOperation::new(self)
147 }
148 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
149 self.set_config_override(::std::option::Option::Some(config_override.into()));
150 self
151 }
152
153 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
154 self.config_override = config_override;
155 self
156 }
157 /// <p>A descriptive label that is associated with game session queue. Queue names must be unique within each Region.</p>
158 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159 self.inner = self.inner.name(input.into());
160 self
161 }
162 /// <p>A descriptive label that is associated with game session queue. Queue names must be unique within each Region.</p>
163 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164 self.inner = self.inner.set_name(input);
165 self
166 }
167 /// <p>A descriptive label that is associated with game session queue. Queue names must be unique within each Region.</p>
168 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
169 self.inner.get_name()
170 }
171 /// <p>The maximum time, in seconds, that a new game session placement request remains in the queue. When a request exceeds this time, the game session placement changes to a <code>TIMED_OUT</code> status. If you don't specify a request timeout, the queue uses a default value.</p>
172 pub fn timeout_in_seconds(mut self, input: i32) -> Self {
173 self.inner = self.inner.timeout_in_seconds(input);
174 self
175 }
176 /// <p>The maximum time, in seconds, that a new game session placement request remains in the queue. When a request exceeds this time, the game session placement changes to a <code>TIMED_OUT</code> status. If you don't specify a request timeout, the queue uses a default value.</p>
177 pub fn set_timeout_in_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
178 self.inner = self.inner.set_timeout_in_seconds(input);
179 self
180 }
181 /// <p>The maximum time, in seconds, that a new game session placement request remains in the queue. When a request exceeds this time, the game session placement changes to a <code>TIMED_OUT</code> status. If you don't specify a request timeout, the queue uses a default value.</p>
182 pub fn get_timeout_in_seconds(&self) -> &::std::option::Option<i32> {
183 self.inner.get_timeout_in_seconds()
184 }
185 ///
186 /// Appends an item to `PlayerLatencyPolicies`.
187 ///
188 /// To override the contents of this collection use [`set_player_latency_policies`](Self::set_player_latency_policies).
189 ///
190 /// <p>A set of policies that enforce a sliding cap on player latency when processing game sessions placement requests. Use multiple policies to gradually relax the cap over time if Amazon GameLift Servers can't make a placement. Policies are evaluated in order starting with the lowest maximum latency value.</p>
191 pub fn player_latency_policies(mut self, input: crate::types::PlayerLatencyPolicy) -> Self {
192 self.inner = self.inner.player_latency_policies(input);
193 self
194 }
195 /// <p>A set of policies that enforce a sliding cap on player latency when processing game sessions placement requests. Use multiple policies to gradually relax the cap over time if Amazon GameLift Servers can't make a placement. Policies are evaluated in order starting with the lowest maximum latency value.</p>
196 pub fn set_player_latency_policies(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PlayerLatencyPolicy>>) -> Self {
197 self.inner = self.inner.set_player_latency_policies(input);
198 self
199 }
200 /// <p>A set of policies that enforce a sliding cap on player latency when processing game sessions placement requests. Use multiple policies to gradually relax the cap over time if Amazon GameLift Servers can't make a placement. Policies are evaluated in order starting with the lowest maximum latency value.</p>
201 pub fn get_player_latency_policies(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PlayerLatencyPolicy>> {
202 self.inner.get_player_latency_policies()
203 }
204 ///
205 /// Appends an item to `Destinations`.
206 ///
207 /// To override the contents of this collection use [`set_destinations`](Self::set_destinations).
208 ///
209 /// <p>A list of fleets and/or fleet aliases that can be used to fulfill game session placement requests in the queue. Destinations are identified by either a fleet ARN or a fleet alias ARN, and are listed in order of placement preference.</p>
210 pub fn destinations(mut self, input: crate::types::GameSessionQueueDestination) -> Self {
211 self.inner = self.inner.destinations(input);
212 self
213 }
214 /// <p>A list of fleets and/or fleet aliases that can be used to fulfill game session placement requests in the queue. Destinations are identified by either a fleet ARN or a fleet alias ARN, and are listed in order of placement preference.</p>
215 pub fn set_destinations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GameSessionQueueDestination>>) -> Self {
216 self.inner = self.inner.set_destinations(input);
217 self
218 }
219 /// <p>A list of fleets and/or fleet aliases that can be used to fulfill game session placement requests in the queue. Destinations are identified by either a fleet ARN or a fleet alias ARN, and are listed in order of placement preference.</p>
220 pub fn get_destinations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GameSessionQueueDestination>> {
221 self.inner.get_destinations()
222 }
223 /// <p>A list of locations where a queue is allowed to place new game sessions. Locations are specified in the form of Amazon Web Services Region codes, such as <code>us-west-2</code>. If this parameter is not set, game sessions can be placed in any queue location.</p>
224 pub fn filter_configuration(mut self, input: crate::types::FilterConfiguration) -> Self {
225 self.inner = self.inner.filter_configuration(input);
226 self
227 }
228 /// <p>A list of locations where a queue is allowed to place new game sessions. Locations are specified in the form of Amazon Web Services Region codes, such as <code>us-west-2</code>. If this parameter is not set, game sessions can be placed in any queue location.</p>
229 pub fn set_filter_configuration(mut self, input: ::std::option::Option<crate::types::FilterConfiguration>) -> Self {
230 self.inner = self.inner.set_filter_configuration(input);
231 self
232 }
233 /// <p>A list of locations where a queue is allowed to place new game sessions. Locations are specified in the form of Amazon Web Services Region codes, such as <code>us-west-2</code>. If this parameter is not set, game sessions can be placed in any queue location.</p>
234 pub fn get_filter_configuration(&self) -> &::std::option::Option<crate::types::FilterConfiguration> {
235 self.inner.get_filter_configuration()
236 }
237 /// <p>Custom settings to use when prioritizing destinations and locations for game session placements. This configuration replaces the FleetIQ default prioritization process. Priority types that are not explicitly named will be automatically applied at the end of the prioritization process.</p>
238 pub fn priority_configuration(mut self, input: crate::types::PriorityConfiguration) -> Self {
239 self.inner = self.inner.priority_configuration(input);
240 self
241 }
242 /// <p>Custom settings to use when prioritizing destinations and locations for game session placements. This configuration replaces the FleetIQ default prioritization process. Priority types that are not explicitly named will be automatically applied at the end of the prioritization process.</p>
243 pub fn set_priority_configuration(mut self, input: ::std::option::Option<crate::types::PriorityConfiguration>) -> Self {
244 self.inner = self.inner.set_priority_configuration(input);
245 self
246 }
247 /// <p>Custom settings to use when prioritizing destinations and locations for game session placements. This configuration replaces the FleetIQ default prioritization process. Priority types that are not explicitly named will be automatically applied at the end of the prioritization process.</p>
248 pub fn get_priority_configuration(&self) -> &::std::option::Option<crate::types::PriorityConfiguration> {
249 self.inner.get_priority_configuration()
250 }
251 /// <p>Information to be added to all events that are related to this game session queue.</p>
252 pub fn custom_event_data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
253 self.inner = self.inner.custom_event_data(input.into());
254 self
255 }
256 /// <p>Information to be added to all events that are related to this game session queue.</p>
257 pub fn set_custom_event_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
258 self.inner = self.inner.set_custom_event_data(input);
259 self
260 }
261 /// <p>Information to be added to all events that are related to this game session queue.</p>
262 pub fn get_custom_event_data(&self) -> &::std::option::Option<::std::string::String> {
263 self.inner.get_custom_event_data()
264 }
265 /// <p>An SNS topic ARN that is set up to receive game session placement notifications. See <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/queue-notification.html"> Setting up notifications for game session placement</a>.</p>
266 pub fn notification_target(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
267 self.inner = self.inner.notification_target(input.into());
268 self
269 }
270 /// <p>An SNS topic ARN that is set up to receive game session placement notifications. See <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/queue-notification.html"> Setting up notifications for game session placement</a>.</p>
271 pub fn set_notification_target(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
272 self.inner = self.inner.set_notification_target(input);
273 self
274 }
275 /// <p>An SNS topic ARN that is set up to receive game session placement notifications. See <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/queue-notification.html"> Setting up notifications for game session placement</a>.</p>
276 pub fn get_notification_target(&self) -> &::std::option::Option<::std::string::String> {
277 self.inner.get_notification_target()
278 }
279 ///
280 /// Appends an item to `Tags`.
281 ///
282 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
283 ///
284 /// <p>A list of labels to assign to the new game session queue resource. Tags are developer-defined key-value pairs. Tagging Amazon Web Services resources are useful for resource management, access management and cost allocation. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html"> Tagging Amazon Web Services Resources</a> in the <i>Amazon Web Services General Reference</i>.</p>
285 pub fn tags(mut self, input: crate::types::Tag) -> Self {
286 self.inner = self.inner.tags(input);
287 self
288 }
289 /// <p>A list of labels to assign to the new game session queue resource. Tags are developer-defined key-value pairs. Tagging Amazon Web Services resources are useful for resource management, access management and cost allocation. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html"> Tagging Amazon Web Services Resources</a> in the <i>Amazon Web Services General Reference</i>.</p>
290 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
291 self.inner = self.inner.set_tags(input);
292 self
293 }
294 /// <p>A list of labels to assign to the new game session queue resource. Tags are developer-defined key-value pairs. Tagging Amazon Web Services resources are useful for resource management, access management and cost allocation. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html"> Tagging Amazon Web Services Resources</a> in the <i>Amazon Web Services General Reference</i>.</p>
295 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
296 self.inner.get_tags()
297 }
298}