aws_sdk_ec2/operation/start_instances/
_start_instances_input.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 StartInstancesInput {
6    /// <p>The IDs of the instances.</p>
7    pub instance_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8    /// <p>Reserved.</p>
9    pub additional_info: ::std::option::Option<::std::string::String>,
10    /// <p>Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
11    pub dry_run: ::std::option::Option<bool>,
12}
13impl StartInstancesInput {
14    /// <p>The IDs of the instances.</p>
15    ///
16    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.instance_ids.is_none()`.
17    pub fn instance_ids(&self) -> &[::std::string::String] {
18        self.instance_ids.as_deref().unwrap_or_default()
19    }
20    /// <p>Reserved.</p>
21    pub fn additional_info(&self) -> ::std::option::Option<&str> {
22        self.additional_info.as_deref()
23    }
24    /// <p>Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
25    pub fn dry_run(&self) -> ::std::option::Option<bool> {
26        self.dry_run
27    }
28}
29impl StartInstancesInput {
30    /// Creates a new builder-style object to manufacture [`StartInstancesInput`](crate::operation::start_instances::StartInstancesInput).
31    pub fn builder() -> crate::operation::start_instances::builders::StartInstancesInputBuilder {
32        crate::operation::start_instances::builders::StartInstancesInputBuilder::default()
33    }
34}
35
36/// A builder for [`StartInstancesInput`](crate::operation::start_instances::StartInstancesInput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct StartInstancesInputBuilder {
40    pub(crate) instance_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
41    pub(crate) additional_info: ::std::option::Option<::std::string::String>,
42    pub(crate) dry_run: ::std::option::Option<bool>,
43}
44impl StartInstancesInputBuilder {
45    /// Appends an item to `instance_ids`.
46    ///
47    /// To override the contents of this collection use [`set_instance_ids`](Self::set_instance_ids).
48    ///
49    /// <p>The IDs of the instances.</p>
50    pub fn instance_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
51        let mut v = self.instance_ids.unwrap_or_default();
52        v.push(input.into());
53        self.instance_ids = ::std::option::Option::Some(v);
54        self
55    }
56    /// <p>The IDs of the instances.</p>
57    pub fn set_instance_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
58        self.instance_ids = input;
59        self
60    }
61    /// <p>The IDs of the instances.</p>
62    pub fn get_instance_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
63        &self.instance_ids
64    }
65    /// <p>Reserved.</p>
66    pub fn additional_info(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.additional_info = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>Reserved.</p>
71    pub fn set_additional_info(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.additional_info = input;
73        self
74    }
75    /// <p>Reserved.</p>
76    pub fn get_additional_info(&self) -> &::std::option::Option<::std::string::String> {
77        &self.additional_info
78    }
79    /// <p>Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
80    pub fn dry_run(mut self, input: bool) -> Self {
81        self.dry_run = ::std::option::Option::Some(input);
82        self
83    }
84    /// <p>Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
85    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
86        self.dry_run = input;
87        self
88    }
89    /// <p>Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
90    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
91        &self.dry_run
92    }
93    /// Consumes the builder and constructs a [`StartInstancesInput`](crate::operation::start_instances::StartInstancesInput).
94    pub fn build(
95        self,
96    ) -> ::std::result::Result<crate::operation::start_instances::StartInstancesInput, ::aws_smithy_types::error::operation::BuildError> {
97        ::std::result::Result::Ok(crate::operation::start_instances::StartInstancesInput {
98            instance_ids: self.instance_ids,
99            additional_info: self.additional_info,
100            dry_run: self.dry_run,
101        })
102    }
103}