aws_sdk_backupgateway/operation/create_gateway/
_create_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 CreateGatewayInput {
6    /// <p>The activation key of the created gateway.</p>
7    pub activation_key: ::std::option::Option<::std::string::String>,
8    /// <p>The display name of the created gateway.</p>
9    pub gateway_display_name: ::std::option::Option<::std::string::String>,
10    /// <p>The type of created gateway.</p>
11    pub gateway_type: ::std::option::Option<crate::types::GatewayType>,
12    /// <p>A list of up to 50 tags to assign to the gateway. Each tag is a key-value pair.</p>
13    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
14}
15impl CreateGatewayInput {
16    /// <p>The activation key of the created gateway.</p>
17    pub fn activation_key(&self) -> ::std::option::Option<&str> {
18        self.activation_key.as_deref()
19    }
20    /// <p>The display name of the created gateway.</p>
21    pub fn gateway_display_name(&self) -> ::std::option::Option<&str> {
22        self.gateway_display_name.as_deref()
23    }
24    /// <p>The type of created gateway.</p>
25    pub fn gateway_type(&self) -> ::std::option::Option<&crate::types::GatewayType> {
26        self.gateway_type.as_ref()
27    }
28    /// <p>A list of up to 50 tags to assign to the gateway. Each tag is a key-value pair.</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 `.tags.is_none()`.
31    pub fn tags(&self) -> &[crate::types::Tag] {
32        self.tags.as_deref().unwrap_or_default()
33    }
34}
35impl CreateGatewayInput {
36    /// Creates a new builder-style object to manufacture [`CreateGatewayInput`](crate::operation::create_gateway::CreateGatewayInput).
37    pub fn builder() -> crate::operation::create_gateway::builders::CreateGatewayInputBuilder {
38        crate::operation::create_gateway::builders::CreateGatewayInputBuilder::default()
39    }
40}
41
42/// A builder for [`CreateGatewayInput`](crate::operation::create_gateway::CreateGatewayInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct CreateGatewayInputBuilder {
46    pub(crate) activation_key: ::std::option::Option<::std::string::String>,
47    pub(crate) gateway_display_name: ::std::option::Option<::std::string::String>,
48    pub(crate) gateway_type: ::std::option::Option<crate::types::GatewayType>,
49    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
50}
51impl CreateGatewayInputBuilder {
52    /// <p>The activation key of the created gateway.</p>
53    /// This field is required.
54    pub fn activation_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.activation_key = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The activation key of the created gateway.</p>
59    pub fn set_activation_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.activation_key = input;
61        self
62    }
63    /// <p>The activation key of the created gateway.</p>
64    pub fn get_activation_key(&self) -> &::std::option::Option<::std::string::String> {
65        &self.activation_key
66    }
67    /// <p>The display name of the created gateway.</p>
68    /// This field is required.
69    pub fn gateway_display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70        self.gateway_display_name = ::std::option::Option::Some(input.into());
71        self
72    }
73    /// <p>The display name of the created gateway.</p>
74    pub fn set_gateway_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75        self.gateway_display_name = input;
76        self
77    }
78    /// <p>The display name of the created gateway.</p>
79    pub fn get_gateway_display_name(&self) -> &::std::option::Option<::std::string::String> {
80        &self.gateway_display_name
81    }
82    /// <p>The type of created gateway.</p>
83    /// This field is required.
84    pub fn gateway_type(mut self, input: crate::types::GatewayType) -> Self {
85        self.gateway_type = ::std::option::Option::Some(input);
86        self
87    }
88    /// <p>The type of created gateway.</p>
89    pub fn set_gateway_type(mut self, input: ::std::option::Option<crate::types::GatewayType>) -> Self {
90        self.gateway_type = input;
91        self
92    }
93    /// <p>The type of created gateway.</p>
94    pub fn get_gateway_type(&self) -> &::std::option::Option<crate::types::GatewayType> {
95        &self.gateway_type
96    }
97    /// Appends an item to `tags`.
98    ///
99    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
100    ///
101    /// <p>A list of up to 50 tags to assign to the gateway. Each tag is a key-value pair.</p>
102    pub fn tags(mut self, input: crate::types::Tag) -> Self {
103        let mut v = self.tags.unwrap_or_default();
104        v.push(input);
105        self.tags = ::std::option::Option::Some(v);
106        self
107    }
108    /// <p>A list of up to 50 tags to assign to the gateway. Each tag is a key-value pair.</p>
109    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
110        self.tags = input;
111        self
112    }
113    /// <p>A list of up to 50 tags to assign to the gateway. Each tag is a key-value pair.</p>
114    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
115        &self.tags
116    }
117    /// Consumes the builder and constructs a [`CreateGatewayInput`](crate::operation::create_gateway::CreateGatewayInput).
118    pub fn build(
119        self,
120    ) -> ::std::result::Result<crate::operation::create_gateway::CreateGatewayInput, ::aws_smithy_types::error::operation::BuildError> {
121        ::std::result::Result::Ok(crate::operation::create_gateway::CreateGatewayInput {
122            activation_key: self.activation_key,
123            gateway_display_name: self.gateway_display_name,
124            gateway_type: self.gateway_type,
125            tags: self.tags,
126        })
127    }
128}