aws_sdk_ec2/operation/accept_address_transfer/_accept_address_transfer_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 AcceptAddressTransferInput {
6 /// <p>The Elastic IP address you are accepting for transfer.</p>
7 pub address: ::std::option::Option<::std::string::String>,
8 /// <p><code>tag</code>:<key>
9 /// - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key
10 /// <code>Owner</code> and the value
11 /// <code>TeamA</code>, specify
12 /// <code>tag:Owner</code> for the filter name and
13 /// <code>TeamA</code> for the filter value.
14 /// </key></p>
15 pub tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
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 dry_run: ::std::option::Option<bool>,
18}
19impl AcceptAddressTransferInput {
20 /// <p>The Elastic IP address you are accepting for transfer.</p>
21 pub fn address(&self) -> ::std::option::Option<&str> {
22 self.address.as_deref()
23 }
24 /// <p><code>tag</code>:<key>
25 /// - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key
26 /// <code>Owner</code> and the value
27 /// <code>TeamA</code>, specify
28 /// <code>tag:Owner</code> for the filter name and
29 /// <code>TeamA</code> for the filter value.
30 /// </key></p>
31 ///
32 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tag_specifications.is_none()`.
33 pub fn tag_specifications(&self) -> &[crate::types::TagSpecification] {
34 self.tag_specifications.as_deref().unwrap_or_default()
35 }
36 /// <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>
37 pub fn dry_run(&self) -> ::std::option::Option<bool> {
38 self.dry_run
39 }
40}
41impl AcceptAddressTransferInput {
42 /// Creates a new builder-style object to manufacture [`AcceptAddressTransferInput`](crate::operation::accept_address_transfer::AcceptAddressTransferInput).
43 pub fn builder() -> crate::operation::accept_address_transfer::builders::AcceptAddressTransferInputBuilder {
44 crate::operation::accept_address_transfer::builders::AcceptAddressTransferInputBuilder::default()
45 }
46}
47
48/// A builder for [`AcceptAddressTransferInput`](crate::operation::accept_address_transfer::AcceptAddressTransferInput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct AcceptAddressTransferInputBuilder {
52 pub(crate) address: ::std::option::Option<::std::string::String>,
53 pub(crate) tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
54 pub(crate) dry_run: ::std::option::Option<bool>,
55}
56impl AcceptAddressTransferInputBuilder {
57 /// <p>The Elastic IP address you are accepting for transfer.</p>
58 /// This field is required.
59 pub fn address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60 self.address = ::std::option::Option::Some(input.into());
61 self
62 }
63 /// <p>The Elastic IP address you are accepting for transfer.</p>
64 pub fn set_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65 self.address = input;
66 self
67 }
68 /// <p>The Elastic IP address you are accepting for transfer.</p>
69 pub fn get_address(&self) -> &::std::option::Option<::std::string::String> {
70 &self.address
71 }
72 /// Appends an item to `tag_specifications`.
73 ///
74 /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
75 ///
76 /// <p><code>tag</code>:<key>
77 /// - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key
78 /// <code>Owner</code> and the value
79 /// <code>TeamA</code>, specify
80 /// <code>tag:Owner</code> for the filter name and
81 /// <code>TeamA</code> for the filter value.
82 /// </key></p>
83 pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
84 let mut v = self.tag_specifications.unwrap_or_default();
85 v.push(input);
86 self.tag_specifications = ::std::option::Option::Some(v);
87 self
88 }
89 /// <p><code>tag</code>:<key>
90 /// - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key
91 /// <code>Owner</code> and the value
92 /// <code>TeamA</code>, specify
93 /// <code>tag:Owner</code> for the filter name and
94 /// <code>TeamA</code> for the filter value.
95 /// </key></p>
96 pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
97 self.tag_specifications = input;
98 self
99 }
100 /// <p><code>tag</code>:<key>
101 /// - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key
102 /// <code>Owner</code> and the value
103 /// <code>TeamA</code>, specify
104 /// <code>tag:Owner</code> for the filter name and
105 /// <code>TeamA</code> for the filter value.
106 /// </key></p>
107 pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
108 &self.tag_specifications
109 }
110 /// <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>
111 pub fn dry_run(mut self, input: bool) -> Self {
112 self.dry_run = ::std::option::Option::Some(input);
113 self
114 }
115 /// <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>
116 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
117 self.dry_run = input;
118 self
119 }
120 /// <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>
121 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
122 &self.dry_run
123 }
124 /// Consumes the builder and constructs a [`AcceptAddressTransferInput`](crate::operation::accept_address_transfer::AcceptAddressTransferInput).
125 pub fn build(
126 self,
127 ) -> ::std::result::Result<crate::operation::accept_address_transfer::AcceptAddressTransferInput, ::aws_smithy_types::error::operation::BuildError>
128 {
129 ::std::result::Result::Ok(crate::operation::accept_address_transfer::AcceptAddressTransferInput {
130 address: self.address,
131 tag_specifications: self.tag_specifications,
132 dry_run: self.dry_run,
133 })
134 }
135}