aws_sdk_autoscaling/operation/launch_instances/
_launch_instances_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 LaunchInstancesOutput {
6    /// <p>The name of the Auto Scaling group where the instances were launched.</p>
7    pub auto_scaling_group_name: ::std::option::Option<::std::string::String>,
8    /// <p>The idempotency token used for the request, either customer-specified or auto-generated.</p>
9    pub client_token: ::std::option::Option<::std::string::String>,
10    /// <p>A list of successfully launched instances including details such as instance type, Availability Zone, subnet, lifecycle state, and instance IDs.</p>
11    pub instances: ::std::option::Option<::std::vec::Vec<crate::types::InstanceCollection>>,
12    /// <p>A list of errors encountered during the launch attempt including details about failed instance launches with their corresponding error codes and messages.</p>
13    pub errors: ::std::option::Option<::std::vec::Vec<crate::types::LaunchInstancesError>>,
14    _request_id: Option<String>,
15}
16impl LaunchInstancesOutput {
17    /// <p>The name of the Auto Scaling group where the instances were launched.</p>
18    pub fn auto_scaling_group_name(&self) -> ::std::option::Option<&str> {
19        self.auto_scaling_group_name.as_deref()
20    }
21    /// <p>The idempotency token used for the request, either customer-specified or auto-generated.</p>
22    pub fn client_token(&self) -> ::std::option::Option<&str> {
23        self.client_token.as_deref()
24    }
25    /// <p>A list of successfully launched instances including details such as instance type, Availability Zone, subnet, lifecycle state, and instance IDs.</p>
26    ///
27    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.instances.is_none()`.
28    pub fn instances(&self) -> &[crate::types::InstanceCollection] {
29        self.instances.as_deref().unwrap_or_default()
30    }
31    /// <p>A list of errors encountered during the launch attempt including details about failed instance launches with their corresponding error codes and messages.</p>
32    ///
33    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.errors.is_none()`.
34    pub fn errors(&self) -> &[crate::types::LaunchInstancesError] {
35        self.errors.as_deref().unwrap_or_default()
36    }
37}
38impl ::aws_types::request_id::RequestId for LaunchInstancesOutput {
39    fn request_id(&self) -> Option<&str> {
40        self._request_id.as_deref()
41    }
42}
43impl LaunchInstancesOutput {
44    /// Creates a new builder-style object to manufacture [`LaunchInstancesOutput`](crate::operation::launch_instances::LaunchInstancesOutput).
45    pub fn builder() -> crate::operation::launch_instances::builders::LaunchInstancesOutputBuilder {
46        crate::operation::launch_instances::builders::LaunchInstancesOutputBuilder::default()
47    }
48}
49
50/// A builder for [`LaunchInstancesOutput`](crate::operation::launch_instances::LaunchInstancesOutput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
52#[non_exhaustive]
53pub struct LaunchInstancesOutputBuilder {
54    pub(crate) auto_scaling_group_name: ::std::option::Option<::std::string::String>,
55    pub(crate) client_token: ::std::option::Option<::std::string::String>,
56    pub(crate) instances: ::std::option::Option<::std::vec::Vec<crate::types::InstanceCollection>>,
57    pub(crate) errors: ::std::option::Option<::std::vec::Vec<crate::types::LaunchInstancesError>>,
58    _request_id: Option<String>,
59}
60impl LaunchInstancesOutputBuilder {
61    /// <p>The name of the Auto Scaling group where the instances were launched.</p>
62    pub fn auto_scaling_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
63        self.auto_scaling_group_name = ::std::option::Option::Some(input.into());
64        self
65    }
66    /// <p>The name of the Auto Scaling group where the instances were launched.</p>
67    pub fn set_auto_scaling_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68        self.auto_scaling_group_name = input;
69        self
70    }
71    /// <p>The name of the Auto Scaling group where the instances were launched.</p>
72    pub fn get_auto_scaling_group_name(&self) -> &::std::option::Option<::std::string::String> {
73        &self.auto_scaling_group_name
74    }
75    /// <p>The idempotency token used for the request, either customer-specified or auto-generated.</p>
76    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77        self.client_token = ::std::option::Option::Some(input.into());
78        self
79    }
80    /// <p>The idempotency token used for the request, either customer-specified or auto-generated.</p>
81    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82        self.client_token = input;
83        self
84    }
85    /// <p>The idempotency token used for the request, either customer-specified or auto-generated.</p>
86    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
87        &self.client_token
88    }
89    /// Appends an item to `instances`.
90    ///
91    /// To override the contents of this collection use [`set_instances`](Self::set_instances).
92    ///
93    /// <p>A list of successfully launched instances including details such as instance type, Availability Zone, subnet, lifecycle state, and instance IDs.</p>
94    pub fn instances(mut self, input: crate::types::InstanceCollection) -> Self {
95        let mut v = self.instances.unwrap_or_default();
96        v.push(input);
97        self.instances = ::std::option::Option::Some(v);
98        self
99    }
100    /// <p>A list of successfully launched instances including details such as instance type, Availability Zone, subnet, lifecycle state, and instance IDs.</p>
101    pub fn set_instances(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InstanceCollection>>) -> Self {
102        self.instances = input;
103        self
104    }
105    /// <p>A list of successfully launched instances including details such as instance type, Availability Zone, subnet, lifecycle state, and instance IDs.</p>
106    pub fn get_instances(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InstanceCollection>> {
107        &self.instances
108    }
109    /// Appends an item to `errors`.
110    ///
111    /// To override the contents of this collection use [`set_errors`](Self::set_errors).
112    ///
113    /// <p>A list of errors encountered during the launch attempt including details about failed instance launches with their corresponding error codes and messages.</p>
114    pub fn errors(mut self, input: crate::types::LaunchInstancesError) -> Self {
115        let mut v = self.errors.unwrap_or_default();
116        v.push(input);
117        self.errors = ::std::option::Option::Some(v);
118        self
119    }
120    /// <p>A list of errors encountered during the launch attempt including details about failed instance launches with their corresponding error codes and messages.</p>
121    pub fn set_errors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LaunchInstancesError>>) -> Self {
122        self.errors = input;
123        self
124    }
125    /// <p>A list of errors encountered during the launch attempt including details about failed instance launches with their corresponding error codes and messages.</p>
126    pub fn get_errors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LaunchInstancesError>> {
127        &self.errors
128    }
129    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
130        self._request_id = Some(request_id.into());
131        self
132    }
133
134    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
135        self._request_id = request_id;
136        self
137    }
138    /// Consumes the builder and constructs a [`LaunchInstancesOutput`](crate::operation::launch_instances::LaunchInstancesOutput).
139    pub fn build(self) -> crate::operation::launch_instances::LaunchInstancesOutput {
140        crate::operation::launch_instances::LaunchInstancesOutput {
141            auto_scaling_group_name: self.auto_scaling_group_name,
142            client_token: self.client_token,
143            instances: self.instances,
144            errors: self.errors,
145            _request_id: self._request_id,
146        }
147    }
148}