aws_sdk_ec2/operation/delete_subnet/
_delete_subnet_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 DeleteSubnetInput {
6    /// <p>The ID of the subnet.</p>
7    pub subnet_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 DeleteSubnetInput {
12    /// <p>The ID of the subnet.</p>
13    pub fn subnet_id(&self) -> ::std::option::Option<&str> {
14        self.subnet_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 DeleteSubnetInput {
22    /// Creates a new builder-style object to manufacture [`DeleteSubnetInput`](crate::operation::delete_subnet::DeleteSubnetInput).
23    pub fn builder() -> crate::operation::delete_subnet::builders::DeleteSubnetInputBuilder {
24        crate::operation::delete_subnet::builders::DeleteSubnetInputBuilder::default()
25    }
26}
27
28/// A builder for [`DeleteSubnetInput`](crate::operation::delete_subnet::DeleteSubnetInput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct DeleteSubnetInputBuilder {
32    pub(crate) subnet_id: ::std::option::Option<::std::string::String>,
33    pub(crate) dry_run: ::std::option::Option<bool>,
34}
35impl DeleteSubnetInputBuilder {
36    /// <p>The ID of the subnet.</p>
37    /// This field is required.
38    pub fn subnet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39        self.subnet_id = ::std::option::Option::Some(input.into());
40        self
41    }
42    /// <p>The ID of the subnet.</p>
43    pub fn set_subnet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44        self.subnet_id = input;
45        self
46    }
47    /// <p>The ID of the subnet.</p>
48    pub fn get_subnet_id(&self) -> &::std::option::Option<::std::string::String> {
49        &self.subnet_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 [`DeleteSubnetInput`](crate::operation::delete_subnet::DeleteSubnetInput).
66    pub fn build(
67        self,
68    ) -> ::std::result::Result<crate::operation::delete_subnet::DeleteSubnetInput, ::aws_smithy_types::error::operation::BuildError> {
69        ::std::result::Result::Ok(crate::operation::delete_subnet::DeleteSubnetInput {
70            subnet_id: self.subnet_id,
71            dry_run: self.dry_run,
72        })
73    }
74}