aws_sdk_ec2/operation/create_transit_gateway/
_create_transit_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 CreateTransitGatewayInput {
6    /// <p>A description of the transit gateway.</p>
7    pub description: ::std::option::Option<::std::string::String>,
8    /// <p>The transit gateway options.</p>
9    pub options: ::std::option::Option<crate::types::TransitGatewayRequestOptions>,
10    /// <p>The tags to apply to the transit gateway.</p>
11    pub tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
12    /// <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>
13    pub dry_run: ::std::option::Option<bool>,
14}
15impl CreateTransitGatewayInput {
16    /// <p>A description of the transit gateway.</p>
17    pub fn description(&self) -> ::std::option::Option<&str> {
18        self.description.as_deref()
19    }
20    /// <p>The transit gateway options.</p>
21    pub fn options(&self) -> ::std::option::Option<&crate::types::TransitGatewayRequestOptions> {
22        self.options.as_ref()
23    }
24    /// <p>The tags to apply to the transit gateway.</p>
25    ///
26    /// 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()`.
27    pub fn tag_specifications(&self) -> &[crate::types::TagSpecification] {
28        self.tag_specifications.as_deref().unwrap_or_default()
29    }
30    /// <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>
31    pub fn dry_run(&self) -> ::std::option::Option<bool> {
32        self.dry_run
33    }
34}
35impl CreateTransitGatewayInput {
36    /// Creates a new builder-style object to manufacture [`CreateTransitGatewayInput`](crate::operation::create_transit_gateway::CreateTransitGatewayInput).
37    pub fn builder() -> crate::operation::create_transit_gateway::builders::CreateTransitGatewayInputBuilder {
38        crate::operation::create_transit_gateway::builders::CreateTransitGatewayInputBuilder::default()
39    }
40}
41
42/// A builder for [`CreateTransitGatewayInput`](crate::operation::create_transit_gateway::CreateTransitGatewayInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct CreateTransitGatewayInputBuilder {
46    pub(crate) description: ::std::option::Option<::std::string::String>,
47    pub(crate) options: ::std::option::Option<crate::types::TransitGatewayRequestOptions>,
48    pub(crate) tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
49    pub(crate) dry_run: ::std::option::Option<bool>,
50}
51impl CreateTransitGatewayInputBuilder {
52    /// <p>A description of the transit gateway.</p>
53    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
54        self.description = ::std::option::Option::Some(input.into());
55        self
56    }
57    /// <p>A description of the transit gateway.</p>
58    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
59        self.description = input;
60        self
61    }
62    /// <p>A description of the transit gateway.</p>
63    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
64        &self.description
65    }
66    /// <p>The transit gateway options.</p>
67    pub fn options(mut self, input: crate::types::TransitGatewayRequestOptions) -> Self {
68        self.options = ::std::option::Option::Some(input);
69        self
70    }
71    /// <p>The transit gateway options.</p>
72    pub fn set_options(mut self, input: ::std::option::Option<crate::types::TransitGatewayRequestOptions>) -> Self {
73        self.options = input;
74        self
75    }
76    /// <p>The transit gateway options.</p>
77    pub fn get_options(&self) -> &::std::option::Option<crate::types::TransitGatewayRequestOptions> {
78        &self.options
79    }
80    /// Appends an item to `tag_specifications`.
81    ///
82    /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
83    ///
84    /// <p>The tags to apply to the transit gateway.</p>
85    pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
86        let mut v = self.tag_specifications.unwrap_or_default();
87        v.push(input);
88        self.tag_specifications = ::std::option::Option::Some(v);
89        self
90    }
91    /// <p>The tags to apply to the transit gateway.</p>
92    pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
93        self.tag_specifications = input;
94        self
95    }
96    /// <p>The tags to apply to the transit gateway.</p>
97    pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
98        &self.tag_specifications
99    }
100    /// <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>
101    pub fn dry_run(mut self, input: bool) -> Self {
102        self.dry_run = ::std::option::Option::Some(input);
103        self
104    }
105    /// <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>
106    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
107        self.dry_run = input;
108        self
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 get_dry_run(&self) -> &::std::option::Option<bool> {
112        &self.dry_run
113    }
114    /// Consumes the builder and constructs a [`CreateTransitGatewayInput`](crate::operation::create_transit_gateway::CreateTransitGatewayInput).
115    pub fn build(
116        self,
117    ) -> ::std::result::Result<crate::operation::create_transit_gateway::CreateTransitGatewayInput, ::aws_smithy_types::error::operation::BuildError>
118    {
119        ::std::result::Result::Ok(crate::operation::create_transit_gateway::CreateTransitGatewayInput {
120            description: self.description,
121            options: self.options,
122            tag_specifications: self.tag_specifications,
123            dry_run: self.dry_run,
124        })
125    }
126}