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
// 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 UpdateGameSessionInput {
/// <p>A unique identifier for the game session to update. </p>
#[doc(hidden)]
pub game_session_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 policy that determines whether the game session is accepting new players.</p>
#[doc(hidden)]
pub player_session_creation_policy:
std::option::Option<crate::types::PlayerSessionCreationPolicy>,
/// <p>Game session protection policy to apply to this game session only.</p>
/// <ul>
/// <li> <p> <b>NoProtection</b> -- The game session can be terminated during a scale-down event.</p> </li>
/// <li> <p> <b>FullProtection</b> -- If the game session is in an <code>ACTIVE</code> status, it cannot be terminated during a scale-down event.</p> </li>
/// </ul>
#[doc(hidden)]
pub protection_policy: std::option::Option<crate::types::ProtectionPolicy>,
}
impl UpdateGameSessionInput {
/// <p>A unique identifier for the game session to update. </p>
pub fn game_session_id(&self) -> std::option::Option<&str> {
self.game_session_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 policy that determines whether the game session is accepting new players.</p>
pub fn player_session_creation_policy(
&self,
) -> std::option::Option<&crate::types::PlayerSessionCreationPolicy> {
self.player_session_creation_policy.as_ref()
}
/// <p>Game session protection policy to apply to this game session only.</p>
/// <ul>
/// <li> <p> <b>NoProtection</b> -- The game session can be terminated during a scale-down event.</p> </li>
/// <li> <p> <b>FullProtection</b> -- If the game session is in an <code>ACTIVE</code> status, it cannot be terminated during a scale-down event.</p> </li>
/// </ul>
pub fn protection_policy(&self) -> std::option::Option<&crate::types::ProtectionPolicy> {
self.protection_policy.as_ref()
}
}
impl UpdateGameSessionInput {
/// Creates a new builder-style object to manufacture [`UpdateGameSessionInput`](crate::operation::update_game_session::UpdateGameSessionInput).
pub fn builder(
) -> crate::operation::update_game_session::builders::UpdateGameSessionInputBuilder {
crate::operation::update_game_session::builders::UpdateGameSessionInputBuilder::default()
}
}
/// A builder for [`UpdateGameSessionInput`](crate::operation::update_game_session::UpdateGameSessionInput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct UpdateGameSessionInputBuilder {
pub(crate) game_session_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) player_session_creation_policy:
std::option::Option<crate::types::PlayerSessionCreationPolicy>,
pub(crate) protection_policy: std::option::Option<crate::types::ProtectionPolicy>,
}
impl UpdateGameSessionInputBuilder {
/// <p>A unique identifier for the game session to update. </p>
pub fn game_session_id(mut self, input: impl Into<std::string::String>) -> Self {
self.game_session_id = Some(input.into());
self
}
/// <p>A unique identifier for the game session to update. </p>
pub fn set_game_session_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.game_session_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
}
/// <p>A policy that determines whether the game session is accepting new players.</p>
pub fn player_session_creation_policy(
mut self,
input: crate::types::PlayerSessionCreationPolicy,
) -> Self {
self.player_session_creation_policy = Some(input);
self
}
/// <p>A policy that determines whether the game session is accepting new players.</p>
pub fn set_player_session_creation_policy(
mut self,
input: std::option::Option<crate::types::PlayerSessionCreationPolicy>,
) -> Self {
self.player_session_creation_policy = input;
self
}
/// <p>Game session protection policy to apply to this game session only.</p>
/// <ul>
/// <li> <p> <b>NoProtection</b> -- The game session can be terminated during a scale-down event.</p> </li>
/// <li> <p> <b>FullProtection</b> -- If the game session is in an <code>ACTIVE</code> status, it cannot be terminated during a scale-down event.</p> </li>
/// </ul>
pub fn protection_policy(mut self, input: crate::types::ProtectionPolicy) -> Self {
self.protection_policy = Some(input);
self
}
/// <p>Game session protection policy to apply to this game session only.</p>
/// <ul>
/// <li> <p> <b>NoProtection</b> -- The game session can be terminated during a scale-down event.</p> </li>
/// <li> <p> <b>FullProtection</b> -- If the game session is in an <code>ACTIVE</code> status, it cannot be terminated during a scale-down event.</p> </li>
/// </ul>
pub fn set_protection_policy(
mut self,
input: std::option::Option<crate::types::ProtectionPolicy>,
) -> Self {
self.protection_policy = input;
self
}
/// Consumes the builder and constructs a [`UpdateGameSessionInput`](crate::operation::update_game_session::UpdateGameSessionInput).
pub fn build(
self,
) -> Result<
crate::operation::update_game_session::UpdateGameSessionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(
crate::operation::update_game_session::UpdateGameSessionInput {
game_session_id: self.game_session_id,
maximum_player_session_count: self.maximum_player_session_count,
name: self.name,
player_session_creation_policy: self.player_session_creation_policy,
protection_policy: self.protection_policy,
},
)
}
}