aws_sdk_backupgateway/operation/create_gateway/
_create_gateway_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateGatewayInput {
6 pub activation_key: ::std::option::Option<::std::string::String>,
8 pub gateway_display_name: ::std::option::Option<::std::string::String>,
10 pub gateway_type: ::std::option::Option<crate::types::GatewayType>,
12 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
14}
15impl CreateGatewayInput {
16 pub fn activation_key(&self) -> ::std::option::Option<&str> {
18 self.activation_key.as_deref()
19 }
20 pub fn gateway_display_name(&self) -> ::std::option::Option<&str> {
22 self.gateway_display_name.as_deref()
23 }
24 pub fn gateway_type(&self) -> ::std::option::Option<&crate::types::GatewayType> {
26 self.gateway_type.as_ref()
27 }
28 pub fn tags(&self) -> &[crate::types::Tag] {
32 self.tags.as_deref().unwrap_or_default()
33 }
34}
35impl CreateGatewayInput {
36 pub fn builder() -> crate::operation::create_gateway::builders::CreateGatewayInputBuilder {
38 crate::operation::create_gateway::builders::CreateGatewayInputBuilder::default()
39 }
40}
41
42#[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 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 pub fn set_activation_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60 self.activation_key = input;
61 self
62 }
63 pub fn get_activation_key(&self) -> &::std::option::Option<::std::string::String> {
65 &self.activation_key
66 }
67 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 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 pub fn get_gateway_display_name(&self) -> &::std::option::Option<::std::string::String> {
80 &self.gateway_display_name
81 }
82 pub fn gateway_type(mut self, input: crate::types::GatewayType) -> Self {
85 self.gateway_type = ::std::option::Option::Some(input);
86 self
87 }
88 pub fn set_gateway_type(mut self, input: ::std::option::Option<crate::types::GatewayType>) -> Self {
90 self.gateway_type = input;
91 self
92 }
93 pub fn get_gateway_type(&self) -> &::std::option::Option<crate::types::GatewayType> {
95 &self.gateway_type
96 }
97 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 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 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
115 &self.tags
116 }
117 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}