aws_sdk_ec2/operation/create_egress_only_internet_gateway/_create_egress_only_internet_gateway_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 CreateEgressOnlyInternetGatewayInput {
6 /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring idempotency</a>.</p>
7 pub client_token: ::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 /// <p>The ID of the VPC for which to create the egress-only internet gateway.</p>
11 pub vpc_id: ::std::option::Option<::std::string::String>,
12 /// <p>The tags to assign to the egress-only internet gateway.</p>
13 pub tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
14}
15impl CreateEgressOnlyInternetGatewayInput {
16 /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring idempotency</a>.</p>
17 pub fn client_token(&self) -> ::std::option::Option<&str> {
18 self.client_token.as_deref()
19 }
20 /// <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>
21 pub fn dry_run(&self) -> ::std::option::Option<bool> {
22 self.dry_run
23 }
24 /// <p>The ID of the VPC for which to create the egress-only internet gateway.</p>
25 pub fn vpc_id(&self) -> ::std::option::Option<&str> {
26 self.vpc_id.as_deref()
27 }
28 /// <p>The tags to assign to the egress-only internet gateway.</p>
29 ///
30 /// 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()`.
31 pub fn tag_specifications(&self) -> &[crate::types::TagSpecification] {
32 self.tag_specifications.as_deref().unwrap_or_default()
33 }
34}
35impl CreateEgressOnlyInternetGatewayInput {
36 /// Creates a new builder-style object to manufacture [`CreateEgressOnlyInternetGatewayInput`](crate::operation::create_egress_only_internet_gateway::CreateEgressOnlyInternetGatewayInput).
37 pub fn builder() -> crate::operation::create_egress_only_internet_gateway::builders::CreateEgressOnlyInternetGatewayInputBuilder {
38 crate::operation::create_egress_only_internet_gateway::builders::CreateEgressOnlyInternetGatewayInputBuilder::default()
39 }
40}
41
42/// A builder for [`CreateEgressOnlyInternetGatewayInput`](crate::operation::create_egress_only_internet_gateway::CreateEgressOnlyInternetGatewayInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct CreateEgressOnlyInternetGatewayInputBuilder {
46 pub(crate) client_token: ::std::option::Option<::std::string::String>,
47 pub(crate) dry_run: ::std::option::Option<bool>,
48 pub(crate) vpc_id: ::std::option::Option<::std::string::String>,
49 pub(crate) tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
50}
51impl CreateEgressOnlyInternetGatewayInputBuilder {
52 /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring idempotency</a>.</p>
53 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
54 self.client_token = ::std::option::Option::Some(input.into());
55 self
56 }
57 /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring idempotency</a>.</p>
58 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
59 self.client_token = input;
60 self
61 }
62 /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring idempotency</a>.</p>
63 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
64 &self.client_token
65 }
66 /// <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>
67 pub fn dry_run(mut self, input: bool) -> Self {
68 self.dry_run = ::std::option::Option::Some(input);
69 self
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 set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
73 self.dry_run = 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 get_dry_run(&self) -> &::std::option::Option<bool> {
78 &self.dry_run
79 }
80 /// <p>The ID of the VPC for which to create the egress-only internet gateway.</p>
81 /// This field is required.
82 pub fn vpc_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83 self.vpc_id = ::std::option::Option::Some(input.into());
84 self
85 }
86 /// <p>The ID of the VPC for which to create the egress-only internet gateway.</p>
87 pub fn set_vpc_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88 self.vpc_id = input;
89 self
90 }
91 /// <p>The ID of the VPC for which to create the egress-only internet gateway.</p>
92 pub fn get_vpc_id(&self) -> &::std::option::Option<::std::string::String> {
93 &self.vpc_id
94 }
95 /// Appends an item to `tag_specifications`.
96 ///
97 /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
98 ///
99 /// <p>The tags to assign to the egress-only internet gateway.</p>
100 pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
101 let mut v = self.tag_specifications.unwrap_or_default();
102 v.push(input);
103 self.tag_specifications = ::std::option::Option::Some(v);
104 self
105 }
106 /// <p>The tags to assign to the egress-only internet gateway.</p>
107 pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
108 self.tag_specifications = input;
109 self
110 }
111 /// <p>The tags to assign to the egress-only internet gateway.</p>
112 pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
113 &self.tag_specifications
114 }
115 /// Consumes the builder and constructs a [`CreateEgressOnlyInternetGatewayInput`](crate::operation::create_egress_only_internet_gateway::CreateEgressOnlyInternetGatewayInput).
116 pub fn build(
117 self,
118 ) -> ::std::result::Result<
119 crate::operation::create_egress_only_internet_gateway::CreateEgressOnlyInternetGatewayInput,
120 ::aws_smithy_types::error::operation::BuildError,
121 > {
122 ::std::result::Result::Ok(
123 crate::operation::create_egress_only_internet_gateway::CreateEgressOnlyInternetGatewayInput {
124 client_token: self.client_token,
125 dry_run: self.dry_run,
126 vpc_id: self.vpc_id,
127 tag_specifications: self.tag_specifications,
128 },
129 )
130 }
131}