aws_sdk_apigatewayv2/types/
_vpc_link.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents a VPC link.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct VpcLink {
7    /// <p>The timestamp when the VPC link was created.</p>
8    pub created_date: ::std::option::Option<::aws_smithy_types::DateTime>,
9    /// <p>The name of the VPC link.</p>
10    pub name: ::std::option::Option<::std::string::String>,
11    /// <p>A list of security group IDs for the VPC link.</p>
12    pub security_group_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
13    /// <p>A list of subnet IDs to include in the VPC link.</p>
14    pub subnet_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
15    /// <p>Tags for the VPC link.</p>
16    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
17    /// <p>The ID of the VPC link.</p>
18    pub vpc_link_id: ::std::option::Option<::std::string::String>,
19    /// <p>The status of the VPC link.</p>
20    pub vpc_link_status: ::std::option::Option<crate::types::VpcLinkStatus>,
21    /// <p>A message summarizing the cause of the status of the VPC link.</p>
22    pub vpc_link_status_message: ::std::option::Option<::std::string::String>,
23    /// <p>The version of the VPC link.</p>
24    pub vpc_link_version: ::std::option::Option<crate::types::VpcLinkVersion>,
25}
26impl VpcLink {
27    /// <p>The timestamp when the VPC link was created.</p>
28    pub fn created_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
29        self.created_date.as_ref()
30    }
31    /// <p>The name of the VPC link.</p>
32    pub fn name(&self) -> ::std::option::Option<&str> {
33        self.name.as_deref()
34    }
35    /// <p>A list of security group IDs for the VPC link.</p>
36    ///
37    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.security_group_ids.is_none()`.
38    pub fn security_group_ids(&self) -> &[::std::string::String] {
39        self.security_group_ids.as_deref().unwrap_or_default()
40    }
41    /// <p>A list of subnet IDs to include in the VPC link.</p>
42    ///
43    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.subnet_ids.is_none()`.
44    pub fn subnet_ids(&self) -> &[::std::string::String] {
45        self.subnet_ids.as_deref().unwrap_or_default()
46    }
47    /// <p>Tags for the VPC link.</p>
48    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
49        self.tags.as_ref()
50    }
51    /// <p>The ID of the VPC link.</p>
52    pub fn vpc_link_id(&self) -> ::std::option::Option<&str> {
53        self.vpc_link_id.as_deref()
54    }
55    /// <p>The status of the VPC link.</p>
56    pub fn vpc_link_status(&self) -> ::std::option::Option<&crate::types::VpcLinkStatus> {
57        self.vpc_link_status.as_ref()
58    }
59    /// <p>A message summarizing the cause of the status of the VPC link.</p>
60    pub fn vpc_link_status_message(&self) -> ::std::option::Option<&str> {
61        self.vpc_link_status_message.as_deref()
62    }
63    /// <p>The version of the VPC link.</p>
64    pub fn vpc_link_version(&self) -> ::std::option::Option<&crate::types::VpcLinkVersion> {
65        self.vpc_link_version.as_ref()
66    }
67}
68impl VpcLink {
69    /// Creates a new builder-style object to manufacture [`VpcLink`](crate::types::VpcLink).
70    pub fn builder() -> crate::types::builders::VpcLinkBuilder {
71        crate::types::builders::VpcLinkBuilder::default()
72    }
73}
74
75/// A builder for [`VpcLink`](crate::types::VpcLink).
76#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
77#[non_exhaustive]
78pub struct VpcLinkBuilder {
79    pub(crate) created_date: ::std::option::Option<::aws_smithy_types::DateTime>,
80    pub(crate) name: ::std::option::Option<::std::string::String>,
81    pub(crate) security_group_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
82    pub(crate) subnet_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
83    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
84    pub(crate) vpc_link_id: ::std::option::Option<::std::string::String>,
85    pub(crate) vpc_link_status: ::std::option::Option<crate::types::VpcLinkStatus>,
86    pub(crate) vpc_link_status_message: ::std::option::Option<::std::string::String>,
87    pub(crate) vpc_link_version: ::std::option::Option<crate::types::VpcLinkVersion>,
88}
89impl VpcLinkBuilder {
90    /// <p>The timestamp when the VPC link was created.</p>
91    pub fn created_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
92        self.created_date = ::std::option::Option::Some(input);
93        self
94    }
95    /// <p>The timestamp when the VPC link was created.</p>
96    pub fn set_created_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
97        self.created_date = input;
98        self
99    }
100    /// <p>The timestamp when the VPC link was created.</p>
101    pub fn get_created_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
102        &self.created_date
103    }
104    /// <p>The name of the VPC link.</p>
105    /// This field is required.
106    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
107        self.name = ::std::option::Option::Some(input.into());
108        self
109    }
110    /// <p>The name of the VPC link.</p>
111    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
112        self.name = input;
113        self
114    }
115    /// <p>The name of the VPC link.</p>
116    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
117        &self.name
118    }
119    /// Appends an item to `security_group_ids`.
120    ///
121    /// To override the contents of this collection use [`set_security_group_ids`](Self::set_security_group_ids).
122    ///
123    /// <p>A list of security group IDs for the VPC link.</p>
124    pub fn security_group_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        let mut v = self.security_group_ids.unwrap_or_default();
126        v.push(input.into());
127        self.security_group_ids = ::std::option::Option::Some(v);
128        self
129    }
130    /// <p>A list of security group IDs for the VPC link.</p>
131    pub fn set_security_group_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
132        self.security_group_ids = input;
133        self
134    }
135    /// <p>A list of security group IDs for the VPC link.</p>
136    pub fn get_security_group_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
137        &self.security_group_ids
138    }
139    /// Appends an item to `subnet_ids`.
140    ///
141    /// To override the contents of this collection use [`set_subnet_ids`](Self::set_subnet_ids).
142    ///
143    /// <p>A list of subnet IDs to include in the VPC link.</p>
144    pub fn subnet_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        let mut v = self.subnet_ids.unwrap_or_default();
146        v.push(input.into());
147        self.subnet_ids = ::std::option::Option::Some(v);
148        self
149    }
150    /// <p>A list of subnet IDs to include in the VPC link.</p>
151    pub fn set_subnet_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
152        self.subnet_ids = input;
153        self
154    }
155    /// <p>A list of subnet IDs to include in the VPC link.</p>
156    pub fn get_subnet_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
157        &self.subnet_ids
158    }
159    /// Adds a key-value pair to `tags`.
160    ///
161    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
162    ///
163    /// <p>Tags for the VPC link.</p>
164    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
165        let mut hash_map = self.tags.unwrap_or_default();
166        hash_map.insert(k.into(), v.into());
167        self.tags = ::std::option::Option::Some(hash_map);
168        self
169    }
170    /// <p>Tags for the VPC link.</p>
171    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
172        self.tags = input;
173        self
174    }
175    /// <p>Tags for the VPC link.</p>
176    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
177        &self.tags
178    }
179    /// <p>The ID of the VPC link.</p>
180    /// This field is required.
181    pub fn vpc_link_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
182        self.vpc_link_id = ::std::option::Option::Some(input.into());
183        self
184    }
185    /// <p>The ID of the VPC link.</p>
186    pub fn set_vpc_link_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
187        self.vpc_link_id = input;
188        self
189    }
190    /// <p>The ID of the VPC link.</p>
191    pub fn get_vpc_link_id(&self) -> &::std::option::Option<::std::string::String> {
192        &self.vpc_link_id
193    }
194    /// <p>The status of the VPC link.</p>
195    pub fn vpc_link_status(mut self, input: crate::types::VpcLinkStatus) -> Self {
196        self.vpc_link_status = ::std::option::Option::Some(input);
197        self
198    }
199    /// <p>The status of the VPC link.</p>
200    pub fn set_vpc_link_status(mut self, input: ::std::option::Option<crate::types::VpcLinkStatus>) -> Self {
201        self.vpc_link_status = input;
202        self
203    }
204    /// <p>The status of the VPC link.</p>
205    pub fn get_vpc_link_status(&self) -> &::std::option::Option<crate::types::VpcLinkStatus> {
206        &self.vpc_link_status
207    }
208    /// <p>A message summarizing the cause of the status of the VPC link.</p>
209    pub fn vpc_link_status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
210        self.vpc_link_status_message = ::std::option::Option::Some(input.into());
211        self
212    }
213    /// <p>A message summarizing the cause of the status of the VPC link.</p>
214    pub fn set_vpc_link_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
215        self.vpc_link_status_message = input;
216        self
217    }
218    /// <p>A message summarizing the cause of the status of the VPC link.</p>
219    pub fn get_vpc_link_status_message(&self) -> &::std::option::Option<::std::string::String> {
220        &self.vpc_link_status_message
221    }
222    /// <p>The version of the VPC link.</p>
223    pub fn vpc_link_version(mut self, input: crate::types::VpcLinkVersion) -> Self {
224        self.vpc_link_version = ::std::option::Option::Some(input);
225        self
226    }
227    /// <p>The version of the VPC link.</p>
228    pub fn set_vpc_link_version(mut self, input: ::std::option::Option<crate::types::VpcLinkVersion>) -> Self {
229        self.vpc_link_version = input;
230        self
231    }
232    /// <p>The version of the VPC link.</p>
233    pub fn get_vpc_link_version(&self) -> &::std::option::Option<crate::types::VpcLinkVersion> {
234        &self.vpc_link_version
235    }
236    /// Consumes the builder and constructs a [`VpcLink`](crate::types::VpcLink).
237    pub fn build(self) -> crate::types::VpcLink {
238        crate::types::VpcLink {
239            created_date: self.created_date,
240            name: self.name,
241            security_group_ids: self.security_group_ids,
242            subnet_ids: self.subnet_ids,
243            tags: self.tags,
244            vpc_link_id: self.vpc_link_id,
245            vpc_link_status: self.vpc_link_status,
246            vpc_link_status_message: self.vpc_link_status_message,
247            vpc_link_version: self.vpc_link_version,
248        }
249    }
250}