aws-sdk-gamelift 1.119.0

AWS SDK for Amazon GameLift
Documentation
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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
// 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 PutScalingPolicyInput {
    /// <p>A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be unique. A fleet can have only one scaling policy with the same name.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>A unique identifier for the fleet to apply this policy to. You can use either the fleet ID or ARN value. The fleet cannot be in any of the following statuses: ERROR or DELETING.</p>
    pub fleet_id: ::std::option::Option<::std::string::String>,
    /// <p>Amount of adjustment to make, based on the scaling adjustment type.</p>
    pub scaling_adjustment: ::std::option::Option<i32>,
    /// <p>The type of adjustment to make to a fleet's instance count:</p>
    /// <ul>
    /// <li>
    /// <p><b>ChangeInCapacity</b> -- add (or subtract) the scaling adjustment value from the current instance count. Positive values scale up while negative values scale down.</p></li>
    /// <li>
    /// <p><b>ExactCapacity</b> -- set the instance count to the scaling adjustment value.</p></li>
    /// <li>
    /// <p><b>PercentChangeInCapacity</b> -- increase or reduce the current instance count by the scaling adjustment, read as a percentage. Positive values scale up while negative values scale down; for example, a value of "-10" scales the fleet down by 10%.</p></li>
    /// </ul>
    pub scaling_adjustment_type: ::std::option::Option<crate::types::ScalingAdjustmentType>,
    /// <p>Metric value used to trigger a scaling event.</p>
    pub threshold: ::std::option::Option<f64>,
    /// <p>Comparison operator to use when measuring the metric against the threshold value.</p>
    pub comparison_operator: ::std::option::Option<crate::types::ComparisonOperatorType>,
    /// <p>Length of time (in minutes) the metric must be at or beyond the threshold before a scaling event is triggered.</p>
    pub evaluation_periods: ::std::option::Option<i32>,
    /// <p>Name of the Amazon GameLift Servers-defined metric that is used to trigger a scaling adjustment. For detailed descriptions of fleet metrics, see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/monitoring-cloudwatch.html">Monitor Amazon GameLift Servers with Amazon CloudWatch</a>.</p>
    /// <ul>
    /// <li>
    /// <p><b>ActivatingGameSessions</b> -- Game sessions in the process of being created.</p></li>
    /// <li>
    /// <p><b>ActiveGameSessions</b> -- Game sessions that are currently running.</p></li>
    /// <li>
    /// <p><b>ActiveInstances</b> -- Fleet instances that are currently running at least one game session.</p></li>
    /// <li>
    /// <p><b>AvailableGameSessions</b> -- Additional game sessions that fleet could host simultaneously, given current capacity.</p></li>
    /// <li>
    /// <p><b>AvailablePlayerSessions</b> -- Empty player slots in currently active game sessions. This includes game sessions that are not currently accepting players. Reserved player slots are not included.</p></li>
    /// <li>
    /// <p><b>CurrentPlayerSessions</b> -- Player slots in active game sessions that are being used by a player or are reserved for a player.</p></li>
    /// <li>
    /// <p><b>IdleInstances</b> -- Active instances that are currently hosting zero game sessions.</p></li>
    /// <li>
    /// <p><b>PercentAvailableGameSessions</b> -- Unused percentage of the total number of game sessions that a fleet could host simultaneously, given current capacity. Use this metric for a target-based scaling policy.</p></li>
    /// <li>
    /// <p><b>PercentIdleInstances</b> -- Percentage of the total number of active instances that are hosting zero game sessions.</p></li>
    /// <li>
    /// <p><b>QueueDepth</b> -- Pending game session placement requests, in any queue, where the current fleet is the top-priority destination.</p></li>
    /// <li>
    /// <p><b>WaitTime</b> -- Current wait time for pending game session placement requests, in any queue, where the current fleet is the top-priority destination.</p></li>
    /// </ul>
    pub metric_name: ::std::option::Option<crate::types::MetricName>,
    /// <p>The type of scaling policy to create. For a target-based policy, set the parameter <i>MetricName</i> to 'PercentAvailableGameSessions' and specify a <i>TargetConfiguration</i>. For a rule-based policy set the following parameters: <i>MetricName</i>, <i>ComparisonOperator</i>, <i>Threshold</i>, <i>EvaluationPeriods</i>, <i>ScalingAdjustmentType</i>, and <i>ScalingAdjustment</i>.</p>
    pub policy_type: ::std::option::Option<crate::types::PolicyType>,
    /// <p>An object that contains settings for a target-based scaling policy.</p>
    pub target_configuration: ::std::option::Option<crate::types::TargetConfiguration>,
}
impl PutScalingPolicyInput {
    /// <p>A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be unique. A fleet can have only one scaling policy with the same name.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>A unique identifier for the fleet to apply this policy to. You can use either the fleet ID or ARN value. The fleet cannot be in any of the following statuses: ERROR or DELETING.</p>
    pub fn fleet_id(&self) -> ::std::option::Option<&str> {
        self.fleet_id.as_deref()
    }
    /// <p>Amount of adjustment to make, based on the scaling adjustment type.</p>
    pub fn scaling_adjustment(&self) -> ::std::option::Option<i32> {
        self.scaling_adjustment
    }
    /// <p>The type of adjustment to make to a fleet's instance count:</p>
    /// <ul>
    /// <li>
    /// <p><b>ChangeInCapacity</b> -- add (or subtract) the scaling adjustment value from the current instance count. Positive values scale up while negative values scale down.</p></li>
    /// <li>
    /// <p><b>ExactCapacity</b> -- set the instance count to the scaling adjustment value.</p></li>
    /// <li>
    /// <p><b>PercentChangeInCapacity</b> -- increase or reduce the current instance count by the scaling adjustment, read as a percentage. Positive values scale up while negative values scale down; for example, a value of "-10" scales the fleet down by 10%.</p></li>
    /// </ul>
    pub fn scaling_adjustment_type(&self) -> ::std::option::Option<&crate::types::ScalingAdjustmentType> {
        self.scaling_adjustment_type.as_ref()
    }
    /// <p>Metric value used to trigger a scaling event.</p>
    pub fn threshold(&self) -> ::std::option::Option<f64> {
        self.threshold
    }
    /// <p>Comparison operator to use when measuring the metric against the threshold value.</p>
    pub fn comparison_operator(&self) -> ::std::option::Option<&crate::types::ComparisonOperatorType> {
        self.comparison_operator.as_ref()
    }
    /// <p>Length of time (in minutes) the metric must be at or beyond the threshold before a scaling event is triggered.</p>
    pub fn evaluation_periods(&self) -> ::std::option::Option<i32> {
        self.evaluation_periods
    }
    /// <p>Name of the Amazon GameLift Servers-defined metric that is used to trigger a scaling adjustment. For detailed descriptions of fleet metrics, see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/monitoring-cloudwatch.html">Monitor Amazon GameLift Servers with Amazon CloudWatch</a>.</p>
    /// <ul>
    /// <li>
    /// <p><b>ActivatingGameSessions</b> -- Game sessions in the process of being created.</p></li>
    /// <li>
    /// <p><b>ActiveGameSessions</b> -- Game sessions that are currently running.</p></li>
    /// <li>
    /// <p><b>ActiveInstances</b> -- Fleet instances that are currently running at least one game session.</p></li>
    /// <li>
    /// <p><b>AvailableGameSessions</b> -- Additional game sessions that fleet could host simultaneously, given current capacity.</p></li>
    /// <li>
    /// <p><b>AvailablePlayerSessions</b> -- Empty player slots in currently active game sessions. This includes game sessions that are not currently accepting players. Reserved player slots are not included.</p></li>
    /// <li>
    /// <p><b>CurrentPlayerSessions</b> -- Player slots in active game sessions that are being used by a player or are reserved for a player.</p></li>
    /// <li>
    /// <p><b>IdleInstances</b> -- Active instances that are currently hosting zero game sessions.</p></li>
    /// <li>
    /// <p><b>PercentAvailableGameSessions</b> -- Unused percentage of the total number of game sessions that a fleet could host simultaneously, given current capacity. Use this metric for a target-based scaling policy.</p></li>
    /// <li>
    /// <p><b>PercentIdleInstances</b> -- Percentage of the total number of active instances that are hosting zero game sessions.</p></li>
    /// <li>
    /// <p><b>QueueDepth</b> -- Pending game session placement requests, in any queue, where the current fleet is the top-priority destination.</p></li>
    /// <li>
    /// <p><b>WaitTime</b> -- Current wait time for pending game session placement requests, in any queue, where the current fleet is the top-priority destination.</p></li>
    /// </ul>
    pub fn metric_name(&self) -> ::std::option::Option<&crate::types::MetricName> {
        self.metric_name.as_ref()
    }
    /// <p>The type of scaling policy to create. For a target-based policy, set the parameter <i>MetricName</i> to 'PercentAvailableGameSessions' and specify a <i>TargetConfiguration</i>. For a rule-based policy set the following parameters: <i>MetricName</i>, <i>ComparisonOperator</i>, <i>Threshold</i>, <i>EvaluationPeriods</i>, <i>ScalingAdjustmentType</i>, and <i>ScalingAdjustment</i>.</p>
    pub fn policy_type(&self) -> ::std::option::Option<&crate::types::PolicyType> {
        self.policy_type.as_ref()
    }
    /// <p>An object that contains settings for a target-based scaling policy.</p>
    pub fn target_configuration(&self) -> ::std::option::Option<&crate::types::TargetConfiguration> {
        self.target_configuration.as_ref()
    }
}
impl PutScalingPolicyInput {
    /// Creates a new builder-style object to manufacture [`PutScalingPolicyInput`](crate::operation::put_scaling_policy::PutScalingPolicyInput).
    pub fn builder() -> crate::operation::put_scaling_policy::builders::PutScalingPolicyInputBuilder {
        crate::operation::put_scaling_policy::builders::PutScalingPolicyInputBuilder::default()
    }
}

/// A builder for [`PutScalingPolicyInput`](crate::operation::put_scaling_policy::PutScalingPolicyInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutScalingPolicyInputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) fleet_id: ::std::option::Option<::std::string::String>,
    pub(crate) scaling_adjustment: ::std::option::Option<i32>,
    pub(crate) scaling_adjustment_type: ::std::option::Option<crate::types::ScalingAdjustmentType>,
    pub(crate) threshold: ::std::option::Option<f64>,
    pub(crate) comparison_operator: ::std::option::Option<crate::types::ComparisonOperatorType>,
    pub(crate) evaluation_periods: ::std::option::Option<i32>,
    pub(crate) metric_name: ::std::option::Option<crate::types::MetricName>,
    pub(crate) policy_type: ::std::option::Option<crate::types::PolicyType>,
    pub(crate) target_configuration: ::std::option::Option<crate::types::TargetConfiguration>,
}
impl PutScalingPolicyInputBuilder {
    /// <p>A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be unique. A fleet can have only one scaling policy with the same name.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be unique. A fleet can have only one scaling policy with the same name.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>A descriptive label that is associated with a fleet's scaling policy. Policy names do not need to be unique. A fleet can have only one scaling policy with the same name.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>A unique identifier for the fleet to apply this policy to. You can use either the fleet ID or ARN value. The fleet cannot be in any of the following statuses: ERROR or DELETING.</p>
    /// This field is required.
    pub fn fleet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.fleet_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique identifier for the fleet to apply this policy to. You can use either the fleet ID or ARN value. The fleet cannot be in any of the following statuses: ERROR or DELETING.</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 fleet to apply this policy to. You can use either the fleet ID or ARN value. The fleet cannot be in any of the following statuses: ERROR or DELETING.</p>
    pub fn get_fleet_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.fleet_id
    }
    /// <p>Amount of adjustment to make, based on the scaling adjustment type.</p>
    pub fn scaling_adjustment(mut self, input: i32) -> Self {
        self.scaling_adjustment = ::std::option::Option::Some(input);
        self
    }
    /// <p>Amount of adjustment to make, based on the scaling adjustment type.</p>
    pub fn set_scaling_adjustment(mut self, input: ::std::option::Option<i32>) -> Self {
        self.scaling_adjustment = input;
        self
    }
    /// <p>Amount of adjustment to make, based on the scaling adjustment type.</p>
    pub fn get_scaling_adjustment(&self) -> &::std::option::Option<i32> {
        &self.scaling_adjustment
    }
    /// <p>The type of adjustment to make to a fleet's instance count:</p>
    /// <ul>
    /// <li>
    /// <p><b>ChangeInCapacity</b> -- add (or subtract) the scaling adjustment value from the current instance count. Positive values scale up while negative values scale down.</p></li>
    /// <li>
    /// <p><b>ExactCapacity</b> -- set the instance count to the scaling adjustment value.</p></li>
    /// <li>
    /// <p><b>PercentChangeInCapacity</b> -- increase or reduce the current instance count by the scaling adjustment, read as a percentage. Positive values scale up while negative values scale down; for example, a value of "-10" scales the fleet down by 10%.</p></li>
    /// </ul>
    pub fn scaling_adjustment_type(mut self, input: crate::types::ScalingAdjustmentType) -> Self {
        self.scaling_adjustment_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of adjustment to make to a fleet's instance count:</p>
    /// <ul>
    /// <li>
    /// <p><b>ChangeInCapacity</b> -- add (or subtract) the scaling adjustment value from the current instance count. Positive values scale up while negative values scale down.</p></li>
    /// <li>
    /// <p><b>ExactCapacity</b> -- set the instance count to the scaling adjustment value.</p></li>
    /// <li>
    /// <p><b>PercentChangeInCapacity</b> -- increase or reduce the current instance count by the scaling adjustment, read as a percentage. Positive values scale up while negative values scale down; for example, a value of "-10" scales the fleet down by 10%.</p></li>
    /// </ul>
    pub fn set_scaling_adjustment_type(mut self, input: ::std::option::Option<crate::types::ScalingAdjustmentType>) -> Self {
        self.scaling_adjustment_type = input;
        self
    }
    /// <p>The type of adjustment to make to a fleet's instance count:</p>
    /// <ul>
    /// <li>
    /// <p><b>ChangeInCapacity</b> -- add (or subtract) the scaling adjustment value from the current instance count. Positive values scale up while negative values scale down.</p></li>
    /// <li>
    /// <p><b>ExactCapacity</b> -- set the instance count to the scaling adjustment value.</p></li>
    /// <li>
    /// <p><b>PercentChangeInCapacity</b> -- increase or reduce the current instance count by the scaling adjustment, read as a percentage. Positive values scale up while negative values scale down; for example, a value of "-10" scales the fleet down by 10%.</p></li>
    /// </ul>
    pub fn get_scaling_adjustment_type(&self) -> &::std::option::Option<crate::types::ScalingAdjustmentType> {
        &self.scaling_adjustment_type
    }
    /// <p>Metric value used to trigger a scaling event.</p>
    pub fn threshold(mut self, input: f64) -> Self {
        self.threshold = ::std::option::Option::Some(input);
        self
    }
    /// <p>Metric value used to trigger a scaling event.</p>
    pub fn set_threshold(mut self, input: ::std::option::Option<f64>) -> Self {
        self.threshold = input;
        self
    }
    /// <p>Metric value used to trigger a scaling event.</p>
    pub fn get_threshold(&self) -> &::std::option::Option<f64> {
        &self.threshold
    }
    /// <p>Comparison operator to use when measuring the metric against the threshold value.</p>
    pub fn comparison_operator(mut self, input: crate::types::ComparisonOperatorType) -> Self {
        self.comparison_operator = ::std::option::Option::Some(input);
        self
    }
    /// <p>Comparison operator to use when measuring the metric against the threshold value.</p>
    pub fn set_comparison_operator(mut self, input: ::std::option::Option<crate::types::ComparisonOperatorType>) -> Self {
        self.comparison_operator = input;
        self
    }
    /// <p>Comparison operator to use when measuring the metric against the threshold value.</p>
    pub fn get_comparison_operator(&self) -> &::std::option::Option<crate::types::ComparisonOperatorType> {
        &self.comparison_operator
    }
    /// <p>Length of time (in minutes) the metric must be at or beyond the threshold before a scaling event is triggered.</p>
    pub fn evaluation_periods(mut self, input: i32) -> Self {
        self.evaluation_periods = ::std::option::Option::Some(input);
        self
    }
    /// <p>Length of time (in minutes) the metric must be at or beyond the threshold before a scaling event is triggered.</p>
    pub fn set_evaluation_periods(mut self, input: ::std::option::Option<i32>) -> Self {
        self.evaluation_periods = input;
        self
    }
    /// <p>Length of time (in minutes) the metric must be at or beyond the threshold before a scaling event is triggered.</p>
    pub fn get_evaluation_periods(&self) -> &::std::option::Option<i32> {
        &self.evaluation_periods
    }
    /// <p>Name of the Amazon GameLift Servers-defined metric that is used to trigger a scaling adjustment. For detailed descriptions of fleet metrics, see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/monitoring-cloudwatch.html">Monitor Amazon GameLift Servers with Amazon CloudWatch</a>.</p>
    /// <ul>
    /// <li>
    /// <p><b>ActivatingGameSessions</b> -- Game sessions in the process of being created.</p></li>
    /// <li>
    /// <p><b>ActiveGameSessions</b> -- Game sessions that are currently running.</p></li>
    /// <li>
    /// <p><b>ActiveInstances</b> -- Fleet instances that are currently running at least one game session.</p></li>
    /// <li>
    /// <p><b>AvailableGameSessions</b> -- Additional game sessions that fleet could host simultaneously, given current capacity.</p></li>
    /// <li>
    /// <p><b>AvailablePlayerSessions</b> -- Empty player slots in currently active game sessions. This includes game sessions that are not currently accepting players. Reserved player slots are not included.</p></li>
    /// <li>
    /// <p><b>CurrentPlayerSessions</b> -- Player slots in active game sessions that are being used by a player or are reserved for a player.</p></li>
    /// <li>
    /// <p><b>IdleInstances</b> -- Active instances that are currently hosting zero game sessions.</p></li>
    /// <li>
    /// <p><b>PercentAvailableGameSessions</b> -- Unused percentage of the total number of game sessions that a fleet could host simultaneously, given current capacity. Use this metric for a target-based scaling policy.</p></li>
    /// <li>
    /// <p><b>PercentIdleInstances</b> -- Percentage of the total number of active instances that are hosting zero game sessions.</p></li>
    /// <li>
    /// <p><b>QueueDepth</b> -- Pending game session placement requests, in any queue, where the current fleet is the top-priority destination.</p></li>
    /// <li>
    /// <p><b>WaitTime</b> -- Current wait time for pending game session placement requests, in any queue, where the current fleet is the top-priority destination.</p></li>
    /// </ul>
    /// This field is required.
    pub fn metric_name(mut self, input: crate::types::MetricName) -> Self {
        self.metric_name = ::std::option::Option::Some(input);
        self
    }
    /// <p>Name of the Amazon GameLift Servers-defined metric that is used to trigger a scaling adjustment. For detailed descriptions of fleet metrics, see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/monitoring-cloudwatch.html">Monitor Amazon GameLift Servers with Amazon CloudWatch</a>.</p>
    /// <ul>
    /// <li>
    /// <p><b>ActivatingGameSessions</b> -- Game sessions in the process of being created.</p></li>
    /// <li>
    /// <p><b>ActiveGameSessions</b> -- Game sessions that are currently running.</p></li>
    /// <li>
    /// <p><b>ActiveInstances</b> -- Fleet instances that are currently running at least one game session.</p></li>
    /// <li>
    /// <p><b>AvailableGameSessions</b> -- Additional game sessions that fleet could host simultaneously, given current capacity.</p></li>
    /// <li>
    /// <p><b>AvailablePlayerSessions</b> -- Empty player slots in currently active game sessions. This includes game sessions that are not currently accepting players. Reserved player slots are not included.</p></li>
    /// <li>
    /// <p><b>CurrentPlayerSessions</b> -- Player slots in active game sessions that are being used by a player or are reserved for a player.</p></li>
    /// <li>
    /// <p><b>IdleInstances</b> -- Active instances that are currently hosting zero game sessions.</p></li>
    /// <li>
    /// <p><b>PercentAvailableGameSessions</b> -- Unused percentage of the total number of game sessions that a fleet could host simultaneously, given current capacity. Use this metric for a target-based scaling policy.</p></li>
    /// <li>
    /// <p><b>PercentIdleInstances</b> -- Percentage of the total number of active instances that are hosting zero game sessions.</p></li>
    /// <li>
    /// <p><b>QueueDepth</b> -- Pending game session placement requests, in any queue, where the current fleet is the top-priority destination.</p></li>
    /// <li>
    /// <p><b>WaitTime</b> -- Current wait time for pending game session placement requests, in any queue, where the current fleet is the top-priority destination.</p></li>
    /// </ul>
    pub fn set_metric_name(mut self, input: ::std::option::Option<crate::types::MetricName>) -> Self {
        self.metric_name = input;
        self
    }
    /// <p>Name of the Amazon GameLift Servers-defined metric that is used to trigger a scaling adjustment. For detailed descriptions of fleet metrics, see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/monitoring-cloudwatch.html">Monitor Amazon GameLift Servers with Amazon CloudWatch</a>.</p>
    /// <ul>
    /// <li>
    /// <p><b>ActivatingGameSessions</b> -- Game sessions in the process of being created.</p></li>
    /// <li>
    /// <p><b>ActiveGameSessions</b> -- Game sessions that are currently running.</p></li>
    /// <li>
    /// <p><b>ActiveInstances</b> -- Fleet instances that are currently running at least one game session.</p></li>
    /// <li>
    /// <p><b>AvailableGameSessions</b> -- Additional game sessions that fleet could host simultaneously, given current capacity.</p></li>
    /// <li>
    /// <p><b>AvailablePlayerSessions</b> -- Empty player slots in currently active game sessions. This includes game sessions that are not currently accepting players. Reserved player slots are not included.</p></li>
    /// <li>
    /// <p><b>CurrentPlayerSessions</b> -- Player slots in active game sessions that are being used by a player or are reserved for a player.</p></li>
    /// <li>
    /// <p><b>IdleInstances</b> -- Active instances that are currently hosting zero game sessions.</p></li>
    /// <li>
    /// <p><b>PercentAvailableGameSessions</b> -- Unused percentage of the total number of game sessions that a fleet could host simultaneously, given current capacity. Use this metric for a target-based scaling policy.</p></li>
    /// <li>
    /// <p><b>PercentIdleInstances</b> -- Percentage of the total number of active instances that are hosting zero game sessions.</p></li>
    /// <li>
    /// <p><b>QueueDepth</b> -- Pending game session placement requests, in any queue, where the current fleet is the top-priority destination.</p></li>
    /// <li>
    /// <p><b>WaitTime</b> -- Current wait time for pending game session placement requests, in any queue, where the current fleet is the top-priority destination.</p></li>
    /// </ul>
    pub fn get_metric_name(&self) -> &::std::option::Option<crate::types::MetricName> {
        &self.metric_name
    }
    /// <p>The type of scaling policy to create. For a target-based policy, set the parameter <i>MetricName</i> to 'PercentAvailableGameSessions' and specify a <i>TargetConfiguration</i>. For a rule-based policy set the following parameters: <i>MetricName</i>, <i>ComparisonOperator</i>, <i>Threshold</i>, <i>EvaluationPeriods</i>, <i>ScalingAdjustmentType</i>, and <i>ScalingAdjustment</i>.</p>
    pub fn policy_type(mut self, input: crate::types::PolicyType) -> Self {
        self.policy_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of scaling policy to create. For a target-based policy, set the parameter <i>MetricName</i> to 'PercentAvailableGameSessions' and specify a <i>TargetConfiguration</i>. For a rule-based policy set the following parameters: <i>MetricName</i>, <i>ComparisonOperator</i>, <i>Threshold</i>, <i>EvaluationPeriods</i>, <i>ScalingAdjustmentType</i>, and <i>ScalingAdjustment</i>.</p>
    pub fn set_policy_type(mut self, input: ::std::option::Option<crate::types::PolicyType>) -> Self {
        self.policy_type = input;
        self
    }
    /// <p>The type of scaling policy to create. For a target-based policy, set the parameter <i>MetricName</i> to 'PercentAvailableGameSessions' and specify a <i>TargetConfiguration</i>. For a rule-based policy set the following parameters: <i>MetricName</i>, <i>ComparisonOperator</i>, <i>Threshold</i>, <i>EvaluationPeriods</i>, <i>ScalingAdjustmentType</i>, and <i>ScalingAdjustment</i>.</p>
    pub fn get_policy_type(&self) -> &::std::option::Option<crate::types::PolicyType> {
        &self.policy_type
    }
    /// <p>An object that contains settings for a target-based scaling policy.</p>
    pub fn target_configuration(mut self, input: crate::types::TargetConfiguration) -> Self {
        self.target_configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>An object that contains settings for a target-based scaling policy.</p>
    pub fn set_target_configuration(mut self, input: ::std::option::Option<crate::types::TargetConfiguration>) -> Self {
        self.target_configuration = input;
        self
    }
    /// <p>An object that contains settings for a target-based scaling policy.</p>
    pub fn get_target_configuration(&self) -> &::std::option::Option<crate::types::TargetConfiguration> {
        &self.target_configuration
    }
    /// Consumes the builder and constructs a [`PutScalingPolicyInput`](crate::operation::put_scaling_policy::PutScalingPolicyInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::put_scaling_policy::PutScalingPolicyInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::put_scaling_policy::PutScalingPolicyInput {
            name: self.name,
            fleet_id: self.fleet_id,
            scaling_adjustment: self.scaling_adjustment,
            scaling_adjustment_type: self.scaling_adjustment_type,
            threshold: self.threshold,
            comparison_operator: self.comparison_operator,
            evaluation_periods: self.evaluation_periods,
            metric_name: self.metric_name,
            policy_type: self.policy_type,
            target_configuration: self.target_configuration,
        })
    }
}