aws_sdk_ec2/operation/reboot_instances/_reboot_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 RebootInstancesInput {
6 /// <p>The instance IDs.</p>
7 pub instance_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8 /// <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>
9 pub dry_run: ::std::option::Option<bool>,
10}
11impl RebootInstancesInput {
12 /// <p>The instance IDs.</p>
13 ///
14 /// 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()`.
15 pub fn instance_ids(&self) -> &[::std::string::String] {
16 self.instance_ids.as_deref().unwrap_or_default()
17 }
18 /// <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>
19 pub fn dry_run(&self) -> ::std::option::Option<bool> {
20 self.dry_run
21 }
22}
23impl RebootInstancesInput {
24 /// Creates a new builder-style object to manufacture [`RebootInstancesInput`](crate::operation::reboot_instances::RebootInstancesInput).
25 pub fn builder() -> crate::operation::reboot_instances::builders::RebootInstancesInputBuilder {
26 crate::operation::reboot_instances::builders::RebootInstancesInputBuilder::default()
27 }
28}
29
30/// A builder for [`RebootInstancesInput`](crate::operation::reboot_instances::RebootInstancesInput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct RebootInstancesInputBuilder {
34 pub(crate) instance_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
35 pub(crate) dry_run: ::std::option::Option<bool>,
36}
37impl RebootInstancesInputBuilder {
38 /// Appends an item to `instance_ids`.
39 ///
40 /// To override the contents of this collection use [`set_instance_ids`](Self::set_instance_ids).
41 ///
42 /// <p>The instance IDs.</p>
43 pub fn instance_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
44 let mut v = self.instance_ids.unwrap_or_default();
45 v.push(input.into());
46 self.instance_ids = ::std::option::Option::Some(v);
47 self
48 }
49 /// <p>The instance IDs.</p>
50 pub fn set_instance_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
51 self.instance_ids = input;
52 self
53 }
54 /// <p>The instance IDs.</p>
55 pub fn get_instance_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
56 &self.instance_ids
57 }
58 /// <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>
59 pub fn dry_run(mut self, input: bool) -> Self {
60 self.dry_run = ::std::option::Option::Some(input);
61 self
62 }
63 /// <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>
64 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
65 self.dry_run = input;
66 self
67 }
68 /// <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>
69 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
70 &self.dry_run
71 }
72 /// Consumes the builder and constructs a [`RebootInstancesInput`](crate::operation::reboot_instances::RebootInstancesInput).
73 pub fn build(
74 self,
75 ) -> ::std::result::Result<crate::operation::reboot_instances::RebootInstancesInput, ::aws_smithy_types::error::operation::BuildError> {
76 ::std::result::Result::Ok(crate::operation::reboot_instances::RebootInstancesInput {
77 instance_ids: self.instance_ids,
78 dry_run: self.dry_run,
79 })
80 }
81}