aws_sdk_networkmanager/types/
_peering.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes a peering connection.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Peering {
7    /// <p>The ID of the core network for the peering request.</p>
8    pub core_network_id: ::std::option::Option<::std::string::String>,
9    /// <p>The ARN of a core network.</p>
10    pub core_network_arn: ::std::option::Option<::std::string::String>,
11    /// <p>The ID of the peering attachment.</p>
12    pub peering_id: ::std::option::Option<::std::string::String>,
13    /// <p>The ID of the account owner.</p>
14    pub owner_account_id: ::std::option::Option<::std::string::String>,
15    /// <p>The type of peering. This will be <code>TRANSIT_GATEWAY</code>.</p>
16    pub peering_type: ::std::option::Option<crate::types::PeeringType>,
17    /// <p>The current state of the peering connection.</p>
18    pub state: ::std::option::Option<crate::types::PeeringState>,
19    /// <p>The edge location for the peer.</p>
20    pub edge_location: ::std::option::Option<::std::string::String>,
21    /// <p>The resource ARN of the peer.</p>
22    pub resource_arn: ::std::option::Option<::std::string::String>,
23    /// <p>The list of key-value tags associated with the peering.</p>
24    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
25    /// <p>The timestamp when the attachment peer was created.</p>
26    pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
27    /// <p>Describes the error associated with the Connect peer request.</p>
28    pub last_modification_errors: ::std::option::Option<::std::vec::Vec<crate::types::PeeringError>>,
29}
30impl Peering {
31    /// <p>The ID of the core network for the peering request.</p>
32    pub fn core_network_id(&self) -> ::std::option::Option<&str> {
33        self.core_network_id.as_deref()
34    }
35    /// <p>The ARN of a core network.</p>
36    pub fn core_network_arn(&self) -> ::std::option::Option<&str> {
37        self.core_network_arn.as_deref()
38    }
39    /// <p>The ID of the peering attachment.</p>
40    pub fn peering_id(&self) -> ::std::option::Option<&str> {
41        self.peering_id.as_deref()
42    }
43    /// <p>The ID of the account owner.</p>
44    pub fn owner_account_id(&self) -> ::std::option::Option<&str> {
45        self.owner_account_id.as_deref()
46    }
47    /// <p>The type of peering. This will be <code>TRANSIT_GATEWAY</code>.</p>
48    pub fn peering_type(&self) -> ::std::option::Option<&crate::types::PeeringType> {
49        self.peering_type.as_ref()
50    }
51    /// <p>The current state of the peering connection.</p>
52    pub fn state(&self) -> ::std::option::Option<&crate::types::PeeringState> {
53        self.state.as_ref()
54    }
55    /// <p>The edge location for the peer.</p>
56    pub fn edge_location(&self) -> ::std::option::Option<&str> {
57        self.edge_location.as_deref()
58    }
59    /// <p>The resource ARN of the peer.</p>
60    pub fn resource_arn(&self) -> ::std::option::Option<&str> {
61        self.resource_arn.as_deref()
62    }
63    /// <p>The list of key-value tags associated with the peering.</p>
64    ///
65    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
66    pub fn tags(&self) -> &[crate::types::Tag] {
67        self.tags.as_deref().unwrap_or_default()
68    }
69    /// <p>The timestamp when the attachment peer was created.</p>
70    pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
71        self.created_at.as_ref()
72    }
73    /// <p>Describes the error associated with the Connect peer request.</p>
74    ///
75    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.last_modification_errors.is_none()`.
76    pub fn last_modification_errors(&self) -> &[crate::types::PeeringError] {
77        self.last_modification_errors.as_deref().unwrap_or_default()
78    }
79}
80impl Peering {
81    /// Creates a new builder-style object to manufacture [`Peering`](crate::types::Peering).
82    pub fn builder() -> crate::types::builders::PeeringBuilder {
83        crate::types::builders::PeeringBuilder::default()
84    }
85}
86
87/// A builder for [`Peering`](crate::types::Peering).
88#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
89#[non_exhaustive]
90pub struct PeeringBuilder {
91    pub(crate) core_network_id: ::std::option::Option<::std::string::String>,
92    pub(crate) core_network_arn: ::std::option::Option<::std::string::String>,
93    pub(crate) peering_id: ::std::option::Option<::std::string::String>,
94    pub(crate) owner_account_id: ::std::option::Option<::std::string::String>,
95    pub(crate) peering_type: ::std::option::Option<crate::types::PeeringType>,
96    pub(crate) state: ::std::option::Option<crate::types::PeeringState>,
97    pub(crate) edge_location: ::std::option::Option<::std::string::String>,
98    pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
99    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
100    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
101    pub(crate) last_modification_errors: ::std::option::Option<::std::vec::Vec<crate::types::PeeringError>>,
102}
103impl PeeringBuilder {
104    /// <p>The ID of the core network for the peering request.</p>
105    pub fn core_network_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106        self.core_network_id = ::std::option::Option::Some(input.into());
107        self
108    }
109    /// <p>The ID of the core network for the peering request.</p>
110    pub fn set_core_network_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111        self.core_network_id = input;
112        self
113    }
114    /// <p>The ID of the core network for the peering request.</p>
115    pub fn get_core_network_id(&self) -> &::std::option::Option<::std::string::String> {
116        &self.core_network_id
117    }
118    /// <p>The ARN of a core network.</p>
119    pub fn core_network_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.core_network_arn = ::std::option::Option::Some(input.into());
121        self
122    }
123    /// <p>The ARN of a core network.</p>
124    pub fn set_core_network_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.core_network_arn = input;
126        self
127    }
128    /// <p>The ARN of a core network.</p>
129    pub fn get_core_network_arn(&self) -> &::std::option::Option<::std::string::String> {
130        &self.core_network_arn
131    }
132    /// <p>The ID of the peering attachment.</p>
133    pub fn peering_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.peering_id = ::std::option::Option::Some(input.into());
135        self
136    }
137    /// <p>The ID of the peering attachment.</p>
138    pub fn set_peering_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.peering_id = input;
140        self
141    }
142    /// <p>The ID of the peering attachment.</p>
143    pub fn get_peering_id(&self) -> &::std::option::Option<::std::string::String> {
144        &self.peering_id
145    }
146    /// <p>The ID of the account owner.</p>
147    pub fn owner_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.owner_account_id = ::std::option::Option::Some(input.into());
149        self
150    }
151    /// <p>The ID of the account owner.</p>
152    pub fn set_owner_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.owner_account_id = input;
154        self
155    }
156    /// <p>The ID of the account owner.</p>
157    pub fn get_owner_account_id(&self) -> &::std::option::Option<::std::string::String> {
158        &self.owner_account_id
159    }
160    /// <p>The type of peering. This will be <code>TRANSIT_GATEWAY</code>.</p>
161    pub fn peering_type(mut self, input: crate::types::PeeringType) -> Self {
162        self.peering_type = ::std::option::Option::Some(input);
163        self
164    }
165    /// <p>The type of peering. This will be <code>TRANSIT_GATEWAY</code>.</p>
166    pub fn set_peering_type(mut self, input: ::std::option::Option<crate::types::PeeringType>) -> Self {
167        self.peering_type = input;
168        self
169    }
170    /// <p>The type of peering. This will be <code>TRANSIT_GATEWAY</code>.</p>
171    pub fn get_peering_type(&self) -> &::std::option::Option<crate::types::PeeringType> {
172        &self.peering_type
173    }
174    /// <p>The current state of the peering connection.</p>
175    pub fn state(mut self, input: crate::types::PeeringState) -> Self {
176        self.state = ::std::option::Option::Some(input);
177        self
178    }
179    /// <p>The current state of the peering connection.</p>
180    pub fn set_state(mut self, input: ::std::option::Option<crate::types::PeeringState>) -> Self {
181        self.state = input;
182        self
183    }
184    /// <p>The current state of the peering connection.</p>
185    pub fn get_state(&self) -> &::std::option::Option<crate::types::PeeringState> {
186        &self.state
187    }
188    /// <p>The edge location for the peer.</p>
189    pub fn edge_location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
190        self.edge_location = ::std::option::Option::Some(input.into());
191        self
192    }
193    /// <p>The edge location for the peer.</p>
194    pub fn set_edge_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
195        self.edge_location = input;
196        self
197    }
198    /// <p>The edge location for the peer.</p>
199    pub fn get_edge_location(&self) -> &::std::option::Option<::std::string::String> {
200        &self.edge_location
201    }
202    /// <p>The resource ARN of the peer.</p>
203    pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
204        self.resource_arn = ::std::option::Option::Some(input.into());
205        self
206    }
207    /// <p>The resource ARN of the peer.</p>
208    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
209        self.resource_arn = input;
210        self
211    }
212    /// <p>The resource ARN of the peer.</p>
213    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
214        &self.resource_arn
215    }
216    /// Appends an item to `tags`.
217    ///
218    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
219    ///
220    /// <p>The list of key-value tags associated with the peering.</p>
221    pub fn tags(mut self, input: crate::types::Tag) -> Self {
222        let mut v = self.tags.unwrap_or_default();
223        v.push(input);
224        self.tags = ::std::option::Option::Some(v);
225        self
226    }
227    /// <p>The list of key-value tags associated with the peering.</p>
228    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
229        self.tags = input;
230        self
231    }
232    /// <p>The list of key-value tags associated with the peering.</p>
233    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
234        &self.tags
235    }
236    /// <p>The timestamp when the attachment peer was created.</p>
237    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
238        self.created_at = ::std::option::Option::Some(input);
239        self
240    }
241    /// <p>The timestamp when the attachment peer was created.</p>
242    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
243        self.created_at = input;
244        self
245    }
246    /// <p>The timestamp when the attachment peer was created.</p>
247    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
248        &self.created_at
249    }
250    /// Appends an item to `last_modification_errors`.
251    ///
252    /// To override the contents of this collection use [`set_last_modification_errors`](Self::set_last_modification_errors).
253    ///
254    /// <p>Describes the error associated with the Connect peer request.</p>
255    pub fn last_modification_errors(mut self, input: crate::types::PeeringError) -> Self {
256        let mut v = self.last_modification_errors.unwrap_or_default();
257        v.push(input);
258        self.last_modification_errors = ::std::option::Option::Some(v);
259        self
260    }
261    /// <p>Describes the error associated with the Connect peer request.</p>
262    pub fn set_last_modification_errors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PeeringError>>) -> Self {
263        self.last_modification_errors = input;
264        self
265    }
266    /// <p>Describes the error associated with the Connect peer request.</p>
267    pub fn get_last_modification_errors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PeeringError>> {
268        &self.last_modification_errors
269    }
270    /// Consumes the builder and constructs a [`Peering`](crate::types::Peering).
271    pub fn build(self) -> crate::types::Peering {
272        crate::types::Peering {
273            core_network_id: self.core_network_id,
274            core_network_arn: self.core_network_arn,
275            peering_id: self.peering_id,
276            owner_account_id: self.owner_account_id,
277            peering_type: self.peering_type,
278            state: self.state,
279            edge_location: self.edge_location,
280            resource_arn: self.resource_arn,
281            tags: self.tags,
282            created_at: self.created_at,
283            last_modification_errors: self.last_modification_errors,
284        }
285    }
286}