1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateGameSessionInput {
/// <p>A unique identifier for the fleet to create a game session in. You can use either the fleet ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.</p>
#[doc(hidden)]
pub fleet_id: std::option::Option<std::string::String>,
/// <p>A unique identifier for the alias associated with the fleet to create a game session in. You can use either the alias ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.</p>
#[doc(hidden)]
pub alias_id: std::option::Option<std::string::String>,
/// <p>The maximum number of players that can be connected simultaneously to the game session.</p>
#[doc(hidden)]
pub maximum_player_session_count: std::option::Option<i32>,
/// <p>A descriptive label that is associated with a game session. Session names do not need to be unique.</p>
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
/// <p>A set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process with a request to start a new game session (see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a Game Session</a>).</p>
#[doc(hidden)]
pub game_properties: std::option::Option<std::vec::Vec<crate::types::GameProperty>>,
/// <p>A unique identifier for a player or entity creating the game session. This parameter is required when requesting a new game session on a fleet with a resource creation limit policy. This type of policy limits the number of concurrent active game sessions that one player can create within a certain time span. GameLift uses the CreatorId to evaluate the new request against the policy.</p>
#[doc(hidden)]
pub creator_id: std::option::Option<std::string::String>,
/// <p> <i>This parameter is deprecated. Use <code>IdempotencyToken</code> instead.</i> </p>
/// <p>Custom string that uniquely identifies a request for a new game session. Maximum token length is 48 characters. If provided, this string is included in the new game session's ID.</p>
#[doc(hidden)]
pub game_session_id: std::option::Option<std::string::String>,
/// <p>Custom string that uniquely identifies the new game session request. This is useful for ensuring that game session requests with the same idempotency token are processed only once. Subsequent requests with the same string return the original <code>GameSession</code> object, with an updated status. Maximum token length is 48 characters. If provided, this string is included in the new game session's ID. A game session ARN has the following format: <code>arn:aws:gamelift:
/// <region>
/// ::gamesession/
/// <fleet id>
/// /
/// <custom id string or idempotency token></custom>
/// </fleet>
/// </region></code>. Idempotency tokens remain in use for 30 days after a game session has ended; game session objects are retained for this time period and then deleted.</p>
#[doc(hidden)]
pub idempotency_token: std::option::Option<std::string::String>,
/// <p>A set of custom game session properties, formatted as a single string value. This data is passed to a game server process with a request to start a new game session (see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a Game Session</a>).</p>
#[doc(hidden)]
pub game_session_data: std::option::Option<std::string::String>,
/// <p>A fleet's remote location to place the new game session in. If this parameter is not set, the new game session is placed in the fleet's home Region. Specify a remote location with an Amazon Web Services Region code such as <code>us-west-2</code>. </p>
#[doc(hidden)]
pub location: std::option::Option<std::string::String>,
}
impl CreateGameSessionInput {
/// <p>A unique identifier for the fleet to create a game session in. You can use either the fleet ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.</p>
pub fn fleet_id(&self) -> std::option::Option<&str> {
self.fleet_id.as_deref()
}
/// <p>A unique identifier for the alias associated with the fleet to create a game session in. You can use either the alias ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.</p>
pub fn alias_id(&self) -> std::option::Option<&str> {
self.alias_id.as_deref()
}
/// <p>The maximum number of players that can be connected simultaneously to the game session.</p>
pub fn maximum_player_session_count(&self) -> std::option::Option<i32> {
self.maximum_player_session_count
}
/// <p>A descriptive label that is associated with a game session. Session names do not need to be unique.</p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
/// <p>A set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process with a request to start a new game session (see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a Game Session</a>).</p>
pub fn game_properties(&self) -> std::option::Option<&[crate::types::GameProperty]> {
self.game_properties.as_deref()
}
/// <p>A unique identifier for a player or entity creating the game session. This parameter is required when requesting a new game session on a fleet with a resource creation limit policy. This type of policy limits the number of concurrent active game sessions that one player can create within a certain time span. GameLift uses the CreatorId to evaluate the new request against the policy.</p>
pub fn creator_id(&self) -> std::option::Option<&str> {
self.creator_id.as_deref()
}
/// <p> <i>This parameter is deprecated. Use <code>IdempotencyToken</code> instead.</i> </p>
/// <p>Custom string that uniquely identifies a request for a new game session. Maximum token length is 48 characters. If provided, this string is included in the new game session's ID.</p>
pub fn game_session_id(&self) -> std::option::Option<&str> {
self.game_session_id.as_deref()
}
/// <p>Custom string that uniquely identifies the new game session request. This is useful for ensuring that game session requests with the same idempotency token are processed only once. Subsequent requests with the same string return the original <code>GameSession</code> object, with an updated status. Maximum token length is 48 characters. If provided, this string is included in the new game session's ID. A game session ARN has the following format: <code>arn:aws:gamelift:
/// <region>
/// ::gamesession/
/// <fleet id>
/// /
/// <custom id string or idempotency token></custom>
/// </fleet>
/// </region></code>. Idempotency tokens remain in use for 30 days after a game session has ended; game session objects are retained for this time period and then deleted.</p>
pub fn idempotency_token(&self) -> std::option::Option<&str> {
self.idempotency_token.as_deref()
}
/// <p>A set of custom game session properties, formatted as a single string value. This data is passed to a game server process with a request to start a new game session (see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a Game Session</a>).</p>
pub fn game_session_data(&self) -> std::option::Option<&str> {
self.game_session_data.as_deref()
}
/// <p>A fleet's remote location to place the new game session in. If this parameter is not set, the new game session is placed in the fleet's home Region. Specify a remote location with an Amazon Web Services Region code such as <code>us-west-2</code>. </p>
pub fn location(&self) -> std::option::Option<&str> {
self.location.as_deref()
}
}
impl CreateGameSessionInput {
/// Creates a new builder-style object to manufacture [`CreateGameSessionInput`](crate::operation::create_game_session::CreateGameSessionInput).
pub fn builder(
) -> crate::operation::create_game_session::builders::CreateGameSessionInputBuilder {
crate::operation::create_game_session::builders::CreateGameSessionInputBuilder::default()
}
}
/// A builder for [`CreateGameSessionInput`](crate::operation::create_game_session::CreateGameSessionInput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct CreateGameSessionInputBuilder {
pub(crate) fleet_id: std::option::Option<std::string::String>,
pub(crate) alias_id: std::option::Option<std::string::String>,
pub(crate) maximum_player_session_count: std::option::Option<i32>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) game_properties: std::option::Option<std::vec::Vec<crate::types::GameProperty>>,
pub(crate) creator_id: std::option::Option<std::string::String>,
pub(crate) game_session_id: std::option::Option<std::string::String>,
pub(crate) idempotency_token: std::option::Option<std::string::String>,
pub(crate) game_session_data: std::option::Option<std::string::String>,
pub(crate) location: std::option::Option<std::string::String>,
}
impl CreateGameSessionInputBuilder {
/// <p>A unique identifier for the fleet to create a game session in. You can use either the fleet ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.</p>
pub fn fleet_id(mut self, input: impl Into<std::string::String>) -> Self {
self.fleet_id = Some(input.into());
self
}
/// <p>A unique identifier for the fleet to create a game session in. You can use either the fleet ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.</p>
pub fn set_fleet_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.fleet_id = input;
self
}
/// <p>A unique identifier for the alias associated with the fleet to create a game session in. You can use either the alias ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.</p>
pub fn alias_id(mut self, input: impl Into<std::string::String>) -> Self {
self.alias_id = Some(input.into());
self
}
/// <p>A unique identifier for the alias associated with the fleet to create a game session in. You can use either the alias ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.</p>
pub fn set_alias_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.alias_id = input;
self
}
/// <p>The maximum number of players that can be connected simultaneously to the game session.</p>
pub fn maximum_player_session_count(mut self, input: i32) -> Self {
self.maximum_player_session_count = Some(input);
self
}
/// <p>The maximum number of players that can be connected simultaneously to the game session.</p>
pub fn set_maximum_player_session_count(mut self, input: std::option::Option<i32>) -> Self {
self.maximum_player_session_count = input;
self
}
/// <p>A descriptive label that is associated with a game session. Session names do not need to be unique.</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p>A descriptive label that is associated with a game session. Session names do not need to be unique.</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// Appends an item to `game_properties`.
///
/// To override the contents of this collection use [`set_game_properties`](Self::set_game_properties).
///
/// <p>A set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process with a request to start a new game session (see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a Game Session</a>).</p>
pub fn game_properties(mut self, input: crate::types::GameProperty) -> Self {
let mut v = self.game_properties.unwrap_or_default();
v.push(input);
self.game_properties = Some(v);
self
}
/// <p>A set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process with a request to start a new game session (see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a Game Session</a>).</p>
pub fn set_game_properties(
mut self,
input: std::option::Option<std::vec::Vec<crate::types::GameProperty>>,
) -> Self {
self.game_properties = input;
self
}
/// <p>A unique identifier for a player or entity creating the game session. This parameter is required when requesting a new game session on a fleet with a resource creation limit policy. This type of policy limits the number of concurrent active game sessions that one player can create within a certain time span. GameLift uses the CreatorId to evaluate the new request against the policy.</p>
pub fn creator_id(mut self, input: impl Into<std::string::String>) -> Self {
self.creator_id = Some(input.into());
self
}
/// <p>A unique identifier for a player or entity creating the game session. This parameter is required when requesting a new game session on a fleet with a resource creation limit policy. This type of policy limits the number of concurrent active game sessions that one player can create within a certain time span. GameLift uses the CreatorId to evaluate the new request against the policy.</p>
pub fn set_creator_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.creator_id = input;
self
}
/// <p> <i>This parameter is deprecated. Use <code>IdempotencyToken</code> instead.</i> </p>
/// <p>Custom string that uniquely identifies a request for a new game session. Maximum token length is 48 characters. If provided, this string is included in the new game session's ID.</p>
pub fn game_session_id(mut self, input: impl Into<std::string::String>) -> Self {
self.game_session_id = Some(input.into());
self
}
/// <p> <i>This parameter is deprecated. Use <code>IdempotencyToken</code> instead.</i> </p>
/// <p>Custom string that uniquely identifies a request for a new game session. Maximum token length is 48 characters. If provided, this string is included in the new game session's ID.</p>
pub fn set_game_session_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.game_session_id = input;
self
}
/// <p>Custom string that uniquely identifies the new game session request. This is useful for ensuring that game session requests with the same idempotency token are processed only once. Subsequent requests with the same string return the original <code>GameSession</code> object, with an updated status. Maximum token length is 48 characters. If provided, this string is included in the new game session's ID. A game session ARN has the following format: <code>arn:aws:gamelift:
/// <region>
/// ::gamesession/
/// <fleet id>
/// /
/// <custom id string or idempotency token></custom>
/// </fleet>
/// </region></code>. Idempotency tokens remain in use for 30 days after a game session has ended; game session objects are retained for this time period and then deleted.</p>
pub fn idempotency_token(mut self, input: impl Into<std::string::String>) -> Self {
self.idempotency_token = Some(input.into());
self
}
/// <p>Custom string that uniquely identifies the new game session request. This is useful for ensuring that game session requests with the same idempotency token are processed only once. Subsequent requests with the same string return the original <code>GameSession</code> object, with an updated status. Maximum token length is 48 characters. If provided, this string is included in the new game session's ID. A game session ARN has the following format: <code>arn:aws:gamelift:
/// <region>
/// ::gamesession/
/// <fleet id>
/// /
/// <custom id string or idempotency token></custom>
/// </fleet>
/// </region></code>. Idempotency tokens remain in use for 30 days after a game session has ended; game session objects are retained for this time period and then deleted.</p>
pub fn set_idempotency_token(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.idempotency_token = input;
self
}
/// <p>A set of custom game session properties, formatted as a single string value. This data is passed to a game server process with a request to start a new game session (see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a Game Session</a>).</p>
pub fn game_session_data(mut self, input: impl Into<std::string::String>) -> Self {
self.game_session_data = Some(input.into());
self
}
/// <p>A set of custom game session properties, formatted as a single string value. This data is passed to a game server process with a request to start a new game session (see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a Game Session</a>).</p>
pub fn set_game_session_data(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.game_session_data = input;
self
}
/// <p>A fleet's remote location to place the new game session in. If this parameter is not set, the new game session is placed in the fleet's home Region. Specify a remote location with an Amazon Web Services Region code such as <code>us-west-2</code>. </p>
pub fn location(mut self, input: impl Into<std::string::String>) -> Self {
self.location = Some(input.into());
self
}
/// <p>A fleet's remote location to place the new game session in. If this parameter is not set, the new game session is placed in the fleet's home Region. Specify a remote location with an Amazon Web Services Region code such as <code>us-west-2</code>. </p>
pub fn set_location(mut self, input: std::option::Option<std::string::String>) -> Self {
self.location = input;
self
}
/// Consumes the builder and constructs a [`CreateGameSessionInput`](crate::operation::create_game_session::CreateGameSessionInput).
pub fn build(
self,
) -> Result<
crate::operation::create_game_session::CreateGameSessionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(
crate::operation::create_game_session::CreateGameSessionInput {
fleet_id: self.fleet_id,
alias_id: self.alias_id,
maximum_player_session_count: self.maximum_player_session_count,
name: self.name,
game_properties: self.game_properties,
creator_id: self.creator_id,
game_session_id: self.game_session_id,
idempotency_token: self.idempotency_token,
game_session_data: self.game_session_data,
location: self.location,
},
)
}
}