Skip to main content

aws_sdk_apigateway/operation/create_vpc_link/
_create_vpc_link_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>An API Gateway VPC link for a RestApi to access resources in an Amazon Virtual Private Cloud (VPC).</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateVpcLinkOutput {
7    /// <p>The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.</p>
8    pub id: ::std::option::Option<::std::string::String>,
9    /// <p>The name used to label and identify the VPC link.</p>
10    pub name: ::std::option::Option<::std::string::String>,
11    /// <p>The description of the VPC link.</p>
12    pub description: ::std::option::Option<::std::string::String>,
13    /// <p>The ARN of the network load balancer of the VPC targeted by the VPC link. The network load balancer must be owned by the same Amazon Web Services account of the API owner.</p>
14    pub target_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
15    /// <p>The status of the VPC link. The valid values are <code>AVAILABLE</code>, <code>PENDING</code>, <code>DELETING</code>, or <code>FAILED</code>. Deploying an API will wait if the status is <code>PENDING</code> and will fail if the status is <code>DELETING</code>.</p>
16    pub status: ::std::option::Option<crate::types::VpcLinkStatus>,
17    /// <p>A description about the VPC link status.</p>
18    pub status_message: ::std::option::Option<::std::string::String>,
19    /// <p>The collection of tags. Each tag element is associated with a given resource.</p>
20    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
21    _request_id: Option<String>,
22}
23impl CreateVpcLinkOutput {
24    /// <p>The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.</p>
25    pub fn id(&self) -> ::std::option::Option<&str> {
26        self.id.as_deref()
27    }
28    /// <p>The name used to label and identify the VPC link.</p>
29    pub fn name(&self) -> ::std::option::Option<&str> {
30        self.name.as_deref()
31    }
32    /// <p>The description of the VPC link.</p>
33    pub fn description(&self) -> ::std::option::Option<&str> {
34        self.description.as_deref()
35    }
36    /// <p>The ARN of the network load balancer of the VPC targeted by the VPC link. The network load balancer must be owned by the same Amazon Web Services account of the API owner.</p>
37    ///
38    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.target_arns.is_none()`.
39    pub fn target_arns(&self) -> &[::std::string::String] {
40        self.target_arns.as_deref().unwrap_or_default()
41    }
42    /// <p>The status of the VPC link. The valid values are <code>AVAILABLE</code>, <code>PENDING</code>, <code>DELETING</code>, or <code>FAILED</code>. Deploying an API will wait if the status is <code>PENDING</code> and will fail if the status is <code>DELETING</code>.</p>
43    pub fn status(&self) -> ::std::option::Option<&crate::types::VpcLinkStatus> {
44        self.status.as_ref()
45    }
46    /// <p>A description about the VPC link status.</p>
47    pub fn status_message(&self) -> ::std::option::Option<&str> {
48        self.status_message.as_deref()
49    }
50    /// <p>The collection of tags. Each tag element is associated with a given resource.</p>
51    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
52        self.tags.as_ref()
53    }
54}
55impl ::aws_types::request_id::RequestId for CreateVpcLinkOutput {
56    fn request_id(&self) -> Option<&str> {
57        self._request_id.as_deref()
58    }
59}
60impl CreateVpcLinkOutput {
61    /// Creates a new builder-style object to manufacture [`CreateVpcLinkOutput`](crate::operation::create_vpc_link::CreateVpcLinkOutput).
62    pub fn builder() -> crate::operation::create_vpc_link::builders::CreateVpcLinkOutputBuilder {
63        crate::operation::create_vpc_link::builders::CreateVpcLinkOutputBuilder::default()
64    }
65}
66
67/// A builder for [`CreateVpcLinkOutput`](crate::operation::create_vpc_link::CreateVpcLinkOutput).
68#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
69#[non_exhaustive]
70pub struct CreateVpcLinkOutputBuilder {
71    pub(crate) id: ::std::option::Option<::std::string::String>,
72    pub(crate) name: ::std::option::Option<::std::string::String>,
73    pub(crate) description: ::std::option::Option<::std::string::String>,
74    pub(crate) target_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
75    pub(crate) status: ::std::option::Option<crate::types::VpcLinkStatus>,
76    pub(crate) status_message: ::std::option::Option<::std::string::String>,
77    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
78    _request_id: Option<String>,
79}
80impl CreateVpcLinkOutputBuilder {
81    /// <p>The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.</p>
82    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83        self.id = ::std::option::Option::Some(input.into());
84        self
85    }
86    /// <p>The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.</p>
87    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88        self.id = input;
89        self
90    }
91    /// <p>The identifier of the VpcLink. It is used in an Integration to reference this VpcLink.</p>
92    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
93        &self.id
94    }
95    /// <p>The name used to label and identify the VPC link.</p>
96    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.name = ::std::option::Option::Some(input.into());
98        self
99    }
100    /// <p>The name used to label and identify the VPC link.</p>
101    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.name = input;
103        self
104    }
105    /// <p>The name used to label and identify the VPC link.</p>
106    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
107        &self.name
108    }
109    /// <p>The description of the VPC link.</p>
110    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        self.description = ::std::option::Option::Some(input.into());
112        self
113    }
114    /// <p>The description of the VPC link.</p>
115    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.description = input;
117        self
118    }
119    /// <p>The description of the VPC link.</p>
120    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
121        &self.description
122    }
123    /// Appends an item to `target_arns`.
124    ///
125    /// To override the contents of this collection use [`set_target_arns`](Self::set_target_arns).
126    ///
127    /// <p>The ARN of the network load balancer of the VPC targeted by the VPC link. The network load balancer must be owned by the same Amazon Web Services account of the API owner.</p>
128    pub fn target_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        let mut v = self.target_arns.unwrap_or_default();
130        v.push(input.into());
131        self.target_arns = ::std::option::Option::Some(v);
132        self
133    }
134    /// <p>The ARN of the network load balancer of the VPC targeted by the VPC link. The network load balancer must be owned by the same Amazon Web Services account of the API owner.</p>
135    pub fn set_target_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
136        self.target_arns = input;
137        self
138    }
139    /// <p>The ARN of the network load balancer of the VPC targeted by the VPC link. The network load balancer must be owned by the same Amazon Web Services account of the API owner.</p>
140    pub fn get_target_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
141        &self.target_arns
142    }
143    /// <p>The status of the VPC link. The valid values are <code>AVAILABLE</code>, <code>PENDING</code>, <code>DELETING</code>, or <code>FAILED</code>. Deploying an API will wait if the status is <code>PENDING</code> and will fail if the status is <code>DELETING</code>.</p>
144    pub fn status(mut self, input: crate::types::VpcLinkStatus) -> Self {
145        self.status = ::std::option::Option::Some(input);
146        self
147    }
148    /// <p>The status of the VPC link. The valid values are <code>AVAILABLE</code>, <code>PENDING</code>, <code>DELETING</code>, or <code>FAILED</code>. Deploying an API will wait if the status is <code>PENDING</code> and will fail if the status is <code>DELETING</code>.</p>
149    pub fn set_status(mut self, input: ::std::option::Option<crate::types::VpcLinkStatus>) -> Self {
150        self.status = input;
151        self
152    }
153    /// <p>The status of the VPC link. The valid values are <code>AVAILABLE</code>, <code>PENDING</code>, <code>DELETING</code>, or <code>FAILED</code>. Deploying an API will wait if the status is <code>PENDING</code> and will fail if the status is <code>DELETING</code>.</p>
154    pub fn get_status(&self) -> &::std::option::Option<crate::types::VpcLinkStatus> {
155        &self.status
156    }
157    /// <p>A description about the VPC link status.</p>
158    pub fn status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159        self.status_message = ::std::option::Option::Some(input.into());
160        self
161    }
162    /// <p>A description about the VPC link status.</p>
163    pub fn set_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.status_message = input;
165        self
166    }
167    /// <p>A description about the VPC link status.</p>
168    pub fn get_status_message(&self) -> &::std::option::Option<::std::string::String> {
169        &self.status_message
170    }
171    /// Adds a key-value pair to `tags`.
172    ///
173    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
174    ///
175    /// <p>The collection of tags. Each tag element is associated with a given resource.</p>
176    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
177        let mut hash_map = self.tags.unwrap_or_default();
178        hash_map.insert(k.into(), v.into());
179        self.tags = ::std::option::Option::Some(hash_map);
180        self
181    }
182    /// <p>The collection of tags. Each tag element is associated with a given resource.</p>
183    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
184        self.tags = input;
185        self
186    }
187    /// <p>The collection of tags. Each tag element is associated with a given resource.</p>
188    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
189        &self.tags
190    }
191    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
192        self._request_id = Some(request_id.into());
193        self
194    }
195
196    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
197        self._request_id = request_id;
198        self
199    }
200    /// Consumes the builder and constructs a [`CreateVpcLinkOutput`](crate::operation::create_vpc_link::CreateVpcLinkOutput).
201    pub fn build(self) -> crate::operation::create_vpc_link::CreateVpcLinkOutput {
202        crate::operation::create_vpc_link::CreateVpcLinkOutput {
203            id: self.id,
204            name: self.name,
205            description: self.description,
206            target_arns: self.target_arns,
207            status: self.status,
208            status_message: self.status_message,
209            tags: self.tags,
210            _request_id: self._request_id,
211        }
212    }
213}