aws_sdk_ec2/operation/disassociate_address/
_disassociate_address_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 DisassociateAddressInput {
6    /// <p>The association ID. This parameter is required.</p>
7    pub association_id: ::std::option::Option<::std::string::String>,
8    /// <p>Deprecated.</p>
9    pub public_ip: ::std::option::Option<::std::string::String>,
10    /// <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>
11    pub dry_run: ::std::option::Option<bool>,
12}
13impl DisassociateAddressInput {
14    /// <p>The association ID. This parameter is required.</p>
15    pub fn association_id(&self) -> ::std::option::Option<&str> {
16        self.association_id.as_deref()
17    }
18    /// <p>Deprecated.</p>
19    pub fn public_ip(&self) -> ::std::option::Option<&str> {
20        self.public_ip.as_deref()
21    }
22    /// <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>
23    pub fn dry_run(&self) -> ::std::option::Option<bool> {
24        self.dry_run
25    }
26}
27impl DisassociateAddressInput {
28    /// Creates a new builder-style object to manufacture [`DisassociateAddressInput`](crate::operation::disassociate_address::DisassociateAddressInput).
29    pub fn builder() -> crate::operation::disassociate_address::builders::DisassociateAddressInputBuilder {
30        crate::operation::disassociate_address::builders::DisassociateAddressInputBuilder::default()
31    }
32}
33
34/// A builder for [`DisassociateAddressInput`](crate::operation::disassociate_address::DisassociateAddressInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct DisassociateAddressInputBuilder {
38    pub(crate) association_id: ::std::option::Option<::std::string::String>,
39    pub(crate) public_ip: ::std::option::Option<::std::string::String>,
40    pub(crate) dry_run: ::std::option::Option<bool>,
41}
42impl DisassociateAddressInputBuilder {
43    /// <p>The association ID. This parameter is required.</p>
44    pub fn association_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
45        self.association_id = ::std::option::Option::Some(input.into());
46        self
47    }
48    /// <p>The association ID. This parameter is required.</p>
49    pub fn set_association_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
50        self.association_id = input;
51        self
52    }
53    /// <p>The association ID. This parameter is required.</p>
54    pub fn get_association_id(&self) -> &::std::option::Option<::std::string::String> {
55        &self.association_id
56    }
57    /// <p>Deprecated.</p>
58    pub fn public_ip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59        self.public_ip = ::std::option::Option::Some(input.into());
60        self
61    }
62    /// <p>Deprecated.</p>
63    pub fn set_public_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
64        self.public_ip = input;
65        self
66    }
67    /// <p>Deprecated.</p>
68    pub fn get_public_ip(&self) -> &::std::option::Option<::std::string::String> {
69        &self.public_ip
70    }
71    /// <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>
72    pub fn dry_run(mut self, input: bool) -> Self {
73        self.dry_run = ::std::option::Option::Some(input);
74        self
75    }
76    /// <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>
77    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
78        self.dry_run = input;
79        self
80    }
81    /// <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>
82    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
83        &self.dry_run
84    }
85    /// Consumes the builder and constructs a [`DisassociateAddressInput`](crate::operation::disassociate_address::DisassociateAddressInput).
86    pub fn build(
87        self,
88    ) -> ::std::result::Result<crate::operation::disassociate_address::DisassociateAddressInput, ::aws_smithy_types::error::operation::BuildError>
89    {
90        ::std::result::Result::Ok(crate::operation::disassociate_address::DisassociateAddressInput {
91            association_id: self.association_id,
92            public_ip: self.public_ip,
93            dry_run: self.dry_run,
94        })
95    }
96}