aws_sdk_ec2/operation/disable_image/
_disable_image_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 DisableImageInput {
6    /// <p>The ID of the AMI.</p>
7    pub image_id: ::std::option::Option<::std::string::String>,
8    /// <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>
9    pub dry_run: ::std::option::Option<bool>,
10}
11impl DisableImageInput {
12    /// <p>The ID of the AMI.</p>
13    pub fn image_id(&self) -> ::std::option::Option<&str> {
14        self.image_id.as_deref()
15    }
16    /// <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>
17    pub fn dry_run(&self) -> ::std::option::Option<bool> {
18        self.dry_run
19    }
20}
21impl DisableImageInput {
22    /// Creates a new builder-style object to manufacture [`DisableImageInput`](crate::operation::disable_image::DisableImageInput).
23    pub fn builder() -> crate::operation::disable_image::builders::DisableImageInputBuilder {
24        crate::operation::disable_image::builders::DisableImageInputBuilder::default()
25    }
26}
27
28/// A builder for [`DisableImageInput`](crate::operation::disable_image::DisableImageInput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct DisableImageInputBuilder {
32    pub(crate) image_id: ::std::option::Option<::std::string::String>,
33    pub(crate) dry_run: ::std::option::Option<bool>,
34}
35impl DisableImageInputBuilder {
36    /// <p>The ID of the AMI.</p>
37    /// This field is required.
38    pub fn image_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39        self.image_id = ::std::option::Option::Some(input.into());
40        self
41    }
42    /// <p>The ID of the AMI.</p>
43    pub fn set_image_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44        self.image_id = input;
45        self
46    }
47    /// <p>The ID of the AMI.</p>
48    pub fn get_image_id(&self) -> &::std::option::Option<::std::string::String> {
49        &self.image_id
50    }
51    /// <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>
52    pub fn dry_run(mut self, input: bool) -> Self {
53        self.dry_run = ::std::option::Option::Some(input);
54        self
55    }
56    /// <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>
57    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
58        self.dry_run = input;
59        self
60    }
61    /// <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>
62    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
63        &self.dry_run
64    }
65    /// Consumes the builder and constructs a [`DisableImageInput`](crate::operation::disable_image::DisableImageInput).
66    pub fn build(
67        self,
68    ) -> ::std::result::Result<crate::operation::disable_image::DisableImageInput, ::aws_smithy_types::error::operation::BuildError> {
69        ::std::result::Result::Ok(crate::operation::disable_image::DisableImageInput {
70            image_id: self.image_id,
71            dry_run: self.dry_run,
72        })
73    }
74}