aws_sdk_rtbfabric/operation/create_link/
_create_link_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 CreateLinkInput {
6    /// <p>The unique identifier of the gateway.</p>
7    pub gateway_id: ::std::option::Option<::std::string::String>,
8    /// <p>The unique identifier of the peer gateway.</p>
9    pub peer_gateway_id: ::std::option::Option<::std::string::String>,
10    /// <p>Attributes of the link.</p>
11    pub attributes: ::std::option::Option<crate::types::LinkAttributes>,
12    /// <p>Boolean to specify if an HTTP responder is allowed.</p>
13    pub http_responder_allowed: ::std::option::Option<bool>,
14    /// <p>A map of the key-value pairs of the tag or tags to assign to the resource.</p>
15    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
16    /// <p>Settings for the application logs.</p>
17    pub log_settings: ::std::option::Option<crate::types::LinkLogSettings>,
18}
19impl CreateLinkInput {
20    /// <p>The unique identifier of the gateway.</p>
21    pub fn gateway_id(&self) -> ::std::option::Option<&str> {
22        self.gateway_id.as_deref()
23    }
24    /// <p>The unique identifier of the peer gateway.</p>
25    pub fn peer_gateway_id(&self) -> ::std::option::Option<&str> {
26        self.peer_gateway_id.as_deref()
27    }
28    /// <p>Attributes of the link.</p>
29    pub fn attributes(&self) -> ::std::option::Option<&crate::types::LinkAttributes> {
30        self.attributes.as_ref()
31    }
32    /// <p>Boolean to specify if an HTTP responder is allowed.</p>
33    pub fn http_responder_allowed(&self) -> ::std::option::Option<bool> {
34        self.http_responder_allowed
35    }
36    /// <p>A map of the key-value pairs of the tag or tags to assign to the resource.</p>
37    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
38        self.tags.as_ref()
39    }
40    /// <p>Settings for the application logs.</p>
41    pub fn log_settings(&self) -> ::std::option::Option<&crate::types::LinkLogSettings> {
42        self.log_settings.as_ref()
43    }
44}
45impl CreateLinkInput {
46    /// Creates a new builder-style object to manufacture [`CreateLinkInput`](crate::operation::create_link::CreateLinkInput).
47    pub fn builder() -> crate::operation::create_link::builders::CreateLinkInputBuilder {
48        crate::operation::create_link::builders::CreateLinkInputBuilder::default()
49    }
50}
51
52/// A builder for [`CreateLinkInput`](crate::operation::create_link::CreateLinkInput).
53#[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    /// <p>The unique identifier of the gateway.</p>
65    /// This field is required.
66    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    /// <p>The unique identifier of the gateway.</p>
71    pub fn set_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.gateway_id = input;
73        self
74    }
75    /// <p>The unique identifier of the gateway.</p>
76    pub fn get_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
77        &self.gateway_id
78    }
79    /// <p>The unique identifier of the peer gateway.</p>
80    /// This field is required.
81    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    /// <p>The unique identifier of the peer gateway.</p>
86    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    /// <p>The unique identifier of the peer gateway.</p>
91    pub fn get_peer_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
92        &self.peer_gateway_id
93    }
94    /// <p>Attributes of the link.</p>
95    pub fn attributes(mut self, input: crate::types::LinkAttributes) -> Self {
96        self.attributes = ::std::option::Option::Some(input);
97        self
98    }
99    /// <p>Attributes of the link.</p>
100    pub fn set_attributes(mut self, input: ::std::option::Option<crate::types::LinkAttributes>) -> Self {
101        self.attributes = input;
102        self
103    }
104    /// <p>Attributes of the link.</p>
105    pub fn get_attributes(&self) -> &::std::option::Option<crate::types::LinkAttributes> {
106        &self.attributes
107    }
108    /// <p>Boolean to specify if an HTTP responder is allowed.</p>
109    pub fn http_responder_allowed(mut self, input: bool) -> Self {
110        self.http_responder_allowed = ::std::option::Option::Some(input);
111        self
112    }
113    /// <p>Boolean to specify if an HTTP responder is allowed.</p>
114    pub fn set_http_responder_allowed(mut self, input: ::std::option::Option<bool>) -> Self {
115        self.http_responder_allowed = input;
116        self
117    }
118    /// <p>Boolean to specify if an HTTP responder is allowed.</p>
119    pub fn get_http_responder_allowed(&self) -> &::std::option::Option<bool> {
120        &self.http_responder_allowed
121    }
122    /// Adds a key-value pair to `tags`.
123    ///
124    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
125    ///
126    /// <p>A map of the key-value pairs of the tag or tags to assign to the resource.</p>
127    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    /// <p>A map of the key-value pairs of the tag or tags to assign to the resource.</p>
134    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    /// <p>A map of the key-value pairs of the tag or tags to assign to the resource.</p>
139    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
140        &self.tags
141    }
142    /// <p>Settings for the application logs.</p>
143    /// This field is required.
144    pub fn log_settings(mut self, input: crate::types::LinkLogSettings) -> Self {
145        self.log_settings = ::std::option::Option::Some(input);
146        self
147    }
148    /// <p>Settings for the application logs.</p>
149    pub fn set_log_settings(mut self, input: ::std::option::Option<crate::types::LinkLogSettings>) -> Self {
150        self.log_settings = input;
151        self
152    }
153    /// <p>Settings for the application logs.</p>
154    pub fn get_log_settings(&self) -> &::std::option::Option<crate::types::LinkLogSettings> {
155        &self.log_settings
156    }
157    /// Consumes the builder and constructs a [`CreateLinkInput`](crate::operation::create_link::CreateLinkInput).
158    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}