aws_sdk_ec2/operation/bundle_instance/
_bundle_instance_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the parameters for BundleInstance.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct BundleInstanceInput {
7    /// <p>The ID of the instance to bundle.</p>
8    /// <p>Default: None</p>
9    pub instance_id: ::std::option::Option<::std::string::String>,
10    /// <p>The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.</p>
11    pub storage: ::std::option::Option<crate::types::Storage>,
12    /// <p>Checks whether you have the required permissions for the action, 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>
13    pub dry_run: ::std::option::Option<bool>,
14}
15impl BundleInstanceInput {
16    /// <p>The ID of the instance to bundle.</p>
17    /// <p>Default: None</p>
18    pub fn instance_id(&self) -> ::std::option::Option<&str> {
19        self.instance_id.as_deref()
20    }
21    /// <p>The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.</p>
22    pub fn storage(&self) -> ::std::option::Option<&crate::types::Storage> {
23        self.storage.as_ref()
24    }
25    /// <p>Checks whether you have the required permissions for the action, 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>
26    pub fn dry_run(&self) -> ::std::option::Option<bool> {
27        self.dry_run
28    }
29}
30impl BundleInstanceInput {
31    /// Creates a new builder-style object to manufacture [`BundleInstanceInput`](crate::operation::bundle_instance::BundleInstanceInput).
32    pub fn builder() -> crate::operation::bundle_instance::builders::BundleInstanceInputBuilder {
33        crate::operation::bundle_instance::builders::BundleInstanceInputBuilder::default()
34    }
35}
36
37/// A builder for [`BundleInstanceInput`](crate::operation::bundle_instance::BundleInstanceInput).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct BundleInstanceInputBuilder {
41    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
42    pub(crate) storage: ::std::option::Option<crate::types::Storage>,
43    pub(crate) dry_run: ::std::option::Option<bool>,
44}
45impl BundleInstanceInputBuilder {
46    /// <p>The ID of the instance to bundle.</p>
47    /// <p>Default: None</p>
48    /// This field is required.
49    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
50        self.instance_id = ::std::option::Option::Some(input.into());
51        self
52    }
53    /// <p>The ID of the instance to bundle.</p>
54    /// <p>Default: None</p>
55    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
56        self.instance_id = input;
57        self
58    }
59    /// <p>The ID of the instance to bundle.</p>
60    /// <p>Default: None</p>
61    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
62        &self.instance_id
63    }
64    /// <p>The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.</p>
65    /// This field is required.
66    pub fn storage(mut self, input: crate::types::Storage) -> Self {
67        self.storage = ::std::option::Option::Some(input);
68        self
69    }
70    /// <p>The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.</p>
71    pub fn set_storage(mut self, input: ::std::option::Option<crate::types::Storage>) -> Self {
72        self.storage = input;
73        self
74    }
75    /// <p>The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.</p>
76    pub fn get_storage(&self) -> &::std::option::Option<crate::types::Storage> {
77        &self.storage
78    }
79    /// <p>Checks whether you have the required permissions for the action, 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 action, 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 action, 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 [`BundleInstanceInput`](crate::operation::bundle_instance::BundleInstanceInput).
94    pub fn build(
95        self,
96    ) -> ::std::result::Result<crate::operation::bundle_instance::BundleInstanceInput, ::aws_smithy_types::error::operation::BuildError> {
97        ::std::result::Result::Ok(crate::operation::bundle_instance::BundleInstanceInput {
98            instance_id: self.instance_id,
99            storage: self.storage,
100            dry_run: self.dry_run,
101        })
102    }
103}