aws_sdk_gamelift/operation/create_fleet/_create_fleet_output.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateFleetOutput {
6 /// <p>The properties for the new fleet, including the current status. All fleets are placed in <code>NEW</code> status on creation.</p>
7 pub fleet_attributes: ::std::option::Option<crate::types::FleetAttributes>,
8 /// <p>The fleet's locations and life-cycle status of each location. For new fleets, the status of all locations is set to <code>NEW</code>. During fleet creation, Amazon GameLift Servers updates each location status as instances are deployed there and prepared for game hosting. This list includes an entry for the fleet's home Region. For fleets with no remote locations, only one entry, representing the home Region, is returned.</p>
9 pub location_states: ::std::option::Option<::std::vec::Vec<crate::types::LocationState>>,
10 _request_id: Option<String>,
11}
12impl CreateFleetOutput {
13 /// <p>The properties for the new fleet, including the current status. All fleets are placed in <code>NEW</code> status on creation.</p>
14 pub fn fleet_attributes(&self) -> ::std::option::Option<&crate::types::FleetAttributes> {
15 self.fleet_attributes.as_ref()
16 }
17 /// <p>The fleet's locations and life-cycle status of each location. For new fleets, the status of all locations is set to <code>NEW</code>. During fleet creation, Amazon GameLift Servers updates each location status as instances are deployed there and prepared for game hosting. This list includes an entry for the fleet's home Region. For fleets with no remote locations, only one entry, representing the home Region, is returned.</p>
18 ///
19 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.location_states.is_none()`.
20 pub fn location_states(&self) -> &[crate::types::LocationState] {
21 self.location_states.as_deref().unwrap_or_default()
22 }
23}
24impl ::aws_types::request_id::RequestId for CreateFleetOutput {
25 fn request_id(&self) -> Option<&str> {
26 self._request_id.as_deref()
27 }
28}
29impl CreateFleetOutput {
30 /// Creates a new builder-style object to manufacture [`CreateFleetOutput`](crate::operation::create_fleet::CreateFleetOutput).
31 pub fn builder() -> crate::operation::create_fleet::builders::CreateFleetOutputBuilder {
32 crate::operation::create_fleet::builders::CreateFleetOutputBuilder::default()
33 }
34}
35
36/// A builder for [`CreateFleetOutput`](crate::operation::create_fleet::CreateFleetOutput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct CreateFleetOutputBuilder {
40 pub(crate) fleet_attributes: ::std::option::Option<crate::types::FleetAttributes>,
41 pub(crate) location_states: ::std::option::Option<::std::vec::Vec<crate::types::LocationState>>,
42 _request_id: Option<String>,
43}
44impl CreateFleetOutputBuilder {
45 /// <p>The properties for the new fleet, including the current status. All fleets are placed in <code>NEW</code> status on creation.</p>
46 pub fn fleet_attributes(mut self, input: crate::types::FleetAttributes) -> Self {
47 self.fleet_attributes = ::std::option::Option::Some(input);
48 self
49 }
50 /// <p>The properties for the new fleet, including the current status. All fleets are placed in <code>NEW</code> status on creation.</p>
51 pub fn set_fleet_attributes(mut self, input: ::std::option::Option<crate::types::FleetAttributes>) -> Self {
52 self.fleet_attributes = input;
53 self
54 }
55 /// <p>The properties for the new fleet, including the current status. All fleets are placed in <code>NEW</code> status on creation.</p>
56 pub fn get_fleet_attributes(&self) -> &::std::option::Option<crate::types::FleetAttributes> {
57 &self.fleet_attributes
58 }
59 /// Appends an item to `location_states`.
60 ///
61 /// To override the contents of this collection use [`set_location_states`](Self::set_location_states).
62 ///
63 /// <p>The fleet's locations and life-cycle status of each location. For new fleets, the status of all locations is set to <code>NEW</code>. During fleet creation, Amazon GameLift Servers updates each location status as instances are deployed there and prepared for game hosting. This list includes an entry for the fleet's home Region. For fleets with no remote locations, only one entry, representing the home Region, is returned.</p>
64 pub fn location_states(mut self, input: crate::types::LocationState) -> Self {
65 let mut v = self.location_states.unwrap_or_default();
66 v.push(input);
67 self.location_states = ::std::option::Option::Some(v);
68 self
69 }
70 /// <p>The fleet's locations and life-cycle status of each location. For new fleets, the status of all locations is set to <code>NEW</code>. During fleet creation, Amazon GameLift Servers updates each location status as instances are deployed there and prepared for game hosting. This list includes an entry for the fleet's home Region. For fleets with no remote locations, only one entry, representing the home Region, is returned.</p>
71 pub fn set_location_states(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LocationState>>) -> Self {
72 self.location_states = input;
73 self
74 }
75 /// <p>The fleet's locations and life-cycle status of each location. For new fleets, the status of all locations is set to <code>NEW</code>. During fleet creation, Amazon GameLift Servers updates each location status as instances are deployed there and prepared for game hosting. This list includes an entry for the fleet's home Region. For fleets with no remote locations, only one entry, representing the home Region, is returned.</p>
76 pub fn get_location_states(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LocationState>> {
77 &self.location_states
78 }
79 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
80 self._request_id = Some(request_id.into());
81 self
82 }
83
84 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
85 self._request_id = request_id;
86 self
87 }
88 /// Consumes the builder and constructs a [`CreateFleetOutput`](crate::operation::create_fleet::CreateFleetOutput).
89 pub fn build(self) -> crate::operation::create_fleet::CreateFleetOutput {
90 crate::operation::create_fleet::CreateFleetOutput {
91 fleet_attributes: self.fleet_attributes,
92 location_states: self.location_states,
93 _request_id: self._request_id,
94 }
95 }
96}