aws_sdk_rtbfabric/operation/create_link/
_create_link_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateLinkInput {
6 pub gateway_id: ::std::option::Option<::std::string::String>,
8 pub peer_gateway_id: ::std::option::Option<::std::string::String>,
10 pub attributes: ::std::option::Option<crate::types::LinkAttributes>,
12 pub http_responder_allowed: ::std::option::Option<bool>,
14 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
16 pub log_settings: ::std::option::Option<crate::types::LinkLogSettings>,
18}
19impl CreateLinkInput {
20 pub fn gateway_id(&self) -> ::std::option::Option<&str> {
22 self.gateway_id.as_deref()
23 }
24 pub fn peer_gateway_id(&self) -> ::std::option::Option<&str> {
26 self.peer_gateway_id.as_deref()
27 }
28 pub fn attributes(&self) -> ::std::option::Option<&crate::types::LinkAttributes> {
30 self.attributes.as_ref()
31 }
32 pub fn http_responder_allowed(&self) -> ::std::option::Option<bool> {
34 self.http_responder_allowed
35 }
36 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
38 self.tags.as_ref()
39 }
40 pub fn log_settings(&self) -> ::std::option::Option<&crate::types::LinkLogSettings> {
42 self.log_settings.as_ref()
43 }
44}
45impl CreateLinkInput {
46 pub fn builder() -> crate::operation::create_link::builders::CreateLinkInputBuilder {
48 crate::operation::create_link::builders::CreateLinkInputBuilder::default()
49 }
50}
51
52#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct CreateLinkInputBuilder {
56 pub(crate) gateway_id: ::std::option::Option<::std::string::String>,
57 pub(crate) peer_gateway_id: ::std::option::Option<::std::string::String>,
58 pub(crate) attributes: ::std::option::Option<crate::types::LinkAttributes>,
59 pub(crate) http_responder_allowed: ::std::option::Option<bool>,
60 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
61 pub(crate) log_settings: ::std::option::Option<crate::types::LinkLogSettings>,
62}
63impl CreateLinkInputBuilder {
64 pub fn gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67 self.gateway_id = ::std::option::Option::Some(input.into());
68 self
69 }
70 pub fn set_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72 self.gateway_id = input;
73 self
74 }
75 pub fn get_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
77 &self.gateway_id
78 }
79 pub fn peer_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82 self.peer_gateway_id = ::std::option::Option::Some(input.into());
83 self
84 }
85 pub fn set_peer_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87 self.peer_gateway_id = input;
88 self
89 }
90 pub fn get_peer_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
92 &self.peer_gateway_id
93 }
94 pub fn attributes(mut self, input: crate::types::LinkAttributes) -> Self {
96 self.attributes = ::std::option::Option::Some(input);
97 self
98 }
99 pub fn set_attributes(mut self, input: ::std::option::Option<crate::types::LinkAttributes>) -> Self {
101 self.attributes = input;
102 self
103 }
104 pub fn get_attributes(&self) -> &::std::option::Option<crate::types::LinkAttributes> {
106 &self.attributes
107 }
108 pub fn http_responder_allowed(mut self, input: bool) -> Self {
110 self.http_responder_allowed = ::std::option::Option::Some(input);
111 self
112 }
113 pub fn set_http_responder_allowed(mut self, input: ::std::option::Option<bool>) -> Self {
115 self.http_responder_allowed = input;
116 self
117 }
118 pub fn get_http_responder_allowed(&self) -> &::std::option::Option<bool> {
120 &self.http_responder_allowed
121 }
122 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
128 let mut hash_map = self.tags.unwrap_or_default();
129 hash_map.insert(k.into(), v.into());
130 self.tags = ::std::option::Option::Some(hash_map);
131 self
132 }
133 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
135 self.tags = input;
136 self
137 }
138 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
140 &self.tags
141 }
142 pub fn log_settings(mut self, input: crate::types::LinkLogSettings) -> Self {
145 self.log_settings = ::std::option::Option::Some(input);
146 self
147 }
148 pub fn set_log_settings(mut self, input: ::std::option::Option<crate::types::LinkLogSettings>) -> Self {
150 self.log_settings = input;
151 self
152 }
153 pub fn get_log_settings(&self) -> &::std::option::Option<crate::types::LinkLogSettings> {
155 &self.log_settings
156 }
157 pub fn build(self) -> ::std::result::Result<crate::operation::create_link::CreateLinkInput, ::aws_smithy_types::error::operation::BuildError> {
159 ::std::result::Result::Ok(crate::operation::create_link::CreateLinkInput {
160 gateway_id: self.gateway_id,
161 peer_gateway_id: self.peer_gateway_id,
162 attributes: self.attributes,
163 http_responder_allowed: self.http_responder_allowed,
164 tags: self.tags,
165 log_settings: self.log_settings,
166 })
167 }
168}