google_cloud_networkconnectivity_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gaxi;
25extern crate google_cloud_gax;
26extern crate google_cloud_iam_v1;
27extern crate google_cloud_location;
28extern crate google_cloud_longrunning;
29extern crate google_cloud_lro;
30extern crate google_cloud_rpc;
31extern crate serde;
32extern crate serde_json;
33extern crate serde_with;
34extern crate std;
35extern crate tracing;
36extern crate wkt;
37
38mod debug;
39mod deserialize;
40mod serialize;
41
42/// Represents the metadata of the long-running operation.
43#[derive(Clone, Default, PartialEq)]
44#[non_exhaustive]
45pub struct OperationMetadata {
46 /// Output only. The time the operation was created.
47 pub create_time: std::option::Option<wkt::Timestamp>,
48
49 /// Output only. The time the operation finished running.
50 pub end_time: std::option::Option<wkt::Timestamp>,
51
52 /// Output only. Server-defined resource path for the target of the operation.
53 pub target: std::string::String,
54
55 /// Output only. Name of the verb executed by the operation.
56 pub verb: std::string::String,
57
58 /// Output only. Human-readable status of the operation, if any.
59 pub status_message: std::string::String,
60
61 /// Output only. Identifies whether the user has requested cancellation
62 /// of the operation. Operations that have been cancelled successfully
63 /// have
64 /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
65 /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
66 /// corresponding to `Code.CANCELLED`.
67 ///
68 /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
69 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
70 pub requested_cancellation: bool,
71
72 /// Output only. API version used to start the operation.
73 pub api_version: std::string::String,
74
75 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
76}
77
78impl OperationMetadata {
79 /// Creates a new default instance.
80 pub fn new() -> Self {
81 std::default::Default::default()
82 }
83
84 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
85 ///
86 /// # Example
87 /// ```ignore,no_run
88 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
89 /// use wkt::Timestamp;
90 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
91 /// ```
92 pub fn set_create_time<T>(mut self, v: T) -> Self
93 where
94 T: std::convert::Into<wkt::Timestamp>,
95 {
96 self.create_time = std::option::Option::Some(v.into());
97 self
98 }
99
100 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
101 ///
102 /// # Example
103 /// ```ignore,no_run
104 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
105 /// use wkt::Timestamp;
106 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
107 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
108 /// ```
109 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
110 where
111 T: std::convert::Into<wkt::Timestamp>,
112 {
113 self.create_time = v.map(|x| x.into());
114 self
115 }
116
117 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
118 ///
119 /// # Example
120 /// ```ignore,no_run
121 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
122 /// use wkt::Timestamp;
123 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
124 /// ```
125 pub fn set_end_time<T>(mut self, v: T) -> Self
126 where
127 T: std::convert::Into<wkt::Timestamp>,
128 {
129 self.end_time = std::option::Option::Some(v.into());
130 self
131 }
132
133 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
134 ///
135 /// # Example
136 /// ```ignore,no_run
137 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
138 /// use wkt::Timestamp;
139 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
140 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
141 /// ```
142 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
143 where
144 T: std::convert::Into<wkt::Timestamp>,
145 {
146 self.end_time = v.map(|x| x.into());
147 self
148 }
149
150 /// Sets the value of [target][crate::model::OperationMetadata::target].
151 ///
152 /// # Example
153 /// ```ignore,no_run
154 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
155 /// let x = OperationMetadata::new().set_target("example");
156 /// ```
157 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
158 self.target = v.into();
159 self
160 }
161
162 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
163 ///
164 /// # Example
165 /// ```ignore,no_run
166 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
167 /// let x = OperationMetadata::new().set_verb("example");
168 /// ```
169 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
170 self.verb = v.into();
171 self
172 }
173
174 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
175 ///
176 /// # Example
177 /// ```ignore,no_run
178 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
179 /// let x = OperationMetadata::new().set_status_message("example");
180 /// ```
181 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
182 self.status_message = v.into();
183 self
184 }
185
186 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
187 ///
188 /// # Example
189 /// ```ignore,no_run
190 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
191 /// let x = OperationMetadata::new().set_requested_cancellation(true);
192 /// ```
193 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
194 self.requested_cancellation = v.into();
195 self
196 }
197
198 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
199 ///
200 /// # Example
201 /// ```ignore,no_run
202 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
203 /// let x = OperationMetadata::new().set_api_version("example");
204 /// ```
205 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
206 self.api_version = v.into();
207 self
208 }
209}
210
211impl wkt::message::Message for OperationMetadata {
212 fn typename() -> &'static str {
213 "type.googleapis.com/google.cloud.networkconnectivity.v1.OperationMetadata"
214 }
215}
216
217/// The ServiceConnectionMap resource.
218#[derive(Clone, Default, PartialEq)]
219#[non_exhaustive]
220pub struct ServiceConnectionMap {
221 /// Immutable. The name of a ServiceConnectionMap.
222 /// Format:
223 /// projects/{project}/locations/{location}/serviceConnectionMaps/{service_connection_map}
224 /// See: <https://google.aip.dev/122#fields-representing-resource-names>
225 pub name: std::string::String,
226
227 /// Output only. Time when the ServiceConnectionMap was created.
228 pub create_time: std::option::Option<wkt::Timestamp>,
229
230 /// Output only. Time when the ServiceConnectionMap was updated.
231 pub update_time: std::option::Option<wkt::Timestamp>,
232
233 /// User-defined labels.
234 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
235
236 /// A description of this resource.
237 pub description: std::string::String,
238
239 /// The service class identifier this ServiceConnectionMap is for.
240 /// The user of ServiceConnectionMap create API needs to have
241 /// networkconnecitivty.serviceclasses.use iam permission for the service
242 /// class.
243 pub service_class: std::string::String,
244
245 /// Output only. The service class uri this ServiceConnectionMap is for.
246 pub service_class_uri: std::string::String,
247
248 /// Output only. The infrastructure used for connections between
249 /// consumers/producers.
250 pub infrastructure: crate::model::Infrastructure,
251
252 /// The PSC configurations on producer side.
253 pub producer_psc_configs:
254 std::vec::Vec<crate::model::service_connection_map::ProducerPscConfig>,
255
256 /// The PSC configurations on consumer side.
257 pub consumer_psc_configs:
258 std::vec::Vec<crate::model::service_connection_map::ConsumerPscConfig>,
259
260 /// Output only. PSC connection details on consumer side.
261 pub consumer_psc_connections:
262 std::vec::Vec<crate::model::service_connection_map::ConsumerPscConnection>,
263
264 /// The token provided by the consumer. This token authenticates that the
265 /// consumer can create a connection within the specified project and network.
266 pub token: std::string::String,
267
268 /// Optional. The etag is computed by the server, and may be sent on update and
269 /// delete requests to ensure the client has an up-to-date value before
270 /// proceeding.
271 pub etag: std::option::Option<std::string::String>,
272
273 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
274}
275
276impl ServiceConnectionMap {
277 /// Creates a new default instance.
278 pub fn new() -> Self {
279 std::default::Default::default()
280 }
281
282 /// Sets the value of [name][crate::model::ServiceConnectionMap::name].
283 ///
284 /// # Example
285 /// ```ignore,no_run
286 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
287 /// # let project_id = "project_id";
288 /// # let location_id = "location_id";
289 /// # let service_connection_map_id = "service_connection_map_id";
290 /// let x = ServiceConnectionMap::new().set_name(format!("projects/{project_id}/locations/{location_id}/serviceConnectionMaps/{service_connection_map_id}"));
291 /// ```
292 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
293 self.name = v.into();
294 self
295 }
296
297 /// Sets the value of [create_time][crate::model::ServiceConnectionMap::create_time].
298 ///
299 /// # Example
300 /// ```ignore,no_run
301 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
302 /// use wkt::Timestamp;
303 /// let x = ServiceConnectionMap::new().set_create_time(Timestamp::default()/* use setters */);
304 /// ```
305 pub fn set_create_time<T>(mut self, v: T) -> Self
306 where
307 T: std::convert::Into<wkt::Timestamp>,
308 {
309 self.create_time = std::option::Option::Some(v.into());
310 self
311 }
312
313 /// Sets or clears the value of [create_time][crate::model::ServiceConnectionMap::create_time].
314 ///
315 /// # Example
316 /// ```ignore,no_run
317 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
318 /// use wkt::Timestamp;
319 /// let x = ServiceConnectionMap::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
320 /// let x = ServiceConnectionMap::new().set_or_clear_create_time(None::<Timestamp>);
321 /// ```
322 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
323 where
324 T: std::convert::Into<wkt::Timestamp>,
325 {
326 self.create_time = v.map(|x| x.into());
327 self
328 }
329
330 /// Sets the value of [update_time][crate::model::ServiceConnectionMap::update_time].
331 ///
332 /// # Example
333 /// ```ignore,no_run
334 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
335 /// use wkt::Timestamp;
336 /// let x = ServiceConnectionMap::new().set_update_time(Timestamp::default()/* use setters */);
337 /// ```
338 pub fn set_update_time<T>(mut self, v: T) -> Self
339 where
340 T: std::convert::Into<wkt::Timestamp>,
341 {
342 self.update_time = std::option::Option::Some(v.into());
343 self
344 }
345
346 /// Sets or clears the value of [update_time][crate::model::ServiceConnectionMap::update_time].
347 ///
348 /// # Example
349 /// ```ignore,no_run
350 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
351 /// use wkt::Timestamp;
352 /// let x = ServiceConnectionMap::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
353 /// let x = ServiceConnectionMap::new().set_or_clear_update_time(None::<Timestamp>);
354 /// ```
355 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
356 where
357 T: std::convert::Into<wkt::Timestamp>,
358 {
359 self.update_time = v.map(|x| x.into());
360 self
361 }
362
363 /// Sets the value of [labels][crate::model::ServiceConnectionMap::labels].
364 ///
365 /// # Example
366 /// ```ignore,no_run
367 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
368 /// let x = ServiceConnectionMap::new().set_labels([
369 /// ("key0", "abc"),
370 /// ("key1", "xyz"),
371 /// ]);
372 /// ```
373 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
374 where
375 T: std::iter::IntoIterator<Item = (K, V)>,
376 K: std::convert::Into<std::string::String>,
377 V: std::convert::Into<std::string::String>,
378 {
379 use std::iter::Iterator;
380 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
381 self
382 }
383
384 /// Sets the value of [description][crate::model::ServiceConnectionMap::description].
385 ///
386 /// # Example
387 /// ```ignore,no_run
388 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
389 /// let x = ServiceConnectionMap::new().set_description("example");
390 /// ```
391 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
392 self.description = v.into();
393 self
394 }
395
396 /// Sets the value of [service_class][crate::model::ServiceConnectionMap::service_class].
397 ///
398 /// # Example
399 /// ```ignore,no_run
400 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
401 /// let x = ServiceConnectionMap::new().set_service_class("example");
402 /// ```
403 pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
404 self.service_class = v.into();
405 self
406 }
407
408 /// Sets the value of [service_class_uri][crate::model::ServiceConnectionMap::service_class_uri].
409 ///
410 /// # Example
411 /// ```ignore,no_run
412 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
413 /// let x = ServiceConnectionMap::new().set_service_class_uri("example");
414 /// ```
415 pub fn set_service_class_uri<T: std::convert::Into<std::string::String>>(
416 mut self,
417 v: T,
418 ) -> Self {
419 self.service_class_uri = v.into();
420 self
421 }
422
423 /// Sets the value of [infrastructure][crate::model::ServiceConnectionMap::infrastructure].
424 ///
425 /// # Example
426 /// ```ignore,no_run
427 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
428 /// use google_cloud_networkconnectivity_v1::model::Infrastructure;
429 /// let x0 = ServiceConnectionMap::new().set_infrastructure(Infrastructure::Psc);
430 /// ```
431 pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
432 mut self,
433 v: T,
434 ) -> Self {
435 self.infrastructure = v.into();
436 self
437 }
438
439 /// Sets the value of [producer_psc_configs][crate::model::ServiceConnectionMap::producer_psc_configs].
440 ///
441 /// # Example
442 /// ```ignore,no_run
443 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
444 /// use google_cloud_networkconnectivity_v1::model::service_connection_map::ProducerPscConfig;
445 /// let x = ServiceConnectionMap::new()
446 /// .set_producer_psc_configs([
447 /// ProducerPscConfig::default()/* use setters */,
448 /// ProducerPscConfig::default()/* use (different) setters */,
449 /// ]);
450 /// ```
451 pub fn set_producer_psc_configs<T, V>(mut self, v: T) -> Self
452 where
453 T: std::iter::IntoIterator<Item = V>,
454 V: std::convert::Into<crate::model::service_connection_map::ProducerPscConfig>,
455 {
456 use std::iter::Iterator;
457 self.producer_psc_configs = v.into_iter().map(|i| i.into()).collect();
458 self
459 }
460
461 /// Sets the value of [consumer_psc_configs][crate::model::ServiceConnectionMap::consumer_psc_configs].
462 ///
463 /// # Example
464 /// ```ignore,no_run
465 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
466 /// use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
467 /// let x = ServiceConnectionMap::new()
468 /// .set_consumer_psc_configs([
469 /// ConsumerPscConfig::default()/* use setters */,
470 /// ConsumerPscConfig::default()/* use (different) setters */,
471 /// ]);
472 /// ```
473 pub fn set_consumer_psc_configs<T, V>(mut self, v: T) -> Self
474 where
475 T: std::iter::IntoIterator<Item = V>,
476 V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConfig>,
477 {
478 use std::iter::Iterator;
479 self.consumer_psc_configs = v.into_iter().map(|i| i.into()).collect();
480 self
481 }
482
483 /// Sets the value of [consumer_psc_connections][crate::model::ServiceConnectionMap::consumer_psc_connections].
484 ///
485 /// # Example
486 /// ```ignore,no_run
487 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
488 /// use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
489 /// let x = ServiceConnectionMap::new()
490 /// .set_consumer_psc_connections([
491 /// ConsumerPscConnection::default()/* use setters */,
492 /// ConsumerPscConnection::default()/* use (different) setters */,
493 /// ]);
494 /// ```
495 pub fn set_consumer_psc_connections<T, V>(mut self, v: T) -> Self
496 where
497 T: std::iter::IntoIterator<Item = V>,
498 V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConnection>,
499 {
500 use std::iter::Iterator;
501 self.consumer_psc_connections = v.into_iter().map(|i| i.into()).collect();
502 self
503 }
504
505 /// Sets the value of [token][crate::model::ServiceConnectionMap::token].
506 ///
507 /// # Example
508 /// ```ignore,no_run
509 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
510 /// let x = ServiceConnectionMap::new().set_token("example");
511 /// ```
512 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
513 self.token = v.into();
514 self
515 }
516
517 /// Sets the value of [etag][crate::model::ServiceConnectionMap::etag].
518 ///
519 /// # Example
520 /// ```ignore,no_run
521 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
522 /// let x = ServiceConnectionMap::new().set_etag("example");
523 /// ```
524 pub fn set_etag<T>(mut self, v: T) -> Self
525 where
526 T: std::convert::Into<std::string::String>,
527 {
528 self.etag = std::option::Option::Some(v.into());
529 self
530 }
531
532 /// Sets or clears the value of [etag][crate::model::ServiceConnectionMap::etag].
533 ///
534 /// # Example
535 /// ```ignore,no_run
536 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
537 /// let x = ServiceConnectionMap::new().set_or_clear_etag(Some("example"));
538 /// let x = ServiceConnectionMap::new().set_or_clear_etag(None::<String>);
539 /// ```
540 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
541 where
542 T: std::convert::Into<std::string::String>,
543 {
544 self.etag = v.map(|x| x.into());
545 self
546 }
547}
548
549impl wkt::message::Message for ServiceConnectionMap {
550 fn typename() -> &'static str {
551 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap"
552 }
553}
554
555/// Defines additional types related to [ServiceConnectionMap].
556pub mod service_connection_map {
557 #[allow(unused_imports)]
558 use super::*;
559
560 /// The PSC configurations on producer side.
561 #[derive(Clone, Default, PartialEq)]
562 #[non_exhaustive]
563 pub struct ProducerPscConfig {
564 /// The resource path of a service attachment.
565 /// Example:
566 /// projects/{projectNumOrId}/regions/{region}/serviceAttachments/{resourceId}.
567 pub service_attachment_uri: std::string::String,
568
569 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
570 }
571
572 impl ProducerPscConfig {
573 /// Creates a new default instance.
574 pub fn new() -> Self {
575 std::default::Default::default()
576 }
577
578 /// Sets the value of [service_attachment_uri][crate::model::service_connection_map::ProducerPscConfig::service_attachment_uri].
579 ///
580 /// # Example
581 /// ```ignore,no_run
582 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ProducerPscConfig;
583 /// let x = ProducerPscConfig::new().set_service_attachment_uri("example");
584 /// ```
585 pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
586 mut self,
587 v: T,
588 ) -> Self {
589 self.service_attachment_uri = v.into();
590 self
591 }
592 }
593
594 impl wkt::message::Message for ProducerPscConfig {
595 fn typename() -> &'static str {
596 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ProducerPscConfig"
597 }
598 }
599
600 /// Allow the producer to specify which consumers can connect to it.
601 #[derive(Clone, Default, PartialEq)]
602 #[non_exhaustive]
603 pub struct ConsumerPscConfig {
604 /// The consumer project where PSC connections are allowed to be created in.
605 pub project: std::string::String,
606
607 /// The resource path of the consumer network where PSC connections are
608 /// allowed to be created in. Note, this network does not need be in the
609 /// ConsumerPscConfig.project in the case of SharedVPC.
610 /// Example:
611 /// projects/{projectNumOrId}/global/networks/{networkId}.
612 pub network: std::string::String,
613
614 /// This is used in PSC consumer ForwardingRule to control whether the PSC
615 /// endpoint can be accessed from another region.
616 pub disable_global_access: bool,
617
618 /// Output only. Overall state of PSC Connections management for this
619 /// consumer psc config.
620 pub state: crate::model::service_connection_map::consumer_psc_config::State,
621
622 /// Immutable. Deprecated. Use producer_instance_metadata instead.
623 /// An immutable identifier for the producer instance.
624 #[deprecated]
625 pub producer_instance_id: std::string::String,
626
627 /// Output only. A map to store mapping between customer vip and target
628 /// service attachment. Only service attachment with producer specified ip
629 /// addresses are stored here.
630 pub service_attachment_ip_address_map:
631 std::collections::HashMap<std::string::String, std::string::String>,
632
633 /// Required. The project ID or project number of the consumer project. This
634 /// project is the one that the consumer uses to interact with the producer
635 /// instance. From the perspective of a consumer who's created a producer
636 /// instance, this is the project of the producer instance. Format:
637 /// 'projects/<project_id_or_number>' Eg. 'projects/consumer-project' or
638 /// 'projects/1234'
639 pub consumer_instance_project: std::string::String,
640
641 /// Immutable. An immutable map for the producer instance metadata.
642 pub producer_instance_metadata:
643 std::collections::HashMap<std::string::String, std::string::String>,
644
645 /// The requested IP version for the PSC connection.
646 pub ip_version: std::option::Option<crate::model::IPVersion>,
647
648 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
649 }
650
651 impl ConsumerPscConfig {
652 /// Creates a new default instance.
653 pub fn new() -> Self {
654 std::default::Default::default()
655 }
656
657 /// Sets the value of [project][crate::model::service_connection_map::ConsumerPscConfig::project].
658 ///
659 /// # Example
660 /// ```ignore,no_run
661 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
662 /// let x = ConsumerPscConfig::new().set_project("example");
663 /// ```
664 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
665 self.project = v.into();
666 self
667 }
668
669 /// Sets the value of [network][crate::model::service_connection_map::ConsumerPscConfig::network].
670 ///
671 /// # Example
672 /// ```ignore,no_run
673 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
674 /// let x = ConsumerPscConfig::new().set_network("example");
675 /// ```
676 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
677 self.network = v.into();
678 self
679 }
680
681 /// Sets the value of [disable_global_access][crate::model::service_connection_map::ConsumerPscConfig::disable_global_access].
682 ///
683 /// # Example
684 /// ```ignore,no_run
685 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
686 /// let x = ConsumerPscConfig::new().set_disable_global_access(true);
687 /// ```
688 pub fn set_disable_global_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
689 self.disable_global_access = v.into();
690 self
691 }
692
693 /// Sets the value of [state][crate::model::service_connection_map::ConsumerPscConfig::state].
694 ///
695 /// # Example
696 /// ```ignore,no_run
697 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
698 /// use google_cloud_networkconnectivity_v1::model::service_connection_map::consumer_psc_config::State;
699 /// let x0 = ConsumerPscConfig::new().set_state(State::Valid);
700 /// let x1 = ConsumerPscConfig::new().set_state(State::ConnectionPolicyMissing);
701 /// let x2 = ConsumerPscConfig::new().set_state(State::PolicyLimitReached);
702 /// ```
703 pub fn set_state<
704 T: std::convert::Into<crate::model::service_connection_map::consumer_psc_config::State>,
705 >(
706 mut self,
707 v: T,
708 ) -> Self {
709 self.state = v.into();
710 self
711 }
712
713 /// Sets the value of [producer_instance_id][crate::model::service_connection_map::ConsumerPscConfig::producer_instance_id].
714 ///
715 /// # Example
716 /// ```ignore,no_run
717 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
718 /// let x = ConsumerPscConfig::new().set_producer_instance_id("example");
719 /// ```
720 #[deprecated]
721 pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
722 mut self,
723 v: T,
724 ) -> Self {
725 self.producer_instance_id = v.into();
726 self
727 }
728
729 /// Sets the value of [service_attachment_ip_address_map][crate::model::service_connection_map::ConsumerPscConfig::service_attachment_ip_address_map].
730 ///
731 /// # Example
732 /// ```ignore,no_run
733 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
734 /// let x = ConsumerPscConfig::new().set_service_attachment_ip_address_map([
735 /// ("key0", "abc"),
736 /// ("key1", "xyz"),
737 /// ]);
738 /// ```
739 pub fn set_service_attachment_ip_address_map<T, K, V>(mut self, v: T) -> Self
740 where
741 T: std::iter::IntoIterator<Item = (K, V)>,
742 K: std::convert::Into<std::string::String>,
743 V: std::convert::Into<std::string::String>,
744 {
745 use std::iter::Iterator;
746 self.service_attachment_ip_address_map =
747 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
748 self
749 }
750
751 /// Sets the value of [consumer_instance_project][crate::model::service_connection_map::ConsumerPscConfig::consumer_instance_project].
752 ///
753 /// # Example
754 /// ```ignore,no_run
755 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
756 /// let x = ConsumerPscConfig::new().set_consumer_instance_project("example");
757 /// ```
758 pub fn set_consumer_instance_project<T: std::convert::Into<std::string::String>>(
759 mut self,
760 v: T,
761 ) -> Self {
762 self.consumer_instance_project = v.into();
763 self
764 }
765
766 /// Sets the value of [producer_instance_metadata][crate::model::service_connection_map::ConsumerPscConfig::producer_instance_metadata].
767 ///
768 /// # Example
769 /// ```ignore,no_run
770 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
771 /// let x = ConsumerPscConfig::new().set_producer_instance_metadata([
772 /// ("key0", "abc"),
773 /// ("key1", "xyz"),
774 /// ]);
775 /// ```
776 pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
777 where
778 T: std::iter::IntoIterator<Item = (K, V)>,
779 K: std::convert::Into<std::string::String>,
780 V: std::convert::Into<std::string::String>,
781 {
782 use std::iter::Iterator;
783 self.producer_instance_metadata =
784 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
785 self
786 }
787
788 /// Sets the value of [ip_version][crate::model::service_connection_map::ConsumerPscConfig::ip_version].
789 ///
790 /// # Example
791 /// ```ignore,no_run
792 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
793 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
794 /// let x0 = ConsumerPscConfig::new().set_ip_version(IPVersion::Ipv4);
795 /// let x1 = ConsumerPscConfig::new().set_ip_version(IPVersion::Ipv6);
796 /// ```
797 pub fn set_ip_version<T>(mut self, v: T) -> Self
798 where
799 T: std::convert::Into<crate::model::IPVersion>,
800 {
801 self.ip_version = std::option::Option::Some(v.into());
802 self
803 }
804
805 /// Sets or clears the value of [ip_version][crate::model::service_connection_map::ConsumerPscConfig::ip_version].
806 ///
807 /// # Example
808 /// ```ignore,no_run
809 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
810 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
811 /// let x0 = ConsumerPscConfig::new().set_or_clear_ip_version(Some(IPVersion::Ipv4));
812 /// let x1 = ConsumerPscConfig::new().set_or_clear_ip_version(Some(IPVersion::Ipv6));
813 /// let x_none = ConsumerPscConfig::new().set_or_clear_ip_version(None::<IPVersion>);
814 /// ```
815 pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
816 where
817 T: std::convert::Into<crate::model::IPVersion>,
818 {
819 self.ip_version = v.map(|x| x.into());
820 self
821 }
822 }
823
824 impl wkt::message::Message for ConsumerPscConfig {
825 fn typename() -> &'static str {
826 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig"
827 }
828 }
829
830 /// Defines additional types related to [ConsumerPscConfig].
831 pub mod consumer_psc_config {
832 #[allow(unused_imports)]
833 use super::*;
834
835 /// PSC Consumer Config State.
836 ///
837 /// # Working with unknown values
838 ///
839 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
840 /// additional enum variants at any time. Adding new variants is not considered
841 /// a breaking change. Applications should write their code in anticipation of:
842 ///
843 /// - New values appearing in future releases of the client library, **and**
844 /// - New values received dynamically, without application changes.
845 ///
846 /// Please consult the [Working with enums] section in the user guide for some
847 /// guidelines.
848 ///
849 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
850 #[derive(Clone, Debug, PartialEq)]
851 #[non_exhaustive]
852 pub enum State {
853 /// Default state, when Connection Map is created initially.
854 Unspecified,
855 /// Set when policy and map configuration is valid,
856 /// and their matching can lead to allowing creation of PSC Connections
857 /// subject to other constraints like connections limit.
858 Valid,
859 /// No Service Connection Policy found for this network and Service
860 /// Class
861 ConnectionPolicyMissing,
862 /// Service Connection Policy limit reached for this network and Service
863 /// Class
864 PolicyLimitReached,
865 /// The consumer instance project is not in
866 /// AllowedGoogleProducersResourceHierarchyLevels of the matching
867 /// ServiceConnectionPolicy.
868 ConsumerInstanceProjectNotAllowlisted,
869 /// If set, the enum was initialized with an unknown value.
870 ///
871 /// Applications can examine the value using [State::value] or
872 /// [State::name].
873 UnknownValue(state::UnknownValue),
874 }
875
876 #[doc(hidden)]
877 pub mod state {
878 #[allow(unused_imports)]
879 use super::*;
880 #[derive(Clone, Debug, PartialEq)]
881 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
882 }
883
884 impl State {
885 /// Gets the enum value.
886 ///
887 /// Returns `None` if the enum contains an unknown value deserialized from
888 /// the string representation of enums.
889 pub fn value(&self) -> std::option::Option<i32> {
890 match self {
891 Self::Unspecified => std::option::Option::Some(0),
892 Self::Valid => std::option::Option::Some(1),
893 Self::ConnectionPolicyMissing => std::option::Option::Some(2),
894 Self::PolicyLimitReached => std::option::Option::Some(3),
895 Self::ConsumerInstanceProjectNotAllowlisted => std::option::Option::Some(4),
896 Self::UnknownValue(u) => u.0.value(),
897 }
898 }
899
900 /// Gets the enum value as a string.
901 ///
902 /// Returns `None` if the enum contains an unknown value deserialized from
903 /// the integer representation of enums.
904 pub fn name(&self) -> std::option::Option<&str> {
905 match self {
906 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
907 Self::Valid => std::option::Option::Some("VALID"),
908 Self::ConnectionPolicyMissing => {
909 std::option::Option::Some("CONNECTION_POLICY_MISSING")
910 }
911 Self::PolicyLimitReached => std::option::Option::Some("POLICY_LIMIT_REACHED"),
912 Self::ConsumerInstanceProjectNotAllowlisted => {
913 std::option::Option::Some("CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED")
914 }
915 Self::UnknownValue(u) => u.0.name(),
916 }
917 }
918 }
919
920 impl std::default::Default for State {
921 fn default() -> Self {
922 use std::convert::From;
923 Self::from(0)
924 }
925 }
926
927 impl std::fmt::Display for State {
928 fn fmt(
929 &self,
930 f: &mut std::fmt::Formatter<'_>,
931 ) -> std::result::Result<(), std::fmt::Error> {
932 wkt::internal::display_enum(f, self.name(), self.value())
933 }
934 }
935
936 impl std::convert::From<i32> for State {
937 fn from(value: i32) -> Self {
938 match value {
939 0 => Self::Unspecified,
940 1 => Self::Valid,
941 2 => Self::ConnectionPolicyMissing,
942 3 => Self::PolicyLimitReached,
943 4 => Self::ConsumerInstanceProjectNotAllowlisted,
944 _ => Self::UnknownValue(state::UnknownValue(
945 wkt::internal::UnknownEnumValue::Integer(value),
946 )),
947 }
948 }
949 }
950
951 impl std::convert::From<&str> for State {
952 fn from(value: &str) -> Self {
953 use std::string::ToString;
954 match value {
955 "STATE_UNSPECIFIED" => Self::Unspecified,
956 "VALID" => Self::Valid,
957 "CONNECTION_POLICY_MISSING" => Self::ConnectionPolicyMissing,
958 "POLICY_LIMIT_REACHED" => Self::PolicyLimitReached,
959 "CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED" => {
960 Self::ConsumerInstanceProjectNotAllowlisted
961 }
962 _ => Self::UnknownValue(state::UnknownValue(
963 wkt::internal::UnknownEnumValue::String(value.to_string()),
964 )),
965 }
966 }
967 }
968
969 impl serde::ser::Serialize for State {
970 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
971 where
972 S: serde::Serializer,
973 {
974 match self {
975 Self::Unspecified => serializer.serialize_i32(0),
976 Self::Valid => serializer.serialize_i32(1),
977 Self::ConnectionPolicyMissing => serializer.serialize_i32(2),
978 Self::PolicyLimitReached => serializer.serialize_i32(3),
979 Self::ConsumerInstanceProjectNotAllowlisted => serializer.serialize_i32(4),
980 Self::UnknownValue(u) => u.0.serialize(serializer),
981 }
982 }
983 }
984
985 impl<'de> serde::de::Deserialize<'de> for State {
986 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
987 where
988 D: serde::Deserializer<'de>,
989 {
990 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
991 ".google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig.State"))
992 }
993 }
994 }
995
996 /// PSC connection details on consumer side.
997 #[derive(Clone, Default, PartialEq)]
998 #[non_exhaustive]
999 pub struct ConsumerPscConnection {
1000 /// The URI of a service attachment which is the target of the PSC
1001 /// connection.
1002 pub service_attachment_uri: std::string::String,
1003
1004 /// The state of the PSC connection.
1005 pub state: crate::model::service_connection_map::consumer_psc_connection::State,
1006
1007 /// The consumer project whose PSC forwarding rule is connected to the
1008 /// service attachments in this service connection map.
1009 pub project: std::string::String,
1010
1011 /// The consumer network whose PSC forwarding rule is connected to the
1012 /// service attachments in this service connection map.
1013 /// Note that the network could be on a different project (shared VPC).
1014 pub network: std::string::String,
1015
1016 /// The PSC connection id of the PSC forwarding rule connected
1017 /// to the service attachments in this service connection map.
1018 pub psc_connection_id: std::string::String,
1019
1020 /// The IP literal allocated on the consumer network for the PSC forwarding
1021 /// rule that is created to connect to the producer service attachment in
1022 /// this service connection map.
1023 pub ip: std::string::String,
1024
1025 /// The error type indicates whether the error is consumer facing, producer
1026 /// facing or system internal.
1027 #[deprecated]
1028 pub error_type: crate::model::ConnectionErrorType,
1029
1030 /// The most recent error during operating this connection.
1031 #[deprecated]
1032 pub error: std::option::Option<google_cloud_rpc::model::Status>,
1033
1034 /// The last Compute Engine operation to setup PSC connection.
1035 pub gce_operation: std::string::String,
1036
1037 /// The URI of the consumer forwarding rule created.
1038 /// Example:
1039 /// projects/{projectNumOrId}/regions/us-east1/networks/{resourceId}.
1040 pub forwarding_rule: std::string::String,
1041
1042 /// Output only. The error info for the latest error during operating this
1043 /// connection.
1044 pub error_info: std::option::Option<google_cloud_rpc::model::ErrorInfo>,
1045
1046 /// Output only. The URI of the selected subnetwork selected to allocate IP
1047 /// address for this connection.
1048 pub selected_subnetwork: std::string::String,
1049
1050 /// Immutable. Deprecated. Use producer_instance_metadata instead.
1051 /// An immutable identifier for the producer instance.
1052 #[deprecated]
1053 pub producer_instance_id: std::string::String,
1054
1055 /// Immutable. An immutable map for the producer instance metadata.
1056 pub producer_instance_metadata:
1057 std::collections::HashMap<std::string::String, std::string::String>,
1058
1059 /// The requested IP version for the PSC connection.
1060 pub ip_version: std::option::Option<crate::model::IPVersion>,
1061
1062 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1063 }
1064
1065 impl ConsumerPscConnection {
1066 /// Creates a new default instance.
1067 pub fn new() -> Self {
1068 std::default::Default::default()
1069 }
1070
1071 /// Sets the value of [service_attachment_uri][crate::model::service_connection_map::ConsumerPscConnection::service_attachment_uri].
1072 ///
1073 /// # Example
1074 /// ```ignore,no_run
1075 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1076 /// let x = ConsumerPscConnection::new().set_service_attachment_uri("example");
1077 /// ```
1078 pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
1079 mut self,
1080 v: T,
1081 ) -> Self {
1082 self.service_attachment_uri = v.into();
1083 self
1084 }
1085
1086 /// Sets the value of [state][crate::model::service_connection_map::ConsumerPscConnection::state].
1087 ///
1088 /// # Example
1089 /// ```ignore,no_run
1090 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1091 /// use google_cloud_networkconnectivity_v1::model::service_connection_map::consumer_psc_connection::State;
1092 /// let x0 = ConsumerPscConnection::new().set_state(State::Active);
1093 /// let x1 = ConsumerPscConnection::new().set_state(State::Failed);
1094 /// let x2 = ConsumerPscConnection::new().set_state(State::Creating);
1095 /// ```
1096 pub fn set_state<
1097 T: std::convert::Into<
1098 crate::model::service_connection_map::consumer_psc_connection::State,
1099 >,
1100 >(
1101 mut self,
1102 v: T,
1103 ) -> Self {
1104 self.state = v.into();
1105 self
1106 }
1107
1108 /// Sets the value of [project][crate::model::service_connection_map::ConsumerPscConnection::project].
1109 ///
1110 /// # Example
1111 /// ```ignore,no_run
1112 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1113 /// let x = ConsumerPscConnection::new().set_project("example");
1114 /// ```
1115 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1116 self.project = v.into();
1117 self
1118 }
1119
1120 /// Sets the value of [network][crate::model::service_connection_map::ConsumerPscConnection::network].
1121 ///
1122 /// # Example
1123 /// ```ignore,no_run
1124 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1125 /// let x = ConsumerPscConnection::new().set_network("example");
1126 /// ```
1127 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1128 self.network = v.into();
1129 self
1130 }
1131
1132 /// Sets the value of [psc_connection_id][crate::model::service_connection_map::ConsumerPscConnection::psc_connection_id].
1133 ///
1134 /// # Example
1135 /// ```ignore,no_run
1136 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1137 /// let x = ConsumerPscConnection::new().set_psc_connection_id("example");
1138 /// ```
1139 pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
1140 mut self,
1141 v: T,
1142 ) -> Self {
1143 self.psc_connection_id = v.into();
1144 self
1145 }
1146
1147 /// Sets the value of [ip][crate::model::service_connection_map::ConsumerPscConnection::ip].
1148 ///
1149 /// # Example
1150 /// ```ignore,no_run
1151 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1152 /// let x = ConsumerPscConnection::new().set_ip("example");
1153 /// ```
1154 pub fn set_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1155 self.ip = v.into();
1156 self
1157 }
1158
1159 /// Sets the value of [error_type][crate::model::service_connection_map::ConsumerPscConnection::error_type].
1160 ///
1161 /// # Example
1162 /// ```ignore,no_run
1163 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1164 /// use google_cloud_networkconnectivity_v1::model::ConnectionErrorType;
1165 /// let x0 = ConsumerPscConnection::new().set_error_type(ConnectionErrorType::ErrorInternal);
1166 /// let x1 = ConsumerPscConnection::new().set_error_type(ConnectionErrorType::ErrorConsumerSide);
1167 /// let x2 = ConsumerPscConnection::new().set_error_type(ConnectionErrorType::ErrorProducerSide);
1168 /// ```
1169 #[deprecated]
1170 pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
1171 mut self,
1172 v: T,
1173 ) -> Self {
1174 self.error_type = v.into();
1175 self
1176 }
1177
1178 /// Sets the value of [error][crate::model::service_connection_map::ConsumerPscConnection::error].
1179 ///
1180 /// # Example
1181 /// ```ignore,no_run
1182 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1183 /// use google_cloud_rpc::model::Status;
1184 /// let x = ConsumerPscConnection::new().set_error(Status::default()/* use setters */);
1185 /// ```
1186 #[deprecated]
1187 pub fn set_error<T>(mut self, v: T) -> Self
1188 where
1189 T: std::convert::Into<google_cloud_rpc::model::Status>,
1190 {
1191 self.error = std::option::Option::Some(v.into());
1192 self
1193 }
1194
1195 /// Sets or clears the value of [error][crate::model::service_connection_map::ConsumerPscConnection::error].
1196 ///
1197 /// # Example
1198 /// ```ignore,no_run
1199 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1200 /// use google_cloud_rpc::model::Status;
1201 /// let x = ConsumerPscConnection::new().set_or_clear_error(Some(Status::default()/* use setters */));
1202 /// let x = ConsumerPscConnection::new().set_or_clear_error(None::<Status>);
1203 /// ```
1204 #[deprecated]
1205 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1206 where
1207 T: std::convert::Into<google_cloud_rpc::model::Status>,
1208 {
1209 self.error = v.map(|x| x.into());
1210 self
1211 }
1212
1213 /// Sets the value of [gce_operation][crate::model::service_connection_map::ConsumerPscConnection::gce_operation].
1214 ///
1215 /// # Example
1216 /// ```ignore,no_run
1217 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1218 /// let x = ConsumerPscConnection::new().set_gce_operation("example");
1219 /// ```
1220 pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
1221 mut self,
1222 v: T,
1223 ) -> Self {
1224 self.gce_operation = v.into();
1225 self
1226 }
1227
1228 /// Sets the value of [forwarding_rule][crate::model::service_connection_map::ConsumerPscConnection::forwarding_rule].
1229 ///
1230 /// # Example
1231 /// ```ignore,no_run
1232 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1233 /// let x = ConsumerPscConnection::new().set_forwarding_rule("example");
1234 /// ```
1235 pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(
1236 mut self,
1237 v: T,
1238 ) -> Self {
1239 self.forwarding_rule = v.into();
1240 self
1241 }
1242
1243 /// Sets the value of [error_info][crate::model::service_connection_map::ConsumerPscConnection::error_info].
1244 ///
1245 /// # Example
1246 /// ```ignore,no_run
1247 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1248 /// use google_cloud_rpc::model::ErrorInfo;
1249 /// let x = ConsumerPscConnection::new().set_error_info(ErrorInfo::default()/* use setters */);
1250 /// ```
1251 pub fn set_error_info<T>(mut self, v: T) -> Self
1252 where
1253 T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
1254 {
1255 self.error_info = std::option::Option::Some(v.into());
1256 self
1257 }
1258
1259 /// Sets or clears the value of [error_info][crate::model::service_connection_map::ConsumerPscConnection::error_info].
1260 ///
1261 /// # Example
1262 /// ```ignore,no_run
1263 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1264 /// use google_cloud_rpc::model::ErrorInfo;
1265 /// let x = ConsumerPscConnection::new().set_or_clear_error_info(Some(ErrorInfo::default()/* use setters */));
1266 /// let x = ConsumerPscConnection::new().set_or_clear_error_info(None::<ErrorInfo>);
1267 /// ```
1268 pub fn set_or_clear_error_info<T>(mut self, v: std::option::Option<T>) -> Self
1269 where
1270 T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
1271 {
1272 self.error_info = v.map(|x| x.into());
1273 self
1274 }
1275
1276 /// Sets the value of [selected_subnetwork][crate::model::service_connection_map::ConsumerPscConnection::selected_subnetwork].
1277 ///
1278 /// # Example
1279 /// ```ignore,no_run
1280 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1281 /// let x = ConsumerPscConnection::new().set_selected_subnetwork("example");
1282 /// ```
1283 pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
1284 mut self,
1285 v: T,
1286 ) -> Self {
1287 self.selected_subnetwork = v.into();
1288 self
1289 }
1290
1291 /// Sets the value of [producer_instance_id][crate::model::service_connection_map::ConsumerPscConnection::producer_instance_id].
1292 ///
1293 /// # Example
1294 /// ```ignore,no_run
1295 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1296 /// let x = ConsumerPscConnection::new().set_producer_instance_id("example");
1297 /// ```
1298 #[deprecated]
1299 pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
1300 mut self,
1301 v: T,
1302 ) -> Self {
1303 self.producer_instance_id = v.into();
1304 self
1305 }
1306
1307 /// Sets the value of [producer_instance_metadata][crate::model::service_connection_map::ConsumerPscConnection::producer_instance_metadata].
1308 ///
1309 /// # Example
1310 /// ```ignore,no_run
1311 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1312 /// let x = ConsumerPscConnection::new().set_producer_instance_metadata([
1313 /// ("key0", "abc"),
1314 /// ("key1", "xyz"),
1315 /// ]);
1316 /// ```
1317 pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
1318 where
1319 T: std::iter::IntoIterator<Item = (K, V)>,
1320 K: std::convert::Into<std::string::String>,
1321 V: std::convert::Into<std::string::String>,
1322 {
1323 use std::iter::Iterator;
1324 self.producer_instance_metadata =
1325 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1326 self
1327 }
1328
1329 /// Sets the value of [ip_version][crate::model::service_connection_map::ConsumerPscConnection::ip_version].
1330 ///
1331 /// # Example
1332 /// ```ignore,no_run
1333 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1334 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
1335 /// let x0 = ConsumerPscConnection::new().set_ip_version(IPVersion::Ipv4);
1336 /// let x1 = ConsumerPscConnection::new().set_ip_version(IPVersion::Ipv6);
1337 /// ```
1338 pub fn set_ip_version<T>(mut self, v: T) -> Self
1339 where
1340 T: std::convert::Into<crate::model::IPVersion>,
1341 {
1342 self.ip_version = std::option::Option::Some(v.into());
1343 self
1344 }
1345
1346 /// Sets or clears the value of [ip_version][crate::model::service_connection_map::ConsumerPscConnection::ip_version].
1347 ///
1348 /// # Example
1349 /// ```ignore,no_run
1350 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1351 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
1352 /// let x0 = ConsumerPscConnection::new().set_or_clear_ip_version(Some(IPVersion::Ipv4));
1353 /// let x1 = ConsumerPscConnection::new().set_or_clear_ip_version(Some(IPVersion::Ipv6));
1354 /// let x_none = ConsumerPscConnection::new().set_or_clear_ip_version(None::<IPVersion>);
1355 /// ```
1356 pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
1357 where
1358 T: std::convert::Into<crate::model::IPVersion>,
1359 {
1360 self.ip_version = v.map(|x| x.into());
1361 self
1362 }
1363 }
1364
1365 impl wkt::message::Message for ConsumerPscConnection {
1366 fn typename() -> &'static str {
1367 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection"
1368 }
1369 }
1370
1371 /// Defines additional types related to [ConsumerPscConnection].
1372 pub mod consumer_psc_connection {
1373 #[allow(unused_imports)]
1374 use super::*;
1375
1376 /// The state of the PSC connection.
1377 /// We reserve the right to add more states without notice in the future.
1378 /// Users should not use exhaustive switch statements on this enum.
1379 /// See <https://google.aip.dev/216>.
1380 ///
1381 /// # Working with unknown values
1382 ///
1383 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1384 /// additional enum variants at any time. Adding new variants is not considered
1385 /// a breaking change. Applications should write their code in anticipation of:
1386 ///
1387 /// - New values appearing in future releases of the client library, **and**
1388 /// - New values received dynamically, without application changes.
1389 ///
1390 /// Please consult the [Working with enums] section in the user guide for some
1391 /// guidelines.
1392 ///
1393 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1394 #[derive(Clone, Debug, PartialEq)]
1395 #[non_exhaustive]
1396 pub enum State {
1397 /// An invalid state as the default case.
1398 Unspecified,
1399 /// The connection has been created successfully. However, for the
1400 /// up-to-date connection status, please use the service attachment's
1401 /// "ConnectedEndpoint.status" as the source of truth.
1402 Active,
1403 /// The connection is not functional since some resources on the connection
1404 /// fail to be created.
1405 Failed,
1406 /// The connection is being created.
1407 Creating,
1408 /// The connection is being deleted.
1409 Deleting,
1410 /// The connection is being repaired to complete creation.
1411 CreateRepairing,
1412 /// The connection is being repaired to complete deletion.
1413 DeleteRepairing,
1414 /// If set, the enum was initialized with an unknown value.
1415 ///
1416 /// Applications can examine the value using [State::value] or
1417 /// [State::name].
1418 UnknownValue(state::UnknownValue),
1419 }
1420
1421 #[doc(hidden)]
1422 pub mod state {
1423 #[allow(unused_imports)]
1424 use super::*;
1425 #[derive(Clone, Debug, PartialEq)]
1426 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1427 }
1428
1429 impl State {
1430 /// Gets the enum value.
1431 ///
1432 /// Returns `None` if the enum contains an unknown value deserialized from
1433 /// the string representation of enums.
1434 pub fn value(&self) -> std::option::Option<i32> {
1435 match self {
1436 Self::Unspecified => std::option::Option::Some(0),
1437 Self::Active => std::option::Option::Some(1),
1438 Self::Failed => std::option::Option::Some(2),
1439 Self::Creating => std::option::Option::Some(3),
1440 Self::Deleting => std::option::Option::Some(4),
1441 Self::CreateRepairing => std::option::Option::Some(5),
1442 Self::DeleteRepairing => std::option::Option::Some(6),
1443 Self::UnknownValue(u) => u.0.value(),
1444 }
1445 }
1446
1447 /// Gets the enum value as a string.
1448 ///
1449 /// Returns `None` if the enum contains an unknown value deserialized from
1450 /// the integer representation of enums.
1451 pub fn name(&self) -> std::option::Option<&str> {
1452 match self {
1453 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1454 Self::Active => std::option::Option::Some("ACTIVE"),
1455 Self::Failed => std::option::Option::Some("FAILED"),
1456 Self::Creating => std::option::Option::Some("CREATING"),
1457 Self::Deleting => std::option::Option::Some("DELETING"),
1458 Self::CreateRepairing => std::option::Option::Some("CREATE_REPAIRING"),
1459 Self::DeleteRepairing => std::option::Option::Some("DELETE_REPAIRING"),
1460 Self::UnknownValue(u) => u.0.name(),
1461 }
1462 }
1463 }
1464
1465 impl std::default::Default for State {
1466 fn default() -> Self {
1467 use std::convert::From;
1468 Self::from(0)
1469 }
1470 }
1471
1472 impl std::fmt::Display for State {
1473 fn fmt(
1474 &self,
1475 f: &mut std::fmt::Formatter<'_>,
1476 ) -> std::result::Result<(), std::fmt::Error> {
1477 wkt::internal::display_enum(f, self.name(), self.value())
1478 }
1479 }
1480
1481 impl std::convert::From<i32> for State {
1482 fn from(value: i32) -> Self {
1483 match value {
1484 0 => Self::Unspecified,
1485 1 => Self::Active,
1486 2 => Self::Failed,
1487 3 => Self::Creating,
1488 4 => Self::Deleting,
1489 5 => Self::CreateRepairing,
1490 6 => Self::DeleteRepairing,
1491 _ => Self::UnknownValue(state::UnknownValue(
1492 wkt::internal::UnknownEnumValue::Integer(value),
1493 )),
1494 }
1495 }
1496 }
1497
1498 impl std::convert::From<&str> for State {
1499 fn from(value: &str) -> Self {
1500 use std::string::ToString;
1501 match value {
1502 "STATE_UNSPECIFIED" => Self::Unspecified,
1503 "ACTIVE" => Self::Active,
1504 "FAILED" => Self::Failed,
1505 "CREATING" => Self::Creating,
1506 "DELETING" => Self::Deleting,
1507 "CREATE_REPAIRING" => Self::CreateRepairing,
1508 "DELETE_REPAIRING" => Self::DeleteRepairing,
1509 _ => Self::UnknownValue(state::UnknownValue(
1510 wkt::internal::UnknownEnumValue::String(value.to_string()),
1511 )),
1512 }
1513 }
1514 }
1515
1516 impl serde::ser::Serialize for State {
1517 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1518 where
1519 S: serde::Serializer,
1520 {
1521 match self {
1522 Self::Unspecified => serializer.serialize_i32(0),
1523 Self::Active => serializer.serialize_i32(1),
1524 Self::Failed => serializer.serialize_i32(2),
1525 Self::Creating => serializer.serialize_i32(3),
1526 Self::Deleting => serializer.serialize_i32(4),
1527 Self::CreateRepairing => serializer.serialize_i32(5),
1528 Self::DeleteRepairing => serializer.serialize_i32(6),
1529 Self::UnknownValue(u) => u.0.serialize(serializer),
1530 }
1531 }
1532 }
1533
1534 impl<'de> serde::de::Deserialize<'de> for State {
1535 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1536 where
1537 D: serde::Deserializer<'de>,
1538 {
1539 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1540 ".google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection.State"))
1541 }
1542 }
1543 }
1544}
1545
1546/// Request for ListServiceConnectionMaps.
1547#[derive(Clone, Default, PartialEq)]
1548#[non_exhaustive]
1549pub struct ListServiceConnectionMapsRequest {
1550 /// Required. The parent resource's name. ex. projects/123/locations/us-east1
1551 pub parent: std::string::String,
1552
1553 /// The maximum number of results per page that should be returned.
1554 pub page_size: i32,
1555
1556 /// The page token.
1557 pub page_token: std::string::String,
1558
1559 /// A filter expression that filters the results listed in the response.
1560 pub filter: std::string::String,
1561
1562 /// Sort the results by a certain order.
1563 pub order_by: std::string::String,
1564
1565 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1566}
1567
1568impl ListServiceConnectionMapsRequest {
1569 /// Creates a new default instance.
1570 pub fn new() -> Self {
1571 std::default::Default::default()
1572 }
1573
1574 /// Sets the value of [parent][crate::model::ListServiceConnectionMapsRequest::parent].
1575 ///
1576 /// # Example
1577 /// ```ignore,no_run
1578 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1579 /// let x = ListServiceConnectionMapsRequest::new().set_parent("example");
1580 /// ```
1581 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1582 self.parent = v.into();
1583 self
1584 }
1585
1586 /// Sets the value of [page_size][crate::model::ListServiceConnectionMapsRequest::page_size].
1587 ///
1588 /// # Example
1589 /// ```ignore,no_run
1590 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1591 /// let x = ListServiceConnectionMapsRequest::new().set_page_size(42);
1592 /// ```
1593 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1594 self.page_size = v.into();
1595 self
1596 }
1597
1598 /// Sets the value of [page_token][crate::model::ListServiceConnectionMapsRequest::page_token].
1599 ///
1600 /// # Example
1601 /// ```ignore,no_run
1602 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1603 /// let x = ListServiceConnectionMapsRequest::new().set_page_token("example");
1604 /// ```
1605 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1606 self.page_token = v.into();
1607 self
1608 }
1609
1610 /// Sets the value of [filter][crate::model::ListServiceConnectionMapsRequest::filter].
1611 ///
1612 /// # Example
1613 /// ```ignore,no_run
1614 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1615 /// let x = ListServiceConnectionMapsRequest::new().set_filter("example");
1616 /// ```
1617 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1618 self.filter = v.into();
1619 self
1620 }
1621
1622 /// Sets the value of [order_by][crate::model::ListServiceConnectionMapsRequest::order_by].
1623 ///
1624 /// # Example
1625 /// ```ignore,no_run
1626 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1627 /// let x = ListServiceConnectionMapsRequest::new().set_order_by("example");
1628 /// ```
1629 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1630 self.order_by = v.into();
1631 self
1632 }
1633}
1634
1635impl wkt::message::Message for ListServiceConnectionMapsRequest {
1636 fn typename() -> &'static str {
1637 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsRequest"
1638 }
1639}
1640
1641/// Response for ListServiceConnectionMaps.
1642#[derive(Clone, Default, PartialEq)]
1643#[non_exhaustive]
1644pub struct ListServiceConnectionMapsResponse {
1645 /// ServiceConnectionMaps to be returned.
1646 pub service_connection_maps: std::vec::Vec<crate::model::ServiceConnectionMap>,
1647
1648 /// The next pagination token in the List response. It should be used as
1649 /// page_token for the following request. An empty value means no more result.
1650 pub next_page_token: std::string::String,
1651
1652 /// Locations that could not be reached.
1653 pub unreachable: std::vec::Vec<std::string::String>,
1654
1655 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1656}
1657
1658impl ListServiceConnectionMapsResponse {
1659 /// Creates a new default instance.
1660 pub fn new() -> Self {
1661 std::default::Default::default()
1662 }
1663
1664 /// Sets the value of [service_connection_maps][crate::model::ListServiceConnectionMapsResponse::service_connection_maps].
1665 ///
1666 /// # Example
1667 /// ```ignore,no_run
1668 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsResponse;
1669 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1670 /// let x = ListServiceConnectionMapsResponse::new()
1671 /// .set_service_connection_maps([
1672 /// ServiceConnectionMap::default()/* use setters */,
1673 /// ServiceConnectionMap::default()/* use (different) setters */,
1674 /// ]);
1675 /// ```
1676 pub fn set_service_connection_maps<T, V>(mut self, v: T) -> Self
1677 where
1678 T: std::iter::IntoIterator<Item = V>,
1679 V: std::convert::Into<crate::model::ServiceConnectionMap>,
1680 {
1681 use std::iter::Iterator;
1682 self.service_connection_maps = v.into_iter().map(|i| i.into()).collect();
1683 self
1684 }
1685
1686 /// Sets the value of [next_page_token][crate::model::ListServiceConnectionMapsResponse::next_page_token].
1687 ///
1688 /// # Example
1689 /// ```ignore,no_run
1690 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsResponse;
1691 /// let x = ListServiceConnectionMapsResponse::new().set_next_page_token("example");
1692 /// ```
1693 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1694 self.next_page_token = v.into();
1695 self
1696 }
1697
1698 /// Sets the value of [unreachable][crate::model::ListServiceConnectionMapsResponse::unreachable].
1699 ///
1700 /// # Example
1701 /// ```ignore,no_run
1702 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsResponse;
1703 /// let x = ListServiceConnectionMapsResponse::new().set_unreachable(["a", "b", "c"]);
1704 /// ```
1705 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1706 where
1707 T: std::iter::IntoIterator<Item = V>,
1708 V: std::convert::Into<std::string::String>,
1709 {
1710 use std::iter::Iterator;
1711 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1712 self
1713 }
1714}
1715
1716impl wkt::message::Message for ListServiceConnectionMapsResponse {
1717 fn typename() -> &'static str {
1718 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsResponse"
1719 }
1720}
1721
1722#[doc(hidden)]
1723impl google_cloud_gax::paginator::internal::PageableResponse for ListServiceConnectionMapsResponse {
1724 type PageItem = crate::model::ServiceConnectionMap;
1725
1726 fn items(self) -> std::vec::Vec<Self::PageItem> {
1727 self.service_connection_maps
1728 }
1729
1730 fn next_page_token(&self) -> std::string::String {
1731 use std::clone::Clone;
1732 self.next_page_token.clone()
1733 }
1734}
1735
1736/// Request for GetServiceConnectionMap.
1737#[derive(Clone, Default, PartialEq)]
1738#[non_exhaustive]
1739pub struct GetServiceConnectionMapRequest {
1740 /// Required. Name of the ServiceConnectionMap to get.
1741 pub name: std::string::String,
1742
1743 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1744}
1745
1746impl GetServiceConnectionMapRequest {
1747 /// Creates a new default instance.
1748 pub fn new() -> Self {
1749 std::default::Default::default()
1750 }
1751
1752 /// Sets the value of [name][crate::model::GetServiceConnectionMapRequest::name].
1753 ///
1754 /// # Example
1755 /// ```ignore,no_run
1756 /// # use google_cloud_networkconnectivity_v1::model::GetServiceConnectionMapRequest;
1757 /// # let project_id = "project_id";
1758 /// # let location_id = "location_id";
1759 /// # let service_connection_map_id = "service_connection_map_id";
1760 /// let x = GetServiceConnectionMapRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/serviceConnectionMaps/{service_connection_map_id}"));
1761 /// ```
1762 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1763 self.name = v.into();
1764 self
1765 }
1766}
1767
1768impl wkt::message::Message for GetServiceConnectionMapRequest {
1769 fn typename() -> &'static str {
1770 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionMapRequest"
1771 }
1772}
1773
1774/// Request for CreateServiceConnectionMap.
1775#[derive(Clone, Default, PartialEq)]
1776#[non_exhaustive]
1777pub struct CreateServiceConnectionMapRequest {
1778 /// Required. The parent resource's name of the ServiceConnectionMap. ex.
1779 /// projects/123/locations/us-east1
1780 pub parent: std::string::String,
1781
1782 /// Optional. Resource ID
1783 /// (i.e. 'foo' in '[...]/projects/p/locations/l/serviceConnectionMaps/foo')
1784 /// See <https://google.aip.dev/122#resource-id-segments>
1785 /// Unique per location.
1786 /// If one is not provided, one will be generated.
1787 pub service_connection_map_id: std::string::String,
1788
1789 /// Required. Initial values for a new ServiceConnectionMaps
1790 pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
1791
1792 /// Optional. An optional request ID to identify requests. Specify a unique
1793 /// request ID so that if you must retry your request, the server will know to
1794 /// ignore the request if it has already been completed. The server will
1795 /// guarantee that for at least 60 minutes since the first request.
1796 ///
1797 /// For example, consider a situation where you make an initial request and
1798 /// the request times out. If you make the request again with the same request
1799 /// ID, the server can check if original operation with the same request ID
1800 /// was received, and if so, will ignore the second request. This prevents
1801 /// clients from accidentally creating duplicate commitments.
1802 ///
1803 /// The request ID must be a valid UUID with the exception that zero UUID is
1804 /// not supported (00000000-0000-0000-0000-000000000000).
1805 pub request_id: std::string::String,
1806
1807 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1808}
1809
1810impl CreateServiceConnectionMapRequest {
1811 /// Creates a new default instance.
1812 pub fn new() -> Self {
1813 std::default::Default::default()
1814 }
1815
1816 /// Sets the value of [parent][crate::model::CreateServiceConnectionMapRequest::parent].
1817 ///
1818 /// # Example
1819 /// ```ignore,no_run
1820 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1821 /// # let project_id = "project_id";
1822 /// # let location_id = "location_id";
1823 /// let x = CreateServiceConnectionMapRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
1824 /// ```
1825 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1826 self.parent = v.into();
1827 self
1828 }
1829
1830 /// Sets the value of [service_connection_map_id][crate::model::CreateServiceConnectionMapRequest::service_connection_map_id].
1831 ///
1832 /// # Example
1833 /// ```ignore,no_run
1834 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1835 /// let x = CreateServiceConnectionMapRequest::new().set_service_connection_map_id("example");
1836 /// ```
1837 pub fn set_service_connection_map_id<T: std::convert::Into<std::string::String>>(
1838 mut self,
1839 v: T,
1840 ) -> Self {
1841 self.service_connection_map_id = v.into();
1842 self
1843 }
1844
1845 /// Sets the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
1846 ///
1847 /// # Example
1848 /// ```ignore,no_run
1849 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1850 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1851 /// let x = CreateServiceConnectionMapRequest::new().set_service_connection_map(ServiceConnectionMap::default()/* use setters */);
1852 /// ```
1853 pub fn set_service_connection_map<T>(mut self, v: T) -> Self
1854 where
1855 T: std::convert::Into<crate::model::ServiceConnectionMap>,
1856 {
1857 self.service_connection_map = std::option::Option::Some(v.into());
1858 self
1859 }
1860
1861 /// Sets or clears the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
1862 ///
1863 /// # Example
1864 /// ```ignore,no_run
1865 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1866 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1867 /// let x = CreateServiceConnectionMapRequest::new().set_or_clear_service_connection_map(Some(ServiceConnectionMap::default()/* use setters */));
1868 /// let x = CreateServiceConnectionMapRequest::new().set_or_clear_service_connection_map(None::<ServiceConnectionMap>);
1869 /// ```
1870 pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
1871 where
1872 T: std::convert::Into<crate::model::ServiceConnectionMap>,
1873 {
1874 self.service_connection_map = v.map(|x| x.into());
1875 self
1876 }
1877
1878 /// Sets the value of [request_id][crate::model::CreateServiceConnectionMapRequest::request_id].
1879 ///
1880 /// # Example
1881 /// ```ignore,no_run
1882 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1883 /// let x = CreateServiceConnectionMapRequest::new().set_request_id("example");
1884 /// ```
1885 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1886 self.request_id = v.into();
1887 self
1888 }
1889}
1890
1891impl wkt::message::Message for CreateServiceConnectionMapRequest {
1892 fn typename() -> &'static str {
1893 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionMapRequest"
1894 }
1895}
1896
1897/// Request for UpdateServiceConnectionMap.
1898#[derive(Clone, Default, PartialEq)]
1899#[non_exhaustive]
1900pub struct UpdateServiceConnectionMapRequest {
1901 /// Optional. Field mask is used to specify the fields to be overwritten in the
1902 /// ServiceConnectionMap resource by the update.
1903 /// The fields specified in the update_mask are relative to the resource, not
1904 /// the full request. A field will be overwritten if it is in the mask. If the
1905 /// user does not provide a mask then all fields will be overwritten.
1906 pub update_mask: std::option::Option<wkt::FieldMask>,
1907
1908 /// Required. New values to be patched into the resource.
1909 pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
1910
1911 /// Optional. An optional request ID to identify requests. Specify a unique
1912 /// request ID so that if you must retry your request, the server will know to
1913 /// ignore the request if it has already been completed. The server will
1914 /// guarantee that for at least 60 minutes since the first request.
1915 ///
1916 /// For example, consider a situation where you make an initial request and
1917 /// the request times out. If you make the request again with the same request
1918 /// ID, the server can check if original operation with the same request ID
1919 /// was received, and if so, will ignore the second request. This prevents
1920 /// clients from accidentally creating duplicate commitments.
1921 ///
1922 /// The request ID must be a valid UUID with the exception that zero UUID is
1923 /// not supported (00000000-0000-0000-0000-000000000000).
1924 pub request_id: std::string::String,
1925
1926 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1927}
1928
1929impl UpdateServiceConnectionMapRequest {
1930 /// Creates a new default instance.
1931 pub fn new() -> Self {
1932 std::default::Default::default()
1933 }
1934
1935 /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
1936 ///
1937 /// # Example
1938 /// ```ignore,no_run
1939 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1940 /// use wkt::FieldMask;
1941 /// let x = UpdateServiceConnectionMapRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1942 /// ```
1943 pub fn set_update_mask<T>(mut self, v: T) -> Self
1944 where
1945 T: std::convert::Into<wkt::FieldMask>,
1946 {
1947 self.update_mask = std::option::Option::Some(v.into());
1948 self
1949 }
1950
1951 /// Sets or clears the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
1952 ///
1953 /// # Example
1954 /// ```ignore,no_run
1955 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1956 /// use wkt::FieldMask;
1957 /// let x = UpdateServiceConnectionMapRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1958 /// let x = UpdateServiceConnectionMapRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1959 /// ```
1960 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1961 where
1962 T: std::convert::Into<wkt::FieldMask>,
1963 {
1964 self.update_mask = v.map(|x| x.into());
1965 self
1966 }
1967
1968 /// Sets the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
1969 ///
1970 /// # Example
1971 /// ```ignore,no_run
1972 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1973 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1974 /// let x = UpdateServiceConnectionMapRequest::new().set_service_connection_map(ServiceConnectionMap::default()/* use setters */);
1975 /// ```
1976 pub fn set_service_connection_map<T>(mut self, v: T) -> Self
1977 where
1978 T: std::convert::Into<crate::model::ServiceConnectionMap>,
1979 {
1980 self.service_connection_map = std::option::Option::Some(v.into());
1981 self
1982 }
1983
1984 /// Sets or clears the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
1985 ///
1986 /// # Example
1987 /// ```ignore,no_run
1988 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1989 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1990 /// let x = UpdateServiceConnectionMapRequest::new().set_or_clear_service_connection_map(Some(ServiceConnectionMap::default()/* use setters */));
1991 /// let x = UpdateServiceConnectionMapRequest::new().set_or_clear_service_connection_map(None::<ServiceConnectionMap>);
1992 /// ```
1993 pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
1994 where
1995 T: std::convert::Into<crate::model::ServiceConnectionMap>,
1996 {
1997 self.service_connection_map = v.map(|x| x.into());
1998 self
1999 }
2000
2001 /// Sets the value of [request_id][crate::model::UpdateServiceConnectionMapRequest::request_id].
2002 ///
2003 /// # Example
2004 /// ```ignore,no_run
2005 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
2006 /// let x = UpdateServiceConnectionMapRequest::new().set_request_id("example");
2007 /// ```
2008 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2009 self.request_id = v.into();
2010 self
2011 }
2012}
2013
2014impl wkt::message::Message for UpdateServiceConnectionMapRequest {
2015 fn typename() -> &'static str {
2016 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionMapRequest"
2017 }
2018}
2019
2020/// Request for DeleteServiceConnectionMap.
2021#[derive(Clone, Default, PartialEq)]
2022#[non_exhaustive]
2023pub struct DeleteServiceConnectionMapRequest {
2024 /// Required. The name of the ServiceConnectionMap to delete.
2025 pub name: std::string::String,
2026
2027 /// Optional. An optional request ID to identify requests. Specify a unique
2028 /// request ID so that if you must retry your request, the server will know to
2029 /// ignore the request if it has already been completed. The server will
2030 /// guarantee that for at least 60 minutes after the first request.
2031 ///
2032 /// For example, consider a situation where you make an initial request and
2033 /// the request times out. If you make the request again with the same request
2034 /// ID, the server can check if original operation with the same request ID
2035 /// was received, and if so, will ignore the second request. This prevents
2036 /// clients from accidentally creating duplicate commitments.
2037 ///
2038 /// The request ID must be a valid UUID with the exception that zero UUID is
2039 /// not supported (00000000-0000-0000-0000-000000000000).
2040 pub request_id: std::string::String,
2041
2042 /// Optional. The etag is computed by the server, and may be sent on update and
2043 /// delete requests to ensure the client has an up-to-date value before
2044 /// proceeding.
2045 pub etag: std::option::Option<std::string::String>,
2046
2047 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2048}
2049
2050impl DeleteServiceConnectionMapRequest {
2051 /// Creates a new default instance.
2052 pub fn new() -> Self {
2053 std::default::Default::default()
2054 }
2055
2056 /// Sets the value of [name][crate::model::DeleteServiceConnectionMapRequest::name].
2057 ///
2058 /// # Example
2059 /// ```ignore,no_run
2060 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionMapRequest;
2061 /// # let project_id = "project_id";
2062 /// # let location_id = "location_id";
2063 /// # let service_connection_map_id = "service_connection_map_id";
2064 /// let x = DeleteServiceConnectionMapRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/serviceConnectionMaps/{service_connection_map_id}"));
2065 /// ```
2066 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2067 self.name = v.into();
2068 self
2069 }
2070
2071 /// Sets the value of [request_id][crate::model::DeleteServiceConnectionMapRequest::request_id].
2072 ///
2073 /// # Example
2074 /// ```ignore,no_run
2075 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionMapRequest;
2076 /// let x = DeleteServiceConnectionMapRequest::new().set_request_id("example");
2077 /// ```
2078 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2079 self.request_id = v.into();
2080 self
2081 }
2082
2083 /// Sets the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
2084 ///
2085 /// # Example
2086 /// ```ignore,no_run
2087 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionMapRequest;
2088 /// let x = DeleteServiceConnectionMapRequest::new().set_etag("example");
2089 /// ```
2090 pub fn set_etag<T>(mut self, v: T) -> Self
2091 where
2092 T: std::convert::Into<std::string::String>,
2093 {
2094 self.etag = std::option::Option::Some(v.into());
2095 self
2096 }
2097
2098 /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
2099 ///
2100 /// # Example
2101 /// ```ignore,no_run
2102 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionMapRequest;
2103 /// let x = DeleteServiceConnectionMapRequest::new().set_or_clear_etag(Some("example"));
2104 /// let x = DeleteServiceConnectionMapRequest::new().set_or_clear_etag(None::<String>);
2105 /// ```
2106 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2107 where
2108 T: std::convert::Into<std::string::String>,
2109 {
2110 self.etag = v.map(|x| x.into());
2111 self
2112 }
2113}
2114
2115impl wkt::message::Message for DeleteServiceConnectionMapRequest {
2116 fn typename() -> &'static str {
2117 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionMapRequest"
2118 }
2119}
2120
2121/// The ServiceConnectionPolicy resource.
2122#[derive(Clone, Default, PartialEq)]
2123#[non_exhaustive]
2124pub struct ServiceConnectionPolicy {
2125 /// Immutable. The name of a ServiceConnectionPolicy.
2126 /// Format:
2127 /// projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy}
2128 /// See: <https://google.aip.dev/122#fields-representing-resource-names>
2129 pub name: std::string::String,
2130
2131 /// Output only. Time when the ServiceConnectionPolicy was created.
2132 pub create_time: std::option::Option<wkt::Timestamp>,
2133
2134 /// Output only. Time when the ServiceConnectionPolicy was updated.
2135 pub update_time: std::option::Option<wkt::Timestamp>,
2136
2137 /// User-defined labels.
2138 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2139
2140 /// A description of this resource.
2141 pub description: std::string::String,
2142
2143 /// The resource path of the consumer network.
2144 /// Example:
2145 ///
2146 /// - projects/{projectNumOrId}/global/networks/{resourceId}.
2147 pub network: std::string::String,
2148
2149 /// The service class identifier for which this ServiceConnectionPolicy is for.
2150 /// The service class identifier is a unique, symbolic representation of a
2151 /// ServiceClass. It is provided by the Service Producer. Google services have
2152 /// a prefix of gcp or google-cloud. For example, gcp-memorystore-redis or
2153 /// google-cloud-sql. 3rd party services do not. For example,
2154 /// test-service-a3dfcx.
2155 pub service_class: std::string::String,
2156
2157 /// Output only. The type of underlying resources used to create the
2158 /// connection.
2159 pub infrastructure: crate::model::Infrastructure,
2160
2161 /// Configuration used for Private Service Connect connections. Used when
2162 /// Infrastructure is PSC.
2163 pub psc_config: std::option::Option<crate::model::service_connection_policy::PscConfig>,
2164
2165 /// Output only. [Output only] Information about each Private Service Connect
2166 /// connection.
2167 pub psc_connections: std::vec::Vec<crate::model::service_connection_policy::PscConnection>,
2168
2169 /// Optional. The etag is computed by the server, and may be sent on update and
2170 /// delete requests to ensure the client has an up-to-date value before
2171 /// proceeding.
2172 pub etag: std::option::Option<std::string::String>,
2173
2174 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2175}
2176
2177impl ServiceConnectionPolicy {
2178 /// Creates a new default instance.
2179 pub fn new() -> Self {
2180 std::default::Default::default()
2181 }
2182
2183 /// Sets the value of [name][crate::model::ServiceConnectionPolicy::name].
2184 ///
2185 /// # Example
2186 /// ```ignore,no_run
2187 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2188 /// # let project_id = "project_id";
2189 /// # let location_id = "location_id";
2190 /// # let service_connection_policy_id = "service_connection_policy_id";
2191 /// let x = ServiceConnectionPolicy::new().set_name(format!("projects/{project_id}/locations/{location_id}/serviceConnectionPolicies/{service_connection_policy_id}"));
2192 /// ```
2193 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2194 self.name = v.into();
2195 self
2196 }
2197
2198 /// Sets the value of [create_time][crate::model::ServiceConnectionPolicy::create_time].
2199 ///
2200 /// # Example
2201 /// ```ignore,no_run
2202 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2203 /// use wkt::Timestamp;
2204 /// let x = ServiceConnectionPolicy::new().set_create_time(Timestamp::default()/* use setters */);
2205 /// ```
2206 pub fn set_create_time<T>(mut self, v: T) -> Self
2207 where
2208 T: std::convert::Into<wkt::Timestamp>,
2209 {
2210 self.create_time = std::option::Option::Some(v.into());
2211 self
2212 }
2213
2214 /// Sets or clears the value of [create_time][crate::model::ServiceConnectionPolicy::create_time].
2215 ///
2216 /// # Example
2217 /// ```ignore,no_run
2218 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2219 /// use wkt::Timestamp;
2220 /// let x = ServiceConnectionPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2221 /// let x = ServiceConnectionPolicy::new().set_or_clear_create_time(None::<Timestamp>);
2222 /// ```
2223 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2224 where
2225 T: std::convert::Into<wkt::Timestamp>,
2226 {
2227 self.create_time = v.map(|x| x.into());
2228 self
2229 }
2230
2231 /// Sets the value of [update_time][crate::model::ServiceConnectionPolicy::update_time].
2232 ///
2233 /// # Example
2234 /// ```ignore,no_run
2235 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2236 /// use wkt::Timestamp;
2237 /// let x = ServiceConnectionPolicy::new().set_update_time(Timestamp::default()/* use setters */);
2238 /// ```
2239 pub fn set_update_time<T>(mut self, v: T) -> Self
2240 where
2241 T: std::convert::Into<wkt::Timestamp>,
2242 {
2243 self.update_time = std::option::Option::Some(v.into());
2244 self
2245 }
2246
2247 /// Sets or clears the value of [update_time][crate::model::ServiceConnectionPolicy::update_time].
2248 ///
2249 /// # Example
2250 /// ```ignore,no_run
2251 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2252 /// use wkt::Timestamp;
2253 /// let x = ServiceConnectionPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2254 /// let x = ServiceConnectionPolicy::new().set_or_clear_update_time(None::<Timestamp>);
2255 /// ```
2256 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2257 where
2258 T: std::convert::Into<wkt::Timestamp>,
2259 {
2260 self.update_time = v.map(|x| x.into());
2261 self
2262 }
2263
2264 /// Sets the value of [labels][crate::model::ServiceConnectionPolicy::labels].
2265 ///
2266 /// # Example
2267 /// ```ignore,no_run
2268 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2269 /// let x = ServiceConnectionPolicy::new().set_labels([
2270 /// ("key0", "abc"),
2271 /// ("key1", "xyz"),
2272 /// ]);
2273 /// ```
2274 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2275 where
2276 T: std::iter::IntoIterator<Item = (K, V)>,
2277 K: std::convert::Into<std::string::String>,
2278 V: std::convert::Into<std::string::String>,
2279 {
2280 use std::iter::Iterator;
2281 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2282 self
2283 }
2284
2285 /// Sets the value of [description][crate::model::ServiceConnectionPolicy::description].
2286 ///
2287 /// # Example
2288 /// ```ignore,no_run
2289 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2290 /// let x = ServiceConnectionPolicy::new().set_description("example");
2291 /// ```
2292 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2293 self.description = v.into();
2294 self
2295 }
2296
2297 /// Sets the value of [network][crate::model::ServiceConnectionPolicy::network].
2298 ///
2299 /// # Example
2300 /// ```ignore,no_run
2301 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2302 /// let x = ServiceConnectionPolicy::new().set_network("example");
2303 /// ```
2304 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2305 self.network = v.into();
2306 self
2307 }
2308
2309 /// Sets the value of [service_class][crate::model::ServiceConnectionPolicy::service_class].
2310 ///
2311 /// # Example
2312 /// ```ignore,no_run
2313 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2314 /// let x = ServiceConnectionPolicy::new().set_service_class("example");
2315 /// ```
2316 pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2317 self.service_class = v.into();
2318 self
2319 }
2320
2321 /// Sets the value of [infrastructure][crate::model::ServiceConnectionPolicy::infrastructure].
2322 ///
2323 /// # Example
2324 /// ```ignore,no_run
2325 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2326 /// use google_cloud_networkconnectivity_v1::model::Infrastructure;
2327 /// let x0 = ServiceConnectionPolicy::new().set_infrastructure(Infrastructure::Psc);
2328 /// ```
2329 pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
2330 mut self,
2331 v: T,
2332 ) -> Self {
2333 self.infrastructure = v.into();
2334 self
2335 }
2336
2337 /// Sets the value of [psc_config][crate::model::ServiceConnectionPolicy::psc_config].
2338 ///
2339 /// # Example
2340 /// ```ignore,no_run
2341 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2342 /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2343 /// let x = ServiceConnectionPolicy::new().set_psc_config(PscConfig::default()/* use setters */);
2344 /// ```
2345 pub fn set_psc_config<T>(mut self, v: T) -> Self
2346 where
2347 T: std::convert::Into<crate::model::service_connection_policy::PscConfig>,
2348 {
2349 self.psc_config = std::option::Option::Some(v.into());
2350 self
2351 }
2352
2353 /// Sets or clears the value of [psc_config][crate::model::ServiceConnectionPolicy::psc_config].
2354 ///
2355 /// # Example
2356 /// ```ignore,no_run
2357 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2358 /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2359 /// let x = ServiceConnectionPolicy::new().set_or_clear_psc_config(Some(PscConfig::default()/* use setters */));
2360 /// let x = ServiceConnectionPolicy::new().set_or_clear_psc_config(None::<PscConfig>);
2361 /// ```
2362 pub fn set_or_clear_psc_config<T>(mut self, v: std::option::Option<T>) -> Self
2363 where
2364 T: std::convert::Into<crate::model::service_connection_policy::PscConfig>,
2365 {
2366 self.psc_config = v.map(|x| x.into());
2367 self
2368 }
2369
2370 /// Sets the value of [psc_connections][crate::model::ServiceConnectionPolicy::psc_connections].
2371 ///
2372 /// # Example
2373 /// ```ignore,no_run
2374 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2375 /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2376 /// let x = ServiceConnectionPolicy::new()
2377 /// .set_psc_connections([
2378 /// PscConnection::default()/* use setters */,
2379 /// PscConnection::default()/* use (different) setters */,
2380 /// ]);
2381 /// ```
2382 pub fn set_psc_connections<T, V>(mut self, v: T) -> Self
2383 where
2384 T: std::iter::IntoIterator<Item = V>,
2385 V: std::convert::Into<crate::model::service_connection_policy::PscConnection>,
2386 {
2387 use std::iter::Iterator;
2388 self.psc_connections = v.into_iter().map(|i| i.into()).collect();
2389 self
2390 }
2391
2392 /// Sets the value of [etag][crate::model::ServiceConnectionPolicy::etag].
2393 ///
2394 /// # Example
2395 /// ```ignore,no_run
2396 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2397 /// let x = ServiceConnectionPolicy::new().set_etag("example");
2398 /// ```
2399 pub fn set_etag<T>(mut self, v: T) -> Self
2400 where
2401 T: std::convert::Into<std::string::String>,
2402 {
2403 self.etag = std::option::Option::Some(v.into());
2404 self
2405 }
2406
2407 /// Sets or clears the value of [etag][crate::model::ServiceConnectionPolicy::etag].
2408 ///
2409 /// # Example
2410 /// ```ignore,no_run
2411 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2412 /// let x = ServiceConnectionPolicy::new().set_or_clear_etag(Some("example"));
2413 /// let x = ServiceConnectionPolicy::new().set_or_clear_etag(None::<String>);
2414 /// ```
2415 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2416 where
2417 T: std::convert::Into<std::string::String>,
2418 {
2419 self.etag = v.map(|x| x.into());
2420 self
2421 }
2422}
2423
2424impl wkt::message::Message for ServiceConnectionPolicy {
2425 fn typename() -> &'static str {
2426 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy"
2427 }
2428}
2429
2430/// Defines additional types related to [ServiceConnectionPolicy].
2431pub mod service_connection_policy {
2432 #[allow(unused_imports)]
2433 use super::*;
2434
2435 /// Configuration used for Private Service Connect connections. Used when
2436 /// Infrastructure is PSC.
2437 #[derive(Clone, Default, PartialEq)]
2438 #[non_exhaustive]
2439 pub struct PscConfig {
2440 /// The resource paths of subnetworks to use for IP address management.
2441 /// Example:
2442 /// projects/{projectNumOrId}/regions/{region}/subnetworks/{resourceId}.
2443 pub subnetworks: std::vec::Vec<std::string::String>,
2444
2445 /// Optional. Max number of PSC connections for this policy.
2446 pub limit: std::option::Option<i64>,
2447
2448 /// Required. ProducerInstanceLocation is used to specify which authorization
2449 /// mechanism to use to determine which projects the Producer instance can be
2450 /// within.
2451 pub producer_instance_location:
2452 crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
2453
2454 /// Optional. List of Projects, Folders, or Organizations from where the
2455 /// Producer instance can be within. For example, a network administrator can
2456 /// provide both 'organizations/foo' and 'projects/bar' as
2457 /// allowed_google_producers_resource_hierarchy_levels. This allowlists this
2458 /// network to connect with any Producer instance within the 'foo'
2459 /// organization or the 'bar' project. By default,
2460 /// allowed_google_producers_resource_hierarchy_level is empty. The format
2461 /// for each allowed_google_producers_resource_hierarchy_level is \<resource
2462 /// type\>/\<id\> where <resource type\> is one of 'projects', 'folders', or
2463 /// 'organizations' and \<id\> is either the ID or the number of the resource
2464 /// type. Format for each allowed_google_producers_resource_hierarchy_level
2465 /// value: 'projects/<project_id_or_number>' or 'folders/<folder_id>' or
2466 /// 'organizations/<organization_id>'
2467 /// Eg. [projects/my-project-id, projects/567, folders/891,
2468 /// organizations/123]
2469 pub allowed_google_producers_resource_hierarchy_level: std::vec::Vec<std::string::String>,
2470
2471 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2472 }
2473
2474 impl PscConfig {
2475 /// Creates a new default instance.
2476 pub fn new() -> Self {
2477 std::default::Default::default()
2478 }
2479
2480 /// Sets the value of [subnetworks][crate::model::service_connection_policy::PscConfig::subnetworks].
2481 ///
2482 /// # Example
2483 /// ```ignore,no_run
2484 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2485 /// let x = PscConfig::new().set_subnetworks(["a", "b", "c"]);
2486 /// ```
2487 pub fn set_subnetworks<T, V>(mut self, v: T) -> Self
2488 where
2489 T: std::iter::IntoIterator<Item = V>,
2490 V: std::convert::Into<std::string::String>,
2491 {
2492 use std::iter::Iterator;
2493 self.subnetworks = v.into_iter().map(|i| i.into()).collect();
2494 self
2495 }
2496
2497 /// Sets the value of [limit][crate::model::service_connection_policy::PscConfig::limit].
2498 ///
2499 /// # Example
2500 /// ```ignore,no_run
2501 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2502 /// let x = PscConfig::new().set_limit(42);
2503 /// ```
2504 pub fn set_limit<T>(mut self, v: T) -> Self
2505 where
2506 T: std::convert::Into<i64>,
2507 {
2508 self.limit = std::option::Option::Some(v.into());
2509 self
2510 }
2511
2512 /// Sets or clears the value of [limit][crate::model::service_connection_policy::PscConfig::limit].
2513 ///
2514 /// # Example
2515 /// ```ignore,no_run
2516 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2517 /// let x = PscConfig::new().set_or_clear_limit(Some(42));
2518 /// let x = PscConfig::new().set_or_clear_limit(None::<i32>);
2519 /// ```
2520 pub fn set_or_clear_limit<T>(mut self, v: std::option::Option<T>) -> Self
2521 where
2522 T: std::convert::Into<i64>,
2523 {
2524 self.limit = v.map(|x| x.into());
2525 self
2526 }
2527
2528 /// Sets the value of [producer_instance_location][crate::model::service_connection_policy::PscConfig::producer_instance_location].
2529 ///
2530 /// # Example
2531 /// ```ignore,no_run
2532 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2533 /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::psc_config::ProducerInstanceLocation;
2534 /// let x0 = PscConfig::new().set_producer_instance_location(ProducerInstanceLocation::CustomResourceHierarchyLevels);
2535 /// ```
2536 pub fn set_producer_instance_location<
2537 T: std::convert::Into<
2538 crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
2539 >,
2540 >(
2541 mut self,
2542 v: T,
2543 ) -> Self {
2544 self.producer_instance_location = v.into();
2545 self
2546 }
2547
2548 /// Sets the value of [allowed_google_producers_resource_hierarchy_level][crate::model::service_connection_policy::PscConfig::allowed_google_producers_resource_hierarchy_level].
2549 ///
2550 /// # Example
2551 /// ```ignore,no_run
2552 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2553 /// let x = PscConfig::new().set_allowed_google_producers_resource_hierarchy_level(["a", "b", "c"]);
2554 /// ```
2555 pub fn set_allowed_google_producers_resource_hierarchy_level<T, V>(mut self, v: T) -> Self
2556 where
2557 T: std::iter::IntoIterator<Item = V>,
2558 V: std::convert::Into<std::string::String>,
2559 {
2560 use std::iter::Iterator;
2561 self.allowed_google_producers_resource_hierarchy_level =
2562 v.into_iter().map(|i| i.into()).collect();
2563 self
2564 }
2565 }
2566
2567 impl wkt::message::Message for PscConfig {
2568 fn typename() -> &'static str {
2569 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig"
2570 }
2571 }
2572
2573 /// Defines additional types related to [PscConfig].
2574 pub mod psc_config {
2575 #[allow(unused_imports)]
2576 use super::*;
2577
2578 /// ProducerInstanceLocation is used to specify which authorization mechanism
2579 /// to use to determine which projects the Producer instance can be within.
2580 ///
2581 /// # Working with unknown values
2582 ///
2583 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2584 /// additional enum variants at any time. Adding new variants is not considered
2585 /// a breaking change. Applications should write their code in anticipation of:
2586 ///
2587 /// - New values appearing in future releases of the client library, **and**
2588 /// - New values received dynamically, without application changes.
2589 ///
2590 /// Please consult the [Working with enums] section in the user guide for some
2591 /// guidelines.
2592 ///
2593 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2594 #[derive(Clone, Debug, PartialEq)]
2595 #[non_exhaustive]
2596 pub enum ProducerInstanceLocation {
2597 /// Producer instance location is not specified. When this option is
2598 /// chosen, then the PSC connections created by this
2599 /// ServiceConnectionPolicy must be within the same project as the Producer
2600 /// instance. This is the default ProducerInstanceLocation value.
2601 /// To allow for PSC connections from this network to other networks, use
2602 /// the CUSTOM_RESOURCE_HIERARCHY_LEVELS option.
2603 Unspecified,
2604 /// Producer instance must be within one of the values provided in
2605 /// allowed_google_producers_resource_hierarchy_level.
2606 CustomResourceHierarchyLevels,
2607 /// If set, the enum was initialized with an unknown value.
2608 ///
2609 /// Applications can examine the value using [ProducerInstanceLocation::value] or
2610 /// [ProducerInstanceLocation::name].
2611 UnknownValue(producer_instance_location::UnknownValue),
2612 }
2613
2614 #[doc(hidden)]
2615 pub mod producer_instance_location {
2616 #[allow(unused_imports)]
2617 use super::*;
2618 #[derive(Clone, Debug, PartialEq)]
2619 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2620 }
2621
2622 impl ProducerInstanceLocation {
2623 /// Gets the enum value.
2624 ///
2625 /// Returns `None` if the enum contains an unknown value deserialized from
2626 /// the string representation of enums.
2627 pub fn value(&self) -> std::option::Option<i32> {
2628 match self {
2629 Self::Unspecified => std::option::Option::Some(0),
2630 Self::CustomResourceHierarchyLevels => std::option::Option::Some(1),
2631 Self::UnknownValue(u) => u.0.value(),
2632 }
2633 }
2634
2635 /// Gets the enum value as a string.
2636 ///
2637 /// Returns `None` if the enum contains an unknown value deserialized from
2638 /// the integer representation of enums.
2639 pub fn name(&self) -> std::option::Option<&str> {
2640 match self {
2641 Self::Unspecified => {
2642 std::option::Option::Some("PRODUCER_INSTANCE_LOCATION_UNSPECIFIED")
2643 }
2644 Self::CustomResourceHierarchyLevels => {
2645 std::option::Option::Some("CUSTOM_RESOURCE_HIERARCHY_LEVELS")
2646 }
2647 Self::UnknownValue(u) => u.0.name(),
2648 }
2649 }
2650 }
2651
2652 impl std::default::Default for ProducerInstanceLocation {
2653 fn default() -> Self {
2654 use std::convert::From;
2655 Self::from(0)
2656 }
2657 }
2658
2659 impl std::fmt::Display for ProducerInstanceLocation {
2660 fn fmt(
2661 &self,
2662 f: &mut std::fmt::Formatter<'_>,
2663 ) -> std::result::Result<(), std::fmt::Error> {
2664 wkt::internal::display_enum(f, self.name(), self.value())
2665 }
2666 }
2667
2668 impl std::convert::From<i32> for ProducerInstanceLocation {
2669 fn from(value: i32) -> Self {
2670 match value {
2671 0 => Self::Unspecified,
2672 1 => Self::CustomResourceHierarchyLevels,
2673 _ => Self::UnknownValue(producer_instance_location::UnknownValue(
2674 wkt::internal::UnknownEnumValue::Integer(value),
2675 )),
2676 }
2677 }
2678 }
2679
2680 impl std::convert::From<&str> for ProducerInstanceLocation {
2681 fn from(value: &str) -> Self {
2682 use std::string::ToString;
2683 match value {
2684 "PRODUCER_INSTANCE_LOCATION_UNSPECIFIED" => Self::Unspecified,
2685 "CUSTOM_RESOURCE_HIERARCHY_LEVELS" => Self::CustomResourceHierarchyLevels,
2686 _ => Self::UnknownValue(producer_instance_location::UnknownValue(
2687 wkt::internal::UnknownEnumValue::String(value.to_string()),
2688 )),
2689 }
2690 }
2691 }
2692
2693 impl serde::ser::Serialize for ProducerInstanceLocation {
2694 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2695 where
2696 S: serde::Serializer,
2697 {
2698 match self {
2699 Self::Unspecified => serializer.serialize_i32(0),
2700 Self::CustomResourceHierarchyLevels => serializer.serialize_i32(1),
2701 Self::UnknownValue(u) => u.0.serialize(serializer),
2702 }
2703 }
2704 }
2705
2706 impl<'de> serde::de::Deserialize<'de> for ProducerInstanceLocation {
2707 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2708 where
2709 D: serde::Deserializer<'de>,
2710 {
2711 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProducerInstanceLocation>::new(
2712 ".google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig.ProducerInstanceLocation"))
2713 }
2714 }
2715 }
2716
2717 /// Information about a specific Private Service Connect connection.
2718 #[derive(Clone, Default, PartialEq)]
2719 #[non_exhaustive]
2720 pub struct PscConnection {
2721 /// State of the PSC Connection
2722 pub state: crate::model::service_connection_policy::State,
2723
2724 /// The resource reference of the PSC Forwarding Rule within the consumer
2725 /// VPC.
2726 pub consumer_forwarding_rule: std::string::String,
2727
2728 /// The resource reference of the consumer address.
2729 pub consumer_address: std::string::String,
2730
2731 /// The error type indicates whether the error is consumer facing, producer
2732 /// facing or system internal.
2733 #[deprecated]
2734 pub error_type: crate::model::ConnectionErrorType,
2735
2736 /// The most recent error during operating this connection.
2737 /// Deprecated, please use error_info instead.
2738 #[deprecated]
2739 pub error: std::option::Option<google_cloud_rpc::model::Status>,
2740
2741 /// The last Compute Engine operation to setup PSC connection.
2742 pub gce_operation: std::string::String,
2743
2744 /// The project where the PSC connection is created.
2745 pub consumer_target_project: std::string::String,
2746
2747 /// The PSC connection id of the PSC forwarding rule.
2748 pub psc_connection_id: std::string::String,
2749
2750 /// Output only. The error info for the latest error during operating this
2751 /// connection.
2752 pub error_info: std::option::Option<google_cloud_rpc::model::ErrorInfo>,
2753
2754 /// Output only. The URI of the subnetwork selected to allocate IP address
2755 /// for this connection.
2756 pub selected_subnetwork: std::string::String,
2757
2758 /// Immutable. Deprecated. Use producer_instance_metadata instead.
2759 /// An immutable identifier for the producer instance.
2760 #[deprecated]
2761 pub producer_instance_id: std::string::String,
2762
2763 /// Immutable. An immutable map for the producer instance metadata.
2764 pub producer_instance_metadata:
2765 std::collections::HashMap<std::string::String, std::string::String>,
2766
2767 /// Output only. [Output only] The service class associated with this PSC
2768 /// Connection. The value is derived from the SCPolicy and matches the
2769 /// service class name provided by the customer.
2770 pub service_class: std::string::String,
2771
2772 /// The requested IP version for the PSC connection.
2773 pub ip_version: std::option::Option<crate::model::IPVersion>,
2774
2775 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2776 }
2777
2778 impl PscConnection {
2779 /// Creates a new default instance.
2780 pub fn new() -> Self {
2781 std::default::Default::default()
2782 }
2783
2784 /// Sets the value of [state][crate::model::service_connection_policy::PscConnection::state].
2785 ///
2786 /// # Example
2787 /// ```ignore,no_run
2788 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2789 /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::State;
2790 /// let x0 = PscConnection::new().set_state(State::Active);
2791 /// let x1 = PscConnection::new().set_state(State::Failed);
2792 /// let x2 = PscConnection::new().set_state(State::Creating);
2793 /// ```
2794 pub fn set_state<T: std::convert::Into<crate::model::service_connection_policy::State>>(
2795 mut self,
2796 v: T,
2797 ) -> Self {
2798 self.state = v.into();
2799 self
2800 }
2801
2802 /// Sets the value of [consumer_forwarding_rule][crate::model::service_connection_policy::PscConnection::consumer_forwarding_rule].
2803 ///
2804 /// # Example
2805 /// ```ignore,no_run
2806 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2807 /// let x = PscConnection::new().set_consumer_forwarding_rule("example");
2808 /// ```
2809 pub fn set_consumer_forwarding_rule<T: std::convert::Into<std::string::String>>(
2810 mut self,
2811 v: T,
2812 ) -> Self {
2813 self.consumer_forwarding_rule = v.into();
2814 self
2815 }
2816
2817 /// Sets the value of [consumer_address][crate::model::service_connection_policy::PscConnection::consumer_address].
2818 ///
2819 /// # Example
2820 /// ```ignore,no_run
2821 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2822 /// let x = PscConnection::new().set_consumer_address("example");
2823 /// ```
2824 pub fn set_consumer_address<T: std::convert::Into<std::string::String>>(
2825 mut self,
2826 v: T,
2827 ) -> Self {
2828 self.consumer_address = v.into();
2829 self
2830 }
2831
2832 /// Sets the value of [error_type][crate::model::service_connection_policy::PscConnection::error_type].
2833 ///
2834 /// # Example
2835 /// ```ignore,no_run
2836 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2837 /// use google_cloud_networkconnectivity_v1::model::ConnectionErrorType;
2838 /// let x0 = PscConnection::new().set_error_type(ConnectionErrorType::ErrorInternal);
2839 /// let x1 = PscConnection::new().set_error_type(ConnectionErrorType::ErrorConsumerSide);
2840 /// let x2 = PscConnection::new().set_error_type(ConnectionErrorType::ErrorProducerSide);
2841 /// ```
2842 #[deprecated]
2843 pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
2844 mut self,
2845 v: T,
2846 ) -> Self {
2847 self.error_type = v.into();
2848 self
2849 }
2850
2851 /// Sets the value of [error][crate::model::service_connection_policy::PscConnection::error].
2852 ///
2853 /// # Example
2854 /// ```ignore,no_run
2855 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2856 /// use google_cloud_rpc::model::Status;
2857 /// let x = PscConnection::new().set_error(Status::default()/* use setters */);
2858 /// ```
2859 #[deprecated]
2860 pub fn set_error<T>(mut self, v: T) -> Self
2861 where
2862 T: std::convert::Into<google_cloud_rpc::model::Status>,
2863 {
2864 self.error = std::option::Option::Some(v.into());
2865 self
2866 }
2867
2868 /// Sets or clears the value of [error][crate::model::service_connection_policy::PscConnection::error].
2869 ///
2870 /// # Example
2871 /// ```ignore,no_run
2872 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2873 /// use google_cloud_rpc::model::Status;
2874 /// let x = PscConnection::new().set_or_clear_error(Some(Status::default()/* use setters */));
2875 /// let x = PscConnection::new().set_or_clear_error(None::<Status>);
2876 /// ```
2877 #[deprecated]
2878 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
2879 where
2880 T: std::convert::Into<google_cloud_rpc::model::Status>,
2881 {
2882 self.error = v.map(|x| x.into());
2883 self
2884 }
2885
2886 /// Sets the value of [gce_operation][crate::model::service_connection_policy::PscConnection::gce_operation].
2887 ///
2888 /// # Example
2889 /// ```ignore,no_run
2890 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2891 /// let x = PscConnection::new().set_gce_operation("example");
2892 /// ```
2893 pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
2894 mut self,
2895 v: T,
2896 ) -> Self {
2897 self.gce_operation = v.into();
2898 self
2899 }
2900
2901 /// Sets the value of [consumer_target_project][crate::model::service_connection_policy::PscConnection::consumer_target_project].
2902 ///
2903 /// # Example
2904 /// ```ignore,no_run
2905 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2906 /// let x = PscConnection::new().set_consumer_target_project("example");
2907 /// ```
2908 pub fn set_consumer_target_project<T: std::convert::Into<std::string::String>>(
2909 mut self,
2910 v: T,
2911 ) -> Self {
2912 self.consumer_target_project = v.into();
2913 self
2914 }
2915
2916 /// Sets the value of [psc_connection_id][crate::model::service_connection_policy::PscConnection::psc_connection_id].
2917 ///
2918 /// # Example
2919 /// ```ignore,no_run
2920 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2921 /// let x = PscConnection::new().set_psc_connection_id("example");
2922 /// ```
2923 pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
2924 mut self,
2925 v: T,
2926 ) -> Self {
2927 self.psc_connection_id = v.into();
2928 self
2929 }
2930
2931 /// Sets the value of [error_info][crate::model::service_connection_policy::PscConnection::error_info].
2932 ///
2933 /// # Example
2934 /// ```ignore,no_run
2935 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2936 /// use google_cloud_rpc::model::ErrorInfo;
2937 /// let x = PscConnection::new().set_error_info(ErrorInfo::default()/* use setters */);
2938 /// ```
2939 pub fn set_error_info<T>(mut self, v: T) -> Self
2940 where
2941 T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
2942 {
2943 self.error_info = std::option::Option::Some(v.into());
2944 self
2945 }
2946
2947 /// Sets or clears the value of [error_info][crate::model::service_connection_policy::PscConnection::error_info].
2948 ///
2949 /// # Example
2950 /// ```ignore,no_run
2951 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2952 /// use google_cloud_rpc::model::ErrorInfo;
2953 /// let x = PscConnection::new().set_or_clear_error_info(Some(ErrorInfo::default()/* use setters */));
2954 /// let x = PscConnection::new().set_or_clear_error_info(None::<ErrorInfo>);
2955 /// ```
2956 pub fn set_or_clear_error_info<T>(mut self, v: std::option::Option<T>) -> Self
2957 where
2958 T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
2959 {
2960 self.error_info = v.map(|x| x.into());
2961 self
2962 }
2963
2964 /// Sets the value of [selected_subnetwork][crate::model::service_connection_policy::PscConnection::selected_subnetwork].
2965 ///
2966 /// # Example
2967 /// ```ignore,no_run
2968 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2969 /// let x = PscConnection::new().set_selected_subnetwork("example");
2970 /// ```
2971 pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
2972 mut self,
2973 v: T,
2974 ) -> Self {
2975 self.selected_subnetwork = v.into();
2976 self
2977 }
2978
2979 /// Sets the value of [producer_instance_id][crate::model::service_connection_policy::PscConnection::producer_instance_id].
2980 ///
2981 /// # Example
2982 /// ```ignore,no_run
2983 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2984 /// let x = PscConnection::new().set_producer_instance_id("example");
2985 /// ```
2986 #[deprecated]
2987 pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
2988 mut self,
2989 v: T,
2990 ) -> Self {
2991 self.producer_instance_id = v.into();
2992 self
2993 }
2994
2995 /// Sets the value of [producer_instance_metadata][crate::model::service_connection_policy::PscConnection::producer_instance_metadata].
2996 ///
2997 /// # Example
2998 /// ```ignore,no_run
2999 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
3000 /// let x = PscConnection::new().set_producer_instance_metadata([
3001 /// ("key0", "abc"),
3002 /// ("key1", "xyz"),
3003 /// ]);
3004 /// ```
3005 pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
3006 where
3007 T: std::iter::IntoIterator<Item = (K, V)>,
3008 K: std::convert::Into<std::string::String>,
3009 V: std::convert::Into<std::string::String>,
3010 {
3011 use std::iter::Iterator;
3012 self.producer_instance_metadata =
3013 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3014 self
3015 }
3016
3017 /// Sets the value of [service_class][crate::model::service_connection_policy::PscConnection::service_class].
3018 ///
3019 /// # Example
3020 /// ```ignore,no_run
3021 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
3022 /// let x = PscConnection::new().set_service_class("example");
3023 /// ```
3024 pub fn set_service_class<T: std::convert::Into<std::string::String>>(
3025 mut self,
3026 v: T,
3027 ) -> Self {
3028 self.service_class = v.into();
3029 self
3030 }
3031
3032 /// Sets the value of [ip_version][crate::model::service_connection_policy::PscConnection::ip_version].
3033 ///
3034 /// # Example
3035 /// ```ignore,no_run
3036 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
3037 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
3038 /// let x0 = PscConnection::new().set_ip_version(IPVersion::Ipv4);
3039 /// let x1 = PscConnection::new().set_ip_version(IPVersion::Ipv6);
3040 /// ```
3041 pub fn set_ip_version<T>(mut self, v: T) -> Self
3042 where
3043 T: std::convert::Into<crate::model::IPVersion>,
3044 {
3045 self.ip_version = std::option::Option::Some(v.into());
3046 self
3047 }
3048
3049 /// Sets or clears the value of [ip_version][crate::model::service_connection_policy::PscConnection::ip_version].
3050 ///
3051 /// # Example
3052 /// ```ignore,no_run
3053 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
3054 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
3055 /// let x0 = PscConnection::new().set_or_clear_ip_version(Some(IPVersion::Ipv4));
3056 /// let x1 = PscConnection::new().set_or_clear_ip_version(Some(IPVersion::Ipv6));
3057 /// let x_none = PscConnection::new().set_or_clear_ip_version(None::<IPVersion>);
3058 /// ```
3059 pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
3060 where
3061 T: std::convert::Into<crate::model::IPVersion>,
3062 {
3063 self.ip_version = v.map(|x| x.into());
3064 self
3065 }
3066 }
3067
3068 impl wkt::message::Message for PscConnection {
3069 fn typename() -> &'static str {
3070 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConnection"
3071 }
3072 }
3073
3074 /// The state of the PSC connection.
3075 /// We reserve the right to add more states without notice in the future.
3076 /// Users should not use exhaustive switch statements on this enum.
3077 /// See <https://google.aip.dev/216>.
3078 ///
3079 /// # Working with unknown values
3080 ///
3081 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3082 /// additional enum variants at any time. Adding new variants is not considered
3083 /// a breaking change. Applications should write their code in anticipation of:
3084 ///
3085 /// - New values appearing in future releases of the client library, **and**
3086 /// - New values received dynamically, without application changes.
3087 ///
3088 /// Please consult the [Working with enums] section in the user guide for some
3089 /// guidelines.
3090 ///
3091 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3092 #[derive(Clone, Debug, PartialEq)]
3093 #[non_exhaustive]
3094 pub enum State {
3095 /// An invalid state as the default case.
3096 Unspecified,
3097 /// The connection has been created successfully. However, for the
3098 /// up-to-date connection status, please use the created forwarding rule's
3099 /// "PscConnectionStatus" as the source of truth.
3100 Active,
3101 /// The connection is not functional since some resources on the connection
3102 /// fail to be created.
3103 Failed,
3104 /// The connection is being created.
3105 Creating,
3106 /// The connection is being deleted.
3107 Deleting,
3108 /// The connection is being repaired to complete creation.
3109 CreateRepairing,
3110 /// The connection is being repaired to complete deletion.
3111 DeleteRepairing,
3112 /// If set, the enum was initialized with an unknown value.
3113 ///
3114 /// Applications can examine the value using [State::value] or
3115 /// [State::name].
3116 UnknownValue(state::UnknownValue),
3117 }
3118
3119 #[doc(hidden)]
3120 pub mod state {
3121 #[allow(unused_imports)]
3122 use super::*;
3123 #[derive(Clone, Debug, PartialEq)]
3124 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3125 }
3126
3127 impl State {
3128 /// Gets the enum value.
3129 ///
3130 /// Returns `None` if the enum contains an unknown value deserialized from
3131 /// the string representation of enums.
3132 pub fn value(&self) -> std::option::Option<i32> {
3133 match self {
3134 Self::Unspecified => std::option::Option::Some(0),
3135 Self::Active => std::option::Option::Some(1),
3136 Self::Failed => std::option::Option::Some(2),
3137 Self::Creating => std::option::Option::Some(3),
3138 Self::Deleting => std::option::Option::Some(4),
3139 Self::CreateRepairing => std::option::Option::Some(5),
3140 Self::DeleteRepairing => std::option::Option::Some(6),
3141 Self::UnknownValue(u) => u.0.value(),
3142 }
3143 }
3144
3145 /// Gets the enum value as a string.
3146 ///
3147 /// Returns `None` if the enum contains an unknown value deserialized from
3148 /// the integer representation of enums.
3149 pub fn name(&self) -> std::option::Option<&str> {
3150 match self {
3151 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3152 Self::Active => std::option::Option::Some("ACTIVE"),
3153 Self::Failed => std::option::Option::Some("FAILED"),
3154 Self::Creating => std::option::Option::Some("CREATING"),
3155 Self::Deleting => std::option::Option::Some("DELETING"),
3156 Self::CreateRepairing => std::option::Option::Some("CREATE_REPAIRING"),
3157 Self::DeleteRepairing => std::option::Option::Some("DELETE_REPAIRING"),
3158 Self::UnknownValue(u) => u.0.name(),
3159 }
3160 }
3161 }
3162
3163 impl std::default::Default for State {
3164 fn default() -> Self {
3165 use std::convert::From;
3166 Self::from(0)
3167 }
3168 }
3169
3170 impl std::fmt::Display for State {
3171 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3172 wkt::internal::display_enum(f, self.name(), self.value())
3173 }
3174 }
3175
3176 impl std::convert::From<i32> for State {
3177 fn from(value: i32) -> Self {
3178 match value {
3179 0 => Self::Unspecified,
3180 1 => Self::Active,
3181 2 => Self::Failed,
3182 3 => Self::Creating,
3183 4 => Self::Deleting,
3184 5 => Self::CreateRepairing,
3185 6 => Self::DeleteRepairing,
3186 _ => Self::UnknownValue(state::UnknownValue(
3187 wkt::internal::UnknownEnumValue::Integer(value),
3188 )),
3189 }
3190 }
3191 }
3192
3193 impl std::convert::From<&str> for State {
3194 fn from(value: &str) -> Self {
3195 use std::string::ToString;
3196 match value {
3197 "STATE_UNSPECIFIED" => Self::Unspecified,
3198 "ACTIVE" => Self::Active,
3199 "FAILED" => Self::Failed,
3200 "CREATING" => Self::Creating,
3201 "DELETING" => Self::Deleting,
3202 "CREATE_REPAIRING" => Self::CreateRepairing,
3203 "DELETE_REPAIRING" => Self::DeleteRepairing,
3204 _ => Self::UnknownValue(state::UnknownValue(
3205 wkt::internal::UnknownEnumValue::String(value.to_string()),
3206 )),
3207 }
3208 }
3209 }
3210
3211 impl serde::ser::Serialize for State {
3212 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3213 where
3214 S: serde::Serializer,
3215 {
3216 match self {
3217 Self::Unspecified => serializer.serialize_i32(0),
3218 Self::Active => serializer.serialize_i32(1),
3219 Self::Failed => serializer.serialize_i32(2),
3220 Self::Creating => serializer.serialize_i32(3),
3221 Self::Deleting => serializer.serialize_i32(4),
3222 Self::CreateRepairing => serializer.serialize_i32(5),
3223 Self::DeleteRepairing => serializer.serialize_i32(6),
3224 Self::UnknownValue(u) => u.0.serialize(serializer),
3225 }
3226 }
3227 }
3228
3229 impl<'de> serde::de::Deserialize<'de> for State {
3230 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3231 where
3232 D: serde::Deserializer<'de>,
3233 {
3234 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3235 ".google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.State",
3236 ))
3237 }
3238 }
3239}
3240
3241/// Request for ListServiceConnectionPolicies.
3242#[derive(Clone, Default, PartialEq)]
3243#[non_exhaustive]
3244pub struct ListServiceConnectionPoliciesRequest {
3245 /// Required. The parent resource's name. ex. projects/123/locations/us-east1
3246 pub parent: std::string::String,
3247
3248 /// The maximum number of results per page that should be returned.
3249 pub page_size: i32,
3250
3251 /// The page token.
3252 pub page_token: std::string::String,
3253
3254 /// A filter expression that filters the results listed in the response.
3255 pub filter: std::string::String,
3256
3257 /// Sort the results by a certain order.
3258 pub order_by: std::string::String,
3259
3260 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3261}
3262
3263impl ListServiceConnectionPoliciesRequest {
3264 /// Creates a new default instance.
3265 pub fn new() -> Self {
3266 std::default::Default::default()
3267 }
3268
3269 /// Sets the value of [parent][crate::model::ListServiceConnectionPoliciesRequest::parent].
3270 ///
3271 /// # Example
3272 /// ```ignore,no_run
3273 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3274 /// let x = ListServiceConnectionPoliciesRequest::new().set_parent("example");
3275 /// ```
3276 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3277 self.parent = v.into();
3278 self
3279 }
3280
3281 /// Sets the value of [page_size][crate::model::ListServiceConnectionPoliciesRequest::page_size].
3282 ///
3283 /// # Example
3284 /// ```ignore,no_run
3285 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3286 /// let x = ListServiceConnectionPoliciesRequest::new().set_page_size(42);
3287 /// ```
3288 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3289 self.page_size = v.into();
3290 self
3291 }
3292
3293 /// Sets the value of [page_token][crate::model::ListServiceConnectionPoliciesRequest::page_token].
3294 ///
3295 /// # Example
3296 /// ```ignore,no_run
3297 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3298 /// let x = ListServiceConnectionPoliciesRequest::new().set_page_token("example");
3299 /// ```
3300 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3301 self.page_token = v.into();
3302 self
3303 }
3304
3305 /// Sets the value of [filter][crate::model::ListServiceConnectionPoliciesRequest::filter].
3306 ///
3307 /// # Example
3308 /// ```ignore,no_run
3309 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3310 /// let x = ListServiceConnectionPoliciesRequest::new().set_filter("example");
3311 /// ```
3312 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3313 self.filter = v.into();
3314 self
3315 }
3316
3317 /// Sets the value of [order_by][crate::model::ListServiceConnectionPoliciesRequest::order_by].
3318 ///
3319 /// # Example
3320 /// ```ignore,no_run
3321 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3322 /// let x = ListServiceConnectionPoliciesRequest::new().set_order_by("example");
3323 /// ```
3324 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3325 self.order_by = v.into();
3326 self
3327 }
3328}
3329
3330impl wkt::message::Message for ListServiceConnectionPoliciesRequest {
3331 fn typename() -> &'static str {
3332 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesRequest"
3333 }
3334}
3335
3336/// Response for ListServiceConnectionPolicies.
3337#[derive(Clone, Default, PartialEq)]
3338#[non_exhaustive]
3339pub struct ListServiceConnectionPoliciesResponse {
3340 /// ServiceConnectionPolicies to be returned.
3341 pub service_connection_policies: std::vec::Vec<crate::model::ServiceConnectionPolicy>,
3342
3343 /// The next pagination token in the List response. It should be used as
3344 /// page_token for the following request. An empty value means no more result.
3345 pub next_page_token: std::string::String,
3346
3347 /// Locations that could not be reached.
3348 pub unreachable: std::vec::Vec<std::string::String>,
3349
3350 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3351}
3352
3353impl ListServiceConnectionPoliciesResponse {
3354 /// Creates a new default instance.
3355 pub fn new() -> Self {
3356 std::default::Default::default()
3357 }
3358
3359 /// Sets the value of [service_connection_policies][crate::model::ListServiceConnectionPoliciesResponse::service_connection_policies].
3360 ///
3361 /// # Example
3362 /// ```ignore,no_run
3363 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesResponse;
3364 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3365 /// let x = ListServiceConnectionPoliciesResponse::new()
3366 /// .set_service_connection_policies([
3367 /// ServiceConnectionPolicy::default()/* use setters */,
3368 /// ServiceConnectionPolicy::default()/* use (different) setters */,
3369 /// ]);
3370 /// ```
3371 pub fn set_service_connection_policies<T, V>(mut self, v: T) -> Self
3372 where
3373 T: std::iter::IntoIterator<Item = V>,
3374 V: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3375 {
3376 use std::iter::Iterator;
3377 self.service_connection_policies = v.into_iter().map(|i| i.into()).collect();
3378 self
3379 }
3380
3381 /// Sets the value of [next_page_token][crate::model::ListServiceConnectionPoliciesResponse::next_page_token].
3382 ///
3383 /// # Example
3384 /// ```ignore,no_run
3385 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesResponse;
3386 /// let x = ListServiceConnectionPoliciesResponse::new().set_next_page_token("example");
3387 /// ```
3388 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3389 self.next_page_token = v.into();
3390 self
3391 }
3392
3393 /// Sets the value of [unreachable][crate::model::ListServiceConnectionPoliciesResponse::unreachable].
3394 ///
3395 /// # Example
3396 /// ```ignore,no_run
3397 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesResponse;
3398 /// let x = ListServiceConnectionPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
3399 /// ```
3400 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3401 where
3402 T: std::iter::IntoIterator<Item = V>,
3403 V: std::convert::Into<std::string::String>,
3404 {
3405 use std::iter::Iterator;
3406 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3407 self
3408 }
3409}
3410
3411impl wkt::message::Message for ListServiceConnectionPoliciesResponse {
3412 fn typename() -> &'static str {
3413 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesResponse"
3414 }
3415}
3416
3417#[doc(hidden)]
3418impl google_cloud_gax::paginator::internal::PageableResponse
3419 for ListServiceConnectionPoliciesResponse
3420{
3421 type PageItem = crate::model::ServiceConnectionPolicy;
3422
3423 fn items(self) -> std::vec::Vec<Self::PageItem> {
3424 self.service_connection_policies
3425 }
3426
3427 fn next_page_token(&self) -> std::string::String {
3428 use std::clone::Clone;
3429 self.next_page_token.clone()
3430 }
3431}
3432
3433/// Request for GetServiceConnectionPolicy.
3434#[derive(Clone, Default, PartialEq)]
3435#[non_exhaustive]
3436pub struct GetServiceConnectionPolicyRequest {
3437 /// Required. Name of the ServiceConnectionPolicy to get.
3438 pub name: std::string::String,
3439
3440 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3441}
3442
3443impl GetServiceConnectionPolicyRequest {
3444 /// Creates a new default instance.
3445 pub fn new() -> Self {
3446 std::default::Default::default()
3447 }
3448
3449 /// Sets the value of [name][crate::model::GetServiceConnectionPolicyRequest::name].
3450 ///
3451 /// # Example
3452 /// ```ignore,no_run
3453 /// # use google_cloud_networkconnectivity_v1::model::GetServiceConnectionPolicyRequest;
3454 /// # let project_id = "project_id";
3455 /// # let location_id = "location_id";
3456 /// # let service_connection_policy_id = "service_connection_policy_id";
3457 /// let x = GetServiceConnectionPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/serviceConnectionPolicies/{service_connection_policy_id}"));
3458 /// ```
3459 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3460 self.name = v.into();
3461 self
3462 }
3463}
3464
3465impl wkt::message::Message for GetServiceConnectionPolicyRequest {
3466 fn typename() -> &'static str {
3467 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionPolicyRequest"
3468 }
3469}
3470
3471/// Request for CreateServiceConnectionPolicy.
3472#[derive(Clone, Default, PartialEq)]
3473#[non_exhaustive]
3474pub struct CreateServiceConnectionPolicyRequest {
3475 /// Required. The parent resource's name of the ServiceConnectionPolicy. ex.
3476 /// projects/123/locations/us-east1
3477 pub parent: std::string::String,
3478
3479 /// Optional. Resource ID
3480 /// (i.e. 'foo' in
3481 /// '[...]/projects/p/locations/l/serviceConnectionPolicies/foo') See
3482 /// <https://google.aip.dev/122#resource-id-segments> Unique per location.
3483 pub service_connection_policy_id: std::string::String,
3484
3485 /// Required. Initial values for a new ServiceConnectionPolicies
3486 pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,
3487
3488 /// Optional. An optional request ID to identify requests. Specify a unique
3489 /// request ID so that if you must retry your request, the server will know to
3490 /// ignore the request if it has already been completed. The server will
3491 /// guarantee that for at least 60 minutes since the first request.
3492 ///
3493 /// For example, consider a situation where you make an initial request and
3494 /// the request times out. If you make the request again with the same request
3495 /// ID, the server can check if original operation with the same request ID
3496 /// was received, and if so, will ignore the second request. This prevents
3497 /// clients from accidentally creating duplicate commitments.
3498 ///
3499 /// The request ID must be a valid UUID with the exception that zero UUID is
3500 /// not supported (00000000-0000-0000-0000-000000000000).
3501 pub request_id: std::string::String,
3502
3503 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3504}
3505
3506impl CreateServiceConnectionPolicyRequest {
3507 /// Creates a new default instance.
3508 pub fn new() -> Self {
3509 std::default::Default::default()
3510 }
3511
3512 /// Sets the value of [parent][crate::model::CreateServiceConnectionPolicyRequest::parent].
3513 ///
3514 /// # Example
3515 /// ```ignore,no_run
3516 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionPolicyRequest;
3517 /// # let project_id = "project_id";
3518 /// # let location_id = "location_id";
3519 /// let x = CreateServiceConnectionPolicyRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
3520 /// ```
3521 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3522 self.parent = v.into();
3523 self
3524 }
3525
3526 /// Sets the value of [service_connection_policy_id][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy_id].
3527 ///
3528 /// # Example
3529 /// ```ignore,no_run
3530 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionPolicyRequest;
3531 /// let x = CreateServiceConnectionPolicyRequest::new().set_service_connection_policy_id("example");
3532 /// ```
3533 pub fn set_service_connection_policy_id<T: std::convert::Into<std::string::String>>(
3534 mut self,
3535 v: T,
3536 ) -> Self {
3537 self.service_connection_policy_id = v.into();
3538 self
3539 }
3540
3541 /// Sets the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
3542 ///
3543 /// # Example
3544 /// ```ignore,no_run
3545 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionPolicyRequest;
3546 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3547 /// let x = CreateServiceConnectionPolicyRequest::new().set_service_connection_policy(ServiceConnectionPolicy::default()/* use setters */);
3548 /// ```
3549 pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
3550 where
3551 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3552 {
3553 self.service_connection_policy = std::option::Option::Some(v.into());
3554 self
3555 }
3556
3557 /// Sets or clears the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
3558 ///
3559 /// # Example
3560 /// ```ignore,no_run
3561 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionPolicyRequest;
3562 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3563 /// let x = CreateServiceConnectionPolicyRequest::new().set_or_clear_service_connection_policy(Some(ServiceConnectionPolicy::default()/* use setters */));
3564 /// let x = CreateServiceConnectionPolicyRequest::new().set_or_clear_service_connection_policy(None::<ServiceConnectionPolicy>);
3565 /// ```
3566 pub fn set_or_clear_service_connection_policy<T>(mut self, v: std::option::Option<T>) -> Self
3567 where
3568 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3569 {
3570 self.service_connection_policy = v.map(|x| x.into());
3571 self
3572 }
3573
3574 /// Sets the value of [request_id][crate::model::CreateServiceConnectionPolicyRequest::request_id].
3575 ///
3576 /// # Example
3577 /// ```ignore,no_run
3578 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionPolicyRequest;
3579 /// let x = CreateServiceConnectionPolicyRequest::new().set_request_id("example");
3580 /// ```
3581 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3582 self.request_id = v.into();
3583 self
3584 }
3585}
3586
3587impl wkt::message::Message for CreateServiceConnectionPolicyRequest {
3588 fn typename() -> &'static str {
3589 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionPolicyRequest"
3590 }
3591}
3592
3593/// Request for UpdateServiceConnectionPolicy.
3594#[derive(Clone, Default, PartialEq)]
3595#[non_exhaustive]
3596pub struct UpdateServiceConnectionPolicyRequest {
3597 /// Optional. Field mask is used to specify the fields to be overwritten in the
3598 /// ServiceConnectionPolicy resource by the update.
3599 /// The fields specified in the update_mask are relative to the resource, not
3600 /// the full request. A field will be overwritten if it is in the mask. If the
3601 /// user does not provide a mask then all fields will be overwritten.
3602 pub update_mask: std::option::Option<wkt::FieldMask>,
3603
3604 /// Required. New values to be patched into the resource.
3605 pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,
3606
3607 /// Optional. An optional request ID to identify requests. Specify a unique
3608 /// request ID so that if you must retry your request, the server will know to
3609 /// ignore the request if it has already been completed. The server will
3610 /// guarantee that for at least 60 minutes since the first request.
3611 ///
3612 /// For example, consider a situation where you make an initial request and
3613 /// the request times out. If you make the request again with the same request
3614 /// ID, the server can check if original operation with the same request ID
3615 /// was received, and if so, will ignore the second request. This prevents
3616 /// clients from accidentally creating duplicate commitments.
3617 ///
3618 /// The request ID must be a valid UUID with the exception that zero UUID is
3619 /// not supported (00000000-0000-0000-0000-000000000000).
3620 pub request_id: std::string::String,
3621
3622 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3623}
3624
3625impl UpdateServiceConnectionPolicyRequest {
3626 /// Creates a new default instance.
3627 pub fn new() -> Self {
3628 std::default::Default::default()
3629 }
3630
3631 /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
3632 ///
3633 /// # Example
3634 /// ```ignore,no_run
3635 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionPolicyRequest;
3636 /// use wkt::FieldMask;
3637 /// let x = UpdateServiceConnectionPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3638 /// ```
3639 pub fn set_update_mask<T>(mut self, v: T) -> Self
3640 where
3641 T: std::convert::Into<wkt::FieldMask>,
3642 {
3643 self.update_mask = std::option::Option::Some(v.into());
3644 self
3645 }
3646
3647 /// Sets or clears the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
3648 ///
3649 /// # Example
3650 /// ```ignore,no_run
3651 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionPolicyRequest;
3652 /// use wkt::FieldMask;
3653 /// let x = UpdateServiceConnectionPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3654 /// let x = UpdateServiceConnectionPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3655 /// ```
3656 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3657 where
3658 T: std::convert::Into<wkt::FieldMask>,
3659 {
3660 self.update_mask = v.map(|x| x.into());
3661 self
3662 }
3663
3664 /// Sets the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
3665 ///
3666 /// # Example
3667 /// ```ignore,no_run
3668 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionPolicyRequest;
3669 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3670 /// let x = UpdateServiceConnectionPolicyRequest::new().set_service_connection_policy(ServiceConnectionPolicy::default()/* use setters */);
3671 /// ```
3672 pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
3673 where
3674 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3675 {
3676 self.service_connection_policy = std::option::Option::Some(v.into());
3677 self
3678 }
3679
3680 /// Sets or clears the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
3681 ///
3682 /// # Example
3683 /// ```ignore,no_run
3684 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionPolicyRequest;
3685 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3686 /// let x = UpdateServiceConnectionPolicyRequest::new().set_or_clear_service_connection_policy(Some(ServiceConnectionPolicy::default()/* use setters */));
3687 /// let x = UpdateServiceConnectionPolicyRequest::new().set_or_clear_service_connection_policy(None::<ServiceConnectionPolicy>);
3688 /// ```
3689 pub fn set_or_clear_service_connection_policy<T>(mut self, v: std::option::Option<T>) -> Self
3690 where
3691 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3692 {
3693 self.service_connection_policy = v.map(|x| x.into());
3694 self
3695 }
3696
3697 /// Sets the value of [request_id][crate::model::UpdateServiceConnectionPolicyRequest::request_id].
3698 ///
3699 /// # Example
3700 /// ```ignore,no_run
3701 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionPolicyRequest;
3702 /// let x = UpdateServiceConnectionPolicyRequest::new().set_request_id("example");
3703 /// ```
3704 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3705 self.request_id = v.into();
3706 self
3707 }
3708}
3709
3710impl wkt::message::Message for UpdateServiceConnectionPolicyRequest {
3711 fn typename() -> &'static str {
3712 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionPolicyRequest"
3713 }
3714}
3715
3716/// Request for DeleteServiceConnectionPolicy.
3717#[derive(Clone, Default, PartialEq)]
3718#[non_exhaustive]
3719pub struct DeleteServiceConnectionPolicyRequest {
3720 /// Required. The name of the ServiceConnectionPolicy to delete.
3721 pub name: std::string::String,
3722
3723 /// Optional. An optional request ID to identify requests. Specify a unique
3724 /// request ID so that if you must retry your request, the server will know to
3725 /// ignore the request if it has already been completed. The server will
3726 /// guarantee that for at least 60 minutes after the first request.
3727 ///
3728 /// For example, consider a situation where you make an initial request and
3729 /// the request times out. If you make the request again with the same request
3730 /// ID, the server can check if original operation with the same request ID
3731 /// was received, and if so, will ignore the second request. This prevents
3732 /// clients from accidentally creating duplicate commitments.
3733 ///
3734 /// The request ID must be a valid UUID with the exception that zero UUID is
3735 /// not supported (00000000-0000-0000-0000-000000000000).
3736 pub request_id: std::string::String,
3737
3738 /// Optional. The etag is computed by the server, and may be sent on update and
3739 /// delete requests to ensure the client has an up-to-date value before
3740 /// proceeding.
3741 pub etag: std::option::Option<std::string::String>,
3742
3743 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3744}
3745
3746impl DeleteServiceConnectionPolicyRequest {
3747 /// Creates a new default instance.
3748 pub fn new() -> Self {
3749 std::default::Default::default()
3750 }
3751
3752 /// Sets the value of [name][crate::model::DeleteServiceConnectionPolicyRequest::name].
3753 ///
3754 /// # Example
3755 /// ```ignore,no_run
3756 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionPolicyRequest;
3757 /// # let project_id = "project_id";
3758 /// # let location_id = "location_id";
3759 /// # let service_connection_policy_id = "service_connection_policy_id";
3760 /// let x = DeleteServiceConnectionPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/serviceConnectionPolicies/{service_connection_policy_id}"));
3761 /// ```
3762 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3763 self.name = v.into();
3764 self
3765 }
3766
3767 /// Sets the value of [request_id][crate::model::DeleteServiceConnectionPolicyRequest::request_id].
3768 ///
3769 /// # Example
3770 /// ```ignore,no_run
3771 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionPolicyRequest;
3772 /// let x = DeleteServiceConnectionPolicyRequest::new().set_request_id("example");
3773 /// ```
3774 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3775 self.request_id = v.into();
3776 self
3777 }
3778
3779 /// Sets the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
3780 ///
3781 /// # Example
3782 /// ```ignore,no_run
3783 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionPolicyRequest;
3784 /// let x = DeleteServiceConnectionPolicyRequest::new().set_etag("example");
3785 /// ```
3786 pub fn set_etag<T>(mut self, v: T) -> Self
3787 where
3788 T: std::convert::Into<std::string::String>,
3789 {
3790 self.etag = std::option::Option::Some(v.into());
3791 self
3792 }
3793
3794 /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
3795 ///
3796 /// # Example
3797 /// ```ignore,no_run
3798 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionPolicyRequest;
3799 /// let x = DeleteServiceConnectionPolicyRequest::new().set_or_clear_etag(Some("example"));
3800 /// let x = DeleteServiceConnectionPolicyRequest::new().set_or_clear_etag(None::<String>);
3801 /// ```
3802 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
3803 where
3804 T: std::convert::Into<std::string::String>,
3805 {
3806 self.etag = v.map(|x| x.into());
3807 self
3808 }
3809}
3810
3811impl wkt::message::Message for DeleteServiceConnectionPolicyRequest {
3812 fn typename() -> &'static str {
3813 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionPolicyRequest"
3814 }
3815}
3816
3817/// The ServiceClass resource.
3818#[derive(Clone, Default, PartialEq)]
3819#[non_exhaustive]
3820pub struct ServiceClass {
3821 /// Immutable. The name of a ServiceClass resource.
3822 /// Format:
3823 /// projects/{project}/locations/{location}/serviceClasses/{service_class}
3824 /// See: <https://google.aip.dev/122#fields-representing-resource-names>
3825 pub name: std::string::String,
3826
3827 /// Output only. The generated service class name. Use this name to refer to
3828 /// the Service class in Service Connection Maps and Service Connection
3829 /// Policies.
3830 pub service_class: std::string::String,
3831
3832 /// Output only. Time when the ServiceClass was created.
3833 pub create_time: std::option::Option<wkt::Timestamp>,
3834
3835 /// Output only. Time when the ServiceClass was updated.
3836 pub update_time: std::option::Option<wkt::Timestamp>,
3837
3838 /// User-defined labels.
3839 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3840
3841 /// A description of this resource.
3842 pub description: std::string::String,
3843
3844 /// Optional. The etag is computed by the server, and may be sent on update and
3845 /// delete requests to ensure the client has an up-to-date value before
3846 /// proceeding.
3847 pub etag: std::option::Option<std::string::String>,
3848
3849 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3850}
3851
3852impl ServiceClass {
3853 /// Creates a new default instance.
3854 pub fn new() -> Self {
3855 std::default::Default::default()
3856 }
3857
3858 /// Sets the value of [name][crate::model::ServiceClass::name].
3859 ///
3860 /// # Example
3861 /// ```ignore,no_run
3862 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3863 /// # let project_id = "project_id";
3864 /// # let location_id = "location_id";
3865 /// # let service_class_id = "service_class_id";
3866 /// let x = ServiceClass::new().set_name(format!("projects/{project_id}/locations/{location_id}/serviceClasses/{service_class_id}"));
3867 /// ```
3868 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3869 self.name = v.into();
3870 self
3871 }
3872
3873 /// Sets the value of [service_class][crate::model::ServiceClass::service_class].
3874 ///
3875 /// # Example
3876 /// ```ignore,no_run
3877 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3878 /// let x = ServiceClass::new().set_service_class("example");
3879 /// ```
3880 pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3881 self.service_class = v.into();
3882 self
3883 }
3884
3885 /// Sets the value of [create_time][crate::model::ServiceClass::create_time].
3886 ///
3887 /// # Example
3888 /// ```ignore,no_run
3889 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3890 /// use wkt::Timestamp;
3891 /// let x = ServiceClass::new().set_create_time(Timestamp::default()/* use setters */);
3892 /// ```
3893 pub fn set_create_time<T>(mut self, v: T) -> Self
3894 where
3895 T: std::convert::Into<wkt::Timestamp>,
3896 {
3897 self.create_time = std::option::Option::Some(v.into());
3898 self
3899 }
3900
3901 /// Sets or clears the value of [create_time][crate::model::ServiceClass::create_time].
3902 ///
3903 /// # Example
3904 /// ```ignore,no_run
3905 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3906 /// use wkt::Timestamp;
3907 /// let x = ServiceClass::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3908 /// let x = ServiceClass::new().set_or_clear_create_time(None::<Timestamp>);
3909 /// ```
3910 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3911 where
3912 T: std::convert::Into<wkt::Timestamp>,
3913 {
3914 self.create_time = v.map(|x| x.into());
3915 self
3916 }
3917
3918 /// Sets the value of [update_time][crate::model::ServiceClass::update_time].
3919 ///
3920 /// # Example
3921 /// ```ignore,no_run
3922 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3923 /// use wkt::Timestamp;
3924 /// let x = ServiceClass::new().set_update_time(Timestamp::default()/* use setters */);
3925 /// ```
3926 pub fn set_update_time<T>(mut self, v: T) -> Self
3927 where
3928 T: std::convert::Into<wkt::Timestamp>,
3929 {
3930 self.update_time = std::option::Option::Some(v.into());
3931 self
3932 }
3933
3934 /// Sets or clears the value of [update_time][crate::model::ServiceClass::update_time].
3935 ///
3936 /// # Example
3937 /// ```ignore,no_run
3938 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3939 /// use wkt::Timestamp;
3940 /// let x = ServiceClass::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3941 /// let x = ServiceClass::new().set_or_clear_update_time(None::<Timestamp>);
3942 /// ```
3943 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3944 where
3945 T: std::convert::Into<wkt::Timestamp>,
3946 {
3947 self.update_time = v.map(|x| x.into());
3948 self
3949 }
3950
3951 /// Sets the value of [labels][crate::model::ServiceClass::labels].
3952 ///
3953 /// # Example
3954 /// ```ignore,no_run
3955 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3956 /// let x = ServiceClass::new().set_labels([
3957 /// ("key0", "abc"),
3958 /// ("key1", "xyz"),
3959 /// ]);
3960 /// ```
3961 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3962 where
3963 T: std::iter::IntoIterator<Item = (K, V)>,
3964 K: std::convert::Into<std::string::String>,
3965 V: std::convert::Into<std::string::String>,
3966 {
3967 use std::iter::Iterator;
3968 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3969 self
3970 }
3971
3972 /// Sets the value of [description][crate::model::ServiceClass::description].
3973 ///
3974 /// # Example
3975 /// ```ignore,no_run
3976 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3977 /// let x = ServiceClass::new().set_description("example");
3978 /// ```
3979 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3980 self.description = v.into();
3981 self
3982 }
3983
3984 /// Sets the value of [etag][crate::model::ServiceClass::etag].
3985 ///
3986 /// # Example
3987 /// ```ignore,no_run
3988 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3989 /// let x = ServiceClass::new().set_etag("example");
3990 /// ```
3991 pub fn set_etag<T>(mut self, v: T) -> Self
3992 where
3993 T: std::convert::Into<std::string::String>,
3994 {
3995 self.etag = std::option::Option::Some(v.into());
3996 self
3997 }
3998
3999 /// Sets or clears the value of [etag][crate::model::ServiceClass::etag].
4000 ///
4001 /// # Example
4002 /// ```ignore,no_run
4003 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
4004 /// let x = ServiceClass::new().set_or_clear_etag(Some("example"));
4005 /// let x = ServiceClass::new().set_or_clear_etag(None::<String>);
4006 /// ```
4007 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
4008 where
4009 T: std::convert::Into<std::string::String>,
4010 {
4011 self.etag = v.map(|x| x.into());
4012 self
4013 }
4014}
4015
4016impl wkt::message::Message for ServiceClass {
4017 fn typename() -> &'static str {
4018 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceClass"
4019 }
4020}
4021
4022/// Request for ListServiceClasses.
4023#[derive(Clone, Default, PartialEq)]
4024#[non_exhaustive]
4025pub struct ListServiceClassesRequest {
4026 /// Required. The parent resource's name. ex. projects/123/locations/us-east1
4027 pub parent: std::string::String,
4028
4029 /// The maximum number of results per page that should be returned.
4030 pub page_size: i32,
4031
4032 /// The page token.
4033 pub page_token: std::string::String,
4034
4035 /// A filter expression that filters the results listed in the response.
4036 pub filter: std::string::String,
4037
4038 /// Sort the results by a certain order.
4039 pub order_by: std::string::String,
4040
4041 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4042}
4043
4044impl ListServiceClassesRequest {
4045 /// Creates a new default instance.
4046 pub fn new() -> Self {
4047 std::default::Default::default()
4048 }
4049
4050 /// Sets the value of [parent][crate::model::ListServiceClassesRequest::parent].
4051 ///
4052 /// # Example
4053 /// ```ignore,no_run
4054 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesRequest;
4055 /// let x = ListServiceClassesRequest::new().set_parent("example");
4056 /// ```
4057 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4058 self.parent = v.into();
4059 self
4060 }
4061
4062 /// Sets the value of [page_size][crate::model::ListServiceClassesRequest::page_size].
4063 ///
4064 /// # Example
4065 /// ```ignore,no_run
4066 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesRequest;
4067 /// let x = ListServiceClassesRequest::new().set_page_size(42);
4068 /// ```
4069 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4070 self.page_size = v.into();
4071 self
4072 }
4073
4074 /// Sets the value of [page_token][crate::model::ListServiceClassesRequest::page_token].
4075 ///
4076 /// # Example
4077 /// ```ignore,no_run
4078 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesRequest;
4079 /// let x = ListServiceClassesRequest::new().set_page_token("example");
4080 /// ```
4081 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4082 self.page_token = v.into();
4083 self
4084 }
4085
4086 /// Sets the value of [filter][crate::model::ListServiceClassesRequest::filter].
4087 ///
4088 /// # Example
4089 /// ```ignore,no_run
4090 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesRequest;
4091 /// let x = ListServiceClassesRequest::new().set_filter("example");
4092 /// ```
4093 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4094 self.filter = v.into();
4095 self
4096 }
4097
4098 /// Sets the value of [order_by][crate::model::ListServiceClassesRequest::order_by].
4099 ///
4100 /// # Example
4101 /// ```ignore,no_run
4102 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesRequest;
4103 /// let x = ListServiceClassesRequest::new().set_order_by("example");
4104 /// ```
4105 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4106 self.order_by = v.into();
4107 self
4108 }
4109}
4110
4111impl wkt::message::Message for ListServiceClassesRequest {
4112 fn typename() -> &'static str {
4113 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesRequest"
4114 }
4115}
4116
4117/// Response for ListServiceClasses.
4118#[derive(Clone, Default, PartialEq)]
4119#[non_exhaustive]
4120pub struct ListServiceClassesResponse {
4121 /// ServiceClasses to be returned.
4122 pub service_classes: std::vec::Vec<crate::model::ServiceClass>,
4123
4124 /// The next pagination token in the List response. It should be used as
4125 /// page_token for the following request. An empty value means no more result.
4126 pub next_page_token: std::string::String,
4127
4128 /// Locations that could not be reached.
4129 pub unreachable: std::vec::Vec<std::string::String>,
4130
4131 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4132}
4133
4134impl ListServiceClassesResponse {
4135 /// Creates a new default instance.
4136 pub fn new() -> Self {
4137 std::default::Default::default()
4138 }
4139
4140 /// Sets the value of [service_classes][crate::model::ListServiceClassesResponse::service_classes].
4141 ///
4142 /// # Example
4143 /// ```ignore,no_run
4144 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesResponse;
4145 /// use google_cloud_networkconnectivity_v1::model::ServiceClass;
4146 /// let x = ListServiceClassesResponse::new()
4147 /// .set_service_classes([
4148 /// ServiceClass::default()/* use setters */,
4149 /// ServiceClass::default()/* use (different) setters */,
4150 /// ]);
4151 /// ```
4152 pub fn set_service_classes<T, V>(mut self, v: T) -> Self
4153 where
4154 T: std::iter::IntoIterator<Item = V>,
4155 V: std::convert::Into<crate::model::ServiceClass>,
4156 {
4157 use std::iter::Iterator;
4158 self.service_classes = v.into_iter().map(|i| i.into()).collect();
4159 self
4160 }
4161
4162 /// Sets the value of [next_page_token][crate::model::ListServiceClassesResponse::next_page_token].
4163 ///
4164 /// # Example
4165 /// ```ignore,no_run
4166 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesResponse;
4167 /// let x = ListServiceClassesResponse::new().set_next_page_token("example");
4168 /// ```
4169 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4170 self.next_page_token = v.into();
4171 self
4172 }
4173
4174 /// Sets the value of [unreachable][crate::model::ListServiceClassesResponse::unreachable].
4175 ///
4176 /// # Example
4177 /// ```ignore,no_run
4178 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesResponse;
4179 /// let x = ListServiceClassesResponse::new().set_unreachable(["a", "b", "c"]);
4180 /// ```
4181 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4182 where
4183 T: std::iter::IntoIterator<Item = V>,
4184 V: std::convert::Into<std::string::String>,
4185 {
4186 use std::iter::Iterator;
4187 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4188 self
4189 }
4190}
4191
4192impl wkt::message::Message for ListServiceClassesResponse {
4193 fn typename() -> &'static str {
4194 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesResponse"
4195 }
4196}
4197
4198#[doc(hidden)]
4199impl google_cloud_gax::paginator::internal::PageableResponse for ListServiceClassesResponse {
4200 type PageItem = crate::model::ServiceClass;
4201
4202 fn items(self) -> std::vec::Vec<Self::PageItem> {
4203 self.service_classes
4204 }
4205
4206 fn next_page_token(&self) -> std::string::String {
4207 use std::clone::Clone;
4208 self.next_page_token.clone()
4209 }
4210}
4211
4212/// Request for GetServiceClass.
4213#[derive(Clone, Default, PartialEq)]
4214#[non_exhaustive]
4215pub struct GetServiceClassRequest {
4216 /// Required. Name of the ServiceClass to get.
4217 pub name: std::string::String,
4218
4219 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4220}
4221
4222impl GetServiceClassRequest {
4223 /// Creates a new default instance.
4224 pub fn new() -> Self {
4225 std::default::Default::default()
4226 }
4227
4228 /// Sets the value of [name][crate::model::GetServiceClassRequest::name].
4229 ///
4230 /// # Example
4231 /// ```ignore,no_run
4232 /// # use google_cloud_networkconnectivity_v1::model::GetServiceClassRequest;
4233 /// # let project_id = "project_id";
4234 /// # let location_id = "location_id";
4235 /// # let service_class_id = "service_class_id";
4236 /// let x = GetServiceClassRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/serviceClasses/{service_class_id}"));
4237 /// ```
4238 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4239 self.name = v.into();
4240 self
4241 }
4242}
4243
4244impl wkt::message::Message for GetServiceClassRequest {
4245 fn typename() -> &'static str {
4246 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceClassRequest"
4247 }
4248}
4249
4250/// Request for UpdateServiceClass.
4251#[derive(Clone, Default, PartialEq)]
4252#[non_exhaustive]
4253pub struct UpdateServiceClassRequest {
4254 /// Optional. Field mask is used to specify the fields to be overwritten in the
4255 /// ServiceClass resource by the update.
4256 /// The fields specified in the update_mask are relative to the resource, not
4257 /// the full request. A field will be overwritten if it is in the mask. If the
4258 /// user does not provide a mask then all fields will be overwritten.
4259 pub update_mask: std::option::Option<wkt::FieldMask>,
4260
4261 /// Required. New values to be patched into the resource.
4262 pub service_class: std::option::Option<crate::model::ServiceClass>,
4263
4264 /// Optional. An optional request ID to identify requests. Specify a unique
4265 /// request ID so that if you must retry your request, the server will know to
4266 /// ignore the request if it has already been completed. The server will
4267 /// guarantee that for at least 60 minutes since the first request.
4268 ///
4269 /// For example, consider a situation where you make an initial request and
4270 /// the request times out. If you make the request again with the same request
4271 /// ID, the server can check if original operation with the same request ID
4272 /// was received, and if so, will ignore the second request. This prevents
4273 /// clients from accidentally creating duplicate commitments.
4274 ///
4275 /// The request ID must be a valid UUID with the exception that zero UUID is
4276 /// not supported (00000000-0000-0000-0000-000000000000).
4277 pub request_id: std::string::String,
4278
4279 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4280}
4281
4282impl UpdateServiceClassRequest {
4283 /// Creates a new default instance.
4284 pub fn new() -> Self {
4285 std::default::Default::default()
4286 }
4287
4288 /// Sets the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
4289 ///
4290 /// # Example
4291 /// ```ignore,no_run
4292 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceClassRequest;
4293 /// use wkt::FieldMask;
4294 /// let x = UpdateServiceClassRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4295 /// ```
4296 pub fn set_update_mask<T>(mut self, v: T) -> Self
4297 where
4298 T: std::convert::Into<wkt::FieldMask>,
4299 {
4300 self.update_mask = std::option::Option::Some(v.into());
4301 self
4302 }
4303
4304 /// Sets or clears the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
4305 ///
4306 /// # Example
4307 /// ```ignore,no_run
4308 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceClassRequest;
4309 /// use wkt::FieldMask;
4310 /// let x = UpdateServiceClassRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4311 /// let x = UpdateServiceClassRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4312 /// ```
4313 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4314 where
4315 T: std::convert::Into<wkt::FieldMask>,
4316 {
4317 self.update_mask = v.map(|x| x.into());
4318 self
4319 }
4320
4321 /// Sets the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
4322 ///
4323 /// # Example
4324 /// ```ignore,no_run
4325 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceClassRequest;
4326 /// use google_cloud_networkconnectivity_v1::model::ServiceClass;
4327 /// let x = UpdateServiceClassRequest::new().set_service_class(ServiceClass::default()/* use setters */);
4328 /// ```
4329 pub fn set_service_class<T>(mut self, v: T) -> Self
4330 where
4331 T: std::convert::Into<crate::model::ServiceClass>,
4332 {
4333 self.service_class = std::option::Option::Some(v.into());
4334 self
4335 }
4336
4337 /// Sets or clears the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
4338 ///
4339 /// # Example
4340 /// ```ignore,no_run
4341 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceClassRequest;
4342 /// use google_cloud_networkconnectivity_v1::model::ServiceClass;
4343 /// let x = UpdateServiceClassRequest::new().set_or_clear_service_class(Some(ServiceClass::default()/* use setters */));
4344 /// let x = UpdateServiceClassRequest::new().set_or_clear_service_class(None::<ServiceClass>);
4345 /// ```
4346 pub fn set_or_clear_service_class<T>(mut self, v: std::option::Option<T>) -> Self
4347 where
4348 T: std::convert::Into<crate::model::ServiceClass>,
4349 {
4350 self.service_class = v.map(|x| x.into());
4351 self
4352 }
4353
4354 /// Sets the value of [request_id][crate::model::UpdateServiceClassRequest::request_id].
4355 ///
4356 /// # Example
4357 /// ```ignore,no_run
4358 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceClassRequest;
4359 /// let x = UpdateServiceClassRequest::new().set_request_id("example");
4360 /// ```
4361 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4362 self.request_id = v.into();
4363 self
4364 }
4365}
4366
4367impl wkt::message::Message for UpdateServiceClassRequest {
4368 fn typename() -> &'static str {
4369 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceClassRequest"
4370 }
4371}
4372
4373/// Request for DeleteServiceClass.
4374#[derive(Clone, Default, PartialEq)]
4375#[non_exhaustive]
4376pub struct DeleteServiceClassRequest {
4377 /// Required. The name of the ServiceClass to delete.
4378 pub name: std::string::String,
4379
4380 /// Optional. An optional request ID to identify requests. Specify a unique
4381 /// request ID so that if you must retry your request, the server will know to
4382 /// ignore the request if it has already been completed. The server will
4383 /// guarantee that for at least 60 minutes after the first request.
4384 ///
4385 /// For example, consider a situation where you make an initial request and
4386 /// the request times out. If you make the request again with the same request
4387 /// ID, the server can check if original operation with the same request ID
4388 /// was received, and if so, will ignore the second request. This prevents
4389 /// clients from accidentally creating duplicate commitments.
4390 ///
4391 /// The request ID must be a valid UUID with the exception that zero UUID is
4392 /// not supported (00000000-0000-0000-0000-000000000000).
4393 pub request_id: std::string::String,
4394
4395 /// Optional. The etag is computed by the server, and may be sent on update and
4396 /// delete requests to ensure the client has an up-to-date value before
4397 /// proceeding.
4398 pub etag: std::option::Option<std::string::String>,
4399
4400 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4401}
4402
4403impl DeleteServiceClassRequest {
4404 /// Creates a new default instance.
4405 pub fn new() -> Self {
4406 std::default::Default::default()
4407 }
4408
4409 /// Sets the value of [name][crate::model::DeleteServiceClassRequest::name].
4410 ///
4411 /// # Example
4412 /// ```ignore,no_run
4413 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceClassRequest;
4414 /// # let project_id = "project_id";
4415 /// # let location_id = "location_id";
4416 /// # let service_class_id = "service_class_id";
4417 /// let x = DeleteServiceClassRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/serviceClasses/{service_class_id}"));
4418 /// ```
4419 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4420 self.name = v.into();
4421 self
4422 }
4423
4424 /// Sets the value of [request_id][crate::model::DeleteServiceClassRequest::request_id].
4425 ///
4426 /// # Example
4427 /// ```ignore,no_run
4428 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceClassRequest;
4429 /// let x = DeleteServiceClassRequest::new().set_request_id("example");
4430 /// ```
4431 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4432 self.request_id = v.into();
4433 self
4434 }
4435
4436 /// Sets the value of [etag][crate::model::DeleteServiceClassRequest::etag].
4437 ///
4438 /// # Example
4439 /// ```ignore,no_run
4440 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceClassRequest;
4441 /// let x = DeleteServiceClassRequest::new().set_etag("example");
4442 /// ```
4443 pub fn set_etag<T>(mut self, v: T) -> Self
4444 where
4445 T: std::convert::Into<std::string::String>,
4446 {
4447 self.etag = std::option::Option::Some(v.into());
4448 self
4449 }
4450
4451 /// Sets or clears the value of [etag][crate::model::DeleteServiceClassRequest::etag].
4452 ///
4453 /// # Example
4454 /// ```ignore,no_run
4455 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceClassRequest;
4456 /// let x = DeleteServiceClassRequest::new().set_or_clear_etag(Some("example"));
4457 /// let x = DeleteServiceClassRequest::new().set_or_clear_etag(None::<String>);
4458 /// ```
4459 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
4460 where
4461 T: std::convert::Into<std::string::String>,
4462 {
4463 self.etag = v.map(|x| x.into());
4464 self
4465 }
4466}
4467
4468impl wkt::message::Message for DeleteServiceClassRequest {
4469 fn typename() -> &'static str {
4470 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceClassRequest"
4471 }
4472}
4473
4474/// The ServiceConnectionToken resource.
4475#[derive(Clone, Default, PartialEq)]
4476#[non_exhaustive]
4477pub struct ServiceConnectionToken {
4478 /// Immutable. The name of a ServiceConnectionToken.
4479 /// Format:
4480 /// projects/{project}/locations/{location}/ServiceConnectionTokens/{service_connection_token}
4481 /// See: <https://google.aip.dev/122#fields-representing-resource-names>
4482 pub name: std::string::String,
4483
4484 /// Output only. Time when the ServiceConnectionToken was created.
4485 pub create_time: std::option::Option<wkt::Timestamp>,
4486
4487 /// Output only. Time when the ServiceConnectionToken was updated.
4488 pub update_time: std::option::Option<wkt::Timestamp>,
4489
4490 /// User-defined labels.
4491 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4492
4493 /// A description of this resource.
4494 pub description: std::string::String,
4495
4496 /// The resource path of the network associated with this token.
4497 /// Example:
4498 /// projects/{projectNumOrId}/global/networks/{resourceId}.
4499 pub network: std::string::String,
4500
4501 /// Output only. The token generated by Automation.
4502 pub token: std::string::String,
4503
4504 /// Output only. The time to which this token is valid.
4505 pub expire_time: std::option::Option<wkt::Timestamp>,
4506
4507 /// Optional. The etag is computed by the server, and may be sent on update and
4508 /// delete requests to ensure the client has an up-to-date value before
4509 /// proceeding.
4510 pub etag: std::option::Option<std::string::String>,
4511
4512 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4513}
4514
4515impl ServiceConnectionToken {
4516 /// Creates a new default instance.
4517 pub fn new() -> Self {
4518 std::default::Default::default()
4519 }
4520
4521 /// Sets the value of [name][crate::model::ServiceConnectionToken::name].
4522 ///
4523 /// # Example
4524 /// ```ignore,no_run
4525 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4526 /// # let project_id = "project_id";
4527 /// # let location_id = "location_id";
4528 /// # let service_connection_token_id = "service_connection_token_id";
4529 /// let x = ServiceConnectionToken::new().set_name(format!("projects/{project_id}/locations/{location_id}/serviceConnectionTokens/{service_connection_token_id}"));
4530 /// ```
4531 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4532 self.name = v.into();
4533 self
4534 }
4535
4536 /// Sets the value of [create_time][crate::model::ServiceConnectionToken::create_time].
4537 ///
4538 /// # Example
4539 /// ```ignore,no_run
4540 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4541 /// use wkt::Timestamp;
4542 /// let x = ServiceConnectionToken::new().set_create_time(Timestamp::default()/* use setters */);
4543 /// ```
4544 pub fn set_create_time<T>(mut self, v: T) -> Self
4545 where
4546 T: std::convert::Into<wkt::Timestamp>,
4547 {
4548 self.create_time = std::option::Option::Some(v.into());
4549 self
4550 }
4551
4552 /// Sets or clears the value of [create_time][crate::model::ServiceConnectionToken::create_time].
4553 ///
4554 /// # Example
4555 /// ```ignore,no_run
4556 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4557 /// use wkt::Timestamp;
4558 /// let x = ServiceConnectionToken::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4559 /// let x = ServiceConnectionToken::new().set_or_clear_create_time(None::<Timestamp>);
4560 /// ```
4561 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4562 where
4563 T: std::convert::Into<wkt::Timestamp>,
4564 {
4565 self.create_time = v.map(|x| x.into());
4566 self
4567 }
4568
4569 /// Sets the value of [update_time][crate::model::ServiceConnectionToken::update_time].
4570 ///
4571 /// # Example
4572 /// ```ignore,no_run
4573 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4574 /// use wkt::Timestamp;
4575 /// let x = ServiceConnectionToken::new().set_update_time(Timestamp::default()/* use setters */);
4576 /// ```
4577 pub fn set_update_time<T>(mut self, v: T) -> Self
4578 where
4579 T: std::convert::Into<wkt::Timestamp>,
4580 {
4581 self.update_time = std::option::Option::Some(v.into());
4582 self
4583 }
4584
4585 /// Sets or clears the value of [update_time][crate::model::ServiceConnectionToken::update_time].
4586 ///
4587 /// # Example
4588 /// ```ignore,no_run
4589 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4590 /// use wkt::Timestamp;
4591 /// let x = ServiceConnectionToken::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
4592 /// let x = ServiceConnectionToken::new().set_or_clear_update_time(None::<Timestamp>);
4593 /// ```
4594 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4595 where
4596 T: std::convert::Into<wkt::Timestamp>,
4597 {
4598 self.update_time = v.map(|x| x.into());
4599 self
4600 }
4601
4602 /// Sets the value of [labels][crate::model::ServiceConnectionToken::labels].
4603 ///
4604 /// # Example
4605 /// ```ignore,no_run
4606 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4607 /// let x = ServiceConnectionToken::new().set_labels([
4608 /// ("key0", "abc"),
4609 /// ("key1", "xyz"),
4610 /// ]);
4611 /// ```
4612 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4613 where
4614 T: std::iter::IntoIterator<Item = (K, V)>,
4615 K: std::convert::Into<std::string::String>,
4616 V: std::convert::Into<std::string::String>,
4617 {
4618 use std::iter::Iterator;
4619 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4620 self
4621 }
4622
4623 /// Sets the value of [description][crate::model::ServiceConnectionToken::description].
4624 ///
4625 /// # Example
4626 /// ```ignore,no_run
4627 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4628 /// let x = ServiceConnectionToken::new().set_description("example");
4629 /// ```
4630 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4631 self.description = v.into();
4632 self
4633 }
4634
4635 /// Sets the value of [network][crate::model::ServiceConnectionToken::network].
4636 ///
4637 /// # Example
4638 /// ```ignore,no_run
4639 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4640 /// let x = ServiceConnectionToken::new().set_network("example");
4641 /// ```
4642 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4643 self.network = v.into();
4644 self
4645 }
4646
4647 /// Sets the value of [token][crate::model::ServiceConnectionToken::token].
4648 ///
4649 /// # Example
4650 /// ```ignore,no_run
4651 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4652 /// let x = ServiceConnectionToken::new().set_token("example");
4653 /// ```
4654 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4655 self.token = v.into();
4656 self
4657 }
4658
4659 /// Sets the value of [expire_time][crate::model::ServiceConnectionToken::expire_time].
4660 ///
4661 /// # Example
4662 /// ```ignore,no_run
4663 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4664 /// use wkt::Timestamp;
4665 /// let x = ServiceConnectionToken::new().set_expire_time(Timestamp::default()/* use setters */);
4666 /// ```
4667 pub fn set_expire_time<T>(mut self, v: T) -> Self
4668 where
4669 T: std::convert::Into<wkt::Timestamp>,
4670 {
4671 self.expire_time = std::option::Option::Some(v.into());
4672 self
4673 }
4674
4675 /// Sets or clears the value of [expire_time][crate::model::ServiceConnectionToken::expire_time].
4676 ///
4677 /// # Example
4678 /// ```ignore,no_run
4679 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4680 /// use wkt::Timestamp;
4681 /// let x = ServiceConnectionToken::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
4682 /// let x = ServiceConnectionToken::new().set_or_clear_expire_time(None::<Timestamp>);
4683 /// ```
4684 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
4685 where
4686 T: std::convert::Into<wkt::Timestamp>,
4687 {
4688 self.expire_time = v.map(|x| x.into());
4689 self
4690 }
4691
4692 /// Sets the value of [etag][crate::model::ServiceConnectionToken::etag].
4693 ///
4694 /// # Example
4695 /// ```ignore,no_run
4696 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4697 /// let x = ServiceConnectionToken::new().set_etag("example");
4698 /// ```
4699 pub fn set_etag<T>(mut self, v: T) -> Self
4700 where
4701 T: std::convert::Into<std::string::String>,
4702 {
4703 self.etag = std::option::Option::Some(v.into());
4704 self
4705 }
4706
4707 /// Sets or clears the value of [etag][crate::model::ServiceConnectionToken::etag].
4708 ///
4709 /// # Example
4710 /// ```ignore,no_run
4711 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4712 /// let x = ServiceConnectionToken::new().set_or_clear_etag(Some("example"));
4713 /// let x = ServiceConnectionToken::new().set_or_clear_etag(None::<String>);
4714 /// ```
4715 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
4716 where
4717 T: std::convert::Into<std::string::String>,
4718 {
4719 self.etag = v.map(|x| x.into());
4720 self
4721 }
4722}
4723
4724impl wkt::message::Message for ServiceConnectionToken {
4725 fn typename() -> &'static str {
4726 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionToken"
4727 }
4728}
4729
4730/// Request for ListServiceConnectionTokens.
4731#[derive(Clone, Default, PartialEq)]
4732#[non_exhaustive]
4733pub struct ListServiceConnectionTokensRequest {
4734 /// Required. The parent resource's name. ex. projects/123/locations/us-east1
4735 pub parent: std::string::String,
4736
4737 /// The maximum number of results per page that should be returned.
4738 pub page_size: i32,
4739
4740 /// The page token.
4741 pub page_token: std::string::String,
4742
4743 /// A filter expression that filters the results listed in the response.
4744 pub filter: std::string::String,
4745
4746 /// Sort the results by a certain order.
4747 pub order_by: std::string::String,
4748
4749 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4750}
4751
4752impl ListServiceConnectionTokensRequest {
4753 /// Creates a new default instance.
4754 pub fn new() -> Self {
4755 std::default::Default::default()
4756 }
4757
4758 /// Sets the value of [parent][crate::model::ListServiceConnectionTokensRequest::parent].
4759 ///
4760 /// # Example
4761 /// ```ignore,no_run
4762 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensRequest;
4763 /// let x = ListServiceConnectionTokensRequest::new().set_parent("example");
4764 /// ```
4765 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4766 self.parent = v.into();
4767 self
4768 }
4769
4770 /// Sets the value of [page_size][crate::model::ListServiceConnectionTokensRequest::page_size].
4771 ///
4772 /// # Example
4773 /// ```ignore,no_run
4774 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensRequest;
4775 /// let x = ListServiceConnectionTokensRequest::new().set_page_size(42);
4776 /// ```
4777 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4778 self.page_size = v.into();
4779 self
4780 }
4781
4782 /// Sets the value of [page_token][crate::model::ListServiceConnectionTokensRequest::page_token].
4783 ///
4784 /// # Example
4785 /// ```ignore,no_run
4786 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensRequest;
4787 /// let x = ListServiceConnectionTokensRequest::new().set_page_token("example");
4788 /// ```
4789 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4790 self.page_token = v.into();
4791 self
4792 }
4793
4794 /// Sets the value of [filter][crate::model::ListServiceConnectionTokensRequest::filter].
4795 ///
4796 /// # Example
4797 /// ```ignore,no_run
4798 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensRequest;
4799 /// let x = ListServiceConnectionTokensRequest::new().set_filter("example");
4800 /// ```
4801 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4802 self.filter = v.into();
4803 self
4804 }
4805
4806 /// Sets the value of [order_by][crate::model::ListServiceConnectionTokensRequest::order_by].
4807 ///
4808 /// # Example
4809 /// ```ignore,no_run
4810 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensRequest;
4811 /// let x = ListServiceConnectionTokensRequest::new().set_order_by("example");
4812 /// ```
4813 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4814 self.order_by = v.into();
4815 self
4816 }
4817}
4818
4819impl wkt::message::Message for ListServiceConnectionTokensRequest {
4820 fn typename() -> &'static str {
4821 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensRequest"
4822 }
4823}
4824
4825/// Response for ListServiceConnectionTokens.
4826#[derive(Clone, Default, PartialEq)]
4827#[non_exhaustive]
4828pub struct ListServiceConnectionTokensResponse {
4829 /// ServiceConnectionTokens to be returned.
4830 pub service_connection_tokens: std::vec::Vec<crate::model::ServiceConnectionToken>,
4831
4832 /// The next pagination token in the List response. It should be used as
4833 /// page_token for the following request. An empty value means no more result.
4834 pub next_page_token: std::string::String,
4835
4836 /// Locations that could not be reached.
4837 pub unreachable: std::vec::Vec<std::string::String>,
4838
4839 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4840}
4841
4842impl ListServiceConnectionTokensResponse {
4843 /// Creates a new default instance.
4844 pub fn new() -> Self {
4845 std::default::Default::default()
4846 }
4847
4848 /// Sets the value of [service_connection_tokens][crate::model::ListServiceConnectionTokensResponse::service_connection_tokens].
4849 ///
4850 /// # Example
4851 /// ```ignore,no_run
4852 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensResponse;
4853 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4854 /// let x = ListServiceConnectionTokensResponse::new()
4855 /// .set_service_connection_tokens([
4856 /// ServiceConnectionToken::default()/* use setters */,
4857 /// ServiceConnectionToken::default()/* use (different) setters */,
4858 /// ]);
4859 /// ```
4860 pub fn set_service_connection_tokens<T, V>(mut self, v: T) -> Self
4861 where
4862 T: std::iter::IntoIterator<Item = V>,
4863 V: std::convert::Into<crate::model::ServiceConnectionToken>,
4864 {
4865 use std::iter::Iterator;
4866 self.service_connection_tokens = v.into_iter().map(|i| i.into()).collect();
4867 self
4868 }
4869
4870 /// Sets the value of [next_page_token][crate::model::ListServiceConnectionTokensResponse::next_page_token].
4871 ///
4872 /// # Example
4873 /// ```ignore,no_run
4874 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensResponse;
4875 /// let x = ListServiceConnectionTokensResponse::new().set_next_page_token("example");
4876 /// ```
4877 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4878 self.next_page_token = v.into();
4879 self
4880 }
4881
4882 /// Sets the value of [unreachable][crate::model::ListServiceConnectionTokensResponse::unreachable].
4883 ///
4884 /// # Example
4885 /// ```ignore,no_run
4886 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensResponse;
4887 /// let x = ListServiceConnectionTokensResponse::new().set_unreachable(["a", "b", "c"]);
4888 /// ```
4889 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4890 where
4891 T: std::iter::IntoIterator<Item = V>,
4892 V: std::convert::Into<std::string::String>,
4893 {
4894 use std::iter::Iterator;
4895 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4896 self
4897 }
4898}
4899
4900impl wkt::message::Message for ListServiceConnectionTokensResponse {
4901 fn typename() -> &'static str {
4902 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensResponse"
4903 }
4904}
4905
4906#[doc(hidden)]
4907impl google_cloud_gax::paginator::internal::PageableResponse
4908 for ListServiceConnectionTokensResponse
4909{
4910 type PageItem = crate::model::ServiceConnectionToken;
4911
4912 fn items(self) -> std::vec::Vec<Self::PageItem> {
4913 self.service_connection_tokens
4914 }
4915
4916 fn next_page_token(&self) -> std::string::String {
4917 use std::clone::Clone;
4918 self.next_page_token.clone()
4919 }
4920}
4921
4922/// Request for GetServiceConnectionToken.
4923#[derive(Clone, Default, PartialEq)]
4924#[non_exhaustive]
4925pub struct GetServiceConnectionTokenRequest {
4926 /// Required. Name of the ServiceConnectionToken to get.
4927 pub name: std::string::String,
4928
4929 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4930}
4931
4932impl GetServiceConnectionTokenRequest {
4933 /// Creates a new default instance.
4934 pub fn new() -> Self {
4935 std::default::Default::default()
4936 }
4937
4938 /// Sets the value of [name][crate::model::GetServiceConnectionTokenRequest::name].
4939 ///
4940 /// # Example
4941 /// ```ignore,no_run
4942 /// # use google_cloud_networkconnectivity_v1::model::GetServiceConnectionTokenRequest;
4943 /// # let project_id = "project_id";
4944 /// # let location_id = "location_id";
4945 /// # let service_connection_token_id = "service_connection_token_id";
4946 /// let x = GetServiceConnectionTokenRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/serviceConnectionTokens/{service_connection_token_id}"));
4947 /// ```
4948 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4949 self.name = v.into();
4950 self
4951 }
4952}
4953
4954impl wkt::message::Message for GetServiceConnectionTokenRequest {
4955 fn typename() -> &'static str {
4956 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionTokenRequest"
4957 }
4958}
4959
4960/// Request for CreateServiceConnectionToken.
4961#[derive(Clone, Default, PartialEq)]
4962#[non_exhaustive]
4963pub struct CreateServiceConnectionTokenRequest {
4964 /// Required. The parent resource's name of the ServiceConnectionToken. ex.
4965 /// projects/123/locations/us-east1
4966 pub parent: std::string::String,
4967
4968 /// Optional. Resource ID
4969 /// (i.e. 'foo' in '[...]/projects/p/locations/l/ServiceConnectionTokens/foo')
4970 /// See <https://google.aip.dev/122#resource-id-segments>
4971 /// Unique per location.
4972 /// If one is not provided, one will be generated.
4973 pub service_connection_token_id: std::string::String,
4974
4975 /// Required. Initial values for a new ServiceConnectionTokens
4976 pub service_connection_token: std::option::Option<crate::model::ServiceConnectionToken>,
4977
4978 /// Optional. An optional request ID to identify requests. Specify a unique
4979 /// request ID so that if you must retry your request, the server will know to
4980 /// ignore the request if it has already been completed. The server will
4981 /// guarantee that for at least 60 minutes since the first request.
4982 ///
4983 /// For example, consider a situation where you make an initial request and
4984 /// the request times out. If you make the request again with the same request
4985 /// ID, the server can check if original operation with the same request ID
4986 /// was received, and if so, will ignore the second request. This prevents
4987 /// clients from accidentally creating duplicate commitments.
4988 ///
4989 /// The request ID must be a valid UUID with the exception that zero UUID is
4990 /// not supported (00000000-0000-0000-0000-000000000000).
4991 pub request_id: std::string::String,
4992
4993 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4994}
4995
4996impl CreateServiceConnectionTokenRequest {
4997 /// Creates a new default instance.
4998 pub fn new() -> Self {
4999 std::default::Default::default()
5000 }
5001
5002 /// Sets the value of [parent][crate::model::CreateServiceConnectionTokenRequest::parent].
5003 ///
5004 /// # Example
5005 /// ```ignore,no_run
5006 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
5007 /// # let project_id = "project_id";
5008 /// # let location_id = "location_id";
5009 /// let x = CreateServiceConnectionTokenRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
5010 /// ```
5011 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5012 self.parent = v.into();
5013 self
5014 }
5015
5016 /// Sets the value of [service_connection_token_id][crate::model::CreateServiceConnectionTokenRequest::service_connection_token_id].
5017 ///
5018 /// # Example
5019 /// ```ignore,no_run
5020 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
5021 /// let x = CreateServiceConnectionTokenRequest::new().set_service_connection_token_id("example");
5022 /// ```
5023 pub fn set_service_connection_token_id<T: std::convert::Into<std::string::String>>(
5024 mut self,
5025 v: T,
5026 ) -> Self {
5027 self.service_connection_token_id = v.into();
5028 self
5029 }
5030
5031 /// Sets the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
5032 ///
5033 /// # Example
5034 /// ```ignore,no_run
5035 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
5036 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
5037 /// let x = CreateServiceConnectionTokenRequest::new().set_service_connection_token(ServiceConnectionToken::default()/* use setters */);
5038 /// ```
5039 pub fn set_service_connection_token<T>(mut self, v: T) -> Self
5040 where
5041 T: std::convert::Into<crate::model::ServiceConnectionToken>,
5042 {
5043 self.service_connection_token = std::option::Option::Some(v.into());
5044 self
5045 }
5046
5047 /// Sets or clears the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
5048 ///
5049 /// # Example
5050 /// ```ignore,no_run
5051 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
5052 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
5053 /// let x = CreateServiceConnectionTokenRequest::new().set_or_clear_service_connection_token(Some(ServiceConnectionToken::default()/* use setters */));
5054 /// let x = CreateServiceConnectionTokenRequest::new().set_or_clear_service_connection_token(None::<ServiceConnectionToken>);
5055 /// ```
5056 pub fn set_or_clear_service_connection_token<T>(mut self, v: std::option::Option<T>) -> Self
5057 where
5058 T: std::convert::Into<crate::model::ServiceConnectionToken>,
5059 {
5060 self.service_connection_token = v.map(|x| x.into());
5061 self
5062 }
5063
5064 /// Sets the value of [request_id][crate::model::CreateServiceConnectionTokenRequest::request_id].
5065 ///
5066 /// # Example
5067 /// ```ignore,no_run
5068 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
5069 /// let x = CreateServiceConnectionTokenRequest::new().set_request_id("example");
5070 /// ```
5071 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5072 self.request_id = v.into();
5073 self
5074 }
5075}
5076
5077impl wkt::message::Message for CreateServiceConnectionTokenRequest {
5078 fn typename() -> &'static str {
5079 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionTokenRequest"
5080 }
5081}
5082
5083/// Request for DeleteServiceConnectionToken.
5084#[derive(Clone, Default, PartialEq)]
5085#[non_exhaustive]
5086pub struct DeleteServiceConnectionTokenRequest {
5087 /// Required. The name of the ServiceConnectionToken to delete.
5088 pub name: std::string::String,
5089
5090 /// Optional. An optional request ID to identify requests. Specify a unique
5091 /// request ID so that if you must retry your request, the server will know to
5092 /// ignore the request if it has already been completed. The server will
5093 /// guarantee that for at least 60 minutes after the first request.
5094 ///
5095 /// For example, consider a situation where you make an initial request and
5096 /// the request times out. If you make the request again with the same request
5097 /// ID, the server can check if original operation with the same request ID
5098 /// was received, and if so, will ignore the second request. This prevents
5099 /// clients from accidentally creating duplicate commitments.
5100 ///
5101 /// The request ID must be a valid UUID with the exception that zero UUID is
5102 /// not supported (00000000-0000-0000-0000-000000000000).
5103 pub request_id: std::string::String,
5104
5105 /// Optional. The etag is computed by the server, and may be sent on update and
5106 /// delete requests to ensure the client has an up-to-date value before
5107 /// proceeding.
5108 pub etag: std::option::Option<std::string::String>,
5109
5110 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5111}
5112
5113impl DeleteServiceConnectionTokenRequest {
5114 /// Creates a new default instance.
5115 pub fn new() -> Self {
5116 std::default::Default::default()
5117 }
5118
5119 /// Sets the value of [name][crate::model::DeleteServiceConnectionTokenRequest::name].
5120 ///
5121 /// # Example
5122 /// ```ignore,no_run
5123 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionTokenRequest;
5124 /// # let project_id = "project_id";
5125 /// # let location_id = "location_id";
5126 /// # let service_connection_token_id = "service_connection_token_id";
5127 /// let x = DeleteServiceConnectionTokenRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/serviceConnectionTokens/{service_connection_token_id}"));
5128 /// ```
5129 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5130 self.name = v.into();
5131 self
5132 }
5133
5134 /// Sets the value of [request_id][crate::model::DeleteServiceConnectionTokenRequest::request_id].
5135 ///
5136 /// # Example
5137 /// ```ignore,no_run
5138 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionTokenRequest;
5139 /// let x = DeleteServiceConnectionTokenRequest::new().set_request_id("example");
5140 /// ```
5141 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5142 self.request_id = v.into();
5143 self
5144 }
5145
5146 /// Sets the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
5147 ///
5148 /// # Example
5149 /// ```ignore,no_run
5150 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionTokenRequest;
5151 /// let x = DeleteServiceConnectionTokenRequest::new().set_etag("example");
5152 /// ```
5153 pub fn set_etag<T>(mut self, v: T) -> Self
5154 where
5155 T: std::convert::Into<std::string::String>,
5156 {
5157 self.etag = std::option::Option::Some(v.into());
5158 self
5159 }
5160
5161 /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
5162 ///
5163 /// # Example
5164 /// ```ignore,no_run
5165 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionTokenRequest;
5166 /// let x = DeleteServiceConnectionTokenRequest::new().set_or_clear_etag(Some("example"));
5167 /// let x = DeleteServiceConnectionTokenRequest::new().set_or_clear_etag(None::<String>);
5168 /// ```
5169 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
5170 where
5171 T: std::convert::Into<std::string::String>,
5172 {
5173 self.etag = v.map(|x| x.into());
5174 self
5175 }
5176}
5177
5178impl wkt::message::Message for DeleteServiceConnectionTokenRequest {
5179 fn typename() -> &'static str {
5180 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionTokenRequest"
5181 }
5182}
5183
5184/// The `MulticloudDataTransferConfig` resource. It lists the services that you
5185/// configure for Data Transfer Essentials billing and metering.
5186#[derive(Clone, Default, PartialEq)]
5187#[non_exhaustive]
5188pub struct MulticloudDataTransferConfig {
5189 /// Identifier. The name of the `MulticloudDataTransferConfig` resource.
5190 /// Format:
5191 /// `projects/{project}/locations/{location}/multicloudDataTransferConfigs/{multicloud_data_transfer_config}`.
5192 pub name: std::string::String,
5193
5194 /// Output only. Time when the `MulticloudDataTransferConfig` resource was
5195 /// created.
5196 pub create_time: std::option::Option<wkt::Timestamp>,
5197
5198 /// Output only. Time when the `MulticloudDataTransferConfig` resource was
5199 /// updated.
5200 pub update_time: std::option::Option<wkt::Timestamp>,
5201
5202 /// Optional. User-defined labels.
5203 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5204
5205 /// The etag is computed by the server, and might be sent with update and
5206 /// delete requests so that the client has an up-to-date value before
5207 /// proceeding.
5208 pub etag: std::string::String,
5209
5210 /// Optional. A description of this resource.
5211 pub description: std::string::String,
5212
5213 /// Output only. The number of `Destination` resources configured for the
5214 /// `MulticloudDataTransferConfig` resource.
5215 pub destinations_count: i32,
5216
5217 /// Output only. The number of `Destination` resources in use with the
5218 /// `MulticloudDataTransferConfig` resource.
5219 pub destinations_active_count: i32,
5220
5221 /// Optional. Maps services to their current or planned states. Service names
5222 /// are keys, and the associated values describe the state of the service. If a
5223 /// state change is expected, the value is either `ADDING` or `DELETING`,
5224 /// depending on the actions taken.
5225 ///
5226 /// Sample output:
5227 /// "services": {
5228 /// "big-query": {
5229 /// "states": [
5230 /// {
5231 /// "effectiveTime": "2024-12-12T08:00:00Z"
5232 /// "state": "ADDING",
5233 /// },
5234 /// ]
5235 /// },
5236 /// "cloud-storage": {
5237 /// "states": [
5238 /// {
5239 /// "state": "ACTIVE",
5240 /// }
5241 /// ]
5242 /// }
5243 /// }
5244 pub services: std::collections::HashMap<std::string::String, crate::model::StateTimeline>,
5245
5246 /// Output only. The Google-generated unique ID for the
5247 /// `MulticloudDataTransferConfig` resource. This value is unique across all
5248 /// `MulticloudDataTransferConfig` resources. If a resource is deleted and
5249 /// another with the same name is created, the new resource is assigned a
5250 /// different and unique ID.
5251 pub uid: std::string::String,
5252
5253 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5254}
5255
5256impl MulticloudDataTransferConfig {
5257 /// Creates a new default instance.
5258 pub fn new() -> Self {
5259 std::default::Default::default()
5260 }
5261
5262 /// Sets the value of [name][crate::model::MulticloudDataTransferConfig::name].
5263 ///
5264 /// # Example
5265 /// ```ignore,no_run
5266 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5267 /// # let project_id = "project_id";
5268 /// # let location_id = "location_id";
5269 /// # let multicloud_data_transfer_config_id = "multicloud_data_transfer_config_id";
5270 /// let x = MulticloudDataTransferConfig::new().set_name(format!("projects/{project_id}/locations/{location_id}/multicloudDataTransferConfigs/{multicloud_data_transfer_config_id}"));
5271 /// ```
5272 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5273 self.name = v.into();
5274 self
5275 }
5276
5277 /// Sets the value of [create_time][crate::model::MulticloudDataTransferConfig::create_time].
5278 ///
5279 /// # Example
5280 /// ```ignore,no_run
5281 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5282 /// use wkt::Timestamp;
5283 /// let x = MulticloudDataTransferConfig::new().set_create_time(Timestamp::default()/* use setters */);
5284 /// ```
5285 pub fn set_create_time<T>(mut self, v: T) -> Self
5286 where
5287 T: std::convert::Into<wkt::Timestamp>,
5288 {
5289 self.create_time = std::option::Option::Some(v.into());
5290 self
5291 }
5292
5293 /// Sets or clears the value of [create_time][crate::model::MulticloudDataTransferConfig::create_time].
5294 ///
5295 /// # Example
5296 /// ```ignore,no_run
5297 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5298 /// use wkt::Timestamp;
5299 /// let x = MulticloudDataTransferConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5300 /// let x = MulticloudDataTransferConfig::new().set_or_clear_create_time(None::<Timestamp>);
5301 /// ```
5302 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5303 where
5304 T: std::convert::Into<wkt::Timestamp>,
5305 {
5306 self.create_time = v.map(|x| x.into());
5307 self
5308 }
5309
5310 /// Sets the value of [update_time][crate::model::MulticloudDataTransferConfig::update_time].
5311 ///
5312 /// # Example
5313 /// ```ignore,no_run
5314 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5315 /// use wkt::Timestamp;
5316 /// let x = MulticloudDataTransferConfig::new().set_update_time(Timestamp::default()/* use setters */);
5317 /// ```
5318 pub fn set_update_time<T>(mut self, v: T) -> Self
5319 where
5320 T: std::convert::Into<wkt::Timestamp>,
5321 {
5322 self.update_time = std::option::Option::Some(v.into());
5323 self
5324 }
5325
5326 /// Sets or clears the value of [update_time][crate::model::MulticloudDataTransferConfig::update_time].
5327 ///
5328 /// # Example
5329 /// ```ignore,no_run
5330 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5331 /// use wkt::Timestamp;
5332 /// let x = MulticloudDataTransferConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5333 /// let x = MulticloudDataTransferConfig::new().set_or_clear_update_time(None::<Timestamp>);
5334 /// ```
5335 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5336 where
5337 T: std::convert::Into<wkt::Timestamp>,
5338 {
5339 self.update_time = v.map(|x| x.into());
5340 self
5341 }
5342
5343 /// Sets the value of [labels][crate::model::MulticloudDataTransferConfig::labels].
5344 ///
5345 /// # Example
5346 /// ```ignore,no_run
5347 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5348 /// let x = MulticloudDataTransferConfig::new().set_labels([
5349 /// ("key0", "abc"),
5350 /// ("key1", "xyz"),
5351 /// ]);
5352 /// ```
5353 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5354 where
5355 T: std::iter::IntoIterator<Item = (K, V)>,
5356 K: std::convert::Into<std::string::String>,
5357 V: std::convert::Into<std::string::String>,
5358 {
5359 use std::iter::Iterator;
5360 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5361 self
5362 }
5363
5364 /// Sets the value of [etag][crate::model::MulticloudDataTransferConfig::etag].
5365 ///
5366 /// # Example
5367 /// ```ignore,no_run
5368 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5369 /// let x = MulticloudDataTransferConfig::new().set_etag("example");
5370 /// ```
5371 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5372 self.etag = v.into();
5373 self
5374 }
5375
5376 /// Sets the value of [description][crate::model::MulticloudDataTransferConfig::description].
5377 ///
5378 /// # Example
5379 /// ```ignore,no_run
5380 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5381 /// let x = MulticloudDataTransferConfig::new().set_description("example");
5382 /// ```
5383 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5384 self.description = v.into();
5385 self
5386 }
5387
5388 /// Sets the value of [destinations_count][crate::model::MulticloudDataTransferConfig::destinations_count].
5389 ///
5390 /// # Example
5391 /// ```ignore,no_run
5392 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5393 /// let x = MulticloudDataTransferConfig::new().set_destinations_count(42);
5394 /// ```
5395 pub fn set_destinations_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5396 self.destinations_count = v.into();
5397 self
5398 }
5399
5400 /// Sets the value of [destinations_active_count][crate::model::MulticloudDataTransferConfig::destinations_active_count].
5401 ///
5402 /// # Example
5403 /// ```ignore,no_run
5404 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5405 /// let x = MulticloudDataTransferConfig::new().set_destinations_active_count(42);
5406 /// ```
5407 pub fn set_destinations_active_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5408 self.destinations_active_count = v.into();
5409 self
5410 }
5411
5412 /// Sets the value of [services][crate::model::MulticloudDataTransferConfig::services].
5413 ///
5414 /// # Example
5415 /// ```ignore,no_run
5416 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5417 /// use google_cloud_networkconnectivity_v1::model::StateTimeline;
5418 /// let x = MulticloudDataTransferConfig::new().set_services([
5419 /// ("key0", StateTimeline::default()/* use setters */),
5420 /// ("key1", StateTimeline::default()/* use (different) setters */),
5421 /// ]);
5422 /// ```
5423 pub fn set_services<T, K, V>(mut self, v: T) -> Self
5424 where
5425 T: std::iter::IntoIterator<Item = (K, V)>,
5426 K: std::convert::Into<std::string::String>,
5427 V: std::convert::Into<crate::model::StateTimeline>,
5428 {
5429 use std::iter::Iterator;
5430 self.services = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5431 self
5432 }
5433
5434 /// Sets the value of [uid][crate::model::MulticloudDataTransferConfig::uid].
5435 ///
5436 /// # Example
5437 /// ```ignore,no_run
5438 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5439 /// let x = MulticloudDataTransferConfig::new().set_uid("example");
5440 /// ```
5441 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5442 self.uid = v.into();
5443 self
5444 }
5445}
5446
5447impl wkt::message::Message for MulticloudDataTransferConfig {
5448 fn typename() -> &'static str {
5449 "type.googleapis.com/google.cloud.networkconnectivity.v1.MulticloudDataTransferConfig"
5450 }
5451}
5452
5453/// Request message to list `MulticloudDataTransferConfig` resources.
5454#[derive(Clone, Default, PartialEq)]
5455#[non_exhaustive]
5456pub struct ListMulticloudDataTransferConfigsRequest {
5457 /// Required. The name of the parent resource.
5458 pub parent: std::string::String,
5459
5460 /// Optional. The maximum number of results listed per page.
5461 pub page_size: i32,
5462
5463 /// Optional. The page token.
5464 pub page_token: std::string::String,
5465
5466 /// Optional. An expression that filters the results listed in the response.
5467 pub filter: std::string::String,
5468
5469 /// Optional. The sort order of the results.
5470 pub order_by: std::string::String,
5471
5472 /// Optional. If `true`, allows partial responses for multi-regional aggregated
5473 /// list requests.
5474 pub return_partial_success: bool,
5475
5476 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5477}
5478
5479impl ListMulticloudDataTransferConfigsRequest {
5480 /// Creates a new default instance.
5481 pub fn new() -> Self {
5482 std::default::Default::default()
5483 }
5484
5485 /// Sets the value of [parent][crate::model::ListMulticloudDataTransferConfigsRequest::parent].
5486 ///
5487 /// # Example
5488 /// ```ignore,no_run
5489 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5490 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_parent("example");
5491 /// ```
5492 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5493 self.parent = v.into();
5494 self
5495 }
5496
5497 /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferConfigsRequest::page_size].
5498 ///
5499 /// # Example
5500 /// ```ignore,no_run
5501 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5502 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_page_size(42);
5503 /// ```
5504 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5505 self.page_size = v.into();
5506 self
5507 }
5508
5509 /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferConfigsRequest::page_token].
5510 ///
5511 /// # Example
5512 /// ```ignore,no_run
5513 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5514 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_page_token("example");
5515 /// ```
5516 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5517 self.page_token = v.into();
5518 self
5519 }
5520
5521 /// Sets the value of [filter][crate::model::ListMulticloudDataTransferConfigsRequest::filter].
5522 ///
5523 /// # Example
5524 /// ```ignore,no_run
5525 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5526 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_filter("example");
5527 /// ```
5528 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5529 self.filter = v.into();
5530 self
5531 }
5532
5533 /// Sets the value of [order_by][crate::model::ListMulticloudDataTransferConfigsRequest::order_by].
5534 ///
5535 /// # Example
5536 /// ```ignore,no_run
5537 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5538 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_order_by("example");
5539 /// ```
5540 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5541 self.order_by = v.into();
5542 self
5543 }
5544
5545 /// Sets the value of [return_partial_success][crate::model::ListMulticloudDataTransferConfigsRequest::return_partial_success].
5546 ///
5547 /// # Example
5548 /// ```ignore,no_run
5549 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5550 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_return_partial_success(true);
5551 /// ```
5552 pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5553 self.return_partial_success = v.into();
5554 self
5555 }
5556}
5557
5558impl wkt::message::Message for ListMulticloudDataTransferConfigsRequest {
5559 fn typename() -> &'static str {
5560 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferConfigsRequest"
5561 }
5562}
5563
5564/// Response message to list `MulticloudDataTransferConfig` resources.
5565#[derive(Clone, Default, PartialEq)]
5566#[non_exhaustive]
5567pub struct ListMulticloudDataTransferConfigsResponse {
5568 /// The list of `MulticloudDataTransferConfig` resources to be listed.
5569 pub multicloud_data_transfer_configs: std::vec::Vec<crate::model::MulticloudDataTransferConfig>,
5570
5571 /// The next page token.
5572 pub next_page_token: std::string::String,
5573
5574 /// Locations that could not be reached.
5575 pub unreachable: std::vec::Vec<std::string::String>,
5576
5577 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5578}
5579
5580impl ListMulticloudDataTransferConfigsResponse {
5581 /// Creates a new default instance.
5582 pub fn new() -> Self {
5583 std::default::Default::default()
5584 }
5585
5586 /// Sets the value of [multicloud_data_transfer_configs][crate::model::ListMulticloudDataTransferConfigsResponse::multicloud_data_transfer_configs].
5587 ///
5588 /// # Example
5589 /// ```ignore,no_run
5590 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsResponse;
5591 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5592 /// let x = ListMulticloudDataTransferConfigsResponse::new()
5593 /// .set_multicloud_data_transfer_configs([
5594 /// MulticloudDataTransferConfig::default()/* use setters */,
5595 /// MulticloudDataTransferConfig::default()/* use (different) setters */,
5596 /// ]);
5597 /// ```
5598 pub fn set_multicloud_data_transfer_configs<T, V>(mut self, v: T) -> Self
5599 where
5600 T: std::iter::IntoIterator<Item = V>,
5601 V: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5602 {
5603 use std::iter::Iterator;
5604 self.multicloud_data_transfer_configs = v.into_iter().map(|i| i.into()).collect();
5605 self
5606 }
5607
5608 /// Sets the value of [next_page_token][crate::model::ListMulticloudDataTransferConfigsResponse::next_page_token].
5609 ///
5610 /// # Example
5611 /// ```ignore,no_run
5612 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsResponse;
5613 /// let x = ListMulticloudDataTransferConfigsResponse::new().set_next_page_token("example");
5614 /// ```
5615 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5616 self.next_page_token = v.into();
5617 self
5618 }
5619
5620 /// Sets the value of [unreachable][crate::model::ListMulticloudDataTransferConfigsResponse::unreachable].
5621 ///
5622 /// # Example
5623 /// ```ignore,no_run
5624 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsResponse;
5625 /// let x = ListMulticloudDataTransferConfigsResponse::new().set_unreachable(["a", "b", "c"]);
5626 /// ```
5627 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5628 where
5629 T: std::iter::IntoIterator<Item = V>,
5630 V: std::convert::Into<std::string::String>,
5631 {
5632 use std::iter::Iterator;
5633 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5634 self
5635 }
5636}
5637
5638impl wkt::message::Message for ListMulticloudDataTransferConfigsResponse {
5639 fn typename() -> &'static str {
5640 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferConfigsResponse"
5641 }
5642}
5643
5644#[doc(hidden)]
5645impl google_cloud_gax::paginator::internal::PageableResponse
5646 for ListMulticloudDataTransferConfigsResponse
5647{
5648 type PageItem = crate::model::MulticloudDataTransferConfig;
5649
5650 fn items(self) -> std::vec::Vec<Self::PageItem> {
5651 self.multicloud_data_transfer_configs
5652 }
5653
5654 fn next_page_token(&self) -> std::string::String {
5655 use std::clone::Clone;
5656 self.next_page_token.clone()
5657 }
5658}
5659
5660/// Request message to get the details of a `MulticloudDataTransferConfig`
5661/// resource.
5662#[derive(Clone, Default, PartialEq)]
5663#[non_exhaustive]
5664pub struct GetMulticloudDataTransferConfigRequest {
5665 /// Required. The name of the `MulticloudDataTransferConfig` resource to get.
5666 pub name: std::string::String,
5667
5668 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5669}
5670
5671impl GetMulticloudDataTransferConfigRequest {
5672 /// Creates a new default instance.
5673 pub fn new() -> Self {
5674 std::default::Default::default()
5675 }
5676
5677 /// Sets the value of [name][crate::model::GetMulticloudDataTransferConfigRequest::name].
5678 ///
5679 /// # Example
5680 /// ```ignore,no_run
5681 /// # use google_cloud_networkconnectivity_v1::model::GetMulticloudDataTransferConfigRequest;
5682 /// # let project_id = "project_id";
5683 /// # let location_id = "location_id";
5684 /// # let multicloud_data_transfer_config_id = "multicloud_data_transfer_config_id";
5685 /// let x = GetMulticloudDataTransferConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/multicloudDataTransferConfigs/{multicloud_data_transfer_config_id}"));
5686 /// ```
5687 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5688 self.name = v.into();
5689 self
5690 }
5691}
5692
5693impl wkt::message::Message for GetMulticloudDataTransferConfigRequest {
5694 fn typename() -> &'static str {
5695 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetMulticloudDataTransferConfigRequest"
5696 }
5697}
5698
5699/// Request message to create a `MulticloudDataTransferConfig` resource.
5700#[derive(Clone, Default, PartialEq)]
5701#[non_exhaustive]
5702pub struct CreateMulticloudDataTransferConfigRequest {
5703 /// Required. The name of the parent resource.
5704 pub parent: std::string::String,
5705
5706 /// Required. The ID to use for the `MulticloudDataTransferConfig` resource,
5707 /// which becomes the final component of the `MulticloudDataTransferConfig`
5708 /// resource name.
5709 pub multicloud_data_transfer_config_id: std::string::String,
5710
5711 /// Required. The `MulticloudDataTransferConfig` resource to create.
5712 pub multicloud_data_transfer_config:
5713 std::option::Option<crate::model::MulticloudDataTransferConfig>,
5714
5715 /// Optional. A request ID to identify requests. Specify a unique request ID
5716 /// so that if you must retry your request, the server can ignore
5717 /// the request if it has already been completed. The server waits
5718 /// for at least 60 minutes since the first request.
5719 ///
5720 /// For example, consider a situation where you make an initial request and
5721 /// the request times out. If you make the request again with the same request
5722 /// ID, the server can check if original operation with the same request ID
5723 /// was received, and if so, can ignore the second request. This prevents
5724 /// clients from accidentally creating duplicate `MulticloudDataTransferConfig`
5725 /// resources.
5726 ///
5727 /// The request ID must be a valid UUID with the exception that zero UUID
5728 /// (00000000-0000-0000-0000-000000000000) isn't supported.
5729 pub request_id: std::string::String,
5730
5731 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5732}
5733
5734impl CreateMulticloudDataTransferConfigRequest {
5735 /// Creates a new default instance.
5736 pub fn new() -> Self {
5737 std::default::Default::default()
5738 }
5739
5740 /// Sets the value of [parent][crate::model::CreateMulticloudDataTransferConfigRequest::parent].
5741 ///
5742 /// # Example
5743 /// ```ignore,no_run
5744 /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5745 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_parent("example");
5746 /// ```
5747 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5748 self.parent = v.into();
5749 self
5750 }
5751
5752 /// Sets the value of [multicloud_data_transfer_config_id][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config_id].
5753 ///
5754 /// # Example
5755 /// ```ignore,no_run
5756 /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5757 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_multicloud_data_transfer_config_id("example");
5758 /// ```
5759 pub fn set_multicloud_data_transfer_config_id<T: std::convert::Into<std::string::String>>(
5760 mut self,
5761 v: T,
5762 ) -> Self {
5763 self.multicloud_data_transfer_config_id = v.into();
5764 self
5765 }
5766
5767 /// Sets the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
5768 ///
5769 /// # Example
5770 /// ```ignore,no_run
5771 /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5772 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5773 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_multicloud_data_transfer_config(MulticloudDataTransferConfig::default()/* use setters */);
5774 /// ```
5775 pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
5776 where
5777 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5778 {
5779 self.multicloud_data_transfer_config = std::option::Option::Some(v.into());
5780 self
5781 }
5782
5783 /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
5784 ///
5785 /// # Example
5786 /// ```ignore,no_run
5787 /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5788 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5789 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_or_clear_multicloud_data_transfer_config(Some(MulticloudDataTransferConfig::default()/* use setters */));
5790 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_or_clear_multicloud_data_transfer_config(None::<MulticloudDataTransferConfig>);
5791 /// ```
5792 pub fn set_or_clear_multicloud_data_transfer_config<T>(
5793 mut self,
5794 v: std::option::Option<T>,
5795 ) -> Self
5796 where
5797 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5798 {
5799 self.multicloud_data_transfer_config = v.map(|x| x.into());
5800 self
5801 }
5802
5803 /// Sets the value of [request_id][crate::model::CreateMulticloudDataTransferConfigRequest::request_id].
5804 ///
5805 /// # Example
5806 /// ```ignore,no_run
5807 /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5808 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_request_id("example");
5809 /// ```
5810 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5811 self.request_id = v.into();
5812 self
5813 }
5814}
5815
5816impl wkt::message::Message for CreateMulticloudDataTransferConfigRequest {
5817 fn typename() -> &'static str {
5818 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateMulticloudDataTransferConfigRequest"
5819 }
5820}
5821
5822/// Request message to update a `MulticloudDataTransferConfig` resource.
5823#[derive(Clone, Default, PartialEq)]
5824#[non_exhaustive]
5825pub struct UpdateMulticloudDataTransferConfigRequest {
5826 /// Optional. `FieldMask` is used to specify the fields in the
5827 /// `MulticloudDataTransferConfig` resource to be overwritten by the update.
5828 /// The fields specified in `update_mask` are relative to the resource, not
5829 /// the full request. A field is overwritten if it is in the mask. If you
5830 /// don't specify a mask, all fields are overwritten.
5831 pub update_mask: std::option::Option<wkt::FieldMask>,
5832
5833 /// Required. The `MulticloudDataTransferConfig` resource to update.
5834 pub multicloud_data_transfer_config:
5835 std::option::Option<crate::model::MulticloudDataTransferConfig>,
5836
5837 /// Optional. A request ID to identify requests. Specify a unique request ID
5838 /// so that if you must retry your request, the server can ignore
5839 /// the request if it has already been completed. The server waits
5840 /// for at least 60 minutes since the first request.
5841 ///
5842 /// For example, consider a situation where you make an initial request and
5843 /// the request times out. If you make the request again with the same request
5844 /// ID, the server can check if original operation with the same request ID
5845 /// was received, and if so, can ignore the second request. This prevents
5846 /// clients from accidentally creating duplicate `MulticloudDataTransferConfig`
5847 /// resources.
5848 ///
5849 /// The request ID must be a valid UUID with the exception that zero UUID
5850 /// (00000000-0000-0000-0000-000000000000) isn't supported.
5851 pub request_id: std::string::String,
5852
5853 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5854}
5855
5856impl UpdateMulticloudDataTransferConfigRequest {
5857 /// Creates a new default instance.
5858 pub fn new() -> Self {
5859 std::default::Default::default()
5860 }
5861
5862 /// Sets the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
5863 ///
5864 /// # Example
5865 /// ```ignore,no_run
5866 /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5867 /// use wkt::FieldMask;
5868 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5869 /// ```
5870 pub fn set_update_mask<T>(mut self, v: T) -> Self
5871 where
5872 T: std::convert::Into<wkt::FieldMask>,
5873 {
5874 self.update_mask = std::option::Option::Some(v.into());
5875 self
5876 }
5877
5878 /// Sets or clears the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
5879 ///
5880 /// # Example
5881 /// ```ignore,no_run
5882 /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5883 /// use wkt::FieldMask;
5884 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5885 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5886 /// ```
5887 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5888 where
5889 T: std::convert::Into<wkt::FieldMask>,
5890 {
5891 self.update_mask = v.map(|x| x.into());
5892 self
5893 }
5894
5895 /// Sets the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
5896 ///
5897 /// # Example
5898 /// ```ignore,no_run
5899 /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5900 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5901 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_multicloud_data_transfer_config(MulticloudDataTransferConfig::default()/* use setters */);
5902 /// ```
5903 pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
5904 where
5905 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5906 {
5907 self.multicloud_data_transfer_config = std::option::Option::Some(v.into());
5908 self
5909 }
5910
5911 /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
5912 ///
5913 /// # Example
5914 /// ```ignore,no_run
5915 /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5916 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5917 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_or_clear_multicloud_data_transfer_config(Some(MulticloudDataTransferConfig::default()/* use setters */));
5918 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_or_clear_multicloud_data_transfer_config(None::<MulticloudDataTransferConfig>);
5919 /// ```
5920 pub fn set_or_clear_multicloud_data_transfer_config<T>(
5921 mut self,
5922 v: std::option::Option<T>,
5923 ) -> Self
5924 where
5925 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5926 {
5927 self.multicloud_data_transfer_config = v.map(|x| x.into());
5928 self
5929 }
5930
5931 /// Sets the value of [request_id][crate::model::UpdateMulticloudDataTransferConfigRequest::request_id].
5932 ///
5933 /// # Example
5934 /// ```ignore,no_run
5935 /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5936 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_request_id("example");
5937 /// ```
5938 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5939 self.request_id = v.into();
5940 self
5941 }
5942}
5943
5944impl wkt::message::Message for UpdateMulticloudDataTransferConfigRequest {
5945 fn typename() -> &'static str {
5946 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateMulticloudDataTransferConfigRequest"
5947 }
5948}
5949
5950/// Request message to delete a `MulticloudDataTransferConfig` resource.
5951#[derive(Clone, Default, PartialEq)]
5952#[non_exhaustive]
5953pub struct DeleteMulticloudDataTransferConfigRequest {
5954 /// Required. The name of the `MulticloudDataTransferConfig` resource to
5955 /// delete.
5956 pub name: std::string::String,
5957
5958 /// Optional. A request ID to identify requests. Specify a unique request ID
5959 /// so that if you must retry your request, the server can ignore
5960 /// the request if it has already been completed. The server waits
5961 /// for at least 60 minutes since the first request.
5962 ///
5963 /// For example, consider a situation where you make an initial request and
5964 /// the request times out. If you make the request again with the same request
5965 /// ID, the server can check if original operation with the same request ID
5966 /// was received, and if so, can ignore the second request. This prevents
5967 /// clients from accidentally creating duplicate `MulticloudDataTransferConfig`
5968 /// resources.
5969 ///
5970 /// The request ID must be a valid UUID with the exception that zero UUID
5971 /// (00000000-0000-0000-0000-000000000000) isn't supported.
5972 pub request_id: std::string::String,
5973
5974 /// Optional. The etag is computed by the server, and might be sent with update
5975 /// and delete requests so that the client has an up-to-date value before
5976 /// proceeding.
5977 pub etag: std::string::String,
5978
5979 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5980}
5981
5982impl DeleteMulticloudDataTransferConfigRequest {
5983 /// Creates a new default instance.
5984 pub fn new() -> Self {
5985 std::default::Default::default()
5986 }
5987
5988 /// Sets the value of [name][crate::model::DeleteMulticloudDataTransferConfigRequest::name].
5989 ///
5990 /// # Example
5991 /// ```ignore,no_run
5992 /// # use google_cloud_networkconnectivity_v1::model::DeleteMulticloudDataTransferConfigRequest;
5993 /// # let project_id = "project_id";
5994 /// # let location_id = "location_id";
5995 /// # let multicloud_data_transfer_config_id = "multicloud_data_transfer_config_id";
5996 /// let x = DeleteMulticloudDataTransferConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/multicloudDataTransferConfigs/{multicloud_data_transfer_config_id}"));
5997 /// ```
5998 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5999 self.name = v.into();
6000 self
6001 }
6002
6003 /// Sets the value of [request_id][crate::model::DeleteMulticloudDataTransferConfigRequest::request_id].
6004 ///
6005 /// # Example
6006 /// ```ignore,no_run
6007 /// # use google_cloud_networkconnectivity_v1::model::DeleteMulticloudDataTransferConfigRequest;
6008 /// let x = DeleteMulticloudDataTransferConfigRequest::new().set_request_id("example");
6009 /// ```
6010 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6011 self.request_id = v.into();
6012 self
6013 }
6014
6015 /// Sets the value of [etag][crate::model::DeleteMulticloudDataTransferConfigRequest::etag].
6016 ///
6017 /// # Example
6018 /// ```ignore,no_run
6019 /// # use google_cloud_networkconnectivity_v1::model::DeleteMulticloudDataTransferConfigRequest;
6020 /// let x = DeleteMulticloudDataTransferConfigRequest::new().set_etag("example");
6021 /// ```
6022 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6023 self.etag = v.into();
6024 self
6025 }
6026}
6027
6028impl wkt::message::Message for DeleteMulticloudDataTransferConfigRequest {
6029 fn typename() -> &'static str {
6030 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteMulticloudDataTransferConfigRequest"
6031 }
6032}
6033
6034/// The `Destination` resource. It specifies the IP prefix and the associated
6035/// autonomous system numbers (ASN) that you want to include in a
6036/// `MulticloudDataTransferConfig` resource.
6037#[derive(Clone, Default, PartialEq)]
6038#[non_exhaustive]
6039pub struct Destination {
6040 /// Identifier. The name of the `Destination` resource.
6041 /// Format:
6042 /// `projects/{project}/locations/{location}/multicloudDataTransferConfigs/{multicloud_data_transfer_config}/destinations/{destination}`.
6043 pub name: std::string::String,
6044
6045 /// Output only. Time when the `Destination` resource was created.
6046 pub create_time: std::option::Option<wkt::Timestamp>,
6047
6048 /// Output only. Time when the `Destination` resource was updated.
6049 pub update_time: std::option::Option<wkt::Timestamp>,
6050
6051 /// Optional. User-defined labels.
6052 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6053
6054 /// The etag is computed by the server, and might be sent with update and
6055 /// delete requests so that the client has an up-to-date value before
6056 /// proceeding.
6057 pub etag: std::string::String,
6058
6059 /// Optional. A description of this resource.
6060 pub description: std::string::String,
6061
6062 /// Required. Immutable. The IP prefix that represents your workload on another
6063 /// CSP.
6064 pub ip_prefix: std::string::String,
6065
6066 /// Required. Unordered list. The list of `DestinationEndpoint` resources
6067 /// configured for the IP prefix.
6068 pub endpoints: std::vec::Vec<crate::model::destination::DestinationEndpoint>,
6069
6070 /// Output only. The timeline of the expected `Destination` states or the
6071 /// current rest state. If a state change is expected, the value is `ADDING`,
6072 /// `DELETING` or `SUSPENDING`, depending on the action specified.
6073 ///
6074 /// Example:
6075 /// "state_timeline": {
6076 /// "states": [
6077 /// {
6078 /// // The time when the `Destination` resource will be activated.
6079 /// "effectiveTime": "2024-12-01T08:00:00Z",
6080 /// "state": "ADDING"
6081 /// },
6082 /// {
6083 /// // The time when the `Destination` resource will be suspended.
6084 /// "effectiveTime": "2024-12-01T20:00:00Z",
6085 /// "state": "SUSPENDING"
6086 /// }
6087 /// ]
6088 /// }
6089 pub state_timeline: std::option::Option<crate::model::StateTimeline>,
6090
6091 /// Output only. The Google-generated unique ID for the `Destination` resource.
6092 /// This value is unique across all `Destination` resources.
6093 /// If a resource is deleted and another with the same name is
6094 /// created, the new resource is assigned a different and unique ID.
6095 pub uid: std::string::String,
6096
6097 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6098}
6099
6100impl Destination {
6101 /// Creates a new default instance.
6102 pub fn new() -> Self {
6103 std::default::Default::default()
6104 }
6105
6106 /// Sets the value of [name][crate::model::Destination::name].
6107 ///
6108 /// # Example
6109 /// ```ignore,no_run
6110 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6111 /// # let project_id = "project_id";
6112 /// # let location_id = "location_id";
6113 /// # let multicloud_data_transfer_config_id = "multicloud_data_transfer_config_id";
6114 /// # let destination_id = "destination_id";
6115 /// let x = Destination::new().set_name(format!("projects/{project_id}/locations/{location_id}/multicloudDataTransferConfigs/{multicloud_data_transfer_config_id}/destinations/{destination_id}"));
6116 /// ```
6117 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6118 self.name = v.into();
6119 self
6120 }
6121
6122 /// Sets the value of [create_time][crate::model::Destination::create_time].
6123 ///
6124 /// # Example
6125 /// ```ignore,no_run
6126 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6127 /// use wkt::Timestamp;
6128 /// let x = Destination::new().set_create_time(Timestamp::default()/* use setters */);
6129 /// ```
6130 pub fn set_create_time<T>(mut self, v: T) -> Self
6131 where
6132 T: std::convert::Into<wkt::Timestamp>,
6133 {
6134 self.create_time = std::option::Option::Some(v.into());
6135 self
6136 }
6137
6138 /// Sets or clears the value of [create_time][crate::model::Destination::create_time].
6139 ///
6140 /// # Example
6141 /// ```ignore,no_run
6142 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6143 /// use wkt::Timestamp;
6144 /// let x = Destination::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6145 /// let x = Destination::new().set_or_clear_create_time(None::<Timestamp>);
6146 /// ```
6147 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6148 where
6149 T: std::convert::Into<wkt::Timestamp>,
6150 {
6151 self.create_time = v.map(|x| x.into());
6152 self
6153 }
6154
6155 /// Sets the value of [update_time][crate::model::Destination::update_time].
6156 ///
6157 /// # Example
6158 /// ```ignore,no_run
6159 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6160 /// use wkt::Timestamp;
6161 /// let x = Destination::new().set_update_time(Timestamp::default()/* use setters */);
6162 /// ```
6163 pub fn set_update_time<T>(mut self, v: T) -> Self
6164 where
6165 T: std::convert::Into<wkt::Timestamp>,
6166 {
6167 self.update_time = std::option::Option::Some(v.into());
6168 self
6169 }
6170
6171 /// Sets or clears the value of [update_time][crate::model::Destination::update_time].
6172 ///
6173 /// # Example
6174 /// ```ignore,no_run
6175 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6176 /// use wkt::Timestamp;
6177 /// let x = Destination::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6178 /// let x = Destination::new().set_or_clear_update_time(None::<Timestamp>);
6179 /// ```
6180 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6181 where
6182 T: std::convert::Into<wkt::Timestamp>,
6183 {
6184 self.update_time = v.map(|x| x.into());
6185 self
6186 }
6187
6188 /// Sets the value of [labels][crate::model::Destination::labels].
6189 ///
6190 /// # Example
6191 /// ```ignore,no_run
6192 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6193 /// let x = Destination::new().set_labels([
6194 /// ("key0", "abc"),
6195 /// ("key1", "xyz"),
6196 /// ]);
6197 /// ```
6198 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6199 where
6200 T: std::iter::IntoIterator<Item = (K, V)>,
6201 K: std::convert::Into<std::string::String>,
6202 V: std::convert::Into<std::string::String>,
6203 {
6204 use std::iter::Iterator;
6205 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6206 self
6207 }
6208
6209 /// Sets the value of [etag][crate::model::Destination::etag].
6210 ///
6211 /// # Example
6212 /// ```ignore,no_run
6213 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6214 /// let x = Destination::new().set_etag("example");
6215 /// ```
6216 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6217 self.etag = v.into();
6218 self
6219 }
6220
6221 /// Sets the value of [description][crate::model::Destination::description].
6222 ///
6223 /// # Example
6224 /// ```ignore,no_run
6225 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6226 /// let x = Destination::new().set_description("example");
6227 /// ```
6228 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6229 self.description = v.into();
6230 self
6231 }
6232
6233 /// Sets the value of [ip_prefix][crate::model::Destination::ip_prefix].
6234 ///
6235 /// # Example
6236 /// ```ignore,no_run
6237 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6238 /// let x = Destination::new().set_ip_prefix("example");
6239 /// ```
6240 pub fn set_ip_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6241 self.ip_prefix = v.into();
6242 self
6243 }
6244
6245 /// Sets the value of [endpoints][crate::model::Destination::endpoints].
6246 ///
6247 /// # Example
6248 /// ```ignore,no_run
6249 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6250 /// use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6251 /// let x = Destination::new()
6252 /// .set_endpoints([
6253 /// DestinationEndpoint::default()/* use setters */,
6254 /// DestinationEndpoint::default()/* use (different) setters */,
6255 /// ]);
6256 /// ```
6257 pub fn set_endpoints<T, V>(mut self, v: T) -> Self
6258 where
6259 T: std::iter::IntoIterator<Item = V>,
6260 V: std::convert::Into<crate::model::destination::DestinationEndpoint>,
6261 {
6262 use std::iter::Iterator;
6263 self.endpoints = v.into_iter().map(|i| i.into()).collect();
6264 self
6265 }
6266
6267 /// Sets the value of [state_timeline][crate::model::Destination::state_timeline].
6268 ///
6269 /// # Example
6270 /// ```ignore,no_run
6271 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6272 /// use google_cloud_networkconnectivity_v1::model::StateTimeline;
6273 /// let x = Destination::new().set_state_timeline(StateTimeline::default()/* use setters */);
6274 /// ```
6275 pub fn set_state_timeline<T>(mut self, v: T) -> Self
6276 where
6277 T: std::convert::Into<crate::model::StateTimeline>,
6278 {
6279 self.state_timeline = std::option::Option::Some(v.into());
6280 self
6281 }
6282
6283 /// Sets or clears the value of [state_timeline][crate::model::Destination::state_timeline].
6284 ///
6285 /// # Example
6286 /// ```ignore,no_run
6287 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6288 /// use google_cloud_networkconnectivity_v1::model::StateTimeline;
6289 /// let x = Destination::new().set_or_clear_state_timeline(Some(StateTimeline::default()/* use setters */));
6290 /// let x = Destination::new().set_or_clear_state_timeline(None::<StateTimeline>);
6291 /// ```
6292 pub fn set_or_clear_state_timeline<T>(mut self, v: std::option::Option<T>) -> Self
6293 where
6294 T: std::convert::Into<crate::model::StateTimeline>,
6295 {
6296 self.state_timeline = v.map(|x| x.into());
6297 self
6298 }
6299
6300 /// Sets the value of [uid][crate::model::Destination::uid].
6301 ///
6302 /// # Example
6303 /// ```ignore,no_run
6304 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6305 /// let x = Destination::new().set_uid("example");
6306 /// ```
6307 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6308 self.uid = v.into();
6309 self
6310 }
6311}
6312
6313impl wkt::message::Message for Destination {
6314 fn typename() -> &'static str {
6315 "type.googleapis.com/google.cloud.networkconnectivity.v1.Destination"
6316 }
6317}
6318
6319/// Defines additional types related to [Destination].
6320pub mod destination {
6321 #[allow(unused_imports)]
6322 use super::*;
6323
6324 /// The metadata for a `DestinationEndpoint` resource.
6325 #[derive(Clone, Default, PartialEq)]
6326 #[non_exhaustive]
6327 pub struct DestinationEndpoint {
6328 /// Required. The ASN of the remote IP prefix.
6329 pub asn: i64,
6330
6331 /// Required. The CSP of the remote IP prefix.
6332 pub csp: std::string::String,
6333
6334 /// Output only. The state of the `DestinationEndpoint` resource.
6335 pub state: crate::model::destination::destination_endpoint::State,
6336
6337 /// Output only. Time when the `DestinationEndpoint` resource was updated.
6338 pub update_time: std::option::Option<wkt::Timestamp>,
6339
6340 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6341 }
6342
6343 impl DestinationEndpoint {
6344 /// Creates a new default instance.
6345 pub fn new() -> Self {
6346 std::default::Default::default()
6347 }
6348
6349 /// Sets the value of [asn][crate::model::destination::DestinationEndpoint::asn].
6350 ///
6351 /// # Example
6352 /// ```ignore,no_run
6353 /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6354 /// let x = DestinationEndpoint::new().set_asn(42);
6355 /// ```
6356 pub fn set_asn<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6357 self.asn = v.into();
6358 self
6359 }
6360
6361 /// Sets the value of [csp][crate::model::destination::DestinationEndpoint::csp].
6362 ///
6363 /// # Example
6364 /// ```ignore,no_run
6365 /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6366 /// let x = DestinationEndpoint::new().set_csp("example");
6367 /// ```
6368 pub fn set_csp<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6369 self.csp = v.into();
6370 self
6371 }
6372
6373 /// Sets the value of [state][crate::model::destination::DestinationEndpoint::state].
6374 ///
6375 /// # Example
6376 /// ```ignore,no_run
6377 /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6378 /// use google_cloud_networkconnectivity_v1::model::destination::destination_endpoint::State;
6379 /// let x0 = DestinationEndpoint::new().set_state(State::Valid);
6380 /// let x1 = DestinationEndpoint::new().set_state(State::Invalid);
6381 /// ```
6382 pub fn set_state<
6383 T: std::convert::Into<crate::model::destination::destination_endpoint::State>,
6384 >(
6385 mut self,
6386 v: T,
6387 ) -> Self {
6388 self.state = v.into();
6389 self
6390 }
6391
6392 /// Sets the value of [update_time][crate::model::destination::DestinationEndpoint::update_time].
6393 ///
6394 /// # Example
6395 /// ```ignore,no_run
6396 /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6397 /// use wkt::Timestamp;
6398 /// let x = DestinationEndpoint::new().set_update_time(Timestamp::default()/* use setters */);
6399 /// ```
6400 pub fn set_update_time<T>(mut self, v: T) -> Self
6401 where
6402 T: std::convert::Into<wkt::Timestamp>,
6403 {
6404 self.update_time = std::option::Option::Some(v.into());
6405 self
6406 }
6407
6408 /// Sets or clears the value of [update_time][crate::model::destination::DestinationEndpoint::update_time].
6409 ///
6410 /// # Example
6411 /// ```ignore,no_run
6412 /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6413 /// use wkt::Timestamp;
6414 /// let x = DestinationEndpoint::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6415 /// let x = DestinationEndpoint::new().set_or_clear_update_time(None::<Timestamp>);
6416 /// ```
6417 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6418 where
6419 T: std::convert::Into<wkt::Timestamp>,
6420 {
6421 self.update_time = v.map(|x| x.into());
6422 self
6423 }
6424 }
6425
6426 impl wkt::message::Message for DestinationEndpoint {
6427 fn typename() -> &'static str {
6428 "type.googleapis.com/google.cloud.networkconnectivity.v1.Destination.DestinationEndpoint"
6429 }
6430 }
6431
6432 /// Defines additional types related to [DestinationEndpoint].
6433 pub mod destination_endpoint {
6434 #[allow(unused_imports)]
6435 use super::*;
6436
6437 /// The state of the `DestinationEndpoint` resource.
6438 ///
6439 /// # Working with unknown values
6440 ///
6441 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6442 /// additional enum variants at any time. Adding new variants is not considered
6443 /// a breaking change. Applications should write their code in anticipation of:
6444 ///
6445 /// - New values appearing in future releases of the client library, **and**
6446 /// - New values received dynamically, without application changes.
6447 ///
6448 /// Please consult the [Working with enums] section in the user guide for some
6449 /// guidelines.
6450 ///
6451 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6452 #[derive(Clone, Debug, PartialEq)]
6453 #[non_exhaustive]
6454 pub enum State {
6455 /// An invalid state, which is the default case.
6456 Unspecified,
6457 /// The `DestinationEndpoint` resource is valid.
6458 Valid,
6459 /// The `DestinationEndpoint` resource is invalid.
6460 Invalid,
6461 /// If set, the enum was initialized with an unknown value.
6462 ///
6463 /// Applications can examine the value using [State::value] or
6464 /// [State::name].
6465 UnknownValue(state::UnknownValue),
6466 }
6467
6468 #[doc(hidden)]
6469 pub mod state {
6470 #[allow(unused_imports)]
6471 use super::*;
6472 #[derive(Clone, Debug, PartialEq)]
6473 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6474 }
6475
6476 impl State {
6477 /// Gets the enum value.
6478 ///
6479 /// Returns `None` if the enum contains an unknown value deserialized from
6480 /// the string representation of enums.
6481 pub fn value(&self) -> std::option::Option<i32> {
6482 match self {
6483 Self::Unspecified => std::option::Option::Some(0),
6484 Self::Valid => std::option::Option::Some(1),
6485 Self::Invalid => std::option::Option::Some(2),
6486 Self::UnknownValue(u) => u.0.value(),
6487 }
6488 }
6489
6490 /// Gets the enum value as a string.
6491 ///
6492 /// Returns `None` if the enum contains an unknown value deserialized from
6493 /// the integer representation of enums.
6494 pub fn name(&self) -> std::option::Option<&str> {
6495 match self {
6496 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6497 Self::Valid => std::option::Option::Some("VALID"),
6498 Self::Invalid => std::option::Option::Some("INVALID"),
6499 Self::UnknownValue(u) => u.0.name(),
6500 }
6501 }
6502 }
6503
6504 impl std::default::Default for State {
6505 fn default() -> Self {
6506 use std::convert::From;
6507 Self::from(0)
6508 }
6509 }
6510
6511 impl std::fmt::Display for State {
6512 fn fmt(
6513 &self,
6514 f: &mut std::fmt::Formatter<'_>,
6515 ) -> std::result::Result<(), std::fmt::Error> {
6516 wkt::internal::display_enum(f, self.name(), self.value())
6517 }
6518 }
6519
6520 impl std::convert::From<i32> for State {
6521 fn from(value: i32) -> Self {
6522 match value {
6523 0 => Self::Unspecified,
6524 1 => Self::Valid,
6525 2 => Self::Invalid,
6526 _ => Self::UnknownValue(state::UnknownValue(
6527 wkt::internal::UnknownEnumValue::Integer(value),
6528 )),
6529 }
6530 }
6531 }
6532
6533 impl std::convert::From<&str> for State {
6534 fn from(value: &str) -> Self {
6535 use std::string::ToString;
6536 match value {
6537 "STATE_UNSPECIFIED" => Self::Unspecified,
6538 "VALID" => Self::Valid,
6539 "INVALID" => Self::Invalid,
6540 _ => Self::UnknownValue(state::UnknownValue(
6541 wkt::internal::UnknownEnumValue::String(value.to_string()),
6542 )),
6543 }
6544 }
6545 }
6546
6547 impl serde::ser::Serialize for State {
6548 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6549 where
6550 S: serde::Serializer,
6551 {
6552 match self {
6553 Self::Unspecified => serializer.serialize_i32(0),
6554 Self::Valid => serializer.serialize_i32(1),
6555 Self::Invalid => serializer.serialize_i32(2),
6556 Self::UnknownValue(u) => u.0.serialize(serializer),
6557 }
6558 }
6559 }
6560
6561 impl<'de> serde::de::Deserialize<'de> for State {
6562 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6563 where
6564 D: serde::Deserializer<'de>,
6565 {
6566 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6567 ".google.cloud.networkconnectivity.v1.Destination.DestinationEndpoint.State",
6568 ))
6569 }
6570 }
6571 }
6572}
6573
6574/// Request message to list `Destination` resources.
6575#[derive(Clone, Default, PartialEq)]
6576#[non_exhaustive]
6577pub struct ListDestinationsRequest {
6578 /// Required. The name of the parent resource.
6579 pub parent: std::string::String,
6580
6581 /// Optional. The maximum number of results listed per page.
6582 pub page_size: i32,
6583
6584 /// Optional. The page token.
6585 pub page_token: std::string::String,
6586
6587 /// Optional. An expression that filters the results listed in the response.
6588 pub filter: std::string::String,
6589
6590 /// Optional. The sort order of the results.
6591 pub order_by: std::string::String,
6592
6593 /// Optional. If `true`, allow partial responses for multi-regional aggregated
6594 /// list requests.
6595 pub return_partial_success: bool,
6596
6597 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6598}
6599
6600impl ListDestinationsRequest {
6601 /// Creates a new default instance.
6602 pub fn new() -> Self {
6603 std::default::Default::default()
6604 }
6605
6606 /// Sets the value of [parent][crate::model::ListDestinationsRequest::parent].
6607 ///
6608 /// # Example
6609 /// ```ignore,no_run
6610 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6611 /// # let project_id = "project_id";
6612 /// # let location_id = "location_id";
6613 /// # let multicloud_data_transfer_config_id = "multicloud_data_transfer_config_id";
6614 /// let x = ListDestinationsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/multicloudDataTransferConfigs/{multicloud_data_transfer_config_id}"));
6615 /// ```
6616 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6617 self.parent = v.into();
6618 self
6619 }
6620
6621 /// Sets the value of [page_size][crate::model::ListDestinationsRequest::page_size].
6622 ///
6623 /// # Example
6624 /// ```ignore,no_run
6625 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6626 /// let x = ListDestinationsRequest::new().set_page_size(42);
6627 /// ```
6628 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6629 self.page_size = v.into();
6630 self
6631 }
6632
6633 /// Sets the value of [page_token][crate::model::ListDestinationsRequest::page_token].
6634 ///
6635 /// # Example
6636 /// ```ignore,no_run
6637 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6638 /// let x = ListDestinationsRequest::new().set_page_token("example");
6639 /// ```
6640 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6641 self.page_token = v.into();
6642 self
6643 }
6644
6645 /// Sets the value of [filter][crate::model::ListDestinationsRequest::filter].
6646 ///
6647 /// # Example
6648 /// ```ignore,no_run
6649 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6650 /// let x = ListDestinationsRequest::new().set_filter("example");
6651 /// ```
6652 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6653 self.filter = v.into();
6654 self
6655 }
6656
6657 /// Sets the value of [order_by][crate::model::ListDestinationsRequest::order_by].
6658 ///
6659 /// # Example
6660 /// ```ignore,no_run
6661 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6662 /// let x = ListDestinationsRequest::new().set_order_by("example");
6663 /// ```
6664 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6665 self.order_by = v.into();
6666 self
6667 }
6668
6669 /// Sets the value of [return_partial_success][crate::model::ListDestinationsRequest::return_partial_success].
6670 ///
6671 /// # Example
6672 /// ```ignore,no_run
6673 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6674 /// let x = ListDestinationsRequest::new().set_return_partial_success(true);
6675 /// ```
6676 pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6677 self.return_partial_success = v.into();
6678 self
6679 }
6680}
6681
6682impl wkt::message::Message for ListDestinationsRequest {
6683 fn typename() -> &'static str {
6684 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListDestinationsRequest"
6685 }
6686}
6687
6688/// Response message to list `Destination` resources.
6689#[derive(Clone, Default, PartialEq)]
6690#[non_exhaustive]
6691pub struct ListDestinationsResponse {
6692 /// The list of `Destination` resources to be listed.
6693 pub destinations: std::vec::Vec<crate::model::Destination>,
6694
6695 /// The next page token.
6696 pub next_page_token: std::string::String,
6697
6698 /// Locations that could not be reached.
6699 pub unreachable: std::vec::Vec<std::string::String>,
6700
6701 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6702}
6703
6704impl ListDestinationsResponse {
6705 /// Creates a new default instance.
6706 pub fn new() -> Self {
6707 std::default::Default::default()
6708 }
6709
6710 /// Sets the value of [destinations][crate::model::ListDestinationsResponse::destinations].
6711 ///
6712 /// # Example
6713 /// ```ignore,no_run
6714 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsResponse;
6715 /// use google_cloud_networkconnectivity_v1::model::Destination;
6716 /// let x = ListDestinationsResponse::new()
6717 /// .set_destinations([
6718 /// Destination::default()/* use setters */,
6719 /// Destination::default()/* use (different) setters */,
6720 /// ]);
6721 /// ```
6722 pub fn set_destinations<T, V>(mut self, v: T) -> Self
6723 where
6724 T: std::iter::IntoIterator<Item = V>,
6725 V: std::convert::Into<crate::model::Destination>,
6726 {
6727 use std::iter::Iterator;
6728 self.destinations = v.into_iter().map(|i| i.into()).collect();
6729 self
6730 }
6731
6732 /// Sets the value of [next_page_token][crate::model::ListDestinationsResponse::next_page_token].
6733 ///
6734 /// # Example
6735 /// ```ignore,no_run
6736 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsResponse;
6737 /// let x = ListDestinationsResponse::new().set_next_page_token("example");
6738 /// ```
6739 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6740 self.next_page_token = v.into();
6741 self
6742 }
6743
6744 /// Sets the value of [unreachable][crate::model::ListDestinationsResponse::unreachable].
6745 ///
6746 /// # Example
6747 /// ```ignore,no_run
6748 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsResponse;
6749 /// let x = ListDestinationsResponse::new().set_unreachable(["a", "b", "c"]);
6750 /// ```
6751 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6752 where
6753 T: std::iter::IntoIterator<Item = V>,
6754 V: std::convert::Into<std::string::String>,
6755 {
6756 use std::iter::Iterator;
6757 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6758 self
6759 }
6760}
6761
6762impl wkt::message::Message for ListDestinationsResponse {
6763 fn typename() -> &'static str {
6764 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListDestinationsResponse"
6765 }
6766}
6767
6768#[doc(hidden)]
6769impl google_cloud_gax::paginator::internal::PageableResponse for ListDestinationsResponse {
6770 type PageItem = crate::model::Destination;
6771
6772 fn items(self) -> std::vec::Vec<Self::PageItem> {
6773 self.destinations
6774 }
6775
6776 fn next_page_token(&self) -> std::string::String {
6777 use std::clone::Clone;
6778 self.next_page_token.clone()
6779 }
6780}
6781
6782/// Request message to get the details of a `Destination` resource.
6783#[derive(Clone, Default, PartialEq)]
6784#[non_exhaustive]
6785pub struct GetDestinationRequest {
6786 /// Required. The name of the `Destination` resource to get.
6787 pub name: std::string::String,
6788
6789 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6790}
6791
6792impl GetDestinationRequest {
6793 /// Creates a new default instance.
6794 pub fn new() -> Self {
6795 std::default::Default::default()
6796 }
6797
6798 /// Sets the value of [name][crate::model::GetDestinationRequest::name].
6799 ///
6800 /// # Example
6801 /// ```ignore,no_run
6802 /// # use google_cloud_networkconnectivity_v1::model::GetDestinationRequest;
6803 /// # let project_id = "project_id";
6804 /// # let location_id = "location_id";
6805 /// # let multicloud_data_transfer_config_id = "multicloud_data_transfer_config_id";
6806 /// # let destination_id = "destination_id";
6807 /// let x = GetDestinationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/multicloudDataTransferConfigs/{multicloud_data_transfer_config_id}/destinations/{destination_id}"));
6808 /// ```
6809 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6810 self.name = v.into();
6811 self
6812 }
6813}
6814
6815impl wkt::message::Message for GetDestinationRequest {
6816 fn typename() -> &'static str {
6817 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetDestinationRequest"
6818 }
6819}
6820
6821/// Request message to create a `Destination` resource.
6822#[derive(Clone, Default, PartialEq)]
6823#[non_exhaustive]
6824pub struct CreateDestinationRequest {
6825 /// Required. The name of the parent resource.
6826 pub parent: std::string::String,
6827
6828 /// Required. The ID to use for the `Destination` resource, which becomes the
6829 /// final component of the `Destination` resource name.
6830 pub destination_id: std::string::String,
6831
6832 /// Required. The `Destination` resource to create.
6833 pub destination: std::option::Option<crate::model::Destination>,
6834
6835 /// Optional. A request ID to identify requests. Specify a unique request ID
6836 /// so that if you must retry your request, the server can ignore
6837 /// the request if it has already been completed. The server waits
6838 /// for at least 60 minutes since the first request.
6839 ///
6840 /// For example, consider a situation where you make an initial request and
6841 /// the request times out. If you make the request again with the same request
6842 /// ID, the server can check if original operation with the same request ID
6843 /// was received, and if so, can ignore the second request. This prevents
6844 /// clients from accidentally creating duplicate `Destination`
6845 /// resources.
6846 ///
6847 /// The request ID must be a valid UUID with the exception that zero UUID
6848 /// (00000000-0000-0000-0000-000000000000) isn't supported.
6849 pub request_id: std::string::String,
6850
6851 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6852}
6853
6854impl CreateDestinationRequest {
6855 /// Creates a new default instance.
6856 pub fn new() -> Self {
6857 std::default::Default::default()
6858 }
6859
6860 /// Sets the value of [parent][crate::model::CreateDestinationRequest::parent].
6861 ///
6862 /// # Example
6863 /// ```ignore,no_run
6864 /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6865 /// # let project_id = "project_id";
6866 /// # let location_id = "location_id";
6867 /// # let multicloud_data_transfer_config_id = "multicloud_data_transfer_config_id";
6868 /// let x = CreateDestinationRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/multicloudDataTransferConfigs/{multicloud_data_transfer_config_id}"));
6869 /// ```
6870 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6871 self.parent = v.into();
6872 self
6873 }
6874
6875 /// Sets the value of [destination_id][crate::model::CreateDestinationRequest::destination_id].
6876 ///
6877 /// # Example
6878 /// ```ignore,no_run
6879 /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6880 /// let x = CreateDestinationRequest::new().set_destination_id("example");
6881 /// ```
6882 pub fn set_destination_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6883 self.destination_id = v.into();
6884 self
6885 }
6886
6887 /// Sets the value of [destination][crate::model::CreateDestinationRequest::destination].
6888 ///
6889 /// # Example
6890 /// ```ignore,no_run
6891 /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6892 /// use google_cloud_networkconnectivity_v1::model::Destination;
6893 /// let x = CreateDestinationRequest::new().set_destination(Destination::default()/* use setters */);
6894 /// ```
6895 pub fn set_destination<T>(mut self, v: T) -> Self
6896 where
6897 T: std::convert::Into<crate::model::Destination>,
6898 {
6899 self.destination = std::option::Option::Some(v.into());
6900 self
6901 }
6902
6903 /// Sets or clears the value of [destination][crate::model::CreateDestinationRequest::destination].
6904 ///
6905 /// # Example
6906 /// ```ignore,no_run
6907 /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6908 /// use google_cloud_networkconnectivity_v1::model::Destination;
6909 /// let x = CreateDestinationRequest::new().set_or_clear_destination(Some(Destination::default()/* use setters */));
6910 /// let x = CreateDestinationRequest::new().set_or_clear_destination(None::<Destination>);
6911 /// ```
6912 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
6913 where
6914 T: std::convert::Into<crate::model::Destination>,
6915 {
6916 self.destination = v.map(|x| x.into());
6917 self
6918 }
6919
6920 /// Sets the value of [request_id][crate::model::CreateDestinationRequest::request_id].
6921 ///
6922 /// # Example
6923 /// ```ignore,no_run
6924 /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6925 /// let x = CreateDestinationRequest::new().set_request_id("example");
6926 /// ```
6927 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6928 self.request_id = v.into();
6929 self
6930 }
6931}
6932
6933impl wkt::message::Message for CreateDestinationRequest {
6934 fn typename() -> &'static str {
6935 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateDestinationRequest"
6936 }
6937}
6938
6939/// Request message to update a `Destination` resource.
6940#[derive(Clone, Default, PartialEq)]
6941#[non_exhaustive]
6942pub struct UpdateDestinationRequest {
6943 /// Optional. `FieldMask is used to specify the fields to be overwritten in the
6944 /// `Destination` resource by the update.
6945 /// The fields specified in `update_mask` are relative to the resource, not
6946 /// the full request. A field is overwritten if it is in the mask. If you
6947 /// don't specify a mask, all fields are overwritten.
6948 pub update_mask: std::option::Option<wkt::FieldMask>,
6949
6950 /// Required. The `Destination` resource to update.
6951 pub destination: std::option::Option<crate::model::Destination>,
6952
6953 /// Optional. A request ID to identify requests. Specify a unique request ID
6954 /// so that if you must retry your request, the server can ignore
6955 /// the request if it has already been completed. The server waits
6956 /// for at least 60 minutes since the first request.
6957 ///
6958 /// For example, consider a situation where you make an initial request and
6959 /// the request times out. If you make the request again with the same request
6960 /// ID, the server can check if original operation with the same request ID
6961 /// was received, and if so, can ignore the second request.
6962 ///
6963 /// The request ID must be a valid UUID with the exception that zero UUID
6964 /// (00000000-0000-0000-0000-000000000000) isn't supported.
6965 pub request_id: std::string::String,
6966
6967 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6968}
6969
6970impl UpdateDestinationRequest {
6971 /// Creates a new default instance.
6972 pub fn new() -> Self {
6973 std::default::Default::default()
6974 }
6975
6976 /// Sets the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
6977 ///
6978 /// # Example
6979 /// ```ignore,no_run
6980 /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
6981 /// use wkt::FieldMask;
6982 /// let x = UpdateDestinationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6983 /// ```
6984 pub fn set_update_mask<T>(mut self, v: T) -> Self
6985 where
6986 T: std::convert::Into<wkt::FieldMask>,
6987 {
6988 self.update_mask = std::option::Option::Some(v.into());
6989 self
6990 }
6991
6992 /// Sets or clears the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
6993 ///
6994 /// # Example
6995 /// ```ignore,no_run
6996 /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
6997 /// use wkt::FieldMask;
6998 /// let x = UpdateDestinationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6999 /// let x = UpdateDestinationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7000 /// ```
7001 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7002 where
7003 T: std::convert::Into<wkt::FieldMask>,
7004 {
7005 self.update_mask = v.map(|x| x.into());
7006 self
7007 }
7008
7009 /// Sets the value of [destination][crate::model::UpdateDestinationRequest::destination].
7010 ///
7011 /// # Example
7012 /// ```ignore,no_run
7013 /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
7014 /// use google_cloud_networkconnectivity_v1::model::Destination;
7015 /// let x = UpdateDestinationRequest::new().set_destination(Destination::default()/* use setters */);
7016 /// ```
7017 pub fn set_destination<T>(mut self, v: T) -> Self
7018 where
7019 T: std::convert::Into<crate::model::Destination>,
7020 {
7021 self.destination = std::option::Option::Some(v.into());
7022 self
7023 }
7024
7025 /// Sets or clears the value of [destination][crate::model::UpdateDestinationRequest::destination].
7026 ///
7027 /// # Example
7028 /// ```ignore,no_run
7029 /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
7030 /// use google_cloud_networkconnectivity_v1::model::Destination;
7031 /// let x = UpdateDestinationRequest::new().set_or_clear_destination(Some(Destination::default()/* use setters */));
7032 /// let x = UpdateDestinationRequest::new().set_or_clear_destination(None::<Destination>);
7033 /// ```
7034 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
7035 where
7036 T: std::convert::Into<crate::model::Destination>,
7037 {
7038 self.destination = v.map(|x| x.into());
7039 self
7040 }
7041
7042 /// Sets the value of [request_id][crate::model::UpdateDestinationRequest::request_id].
7043 ///
7044 /// # Example
7045 /// ```ignore,no_run
7046 /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
7047 /// let x = UpdateDestinationRequest::new().set_request_id("example");
7048 /// ```
7049 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7050 self.request_id = v.into();
7051 self
7052 }
7053}
7054
7055impl wkt::message::Message for UpdateDestinationRequest {
7056 fn typename() -> &'static str {
7057 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateDestinationRequest"
7058 }
7059}
7060
7061/// Request message to delete a `Destination` resource.
7062#[derive(Clone, Default, PartialEq)]
7063#[non_exhaustive]
7064pub struct DeleteDestinationRequest {
7065 /// Required. The name of the `Destination` resource to delete.
7066 pub name: std::string::String,
7067
7068 /// Optional. A request ID to identify requests. Specify a unique request ID
7069 /// so that if you must retry your request, the server can ignore
7070 /// the request if it has already been completed. The server waits
7071 /// for at least 60 minutes since the first request.
7072 ///
7073 /// For example, consider a situation where you make an initial request and
7074 /// the request times out. If you make the request again with the same request
7075 /// ID, the server can check if original operation with the same request ID
7076 /// was received, and if so, can ignore the second request.
7077 ///
7078 /// The request ID must be a valid UUID with the exception that zero UUID
7079 /// (00000000-0000-0000-0000-000000000000) isn't supported.
7080 pub request_id: std::string::String,
7081
7082 /// Optional. The etag is computed by the server, and might be sent with update
7083 /// and delete requests so that the client has an up-to-date value before
7084 /// proceeding.
7085 pub etag: std::string::String,
7086
7087 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7088}
7089
7090impl DeleteDestinationRequest {
7091 /// Creates a new default instance.
7092 pub fn new() -> Self {
7093 std::default::Default::default()
7094 }
7095
7096 /// Sets the value of [name][crate::model::DeleteDestinationRequest::name].
7097 ///
7098 /// # Example
7099 /// ```ignore,no_run
7100 /// # use google_cloud_networkconnectivity_v1::model::DeleteDestinationRequest;
7101 /// # let project_id = "project_id";
7102 /// # let location_id = "location_id";
7103 /// # let multicloud_data_transfer_config_id = "multicloud_data_transfer_config_id";
7104 /// # let destination_id = "destination_id";
7105 /// let x = DeleteDestinationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/multicloudDataTransferConfigs/{multicloud_data_transfer_config_id}/destinations/{destination_id}"));
7106 /// ```
7107 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7108 self.name = v.into();
7109 self
7110 }
7111
7112 /// Sets the value of [request_id][crate::model::DeleteDestinationRequest::request_id].
7113 ///
7114 /// # Example
7115 /// ```ignore,no_run
7116 /// # use google_cloud_networkconnectivity_v1::model::DeleteDestinationRequest;
7117 /// let x = DeleteDestinationRequest::new().set_request_id("example");
7118 /// ```
7119 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7120 self.request_id = v.into();
7121 self
7122 }
7123
7124 /// Sets the value of [etag][crate::model::DeleteDestinationRequest::etag].
7125 ///
7126 /// # Example
7127 /// ```ignore,no_run
7128 /// # use google_cloud_networkconnectivity_v1::model::DeleteDestinationRequest;
7129 /// let x = DeleteDestinationRequest::new().set_etag("example");
7130 /// ```
7131 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7132 self.etag = v.into();
7133 self
7134 }
7135}
7136
7137impl wkt::message::Message for DeleteDestinationRequest {
7138 fn typename() -> &'static str {
7139 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteDestinationRequest"
7140 }
7141}
7142
7143/// The timeline of the pending states for a resource.
7144#[derive(Clone, Default, PartialEq)]
7145#[non_exhaustive]
7146pub struct StateTimeline {
7147 /// Output only. The state and activation time details of the resource state.
7148 pub states: std::vec::Vec<crate::model::state_timeline::StateMetadata>,
7149
7150 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7151}
7152
7153impl StateTimeline {
7154 /// Creates a new default instance.
7155 pub fn new() -> Self {
7156 std::default::Default::default()
7157 }
7158
7159 /// Sets the value of [states][crate::model::StateTimeline::states].
7160 ///
7161 /// # Example
7162 /// ```ignore,no_run
7163 /// # use google_cloud_networkconnectivity_v1::model::StateTimeline;
7164 /// use google_cloud_networkconnectivity_v1::model::state_timeline::StateMetadata;
7165 /// let x = StateTimeline::new()
7166 /// .set_states([
7167 /// StateMetadata::default()/* use setters */,
7168 /// StateMetadata::default()/* use (different) setters */,
7169 /// ]);
7170 /// ```
7171 pub fn set_states<T, V>(mut self, v: T) -> Self
7172 where
7173 T: std::iter::IntoIterator<Item = V>,
7174 V: std::convert::Into<crate::model::state_timeline::StateMetadata>,
7175 {
7176 use std::iter::Iterator;
7177 self.states = v.into_iter().map(|i| i.into()).collect();
7178 self
7179 }
7180}
7181
7182impl wkt::message::Message for StateTimeline {
7183 fn typename() -> &'static str {
7184 "type.googleapis.com/google.cloud.networkconnectivity.v1.StateTimeline"
7185 }
7186}
7187
7188/// Defines additional types related to [StateTimeline].
7189pub mod state_timeline {
7190 #[allow(unused_imports)]
7191 use super::*;
7192
7193 /// The state and activation time details of the resource state.
7194 #[derive(Clone, Default, PartialEq)]
7195 #[non_exhaustive]
7196 pub struct StateMetadata {
7197 /// Output only. The state of the resource.
7198 pub state: crate::model::state_timeline::state_metadata::State,
7199
7200 /// Output only. Accompanies only the transient states, which include
7201 /// `ADDING`, `DELETING`, and `SUSPENDING`, to denote the time until which
7202 /// the transient state of the resource will be effective. For instance, if
7203 /// the state is `ADDING`, this field shows the time when the resource state
7204 /// transitions to `ACTIVE`.
7205 pub effective_time: std::option::Option<wkt::Timestamp>,
7206
7207 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7208 }
7209
7210 impl StateMetadata {
7211 /// Creates a new default instance.
7212 pub fn new() -> Self {
7213 std::default::Default::default()
7214 }
7215
7216 /// Sets the value of [state][crate::model::state_timeline::StateMetadata::state].
7217 ///
7218 /// # Example
7219 /// ```ignore,no_run
7220 /// # use google_cloud_networkconnectivity_v1::model::state_timeline::StateMetadata;
7221 /// use google_cloud_networkconnectivity_v1::model::state_timeline::state_metadata::State;
7222 /// let x0 = StateMetadata::new().set_state(State::Adding);
7223 /// let x1 = StateMetadata::new().set_state(State::Active);
7224 /// let x2 = StateMetadata::new().set_state(State::Deleting);
7225 /// ```
7226 pub fn set_state<
7227 T: std::convert::Into<crate::model::state_timeline::state_metadata::State>,
7228 >(
7229 mut self,
7230 v: T,
7231 ) -> Self {
7232 self.state = v.into();
7233 self
7234 }
7235
7236 /// Sets the value of [effective_time][crate::model::state_timeline::StateMetadata::effective_time].
7237 ///
7238 /// # Example
7239 /// ```ignore,no_run
7240 /// # use google_cloud_networkconnectivity_v1::model::state_timeline::StateMetadata;
7241 /// use wkt::Timestamp;
7242 /// let x = StateMetadata::new().set_effective_time(Timestamp::default()/* use setters */);
7243 /// ```
7244 pub fn set_effective_time<T>(mut self, v: T) -> Self
7245 where
7246 T: std::convert::Into<wkt::Timestamp>,
7247 {
7248 self.effective_time = std::option::Option::Some(v.into());
7249 self
7250 }
7251
7252 /// Sets or clears the value of [effective_time][crate::model::state_timeline::StateMetadata::effective_time].
7253 ///
7254 /// # Example
7255 /// ```ignore,no_run
7256 /// # use google_cloud_networkconnectivity_v1::model::state_timeline::StateMetadata;
7257 /// use wkt::Timestamp;
7258 /// let x = StateMetadata::new().set_or_clear_effective_time(Some(Timestamp::default()/* use setters */));
7259 /// let x = StateMetadata::new().set_or_clear_effective_time(None::<Timestamp>);
7260 /// ```
7261 pub fn set_or_clear_effective_time<T>(mut self, v: std::option::Option<T>) -> Self
7262 where
7263 T: std::convert::Into<wkt::Timestamp>,
7264 {
7265 self.effective_time = v.map(|x| x.into());
7266 self
7267 }
7268 }
7269
7270 impl wkt::message::Message for StateMetadata {
7271 fn typename() -> &'static str {
7272 "type.googleapis.com/google.cloud.networkconnectivity.v1.StateTimeline.StateMetadata"
7273 }
7274 }
7275
7276 /// Defines additional types related to [StateMetadata].
7277 pub mod state_metadata {
7278 #[allow(unused_imports)]
7279 use super::*;
7280
7281 /// The state of the resource.
7282 ///
7283 /// # Working with unknown values
7284 ///
7285 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7286 /// additional enum variants at any time. Adding new variants is not considered
7287 /// a breaking change. Applications should write their code in anticipation of:
7288 ///
7289 /// - New values appearing in future releases of the client library, **and**
7290 /// - New values received dynamically, without application changes.
7291 ///
7292 /// Please consult the [Working with enums] section in the user guide for some
7293 /// guidelines.
7294 ///
7295 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7296 #[derive(Clone, Debug, PartialEq)]
7297 #[non_exhaustive]
7298 pub enum State {
7299 /// An invalid state, which is the default case.
7300 Unspecified,
7301 /// The resource is being added.
7302 Adding,
7303 /// The resource is in use.
7304 Active,
7305 /// The resource is being deleted.
7306 Deleting,
7307 /// The resource is being suspended.
7308 Suspending,
7309 /// The resource is suspended and not in use.
7310 Suspended,
7311 /// If set, the enum was initialized with an unknown value.
7312 ///
7313 /// Applications can examine the value using [State::value] or
7314 /// [State::name].
7315 UnknownValue(state::UnknownValue),
7316 }
7317
7318 #[doc(hidden)]
7319 pub mod state {
7320 #[allow(unused_imports)]
7321 use super::*;
7322 #[derive(Clone, Debug, PartialEq)]
7323 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7324 }
7325
7326 impl State {
7327 /// Gets the enum value.
7328 ///
7329 /// Returns `None` if the enum contains an unknown value deserialized from
7330 /// the string representation of enums.
7331 pub fn value(&self) -> std::option::Option<i32> {
7332 match self {
7333 Self::Unspecified => std::option::Option::Some(0),
7334 Self::Adding => std::option::Option::Some(1),
7335 Self::Active => std::option::Option::Some(2),
7336 Self::Deleting => std::option::Option::Some(3),
7337 Self::Suspending => std::option::Option::Some(4),
7338 Self::Suspended => std::option::Option::Some(5),
7339 Self::UnknownValue(u) => u.0.value(),
7340 }
7341 }
7342
7343 /// Gets the enum value as a string.
7344 ///
7345 /// Returns `None` if the enum contains an unknown value deserialized from
7346 /// the integer representation of enums.
7347 pub fn name(&self) -> std::option::Option<&str> {
7348 match self {
7349 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7350 Self::Adding => std::option::Option::Some("ADDING"),
7351 Self::Active => std::option::Option::Some("ACTIVE"),
7352 Self::Deleting => std::option::Option::Some("DELETING"),
7353 Self::Suspending => std::option::Option::Some("SUSPENDING"),
7354 Self::Suspended => std::option::Option::Some("SUSPENDED"),
7355 Self::UnknownValue(u) => u.0.name(),
7356 }
7357 }
7358 }
7359
7360 impl std::default::Default for State {
7361 fn default() -> Self {
7362 use std::convert::From;
7363 Self::from(0)
7364 }
7365 }
7366
7367 impl std::fmt::Display for State {
7368 fn fmt(
7369 &self,
7370 f: &mut std::fmt::Formatter<'_>,
7371 ) -> std::result::Result<(), std::fmt::Error> {
7372 wkt::internal::display_enum(f, self.name(), self.value())
7373 }
7374 }
7375
7376 impl std::convert::From<i32> for State {
7377 fn from(value: i32) -> Self {
7378 match value {
7379 0 => Self::Unspecified,
7380 1 => Self::Adding,
7381 2 => Self::Active,
7382 3 => Self::Deleting,
7383 4 => Self::Suspending,
7384 5 => Self::Suspended,
7385 _ => Self::UnknownValue(state::UnknownValue(
7386 wkt::internal::UnknownEnumValue::Integer(value),
7387 )),
7388 }
7389 }
7390 }
7391
7392 impl std::convert::From<&str> for State {
7393 fn from(value: &str) -> Self {
7394 use std::string::ToString;
7395 match value {
7396 "STATE_UNSPECIFIED" => Self::Unspecified,
7397 "ADDING" => Self::Adding,
7398 "ACTIVE" => Self::Active,
7399 "DELETING" => Self::Deleting,
7400 "SUSPENDING" => Self::Suspending,
7401 "SUSPENDED" => Self::Suspended,
7402 _ => Self::UnknownValue(state::UnknownValue(
7403 wkt::internal::UnknownEnumValue::String(value.to_string()),
7404 )),
7405 }
7406 }
7407 }
7408
7409 impl serde::ser::Serialize for State {
7410 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7411 where
7412 S: serde::Serializer,
7413 {
7414 match self {
7415 Self::Unspecified => serializer.serialize_i32(0),
7416 Self::Adding => serializer.serialize_i32(1),
7417 Self::Active => serializer.serialize_i32(2),
7418 Self::Deleting => serializer.serialize_i32(3),
7419 Self::Suspending => serializer.serialize_i32(4),
7420 Self::Suspended => serializer.serialize_i32(5),
7421 Self::UnknownValue(u) => u.0.serialize(serializer),
7422 }
7423 }
7424 }
7425
7426 impl<'de> serde::de::Deserialize<'de> for State {
7427 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7428 where
7429 D: serde::Deserializer<'de>,
7430 {
7431 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7432 ".google.cloud.networkconnectivity.v1.StateTimeline.StateMetadata.State",
7433 ))
7434 }
7435 }
7436 }
7437}
7438
7439/// A service in your project in a region that is eligible for Data Transfer
7440/// Essentials configuration.
7441#[derive(Clone, Default, PartialEq)]
7442#[non_exhaustive]
7443pub struct MulticloudDataTransferSupportedService {
7444 /// Identifier. The name of the service.
7445 pub name: std::string::String,
7446
7447 /// Output only. The network service tier or regional endpoint supported for
7448 /// the service.
7449 pub service_configs: std::vec::Vec<crate::model::ServiceConfig>,
7450
7451 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7452}
7453
7454impl MulticloudDataTransferSupportedService {
7455 /// Creates a new default instance.
7456 pub fn new() -> Self {
7457 std::default::Default::default()
7458 }
7459
7460 /// Sets the value of [name][crate::model::MulticloudDataTransferSupportedService::name].
7461 ///
7462 /// # Example
7463 /// ```ignore,no_run
7464 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferSupportedService;
7465 /// # let project_id = "project_id";
7466 /// # let location_id = "location_id";
7467 /// # let multicloud_data_transfer_supported_service_id = "multicloud_data_transfer_supported_service_id";
7468 /// let x = MulticloudDataTransferSupportedService::new().set_name(format!("projects/{project_id}/locations/{location_id}/multicloudDataTransferSupportedServices/{multicloud_data_transfer_supported_service_id}"));
7469 /// ```
7470 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7471 self.name = v.into();
7472 self
7473 }
7474
7475 /// Sets the value of [service_configs][crate::model::MulticloudDataTransferSupportedService::service_configs].
7476 ///
7477 /// # Example
7478 /// ```ignore,no_run
7479 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferSupportedService;
7480 /// use google_cloud_networkconnectivity_v1::model::ServiceConfig;
7481 /// let x = MulticloudDataTransferSupportedService::new()
7482 /// .set_service_configs([
7483 /// ServiceConfig::default()/* use setters */,
7484 /// ServiceConfig::default()/* use (different) setters */,
7485 /// ]);
7486 /// ```
7487 pub fn set_service_configs<T, V>(mut self, v: T) -> Self
7488 where
7489 T: std::iter::IntoIterator<Item = V>,
7490 V: std::convert::Into<crate::model::ServiceConfig>,
7491 {
7492 use std::iter::Iterator;
7493 self.service_configs = v.into_iter().map(|i| i.into()).collect();
7494 self
7495 }
7496}
7497
7498impl wkt::message::Message for MulticloudDataTransferSupportedService {
7499 fn typename() -> &'static str {
7500 "type.googleapis.com/google.cloud.networkconnectivity.v1.MulticloudDataTransferSupportedService"
7501 }
7502}
7503
7504/// Specifies eligibility information for the service.
7505#[derive(Clone, Default, PartialEq)]
7506#[non_exhaustive]
7507pub struct ServiceConfig {
7508 /// Output only. The eligibility criteria for the service.
7509 pub eligibility_criteria: crate::model::service_config::EligibilityCriteria,
7510
7511 /// Output only. The end time for eligibility criteria support. If not
7512 /// specified, no planned end time is set.
7513 pub support_end_time: std::option::Option<wkt::Timestamp>,
7514
7515 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7516}
7517
7518impl ServiceConfig {
7519 /// Creates a new default instance.
7520 pub fn new() -> Self {
7521 std::default::Default::default()
7522 }
7523
7524 /// Sets the value of [eligibility_criteria][crate::model::ServiceConfig::eligibility_criteria].
7525 ///
7526 /// # Example
7527 /// ```ignore,no_run
7528 /// # use google_cloud_networkconnectivity_v1::model::ServiceConfig;
7529 /// use google_cloud_networkconnectivity_v1::model::service_config::EligibilityCriteria;
7530 /// let x0 = ServiceConfig::new().set_eligibility_criteria(EligibilityCriteria::NetworkServiceTierPremiumOnly);
7531 /// let x1 = ServiceConfig::new().set_eligibility_criteria(EligibilityCriteria::NetworkServiceTierStandardOnly);
7532 /// let x2 = ServiceConfig::new().set_eligibility_criteria(EligibilityCriteria::RequestEndpointRegionalEndpointOnly);
7533 /// ```
7534 pub fn set_eligibility_criteria<
7535 T: std::convert::Into<crate::model::service_config::EligibilityCriteria>,
7536 >(
7537 mut self,
7538 v: T,
7539 ) -> Self {
7540 self.eligibility_criteria = v.into();
7541 self
7542 }
7543
7544 /// Sets the value of [support_end_time][crate::model::ServiceConfig::support_end_time].
7545 ///
7546 /// # Example
7547 /// ```ignore,no_run
7548 /// # use google_cloud_networkconnectivity_v1::model::ServiceConfig;
7549 /// use wkt::Timestamp;
7550 /// let x = ServiceConfig::new().set_support_end_time(Timestamp::default()/* use setters */);
7551 /// ```
7552 pub fn set_support_end_time<T>(mut self, v: T) -> Self
7553 where
7554 T: std::convert::Into<wkt::Timestamp>,
7555 {
7556 self.support_end_time = std::option::Option::Some(v.into());
7557 self
7558 }
7559
7560 /// Sets or clears the value of [support_end_time][crate::model::ServiceConfig::support_end_time].
7561 ///
7562 /// # Example
7563 /// ```ignore,no_run
7564 /// # use google_cloud_networkconnectivity_v1::model::ServiceConfig;
7565 /// use wkt::Timestamp;
7566 /// let x = ServiceConfig::new().set_or_clear_support_end_time(Some(Timestamp::default()/* use setters */));
7567 /// let x = ServiceConfig::new().set_or_clear_support_end_time(None::<Timestamp>);
7568 /// ```
7569 pub fn set_or_clear_support_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7570 where
7571 T: std::convert::Into<wkt::Timestamp>,
7572 {
7573 self.support_end_time = v.map(|x| x.into());
7574 self
7575 }
7576}
7577
7578impl wkt::message::Message for ServiceConfig {
7579 fn typename() -> &'static str {
7580 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConfig"
7581 }
7582}
7583
7584/// Defines additional types related to [ServiceConfig].
7585pub mod service_config {
7586 #[allow(unused_imports)]
7587 use super::*;
7588
7589 /// The eligibility information for the service.
7590 ///
7591 /// # Working with unknown values
7592 ///
7593 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7594 /// additional enum variants at any time. Adding new variants is not considered
7595 /// a breaking change. Applications should write their code in anticipation of:
7596 ///
7597 /// - New values appearing in future releases of the client library, **and**
7598 /// - New values received dynamically, without application changes.
7599 ///
7600 /// Please consult the [Working with enums] section in the user guide for some
7601 /// guidelines.
7602 ///
7603 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7604 #[derive(Clone, Debug, PartialEq)]
7605 #[non_exhaustive]
7606 pub enum EligibilityCriteria {
7607 /// The service is not eligible for Data Transfer Essentials configuration.
7608 /// This is the default case.
7609 Unspecified,
7610 /// The service is eligible for Data Transfer Essentials configuration only
7611 /// for Premium Tier.
7612 NetworkServiceTierPremiumOnly,
7613 /// The service is eligible for Data Transfer Essentials configuration only
7614 /// for Standard Tier.
7615 NetworkServiceTierStandardOnly,
7616 /// The service is eligible for Data Transfer Essentials configuration only
7617 /// for the regional endpoint.
7618 RequestEndpointRegionalEndpointOnly,
7619 /// If set, the enum was initialized with an unknown value.
7620 ///
7621 /// Applications can examine the value using [EligibilityCriteria::value] or
7622 /// [EligibilityCriteria::name].
7623 UnknownValue(eligibility_criteria::UnknownValue),
7624 }
7625
7626 #[doc(hidden)]
7627 pub mod eligibility_criteria {
7628 #[allow(unused_imports)]
7629 use super::*;
7630 #[derive(Clone, Debug, PartialEq)]
7631 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7632 }
7633
7634 impl EligibilityCriteria {
7635 /// Gets the enum value.
7636 ///
7637 /// Returns `None` if the enum contains an unknown value deserialized from
7638 /// the string representation of enums.
7639 pub fn value(&self) -> std::option::Option<i32> {
7640 match self {
7641 Self::Unspecified => std::option::Option::Some(0),
7642 Self::NetworkServiceTierPremiumOnly => std::option::Option::Some(1),
7643 Self::NetworkServiceTierStandardOnly => std::option::Option::Some(2),
7644 Self::RequestEndpointRegionalEndpointOnly => std::option::Option::Some(3),
7645 Self::UnknownValue(u) => u.0.value(),
7646 }
7647 }
7648
7649 /// Gets the enum value as a string.
7650 ///
7651 /// Returns `None` if the enum contains an unknown value deserialized from
7652 /// the integer representation of enums.
7653 pub fn name(&self) -> std::option::Option<&str> {
7654 match self {
7655 Self::Unspecified => std::option::Option::Some("ELIGIBILITY_CRITERIA_UNSPECIFIED"),
7656 Self::NetworkServiceTierPremiumOnly => {
7657 std::option::Option::Some("NETWORK_SERVICE_TIER_PREMIUM_ONLY")
7658 }
7659 Self::NetworkServiceTierStandardOnly => {
7660 std::option::Option::Some("NETWORK_SERVICE_TIER_STANDARD_ONLY")
7661 }
7662 Self::RequestEndpointRegionalEndpointOnly => {
7663 std::option::Option::Some("REQUEST_ENDPOINT_REGIONAL_ENDPOINT_ONLY")
7664 }
7665 Self::UnknownValue(u) => u.0.name(),
7666 }
7667 }
7668 }
7669
7670 impl std::default::Default for EligibilityCriteria {
7671 fn default() -> Self {
7672 use std::convert::From;
7673 Self::from(0)
7674 }
7675 }
7676
7677 impl std::fmt::Display for EligibilityCriteria {
7678 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7679 wkt::internal::display_enum(f, self.name(), self.value())
7680 }
7681 }
7682
7683 impl std::convert::From<i32> for EligibilityCriteria {
7684 fn from(value: i32) -> Self {
7685 match value {
7686 0 => Self::Unspecified,
7687 1 => Self::NetworkServiceTierPremiumOnly,
7688 2 => Self::NetworkServiceTierStandardOnly,
7689 3 => Self::RequestEndpointRegionalEndpointOnly,
7690 _ => Self::UnknownValue(eligibility_criteria::UnknownValue(
7691 wkt::internal::UnknownEnumValue::Integer(value),
7692 )),
7693 }
7694 }
7695 }
7696
7697 impl std::convert::From<&str> for EligibilityCriteria {
7698 fn from(value: &str) -> Self {
7699 use std::string::ToString;
7700 match value {
7701 "ELIGIBILITY_CRITERIA_UNSPECIFIED" => Self::Unspecified,
7702 "NETWORK_SERVICE_TIER_PREMIUM_ONLY" => Self::NetworkServiceTierPremiumOnly,
7703 "NETWORK_SERVICE_TIER_STANDARD_ONLY" => Self::NetworkServiceTierStandardOnly,
7704 "REQUEST_ENDPOINT_REGIONAL_ENDPOINT_ONLY" => {
7705 Self::RequestEndpointRegionalEndpointOnly
7706 }
7707 _ => Self::UnknownValue(eligibility_criteria::UnknownValue(
7708 wkt::internal::UnknownEnumValue::String(value.to_string()),
7709 )),
7710 }
7711 }
7712 }
7713
7714 impl serde::ser::Serialize for EligibilityCriteria {
7715 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7716 where
7717 S: serde::Serializer,
7718 {
7719 match self {
7720 Self::Unspecified => serializer.serialize_i32(0),
7721 Self::NetworkServiceTierPremiumOnly => serializer.serialize_i32(1),
7722 Self::NetworkServiceTierStandardOnly => serializer.serialize_i32(2),
7723 Self::RequestEndpointRegionalEndpointOnly => serializer.serialize_i32(3),
7724 Self::UnknownValue(u) => u.0.serialize(serializer),
7725 }
7726 }
7727 }
7728
7729 impl<'de> serde::de::Deserialize<'de> for EligibilityCriteria {
7730 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7731 where
7732 D: serde::Deserializer<'de>,
7733 {
7734 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EligibilityCriteria>::new(
7735 ".google.cloud.networkconnectivity.v1.ServiceConfig.EligibilityCriteria",
7736 ))
7737 }
7738 }
7739}
7740
7741/// Request message to check if a service in your project in a region is
7742/// eligible for Data Transfer Essentials configuration.
7743#[derive(Clone, Default, PartialEq)]
7744#[non_exhaustive]
7745pub struct GetMulticloudDataTransferSupportedServiceRequest {
7746 /// Required. The name of the service.
7747 pub name: std::string::String,
7748
7749 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7750}
7751
7752impl GetMulticloudDataTransferSupportedServiceRequest {
7753 /// Creates a new default instance.
7754 pub fn new() -> Self {
7755 std::default::Default::default()
7756 }
7757
7758 /// Sets the value of [name][crate::model::GetMulticloudDataTransferSupportedServiceRequest::name].
7759 ///
7760 /// # Example
7761 /// ```ignore,no_run
7762 /// # use google_cloud_networkconnectivity_v1::model::GetMulticloudDataTransferSupportedServiceRequest;
7763 /// # let project_id = "project_id";
7764 /// # let location_id = "location_id";
7765 /// # let multicloud_data_transfer_supported_service_id = "multicloud_data_transfer_supported_service_id";
7766 /// let x = GetMulticloudDataTransferSupportedServiceRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/multicloudDataTransferSupportedServices/{multicloud_data_transfer_supported_service_id}"));
7767 /// ```
7768 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7769 self.name = v.into();
7770 self
7771 }
7772}
7773
7774impl wkt::message::Message for GetMulticloudDataTransferSupportedServiceRequest {
7775 fn typename() -> &'static str {
7776 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetMulticloudDataTransferSupportedServiceRequest"
7777 }
7778}
7779
7780/// Request message to list the services in your project that are eligible for
7781/// Data Transfer Essentials configuration.
7782#[derive(Clone, Default, PartialEq)]
7783#[non_exhaustive]
7784pub struct ListMulticloudDataTransferSupportedServicesRequest {
7785 /// Required. The name of the parent resource.
7786 pub parent: std::string::String,
7787
7788 /// Optional. The maximum number of results listed per page.
7789 pub page_size: i32,
7790
7791 /// Optional. The page token.
7792 pub page_token: std::string::String,
7793
7794 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7795}
7796
7797impl ListMulticloudDataTransferSupportedServicesRequest {
7798 /// Creates a new default instance.
7799 pub fn new() -> Self {
7800 std::default::Default::default()
7801 }
7802
7803 /// Sets the value of [parent][crate::model::ListMulticloudDataTransferSupportedServicesRequest::parent].
7804 ///
7805 /// # Example
7806 /// ```ignore,no_run
7807 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesRequest;
7808 /// let x = ListMulticloudDataTransferSupportedServicesRequest::new().set_parent("example");
7809 /// ```
7810 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7811 self.parent = v.into();
7812 self
7813 }
7814
7815 /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_size].
7816 ///
7817 /// # Example
7818 /// ```ignore,no_run
7819 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesRequest;
7820 /// let x = ListMulticloudDataTransferSupportedServicesRequest::new().set_page_size(42);
7821 /// ```
7822 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7823 self.page_size = v.into();
7824 self
7825 }
7826
7827 /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_token].
7828 ///
7829 /// # Example
7830 /// ```ignore,no_run
7831 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesRequest;
7832 /// let x = ListMulticloudDataTransferSupportedServicesRequest::new().set_page_token("example");
7833 /// ```
7834 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7835 self.page_token = v.into();
7836 self
7837 }
7838}
7839
7840impl wkt::message::Message for ListMulticloudDataTransferSupportedServicesRequest {
7841 fn typename() -> &'static str {
7842 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferSupportedServicesRequest"
7843 }
7844}
7845
7846/// Response message to list the services in your project in regions that are
7847/// eligible for Data Transfer Essentials configuration.
7848#[derive(Clone, Default, PartialEq)]
7849#[non_exhaustive]
7850pub struct ListMulticloudDataTransferSupportedServicesResponse {
7851 /// The list of supported services.
7852 pub multicloud_data_transfer_supported_services:
7853 std::vec::Vec<crate::model::MulticloudDataTransferSupportedService>,
7854
7855 /// The next page token.
7856 pub next_page_token: std::string::String,
7857
7858 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7859}
7860
7861impl ListMulticloudDataTransferSupportedServicesResponse {
7862 /// Creates a new default instance.
7863 pub fn new() -> Self {
7864 std::default::Default::default()
7865 }
7866
7867 /// Sets the value of [multicloud_data_transfer_supported_services][crate::model::ListMulticloudDataTransferSupportedServicesResponse::multicloud_data_transfer_supported_services].
7868 ///
7869 /// # Example
7870 /// ```ignore,no_run
7871 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesResponse;
7872 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferSupportedService;
7873 /// let x = ListMulticloudDataTransferSupportedServicesResponse::new()
7874 /// .set_multicloud_data_transfer_supported_services([
7875 /// MulticloudDataTransferSupportedService::default()/* use setters */,
7876 /// MulticloudDataTransferSupportedService::default()/* use (different) setters */,
7877 /// ]);
7878 /// ```
7879 pub fn set_multicloud_data_transfer_supported_services<T, V>(mut self, v: T) -> Self
7880 where
7881 T: std::iter::IntoIterator<Item = V>,
7882 V: std::convert::Into<crate::model::MulticloudDataTransferSupportedService>,
7883 {
7884 use std::iter::Iterator;
7885 self.multicloud_data_transfer_supported_services =
7886 v.into_iter().map(|i| i.into()).collect();
7887 self
7888 }
7889
7890 /// Sets the value of [next_page_token][crate::model::ListMulticloudDataTransferSupportedServicesResponse::next_page_token].
7891 ///
7892 /// # Example
7893 /// ```ignore,no_run
7894 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesResponse;
7895 /// let x = ListMulticloudDataTransferSupportedServicesResponse::new().set_next_page_token("example");
7896 /// ```
7897 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7898 self.next_page_token = v.into();
7899 self
7900 }
7901}
7902
7903impl wkt::message::Message for ListMulticloudDataTransferSupportedServicesResponse {
7904 fn typename() -> &'static str {
7905 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferSupportedServicesResponse"
7906 }
7907}
7908
7909#[doc(hidden)]
7910impl google_cloud_gax::paginator::internal::PageableResponse
7911 for ListMulticloudDataTransferSupportedServicesResponse
7912{
7913 type PageItem = crate::model::MulticloudDataTransferSupportedService;
7914
7915 fn items(self) -> std::vec::Vec<Self::PageItem> {
7916 self.multicloud_data_transfer_supported_services
7917 }
7918
7919 fn next_page_token(&self) -> std::string::String {
7920 use std::clone::Clone;
7921 self.next_page_token.clone()
7922 }
7923}
7924
7925/// A Network Connectivity Center hub is a global management resource to which
7926/// you attach spokes. A single hub can contain spokes from multiple regions.
7927/// However, if any of a hub's spokes use the site-to-site data transfer feature,
7928/// the resources associated with those spokes must all be in the same VPC
7929/// network. Spokes that do not use site-to-site data transfer can be associated
7930/// with any VPC network in your project.
7931#[derive(Clone, Default, PartialEq)]
7932#[non_exhaustive]
7933pub struct Hub {
7934 /// Immutable. The name of the hub. Hub names must be unique. They use the
7935 /// following form:
7936 /// `projects/{project_number}/locations/global/hubs/{hub_id}`
7937 pub name: std::string::String,
7938
7939 /// Output only. The time the hub was created.
7940 pub create_time: std::option::Option<wkt::Timestamp>,
7941
7942 /// Output only. The time the hub was last updated.
7943 pub update_time: std::option::Option<wkt::Timestamp>,
7944
7945 /// Optional labels in key-value pair format. For more information about
7946 /// labels, see [Requirements for
7947 /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
7948 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7949
7950 /// Optional. An optional description of the hub.
7951 pub description: std::string::String,
7952
7953 /// Output only. The Google-generated UUID for the hub. This value is unique
7954 /// across all hub resources. If a hub is deleted and another with the same
7955 /// name is created, the new hub is assigned a different unique_id.
7956 pub unique_id: std::string::String,
7957
7958 /// Output only. The current lifecycle state of this hub.
7959 pub state: crate::model::State,
7960
7961 /// The VPC networks associated with this hub's spokes.
7962 ///
7963 /// This field is read-only. Network Connectivity Center automatically
7964 /// populates it based on the set of spokes attached to the hub.
7965 pub routing_vpcs: std::vec::Vec<crate::model::RoutingVPC>,
7966
7967 /// Output only. The route tables that belong to this hub. They use the
7968 /// following form:
7969 /// `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}`
7970 ///
7971 /// This field is read-only. Network Connectivity Center automatically
7972 /// populates it based on the route tables nested under the hub.
7973 pub route_tables: std::vec::Vec<std::string::String>,
7974
7975 /// Output only. A summary of the spokes associated with a hub. The
7976 /// summary includes a count of spokes according to type
7977 /// and according to state. If any spokes are inactive,
7978 /// the summary also lists the reasons they are inactive,
7979 /// including a count for each reason.
7980 pub spoke_summary: std::option::Option<crate::model::SpokeSummary>,
7981
7982 /// Optional. The policy mode of this hub. This field can be either
7983 /// PRESET or CUSTOM. If unspecified, the
7984 /// policy_mode defaults to PRESET.
7985 pub policy_mode: crate::model::PolicyMode,
7986
7987 /// Optional. The topology implemented in this hub. Currently, this field is
7988 /// only used when policy_mode = PRESET. The available preset topologies are
7989 /// MESH and STAR. If preset_topology is unspecified and policy_mode = PRESET,
7990 /// the preset_topology defaults to MESH. When policy_mode = CUSTOM,
7991 /// the preset_topology is set to PRESET_TOPOLOGY_UNSPECIFIED.
7992 pub preset_topology: crate::model::PresetTopology,
7993
7994 /// Optional. Whether Private Service Connect connection propagation is enabled
7995 /// for the hub. If true, Private Service Connect endpoints in VPC spokes
7996 /// attached to the hub are made accessible to other VPC spokes attached to the
7997 /// hub. The default value is false.
7998 pub export_psc: std::option::Option<bool>,
7999
8000 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8001}
8002
8003impl Hub {
8004 /// Creates a new default instance.
8005 pub fn new() -> Self {
8006 std::default::Default::default()
8007 }
8008
8009 /// Sets the value of [name][crate::model::Hub::name].
8010 ///
8011 /// # Example
8012 /// ```ignore,no_run
8013 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8014 /// # let project_id = "project_id";
8015 /// # let hub_id = "hub_id";
8016 /// let x = Hub::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}"));
8017 /// ```
8018 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8019 self.name = v.into();
8020 self
8021 }
8022
8023 /// Sets the value of [create_time][crate::model::Hub::create_time].
8024 ///
8025 /// # Example
8026 /// ```ignore,no_run
8027 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8028 /// use wkt::Timestamp;
8029 /// let x = Hub::new().set_create_time(Timestamp::default()/* use setters */);
8030 /// ```
8031 pub fn set_create_time<T>(mut self, v: T) -> Self
8032 where
8033 T: std::convert::Into<wkt::Timestamp>,
8034 {
8035 self.create_time = std::option::Option::Some(v.into());
8036 self
8037 }
8038
8039 /// Sets or clears the value of [create_time][crate::model::Hub::create_time].
8040 ///
8041 /// # Example
8042 /// ```ignore,no_run
8043 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8044 /// use wkt::Timestamp;
8045 /// let x = Hub::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8046 /// let x = Hub::new().set_or_clear_create_time(None::<Timestamp>);
8047 /// ```
8048 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8049 where
8050 T: std::convert::Into<wkt::Timestamp>,
8051 {
8052 self.create_time = v.map(|x| x.into());
8053 self
8054 }
8055
8056 /// Sets the value of [update_time][crate::model::Hub::update_time].
8057 ///
8058 /// # Example
8059 /// ```ignore,no_run
8060 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8061 /// use wkt::Timestamp;
8062 /// let x = Hub::new().set_update_time(Timestamp::default()/* use setters */);
8063 /// ```
8064 pub fn set_update_time<T>(mut self, v: T) -> Self
8065 where
8066 T: std::convert::Into<wkt::Timestamp>,
8067 {
8068 self.update_time = std::option::Option::Some(v.into());
8069 self
8070 }
8071
8072 /// Sets or clears the value of [update_time][crate::model::Hub::update_time].
8073 ///
8074 /// # Example
8075 /// ```ignore,no_run
8076 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8077 /// use wkt::Timestamp;
8078 /// let x = Hub::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
8079 /// let x = Hub::new().set_or_clear_update_time(None::<Timestamp>);
8080 /// ```
8081 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8082 where
8083 T: std::convert::Into<wkt::Timestamp>,
8084 {
8085 self.update_time = v.map(|x| x.into());
8086 self
8087 }
8088
8089 /// Sets the value of [labels][crate::model::Hub::labels].
8090 ///
8091 /// # Example
8092 /// ```ignore,no_run
8093 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8094 /// let x = Hub::new().set_labels([
8095 /// ("key0", "abc"),
8096 /// ("key1", "xyz"),
8097 /// ]);
8098 /// ```
8099 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8100 where
8101 T: std::iter::IntoIterator<Item = (K, V)>,
8102 K: std::convert::Into<std::string::String>,
8103 V: std::convert::Into<std::string::String>,
8104 {
8105 use std::iter::Iterator;
8106 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8107 self
8108 }
8109
8110 /// Sets the value of [description][crate::model::Hub::description].
8111 ///
8112 /// # Example
8113 /// ```ignore,no_run
8114 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8115 /// let x = Hub::new().set_description("example");
8116 /// ```
8117 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8118 self.description = v.into();
8119 self
8120 }
8121
8122 /// Sets the value of [unique_id][crate::model::Hub::unique_id].
8123 ///
8124 /// # Example
8125 /// ```ignore,no_run
8126 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8127 /// let x = Hub::new().set_unique_id("example");
8128 /// ```
8129 pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8130 self.unique_id = v.into();
8131 self
8132 }
8133
8134 /// Sets the value of [state][crate::model::Hub::state].
8135 ///
8136 /// # Example
8137 /// ```ignore,no_run
8138 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8139 /// use google_cloud_networkconnectivity_v1::model::State;
8140 /// let x0 = Hub::new().set_state(State::Creating);
8141 /// let x1 = Hub::new().set_state(State::Active);
8142 /// let x2 = Hub::new().set_state(State::Deleting);
8143 /// ```
8144 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
8145 self.state = v.into();
8146 self
8147 }
8148
8149 /// Sets the value of [routing_vpcs][crate::model::Hub::routing_vpcs].
8150 ///
8151 /// # Example
8152 /// ```ignore,no_run
8153 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8154 /// use google_cloud_networkconnectivity_v1::model::RoutingVPC;
8155 /// let x = Hub::new()
8156 /// .set_routing_vpcs([
8157 /// RoutingVPC::default()/* use setters */,
8158 /// RoutingVPC::default()/* use (different) setters */,
8159 /// ]);
8160 /// ```
8161 pub fn set_routing_vpcs<T, V>(mut self, v: T) -> Self
8162 where
8163 T: std::iter::IntoIterator<Item = V>,
8164 V: std::convert::Into<crate::model::RoutingVPC>,
8165 {
8166 use std::iter::Iterator;
8167 self.routing_vpcs = v.into_iter().map(|i| i.into()).collect();
8168 self
8169 }
8170
8171 /// Sets the value of [route_tables][crate::model::Hub::route_tables].
8172 ///
8173 /// # Example
8174 /// ```ignore,no_run
8175 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8176 /// let x = Hub::new().set_route_tables(["a", "b", "c"]);
8177 /// ```
8178 pub fn set_route_tables<T, V>(mut self, v: T) -> Self
8179 where
8180 T: std::iter::IntoIterator<Item = V>,
8181 V: std::convert::Into<std::string::String>,
8182 {
8183 use std::iter::Iterator;
8184 self.route_tables = v.into_iter().map(|i| i.into()).collect();
8185 self
8186 }
8187
8188 /// Sets the value of [spoke_summary][crate::model::Hub::spoke_summary].
8189 ///
8190 /// # Example
8191 /// ```ignore,no_run
8192 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8193 /// use google_cloud_networkconnectivity_v1::model::SpokeSummary;
8194 /// let x = Hub::new().set_spoke_summary(SpokeSummary::default()/* use setters */);
8195 /// ```
8196 pub fn set_spoke_summary<T>(mut self, v: T) -> Self
8197 where
8198 T: std::convert::Into<crate::model::SpokeSummary>,
8199 {
8200 self.spoke_summary = std::option::Option::Some(v.into());
8201 self
8202 }
8203
8204 /// Sets or clears the value of [spoke_summary][crate::model::Hub::spoke_summary].
8205 ///
8206 /// # Example
8207 /// ```ignore,no_run
8208 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8209 /// use google_cloud_networkconnectivity_v1::model::SpokeSummary;
8210 /// let x = Hub::new().set_or_clear_spoke_summary(Some(SpokeSummary::default()/* use setters */));
8211 /// let x = Hub::new().set_or_clear_spoke_summary(None::<SpokeSummary>);
8212 /// ```
8213 pub fn set_or_clear_spoke_summary<T>(mut self, v: std::option::Option<T>) -> Self
8214 where
8215 T: std::convert::Into<crate::model::SpokeSummary>,
8216 {
8217 self.spoke_summary = v.map(|x| x.into());
8218 self
8219 }
8220
8221 /// Sets the value of [policy_mode][crate::model::Hub::policy_mode].
8222 ///
8223 /// # Example
8224 /// ```ignore,no_run
8225 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8226 /// use google_cloud_networkconnectivity_v1::model::PolicyMode;
8227 /// let x0 = Hub::new().set_policy_mode(PolicyMode::Preset);
8228 /// ```
8229 pub fn set_policy_mode<T: std::convert::Into<crate::model::PolicyMode>>(
8230 mut self,
8231 v: T,
8232 ) -> Self {
8233 self.policy_mode = v.into();
8234 self
8235 }
8236
8237 /// Sets the value of [preset_topology][crate::model::Hub::preset_topology].
8238 ///
8239 /// # Example
8240 /// ```ignore,no_run
8241 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8242 /// use google_cloud_networkconnectivity_v1::model::PresetTopology;
8243 /// let x0 = Hub::new().set_preset_topology(PresetTopology::Mesh);
8244 /// let x1 = Hub::new().set_preset_topology(PresetTopology::Star);
8245 /// ```
8246 pub fn set_preset_topology<T: std::convert::Into<crate::model::PresetTopology>>(
8247 mut self,
8248 v: T,
8249 ) -> Self {
8250 self.preset_topology = v.into();
8251 self
8252 }
8253
8254 /// Sets the value of [export_psc][crate::model::Hub::export_psc].
8255 ///
8256 /// # Example
8257 /// ```ignore,no_run
8258 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8259 /// let x = Hub::new().set_export_psc(true);
8260 /// ```
8261 pub fn set_export_psc<T>(mut self, v: T) -> Self
8262 where
8263 T: std::convert::Into<bool>,
8264 {
8265 self.export_psc = std::option::Option::Some(v.into());
8266 self
8267 }
8268
8269 /// Sets or clears the value of [export_psc][crate::model::Hub::export_psc].
8270 ///
8271 /// # Example
8272 /// ```ignore,no_run
8273 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8274 /// let x = Hub::new().set_or_clear_export_psc(Some(false));
8275 /// let x = Hub::new().set_or_clear_export_psc(None::<bool>);
8276 /// ```
8277 pub fn set_or_clear_export_psc<T>(mut self, v: std::option::Option<T>) -> Self
8278 where
8279 T: std::convert::Into<bool>,
8280 {
8281 self.export_psc = v.map(|x| x.into());
8282 self
8283 }
8284}
8285
8286impl wkt::message::Message for Hub {
8287 fn typename() -> &'static str {
8288 "type.googleapis.com/google.cloud.networkconnectivity.v1.Hub"
8289 }
8290}
8291
8292/// RoutingVPC contains information about the VPC networks associated
8293/// with the spokes of a Network Connectivity Center hub.
8294#[derive(Clone, Default, PartialEq)]
8295#[non_exhaustive]
8296pub struct RoutingVPC {
8297 /// The URI of the VPC network.
8298 pub uri: std::string::String,
8299
8300 /// Output only. If true, indicates that this VPC network is currently
8301 /// associated with spokes that use the data transfer feature (spokes where the
8302 /// site_to_site_data_transfer field is set to true). If you create new spokes
8303 /// that use data transfer, they must be associated with this VPC network. At
8304 /// most, one VPC network will have this field set to true.
8305 pub required_for_new_site_to_site_data_transfer_spokes: bool,
8306
8307 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8308}
8309
8310impl RoutingVPC {
8311 /// Creates a new default instance.
8312 pub fn new() -> Self {
8313 std::default::Default::default()
8314 }
8315
8316 /// Sets the value of [uri][crate::model::RoutingVPC::uri].
8317 ///
8318 /// # Example
8319 /// ```ignore,no_run
8320 /// # use google_cloud_networkconnectivity_v1::model::RoutingVPC;
8321 /// let x = RoutingVPC::new().set_uri("example");
8322 /// ```
8323 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8324 self.uri = v.into();
8325 self
8326 }
8327
8328 /// Sets the value of [required_for_new_site_to_site_data_transfer_spokes][crate::model::RoutingVPC::required_for_new_site_to_site_data_transfer_spokes].
8329 ///
8330 /// # Example
8331 /// ```ignore,no_run
8332 /// # use google_cloud_networkconnectivity_v1::model::RoutingVPC;
8333 /// let x = RoutingVPC::new().set_required_for_new_site_to_site_data_transfer_spokes(true);
8334 /// ```
8335 pub fn set_required_for_new_site_to_site_data_transfer_spokes<T: std::convert::Into<bool>>(
8336 mut self,
8337 v: T,
8338 ) -> Self {
8339 self.required_for_new_site_to_site_data_transfer_spokes = v.into();
8340 self
8341 }
8342}
8343
8344impl wkt::message::Message for RoutingVPC {
8345 fn typename() -> &'static str {
8346 "type.googleapis.com/google.cloud.networkconnectivity.v1.RoutingVPC"
8347 }
8348}
8349
8350/// A Network Connectivity Center spoke represents one or more network
8351/// connectivity resources.
8352///
8353/// When you create a spoke, you associate it with a hub. You must also
8354/// identify a value for exactly one of the following fields:
8355///
8356/// * linked_vpn_tunnels
8357/// * linked_interconnect_attachments
8358/// * linked_router_appliance_instances
8359/// * linked_vpc_network
8360#[derive(Clone, Default, PartialEq)]
8361#[non_exhaustive]
8362pub struct Spoke {
8363 /// Immutable. The name of the spoke. Spoke names must be unique. They use the
8364 /// following form:
8365 /// `projects/{project_number}/locations/{region}/spokes/{spoke_id}`
8366 pub name: std::string::String,
8367
8368 /// Output only. The time the spoke was created.
8369 pub create_time: std::option::Option<wkt::Timestamp>,
8370
8371 /// Output only. The time the spoke was last updated.
8372 pub update_time: std::option::Option<wkt::Timestamp>,
8373
8374 /// Optional labels in key-value pair format. For more information about
8375 /// labels, see [Requirements for
8376 /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
8377 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8378
8379 /// Optional. An optional description of the spoke.
8380 pub description: std::string::String,
8381
8382 /// Immutable. The name of the hub that this spoke is attached to.
8383 pub hub: std::string::String,
8384
8385 /// Optional. The name of the group that this spoke is associated with.
8386 pub group: std::string::String,
8387
8388 /// Optional. VPN tunnels that are associated with the spoke.
8389 pub linked_vpn_tunnels: std::option::Option<crate::model::LinkedVpnTunnels>,
8390
8391 /// Optional. VLAN attachments that are associated with the spoke.
8392 pub linked_interconnect_attachments:
8393 std::option::Option<crate::model::LinkedInterconnectAttachments>,
8394
8395 /// Optional. Router appliance instances that are associated with the spoke.
8396 pub linked_router_appliance_instances:
8397 std::option::Option<crate::model::LinkedRouterApplianceInstances>,
8398
8399 /// Optional. VPC network that is associated with the spoke.
8400 pub linked_vpc_network: std::option::Option<crate::model::LinkedVpcNetwork>,
8401
8402 /// Optional. The linked producer VPC that is associated with the spoke.
8403 pub linked_producer_vpc_network: std::option::Option<crate::model::LinkedProducerVpcNetwork>,
8404
8405 /// Output only. The Google-generated UUID for the spoke. This value is unique
8406 /// across all spoke resources. If a spoke is deleted and another with the same
8407 /// name is created, the new spoke is assigned a different `unique_id`.
8408 pub unique_id: std::string::String,
8409
8410 /// Output only. The current lifecycle state of this spoke.
8411 pub state: crate::model::State,
8412
8413 /// Output only. The reasons for current state of the spoke.
8414 pub reasons: std::vec::Vec<crate::model::spoke::StateReason>,
8415
8416 /// Output only. The type of resource associated with the spoke.
8417 pub spoke_type: crate::model::SpokeType,
8418
8419 /// Optional. This checksum is computed by the server based on the value of
8420 /// other fields, and may be sent on update and delete requests to ensure the
8421 /// client has an up-to-date value before proceeding.
8422 pub etag: std::string::String,
8423
8424 /// Optional. The list of fields waiting for hub administration's approval.
8425 pub field_paths_pending_update: std::vec::Vec<std::string::String>,
8426
8427 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8428}
8429
8430impl Spoke {
8431 /// Creates a new default instance.
8432 pub fn new() -> Self {
8433 std::default::Default::default()
8434 }
8435
8436 /// Sets the value of [name][crate::model::Spoke::name].
8437 ///
8438 /// # Example
8439 /// ```ignore,no_run
8440 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8441 /// # let project_id = "project_id";
8442 /// # let location_id = "location_id";
8443 /// # let spoke_id = "spoke_id";
8444 /// let x = Spoke::new().set_name(format!("projects/{project_id}/locations/{location_id}/spokes/{spoke_id}"));
8445 /// ```
8446 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8447 self.name = v.into();
8448 self
8449 }
8450
8451 /// Sets the value of [create_time][crate::model::Spoke::create_time].
8452 ///
8453 /// # Example
8454 /// ```ignore,no_run
8455 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8456 /// use wkt::Timestamp;
8457 /// let x = Spoke::new().set_create_time(Timestamp::default()/* use setters */);
8458 /// ```
8459 pub fn set_create_time<T>(mut self, v: T) -> Self
8460 where
8461 T: std::convert::Into<wkt::Timestamp>,
8462 {
8463 self.create_time = std::option::Option::Some(v.into());
8464 self
8465 }
8466
8467 /// Sets or clears the value of [create_time][crate::model::Spoke::create_time].
8468 ///
8469 /// # Example
8470 /// ```ignore,no_run
8471 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8472 /// use wkt::Timestamp;
8473 /// let x = Spoke::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8474 /// let x = Spoke::new().set_or_clear_create_time(None::<Timestamp>);
8475 /// ```
8476 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8477 where
8478 T: std::convert::Into<wkt::Timestamp>,
8479 {
8480 self.create_time = v.map(|x| x.into());
8481 self
8482 }
8483
8484 /// Sets the value of [update_time][crate::model::Spoke::update_time].
8485 ///
8486 /// # Example
8487 /// ```ignore,no_run
8488 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8489 /// use wkt::Timestamp;
8490 /// let x = Spoke::new().set_update_time(Timestamp::default()/* use setters */);
8491 /// ```
8492 pub fn set_update_time<T>(mut self, v: T) -> Self
8493 where
8494 T: std::convert::Into<wkt::Timestamp>,
8495 {
8496 self.update_time = std::option::Option::Some(v.into());
8497 self
8498 }
8499
8500 /// Sets or clears the value of [update_time][crate::model::Spoke::update_time].
8501 ///
8502 /// # Example
8503 /// ```ignore,no_run
8504 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8505 /// use wkt::Timestamp;
8506 /// let x = Spoke::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
8507 /// let x = Spoke::new().set_or_clear_update_time(None::<Timestamp>);
8508 /// ```
8509 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8510 where
8511 T: std::convert::Into<wkt::Timestamp>,
8512 {
8513 self.update_time = v.map(|x| x.into());
8514 self
8515 }
8516
8517 /// Sets the value of [labels][crate::model::Spoke::labels].
8518 ///
8519 /// # Example
8520 /// ```ignore,no_run
8521 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8522 /// let x = Spoke::new().set_labels([
8523 /// ("key0", "abc"),
8524 /// ("key1", "xyz"),
8525 /// ]);
8526 /// ```
8527 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8528 where
8529 T: std::iter::IntoIterator<Item = (K, V)>,
8530 K: std::convert::Into<std::string::String>,
8531 V: std::convert::Into<std::string::String>,
8532 {
8533 use std::iter::Iterator;
8534 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8535 self
8536 }
8537
8538 /// Sets the value of [description][crate::model::Spoke::description].
8539 ///
8540 /// # Example
8541 /// ```ignore,no_run
8542 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8543 /// let x = Spoke::new().set_description("example");
8544 /// ```
8545 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8546 self.description = v.into();
8547 self
8548 }
8549
8550 /// Sets the value of [hub][crate::model::Spoke::hub].
8551 ///
8552 /// # Example
8553 /// ```ignore,no_run
8554 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8555 /// # let project_id = "project_id";
8556 /// # let hub_id = "hub_id";
8557 /// let x = Spoke::new().set_hub(format!("projects/{project_id}/locations/global/hubs/{hub_id}"));
8558 /// ```
8559 pub fn set_hub<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8560 self.hub = v.into();
8561 self
8562 }
8563
8564 /// Sets the value of [group][crate::model::Spoke::group].
8565 ///
8566 /// # Example
8567 /// ```ignore,no_run
8568 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8569 /// # let project_id = "project_id";
8570 /// # let hub_id = "hub_id";
8571 /// # let group_id = "group_id";
8572 /// let x = Spoke::new().set_group(format!("projects/{project_id}/locations/global/hubs/{hub_id}/groups/{group_id}"));
8573 /// ```
8574 pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8575 self.group = v.into();
8576 self
8577 }
8578
8579 /// Sets the value of [linked_vpn_tunnels][crate::model::Spoke::linked_vpn_tunnels].
8580 ///
8581 /// # Example
8582 /// ```ignore,no_run
8583 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8584 /// use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
8585 /// let x = Spoke::new().set_linked_vpn_tunnels(LinkedVpnTunnels::default()/* use setters */);
8586 /// ```
8587 pub fn set_linked_vpn_tunnels<T>(mut self, v: T) -> Self
8588 where
8589 T: std::convert::Into<crate::model::LinkedVpnTunnels>,
8590 {
8591 self.linked_vpn_tunnels = std::option::Option::Some(v.into());
8592 self
8593 }
8594
8595 /// Sets or clears the value of [linked_vpn_tunnels][crate::model::Spoke::linked_vpn_tunnels].
8596 ///
8597 /// # Example
8598 /// ```ignore,no_run
8599 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8600 /// use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
8601 /// let x = Spoke::new().set_or_clear_linked_vpn_tunnels(Some(LinkedVpnTunnels::default()/* use setters */));
8602 /// let x = Spoke::new().set_or_clear_linked_vpn_tunnels(None::<LinkedVpnTunnels>);
8603 /// ```
8604 pub fn set_or_clear_linked_vpn_tunnels<T>(mut self, v: std::option::Option<T>) -> Self
8605 where
8606 T: std::convert::Into<crate::model::LinkedVpnTunnels>,
8607 {
8608 self.linked_vpn_tunnels = v.map(|x| x.into());
8609 self
8610 }
8611
8612 /// Sets the value of [linked_interconnect_attachments][crate::model::Spoke::linked_interconnect_attachments].
8613 ///
8614 /// # Example
8615 /// ```ignore,no_run
8616 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8617 /// use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
8618 /// let x = Spoke::new().set_linked_interconnect_attachments(LinkedInterconnectAttachments::default()/* use setters */);
8619 /// ```
8620 pub fn set_linked_interconnect_attachments<T>(mut self, v: T) -> Self
8621 where
8622 T: std::convert::Into<crate::model::LinkedInterconnectAttachments>,
8623 {
8624 self.linked_interconnect_attachments = std::option::Option::Some(v.into());
8625 self
8626 }
8627
8628 /// Sets or clears the value of [linked_interconnect_attachments][crate::model::Spoke::linked_interconnect_attachments].
8629 ///
8630 /// # Example
8631 /// ```ignore,no_run
8632 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8633 /// use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
8634 /// let x = Spoke::new().set_or_clear_linked_interconnect_attachments(Some(LinkedInterconnectAttachments::default()/* use setters */));
8635 /// let x = Spoke::new().set_or_clear_linked_interconnect_attachments(None::<LinkedInterconnectAttachments>);
8636 /// ```
8637 pub fn set_or_clear_linked_interconnect_attachments<T>(
8638 mut self,
8639 v: std::option::Option<T>,
8640 ) -> Self
8641 where
8642 T: std::convert::Into<crate::model::LinkedInterconnectAttachments>,
8643 {
8644 self.linked_interconnect_attachments = v.map(|x| x.into());
8645 self
8646 }
8647
8648 /// Sets the value of [linked_router_appliance_instances][crate::model::Spoke::linked_router_appliance_instances].
8649 ///
8650 /// # Example
8651 /// ```ignore,no_run
8652 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8653 /// use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
8654 /// let x = Spoke::new().set_linked_router_appliance_instances(LinkedRouterApplianceInstances::default()/* use setters */);
8655 /// ```
8656 pub fn set_linked_router_appliance_instances<T>(mut self, v: T) -> Self
8657 where
8658 T: std::convert::Into<crate::model::LinkedRouterApplianceInstances>,
8659 {
8660 self.linked_router_appliance_instances = std::option::Option::Some(v.into());
8661 self
8662 }
8663
8664 /// Sets or clears the value of [linked_router_appliance_instances][crate::model::Spoke::linked_router_appliance_instances].
8665 ///
8666 /// # Example
8667 /// ```ignore,no_run
8668 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8669 /// use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
8670 /// let x = Spoke::new().set_or_clear_linked_router_appliance_instances(Some(LinkedRouterApplianceInstances::default()/* use setters */));
8671 /// let x = Spoke::new().set_or_clear_linked_router_appliance_instances(None::<LinkedRouterApplianceInstances>);
8672 /// ```
8673 pub fn set_or_clear_linked_router_appliance_instances<T>(
8674 mut self,
8675 v: std::option::Option<T>,
8676 ) -> Self
8677 where
8678 T: std::convert::Into<crate::model::LinkedRouterApplianceInstances>,
8679 {
8680 self.linked_router_appliance_instances = v.map(|x| x.into());
8681 self
8682 }
8683
8684 /// Sets the value of [linked_vpc_network][crate::model::Spoke::linked_vpc_network].
8685 ///
8686 /// # Example
8687 /// ```ignore,no_run
8688 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8689 /// use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
8690 /// let x = Spoke::new().set_linked_vpc_network(LinkedVpcNetwork::default()/* use setters */);
8691 /// ```
8692 pub fn set_linked_vpc_network<T>(mut self, v: T) -> Self
8693 where
8694 T: std::convert::Into<crate::model::LinkedVpcNetwork>,
8695 {
8696 self.linked_vpc_network = std::option::Option::Some(v.into());
8697 self
8698 }
8699
8700 /// Sets or clears the value of [linked_vpc_network][crate::model::Spoke::linked_vpc_network].
8701 ///
8702 /// # Example
8703 /// ```ignore,no_run
8704 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8705 /// use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
8706 /// let x = Spoke::new().set_or_clear_linked_vpc_network(Some(LinkedVpcNetwork::default()/* use setters */));
8707 /// let x = Spoke::new().set_or_clear_linked_vpc_network(None::<LinkedVpcNetwork>);
8708 /// ```
8709 pub fn set_or_clear_linked_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
8710 where
8711 T: std::convert::Into<crate::model::LinkedVpcNetwork>,
8712 {
8713 self.linked_vpc_network = v.map(|x| x.into());
8714 self
8715 }
8716
8717 /// Sets the value of [linked_producer_vpc_network][crate::model::Spoke::linked_producer_vpc_network].
8718 ///
8719 /// # Example
8720 /// ```ignore,no_run
8721 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8722 /// use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
8723 /// let x = Spoke::new().set_linked_producer_vpc_network(LinkedProducerVpcNetwork::default()/* use setters */);
8724 /// ```
8725 pub fn set_linked_producer_vpc_network<T>(mut self, v: T) -> Self
8726 where
8727 T: std::convert::Into<crate::model::LinkedProducerVpcNetwork>,
8728 {
8729 self.linked_producer_vpc_network = std::option::Option::Some(v.into());
8730 self
8731 }
8732
8733 /// Sets or clears the value of [linked_producer_vpc_network][crate::model::Spoke::linked_producer_vpc_network].
8734 ///
8735 /// # Example
8736 /// ```ignore,no_run
8737 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8738 /// use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
8739 /// let x = Spoke::new().set_or_clear_linked_producer_vpc_network(Some(LinkedProducerVpcNetwork::default()/* use setters */));
8740 /// let x = Spoke::new().set_or_clear_linked_producer_vpc_network(None::<LinkedProducerVpcNetwork>);
8741 /// ```
8742 pub fn set_or_clear_linked_producer_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
8743 where
8744 T: std::convert::Into<crate::model::LinkedProducerVpcNetwork>,
8745 {
8746 self.linked_producer_vpc_network = v.map(|x| x.into());
8747 self
8748 }
8749
8750 /// Sets the value of [unique_id][crate::model::Spoke::unique_id].
8751 ///
8752 /// # Example
8753 /// ```ignore,no_run
8754 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8755 /// let x = Spoke::new().set_unique_id("example");
8756 /// ```
8757 pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8758 self.unique_id = v.into();
8759 self
8760 }
8761
8762 /// Sets the value of [state][crate::model::Spoke::state].
8763 ///
8764 /// # Example
8765 /// ```ignore,no_run
8766 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8767 /// use google_cloud_networkconnectivity_v1::model::State;
8768 /// let x0 = Spoke::new().set_state(State::Creating);
8769 /// let x1 = Spoke::new().set_state(State::Active);
8770 /// let x2 = Spoke::new().set_state(State::Deleting);
8771 /// ```
8772 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
8773 self.state = v.into();
8774 self
8775 }
8776
8777 /// Sets the value of [reasons][crate::model::Spoke::reasons].
8778 ///
8779 /// # Example
8780 /// ```ignore,no_run
8781 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8782 /// use google_cloud_networkconnectivity_v1::model::spoke::StateReason;
8783 /// let x = Spoke::new()
8784 /// .set_reasons([
8785 /// StateReason::default()/* use setters */,
8786 /// StateReason::default()/* use (different) setters */,
8787 /// ]);
8788 /// ```
8789 pub fn set_reasons<T, V>(mut self, v: T) -> Self
8790 where
8791 T: std::iter::IntoIterator<Item = V>,
8792 V: std::convert::Into<crate::model::spoke::StateReason>,
8793 {
8794 use std::iter::Iterator;
8795 self.reasons = v.into_iter().map(|i| i.into()).collect();
8796 self
8797 }
8798
8799 /// Sets the value of [spoke_type][crate::model::Spoke::spoke_type].
8800 ///
8801 /// # Example
8802 /// ```ignore,no_run
8803 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8804 /// use google_cloud_networkconnectivity_v1::model::SpokeType;
8805 /// let x0 = Spoke::new().set_spoke_type(SpokeType::VpnTunnel);
8806 /// let x1 = Spoke::new().set_spoke_type(SpokeType::InterconnectAttachment);
8807 /// let x2 = Spoke::new().set_spoke_type(SpokeType::RouterAppliance);
8808 /// ```
8809 pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(mut self, v: T) -> Self {
8810 self.spoke_type = v.into();
8811 self
8812 }
8813
8814 /// Sets the value of [etag][crate::model::Spoke::etag].
8815 ///
8816 /// # Example
8817 /// ```ignore,no_run
8818 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8819 /// let x = Spoke::new().set_etag("example");
8820 /// ```
8821 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8822 self.etag = v.into();
8823 self
8824 }
8825
8826 /// Sets the value of [field_paths_pending_update][crate::model::Spoke::field_paths_pending_update].
8827 ///
8828 /// # Example
8829 /// ```ignore,no_run
8830 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8831 /// let x = Spoke::new().set_field_paths_pending_update(["a", "b", "c"]);
8832 /// ```
8833 pub fn set_field_paths_pending_update<T, V>(mut self, v: T) -> Self
8834 where
8835 T: std::iter::IntoIterator<Item = V>,
8836 V: std::convert::Into<std::string::String>,
8837 {
8838 use std::iter::Iterator;
8839 self.field_paths_pending_update = v.into_iter().map(|i| i.into()).collect();
8840 self
8841 }
8842}
8843
8844impl wkt::message::Message for Spoke {
8845 fn typename() -> &'static str {
8846 "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke"
8847 }
8848}
8849
8850/// Defines additional types related to [Spoke].
8851pub mod spoke {
8852 #[allow(unused_imports)]
8853 use super::*;
8854
8855 /// The reason a spoke is inactive.
8856 #[derive(Clone, Default, PartialEq)]
8857 #[non_exhaustive]
8858 pub struct StateReason {
8859 /// The code associated with this reason.
8860 pub code: crate::model::spoke::state_reason::Code,
8861
8862 /// Human-readable details about this reason.
8863 pub message: std::string::String,
8864
8865 /// Additional information provided by the user in the RejectSpoke call.
8866 pub user_details: std::string::String,
8867
8868 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8869 }
8870
8871 impl StateReason {
8872 /// Creates a new default instance.
8873 pub fn new() -> Self {
8874 std::default::Default::default()
8875 }
8876
8877 /// Sets the value of [code][crate::model::spoke::StateReason::code].
8878 ///
8879 /// # Example
8880 /// ```ignore,no_run
8881 /// # use google_cloud_networkconnectivity_v1::model::spoke::StateReason;
8882 /// use google_cloud_networkconnectivity_v1::model::spoke::state_reason::Code;
8883 /// let x0 = StateReason::new().set_code(Code::PendingReview);
8884 /// let x1 = StateReason::new().set_code(Code::Rejected);
8885 /// let x2 = StateReason::new().set_code(Code::Paused);
8886 /// ```
8887 pub fn set_code<T: std::convert::Into<crate::model::spoke::state_reason::Code>>(
8888 mut self,
8889 v: T,
8890 ) -> Self {
8891 self.code = v.into();
8892 self
8893 }
8894
8895 /// Sets the value of [message][crate::model::spoke::StateReason::message].
8896 ///
8897 /// # Example
8898 /// ```ignore,no_run
8899 /// # use google_cloud_networkconnectivity_v1::model::spoke::StateReason;
8900 /// let x = StateReason::new().set_message("example");
8901 /// ```
8902 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8903 self.message = v.into();
8904 self
8905 }
8906
8907 /// Sets the value of [user_details][crate::model::spoke::StateReason::user_details].
8908 ///
8909 /// # Example
8910 /// ```ignore,no_run
8911 /// # use google_cloud_networkconnectivity_v1::model::spoke::StateReason;
8912 /// let x = StateReason::new().set_user_details("example");
8913 /// ```
8914 pub fn set_user_details<T: std::convert::Into<std::string::String>>(
8915 mut self,
8916 v: T,
8917 ) -> Self {
8918 self.user_details = v.into();
8919 self
8920 }
8921 }
8922
8923 impl wkt::message::Message for StateReason {
8924 fn typename() -> &'static str {
8925 "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke.StateReason"
8926 }
8927 }
8928
8929 /// Defines additional types related to [StateReason].
8930 pub mod state_reason {
8931 #[allow(unused_imports)]
8932 use super::*;
8933
8934 /// The Code enum represents the various reasons a state can be `INACTIVE`.
8935 ///
8936 /// # Working with unknown values
8937 ///
8938 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8939 /// additional enum variants at any time. Adding new variants is not considered
8940 /// a breaking change. Applications should write their code in anticipation of:
8941 ///
8942 /// - New values appearing in future releases of the client library, **and**
8943 /// - New values received dynamically, without application changes.
8944 ///
8945 /// Please consult the [Working with enums] section in the user guide for some
8946 /// guidelines.
8947 ///
8948 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8949 #[derive(Clone, Debug, PartialEq)]
8950 #[non_exhaustive]
8951 pub enum Code {
8952 /// No information available.
8953 Unspecified,
8954 /// The proposed spoke is pending review.
8955 PendingReview,
8956 /// The proposed spoke has been rejected by the hub administrator.
8957 Rejected,
8958 /// The spoke has been deactivated internally.
8959 Paused,
8960 /// Network Connectivity Center encountered errors while accepting
8961 /// the spoke.
8962 Failed,
8963 /// The proposed spoke update is pending review.
8964 UpdatePendingReview,
8965 /// The proposed spoke update has been rejected by the hub administrator.
8966 UpdateRejected,
8967 /// Network Connectivity Center encountered errors while accepting
8968 /// the spoke update.
8969 UpdateFailed,
8970 /// If set, the enum was initialized with an unknown value.
8971 ///
8972 /// Applications can examine the value using [Code::value] or
8973 /// [Code::name].
8974 UnknownValue(code::UnknownValue),
8975 }
8976
8977 #[doc(hidden)]
8978 pub mod code {
8979 #[allow(unused_imports)]
8980 use super::*;
8981 #[derive(Clone, Debug, PartialEq)]
8982 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8983 }
8984
8985 impl Code {
8986 /// Gets the enum value.
8987 ///
8988 /// Returns `None` if the enum contains an unknown value deserialized from
8989 /// the string representation of enums.
8990 pub fn value(&self) -> std::option::Option<i32> {
8991 match self {
8992 Self::Unspecified => std::option::Option::Some(0),
8993 Self::PendingReview => std::option::Option::Some(1),
8994 Self::Rejected => std::option::Option::Some(2),
8995 Self::Paused => std::option::Option::Some(3),
8996 Self::Failed => std::option::Option::Some(4),
8997 Self::UpdatePendingReview => std::option::Option::Some(5),
8998 Self::UpdateRejected => std::option::Option::Some(6),
8999 Self::UpdateFailed => std::option::Option::Some(7),
9000 Self::UnknownValue(u) => u.0.value(),
9001 }
9002 }
9003
9004 /// Gets the enum value as a string.
9005 ///
9006 /// Returns `None` if the enum contains an unknown value deserialized from
9007 /// the integer representation of enums.
9008 pub fn name(&self) -> std::option::Option<&str> {
9009 match self {
9010 Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
9011 Self::PendingReview => std::option::Option::Some("PENDING_REVIEW"),
9012 Self::Rejected => std::option::Option::Some("REJECTED"),
9013 Self::Paused => std::option::Option::Some("PAUSED"),
9014 Self::Failed => std::option::Option::Some("FAILED"),
9015 Self::UpdatePendingReview => std::option::Option::Some("UPDATE_PENDING_REVIEW"),
9016 Self::UpdateRejected => std::option::Option::Some("UPDATE_REJECTED"),
9017 Self::UpdateFailed => std::option::Option::Some("UPDATE_FAILED"),
9018 Self::UnknownValue(u) => u.0.name(),
9019 }
9020 }
9021 }
9022
9023 impl std::default::Default for Code {
9024 fn default() -> Self {
9025 use std::convert::From;
9026 Self::from(0)
9027 }
9028 }
9029
9030 impl std::fmt::Display for Code {
9031 fn fmt(
9032 &self,
9033 f: &mut std::fmt::Formatter<'_>,
9034 ) -> std::result::Result<(), std::fmt::Error> {
9035 wkt::internal::display_enum(f, self.name(), self.value())
9036 }
9037 }
9038
9039 impl std::convert::From<i32> for Code {
9040 fn from(value: i32) -> Self {
9041 match value {
9042 0 => Self::Unspecified,
9043 1 => Self::PendingReview,
9044 2 => Self::Rejected,
9045 3 => Self::Paused,
9046 4 => Self::Failed,
9047 5 => Self::UpdatePendingReview,
9048 6 => Self::UpdateRejected,
9049 7 => Self::UpdateFailed,
9050 _ => Self::UnknownValue(code::UnknownValue(
9051 wkt::internal::UnknownEnumValue::Integer(value),
9052 )),
9053 }
9054 }
9055 }
9056
9057 impl std::convert::From<&str> for Code {
9058 fn from(value: &str) -> Self {
9059 use std::string::ToString;
9060 match value {
9061 "CODE_UNSPECIFIED" => Self::Unspecified,
9062 "PENDING_REVIEW" => Self::PendingReview,
9063 "REJECTED" => Self::Rejected,
9064 "PAUSED" => Self::Paused,
9065 "FAILED" => Self::Failed,
9066 "UPDATE_PENDING_REVIEW" => Self::UpdatePendingReview,
9067 "UPDATE_REJECTED" => Self::UpdateRejected,
9068 "UPDATE_FAILED" => Self::UpdateFailed,
9069 _ => Self::UnknownValue(code::UnknownValue(
9070 wkt::internal::UnknownEnumValue::String(value.to_string()),
9071 )),
9072 }
9073 }
9074 }
9075
9076 impl serde::ser::Serialize for Code {
9077 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9078 where
9079 S: serde::Serializer,
9080 {
9081 match self {
9082 Self::Unspecified => serializer.serialize_i32(0),
9083 Self::PendingReview => serializer.serialize_i32(1),
9084 Self::Rejected => serializer.serialize_i32(2),
9085 Self::Paused => serializer.serialize_i32(3),
9086 Self::Failed => serializer.serialize_i32(4),
9087 Self::UpdatePendingReview => serializer.serialize_i32(5),
9088 Self::UpdateRejected => serializer.serialize_i32(6),
9089 Self::UpdateFailed => serializer.serialize_i32(7),
9090 Self::UnknownValue(u) => u.0.serialize(serializer),
9091 }
9092 }
9093 }
9094
9095 impl<'de> serde::de::Deserialize<'de> for Code {
9096 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9097 where
9098 D: serde::Deserializer<'de>,
9099 {
9100 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
9101 ".google.cloud.networkconnectivity.v1.Spoke.StateReason.Code",
9102 ))
9103 }
9104 }
9105 }
9106}
9107
9108#[allow(missing_docs)]
9109#[derive(Clone, Default, PartialEq)]
9110#[non_exhaustive]
9111pub struct RouteTable {
9112 /// Immutable. The name of the route table. Route table names must be unique.
9113 /// They use the following form:
9114 /// `projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}`
9115 pub name: std::string::String,
9116
9117 /// Output only. The time the route table was created.
9118 pub create_time: std::option::Option<wkt::Timestamp>,
9119
9120 /// Output only. The time the route table was last updated.
9121 pub update_time: std::option::Option<wkt::Timestamp>,
9122
9123 /// Optional labels in key-value pair format. For more information about
9124 /// labels, see [Requirements for
9125 /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
9126 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9127
9128 /// An optional description of the route table.
9129 pub description: std::string::String,
9130
9131 /// Output only. The Google-generated UUID for the route table. This value is
9132 /// unique across all route table resources. If a route table is deleted and
9133 /// another with the same name is created, the new route table is assigned
9134 /// a different `uid`.
9135 pub uid: std::string::String,
9136
9137 /// Output only. The current lifecycle state of this route table.
9138 pub state: crate::model::State,
9139
9140 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9141}
9142
9143impl RouteTable {
9144 /// Creates a new default instance.
9145 pub fn new() -> Self {
9146 std::default::Default::default()
9147 }
9148
9149 /// Sets the value of [name][crate::model::RouteTable::name].
9150 ///
9151 /// # Example
9152 /// ```ignore,no_run
9153 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9154 /// # let project_id = "project_id";
9155 /// # let hub_id = "hub_id";
9156 /// # let route_table_id = "route_table_id";
9157 /// let x = RouteTable::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}"));
9158 /// ```
9159 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9160 self.name = v.into();
9161 self
9162 }
9163
9164 /// Sets the value of [create_time][crate::model::RouteTable::create_time].
9165 ///
9166 /// # Example
9167 /// ```ignore,no_run
9168 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9169 /// use wkt::Timestamp;
9170 /// let x = RouteTable::new().set_create_time(Timestamp::default()/* use setters */);
9171 /// ```
9172 pub fn set_create_time<T>(mut self, v: T) -> Self
9173 where
9174 T: std::convert::Into<wkt::Timestamp>,
9175 {
9176 self.create_time = std::option::Option::Some(v.into());
9177 self
9178 }
9179
9180 /// Sets or clears the value of [create_time][crate::model::RouteTable::create_time].
9181 ///
9182 /// # Example
9183 /// ```ignore,no_run
9184 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9185 /// use wkt::Timestamp;
9186 /// let x = RouteTable::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9187 /// let x = RouteTable::new().set_or_clear_create_time(None::<Timestamp>);
9188 /// ```
9189 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9190 where
9191 T: std::convert::Into<wkt::Timestamp>,
9192 {
9193 self.create_time = v.map(|x| x.into());
9194 self
9195 }
9196
9197 /// Sets the value of [update_time][crate::model::RouteTable::update_time].
9198 ///
9199 /// # Example
9200 /// ```ignore,no_run
9201 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9202 /// use wkt::Timestamp;
9203 /// let x = RouteTable::new().set_update_time(Timestamp::default()/* use setters */);
9204 /// ```
9205 pub fn set_update_time<T>(mut self, v: T) -> Self
9206 where
9207 T: std::convert::Into<wkt::Timestamp>,
9208 {
9209 self.update_time = std::option::Option::Some(v.into());
9210 self
9211 }
9212
9213 /// Sets or clears the value of [update_time][crate::model::RouteTable::update_time].
9214 ///
9215 /// # Example
9216 /// ```ignore,no_run
9217 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9218 /// use wkt::Timestamp;
9219 /// let x = RouteTable::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9220 /// let x = RouteTable::new().set_or_clear_update_time(None::<Timestamp>);
9221 /// ```
9222 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9223 where
9224 T: std::convert::Into<wkt::Timestamp>,
9225 {
9226 self.update_time = v.map(|x| x.into());
9227 self
9228 }
9229
9230 /// Sets the value of [labels][crate::model::RouteTable::labels].
9231 ///
9232 /// # Example
9233 /// ```ignore,no_run
9234 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9235 /// let x = RouteTable::new().set_labels([
9236 /// ("key0", "abc"),
9237 /// ("key1", "xyz"),
9238 /// ]);
9239 /// ```
9240 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9241 where
9242 T: std::iter::IntoIterator<Item = (K, V)>,
9243 K: std::convert::Into<std::string::String>,
9244 V: std::convert::Into<std::string::String>,
9245 {
9246 use std::iter::Iterator;
9247 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9248 self
9249 }
9250
9251 /// Sets the value of [description][crate::model::RouteTable::description].
9252 ///
9253 /// # Example
9254 /// ```ignore,no_run
9255 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9256 /// let x = RouteTable::new().set_description("example");
9257 /// ```
9258 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9259 self.description = v.into();
9260 self
9261 }
9262
9263 /// Sets the value of [uid][crate::model::RouteTable::uid].
9264 ///
9265 /// # Example
9266 /// ```ignore,no_run
9267 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9268 /// let x = RouteTable::new().set_uid("example");
9269 /// ```
9270 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9271 self.uid = v.into();
9272 self
9273 }
9274
9275 /// Sets the value of [state][crate::model::RouteTable::state].
9276 ///
9277 /// # Example
9278 /// ```ignore,no_run
9279 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9280 /// use google_cloud_networkconnectivity_v1::model::State;
9281 /// let x0 = RouteTable::new().set_state(State::Creating);
9282 /// let x1 = RouteTable::new().set_state(State::Active);
9283 /// let x2 = RouteTable::new().set_state(State::Deleting);
9284 /// ```
9285 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
9286 self.state = v.into();
9287 self
9288 }
9289}
9290
9291impl wkt::message::Message for RouteTable {
9292 fn typename() -> &'static str {
9293 "type.googleapis.com/google.cloud.networkconnectivity.v1.RouteTable"
9294 }
9295}
9296
9297/// A route defines a path from VM instances within a spoke to a specific
9298/// destination resource. Only VPC spokes have routes.
9299#[derive(Clone, Default, PartialEq)]
9300#[non_exhaustive]
9301pub struct Route {
9302 /// Immutable. The name of the route. Route names must be unique. Route names
9303 /// use the following form:
9304 /// `projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}/routes/{route_id}`
9305 pub name: std::string::String,
9306
9307 /// Output only. The time the route was created.
9308 pub create_time: std::option::Option<wkt::Timestamp>,
9309
9310 /// Output only. The time the route was last updated.
9311 pub update_time: std::option::Option<wkt::Timestamp>,
9312
9313 /// The destination IP address range.
9314 pub ip_cidr_range: std::string::String,
9315
9316 /// Output only. The route's type. Its type is determined by the properties of
9317 /// its IP address range.
9318 pub r#type: crate::model::RouteType,
9319
9320 /// Immutable. The destination VPC network for packets on this route.
9321 pub next_hop_vpc_network: std::option::Option<crate::model::NextHopVpcNetwork>,
9322
9323 /// Optional labels in key-value pair format. For more information about
9324 /// labels, see [Requirements for
9325 /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
9326 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9327
9328 /// An optional description of the route.
9329 pub description: std::string::String,
9330
9331 /// Output only. The Google-generated UUID for the route. This value is unique
9332 /// across all Network Connectivity Center route resources. If a
9333 /// route is deleted and another with the same name is created,
9334 /// the new route is assigned a different `uid`.
9335 pub uid: std::string::String,
9336
9337 /// Output only. The current lifecycle state of the route.
9338 pub state: crate::model::State,
9339
9340 /// Immutable. The spoke that this route leads to.
9341 /// Example: projects/12345/locations/global/spokes/SPOKE
9342 pub spoke: std::string::String,
9343
9344 /// Output only. The origin location of the route.
9345 /// Uses the following form: "projects/{project}/locations/{location}"
9346 /// Example: projects/1234/locations/us-central1
9347 pub location: std::string::String,
9348
9349 /// Output only. The priority of this route. Priority is used to break ties in
9350 /// cases where a destination matches more than one route. In these cases the
9351 /// route with the lowest-numbered priority value wins.
9352 pub priority: i64,
9353
9354 /// Immutable. The next-hop VPN tunnel for packets on this route.
9355 pub next_hop_vpn_tunnel: std::option::Option<crate::model::NextHopVPNTunnel>,
9356
9357 /// Immutable. The next-hop Router appliance instance for packets on this
9358 /// route.
9359 pub next_hop_router_appliance_instance:
9360 std::option::Option<crate::model::NextHopRouterApplianceInstance>,
9361
9362 /// Immutable. The next-hop VLAN attachment for packets on this route.
9363 pub next_hop_interconnect_attachment:
9364 std::option::Option<crate::model::NextHopInterconnectAttachment>,
9365
9366 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9367}
9368
9369impl Route {
9370 /// Creates a new default instance.
9371 pub fn new() -> Self {
9372 std::default::Default::default()
9373 }
9374
9375 /// Sets the value of [name][crate::model::Route::name].
9376 ///
9377 /// # Example
9378 /// ```ignore,no_run
9379 /// # use google_cloud_networkconnectivity_v1::model::Route;
9380 /// # let project_id = "project_id";
9381 /// # let hub_id = "hub_id";
9382 /// # let route_table_id = "route_table_id";
9383 /// # let route_id = "route_id";
9384 /// let x = Route::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}/routes/{route_id}"));
9385 /// ```
9386 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9387 self.name = v.into();
9388 self
9389 }
9390
9391 /// Sets the value of [create_time][crate::model::Route::create_time].
9392 ///
9393 /// # Example
9394 /// ```ignore,no_run
9395 /// # use google_cloud_networkconnectivity_v1::model::Route;
9396 /// use wkt::Timestamp;
9397 /// let x = Route::new().set_create_time(Timestamp::default()/* use setters */);
9398 /// ```
9399 pub fn set_create_time<T>(mut self, v: T) -> Self
9400 where
9401 T: std::convert::Into<wkt::Timestamp>,
9402 {
9403 self.create_time = std::option::Option::Some(v.into());
9404 self
9405 }
9406
9407 /// Sets or clears the value of [create_time][crate::model::Route::create_time].
9408 ///
9409 /// # Example
9410 /// ```ignore,no_run
9411 /// # use google_cloud_networkconnectivity_v1::model::Route;
9412 /// use wkt::Timestamp;
9413 /// let x = Route::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9414 /// let x = Route::new().set_or_clear_create_time(None::<Timestamp>);
9415 /// ```
9416 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9417 where
9418 T: std::convert::Into<wkt::Timestamp>,
9419 {
9420 self.create_time = v.map(|x| x.into());
9421 self
9422 }
9423
9424 /// Sets the value of [update_time][crate::model::Route::update_time].
9425 ///
9426 /// # Example
9427 /// ```ignore,no_run
9428 /// # use google_cloud_networkconnectivity_v1::model::Route;
9429 /// use wkt::Timestamp;
9430 /// let x = Route::new().set_update_time(Timestamp::default()/* use setters */);
9431 /// ```
9432 pub fn set_update_time<T>(mut self, v: T) -> Self
9433 where
9434 T: std::convert::Into<wkt::Timestamp>,
9435 {
9436 self.update_time = std::option::Option::Some(v.into());
9437 self
9438 }
9439
9440 /// Sets or clears the value of [update_time][crate::model::Route::update_time].
9441 ///
9442 /// # Example
9443 /// ```ignore,no_run
9444 /// # use google_cloud_networkconnectivity_v1::model::Route;
9445 /// use wkt::Timestamp;
9446 /// let x = Route::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9447 /// let x = Route::new().set_or_clear_update_time(None::<Timestamp>);
9448 /// ```
9449 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9450 where
9451 T: std::convert::Into<wkt::Timestamp>,
9452 {
9453 self.update_time = v.map(|x| x.into());
9454 self
9455 }
9456
9457 /// Sets the value of [ip_cidr_range][crate::model::Route::ip_cidr_range].
9458 ///
9459 /// # Example
9460 /// ```ignore,no_run
9461 /// # use google_cloud_networkconnectivity_v1::model::Route;
9462 /// let x = Route::new().set_ip_cidr_range("example");
9463 /// ```
9464 pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9465 self.ip_cidr_range = v.into();
9466 self
9467 }
9468
9469 /// Sets the value of [r#type][crate::model::Route::type].
9470 ///
9471 /// # Example
9472 /// ```ignore,no_run
9473 /// # use google_cloud_networkconnectivity_v1::model::Route;
9474 /// use google_cloud_networkconnectivity_v1::model::RouteType;
9475 /// let x0 = Route::new().set_type(RouteType::VpcPrimarySubnet);
9476 /// let x1 = Route::new().set_type(RouteType::VpcSecondarySubnet);
9477 /// let x2 = Route::new().set_type(RouteType::DynamicRoute);
9478 /// ```
9479 pub fn set_type<T: std::convert::Into<crate::model::RouteType>>(mut self, v: T) -> Self {
9480 self.r#type = v.into();
9481 self
9482 }
9483
9484 /// Sets the value of [next_hop_vpc_network][crate::model::Route::next_hop_vpc_network].
9485 ///
9486 /// # Example
9487 /// ```ignore,no_run
9488 /// # use google_cloud_networkconnectivity_v1::model::Route;
9489 /// use google_cloud_networkconnectivity_v1::model::NextHopVpcNetwork;
9490 /// let x = Route::new().set_next_hop_vpc_network(NextHopVpcNetwork::default()/* use setters */);
9491 /// ```
9492 pub fn set_next_hop_vpc_network<T>(mut self, v: T) -> Self
9493 where
9494 T: std::convert::Into<crate::model::NextHopVpcNetwork>,
9495 {
9496 self.next_hop_vpc_network = std::option::Option::Some(v.into());
9497 self
9498 }
9499
9500 /// Sets or clears the value of [next_hop_vpc_network][crate::model::Route::next_hop_vpc_network].
9501 ///
9502 /// # Example
9503 /// ```ignore,no_run
9504 /// # use google_cloud_networkconnectivity_v1::model::Route;
9505 /// use google_cloud_networkconnectivity_v1::model::NextHopVpcNetwork;
9506 /// let x = Route::new().set_or_clear_next_hop_vpc_network(Some(NextHopVpcNetwork::default()/* use setters */));
9507 /// let x = Route::new().set_or_clear_next_hop_vpc_network(None::<NextHopVpcNetwork>);
9508 /// ```
9509 pub fn set_or_clear_next_hop_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
9510 where
9511 T: std::convert::Into<crate::model::NextHopVpcNetwork>,
9512 {
9513 self.next_hop_vpc_network = v.map(|x| x.into());
9514 self
9515 }
9516
9517 /// Sets the value of [labels][crate::model::Route::labels].
9518 ///
9519 /// # Example
9520 /// ```ignore,no_run
9521 /// # use google_cloud_networkconnectivity_v1::model::Route;
9522 /// let x = Route::new().set_labels([
9523 /// ("key0", "abc"),
9524 /// ("key1", "xyz"),
9525 /// ]);
9526 /// ```
9527 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9528 where
9529 T: std::iter::IntoIterator<Item = (K, V)>,
9530 K: std::convert::Into<std::string::String>,
9531 V: std::convert::Into<std::string::String>,
9532 {
9533 use std::iter::Iterator;
9534 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9535 self
9536 }
9537
9538 /// Sets the value of [description][crate::model::Route::description].
9539 ///
9540 /// # Example
9541 /// ```ignore,no_run
9542 /// # use google_cloud_networkconnectivity_v1::model::Route;
9543 /// let x = Route::new().set_description("example");
9544 /// ```
9545 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9546 self.description = v.into();
9547 self
9548 }
9549
9550 /// Sets the value of [uid][crate::model::Route::uid].
9551 ///
9552 /// # Example
9553 /// ```ignore,no_run
9554 /// # use google_cloud_networkconnectivity_v1::model::Route;
9555 /// let x = Route::new().set_uid("example");
9556 /// ```
9557 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9558 self.uid = v.into();
9559 self
9560 }
9561
9562 /// Sets the value of [state][crate::model::Route::state].
9563 ///
9564 /// # Example
9565 /// ```ignore,no_run
9566 /// # use google_cloud_networkconnectivity_v1::model::Route;
9567 /// use google_cloud_networkconnectivity_v1::model::State;
9568 /// let x0 = Route::new().set_state(State::Creating);
9569 /// let x1 = Route::new().set_state(State::Active);
9570 /// let x2 = Route::new().set_state(State::Deleting);
9571 /// ```
9572 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
9573 self.state = v.into();
9574 self
9575 }
9576
9577 /// Sets the value of [spoke][crate::model::Route::spoke].
9578 ///
9579 /// # Example
9580 /// ```ignore,no_run
9581 /// # use google_cloud_networkconnectivity_v1::model::Route;
9582 /// # let project_id = "project_id";
9583 /// # let location_id = "location_id";
9584 /// # let spoke_id = "spoke_id";
9585 /// let x = Route::new().set_spoke(format!("projects/{project_id}/locations/{location_id}/spokes/{spoke_id}"));
9586 /// ```
9587 pub fn set_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9588 self.spoke = v.into();
9589 self
9590 }
9591
9592 /// Sets the value of [location][crate::model::Route::location].
9593 ///
9594 /// # Example
9595 /// ```ignore,no_run
9596 /// # use google_cloud_networkconnectivity_v1::model::Route;
9597 /// let x = Route::new().set_location("example");
9598 /// ```
9599 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9600 self.location = v.into();
9601 self
9602 }
9603
9604 /// Sets the value of [priority][crate::model::Route::priority].
9605 ///
9606 /// # Example
9607 /// ```ignore,no_run
9608 /// # use google_cloud_networkconnectivity_v1::model::Route;
9609 /// let x = Route::new().set_priority(42);
9610 /// ```
9611 pub fn set_priority<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9612 self.priority = v.into();
9613 self
9614 }
9615
9616 /// Sets the value of [next_hop_vpn_tunnel][crate::model::Route::next_hop_vpn_tunnel].
9617 ///
9618 /// # Example
9619 /// ```ignore,no_run
9620 /// # use google_cloud_networkconnectivity_v1::model::Route;
9621 /// use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
9622 /// let x = Route::new().set_next_hop_vpn_tunnel(NextHopVPNTunnel::default()/* use setters */);
9623 /// ```
9624 pub fn set_next_hop_vpn_tunnel<T>(mut self, v: T) -> Self
9625 where
9626 T: std::convert::Into<crate::model::NextHopVPNTunnel>,
9627 {
9628 self.next_hop_vpn_tunnel = std::option::Option::Some(v.into());
9629 self
9630 }
9631
9632 /// Sets or clears the value of [next_hop_vpn_tunnel][crate::model::Route::next_hop_vpn_tunnel].
9633 ///
9634 /// # Example
9635 /// ```ignore,no_run
9636 /// # use google_cloud_networkconnectivity_v1::model::Route;
9637 /// use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
9638 /// let x = Route::new().set_or_clear_next_hop_vpn_tunnel(Some(NextHopVPNTunnel::default()/* use setters */));
9639 /// let x = Route::new().set_or_clear_next_hop_vpn_tunnel(None::<NextHopVPNTunnel>);
9640 /// ```
9641 pub fn set_or_clear_next_hop_vpn_tunnel<T>(mut self, v: std::option::Option<T>) -> Self
9642 where
9643 T: std::convert::Into<crate::model::NextHopVPNTunnel>,
9644 {
9645 self.next_hop_vpn_tunnel = v.map(|x| x.into());
9646 self
9647 }
9648
9649 /// Sets the value of [next_hop_router_appliance_instance][crate::model::Route::next_hop_router_appliance_instance].
9650 ///
9651 /// # Example
9652 /// ```ignore,no_run
9653 /// # use google_cloud_networkconnectivity_v1::model::Route;
9654 /// use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
9655 /// let x = Route::new().set_next_hop_router_appliance_instance(NextHopRouterApplianceInstance::default()/* use setters */);
9656 /// ```
9657 pub fn set_next_hop_router_appliance_instance<T>(mut self, v: T) -> Self
9658 where
9659 T: std::convert::Into<crate::model::NextHopRouterApplianceInstance>,
9660 {
9661 self.next_hop_router_appliance_instance = std::option::Option::Some(v.into());
9662 self
9663 }
9664
9665 /// Sets or clears the value of [next_hop_router_appliance_instance][crate::model::Route::next_hop_router_appliance_instance].
9666 ///
9667 /// # Example
9668 /// ```ignore,no_run
9669 /// # use google_cloud_networkconnectivity_v1::model::Route;
9670 /// use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
9671 /// let x = Route::new().set_or_clear_next_hop_router_appliance_instance(Some(NextHopRouterApplianceInstance::default()/* use setters */));
9672 /// let x = Route::new().set_or_clear_next_hop_router_appliance_instance(None::<NextHopRouterApplianceInstance>);
9673 /// ```
9674 pub fn set_or_clear_next_hop_router_appliance_instance<T>(
9675 mut self,
9676 v: std::option::Option<T>,
9677 ) -> Self
9678 where
9679 T: std::convert::Into<crate::model::NextHopRouterApplianceInstance>,
9680 {
9681 self.next_hop_router_appliance_instance = v.map(|x| x.into());
9682 self
9683 }
9684
9685 /// Sets the value of [next_hop_interconnect_attachment][crate::model::Route::next_hop_interconnect_attachment].
9686 ///
9687 /// # Example
9688 /// ```ignore,no_run
9689 /// # use google_cloud_networkconnectivity_v1::model::Route;
9690 /// use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
9691 /// let x = Route::new().set_next_hop_interconnect_attachment(NextHopInterconnectAttachment::default()/* use setters */);
9692 /// ```
9693 pub fn set_next_hop_interconnect_attachment<T>(mut self, v: T) -> Self
9694 where
9695 T: std::convert::Into<crate::model::NextHopInterconnectAttachment>,
9696 {
9697 self.next_hop_interconnect_attachment = std::option::Option::Some(v.into());
9698 self
9699 }
9700
9701 /// Sets or clears the value of [next_hop_interconnect_attachment][crate::model::Route::next_hop_interconnect_attachment].
9702 ///
9703 /// # Example
9704 /// ```ignore,no_run
9705 /// # use google_cloud_networkconnectivity_v1::model::Route;
9706 /// use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
9707 /// let x = Route::new().set_or_clear_next_hop_interconnect_attachment(Some(NextHopInterconnectAttachment::default()/* use setters */));
9708 /// let x = Route::new().set_or_clear_next_hop_interconnect_attachment(None::<NextHopInterconnectAttachment>);
9709 /// ```
9710 pub fn set_or_clear_next_hop_interconnect_attachment<T>(
9711 mut self,
9712 v: std::option::Option<T>,
9713 ) -> Self
9714 where
9715 T: std::convert::Into<crate::model::NextHopInterconnectAttachment>,
9716 {
9717 self.next_hop_interconnect_attachment = v.map(|x| x.into());
9718 self
9719 }
9720}
9721
9722impl wkt::message::Message for Route {
9723 fn typename() -> &'static str {
9724 "type.googleapis.com/google.cloud.networkconnectivity.v1.Route"
9725 }
9726}
9727
9728/// A group represents a subset of spokes attached to a hub.
9729#[derive(Clone, Default, PartialEq)]
9730#[non_exhaustive]
9731pub struct Group {
9732 /// Immutable. The name of the group. Group names must be unique. They
9733 /// use the following form:
9734 /// `projects/{project_number}/locations/global/hubs/{hub}/groups/{group_id}`
9735 pub name: std::string::String,
9736
9737 /// Output only. The time the group was created.
9738 pub create_time: std::option::Option<wkt::Timestamp>,
9739
9740 /// Output only. The time the group was last updated.
9741 pub update_time: std::option::Option<wkt::Timestamp>,
9742
9743 /// Optional. Labels in key-value pair format. For more information about
9744 /// labels, see [Requirements for
9745 /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
9746 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9747
9748 /// Optional. The description of the group.
9749 pub description: std::string::String,
9750
9751 /// Output only. The Google-generated UUID for the group. This value is unique
9752 /// across all group resources. If a group is deleted and
9753 /// another with the same name is created, the new route table is assigned
9754 /// a different unique_id.
9755 pub uid: std::string::String,
9756
9757 /// Output only. The current lifecycle state of this group.
9758 pub state: crate::model::State,
9759
9760 /// Optional. The auto-accept setting for this group.
9761 pub auto_accept: std::option::Option<crate::model::AutoAccept>,
9762
9763 /// Output only. The name of the route table that corresponds to this group.
9764 /// They use the following form:
9765 /// `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}`
9766 pub route_table: std::string::String,
9767
9768 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9769}
9770
9771impl Group {
9772 /// Creates a new default instance.
9773 pub fn new() -> Self {
9774 std::default::Default::default()
9775 }
9776
9777 /// Sets the value of [name][crate::model::Group::name].
9778 ///
9779 /// # Example
9780 /// ```ignore,no_run
9781 /// # use google_cloud_networkconnectivity_v1::model::Group;
9782 /// # let project_id = "project_id";
9783 /// # let hub_id = "hub_id";
9784 /// # let group_id = "group_id";
9785 /// let x = Group::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}/groups/{group_id}"));
9786 /// ```
9787 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9788 self.name = v.into();
9789 self
9790 }
9791
9792 /// Sets the value of [create_time][crate::model::Group::create_time].
9793 ///
9794 /// # Example
9795 /// ```ignore,no_run
9796 /// # use google_cloud_networkconnectivity_v1::model::Group;
9797 /// use wkt::Timestamp;
9798 /// let x = Group::new().set_create_time(Timestamp::default()/* use setters */);
9799 /// ```
9800 pub fn set_create_time<T>(mut self, v: T) -> Self
9801 where
9802 T: std::convert::Into<wkt::Timestamp>,
9803 {
9804 self.create_time = std::option::Option::Some(v.into());
9805 self
9806 }
9807
9808 /// Sets or clears the value of [create_time][crate::model::Group::create_time].
9809 ///
9810 /// # Example
9811 /// ```ignore,no_run
9812 /// # use google_cloud_networkconnectivity_v1::model::Group;
9813 /// use wkt::Timestamp;
9814 /// let x = Group::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9815 /// let x = Group::new().set_or_clear_create_time(None::<Timestamp>);
9816 /// ```
9817 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9818 where
9819 T: std::convert::Into<wkt::Timestamp>,
9820 {
9821 self.create_time = v.map(|x| x.into());
9822 self
9823 }
9824
9825 /// Sets the value of [update_time][crate::model::Group::update_time].
9826 ///
9827 /// # Example
9828 /// ```ignore,no_run
9829 /// # use google_cloud_networkconnectivity_v1::model::Group;
9830 /// use wkt::Timestamp;
9831 /// let x = Group::new().set_update_time(Timestamp::default()/* use setters */);
9832 /// ```
9833 pub fn set_update_time<T>(mut self, v: T) -> Self
9834 where
9835 T: std::convert::Into<wkt::Timestamp>,
9836 {
9837 self.update_time = std::option::Option::Some(v.into());
9838 self
9839 }
9840
9841 /// Sets or clears the value of [update_time][crate::model::Group::update_time].
9842 ///
9843 /// # Example
9844 /// ```ignore,no_run
9845 /// # use google_cloud_networkconnectivity_v1::model::Group;
9846 /// use wkt::Timestamp;
9847 /// let x = Group::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9848 /// let x = Group::new().set_or_clear_update_time(None::<Timestamp>);
9849 /// ```
9850 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9851 where
9852 T: std::convert::Into<wkt::Timestamp>,
9853 {
9854 self.update_time = v.map(|x| x.into());
9855 self
9856 }
9857
9858 /// Sets the value of [labels][crate::model::Group::labels].
9859 ///
9860 /// # Example
9861 /// ```ignore,no_run
9862 /// # use google_cloud_networkconnectivity_v1::model::Group;
9863 /// let x = Group::new().set_labels([
9864 /// ("key0", "abc"),
9865 /// ("key1", "xyz"),
9866 /// ]);
9867 /// ```
9868 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9869 where
9870 T: std::iter::IntoIterator<Item = (K, V)>,
9871 K: std::convert::Into<std::string::String>,
9872 V: std::convert::Into<std::string::String>,
9873 {
9874 use std::iter::Iterator;
9875 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9876 self
9877 }
9878
9879 /// Sets the value of [description][crate::model::Group::description].
9880 ///
9881 /// # Example
9882 /// ```ignore,no_run
9883 /// # use google_cloud_networkconnectivity_v1::model::Group;
9884 /// let x = Group::new().set_description("example");
9885 /// ```
9886 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9887 self.description = v.into();
9888 self
9889 }
9890
9891 /// Sets the value of [uid][crate::model::Group::uid].
9892 ///
9893 /// # Example
9894 /// ```ignore,no_run
9895 /// # use google_cloud_networkconnectivity_v1::model::Group;
9896 /// let x = Group::new().set_uid("example");
9897 /// ```
9898 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9899 self.uid = v.into();
9900 self
9901 }
9902
9903 /// Sets the value of [state][crate::model::Group::state].
9904 ///
9905 /// # Example
9906 /// ```ignore,no_run
9907 /// # use google_cloud_networkconnectivity_v1::model::Group;
9908 /// use google_cloud_networkconnectivity_v1::model::State;
9909 /// let x0 = Group::new().set_state(State::Creating);
9910 /// let x1 = Group::new().set_state(State::Active);
9911 /// let x2 = Group::new().set_state(State::Deleting);
9912 /// ```
9913 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
9914 self.state = v.into();
9915 self
9916 }
9917
9918 /// Sets the value of [auto_accept][crate::model::Group::auto_accept].
9919 ///
9920 /// # Example
9921 /// ```ignore,no_run
9922 /// # use google_cloud_networkconnectivity_v1::model::Group;
9923 /// use google_cloud_networkconnectivity_v1::model::AutoAccept;
9924 /// let x = Group::new().set_auto_accept(AutoAccept::default()/* use setters */);
9925 /// ```
9926 pub fn set_auto_accept<T>(mut self, v: T) -> Self
9927 where
9928 T: std::convert::Into<crate::model::AutoAccept>,
9929 {
9930 self.auto_accept = std::option::Option::Some(v.into());
9931 self
9932 }
9933
9934 /// Sets or clears the value of [auto_accept][crate::model::Group::auto_accept].
9935 ///
9936 /// # Example
9937 /// ```ignore,no_run
9938 /// # use google_cloud_networkconnectivity_v1::model::Group;
9939 /// use google_cloud_networkconnectivity_v1::model::AutoAccept;
9940 /// let x = Group::new().set_or_clear_auto_accept(Some(AutoAccept::default()/* use setters */));
9941 /// let x = Group::new().set_or_clear_auto_accept(None::<AutoAccept>);
9942 /// ```
9943 pub fn set_or_clear_auto_accept<T>(mut self, v: std::option::Option<T>) -> Self
9944 where
9945 T: std::convert::Into<crate::model::AutoAccept>,
9946 {
9947 self.auto_accept = v.map(|x| x.into());
9948 self
9949 }
9950
9951 /// Sets the value of [route_table][crate::model::Group::route_table].
9952 ///
9953 /// # Example
9954 /// ```ignore,no_run
9955 /// # use google_cloud_networkconnectivity_v1::model::Group;
9956 /// let x = Group::new().set_route_table("example");
9957 /// ```
9958 pub fn set_route_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9959 self.route_table = v.into();
9960 self
9961 }
9962}
9963
9964impl wkt::message::Message for Group {
9965 fn typename() -> &'static str {
9966 "type.googleapis.com/google.cloud.networkconnectivity.v1.Group"
9967 }
9968}
9969
9970/// The auto-accept setting for a group controls whether
9971/// proposed spokes are automatically attached to the hub. If auto-accept is
9972/// enabled, the spoke immediately is attached to the hub and becomes part of the
9973/// group. In this case, the new spoke is in the ACTIVE state.
9974/// If auto-accept is disabled, the spoke goes to the INACTIVE
9975/// state, and it must be reviewed and accepted by a hub
9976/// administrator.
9977#[derive(Clone, Default, PartialEq)]
9978#[non_exhaustive]
9979pub struct AutoAccept {
9980 /// Optional. A list of project ids or project numbers for which you want
9981 /// to enable auto-accept. The auto-accept setting is applied to
9982 /// spokes being created or updated in these projects.
9983 pub auto_accept_projects: std::vec::Vec<std::string::String>,
9984
9985 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9986}
9987
9988impl AutoAccept {
9989 /// Creates a new default instance.
9990 pub fn new() -> Self {
9991 std::default::Default::default()
9992 }
9993
9994 /// Sets the value of [auto_accept_projects][crate::model::AutoAccept::auto_accept_projects].
9995 ///
9996 /// # Example
9997 /// ```ignore,no_run
9998 /// # use google_cloud_networkconnectivity_v1::model::AutoAccept;
9999 /// let x = AutoAccept::new().set_auto_accept_projects(["a", "b", "c"]);
10000 /// ```
10001 pub fn set_auto_accept_projects<T, V>(mut self, v: T) -> Self
10002 where
10003 T: std::iter::IntoIterator<Item = V>,
10004 V: std::convert::Into<std::string::String>,
10005 {
10006 use std::iter::Iterator;
10007 self.auto_accept_projects = v.into_iter().map(|i| i.into()).collect();
10008 self
10009 }
10010}
10011
10012impl wkt::message::Message for AutoAccept {
10013 fn typename() -> &'static str {
10014 "type.googleapis.com/google.cloud.networkconnectivity.v1.AutoAccept"
10015 }
10016}
10017
10018/// Request for
10019/// [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs]
10020/// method.
10021///
10022/// [google.cloud.networkconnectivity.v1.HubService.ListHubs]: crate::client::HubService::list_hubs
10023#[derive(Clone, Default, PartialEq)]
10024#[non_exhaustive]
10025pub struct ListHubsRequest {
10026 /// Required. The parent resource's name.
10027 pub parent: std::string::String,
10028
10029 /// The maximum number of results per page to return.
10030 pub page_size: i32,
10031
10032 /// The page token.
10033 pub page_token: std::string::String,
10034
10035 /// An expression that filters the list of results.
10036 pub filter: std::string::String,
10037
10038 /// Sort the results by a certain order.
10039 pub order_by: std::string::String,
10040
10041 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10042}
10043
10044impl ListHubsRequest {
10045 /// Creates a new default instance.
10046 pub fn new() -> Self {
10047 std::default::Default::default()
10048 }
10049
10050 /// Sets the value of [parent][crate::model::ListHubsRequest::parent].
10051 ///
10052 /// # Example
10053 /// ```ignore,no_run
10054 /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
10055 /// let x = ListHubsRequest::new().set_parent("example");
10056 /// ```
10057 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10058 self.parent = v.into();
10059 self
10060 }
10061
10062 /// Sets the value of [page_size][crate::model::ListHubsRequest::page_size].
10063 ///
10064 /// # Example
10065 /// ```ignore,no_run
10066 /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
10067 /// let x = ListHubsRequest::new().set_page_size(42);
10068 /// ```
10069 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10070 self.page_size = v.into();
10071 self
10072 }
10073
10074 /// Sets the value of [page_token][crate::model::ListHubsRequest::page_token].
10075 ///
10076 /// # Example
10077 /// ```ignore,no_run
10078 /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
10079 /// let x = ListHubsRequest::new().set_page_token("example");
10080 /// ```
10081 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10082 self.page_token = v.into();
10083 self
10084 }
10085
10086 /// Sets the value of [filter][crate::model::ListHubsRequest::filter].
10087 ///
10088 /// # Example
10089 /// ```ignore,no_run
10090 /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
10091 /// let x = ListHubsRequest::new().set_filter("example");
10092 /// ```
10093 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10094 self.filter = v.into();
10095 self
10096 }
10097
10098 /// Sets the value of [order_by][crate::model::ListHubsRequest::order_by].
10099 ///
10100 /// # Example
10101 /// ```ignore,no_run
10102 /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
10103 /// let x = ListHubsRequest::new().set_order_by("example");
10104 /// ```
10105 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10106 self.order_by = v.into();
10107 self
10108 }
10109}
10110
10111impl wkt::message::Message for ListHubsRequest {
10112 fn typename() -> &'static str {
10113 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsRequest"
10114 }
10115}
10116
10117/// Response for
10118/// [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs]
10119/// method.
10120///
10121/// [google.cloud.networkconnectivity.v1.HubService.ListHubs]: crate::client::HubService::list_hubs
10122#[derive(Clone, Default, PartialEq)]
10123#[non_exhaustive]
10124pub struct ListHubsResponse {
10125 /// The requested hubs.
10126 pub hubs: std::vec::Vec<crate::model::Hub>,
10127
10128 /// The token for the next page of the response. To see more results,
10129 /// use this value as the page_token for your next request. If this value
10130 /// is empty, there are no more results.
10131 pub next_page_token: std::string::String,
10132
10133 /// Locations that could not be reached.
10134 pub unreachable: std::vec::Vec<std::string::String>,
10135
10136 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10137}
10138
10139impl ListHubsResponse {
10140 /// Creates a new default instance.
10141 pub fn new() -> Self {
10142 std::default::Default::default()
10143 }
10144
10145 /// Sets the value of [hubs][crate::model::ListHubsResponse::hubs].
10146 ///
10147 /// # Example
10148 /// ```ignore,no_run
10149 /// # use google_cloud_networkconnectivity_v1::model::ListHubsResponse;
10150 /// use google_cloud_networkconnectivity_v1::model::Hub;
10151 /// let x = ListHubsResponse::new()
10152 /// .set_hubs([
10153 /// Hub::default()/* use setters */,
10154 /// Hub::default()/* use (different) setters */,
10155 /// ]);
10156 /// ```
10157 pub fn set_hubs<T, V>(mut self, v: T) -> Self
10158 where
10159 T: std::iter::IntoIterator<Item = V>,
10160 V: std::convert::Into<crate::model::Hub>,
10161 {
10162 use std::iter::Iterator;
10163 self.hubs = v.into_iter().map(|i| i.into()).collect();
10164 self
10165 }
10166
10167 /// Sets the value of [next_page_token][crate::model::ListHubsResponse::next_page_token].
10168 ///
10169 /// # Example
10170 /// ```ignore,no_run
10171 /// # use google_cloud_networkconnectivity_v1::model::ListHubsResponse;
10172 /// let x = ListHubsResponse::new().set_next_page_token("example");
10173 /// ```
10174 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10175 self.next_page_token = v.into();
10176 self
10177 }
10178
10179 /// Sets the value of [unreachable][crate::model::ListHubsResponse::unreachable].
10180 ///
10181 /// # Example
10182 /// ```ignore,no_run
10183 /// # use google_cloud_networkconnectivity_v1::model::ListHubsResponse;
10184 /// let x = ListHubsResponse::new().set_unreachable(["a", "b", "c"]);
10185 /// ```
10186 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10187 where
10188 T: std::iter::IntoIterator<Item = V>,
10189 V: std::convert::Into<std::string::String>,
10190 {
10191 use std::iter::Iterator;
10192 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10193 self
10194 }
10195}
10196
10197impl wkt::message::Message for ListHubsResponse {
10198 fn typename() -> &'static str {
10199 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsResponse"
10200 }
10201}
10202
10203#[doc(hidden)]
10204impl google_cloud_gax::paginator::internal::PageableResponse for ListHubsResponse {
10205 type PageItem = crate::model::Hub;
10206
10207 fn items(self) -> std::vec::Vec<Self::PageItem> {
10208 self.hubs
10209 }
10210
10211 fn next_page_token(&self) -> std::string::String {
10212 use std::clone::Clone;
10213 self.next_page_token.clone()
10214 }
10215}
10216
10217/// Request for
10218/// [HubService.GetHub][google.cloud.networkconnectivity.v1.HubService.GetHub]
10219/// method.
10220///
10221/// [google.cloud.networkconnectivity.v1.HubService.GetHub]: crate::client::HubService::get_hub
10222#[derive(Clone, Default, PartialEq)]
10223#[non_exhaustive]
10224pub struct GetHubRequest {
10225 /// Required. The name of the hub resource to get.
10226 pub name: std::string::String,
10227
10228 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10229}
10230
10231impl GetHubRequest {
10232 /// Creates a new default instance.
10233 pub fn new() -> Self {
10234 std::default::Default::default()
10235 }
10236
10237 /// Sets the value of [name][crate::model::GetHubRequest::name].
10238 ///
10239 /// # Example
10240 /// ```ignore,no_run
10241 /// # use google_cloud_networkconnectivity_v1::model::GetHubRequest;
10242 /// # let project_id = "project_id";
10243 /// # let hub_id = "hub_id";
10244 /// let x = GetHubRequest::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}"));
10245 /// ```
10246 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10247 self.name = v.into();
10248 self
10249 }
10250}
10251
10252impl wkt::message::Message for GetHubRequest {
10253 fn typename() -> &'static str {
10254 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetHubRequest"
10255 }
10256}
10257
10258/// Request for
10259/// [HubService.CreateHub][google.cloud.networkconnectivity.v1.HubService.CreateHub]
10260/// method.
10261///
10262/// [google.cloud.networkconnectivity.v1.HubService.CreateHub]: crate::client::HubService::create_hub
10263#[derive(Clone, Default, PartialEq)]
10264#[non_exhaustive]
10265pub struct CreateHubRequest {
10266 /// Required. The parent resource.
10267 pub parent: std::string::String,
10268
10269 /// Required. A unique identifier for the hub.
10270 pub hub_id: std::string::String,
10271
10272 /// Required. The initial values for a new hub.
10273 pub hub: std::option::Option<crate::model::Hub>,
10274
10275 /// Optional. A request ID to identify requests. Specify a unique request ID so
10276 /// that if you must retry your request, the server knows to ignore the request
10277 /// if it has already been completed. The server guarantees that a request
10278 /// doesn't result in creation of duplicate commitments for at least 60
10279 /// minutes.
10280 ///
10281 /// For example, consider a situation where you make an initial request and
10282 /// the request times out. If you make the request again with the same request
10283 /// ID, the server can check to see whether the original operation
10284 /// was received. If it was, the server ignores the second request. This
10285 /// behavior prevents clients from mistakenly creating duplicate commitments.
10286 ///
10287 /// The request ID must be a valid UUID, with the exception that zero UUID is
10288 /// not supported (00000000-0000-0000-0000-000000000000).
10289 pub request_id: std::string::String,
10290
10291 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10292}
10293
10294impl CreateHubRequest {
10295 /// Creates a new default instance.
10296 pub fn new() -> Self {
10297 std::default::Default::default()
10298 }
10299
10300 /// Sets the value of [parent][crate::model::CreateHubRequest::parent].
10301 ///
10302 /// # Example
10303 /// ```ignore,no_run
10304 /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10305 /// let x = CreateHubRequest::new().set_parent("example");
10306 /// ```
10307 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10308 self.parent = v.into();
10309 self
10310 }
10311
10312 /// Sets the value of [hub_id][crate::model::CreateHubRequest::hub_id].
10313 ///
10314 /// # Example
10315 /// ```ignore,no_run
10316 /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10317 /// let x = CreateHubRequest::new().set_hub_id("example");
10318 /// ```
10319 pub fn set_hub_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10320 self.hub_id = v.into();
10321 self
10322 }
10323
10324 /// Sets the value of [hub][crate::model::CreateHubRequest::hub].
10325 ///
10326 /// # Example
10327 /// ```ignore,no_run
10328 /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10329 /// use google_cloud_networkconnectivity_v1::model::Hub;
10330 /// let x = CreateHubRequest::new().set_hub(Hub::default()/* use setters */);
10331 /// ```
10332 pub fn set_hub<T>(mut self, v: T) -> Self
10333 where
10334 T: std::convert::Into<crate::model::Hub>,
10335 {
10336 self.hub = std::option::Option::Some(v.into());
10337 self
10338 }
10339
10340 /// Sets or clears the value of [hub][crate::model::CreateHubRequest::hub].
10341 ///
10342 /// # Example
10343 /// ```ignore,no_run
10344 /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10345 /// use google_cloud_networkconnectivity_v1::model::Hub;
10346 /// let x = CreateHubRequest::new().set_or_clear_hub(Some(Hub::default()/* use setters */));
10347 /// let x = CreateHubRequest::new().set_or_clear_hub(None::<Hub>);
10348 /// ```
10349 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
10350 where
10351 T: std::convert::Into<crate::model::Hub>,
10352 {
10353 self.hub = v.map(|x| x.into());
10354 self
10355 }
10356
10357 /// Sets the value of [request_id][crate::model::CreateHubRequest::request_id].
10358 ///
10359 /// # Example
10360 /// ```ignore,no_run
10361 /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10362 /// let x = CreateHubRequest::new().set_request_id("example");
10363 /// ```
10364 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10365 self.request_id = v.into();
10366 self
10367 }
10368}
10369
10370impl wkt::message::Message for CreateHubRequest {
10371 fn typename() -> &'static str {
10372 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateHubRequest"
10373 }
10374}
10375
10376/// Request for
10377/// [HubService.UpdateHub][google.cloud.networkconnectivity.v1.HubService.UpdateHub]
10378/// method.
10379///
10380/// [google.cloud.networkconnectivity.v1.HubService.UpdateHub]: crate::client::HubService::update_hub
10381#[derive(Clone, Default, PartialEq)]
10382#[non_exhaustive]
10383pub struct UpdateHubRequest {
10384 /// Optional. In the case of an update to an existing hub, field mask is used
10385 /// to specify the fields to be overwritten. The fields specified in the
10386 /// update_mask are relative to the resource, not the full request. A field is
10387 /// overwritten if it is in the mask. If the user does not provide a mask, then
10388 /// all fields are overwritten.
10389 pub update_mask: std::option::Option<wkt::FieldMask>,
10390
10391 /// Required. The state that the hub should be in after the update.
10392 pub hub: std::option::Option<crate::model::Hub>,
10393
10394 /// Optional. A request ID to identify requests. Specify a unique request ID so
10395 /// that if you must retry your request, the server knows to ignore the request
10396 /// if it has already been completed. The server guarantees that a request
10397 /// doesn't result in creation of duplicate commitments for at least 60
10398 /// minutes.
10399 ///
10400 /// For example, consider a situation where you make an initial request and
10401 /// the request times out. If you make the request again with the same request
10402 /// ID, the server can check to see whether the original operation
10403 /// was received. If it was, the server ignores the second request. This
10404 /// behavior prevents clients from mistakenly creating duplicate commitments.
10405 ///
10406 /// The request ID must be a valid UUID, with the exception that zero UUID is
10407 /// not supported (00000000-0000-0000-0000-000000000000).
10408 pub request_id: std::string::String,
10409
10410 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10411}
10412
10413impl UpdateHubRequest {
10414 /// Creates a new default instance.
10415 pub fn new() -> Self {
10416 std::default::Default::default()
10417 }
10418
10419 /// Sets the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
10420 ///
10421 /// # Example
10422 /// ```ignore,no_run
10423 /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10424 /// use wkt::FieldMask;
10425 /// let x = UpdateHubRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10426 /// ```
10427 pub fn set_update_mask<T>(mut self, v: T) -> Self
10428 where
10429 T: std::convert::Into<wkt::FieldMask>,
10430 {
10431 self.update_mask = std::option::Option::Some(v.into());
10432 self
10433 }
10434
10435 /// Sets or clears the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
10436 ///
10437 /// # Example
10438 /// ```ignore,no_run
10439 /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10440 /// use wkt::FieldMask;
10441 /// let x = UpdateHubRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10442 /// let x = UpdateHubRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10443 /// ```
10444 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10445 where
10446 T: std::convert::Into<wkt::FieldMask>,
10447 {
10448 self.update_mask = v.map(|x| x.into());
10449 self
10450 }
10451
10452 /// Sets the value of [hub][crate::model::UpdateHubRequest::hub].
10453 ///
10454 /// # Example
10455 /// ```ignore,no_run
10456 /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10457 /// use google_cloud_networkconnectivity_v1::model::Hub;
10458 /// let x = UpdateHubRequest::new().set_hub(Hub::default()/* use setters */);
10459 /// ```
10460 pub fn set_hub<T>(mut self, v: T) -> Self
10461 where
10462 T: std::convert::Into<crate::model::Hub>,
10463 {
10464 self.hub = std::option::Option::Some(v.into());
10465 self
10466 }
10467
10468 /// Sets or clears the value of [hub][crate::model::UpdateHubRequest::hub].
10469 ///
10470 /// # Example
10471 /// ```ignore,no_run
10472 /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10473 /// use google_cloud_networkconnectivity_v1::model::Hub;
10474 /// let x = UpdateHubRequest::new().set_or_clear_hub(Some(Hub::default()/* use setters */));
10475 /// let x = UpdateHubRequest::new().set_or_clear_hub(None::<Hub>);
10476 /// ```
10477 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
10478 where
10479 T: std::convert::Into<crate::model::Hub>,
10480 {
10481 self.hub = v.map(|x| x.into());
10482 self
10483 }
10484
10485 /// Sets the value of [request_id][crate::model::UpdateHubRequest::request_id].
10486 ///
10487 /// # Example
10488 /// ```ignore,no_run
10489 /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10490 /// let x = UpdateHubRequest::new().set_request_id("example");
10491 /// ```
10492 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10493 self.request_id = v.into();
10494 self
10495 }
10496}
10497
10498impl wkt::message::Message for UpdateHubRequest {
10499 fn typename() -> &'static str {
10500 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateHubRequest"
10501 }
10502}
10503
10504/// The request for
10505/// [HubService.DeleteHub][google.cloud.networkconnectivity.v1.HubService.DeleteHub].
10506///
10507/// [google.cloud.networkconnectivity.v1.HubService.DeleteHub]: crate::client::HubService::delete_hub
10508#[derive(Clone, Default, PartialEq)]
10509#[non_exhaustive]
10510pub struct DeleteHubRequest {
10511 /// Required. The name of the hub to delete.
10512 pub name: std::string::String,
10513
10514 /// Optional. A request ID to identify requests. Specify a unique request ID so
10515 /// that if you must retry your request, the server knows to ignore the request
10516 /// if it has already been completed. The server guarantees that a request
10517 /// doesn't result in creation of duplicate commitments for at least 60
10518 /// minutes.
10519 ///
10520 /// For example, consider a situation where you make an initial request and
10521 /// the request times out. If you make the request again with the same request
10522 /// ID, the server can check to see whether the original operation
10523 /// was received. If it was, the server ignores the second request. This
10524 /// behavior prevents clients from mistakenly creating duplicate commitments.
10525 ///
10526 /// The request ID must be a valid UUID, with the exception that zero UUID is
10527 /// not supported (00000000-0000-0000-0000-000000000000).
10528 pub request_id: std::string::String,
10529
10530 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10531}
10532
10533impl DeleteHubRequest {
10534 /// Creates a new default instance.
10535 pub fn new() -> Self {
10536 std::default::Default::default()
10537 }
10538
10539 /// Sets the value of [name][crate::model::DeleteHubRequest::name].
10540 ///
10541 /// # Example
10542 /// ```ignore,no_run
10543 /// # use google_cloud_networkconnectivity_v1::model::DeleteHubRequest;
10544 /// # let project_id = "project_id";
10545 /// # let hub_id = "hub_id";
10546 /// let x = DeleteHubRequest::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}"));
10547 /// ```
10548 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10549 self.name = v.into();
10550 self
10551 }
10552
10553 /// Sets the value of [request_id][crate::model::DeleteHubRequest::request_id].
10554 ///
10555 /// # Example
10556 /// ```ignore,no_run
10557 /// # use google_cloud_networkconnectivity_v1::model::DeleteHubRequest;
10558 /// let x = DeleteHubRequest::new().set_request_id("example");
10559 /// ```
10560 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10561 self.request_id = v.into();
10562 self
10563 }
10564}
10565
10566impl wkt::message::Message for DeleteHubRequest {
10567 fn typename() -> &'static str {
10568 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteHubRequest"
10569 }
10570}
10571
10572/// The request for
10573/// [HubService.ListHubSpokes][google.cloud.networkconnectivity.v1.HubService.ListHubSpokes].
10574///
10575/// [google.cloud.networkconnectivity.v1.HubService.ListHubSpokes]: crate::client::HubService::list_hub_spokes
10576#[derive(Clone, Default, PartialEq)]
10577#[non_exhaustive]
10578pub struct ListHubSpokesRequest {
10579 /// Required. The name of the hub.
10580 pub name: std::string::String,
10581
10582 /// A list of locations.
10583 /// Specify one of the following: `[global]`, a single region (for
10584 /// example, `[us-central1]`), or a combination of
10585 /// values (for example, `[global, us-central1, us-west1]`).
10586 /// If the spoke_locations field is populated, the list of results
10587 /// includes only spokes in the specified location.
10588 /// If the spoke_locations field is not populated, the list of results
10589 /// includes spokes in all locations.
10590 pub spoke_locations: std::vec::Vec<std::string::String>,
10591
10592 /// The maximum number of results to return per page.
10593 pub page_size: i32,
10594
10595 /// The page token.
10596 pub page_token: std::string::String,
10597
10598 /// An expression that filters the list of results.
10599 pub filter: std::string::String,
10600
10601 /// Sort the results by name or create_time.
10602 pub order_by: std::string::String,
10603
10604 /// The view of the spoke to return.
10605 /// The view that you use determines which spoke fields are included in the
10606 /// response.
10607 pub view: crate::model::list_hub_spokes_request::SpokeView,
10608
10609 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10610}
10611
10612impl ListHubSpokesRequest {
10613 /// Creates a new default instance.
10614 pub fn new() -> Self {
10615 std::default::Default::default()
10616 }
10617
10618 /// Sets the value of [name][crate::model::ListHubSpokesRequest::name].
10619 ///
10620 /// # Example
10621 /// ```ignore,no_run
10622 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10623 /// # let project_id = "project_id";
10624 /// # let hub_id = "hub_id";
10625 /// let x = ListHubSpokesRequest::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}"));
10626 /// ```
10627 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10628 self.name = v.into();
10629 self
10630 }
10631
10632 /// Sets the value of [spoke_locations][crate::model::ListHubSpokesRequest::spoke_locations].
10633 ///
10634 /// # Example
10635 /// ```ignore,no_run
10636 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10637 /// let x = ListHubSpokesRequest::new().set_spoke_locations(["a", "b", "c"]);
10638 /// ```
10639 pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
10640 where
10641 T: std::iter::IntoIterator<Item = V>,
10642 V: std::convert::Into<std::string::String>,
10643 {
10644 use std::iter::Iterator;
10645 self.spoke_locations = v.into_iter().map(|i| i.into()).collect();
10646 self
10647 }
10648
10649 /// Sets the value of [page_size][crate::model::ListHubSpokesRequest::page_size].
10650 ///
10651 /// # Example
10652 /// ```ignore,no_run
10653 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10654 /// let x = ListHubSpokesRequest::new().set_page_size(42);
10655 /// ```
10656 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10657 self.page_size = v.into();
10658 self
10659 }
10660
10661 /// Sets the value of [page_token][crate::model::ListHubSpokesRequest::page_token].
10662 ///
10663 /// # Example
10664 /// ```ignore,no_run
10665 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10666 /// let x = ListHubSpokesRequest::new().set_page_token("example");
10667 /// ```
10668 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10669 self.page_token = v.into();
10670 self
10671 }
10672
10673 /// Sets the value of [filter][crate::model::ListHubSpokesRequest::filter].
10674 ///
10675 /// # Example
10676 /// ```ignore,no_run
10677 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10678 /// let x = ListHubSpokesRequest::new().set_filter("example");
10679 /// ```
10680 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10681 self.filter = v.into();
10682 self
10683 }
10684
10685 /// Sets the value of [order_by][crate::model::ListHubSpokesRequest::order_by].
10686 ///
10687 /// # Example
10688 /// ```ignore,no_run
10689 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10690 /// let x = ListHubSpokesRequest::new().set_order_by("example");
10691 /// ```
10692 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10693 self.order_by = v.into();
10694 self
10695 }
10696
10697 /// Sets the value of [view][crate::model::ListHubSpokesRequest::view].
10698 ///
10699 /// # Example
10700 /// ```ignore,no_run
10701 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10702 /// use google_cloud_networkconnectivity_v1::model::list_hub_spokes_request::SpokeView;
10703 /// let x0 = ListHubSpokesRequest::new().set_view(SpokeView::Basic);
10704 /// let x1 = ListHubSpokesRequest::new().set_view(SpokeView::Detailed);
10705 /// ```
10706 pub fn set_view<T: std::convert::Into<crate::model::list_hub_spokes_request::SpokeView>>(
10707 mut self,
10708 v: T,
10709 ) -> Self {
10710 self.view = v.into();
10711 self
10712 }
10713}
10714
10715impl wkt::message::Message for ListHubSpokesRequest {
10716 fn typename() -> &'static str {
10717 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesRequest"
10718 }
10719}
10720
10721/// Defines additional types related to [ListHubSpokesRequest].
10722pub mod list_hub_spokes_request {
10723 #[allow(unused_imports)]
10724 use super::*;
10725
10726 /// Enum that controls which spoke fields are included in the response.
10727 ///
10728 /// # Working with unknown values
10729 ///
10730 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10731 /// additional enum variants at any time. Adding new variants is not considered
10732 /// a breaking change. Applications should write their code in anticipation of:
10733 ///
10734 /// - New values appearing in future releases of the client library, **and**
10735 /// - New values received dynamically, without application changes.
10736 ///
10737 /// Please consult the [Working with enums] section in the user guide for some
10738 /// guidelines.
10739 ///
10740 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10741 #[derive(Clone, Debug, PartialEq)]
10742 #[non_exhaustive]
10743 pub enum SpokeView {
10744 /// The spoke view is unspecified. When the spoke view is unspecified, the
10745 /// API returns the same fields as the `BASIC` view.
10746 Unspecified,
10747 /// Includes `name`, `create_time`, `hub`, `unique_id`, `state`, `reasons`,
10748 /// and `spoke_type`. This is the default value.
10749 Basic,
10750 /// Includes all spoke fields except `labels`.
10751 /// You can use the `DETAILED` view only when you set the `spoke_locations`
10752 /// field to `[global]`.
10753 Detailed,
10754 /// If set, the enum was initialized with an unknown value.
10755 ///
10756 /// Applications can examine the value using [SpokeView::value] or
10757 /// [SpokeView::name].
10758 UnknownValue(spoke_view::UnknownValue),
10759 }
10760
10761 #[doc(hidden)]
10762 pub mod spoke_view {
10763 #[allow(unused_imports)]
10764 use super::*;
10765 #[derive(Clone, Debug, PartialEq)]
10766 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10767 }
10768
10769 impl SpokeView {
10770 /// Gets the enum value.
10771 ///
10772 /// Returns `None` if the enum contains an unknown value deserialized from
10773 /// the string representation of enums.
10774 pub fn value(&self) -> std::option::Option<i32> {
10775 match self {
10776 Self::Unspecified => std::option::Option::Some(0),
10777 Self::Basic => std::option::Option::Some(1),
10778 Self::Detailed => std::option::Option::Some(2),
10779 Self::UnknownValue(u) => u.0.value(),
10780 }
10781 }
10782
10783 /// Gets the enum value as a string.
10784 ///
10785 /// Returns `None` if the enum contains an unknown value deserialized from
10786 /// the integer representation of enums.
10787 pub fn name(&self) -> std::option::Option<&str> {
10788 match self {
10789 Self::Unspecified => std::option::Option::Some("SPOKE_VIEW_UNSPECIFIED"),
10790 Self::Basic => std::option::Option::Some("BASIC"),
10791 Self::Detailed => std::option::Option::Some("DETAILED"),
10792 Self::UnknownValue(u) => u.0.name(),
10793 }
10794 }
10795 }
10796
10797 impl std::default::Default for SpokeView {
10798 fn default() -> Self {
10799 use std::convert::From;
10800 Self::from(0)
10801 }
10802 }
10803
10804 impl std::fmt::Display for SpokeView {
10805 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10806 wkt::internal::display_enum(f, self.name(), self.value())
10807 }
10808 }
10809
10810 impl std::convert::From<i32> for SpokeView {
10811 fn from(value: i32) -> Self {
10812 match value {
10813 0 => Self::Unspecified,
10814 1 => Self::Basic,
10815 2 => Self::Detailed,
10816 _ => Self::UnknownValue(spoke_view::UnknownValue(
10817 wkt::internal::UnknownEnumValue::Integer(value),
10818 )),
10819 }
10820 }
10821 }
10822
10823 impl std::convert::From<&str> for SpokeView {
10824 fn from(value: &str) -> Self {
10825 use std::string::ToString;
10826 match value {
10827 "SPOKE_VIEW_UNSPECIFIED" => Self::Unspecified,
10828 "BASIC" => Self::Basic,
10829 "DETAILED" => Self::Detailed,
10830 _ => Self::UnknownValue(spoke_view::UnknownValue(
10831 wkt::internal::UnknownEnumValue::String(value.to_string()),
10832 )),
10833 }
10834 }
10835 }
10836
10837 impl serde::ser::Serialize for SpokeView {
10838 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10839 where
10840 S: serde::Serializer,
10841 {
10842 match self {
10843 Self::Unspecified => serializer.serialize_i32(0),
10844 Self::Basic => serializer.serialize_i32(1),
10845 Self::Detailed => serializer.serialize_i32(2),
10846 Self::UnknownValue(u) => u.0.serialize(serializer),
10847 }
10848 }
10849 }
10850
10851 impl<'de> serde::de::Deserialize<'de> for SpokeView {
10852 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10853 where
10854 D: serde::Deserializer<'de>,
10855 {
10856 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpokeView>::new(
10857 ".google.cloud.networkconnectivity.v1.ListHubSpokesRequest.SpokeView",
10858 ))
10859 }
10860 }
10861}
10862
10863/// The response for
10864/// [HubService.ListHubSpokes][google.cloud.networkconnectivity.v1.HubService.ListHubSpokes].
10865///
10866/// [google.cloud.networkconnectivity.v1.HubService.ListHubSpokes]: crate::client::HubService::list_hub_spokes
10867#[derive(Clone, Default, PartialEq)]
10868#[non_exhaustive]
10869pub struct ListHubSpokesResponse {
10870 /// The requested spokes.
10871 /// The spoke fields can be partially populated based on the `view` field in
10872 /// the request message.
10873 pub spokes: std::vec::Vec<crate::model::Spoke>,
10874
10875 /// The token for the next page of the response. To see more results,
10876 /// use this value as the page_token for your next request. If this value
10877 /// is empty, there are no more results.
10878 pub next_page_token: std::string::String,
10879
10880 /// Locations that could not be reached.
10881 pub unreachable: std::vec::Vec<std::string::String>,
10882
10883 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10884}
10885
10886impl ListHubSpokesResponse {
10887 /// Creates a new default instance.
10888 pub fn new() -> Self {
10889 std::default::Default::default()
10890 }
10891
10892 /// Sets the value of [spokes][crate::model::ListHubSpokesResponse::spokes].
10893 ///
10894 /// # Example
10895 /// ```ignore,no_run
10896 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesResponse;
10897 /// use google_cloud_networkconnectivity_v1::model::Spoke;
10898 /// let x = ListHubSpokesResponse::new()
10899 /// .set_spokes([
10900 /// Spoke::default()/* use setters */,
10901 /// Spoke::default()/* use (different) setters */,
10902 /// ]);
10903 /// ```
10904 pub fn set_spokes<T, V>(mut self, v: T) -> Self
10905 where
10906 T: std::iter::IntoIterator<Item = V>,
10907 V: std::convert::Into<crate::model::Spoke>,
10908 {
10909 use std::iter::Iterator;
10910 self.spokes = v.into_iter().map(|i| i.into()).collect();
10911 self
10912 }
10913
10914 /// Sets the value of [next_page_token][crate::model::ListHubSpokesResponse::next_page_token].
10915 ///
10916 /// # Example
10917 /// ```ignore,no_run
10918 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesResponse;
10919 /// let x = ListHubSpokesResponse::new().set_next_page_token("example");
10920 /// ```
10921 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10922 self.next_page_token = v.into();
10923 self
10924 }
10925
10926 /// Sets the value of [unreachable][crate::model::ListHubSpokesResponse::unreachable].
10927 ///
10928 /// # Example
10929 /// ```ignore,no_run
10930 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesResponse;
10931 /// let x = ListHubSpokesResponse::new().set_unreachable(["a", "b", "c"]);
10932 /// ```
10933 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10934 where
10935 T: std::iter::IntoIterator<Item = V>,
10936 V: std::convert::Into<std::string::String>,
10937 {
10938 use std::iter::Iterator;
10939 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10940 self
10941 }
10942}
10943
10944impl wkt::message::Message for ListHubSpokesResponse {
10945 fn typename() -> &'static str {
10946 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesResponse"
10947 }
10948}
10949
10950#[doc(hidden)]
10951impl google_cloud_gax::paginator::internal::PageableResponse for ListHubSpokesResponse {
10952 type PageItem = crate::model::Spoke;
10953
10954 fn items(self) -> std::vec::Vec<Self::PageItem> {
10955 self.spokes
10956 }
10957
10958 fn next_page_token(&self) -> std::string::String {
10959 use std::clone::Clone;
10960 self.next_page_token.clone()
10961 }
10962}
10963
10964/// The request for
10965/// [HubService.QueryHubStatus][google.cloud.networkconnectivity.v1.HubService.QueryHubStatus].
10966///
10967/// [google.cloud.networkconnectivity.v1.HubService.QueryHubStatus]: crate::client::HubService::query_hub_status
10968#[derive(Clone, Default, PartialEq)]
10969#[non_exhaustive]
10970pub struct QueryHubStatusRequest {
10971 /// Required. The name of the hub.
10972 pub name: std::string::String,
10973
10974 /// Optional. The maximum number of results to return per page.
10975 pub page_size: i32,
10976
10977 /// Optional. The page token.
10978 pub page_token: std::string::String,
10979
10980 /// Optional. An expression that filters the list of results.
10981 /// The filter can be used to filter the results by the following fields:
10982 ///
10983 /// * `psc_propagation_status.source_spoke`
10984 /// * `psc_propagation_status.source_group`
10985 /// * `psc_propagation_status.source_forwarding_rule`
10986 /// * `psc_propagation_status.target_spoke`
10987 /// * `psc_propagation_status.target_group`
10988 /// * `psc_propagation_status.code`
10989 /// * `psc_propagation_status.message`
10990 pub filter: std::string::String,
10991
10992 /// Optional. Sort the results in ascending order by the specified fields.
10993 /// A comma-separated list of any of these fields:
10994 ///
10995 /// * `psc_propagation_status.source_spoke`
10996 /// * `psc_propagation_status.source_group`
10997 /// * `psc_propagation_status.source_forwarding_rule`
10998 /// * `psc_propagation_status.target_spoke`
10999 /// * `psc_propagation_status.target_group`
11000 /// * `psc_propagation_status.code`
11001 /// If `group_by` is set, the value of the `order_by` field must be the
11002 /// same as or a subset of the `group_by` field.
11003 pub order_by: std::string::String,
11004
11005 /// Optional. Aggregate the results by the specified fields.
11006 /// A comma-separated list of any of these fields:
11007 ///
11008 /// * `psc_propagation_status.source_spoke`
11009 /// * `psc_propagation_status.source_group`
11010 /// * `psc_propagation_status.source_forwarding_rule`
11011 /// * `psc_propagation_status.target_spoke`
11012 /// * `psc_propagation_status.target_group`
11013 /// * `psc_propagation_status.code`
11014 pub group_by: std::string::String,
11015
11016 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11017}
11018
11019impl QueryHubStatusRequest {
11020 /// Creates a new default instance.
11021 pub fn new() -> Self {
11022 std::default::Default::default()
11023 }
11024
11025 /// Sets the value of [name][crate::model::QueryHubStatusRequest::name].
11026 ///
11027 /// # Example
11028 /// ```ignore,no_run
11029 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
11030 /// # let project_id = "project_id";
11031 /// # let hub_id = "hub_id";
11032 /// let x = QueryHubStatusRequest::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}"));
11033 /// ```
11034 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11035 self.name = v.into();
11036 self
11037 }
11038
11039 /// Sets the value of [page_size][crate::model::QueryHubStatusRequest::page_size].
11040 ///
11041 /// # Example
11042 /// ```ignore,no_run
11043 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
11044 /// let x = QueryHubStatusRequest::new().set_page_size(42);
11045 /// ```
11046 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11047 self.page_size = v.into();
11048 self
11049 }
11050
11051 /// Sets the value of [page_token][crate::model::QueryHubStatusRequest::page_token].
11052 ///
11053 /// # Example
11054 /// ```ignore,no_run
11055 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
11056 /// let x = QueryHubStatusRequest::new().set_page_token("example");
11057 /// ```
11058 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11059 self.page_token = v.into();
11060 self
11061 }
11062
11063 /// Sets the value of [filter][crate::model::QueryHubStatusRequest::filter].
11064 ///
11065 /// # Example
11066 /// ```ignore,no_run
11067 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
11068 /// let x = QueryHubStatusRequest::new().set_filter("example");
11069 /// ```
11070 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11071 self.filter = v.into();
11072 self
11073 }
11074
11075 /// Sets the value of [order_by][crate::model::QueryHubStatusRequest::order_by].
11076 ///
11077 /// # Example
11078 /// ```ignore,no_run
11079 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
11080 /// let x = QueryHubStatusRequest::new().set_order_by("example");
11081 /// ```
11082 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11083 self.order_by = v.into();
11084 self
11085 }
11086
11087 /// Sets the value of [group_by][crate::model::QueryHubStatusRequest::group_by].
11088 ///
11089 /// # Example
11090 /// ```ignore,no_run
11091 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
11092 /// let x = QueryHubStatusRequest::new().set_group_by("example");
11093 /// ```
11094 pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11095 self.group_by = v.into();
11096 self
11097 }
11098}
11099
11100impl wkt::message::Message for QueryHubStatusRequest {
11101 fn typename() -> &'static str {
11102 "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusRequest"
11103 }
11104}
11105
11106/// The response for
11107/// [HubService.QueryHubStatus][google.cloud.networkconnectivity.v1.HubService.QueryHubStatus].
11108///
11109/// [google.cloud.networkconnectivity.v1.HubService.QueryHubStatus]: crate::client::HubService::query_hub_status
11110#[derive(Clone, Default, PartialEq)]
11111#[non_exhaustive]
11112pub struct QueryHubStatusResponse {
11113 /// The list of hub status.
11114 pub hub_status_entries: std::vec::Vec<crate::model::HubStatusEntry>,
11115
11116 /// The token for the next page of the response. To see more results,
11117 /// use this value as the page_token for your next request. If this value
11118 /// is empty, there are no more results.
11119 pub next_page_token: std::string::String,
11120
11121 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11122}
11123
11124impl QueryHubStatusResponse {
11125 /// Creates a new default instance.
11126 pub fn new() -> Self {
11127 std::default::Default::default()
11128 }
11129
11130 /// Sets the value of [hub_status_entries][crate::model::QueryHubStatusResponse::hub_status_entries].
11131 ///
11132 /// # Example
11133 /// ```ignore,no_run
11134 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusResponse;
11135 /// use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11136 /// let x = QueryHubStatusResponse::new()
11137 /// .set_hub_status_entries([
11138 /// HubStatusEntry::default()/* use setters */,
11139 /// HubStatusEntry::default()/* use (different) setters */,
11140 /// ]);
11141 /// ```
11142 pub fn set_hub_status_entries<T, V>(mut self, v: T) -> Self
11143 where
11144 T: std::iter::IntoIterator<Item = V>,
11145 V: std::convert::Into<crate::model::HubStatusEntry>,
11146 {
11147 use std::iter::Iterator;
11148 self.hub_status_entries = v.into_iter().map(|i| i.into()).collect();
11149 self
11150 }
11151
11152 /// Sets the value of [next_page_token][crate::model::QueryHubStatusResponse::next_page_token].
11153 ///
11154 /// # Example
11155 /// ```ignore,no_run
11156 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusResponse;
11157 /// let x = QueryHubStatusResponse::new().set_next_page_token("example");
11158 /// ```
11159 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11160 self.next_page_token = v.into();
11161 self
11162 }
11163}
11164
11165impl wkt::message::Message for QueryHubStatusResponse {
11166 fn typename() -> &'static str {
11167 "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusResponse"
11168 }
11169}
11170
11171#[doc(hidden)]
11172impl google_cloud_gax::paginator::internal::PageableResponse for QueryHubStatusResponse {
11173 type PageItem = crate::model::HubStatusEntry;
11174
11175 fn items(self) -> std::vec::Vec<Self::PageItem> {
11176 self.hub_status_entries
11177 }
11178
11179 fn next_page_token(&self) -> std::string::String {
11180 use std::clone::Clone;
11181 self.next_page_token.clone()
11182 }
11183}
11184
11185/// A hub status entry represents the status of a set of propagated Private
11186/// Service Connect connections grouped by certain fields.
11187#[derive(Clone, Default, PartialEq)]
11188#[non_exhaustive]
11189pub struct HubStatusEntry {
11190 /// The number of propagated Private Service Connect connections with this
11191 /// status. If the `group_by` field was not set in the request message, the
11192 /// value of this field is 1.
11193 pub count: i32,
11194
11195 /// The fields that this entry is grouped by. This has the same value as the
11196 /// `group_by` field in the request message.
11197 pub group_by: std::string::String,
11198
11199 /// The Private Service Connect propagation status.
11200 pub psc_propagation_status: std::option::Option<crate::model::PscPropagationStatus>,
11201
11202 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11203}
11204
11205impl HubStatusEntry {
11206 /// Creates a new default instance.
11207 pub fn new() -> Self {
11208 std::default::Default::default()
11209 }
11210
11211 /// Sets the value of [count][crate::model::HubStatusEntry::count].
11212 ///
11213 /// # Example
11214 /// ```ignore,no_run
11215 /// # use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11216 /// let x = HubStatusEntry::new().set_count(42);
11217 /// ```
11218 pub fn set_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11219 self.count = v.into();
11220 self
11221 }
11222
11223 /// Sets the value of [group_by][crate::model::HubStatusEntry::group_by].
11224 ///
11225 /// # Example
11226 /// ```ignore,no_run
11227 /// # use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11228 /// let x = HubStatusEntry::new().set_group_by("example");
11229 /// ```
11230 pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11231 self.group_by = v.into();
11232 self
11233 }
11234
11235 /// Sets the value of [psc_propagation_status][crate::model::HubStatusEntry::psc_propagation_status].
11236 ///
11237 /// # Example
11238 /// ```ignore,no_run
11239 /// # use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11240 /// use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11241 /// let x = HubStatusEntry::new().set_psc_propagation_status(PscPropagationStatus::default()/* use setters */);
11242 /// ```
11243 pub fn set_psc_propagation_status<T>(mut self, v: T) -> Self
11244 where
11245 T: std::convert::Into<crate::model::PscPropagationStatus>,
11246 {
11247 self.psc_propagation_status = std::option::Option::Some(v.into());
11248 self
11249 }
11250
11251 /// Sets or clears the value of [psc_propagation_status][crate::model::HubStatusEntry::psc_propagation_status].
11252 ///
11253 /// # Example
11254 /// ```ignore,no_run
11255 /// # use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11256 /// use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11257 /// let x = HubStatusEntry::new().set_or_clear_psc_propagation_status(Some(PscPropagationStatus::default()/* use setters */));
11258 /// let x = HubStatusEntry::new().set_or_clear_psc_propagation_status(None::<PscPropagationStatus>);
11259 /// ```
11260 pub fn set_or_clear_psc_propagation_status<T>(mut self, v: std::option::Option<T>) -> Self
11261 where
11262 T: std::convert::Into<crate::model::PscPropagationStatus>,
11263 {
11264 self.psc_propagation_status = v.map(|x| x.into());
11265 self
11266 }
11267}
11268
11269impl wkt::message::Message for HubStatusEntry {
11270 fn typename() -> &'static str {
11271 "type.googleapis.com/google.cloud.networkconnectivity.v1.HubStatusEntry"
11272 }
11273}
11274
11275/// The status of one or more propagated Private Service Connect connections in a
11276/// hub.
11277#[derive(Clone, Default, PartialEq)]
11278#[non_exhaustive]
11279pub struct PscPropagationStatus {
11280 /// The name of the spoke that the source forwarding rule belongs to.
11281 pub source_spoke: std::string::String,
11282
11283 /// The name of the group that the source spoke belongs to.
11284 pub source_group: std::string::String,
11285
11286 /// The name of the forwarding rule exported to the hub.
11287 pub source_forwarding_rule: std::string::String,
11288
11289 /// The name of the spoke that the source forwarding rule propagates to.
11290 pub target_spoke: std::string::String,
11291
11292 /// The name of the group that the target spoke belongs to.
11293 pub target_group: std::string::String,
11294
11295 /// The propagation status.
11296 pub code: crate::model::psc_propagation_status::Code,
11297
11298 /// The human-readable summary of the Private Service Connect connection
11299 /// propagation status.
11300 pub message: std::string::String,
11301
11302 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11303}
11304
11305impl PscPropagationStatus {
11306 /// Creates a new default instance.
11307 pub fn new() -> Self {
11308 std::default::Default::default()
11309 }
11310
11311 /// Sets the value of [source_spoke][crate::model::PscPropagationStatus::source_spoke].
11312 ///
11313 /// # Example
11314 /// ```ignore,no_run
11315 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11316 /// let x = PscPropagationStatus::new().set_source_spoke("example");
11317 /// ```
11318 pub fn set_source_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11319 self.source_spoke = v.into();
11320 self
11321 }
11322
11323 /// Sets the value of [source_group][crate::model::PscPropagationStatus::source_group].
11324 ///
11325 /// # Example
11326 /// ```ignore,no_run
11327 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11328 /// let x = PscPropagationStatus::new().set_source_group("example");
11329 /// ```
11330 pub fn set_source_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11331 self.source_group = v.into();
11332 self
11333 }
11334
11335 /// Sets the value of [source_forwarding_rule][crate::model::PscPropagationStatus::source_forwarding_rule].
11336 ///
11337 /// # Example
11338 /// ```ignore,no_run
11339 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11340 /// let x = PscPropagationStatus::new().set_source_forwarding_rule("example");
11341 /// ```
11342 pub fn set_source_forwarding_rule<T: std::convert::Into<std::string::String>>(
11343 mut self,
11344 v: T,
11345 ) -> Self {
11346 self.source_forwarding_rule = v.into();
11347 self
11348 }
11349
11350 /// Sets the value of [target_spoke][crate::model::PscPropagationStatus::target_spoke].
11351 ///
11352 /// # Example
11353 /// ```ignore,no_run
11354 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11355 /// let x = PscPropagationStatus::new().set_target_spoke("example");
11356 /// ```
11357 pub fn set_target_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11358 self.target_spoke = v.into();
11359 self
11360 }
11361
11362 /// Sets the value of [target_group][crate::model::PscPropagationStatus::target_group].
11363 ///
11364 /// # Example
11365 /// ```ignore,no_run
11366 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11367 /// let x = PscPropagationStatus::new().set_target_group("example");
11368 /// ```
11369 pub fn set_target_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11370 self.target_group = v.into();
11371 self
11372 }
11373
11374 /// Sets the value of [code][crate::model::PscPropagationStatus::code].
11375 ///
11376 /// # Example
11377 /// ```ignore,no_run
11378 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11379 /// use google_cloud_networkconnectivity_v1::model::psc_propagation_status::Code;
11380 /// let x0 = PscPropagationStatus::new().set_code(Code::Ready);
11381 /// let x1 = PscPropagationStatus::new().set_code(Code::Propagating);
11382 /// let x2 = PscPropagationStatus::new().set_code(Code::ErrorProducerPropagatedConnectionLimitExceeded);
11383 /// ```
11384 pub fn set_code<T: std::convert::Into<crate::model::psc_propagation_status::Code>>(
11385 mut self,
11386 v: T,
11387 ) -> Self {
11388 self.code = v.into();
11389 self
11390 }
11391
11392 /// Sets the value of [message][crate::model::PscPropagationStatus::message].
11393 ///
11394 /// # Example
11395 /// ```ignore,no_run
11396 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11397 /// let x = PscPropagationStatus::new().set_message("example");
11398 /// ```
11399 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11400 self.message = v.into();
11401 self
11402 }
11403}
11404
11405impl wkt::message::Message for PscPropagationStatus {
11406 fn typename() -> &'static str {
11407 "type.googleapis.com/google.cloud.networkconnectivity.v1.PscPropagationStatus"
11408 }
11409}
11410
11411/// Defines additional types related to [PscPropagationStatus].
11412pub mod psc_propagation_status {
11413 #[allow(unused_imports)]
11414 use super::*;
11415
11416 /// The Code enum represents the state of the Private Service Connect
11417 /// propagation.
11418 ///
11419 /// # Working with unknown values
11420 ///
11421 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11422 /// additional enum variants at any time. Adding new variants is not considered
11423 /// a breaking change. Applications should write their code in anticipation of:
11424 ///
11425 /// - New values appearing in future releases of the client library, **and**
11426 /// - New values received dynamically, without application changes.
11427 ///
11428 /// Please consult the [Working with enums] section in the user guide for some
11429 /// guidelines.
11430 ///
11431 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11432 #[derive(Clone, Debug, PartialEq)]
11433 #[non_exhaustive]
11434 pub enum Code {
11435 /// The code is unspecified.
11436 Unspecified,
11437 /// The propagated Private Service Connect connection is ready.
11438 Ready,
11439 /// The Private Service Connect connection is propagating. This is a
11440 /// transient state.
11441 Propagating,
11442 /// The Private Service Connect connection propagation failed because the VPC
11443 /// network or the project of the target spoke has exceeded the connection
11444 /// limit set by the producer.
11445 ErrorProducerPropagatedConnectionLimitExceeded,
11446 /// The Private Service Connect connection propagation failed because the NAT
11447 /// IP subnet space has been exhausted. It is equivalent to the `Needs
11448 /// attention` status of the Private Service Connect connection. See
11449 /// <https://cloud.google.com/vpc/docs/about-accessing-vpc-hosted-services-endpoints#connection-statuses>.
11450 ErrorProducerNatIpSpaceExhausted,
11451 /// The Private Service Connect connection propagation failed because the
11452 /// `PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK` quota in the
11453 /// producer VPC network has been exceeded.
11454 ErrorProducerQuotaExceeded,
11455 /// The Private Service Connect connection propagation failed because the
11456 /// `PSC_PROPAGATED_CONNECTIONS_PER_VPC_NETWORK` quota in the consumer
11457 /// VPC network has been exceeded.
11458 ErrorConsumerQuotaExceeded,
11459 /// If set, the enum was initialized with an unknown value.
11460 ///
11461 /// Applications can examine the value using [Code::value] or
11462 /// [Code::name].
11463 UnknownValue(code::UnknownValue),
11464 }
11465
11466 #[doc(hidden)]
11467 pub mod code {
11468 #[allow(unused_imports)]
11469 use super::*;
11470 #[derive(Clone, Debug, PartialEq)]
11471 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11472 }
11473
11474 impl Code {
11475 /// Gets the enum value.
11476 ///
11477 /// Returns `None` if the enum contains an unknown value deserialized from
11478 /// the string representation of enums.
11479 pub fn value(&self) -> std::option::Option<i32> {
11480 match self {
11481 Self::Unspecified => std::option::Option::Some(0),
11482 Self::Ready => std::option::Option::Some(1),
11483 Self::Propagating => std::option::Option::Some(2),
11484 Self::ErrorProducerPropagatedConnectionLimitExceeded => {
11485 std::option::Option::Some(3)
11486 }
11487 Self::ErrorProducerNatIpSpaceExhausted => std::option::Option::Some(4),
11488 Self::ErrorProducerQuotaExceeded => std::option::Option::Some(5),
11489 Self::ErrorConsumerQuotaExceeded => std::option::Option::Some(6),
11490 Self::UnknownValue(u) => u.0.value(),
11491 }
11492 }
11493
11494 /// Gets the enum value as a string.
11495 ///
11496 /// Returns `None` if the enum contains an unknown value deserialized from
11497 /// the integer representation of enums.
11498 pub fn name(&self) -> std::option::Option<&str> {
11499 match self {
11500 Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
11501 Self::Ready => std::option::Option::Some("READY"),
11502 Self::Propagating => std::option::Option::Some("PROPAGATING"),
11503 Self::ErrorProducerPropagatedConnectionLimitExceeded => {
11504 std::option::Option::Some("ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED")
11505 }
11506 Self::ErrorProducerNatIpSpaceExhausted => {
11507 std::option::Option::Some("ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED")
11508 }
11509 Self::ErrorProducerQuotaExceeded => {
11510 std::option::Option::Some("ERROR_PRODUCER_QUOTA_EXCEEDED")
11511 }
11512 Self::ErrorConsumerQuotaExceeded => {
11513 std::option::Option::Some("ERROR_CONSUMER_QUOTA_EXCEEDED")
11514 }
11515 Self::UnknownValue(u) => u.0.name(),
11516 }
11517 }
11518 }
11519
11520 impl std::default::Default for Code {
11521 fn default() -> Self {
11522 use std::convert::From;
11523 Self::from(0)
11524 }
11525 }
11526
11527 impl std::fmt::Display for Code {
11528 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11529 wkt::internal::display_enum(f, self.name(), self.value())
11530 }
11531 }
11532
11533 impl std::convert::From<i32> for Code {
11534 fn from(value: i32) -> Self {
11535 match value {
11536 0 => Self::Unspecified,
11537 1 => Self::Ready,
11538 2 => Self::Propagating,
11539 3 => Self::ErrorProducerPropagatedConnectionLimitExceeded,
11540 4 => Self::ErrorProducerNatIpSpaceExhausted,
11541 5 => Self::ErrorProducerQuotaExceeded,
11542 6 => Self::ErrorConsumerQuotaExceeded,
11543 _ => Self::UnknownValue(code::UnknownValue(
11544 wkt::internal::UnknownEnumValue::Integer(value),
11545 )),
11546 }
11547 }
11548 }
11549
11550 impl std::convert::From<&str> for Code {
11551 fn from(value: &str) -> Self {
11552 use std::string::ToString;
11553 match value {
11554 "CODE_UNSPECIFIED" => Self::Unspecified,
11555 "READY" => Self::Ready,
11556 "PROPAGATING" => Self::Propagating,
11557 "ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED" => {
11558 Self::ErrorProducerPropagatedConnectionLimitExceeded
11559 }
11560 "ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED" => Self::ErrorProducerNatIpSpaceExhausted,
11561 "ERROR_PRODUCER_QUOTA_EXCEEDED" => Self::ErrorProducerQuotaExceeded,
11562 "ERROR_CONSUMER_QUOTA_EXCEEDED" => Self::ErrorConsumerQuotaExceeded,
11563 _ => Self::UnknownValue(code::UnknownValue(
11564 wkt::internal::UnknownEnumValue::String(value.to_string()),
11565 )),
11566 }
11567 }
11568 }
11569
11570 impl serde::ser::Serialize for Code {
11571 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11572 where
11573 S: serde::Serializer,
11574 {
11575 match self {
11576 Self::Unspecified => serializer.serialize_i32(0),
11577 Self::Ready => serializer.serialize_i32(1),
11578 Self::Propagating => serializer.serialize_i32(2),
11579 Self::ErrorProducerPropagatedConnectionLimitExceeded => serializer.serialize_i32(3),
11580 Self::ErrorProducerNatIpSpaceExhausted => serializer.serialize_i32(4),
11581 Self::ErrorProducerQuotaExceeded => serializer.serialize_i32(5),
11582 Self::ErrorConsumerQuotaExceeded => serializer.serialize_i32(6),
11583 Self::UnknownValue(u) => u.0.serialize(serializer),
11584 }
11585 }
11586 }
11587
11588 impl<'de> serde::de::Deserialize<'de> for Code {
11589 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11590 where
11591 D: serde::Deserializer<'de>,
11592 {
11593 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
11594 ".google.cloud.networkconnectivity.v1.PscPropagationStatus.Code",
11595 ))
11596 }
11597 }
11598}
11599
11600/// The request for
11601/// [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
11602///
11603/// [google.cloud.networkconnectivity.v1.HubService.ListSpokes]: crate::client::HubService::list_spokes
11604#[derive(Clone, Default, PartialEq)]
11605#[non_exhaustive]
11606pub struct ListSpokesRequest {
11607 /// Required. The parent resource.
11608 pub parent: std::string::String,
11609
11610 /// The maximum number of results to return per page.
11611 pub page_size: i32,
11612
11613 /// The page token.
11614 pub page_token: std::string::String,
11615
11616 /// An expression that filters the list of results.
11617 pub filter: std::string::String,
11618
11619 /// Sort the results by a certain order.
11620 pub order_by: std::string::String,
11621
11622 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11623}
11624
11625impl ListSpokesRequest {
11626 /// Creates a new default instance.
11627 pub fn new() -> Self {
11628 std::default::Default::default()
11629 }
11630
11631 /// Sets the value of [parent][crate::model::ListSpokesRequest::parent].
11632 ///
11633 /// # Example
11634 /// ```ignore,no_run
11635 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11636 /// let x = ListSpokesRequest::new().set_parent("example");
11637 /// ```
11638 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11639 self.parent = v.into();
11640 self
11641 }
11642
11643 /// Sets the value of [page_size][crate::model::ListSpokesRequest::page_size].
11644 ///
11645 /// # Example
11646 /// ```ignore,no_run
11647 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11648 /// let x = ListSpokesRequest::new().set_page_size(42);
11649 /// ```
11650 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11651 self.page_size = v.into();
11652 self
11653 }
11654
11655 /// Sets the value of [page_token][crate::model::ListSpokesRequest::page_token].
11656 ///
11657 /// # Example
11658 /// ```ignore,no_run
11659 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11660 /// let x = ListSpokesRequest::new().set_page_token("example");
11661 /// ```
11662 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11663 self.page_token = v.into();
11664 self
11665 }
11666
11667 /// Sets the value of [filter][crate::model::ListSpokesRequest::filter].
11668 ///
11669 /// # Example
11670 /// ```ignore,no_run
11671 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11672 /// let x = ListSpokesRequest::new().set_filter("example");
11673 /// ```
11674 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11675 self.filter = v.into();
11676 self
11677 }
11678
11679 /// Sets the value of [order_by][crate::model::ListSpokesRequest::order_by].
11680 ///
11681 /// # Example
11682 /// ```ignore,no_run
11683 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11684 /// let x = ListSpokesRequest::new().set_order_by("example");
11685 /// ```
11686 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11687 self.order_by = v.into();
11688 self
11689 }
11690}
11691
11692impl wkt::message::Message for ListSpokesRequest {
11693 fn typename() -> &'static str {
11694 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesRequest"
11695 }
11696}
11697
11698/// The response for
11699/// [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
11700///
11701/// [google.cloud.networkconnectivity.v1.HubService.ListSpokes]: crate::client::HubService::list_spokes
11702#[derive(Clone, Default, PartialEq)]
11703#[non_exhaustive]
11704pub struct ListSpokesResponse {
11705 /// The requested spokes.
11706 pub spokes: std::vec::Vec<crate::model::Spoke>,
11707
11708 /// The token for the next page of the response. To see more results,
11709 /// use this value as the page_token for your next request. If this value
11710 /// is empty, there are no more results.
11711 pub next_page_token: std::string::String,
11712
11713 /// Locations that could not be reached.
11714 pub unreachable: std::vec::Vec<std::string::String>,
11715
11716 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11717}
11718
11719impl ListSpokesResponse {
11720 /// Creates a new default instance.
11721 pub fn new() -> Self {
11722 std::default::Default::default()
11723 }
11724
11725 /// Sets the value of [spokes][crate::model::ListSpokesResponse::spokes].
11726 ///
11727 /// # Example
11728 /// ```ignore,no_run
11729 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesResponse;
11730 /// use google_cloud_networkconnectivity_v1::model::Spoke;
11731 /// let x = ListSpokesResponse::new()
11732 /// .set_spokes([
11733 /// Spoke::default()/* use setters */,
11734 /// Spoke::default()/* use (different) setters */,
11735 /// ]);
11736 /// ```
11737 pub fn set_spokes<T, V>(mut self, v: T) -> Self
11738 where
11739 T: std::iter::IntoIterator<Item = V>,
11740 V: std::convert::Into<crate::model::Spoke>,
11741 {
11742 use std::iter::Iterator;
11743 self.spokes = v.into_iter().map(|i| i.into()).collect();
11744 self
11745 }
11746
11747 /// Sets the value of [next_page_token][crate::model::ListSpokesResponse::next_page_token].
11748 ///
11749 /// # Example
11750 /// ```ignore,no_run
11751 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesResponse;
11752 /// let x = ListSpokesResponse::new().set_next_page_token("example");
11753 /// ```
11754 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11755 self.next_page_token = v.into();
11756 self
11757 }
11758
11759 /// Sets the value of [unreachable][crate::model::ListSpokesResponse::unreachable].
11760 ///
11761 /// # Example
11762 /// ```ignore,no_run
11763 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesResponse;
11764 /// let x = ListSpokesResponse::new().set_unreachable(["a", "b", "c"]);
11765 /// ```
11766 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11767 where
11768 T: std::iter::IntoIterator<Item = V>,
11769 V: std::convert::Into<std::string::String>,
11770 {
11771 use std::iter::Iterator;
11772 self.unreachable = v.into_iter().map(|i| i.into()).collect();
11773 self
11774 }
11775}
11776
11777impl wkt::message::Message for ListSpokesResponse {
11778 fn typename() -> &'static str {
11779 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesResponse"
11780 }
11781}
11782
11783#[doc(hidden)]
11784impl google_cloud_gax::paginator::internal::PageableResponse for ListSpokesResponse {
11785 type PageItem = crate::model::Spoke;
11786
11787 fn items(self) -> std::vec::Vec<Self::PageItem> {
11788 self.spokes
11789 }
11790
11791 fn next_page_token(&self) -> std::string::String {
11792 use std::clone::Clone;
11793 self.next_page_token.clone()
11794 }
11795}
11796
11797/// The request for
11798/// [HubService.GetSpoke][google.cloud.networkconnectivity.v1.HubService.GetSpoke].
11799///
11800/// [google.cloud.networkconnectivity.v1.HubService.GetSpoke]: crate::client::HubService::get_spoke
11801#[derive(Clone, Default, PartialEq)]
11802#[non_exhaustive]
11803pub struct GetSpokeRequest {
11804 /// Required. The name of the spoke resource.
11805 pub name: std::string::String,
11806
11807 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11808}
11809
11810impl GetSpokeRequest {
11811 /// Creates a new default instance.
11812 pub fn new() -> Self {
11813 std::default::Default::default()
11814 }
11815
11816 /// Sets the value of [name][crate::model::GetSpokeRequest::name].
11817 ///
11818 /// # Example
11819 /// ```ignore,no_run
11820 /// # use google_cloud_networkconnectivity_v1::model::GetSpokeRequest;
11821 /// # let project_id = "project_id";
11822 /// # let location_id = "location_id";
11823 /// # let spoke_id = "spoke_id";
11824 /// let x = GetSpokeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/spokes/{spoke_id}"));
11825 /// ```
11826 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11827 self.name = v.into();
11828 self
11829 }
11830}
11831
11832impl wkt::message::Message for GetSpokeRequest {
11833 fn typename() -> &'static str {
11834 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetSpokeRequest"
11835 }
11836}
11837
11838/// The request for
11839/// [HubService.CreateSpoke][google.cloud.networkconnectivity.v1.HubService.CreateSpoke].
11840///
11841/// [google.cloud.networkconnectivity.v1.HubService.CreateSpoke]: crate::client::HubService::create_spoke
11842#[derive(Clone, Default, PartialEq)]
11843#[non_exhaustive]
11844pub struct CreateSpokeRequest {
11845 /// Required. The parent resource.
11846 pub parent: std::string::String,
11847
11848 /// Required. Unique id for the spoke to create.
11849 pub spoke_id: std::string::String,
11850
11851 /// Required. The initial values for a new spoke.
11852 pub spoke: std::option::Option<crate::model::Spoke>,
11853
11854 /// Optional. A request ID to identify requests. Specify a unique request ID so
11855 /// that if you must retry your request, the server knows to ignore the request
11856 /// if it has already been completed. The server guarantees that a request
11857 /// doesn't result in creation of duplicate commitments for at least 60
11858 /// minutes.
11859 ///
11860 /// For example, consider a situation where you make an initial request and
11861 /// the request times out. If you make the request again with the same request
11862 /// ID, the server can check to see whether the original operation
11863 /// was received. If it was, the server ignores the second request. This
11864 /// behavior prevents clients from mistakenly creating duplicate commitments.
11865 ///
11866 /// The request ID must be a valid UUID, with the exception that zero UUID is
11867 /// not supported (00000000-0000-0000-0000-000000000000).
11868 pub request_id: std::string::String,
11869
11870 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11871}
11872
11873impl CreateSpokeRequest {
11874 /// Creates a new default instance.
11875 pub fn new() -> Self {
11876 std::default::Default::default()
11877 }
11878
11879 /// Sets the value of [parent][crate::model::CreateSpokeRequest::parent].
11880 ///
11881 /// # Example
11882 /// ```ignore,no_run
11883 /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11884 /// let x = CreateSpokeRequest::new().set_parent("example");
11885 /// ```
11886 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11887 self.parent = v.into();
11888 self
11889 }
11890
11891 /// Sets the value of [spoke_id][crate::model::CreateSpokeRequest::spoke_id].
11892 ///
11893 /// # Example
11894 /// ```ignore,no_run
11895 /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11896 /// let x = CreateSpokeRequest::new().set_spoke_id("example");
11897 /// ```
11898 pub fn set_spoke_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11899 self.spoke_id = v.into();
11900 self
11901 }
11902
11903 /// Sets the value of [spoke][crate::model::CreateSpokeRequest::spoke].
11904 ///
11905 /// # Example
11906 /// ```ignore,no_run
11907 /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11908 /// use google_cloud_networkconnectivity_v1::model::Spoke;
11909 /// let x = CreateSpokeRequest::new().set_spoke(Spoke::default()/* use setters */);
11910 /// ```
11911 pub fn set_spoke<T>(mut self, v: T) -> Self
11912 where
11913 T: std::convert::Into<crate::model::Spoke>,
11914 {
11915 self.spoke = std::option::Option::Some(v.into());
11916 self
11917 }
11918
11919 /// Sets or clears the value of [spoke][crate::model::CreateSpokeRequest::spoke].
11920 ///
11921 /// # Example
11922 /// ```ignore,no_run
11923 /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11924 /// use google_cloud_networkconnectivity_v1::model::Spoke;
11925 /// let x = CreateSpokeRequest::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
11926 /// let x = CreateSpokeRequest::new().set_or_clear_spoke(None::<Spoke>);
11927 /// ```
11928 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
11929 where
11930 T: std::convert::Into<crate::model::Spoke>,
11931 {
11932 self.spoke = v.map(|x| x.into());
11933 self
11934 }
11935
11936 /// Sets the value of [request_id][crate::model::CreateSpokeRequest::request_id].
11937 ///
11938 /// # Example
11939 /// ```ignore,no_run
11940 /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11941 /// let x = CreateSpokeRequest::new().set_request_id("example");
11942 /// ```
11943 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11944 self.request_id = v.into();
11945 self
11946 }
11947}
11948
11949impl wkt::message::Message for CreateSpokeRequest {
11950 fn typename() -> &'static str {
11951 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateSpokeRequest"
11952 }
11953}
11954
11955/// Request for
11956/// [HubService.UpdateSpoke][google.cloud.networkconnectivity.v1.HubService.UpdateSpoke]
11957/// method.
11958///
11959/// [google.cloud.networkconnectivity.v1.HubService.UpdateSpoke]: crate::client::HubService::update_spoke
11960#[derive(Clone, Default, PartialEq)]
11961#[non_exhaustive]
11962pub struct UpdateSpokeRequest {
11963 /// Optional. In the case of an update to an existing spoke, field mask is used
11964 /// to specify the fields to be overwritten. The fields specified in the
11965 /// update_mask are relative to the resource, not the full request. A field is
11966 /// overwritten if it is in the mask. If the user does not provide a mask, then
11967 /// all fields are overwritten.
11968 pub update_mask: std::option::Option<wkt::FieldMask>,
11969
11970 /// Required. The state that the spoke should be in after the update.
11971 pub spoke: std::option::Option<crate::model::Spoke>,
11972
11973 /// Optional. A request ID to identify requests. Specify a unique request ID so
11974 /// that if you must retry your request, the server knows to ignore the request
11975 /// if it has already been completed. The server guarantees that a request
11976 /// doesn't result in creation of duplicate commitments for at least 60
11977 /// minutes.
11978 ///
11979 /// For example, consider a situation where you make an initial request and
11980 /// the request times out. If you make the request again with the same request
11981 /// ID, the server can check to see whether the original operation
11982 /// was received. If it was, the server ignores the second request. This
11983 /// behavior prevents clients from mistakenly creating duplicate commitments.
11984 ///
11985 /// The request ID must be a valid UUID, with the exception that zero UUID is
11986 /// not supported (00000000-0000-0000-0000-000000000000).
11987 pub request_id: std::string::String,
11988
11989 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11990}
11991
11992impl UpdateSpokeRequest {
11993 /// Creates a new default instance.
11994 pub fn new() -> Self {
11995 std::default::Default::default()
11996 }
11997
11998 /// Sets the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
11999 ///
12000 /// # Example
12001 /// ```ignore,no_run
12002 /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
12003 /// use wkt::FieldMask;
12004 /// let x = UpdateSpokeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
12005 /// ```
12006 pub fn set_update_mask<T>(mut self, v: T) -> Self
12007 where
12008 T: std::convert::Into<wkt::FieldMask>,
12009 {
12010 self.update_mask = std::option::Option::Some(v.into());
12011 self
12012 }
12013
12014 /// Sets or clears the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
12015 ///
12016 /// # Example
12017 /// ```ignore,no_run
12018 /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
12019 /// use wkt::FieldMask;
12020 /// let x = UpdateSpokeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
12021 /// let x = UpdateSpokeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
12022 /// ```
12023 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12024 where
12025 T: std::convert::Into<wkt::FieldMask>,
12026 {
12027 self.update_mask = v.map(|x| x.into());
12028 self
12029 }
12030
12031 /// Sets the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
12032 ///
12033 /// # Example
12034 /// ```ignore,no_run
12035 /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
12036 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12037 /// let x = UpdateSpokeRequest::new().set_spoke(Spoke::default()/* use setters */);
12038 /// ```
12039 pub fn set_spoke<T>(mut self, v: T) -> Self
12040 where
12041 T: std::convert::Into<crate::model::Spoke>,
12042 {
12043 self.spoke = std::option::Option::Some(v.into());
12044 self
12045 }
12046
12047 /// Sets or clears the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
12048 ///
12049 /// # Example
12050 /// ```ignore,no_run
12051 /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
12052 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12053 /// let x = UpdateSpokeRequest::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12054 /// let x = UpdateSpokeRequest::new().set_or_clear_spoke(None::<Spoke>);
12055 /// ```
12056 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12057 where
12058 T: std::convert::Into<crate::model::Spoke>,
12059 {
12060 self.spoke = v.map(|x| x.into());
12061 self
12062 }
12063
12064 /// Sets the value of [request_id][crate::model::UpdateSpokeRequest::request_id].
12065 ///
12066 /// # Example
12067 /// ```ignore,no_run
12068 /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
12069 /// let x = UpdateSpokeRequest::new().set_request_id("example");
12070 /// ```
12071 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12072 self.request_id = v.into();
12073 self
12074 }
12075}
12076
12077impl wkt::message::Message for UpdateSpokeRequest {
12078 fn typename() -> &'static str {
12079 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateSpokeRequest"
12080 }
12081}
12082
12083/// The request for
12084/// [HubService.DeleteSpoke][google.cloud.networkconnectivity.v1.HubService.DeleteSpoke].
12085///
12086/// [google.cloud.networkconnectivity.v1.HubService.DeleteSpoke]: crate::client::HubService::delete_spoke
12087#[derive(Clone, Default, PartialEq)]
12088#[non_exhaustive]
12089pub struct DeleteSpokeRequest {
12090 /// Required. The name of the spoke to delete.
12091 pub name: std::string::String,
12092
12093 /// Optional. A request ID to identify requests. Specify a unique request ID so
12094 /// that if you must retry your request, the server knows to ignore the request
12095 /// if it has already been completed. The server guarantees that a request
12096 /// doesn't result in creation of duplicate commitments for at least 60
12097 /// minutes.
12098 ///
12099 /// For example, consider a situation where you make an initial request and
12100 /// the request times out. If you make the request again with the same request
12101 /// ID, the server can check to see whether the original operation
12102 /// was received. If it was, the server ignores the second request. This
12103 /// behavior prevents clients from mistakenly creating duplicate commitments.
12104 ///
12105 /// The request ID must be a valid UUID, with the exception that zero UUID is
12106 /// not supported (00000000-0000-0000-0000-000000000000).
12107 pub request_id: std::string::String,
12108
12109 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12110}
12111
12112impl DeleteSpokeRequest {
12113 /// Creates a new default instance.
12114 pub fn new() -> Self {
12115 std::default::Default::default()
12116 }
12117
12118 /// Sets the value of [name][crate::model::DeleteSpokeRequest::name].
12119 ///
12120 /// # Example
12121 /// ```ignore,no_run
12122 /// # use google_cloud_networkconnectivity_v1::model::DeleteSpokeRequest;
12123 /// # let project_id = "project_id";
12124 /// # let location_id = "location_id";
12125 /// # let spoke_id = "spoke_id";
12126 /// let x = DeleteSpokeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/spokes/{spoke_id}"));
12127 /// ```
12128 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12129 self.name = v.into();
12130 self
12131 }
12132
12133 /// Sets the value of [request_id][crate::model::DeleteSpokeRequest::request_id].
12134 ///
12135 /// # Example
12136 /// ```ignore,no_run
12137 /// # use google_cloud_networkconnectivity_v1::model::DeleteSpokeRequest;
12138 /// let x = DeleteSpokeRequest::new().set_request_id("example");
12139 /// ```
12140 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12141 self.request_id = v.into();
12142 self
12143 }
12144}
12145
12146impl wkt::message::Message for DeleteSpokeRequest {
12147 fn typename() -> &'static str {
12148 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteSpokeRequest"
12149 }
12150}
12151
12152/// The request for
12153/// [HubService.AcceptHubSpoke][google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke].
12154///
12155/// [google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke]: crate::client::HubService::accept_hub_spoke
12156#[derive(Clone, Default, PartialEq)]
12157#[non_exhaustive]
12158pub struct AcceptHubSpokeRequest {
12159 /// Required. The name of the hub into which to accept the spoke.
12160 pub name: std::string::String,
12161
12162 /// Required. The URI of the spoke to accept into the hub.
12163 pub spoke_uri: std::string::String,
12164
12165 /// Optional. A request ID to identify requests. Specify a unique request ID so
12166 /// that if you must retry your request, the server knows to ignore the request
12167 /// if it has already been completed. The server guarantees that a request
12168 /// doesn't result in creation of duplicate commitments for at least 60
12169 /// minutes.
12170 ///
12171 /// For example, consider a situation where you make an initial request and
12172 /// the request times out. If you make the request again with the same request
12173 /// ID, the server can check to see whether the original operation
12174 /// was received. If it was, the server ignores the second request. This
12175 /// behavior prevents clients from mistakenly creating duplicate commitments.
12176 ///
12177 /// The request ID must be a valid UUID, with the exception that zero UUID is
12178 /// not supported (00000000-0000-0000-0000-000000000000).
12179 pub request_id: std::string::String,
12180
12181 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12182}
12183
12184impl AcceptHubSpokeRequest {
12185 /// Creates a new default instance.
12186 pub fn new() -> Self {
12187 std::default::Default::default()
12188 }
12189
12190 /// Sets the value of [name][crate::model::AcceptHubSpokeRequest::name].
12191 ///
12192 /// # Example
12193 /// ```ignore,no_run
12194 /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeRequest;
12195 /// # let project_id = "project_id";
12196 /// # let hub_id = "hub_id";
12197 /// let x = AcceptHubSpokeRequest::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}"));
12198 /// ```
12199 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12200 self.name = v.into();
12201 self
12202 }
12203
12204 /// Sets the value of [spoke_uri][crate::model::AcceptHubSpokeRequest::spoke_uri].
12205 ///
12206 /// # Example
12207 /// ```ignore,no_run
12208 /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeRequest;
12209 /// # let project_id = "project_id";
12210 /// # let location_id = "location_id";
12211 /// # let spoke_id = "spoke_id";
12212 /// let x = AcceptHubSpokeRequest::new().set_spoke_uri(format!("projects/{project_id}/locations/{location_id}/spokes/{spoke_id}"));
12213 /// ```
12214 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12215 self.spoke_uri = v.into();
12216 self
12217 }
12218
12219 /// Sets the value of [request_id][crate::model::AcceptHubSpokeRequest::request_id].
12220 ///
12221 /// # Example
12222 /// ```ignore,no_run
12223 /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeRequest;
12224 /// let x = AcceptHubSpokeRequest::new().set_request_id("example");
12225 /// ```
12226 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12227 self.request_id = v.into();
12228 self
12229 }
12230}
12231
12232impl wkt::message::Message for AcceptHubSpokeRequest {
12233 fn typename() -> &'static str {
12234 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest"
12235 }
12236}
12237
12238/// The response for
12239/// [HubService.AcceptHubSpoke][google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke].
12240///
12241/// [google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke]: crate::client::HubService::accept_hub_spoke
12242#[derive(Clone, Default, PartialEq)]
12243#[non_exhaustive]
12244pub struct AcceptHubSpokeResponse {
12245 /// The spoke that was operated on.
12246 pub spoke: std::option::Option<crate::model::Spoke>,
12247
12248 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12249}
12250
12251impl AcceptHubSpokeResponse {
12252 /// Creates a new default instance.
12253 pub fn new() -> Self {
12254 std::default::Default::default()
12255 }
12256
12257 /// Sets the value of [spoke][crate::model::AcceptHubSpokeResponse::spoke].
12258 ///
12259 /// # Example
12260 /// ```ignore,no_run
12261 /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeResponse;
12262 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12263 /// let x = AcceptHubSpokeResponse::new().set_spoke(Spoke::default()/* use setters */);
12264 /// ```
12265 pub fn set_spoke<T>(mut self, v: T) -> Self
12266 where
12267 T: std::convert::Into<crate::model::Spoke>,
12268 {
12269 self.spoke = std::option::Option::Some(v.into());
12270 self
12271 }
12272
12273 /// Sets or clears the value of [spoke][crate::model::AcceptHubSpokeResponse::spoke].
12274 ///
12275 /// # Example
12276 /// ```ignore,no_run
12277 /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeResponse;
12278 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12279 /// let x = AcceptHubSpokeResponse::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12280 /// let x = AcceptHubSpokeResponse::new().set_or_clear_spoke(None::<Spoke>);
12281 /// ```
12282 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12283 where
12284 T: std::convert::Into<crate::model::Spoke>,
12285 {
12286 self.spoke = v.map(|x| x.into());
12287 self
12288 }
12289}
12290
12291impl wkt::message::Message for AcceptHubSpokeResponse {
12292 fn typename() -> &'static str {
12293 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse"
12294 }
12295}
12296
12297/// The request for
12298/// [HubService.RejectHubSpoke][google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke].
12299///
12300/// [google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke]: crate::client::HubService::reject_hub_spoke
12301#[derive(Clone, Default, PartialEq)]
12302#[non_exhaustive]
12303pub struct RejectHubSpokeRequest {
12304 /// Required. The name of the hub from which to reject the spoke.
12305 pub name: std::string::String,
12306
12307 /// Required. The URI of the spoke to reject from the hub.
12308 pub spoke_uri: std::string::String,
12309
12310 /// Optional. A request ID to identify requests. Specify a unique request ID so
12311 /// that if you must retry your request, the server knows to ignore the request
12312 /// if it has already been completed. The server guarantees that a request
12313 /// doesn't result in creation of duplicate commitments for at least 60
12314 /// minutes.
12315 ///
12316 /// For example, consider a situation where you make an initial request and
12317 /// the request times out. If you make the request again with the same request
12318 /// ID, the server can check to see whether the original operation
12319 /// was received. If it was, the server ignores the second request. This
12320 /// behavior prevents clients from mistakenly creating duplicate commitments.
12321 ///
12322 /// The request ID must be a valid UUID, with the exception that zero UUID is
12323 /// not supported (00000000-0000-0000-0000-000000000000).
12324 pub request_id: std::string::String,
12325
12326 /// Optional. Additional information provided by the hub administrator.
12327 pub details: std::string::String,
12328
12329 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12330}
12331
12332impl RejectHubSpokeRequest {
12333 /// Creates a new default instance.
12334 pub fn new() -> Self {
12335 std::default::Default::default()
12336 }
12337
12338 /// Sets the value of [name][crate::model::RejectHubSpokeRequest::name].
12339 ///
12340 /// # Example
12341 /// ```ignore,no_run
12342 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeRequest;
12343 /// # let project_id = "project_id";
12344 /// # let hub_id = "hub_id";
12345 /// let x = RejectHubSpokeRequest::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}"));
12346 /// ```
12347 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12348 self.name = v.into();
12349 self
12350 }
12351
12352 /// Sets the value of [spoke_uri][crate::model::RejectHubSpokeRequest::spoke_uri].
12353 ///
12354 /// # Example
12355 /// ```ignore,no_run
12356 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeRequest;
12357 /// # let project_id = "project_id";
12358 /// # let location_id = "location_id";
12359 /// # let spoke_id = "spoke_id";
12360 /// let x = RejectHubSpokeRequest::new().set_spoke_uri(format!("projects/{project_id}/locations/{location_id}/spokes/{spoke_id}"));
12361 /// ```
12362 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12363 self.spoke_uri = v.into();
12364 self
12365 }
12366
12367 /// Sets the value of [request_id][crate::model::RejectHubSpokeRequest::request_id].
12368 ///
12369 /// # Example
12370 /// ```ignore,no_run
12371 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeRequest;
12372 /// let x = RejectHubSpokeRequest::new().set_request_id("example");
12373 /// ```
12374 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12375 self.request_id = v.into();
12376 self
12377 }
12378
12379 /// Sets the value of [details][crate::model::RejectHubSpokeRequest::details].
12380 ///
12381 /// # Example
12382 /// ```ignore,no_run
12383 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeRequest;
12384 /// let x = RejectHubSpokeRequest::new().set_details("example");
12385 /// ```
12386 pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12387 self.details = v.into();
12388 self
12389 }
12390}
12391
12392impl wkt::message::Message for RejectHubSpokeRequest {
12393 fn typename() -> &'static str {
12394 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeRequest"
12395 }
12396}
12397
12398/// The response for
12399/// [HubService.RejectHubSpoke][google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke].
12400///
12401/// [google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke]: crate::client::HubService::reject_hub_spoke
12402#[derive(Clone, Default, PartialEq)]
12403#[non_exhaustive]
12404pub struct RejectHubSpokeResponse {
12405 /// The spoke that was operated on.
12406 pub spoke: std::option::Option<crate::model::Spoke>,
12407
12408 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12409}
12410
12411impl RejectHubSpokeResponse {
12412 /// Creates a new default instance.
12413 pub fn new() -> Self {
12414 std::default::Default::default()
12415 }
12416
12417 /// Sets the value of [spoke][crate::model::RejectHubSpokeResponse::spoke].
12418 ///
12419 /// # Example
12420 /// ```ignore,no_run
12421 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeResponse;
12422 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12423 /// let x = RejectHubSpokeResponse::new().set_spoke(Spoke::default()/* use setters */);
12424 /// ```
12425 pub fn set_spoke<T>(mut self, v: T) -> Self
12426 where
12427 T: std::convert::Into<crate::model::Spoke>,
12428 {
12429 self.spoke = std::option::Option::Some(v.into());
12430 self
12431 }
12432
12433 /// Sets or clears the value of [spoke][crate::model::RejectHubSpokeResponse::spoke].
12434 ///
12435 /// # Example
12436 /// ```ignore,no_run
12437 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeResponse;
12438 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12439 /// let x = RejectHubSpokeResponse::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12440 /// let x = RejectHubSpokeResponse::new().set_or_clear_spoke(None::<Spoke>);
12441 /// ```
12442 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12443 where
12444 T: std::convert::Into<crate::model::Spoke>,
12445 {
12446 self.spoke = v.map(|x| x.into());
12447 self
12448 }
12449}
12450
12451impl wkt::message::Message for RejectHubSpokeResponse {
12452 fn typename() -> &'static str {
12453 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeResponse"
12454 }
12455}
12456
12457/// The request for
12458/// [HubService.AcceptSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate].
12459///
12460/// [google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate]: crate::client::HubService::accept_spoke_update
12461#[derive(Clone, Default, PartialEq)]
12462#[non_exhaustive]
12463pub struct AcceptSpokeUpdateRequest {
12464 /// Required. The name of the hub to accept spoke update.
12465 pub name: std::string::String,
12466
12467 /// Required. The URI of the spoke to accept update.
12468 pub spoke_uri: std::string::String,
12469
12470 /// Required. The etag of the spoke to accept update.
12471 pub spoke_etag: std::string::String,
12472
12473 /// Optional. A request ID to identify requests. Specify a unique request ID so
12474 /// that if you must retry your request, the server knows to ignore the request
12475 /// if it has already been completed. The server guarantees that a request
12476 /// doesn't result in creation of duplicate commitments for at least 60
12477 /// minutes.
12478 ///
12479 /// For example, consider a situation where you make an initial request and
12480 /// the request times out. If you make the request again with the same request
12481 /// ID, the server can check to see whether the original operation
12482 /// was received. If it was, the server ignores the second request. This
12483 /// behavior prevents clients from mistakenly creating duplicate commitments.
12484 ///
12485 /// The request ID must be a valid UUID, with the exception that zero UUID is
12486 /// not supported (00000000-0000-0000-0000-000000000000).
12487 pub request_id: std::string::String,
12488
12489 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12490}
12491
12492impl AcceptSpokeUpdateRequest {
12493 /// Creates a new default instance.
12494 pub fn new() -> Self {
12495 std::default::Default::default()
12496 }
12497
12498 /// Sets the value of [name][crate::model::AcceptSpokeUpdateRequest::name].
12499 ///
12500 /// # Example
12501 /// ```ignore,no_run
12502 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateRequest;
12503 /// # let project_id = "project_id";
12504 /// # let hub_id = "hub_id";
12505 /// let x = AcceptSpokeUpdateRequest::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}"));
12506 /// ```
12507 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12508 self.name = v.into();
12509 self
12510 }
12511
12512 /// Sets the value of [spoke_uri][crate::model::AcceptSpokeUpdateRequest::spoke_uri].
12513 ///
12514 /// # Example
12515 /// ```ignore,no_run
12516 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateRequest;
12517 /// # let project_id = "project_id";
12518 /// # let location_id = "location_id";
12519 /// # let spoke_id = "spoke_id";
12520 /// let x = AcceptSpokeUpdateRequest::new().set_spoke_uri(format!("projects/{project_id}/locations/{location_id}/spokes/{spoke_id}"));
12521 /// ```
12522 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12523 self.spoke_uri = v.into();
12524 self
12525 }
12526
12527 /// Sets the value of [spoke_etag][crate::model::AcceptSpokeUpdateRequest::spoke_etag].
12528 ///
12529 /// # Example
12530 /// ```ignore,no_run
12531 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateRequest;
12532 /// let x = AcceptSpokeUpdateRequest::new().set_spoke_etag("example");
12533 /// ```
12534 pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12535 self.spoke_etag = v.into();
12536 self
12537 }
12538
12539 /// Sets the value of [request_id][crate::model::AcceptSpokeUpdateRequest::request_id].
12540 ///
12541 /// # Example
12542 /// ```ignore,no_run
12543 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateRequest;
12544 /// let x = AcceptSpokeUpdateRequest::new().set_request_id("example");
12545 /// ```
12546 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12547 self.request_id = v.into();
12548 self
12549 }
12550}
12551
12552impl wkt::message::Message for AcceptSpokeUpdateRequest {
12553 fn typename() -> &'static str {
12554 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateRequest"
12555 }
12556}
12557
12558/// The response for
12559/// [HubService.AcceptSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate].
12560///
12561/// [google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate]: crate::client::HubService::accept_spoke_update
12562#[derive(Clone, Default, PartialEq)]
12563#[non_exhaustive]
12564pub struct AcceptSpokeUpdateResponse {
12565 /// The spoke that was operated on.
12566 pub spoke: std::option::Option<crate::model::Spoke>,
12567
12568 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12569}
12570
12571impl AcceptSpokeUpdateResponse {
12572 /// Creates a new default instance.
12573 pub fn new() -> Self {
12574 std::default::Default::default()
12575 }
12576
12577 /// Sets the value of [spoke][crate::model::AcceptSpokeUpdateResponse::spoke].
12578 ///
12579 /// # Example
12580 /// ```ignore,no_run
12581 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateResponse;
12582 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12583 /// let x = AcceptSpokeUpdateResponse::new().set_spoke(Spoke::default()/* use setters */);
12584 /// ```
12585 pub fn set_spoke<T>(mut self, v: T) -> Self
12586 where
12587 T: std::convert::Into<crate::model::Spoke>,
12588 {
12589 self.spoke = std::option::Option::Some(v.into());
12590 self
12591 }
12592
12593 /// Sets or clears the value of [spoke][crate::model::AcceptSpokeUpdateResponse::spoke].
12594 ///
12595 /// # Example
12596 /// ```ignore,no_run
12597 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateResponse;
12598 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12599 /// let x = AcceptSpokeUpdateResponse::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12600 /// let x = AcceptSpokeUpdateResponse::new().set_or_clear_spoke(None::<Spoke>);
12601 /// ```
12602 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12603 where
12604 T: std::convert::Into<crate::model::Spoke>,
12605 {
12606 self.spoke = v.map(|x| x.into());
12607 self
12608 }
12609}
12610
12611impl wkt::message::Message for AcceptSpokeUpdateResponse {
12612 fn typename() -> &'static str {
12613 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateResponse"
12614 }
12615}
12616
12617/// The request for
12618/// [HubService.RejectSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate].
12619///
12620/// [google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate]: crate::client::HubService::reject_spoke_update
12621#[derive(Clone, Default, PartialEq)]
12622#[non_exhaustive]
12623pub struct RejectSpokeUpdateRequest {
12624 /// Required. The name of the hub to reject spoke update.
12625 pub name: std::string::String,
12626
12627 /// Required. The URI of the spoke to reject update.
12628 pub spoke_uri: std::string::String,
12629
12630 /// Required. The etag of the spoke to reject update.
12631 pub spoke_etag: std::string::String,
12632
12633 /// Optional. Additional information provided by the hub administrator.
12634 pub details: std::string::String,
12635
12636 /// Optional. A request ID to identify requests. Specify a unique request ID so
12637 /// that if you must retry your request, the server knows to ignore the request
12638 /// if it has already been completed. The server guarantees that a request
12639 /// doesn't result in creation of duplicate commitments for at least 60
12640 /// minutes.
12641 ///
12642 /// For example, consider a situation where you make an initial request and
12643 /// the request times out. If you make the request again with the same request
12644 /// ID, the server can check to see whether the original operation
12645 /// was received. If it was, the server ignores the second request. This
12646 /// behavior prevents clients from mistakenly creating duplicate commitments.
12647 ///
12648 /// The request ID must be a valid UUID, with the exception that zero UUID is
12649 /// not supported (00000000-0000-0000-0000-000000000000).
12650 pub request_id: std::string::String,
12651
12652 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12653}
12654
12655impl RejectSpokeUpdateRequest {
12656 /// Creates a new default instance.
12657 pub fn new() -> Self {
12658 std::default::Default::default()
12659 }
12660
12661 /// Sets the value of [name][crate::model::RejectSpokeUpdateRequest::name].
12662 ///
12663 /// # Example
12664 /// ```ignore,no_run
12665 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12666 /// # let project_id = "project_id";
12667 /// # let hub_id = "hub_id";
12668 /// let x = RejectSpokeUpdateRequest::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}"));
12669 /// ```
12670 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12671 self.name = v.into();
12672 self
12673 }
12674
12675 /// Sets the value of [spoke_uri][crate::model::RejectSpokeUpdateRequest::spoke_uri].
12676 ///
12677 /// # Example
12678 /// ```ignore,no_run
12679 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12680 /// # let project_id = "project_id";
12681 /// # let location_id = "location_id";
12682 /// # let spoke_id = "spoke_id";
12683 /// let x = RejectSpokeUpdateRequest::new().set_spoke_uri(format!("projects/{project_id}/locations/{location_id}/spokes/{spoke_id}"));
12684 /// ```
12685 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12686 self.spoke_uri = v.into();
12687 self
12688 }
12689
12690 /// Sets the value of [spoke_etag][crate::model::RejectSpokeUpdateRequest::spoke_etag].
12691 ///
12692 /// # Example
12693 /// ```ignore,no_run
12694 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12695 /// let x = RejectSpokeUpdateRequest::new().set_spoke_etag("example");
12696 /// ```
12697 pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12698 self.spoke_etag = v.into();
12699 self
12700 }
12701
12702 /// Sets the value of [details][crate::model::RejectSpokeUpdateRequest::details].
12703 ///
12704 /// # Example
12705 /// ```ignore,no_run
12706 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12707 /// let x = RejectSpokeUpdateRequest::new().set_details("example");
12708 /// ```
12709 pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12710 self.details = v.into();
12711 self
12712 }
12713
12714 /// Sets the value of [request_id][crate::model::RejectSpokeUpdateRequest::request_id].
12715 ///
12716 /// # Example
12717 /// ```ignore,no_run
12718 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12719 /// let x = RejectSpokeUpdateRequest::new().set_request_id("example");
12720 /// ```
12721 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12722 self.request_id = v.into();
12723 self
12724 }
12725}
12726
12727impl wkt::message::Message for RejectSpokeUpdateRequest {
12728 fn typename() -> &'static str {
12729 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateRequest"
12730 }
12731}
12732
12733/// The response for
12734/// [HubService.RejectSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate].
12735///
12736/// [google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate]: crate::client::HubService::reject_spoke_update
12737#[derive(Clone, Default, PartialEq)]
12738#[non_exhaustive]
12739pub struct RejectSpokeUpdateResponse {
12740 /// The spoke that was operated on.
12741 pub spoke: std::option::Option<crate::model::Spoke>,
12742
12743 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12744}
12745
12746impl RejectSpokeUpdateResponse {
12747 /// Creates a new default instance.
12748 pub fn new() -> Self {
12749 std::default::Default::default()
12750 }
12751
12752 /// Sets the value of [spoke][crate::model::RejectSpokeUpdateResponse::spoke].
12753 ///
12754 /// # Example
12755 /// ```ignore,no_run
12756 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateResponse;
12757 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12758 /// let x = RejectSpokeUpdateResponse::new().set_spoke(Spoke::default()/* use setters */);
12759 /// ```
12760 pub fn set_spoke<T>(mut self, v: T) -> Self
12761 where
12762 T: std::convert::Into<crate::model::Spoke>,
12763 {
12764 self.spoke = std::option::Option::Some(v.into());
12765 self
12766 }
12767
12768 /// Sets or clears the value of [spoke][crate::model::RejectSpokeUpdateResponse::spoke].
12769 ///
12770 /// # Example
12771 /// ```ignore,no_run
12772 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateResponse;
12773 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12774 /// let x = RejectSpokeUpdateResponse::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12775 /// let x = RejectSpokeUpdateResponse::new().set_or_clear_spoke(None::<Spoke>);
12776 /// ```
12777 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12778 where
12779 T: std::convert::Into<crate::model::Spoke>,
12780 {
12781 self.spoke = v.map(|x| x.into());
12782 self
12783 }
12784}
12785
12786impl wkt::message::Message for RejectSpokeUpdateResponse {
12787 fn typename() -> &'static str {
12788 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateResponse"
12789 }
12790}
12791
12792/// The request for
12793/// [HubService.GetRouteTable][google.cloud.networkconnectivity.v1.HubService.GetRouteTable].
12794///
12795/// [google.cloud.networkconnectivity.v1.HubService.GetRouteTable]: crate::client::HubService::get_route_table
12796#[derive(Clone, Default, PartialEq)]
12797#[non_exhaustive]
12798pub struct GetRouteTableRequest {
12799 /// Required. The name of the route table resource.
12800 pub name: std::string::String,
12801
12802 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12803}
12804
12805impl GetRouteTableRequest {
12806 /// Creates a new default instance.
12807 pub fn new() -> Self {
12808 std::default::Default::default()
12809 }
12810
12811 /// Sets the value of [name][crate::model::GetRouteTableRequest::name].
12812 ///
12813 /// # Example
12814 /// ```ignore,no_run
12815 /// # use google_cloud_networkconnectivity_v1::model::GetRouteTableRequest;
12816 /// # let project_id = "project_id";
12817 /// # let hub_id = "hub_id";
12818 /// # let route_table_id = "route_table_id";
12819 /// let x = GetRouteTableRequest::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}"));
12820 /// ```
12821 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12822 self.name = v.into();
12823 self
12824 }
12825}
12826
12827impl wkt::message::Message for GetRouteTableRequest {
12828 fn typename() -> &'static str {
12829 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteTableRequest"
12830 }
12831}
12832
12833/// The request for
12834/// [HubService.GetRoute][google.cloud.networkconnectivity.v1.HubService.GetRoute].
12835///
12836/// [google.cloud.networkconnectivity.v1.HubService.GetRoute]: crate::client::HubService::get_route
12837#[derive(Clone, Default, PartialEq)]
12838#[non_exhaustive]
12839pub struct GetRouteRequest {
12840 /// Required. The name of the route resource.
12841 pub name: std::string::String,
12842
12843 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12844}
12845
12846impl GetRouteRequest {
12847 /// Creates a new default instance.
12848 pub fn new() -> Self {
12849 std::default::Default::default()
12850 }
12851
12852 /// Sets the value of [name][crate::model::GetRouteRequest::name].
12853 ///
12854 /// # Example
12855 /// ```ignore,no_run
12856 /// # use google_cloud_networkconnectivity_v1::model::GetRouteRequest;
12857 /// # let project_id = "project_id";
12858 /// # let hub_id = "hub_id";
12859 /// # let route_table_id = "route_table_id";
12860 /// # let route_id = "route_id";
12861 /// let x = GetRouteRequest::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}/routes/{route_id}"));
12862 /// ```
12863 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12864 self.name = v.into();
12865 self
12866 }
12867}
12868
12869impl wkt::message::Message for GetRouteRequest {
12870 fn typename() -> &'static str {
12871 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteRequest"
12872 }
12873}
12874
12875/// Request for
12876/// [HubService.ListRoutes][google.cloud.networkconnectivity.v1.HubService.ListRoutes]
12877/// method.
12878///
12879/// [google.cloud.networkconnectivity.v1.HubService.ListRoutes]: crate::client::HubService::list_routes
12880#[derive(Clone, Default, PartialEq)]
12881#[non_exhaustive]
12882pub struct ListRoutesRequest {
12883 /// Required. The parent resource's name.
12884 pub parent: std::string::String,
12885
12886 /// The maximum number of results to return per page.
12887 pub page_size: i32,
12888
12889 /// The page token.
12890 pub page_token: std::string::String,
12891
12892 /// An expression that filters the list of results.
12893 pub filter: std::string::String,
12894
12895 /// Sort the results by a certain order.
12896 pub order_by: std::string::String,
12897
12898 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12899}
12900
12901impl ListRoutesRequest {
12902 /// Creates a new default instance.
12903 pub fn new() -> Self {
12904 std::default::Default::default()
12905 }
12906
12907 /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
12908 ///
12909 /// # Example
12910 /// ```ignore,no_run
12911 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12912 /// # let project_id = "project_id";
12913 /// # let hub_id = "hub_id";
12914 /// # let route_table_id = "route_table_id";
12915 /// let x = ListRoutesRequest::new().set_parent(format!("projects/{project_id}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}"));
12916 /// ```
12917 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12918 self.parent = v.into();
12919 self
12920 }
12921
12922 /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
12923 ///
12924 /// # Example
12925 /// ```ignore,no_run
12926 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12927 /// let x = ListRoutesRequest::new().set_page_size(42);
12928 /// ```
12929 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12930 self.page_size = v.into();
12931 self
12932 }
12933
12934 /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
12935 ///
12936 /// # Example
12937 /// ```ignore,no_run
12938 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12939 /// let x = ListRoutesRequest::new().set_page_token("example");
12940 /// ```
12941 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12942 self.page_token = v.into();
12943 self
12944 }
12945
12946 /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
12947 ///
12948 /// # Example
12949 /// ```ignore,no_run
12950 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12951 /// let x = ListRoutesRequest::new().set_filter("example");
12952 /// ```
12953 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12954 self.filter = v.into();
12955 self
12956 }
12957
12958 /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
12959 ///
12960 /// # Example
12961 /// ```ignore,no_run
12962 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12963 /// let x = ListRoutesRequest::new().set_order_by("example");
12964 /// ```
12965 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12966 self.order_by = v.into();
12967 self
12968 }
12969}
12970
12971impl wkt::message::Message for ListRoutesRequest {
12972 fn typename() -> &'static str {
12973 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesRequest"
12974 }
12975}
12976
12977/// Response for
12978/// [HubService.ListRoutes][google.cloud.networkconnectivity.v1.HubService.ListRoutes]
12979/// method.
12980///
12981/// [google.cloud.networkconnectivity.v1.HubService.ListRoutes]: crate::client::HubService::list_routes
12982#[derive(Clone, Default, PartialEq)]
12983#[non_exhaustive]
12984pub struct ListRoutesResponse {
12985 /// The requested routes.
12986 pub routes: std::vec::Vec<crate::model::Route>,
12987
12988 /// The token for the next page of the response. To see more results,
12989 /// use this value as the page_token for your next request. If this value
12990 /// is empty, there are no more results.
12991 pub next_page_token: std::string::String,
12992
12993 /// RouteTables that could not be reached.
12994 pub unreachable: std::vec::Vec<std::string::String>,
12995
12996 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12997}
12998
12999impl ListRoutesResponse {
13000 /// Creates a new default instance.
13001 pub fn new() -> Self {
13002 std::default::Default::default()
13003 }
13004
13005 /// Sets the value of [routes][crate::model::ListRoutesResponse::routes].
13006 ///
13007 /// # Example
13008 /// ```ignore,no_run
13009 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesResponse;
13010 /// use google_cloud_networkconnectivity_v1::model::Route;
13011 /// let x = ListRoutesResponse::new()
13012 /// .set_routes([
13013 /// Route::default()/* use setters */,
13014 /// Route::default()/* use (different) setters */,
13015 /// ]);
13016 /// ```
13017 pub fn set_routes<T, V>(mut self, v: T) -> Self
13018 where
13019 T: std::iter::IntoIterator<Item = V>,
13020 V: std::convert::Into<crate::model::Route>,
13021 {
13022 use std::iter::Iterator;
13023 self.routes = v.into_iter().map(|i| i.into()).collect();
13024 self
13025 }
13026
13027 /// Sets the value of [next_page_token][crate::model::ListRoutesResponse::next_page_token].
13028 ///
13029 /// # Example
13030 /// ```ignore,no_run
13031 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesResponse;
13032 /// let x = ListRoutesResponse::new().set_next_page_token("example");
13033 /// ```
13034 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13035 self.next_page_token = v.into();
13036 self
13037 }
13038
13039 /// Sets the value of [unreachable][crate::model::ListRoutesResponse::unreachable].
13040 ///
13041 /// # Example
13042 /// ```ignore,no_run
13043 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesResponse;
13044 /// let x = ListRoutesResponse::new().set_unreachable(["a", "b", "c"]);
13045 /// ```
13046 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13047 where
13048 T: std::iter::IntoIterator<Item = V>,
13049 V: std::convert::Into<std::string::String>,
13050 {
13051 use std::iter::Iterator;
13052 self.unreachable = v.into_iter().map(|i| i.into()).collect();
13053 self
13054 }
13055}
13056
13057impl wkt::message::Message for ListRoutesResponse {
13058 fn typename() -> &'static str {
13059 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesResponse"
13060 }
13061}
13062
13063#[doc(hidden)]
13064impl google_cloud_gax::paginator::internal::PageableResponse for ListRoutesResponse {
13065 type PageItem = crate::model::Route;
13066
13067 fn items(self) -> std::vec::Vec<Self::PageItem> {
13068 self.routes
13069 }
13070
13071 fn next_page_token(&self) -> std::string::String {
13072 use std::clone::Clone;
13073 self.next_page_token.clone()
13074 }
13075}
13076
13077/// Request for
13078/// [HubService.ListRouteTables][google.cloud.networkconnectivity.v1.HubService.ListRouteTables]
13079/// method.
13080///
13081/// [google.cloud.networkconnectivity.v1.HubService.ListRouteTables]: crate::client::HubService::list_route_tables
13082#[derive(Clone, Default, PartialEq)]
13083#[non_exhaustive]
13084pub struct ListRouteTablesRequest {
13085 /// Required. The parent resource's name.
13086 pub parent: std::string::String,
13087
13088 /// The maximum number of results to return per page.
13089 pub page_size: i32,
13090
13091 /// The page token.
13092 pub page_token: std::string::String,
13093
13094 /// An expression that filters the list of results.
13095 pub filter: std::string::String,
13096
13097 /// Sort the results by a certain order.
13098 pub order_by: std::string::String,
13099
13100 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13101}
13102
13103impl ListRouteTablesRequest {
13104 /// Creates a new default instance.
13105 pub fn new() -> Self {
13106 std::default::Default::default()
13107 }
13108
13109 /// Sets the value of [parent][crate::model::ListRouteTablesRequest::parent].
13110 ///
13111 /// # Example
13112 /// ```ignore,no_run
13113 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
13114 /// # let project_id = "project_id";
13115 /// # let hub_id = "hub_id";
13116 /// let x = ListRouteTablesRequest::new().set_parent(format!("projects/{project_id}/locations/global/hubs/{hub_id}"));
13117 /// ```
13118 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13119 self.parent = v.into();
13120 self
13121 }
13122
13123 /// Sets the value of [page_size][crate::model::ListRouteTablesRequest::page_size].
13124 ///
13125 /// # Example
13126 /// ```ignore,no_run
13127 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
13128 /// let x = ListRouteTablesRequest::new().set_page_size(42);
13129 /// ```
13130 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13131 self.page_size = v.into();
13132 self
13133 }
13134
13135 /// Sets the value of [page_token][crate::model::ListRouteTablesRequest::page_token].
13136 ///
13137 /// # Example
13138 /// ```ignore,no_run
13139 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
13140 /// let x = ListRouteTablesRequest::new().set_page_token("example");
13141 /// ```
13142 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13143 self.page_token = v.into();
13144 self
13145 }
13146
13147 /// Sets the value of [filter][crate::model::ListRouteTablesRequest::filter].
13148 ///
13149 /// # Example
13150 /// ```ignore,no_run
13151 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
13152 /// let x = ListRouteTablesRequest::new().set_filter("example");
13153 /// ```
13154 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13155 self.filter = v.into();
13156 self
13157 }
13158
13159 /// Sets the value of [order_by][crate::model::ListRouteTablesRequest::order_by].
13160 ///
13161 /// # Example
13162 /// ```ignore,no_run
13163 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
13164 /// let x = ListRouteTablesRequest::new().set_order_by("example");
13165 /// ```
13166 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13167 self.order_by = v.into();
13168 self
13169 }
13170}
13171
13172impl wkt::message::Message for ListRouteTablesRequest {
13173 fn typename() -> &'static str {
13174 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesRequest"
13175 }
13176}
13177
13178/// Response for
13179/// [HubService.ListRouteTables][google.cloud.networkconnectivity.v1.HubService.ListRouteTables]
13180/// method.
13181///
13182/// [google.cloud.networkconnectivity.v1.HubService.ListRouteTables]: crate::client::HubService::list_route_tables
13183#[derive(Clone, Default, PartialEq)]
13184#[non_exhaustive]
13185pub struct ListRouteTablesResponse {
13186 /// The requested route tables.
13187 pub route_tables: std::vec::Vec<crate::model::RouteTable>,
13188
13189 /// The token for the next page of the response. To see more results,
13190 /// use this value as the page_token for your next request. If this value
13191 /// is empty, there are no more results.
13192 pub next_page_token: std::string::String,
13193
13194 /// Hubs that could not be reached.
13195 pub unreachable: std::vec::Vec<std::string::String>,
13196
13197 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13198}
13199
13200impl ListRouteTablesResponse {
13201 /// Creates a new default instance.
13202 pub fn new() -> Self {
13203 std::default::Default::default()
13204 }
13205
13206 /// Sets the value of [route_tables][crate::model::ListRouteTablesResponse::route_tables].
13207 ///
13208 /// # Example
13209 /// ```ignore,no_run
13210 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesResponse;
13211 /// use google_cloud_networkconnectivity_v1::model::RouteTable;
13212 /// let x = ListRouteTablesResponse::new()
13213 /// .set_route_tables([
13214 /// RouteTable::default()/* use setters */,
13215 /// RouteTable::default()/* use (different) setters */,
13216 /// ]);
13217 /// ```
13218 pub fn set_route_tables<T, V>(mut self, v: T) -> Self
13219 where
13220 T: std::iter::IntoIterator<Item = V>,
13221 V: std::convert::Into<crate::model::RouteTable>,
13222 {
13223 use std::iter::Iterator;
13224 self.route_tables = v.into_iter().map(|i| i.into()).collect();
13225 self
13226 }
13227
13228 /// Sets the value of [next_page_token][crate::model::ListRouteTablesResponse::next_page_token].
13229 ///
13230 /// # Example
13231 /// ```ignore,no_run
13232 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesResponse;
13233 /// let x = ListRouteTablesResponse::new().set_next_page_token("example");
13234 /// ```
13235 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13236 self.next_page_token = v.into();
13237 self
13238 }
13239
13240 /// Sets the value of [unreachable][crate::model::ListRouteTablesResponse::unreachable].
13241 ///
13242 /// # Example
13243 /// ```ignore,no_run
13244 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesResponse;
13245 /// let x = ListRouteTablesResponse::new().set_unreachable(["a", "b", "c"]);
13246 /// ```
13247 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13248 where
13249 T: std::iter::IntoIterator<Item = V>,
13250 V: std::convert::Into<std::string::String>,
13251 {
13252 use std::iter::Iterator;
13253 self.unreachable = v.into_iter().map(|i| i.into()).collect();
13254 self
13255 }
13256}
13257
13258impl wkt::message::Message for ListRouteTablesResponse {
13259 fn typename() -> &'static str {
13260 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesResponse"
13261 }
13262}
13263
13264#[doc(hidden)]
13265impl google_cloud_gax::paginator::internal::PageableResponse for ListRouteTablesResponse {
13266 type PageItem = crate::model::RouteTable;
13267
13268 fn items(self) -> std::vec::Vec<Self::PageItem> {
13269 self.route_tables
13270 }
13271
13272 fn next_page_token(&self) -> std::string::String {
13273 use std::clone::Clone;
13274 self.next_page_token.clone()
13275 }
13276}
13277
13278/// Request for
13279/// [HubService.ListGroups][google.cloud.networkconnectivity.v1.HubService.ListGroups]
13280/// method.
13281///
13282/// [google.cloud.networkconnectivity.v1.HubService.ListGroups]: crate::client::HubService::list_groups
13283#[derive(Clone, Default, PartialEq)]
13284#[non_exhaustive]
13285pub struct ListGroupsRequest {
13286 /// Required. The parent resource's name.
13287 pub parent: std::string::String,
13288
13289 /// The maximum number of results to return per page.
13290 pub page_size: i32,
13291
13292 /// The page token.
13293 pub page_token: std::string::String,
13294
13295 /// An expression that filters the list of results.
13296 pub filter: std::string::String,
13297
13298 /// Sort the results by a certain order.
13299 pub order_by: std::string::String,
13300
13301 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13302}
13303
13304impl ListGroupsRequest {
13305 /// Creates a new default instance.
13306 pub fn new() -> Self {
13307 std::default::Default::default()
13308 }
13309
13310 /// Sets the value of [parent][crate::model::ListGroupsRequest::parent].
13311 ///
13312 /// # Example
13313 /// ```ignore,no_run
13314 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13315 /// # let project_id = "project_id";
13316 /// # let hub_id = "hub_id";
13317 /// let x = ListGroupsRequest::new().set_parent(format!("projects/{project_id}/locations/global/hubs/{hub_id}"));
13318 /// ```
13319 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13320 self.parent = v.into();
13321 self
13322 }
13323
13324 /// Sets the value of [page_size][crate::model::ListGroupsRequest::page_size].
13325 ///
13326 /// # Example
13327 /// ```ignore,no_run
13328 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13329 /// let x = ListGroupsRequest::new().set_page_size(42);
13330 /// ```
13331 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13332 self.page_size = v.into();
13333 self
13334 }
13335
13336 /// Sets the value of [page_token][crate::model::ListGroupsRequest::page_token].
13337 ///
13338 /// # Example
13339 /// ```ignore,no_run
13340 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13341 /// let x = ListGroupsRequest::new().set_page_token("example");
13342 /// ```
13343 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13344 self.page_token = v.into();
13345 self
13346 }
13347
13348 /// Sets the value of [filter][crate::model::ListGroupsRequest::filter].
13349 ///
13350 /// # Example
13351 /// ```ignore,no_run
13352 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13353 /// let x = ListGroupsRequest::new().set_filter("example");
13354 /// ```
13355 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13356 self.filter = v.into();
13357 self
13358 }
13359
13360 /// Sets the value of [order_by][crate::model::ListGroupsRequest::order_by].
13361 ///
13362 /// # Example
13363 /// ```ignore,no_run
13364 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13365 /// let x = ListGroupsRequest::new().set_order_by("example");
13366 /// ```
13367 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13368 self.order_by = v.into();
13369 self
13370 }
13371}
13372
13373impl wkt::message::Message for ListGroupsRequest {
13374 fn typename() -> &'static str {
13375 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsRequest"
13376 }
13377}
13378
13379/// Response for
13380/// [HubService.ListGroups][google.cloud.networkconnectivity.v1.HubService.ListGroups]
13381/// method.
13382///
13383/// [google.cloud.networkconnectivity.v1.HubService.ListGroups]: crate::client::HubService::list_groups
13384#[derive(Clone, Default, PartialEq)]
13385#[non_exhaustive]
13386pub struct ListGroupsResponse {
13387 /// The requested groups.
13388 pub groups: std::vec::Vec<crate::model::Group>,
13389
13390 /// The token for the next page of the response. To see more results,
13391 /// use this value as the page_token for your next request. If this value
13392 /// is empty, there are no more results.
13393 pub next_page_token: std::string::String,
13394
13395 /// Hubs that could not be reached.
13396 pub unreachable: std::vec::Vec<std::string::String>,
13397
13398 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13399}
13400
13401impl ListGroupsResponse {
13402 /// Creates a new default instance.
13403 pub fn new() -> Self {
13404 std::default::Default::default()
13405 }
13406
13407 /// Sets the value of [groups][crate::model::ListGroupsResponse::groups].
13408 ///
13409 /// # Example
13410 /// ```ignore,no_run
13411 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsResponse;
13412 /// use google_cloud_networkconnectivity_v1::model::Group;
13413 /// let x = ListGroupsResponse::new()
13414 /// .set_groups([
13415 /// Group::default()/* use setters */,
13416 /// Group::default()/* use (different) setters */,
13417 /// ]);
13418 /// ```
13419 pub fn set_groups<T, V>(mut self, v: T) -> Self
13420 where
13421 T: std::iter::IntoIterator<Item = V>,
13422 V: std::convert::Into<crate::model::Group>,
13423 {
13424 use std::iter::Iterator;
13425 self.groups = v.into_iter().map(|i| i.into()).collect();
13426 self
13427 }
13428
13429 /// Sets the value of [next_page_token][crate::model::ListGroupsResponse::next_page_token].
13430 ///
13431 /// # Example
13432 /// ```ignore,no_run
13433 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsResponse;
13434 /// let x = ListGroupsResponse::new().set_next_page_token("example");
13435 /// ```
13436 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13437 self.next_page_token = v.into();
13438 self
13439 }
13440
13441 /// Sets the value of [unreachable][crate::model::ListGroupsResponse::unreachable].
13442 ///
13443 /// # Example
13444 /// ```ignore,no_run
13445 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsResponse;
13446 /// let x = ListGroupsResponse::new().set_unreachable(["a", "b", "c"]);
13447 /// ```
13448 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13449 where
13450 T: std::iter::IntoIterator<Item = V>,
13451 V: std::convert::Into<std::string::String>,
13452 {
13453 use std::iter::Iterator;
13454 self.unreachable = v.into_iter().map(|i| i.into()).collect();
13455 self
13456 }
13457}
13458
13459impl wkt::message::Message for ListGroupsResponse {
13460 fn typename() -> &'static str {
13461 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsResponse"
13462 }
13463}
13464
13465#[doc(hidden)]
13466impl google_cloud_gax::paginator::internal::PageableResponse for ListGroupsResponse {
13467 type PageItem = crate::model::Group;
13468
13469 fn items(self) -> std::vec::Vec<Self::PageItem> {
13470 self.groups
13471 }
13472
13473 fn next_page_token(&self) -> std::string::String {
13474 use std::clone::Clone;
13475 self.next_page_token.clone()
13476 }
13477}
13478
13479/// A collection of Cloud VPN tunnel resources. These resources should be
13480/// redundant HA VPN tunnels that all advertise the same prefixes to Google
13481/// Cloud. Alternatively, in a passive/active configuration, all tunnels
13482/// should be capable of advertising the same prefixes.
13483#[derive(Clone, Default, PartialEq)]
13484#[non_exhaustive]
13485pub struct LinkedVpnTunnels {
13486 /// The URIs of linked VPN tunnel resources.
13487 pub uris: std::vec::Vec<std::string::String>,
13488
13489 /// A value that controls whether site-to-site data transfer is enabled for
13490 /// these resources. Data transfer is available only in [supported
13491 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
13492 pub site_to_site_data_transfer: bool,
13493
13494 /// Output only. The VPC network where these VPN tunnels are located.
13495 pub vpc_network: std::string::String,
13496
13497 /// Optional. IP ranges allowed to be included during import from hub (does not
13498 /// control transit connectivity). The only allowed value for now is
13499 /// "ALL_IPV4_RANGES".
13500 pub include_import_ranges: std::vec::Vec<std::string::String>,
13501
13502 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13503}
13504
13505impl LinkedVpnTunnels {
13506 /// Creates a new default instance.
13507 pub fn new() -> Self {
13508 std::default::Default::default()
13509 }
13510
13511 /// Sets the value of [uris][crate::model::LinkedVpnTunnels::uris].
13512 ///
13513 /// # Example
13514 /// ```ignore,no_run
13515 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
13516 /// let x = LinkedVpnTunnels::new().set_uris(["a", "b", "c"]);
13517 /// ```
13518 pub fn set_uris<T, V>(mut self, v: T) -> Self
13519 where
13520 T: std::iter::IntoIterator<Item = V>,
13521 V: std::convert::Into<std::string::String>,
13522 {
13523 use std::iter::Iterator;
13524 self.uris = v.into_iter().map(|i| i.into()).collect();
13525 self
13526 }
13527
13528 /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedVpnTunnels::site_to_site_data_transfer].
13529 ///
13530 /// # Example
13531 /// ```ignore,no_run
13532 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
13533 /// let x = LinkedVpnTunnels::new().set_site_to_site_data_transfer(true);
13534 /// ```
13535 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13536 self.site_to_site_data_transfer = v.into();
13537 self
13538 }
13539
13540 /// Sets the value of [vpc_network][crate::model::LinkedVpnTunnels::vpc_network].
13541 ///
13542 /// # Example
13543 /// ```ignore,no_run
13544 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
13545 /// let x = LinkedVpnTunnels::new().set_vpc_network("example");
13546 /// ```
13547 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13548 self.vpc_network = v.into();
13549 self
13550 }
13551
13552 /// Sets the value of [include_import_ranges][crate::model::LinkedVpnTunnels::include_import_ranges].
13553 ///
13554 /// # Example
13555 /// ```ignore,no_run
13556 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
13557 /// let x = LinkedVpnTunnels::new().set_include_import_ranges(["a", "b", "c"]);
13558 /// ```
13559 pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
13560 where
13561 T: std::iter::IntoIterator<Item = V>,
13562 V: std::convert::Into<std::string::String>,
13563 {
13564 use std::iter::Iterator;
13565 self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
13566 self
13567 }
13568}
13569
13570impl wkt::message::Message for LinkedVpnTunnels {
13571 fn typename() -> &'static str {
13572 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpnTunnels"
13573 }
13574}
13575
13576/// A collection of VLAN attachment resources. These resources should
13577/// be redundant attachments that all advertise the same prefixes to Google
13578/// Cloud. Alternatively, in active/passive configurations, all attachments
13579/// should be capable of advertising the same prefixes.
13580#[derive(Clone, Default, PartialEq)]
13581#[non_exhaustive]
13582pub struct LinkedInterconnectAttachments {
13583 /// The URIs of linked interconnect attachment resources
13584 pub uris: std::vec::Vec<std::string::String>,
13585
13586 /// A value that controls whether site-to-site data transfer is enabled for
13587 /// these resources. Data transfer is available only in [supported
13588 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
13589 pub site_to_site_data_transfer: bool,
13590
13591 /// Output only. The VPC network where these VLAN attachments are located.
13592 pub vpc_network: std::string::String,
13593
13594 /// Optional. IP ranges allowed to be included during import from hub (does not
13595 /// control transit connectivity). The only allowed value for now is
13596 /// "ALL_IPV4_RANGES".
13597 pub include_import_ranges: std::vec::Vec<std::string::String>,
13598
13599 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13600}
13601
13602impl LinkedInterconnectAttachments {
13603 /// Creates a new default instance.
13604 pub fn new() -> Self {
13605 std::default::Default::default()
13606 }
13607
13608 /// Sets the value of [uris][crate::model::LinkedInterconnectAttachments::uris].
13609 ///
13610 /// # Example
13611 /// ```ignore,no_run
13612 /// # use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
13613 /// let x = LinkedInterconnectAttachments::new().set_uris(["a", "b", "c"]);
13614 /// ```
13615 pub fn set_uris<T, V>(mut self, v: T) -> Self
13616 where
13617 T: std::iter::IntoIterator<Item = V>,
13618 V: std::convert::Into<std::string::String>,
13619 {
13620 use std::iter::Iterator;
13621 self.uris = v.into_iter().map(|i| i.into()).collect();
13622 self
13623 }
13624
13625 /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedInterconnectAttachments::site_to_site_data_transfer].
13626 ///
13627 /// # Example
13628 /// ```ignore,no_run
13629 /// # use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
13630 /// let x = LinkedInterconnectAttachments::new().set_site_to_site_data_transfer(true);
13631 /// ```
13632 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13633 self.site_to_site_data_transfer = v.into();
13634 self
13635 }
13636
13637 /// Sets the value of [vpc_network][crate::model::LinkedInterconnectAttachments::vpc_network].
13638 ///
13639 /// # Example
13640 /// ```ignore,no_run
13641 /// # use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
13642 /// let x = LinkedInterconnectAttachments::new().set_vpc_network("example");
13643 /// ```
13644 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13645 self.vpc_network = v.into();
13646 self
13647 }
13648
13649 /// Sets the value of [include_import_ranges][crate::model::LinkedInterconnectAttachments::include_import_ranges].
13650 ///
13651 /// # Example
13652 /// ```ignore,no_run
13653 /// # use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
13654 /// let x = LinkedInterconnectAttachments::new().set_include_import_ranges(["a", "b", "c"]);
13655 /// ```
13656 pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
13657 where
13658 T: std::iter::IntoIterator<Item = V>,
13659 V: std::convert::Into<std::string::String>,
13660 {
13661 use std::iter::Iterator;
13662 self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
13663 self
13664 }
13665}
13666
13667impl wkt::message::Message for LinkedInterconnectAttachments {
13668 fn typename() -> &'static str {
13669 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments"
13670 }
13671}
13672
13673/// A collection of router appliance instances. If you configure multiple router
13674/// appliance instances to receive data from the same set of sites outside of
13675/// Google Cloud, we recommend that you associate those instances with the same
13676/// spoke.
13677#[derive(Clone, Default, PartialEq)]
13678#[non_exhaustive]
13679pub struct LinkedRouterApplianceInstances {
13680 /// The list of router appliance instances.
13681 pub instances: std::vec::Vec<crate::model::RouterApplianceInstance>,
13682
13683 /// A value that controls whether site-to-site data transfer is enabled for
13684 /// these resources. Data transfer is available only in [supported
13685 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
13686 pub site_to_site_data_transfer: bool,
13687
13688 /// Output only. The VPC network where these router appliance instances are
13689 /// located.
13690 pub vpc_network: std::string::String,
13691
13692 /// Optional. IP ranges allowed to be included during import from hub (does not
13693 /// control transit connectivity). The only allowed value for now is
13694 /// "ALL_IPV4_RANGES".
13695 pub include_import_ranges: std::vec::Vec<std::string::String>,
13696
13697 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13698}
13699
13700impl LinkedRouterApplianceInstances {
13701 /// Creates a new default instance.
13702 pub fn new() -> Self {
13703 std::default::Default::default()
13704 }
13705
13706 /// Sets the value of [instances][crate::model::LinkedRouterApplianceInstances::instances].
13707 ///
13708 /// # Example
13709 /// ```ignore,no_run
13710 /// # use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
13711 /// use google_cloud_networkconnectivity_v1::model::RouterApplianceInstance;
13712 /// let x = LinkedRouterApplianceInstances::new()
13713 /// .set_instances([
13714 /// RouterApplianceInstance::default()/* use setters */,
13715 /// RouterApplianceInstance::default()/* use (different) setters */,
13716 /// ]);
13717 /// ```
13718 pub fn set_instances<T, V>(mut self, v: T) -> Self
13719 where
13720 T: std::iter::IntoIterator<Item = V>,
13721 V: std::convert::Into<crate::model::RouterApplianceInstance>,
13722 {
13723 use std::iter::Iterator;
13724 self.instances = v.into_iter().map(|i| i.into()).collect();
13725 self
13726 }
13727
13728 /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedRouterApplianceInstances::site_to_site_data_transfer].
13729 ///
13730 /// # Example
13731 /// ```ignore,no_run
13732 /// # use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
13733 /// let x = LinkedRouterApplianceInstances::new().set_site_to_site_data_transfer(true);
13734 /// ```
13735 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13736 self.site_to_site_data_transfer = v.into();
13737 self
13738 }
13739
13740 /// Sets the value of [vpc_network][crate::model::LinkedRouterApplianceInstances::vpc_network].
13741 ///
13742 /// # Example
13743 /// ```ignore,no_run
13744 /// # use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
13745 /// let x = LinkedRouterApplianceInstances::new().set_vpc_network("example");
13746 /// ```
13747 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13748 self.vpc_network = v.into();
13749 self
13750 }
13751
13752 /// Sets the value of [include_import_ranges][crate::model::LinkedRouterApplianceInstances::include_import_ranges].
13753 ///
13754 /// # Example
13755 /// ```ignore,no_run
13756 /// # use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
13757 /// let x = LinkedRouterApplianceInstances::new().set_include_import_ranges(["a", "b", "c"]);
13758 /// ```
13759 pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
13760 where
13761 T: std::iter::IntoIterator<Item = V>,
13762 V: std::convert::Into<std::string::String>,
13763 {
13764 use std::iter::Iterator;
13765 self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
13766 self
13767 }
13768}
13769
13770impl wkt::message::Message for LinkedRouterApplianceInstances {
13771 fn typename() -> &'static str {
13772 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances"
13773 }
13774}
13775
13776/// An existing VPC network.
13777#[derive(Clone, Default, PartialEq)]
13778#[non_exhaustive]
13779pub struct LinkedVpcNetwork {
13780 /// Required. The URI of the VPC network resource.
13781 pub uri: std::string::String,
13782
13783 /// Optional. IP ranges encompassing the subnets to be excluded from peering.
13784 pub exclude_export_ranges: std::vec::Vec<std::string::String>,
13785
13786 /// Optional. IP ranges allowed to be included from peering.
13787 pub include_export_ranges: std::vec::Vec<std::string::String>,
13788
13789 /// Optional. The proposed include export IP ranges waiting for hub
13790 /// administration's approval.
13791 pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
13792
13793 /// Output only. The proposed exclude export IP ranges waiting for hub
13794 /// administration's approval.
13795 pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
13796
13797 /// Output only. The list of Producer VPC spokes that this VPC spoke is a
13798 /// service consumer VPC spoke for. These producer VPCs are connected through
13799 /// VPC peering to this spoke's backing VPC network. Because they are directly
13800 /// connected throuh VPC peering, NCC export filters do not apply between the
13801 /// service consumer VPC spoke and any of its producer VPC spokes. This VPC
13802 /// spoke cannot be deleted as long as any of these producer VPC spokes are
13803 /// connected to the NCC Hub.
13804 pub producer_vpc_spokes: std::vec::Vec<std::string::String>,
13805
13806 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13807}
13808
13809impl LinkedVpcNetwork {
13810 /// Creates a new default instance.
13811 pub fn new() -> Self {
13812 std::default::Default::default()
13813 }
13814
13815 /// Sets the value of [uri][crate::model::LinkedVpcNetwork::uri].
13816 ///
13817 /// # Example
13818 /// ```ignore,no_run
13819 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13820 /// let x = LinkedVpcNetwork::new().set_uri("example");
13821 /// ```
13822 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13823 self.uri = v.into();
13824 self
13825 }
13826
13827 /// Sets the value of [exclude_export_ranges][crate::model::LinkedVpcNetwork::exclude_export_ranges].
13828 ///
13829 /// # Example
13830 /// ```ignore,no_run
13831 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13832 /// let x = LinkedVpcNetwork::new().set_exclude_export_ranges(["a", "b", "c"]);
13833 /// ```
13834 pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
13835 where
13836 T: std::iter::IntoIterator<Item = V>,
13837 V: std::convert::Into<std::string::String>,
13838 {
13839 use std::iter::Iterator;
13840 self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
13841 self
13842 }
13843
13844 /// Sets the value of [include_export_ranges][crate::model::LinkedVpcNetwork::include_export_ranges].
13845 ///
13846 /// # Example
13847 /// ```ignore,no_run
13848 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13849 /// let x = LinkedVpcNetwork::new().set_include_export_ranges(["a", "b", "c"]);
13850 /// ```
13851 pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
13852 where
13853 T: std::iter::IntoIterator<Item = V>,
13854 V: std::convert::Into<std::string::String>,
13855 {
13856 use std::iter::Iterator;
13857 self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
13858 self
13859 }
13860
13861 /// Sets the value of [proposed_include_export_ranges][crate::model::LinkedVpcNetwork::proposed_include_export_ranges].
13862 ///
13863 /// # Example
13864 /// ```ignore,no_run
13865 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13866 /// let x = LinkedVpcNetwork::new().set_proposed_include_export_ranges(["a", "b", "c"]);
13867 /// ```
13868 pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
13869 where
13870 T: std::iter::IntoIterator<Item = V>,
13871 V: std::convert::Into<std::string::String>,
13872 {
13873 use std::iter::Iterator;
13874 self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
13875 self
13876 }
13877
13878 /// Sets the value of [proposed_exclude_export_ranges][crate::model::LinkedVpcNetwork::proposed_exclude_export_ranges].
13879 ///
13880 /// # Example
13881 /// ```ignore,no_run
13882 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13883 /// let x = LinkedVpcNetwork::new().set_proposed_exclude_export_ranges(["a", "b", "c"]);
13884 /// ```
13885 pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
13886 where
13887 T: std::iter::IntoIterator<Item = V>,
13888 V: std::convert::Into<std::string::String>,
13889 {
13890 use std::iter::Iterator;
13891 self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
13892 self
13893 }
13894
13895 /// Sets the value of [producer_vpc_spokes][crate::model::LinkedVpcNetwork::producer_vpc_spokes].
13896 ///
13897 /// # Example
13898 /// ```ignore,no_run
13899 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13900 /// let x = LinkedVpcNetwork::new().set_producer_vpc_spokes(["a", "b", "c"]);
13901 /// ```
13902 pub fn set_producer_vpc_spokes<T, V>(mut self, v: T) -> Self
13903 where
13904 T: std::iter::IntoIterator<Item = V>,
13905 V: std::convert::Into<std::string::String>,
13906 {
13907 use std::iter::Iterator;
13908 self.producer_vpc_spokes = v.into_iter().map(|i| i.into()).collect();
13909 self
13910 }
13911}
13912
13913impl wkt::message::Message for LinkedVpcNetwork {
13914 fn typename() -> &'static str {
13915 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpcNetwork"
13916 }
13917}
13918
13919#[allow(missing_docs)]
13920#[derive(Clone, Default, PartialEq)]
13921#[non_exhaustive]
13922pub struct LinkedProducerVpcNetwork {
13923 /// Immutable. The URI of the Service Consumer VPC that the Producer VPC is
13924 /// peered with.
13925 pub network: std::string::String,
13926
13927 /// Output only. The Service Consumer Network spoke.
13928 pub service_consumer_vpc_spoke: std::string::String,
13929
13930 /// Immutable. The name of the VPC peering between the Service Consumer VPC and
13931 /// the Producer VPC (defined in the Tenant project) which is added to the NCC
13932 /// hub. This peering must be in ACTIVE state.
13933 pub peering: std::string::String,
13934
13935 /// Output only. The URI of the Producer VPC.
13936 pub producer_network: std::string::String,
13937
13938 /// Optional. IP ranges encompassing the subnets to be excluded from peering.
13939 pub exclude_export_ranges: std::vec::Vec<std::string::String>,
13940
13941 /// Optional. IP ranges allowed to be included from peering.
13942 pub include_export_ranges: std::vec::Vec<std::string::String>,
13943
13944 /// Optional. The proposed include export IP ranges waiting for hub
13945 /// administration's approval.
13946 pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
13947
13948 /// Output only. The proposed exclude export IP ranges waiting for hub
13949 /// administration's approval.
13950 pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
13951
13952 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13953}
13954
13955impl LinkedProducerVpcNetwork {
13956 /// Creates a new default instance.
13957 pub fn new() -> Self {
13958 std::default::Default::default()
13959 }
13960
13961 /// Sets the value of [network][crate::model::LinkedProducerVpcNetwork::network].
13962 ///
13963 /// # Example
13964 /// ```ignore,no_run
13965 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13966 /// let x = LinkedProducerVpcNetwork::new().set_network("example");
13967 /// ```
13968 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13969 self.network = v.into();
13970 self
13971 }
13972
13973 /// Sets the value of [service_consumer_vpc_spoke][crate::model::LinkedProducerVpcNetwork::service_consumer_vpc_spoke].
13974 ///
13975 /// # Example
13976 /// ```ignore,no_run
13977 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13978 /// # let project_id = "project_id";
13979 /// # let location_id = "location_id";
13980 /// # let spoke_id = "spoke_id";
13981 /// let x = LinkedProducerVpcNetwork::new().set_service_consumer_vpc_spoke(format!("projects/{project_id}/locations/{location_id}/spokes/{spoke_id}"));
13982 /// ```
13983 pub fn set_service_consumer_vpc_spoke<T: std::convert::Into<std::string::String>>(
13984 mut self,
13985 v: T,
13986 ) -> Self {
13987 self.service_consumer_vpc_spoke = v.into();
13988 self
13989 }
13990
13991 /// Sets the value of [peering][crate::model::LinkedProducerVpcNetwork::peering].
13992 ///
13993 /// # Example
13994 /// ```ignore,no_run
13995 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13996 /// let x = LinkedProducerVpcNetwork::new().set_peering("example");
13997 /// ```
13998 pub fn set_peering<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13999 self.peering = v.into();
14000 self
14001 }
14002
14003 /// Sets the value of [producer_network][crate::model::LinkedProducerVpcNetwork::producer_network].
14004 ///
14005 /// # Example
14006 /// ```ignore,no_run
14007 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
14008 /// let x = LinkedProducerVpcNetwork::new().set_producer_network("example");
14009 /// ```
14010 pub fn set_producer_network<T: std::convert::Into<std::string::String>>(
14011 mut self,
14012 v: T,
14013 ) -> Self {
14014 self.producer_network = v.into();
14015 self
14016 }
14017
14018 /// Sets the value of [exclude_export_ranges][crate::model::LinkedProducerVpcNetwork::exclude_export_ranges].
14019 ///
14020 /// # Example
14021 /// ```ignore,no_run
14022 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
14023 /// let x = LinkedProducerVpcNetwork::new().set_exclude_export_ranges(["a", "b", "c"]);
14024 /// ```
14025 pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
14026 where
14027 T: std::iter::IntoIterator<Item = V>,
14028 V: std::convert::Into<std::string::String>,
14029 {
14030 use std::iter::Iterator;
14031 self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
14032 self
14033 }
14034
14035 /// Sets the value of [include_export_ranges][crate::model::LinkedProducerVpcNetwork::include_export_ranges].
14036 ///
14037 /// # Example
14038 /// ```ignore,no_run
14039 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
14040 /// let x = LinkedProducerVpcNetwork::new().set_include_export_ranges(["a", "b", "c"]);
14041 /// ```
14042 pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
14043 where
14044 T: std::iter::IntoIterator<Item = V>,
14045 V: std::convert::Into<std::string::String>,
14046 {
14047 use std::iter::Iterator;
14048 self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
14049 self
14050 }
14051
14052 /// Sets the value of [proposed_include_export_ranges][crate::model::LinkedProducerVpcNetwork::proposed_include_export_ranges].
14053 ///
14054 /// # Example
14055 /// ```ignore,no_run
14056 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
14057 /// let x = LinkedProducerVpcNetwork::new().set_proposed_include_export_ranges(["a", "b", "c"]);
14058 /// ```
14059 pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
14060 where
14061 T: std::iter::IntoIterator<Item = V>,
14062 V: std::convert::Into<std::string::String>,
14063 {
14064 use std::iter::Iterator;
14065 self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
14066 self
14067 }
14068
14069 /// Sets the value of [proposed_exclude_export_ranges][crate::model::LinkedProducerVpcNetwork::proposed_exclude_export_ranges].
14070 ///
14071 /// # Example
14072 /// ```ignore,no_run
14073 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
14074 /// let x = LinkedProducerVpcNetwork::new().set_proposed_exclude_export_ranges(["a", "b", "c"]);
14075 /// ```
14076 pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
14077 where
14078 T: std::iter::IntoIterator<Item = V>,
14079 V: std::convert::Into<std::string::String>,
14080 {
14081 use std::iter::Iterator;
14082 self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
14083 self
14084 }
14085}
14086
14087impl wkt::message::Message for LinkedProducerVpcNetwork {
14088 fn typename() -> &'static str {
14089 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedProducerVpcNetwork"
14090 }
14091}
14092
14093/// A router appliance instance is a Compute Engine virtual machine (VM) instance
14094/// that acts as a BGP speaker. A router appliance instance is specified by the
14095/// URI of the VM and the internal IP address of one of the VM's network
14096/// interfaces.
14097#[derive(Clone, Default, PartialEq)]
14098#[non_exhaustive]
14099pub struct RouterApplianceInstance {
14100 /// The URI of the VM.
14101 pub virtual_machine: std::string::String,
14102
14103 /// The IP address on the VM to use for peering.
14104 pub ip_address: std::string::String,
14105
14106 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14107}
14108
14109impl RouterApplianceInstance {
14110 /// Creates a new default instance.
14111 pub fn new() -> Self {
14112 std::default::Default::default()
14113 }
14114
14115 /// Sets the value of [virtual_machine][crate::model::RouterApplianceInstance::virtual_machine].
14116 ///
14117 /// # Example
14118 /// ```ignore,no_run
14119 /// # use google_cloud_networkconnectivity_v1::model::RouterApplianceInstance;
14120 /// let x = RouterApplianceInstance::new().set_virtual_machine("example");
14121 /// ```
14122 pub fn set_virtual_machine<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14123 self.virtual_machine = v.into();
14124 self
14125 }
14126
14127 /// Sets the value of [ip_address][crate::model::RouterApplianceInstance::ip_address].
14128 ///
14129 /// # Example
14130 /// ```ignore,no_run
14131 /// # use google_cloud_networkconnectivity_v1::model::RouterApplianceInstance;
14132 /// let x = RouterApplianceInstance::new().set_ip_address("example");
14133 /// ```
14134 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14135 self.ip_address = v.into();
14136 self
14137 }
14138}
14139
14140impl wkt::message::Message for RouterApplianceInstance {
14141 fn typename() -> &'static str {
14142 "type.googleapis.com/google.cloud.networkconnectivity.v1.RouterApplianceInstance"
14143 }
14144}
14145
14146/// Metadata about locations
14147#[derive(Clone, Default, PartialEq)]
14148#[non_exhaustive]
14149pub struct LocationMetadata {
14150 /// List of supported features
14151 pub location_features: std::vec::Vec<crate::model::LocationFeature>,
14152
14153 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14154}
14155
14156impl LocationMetadata {
14157 /// Creates a new default instance.
14158 pub fn new() -> Self {
14159 std::default::Default::default()
14160 }
14161
14162 /// Sets the value of [location_features][crate::model::LocationMetadata::location_features].
14163 ///
14164 /// # Example
14165 /// ```ignore,no_run
14166 /// # use google_cloud_networkconnectivity_v1::model::LocationMetadata;
14167 /// use google_cloud_networkconnectivity_v1::model::LocationFeature;
14168 /// let x = LocationMetadata::new().set_location_features([
14169 /// LocationFeature::SiteToCloudSpokes,
14170 /// LocationFeature::SiteToSiteSpokes,
14171 /// ]);
14172 /// ```
14173 pub fn set_location_features<T, V>(mut self, v: T) -> Self
14174 where
14175 T: std::iter::IntoIterator<Item = V>,
14176 V: std::convert::Into<crate::model::LocationFeature>,
14177 {
14178 use std::iter::Iterator;
14179 self.location_features = v.into_iter().map(|i| i.into()).collect();
14180 self
14181 }
14182}
14183
14184impl wkt::message::Message for LocationMetadata {
14185 fn typename() -> &'static str {
14186 "type.googleapis.com/google.cloud.networkconnectivity.v1.LocationMetadata"
14187 }
14188}
14189
14190#[allow(missing_docs)]
14191#[derive(Clone, Default, PartialEq)]
14192#[non_exhaustive]
14193pub struct NextHopVpcNetwork {
14194 /// The URI of the VPC network resource
14195 pub uri: std::string::String,
14196
14197 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14198}
14199
14200impl NextHopVpcNetwork {
14201 /// Creates a new default instance.
14202 pub fn new() -> Self {
14203 std::default::Default::default()
14204 }
14205
14206 /// Sets the value of [uri][crate::model::NextHopVpcNetwork::uri].
14207 ///
14208 /// # Example
14209 /// ```ignore,no_run
14210 /// # use google_cloud_networkconnectivity_v1::model::NextHopVpcNetwork;
14211 /// let x = NextHopVpcNetwork::new().set_uri("example");
14212 /// ```
14213 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14214 self.uri = v.into();
14215 self
14216 }
14217}
14218
14219impl wkt::message::Message for NextHopVpcNetwork {
14220 fn typename() -> &'static str {
14221 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVpcNetwork"
14222 }
14223}
14224
14225/// A route next hop that leads to a VPN tunnel resource.
14226#[derive(Clone, Default, PartialEq)]
14227#[non_exhaustive]
14228pub struct NextHopVPNTunnel {
14229 /// The URI of the VPN tunnel resource.
14230 pub uri: std::string::String,
14231
14232 /// The VPC network where this VPN tunnel is located.
14233 pub vpc_network: std::string::String,
14234
14235 /// Indicates whether site-to-site data transfer is allowed for this VPN tunnel
14236 /// resource. Data transfer is available only in [supported
14237 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
14238 pub site_to_site_data_transfer: bool,
14239
14240 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14241}
14242
14243impl NextHopVPNTunnel {
14244 /// Creates a new default instance.
14245 pub fn new() -> Self {
14246 std::default::Default::default()
14247 }
14248
14249 /// Sets the value of [uri][crate::model::NextHopVPNTunnel::uri].
14250 ///
14251 /// # Example
14252 /// ```ignore,no_run
14253 /// # use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
14254 /// let x = NextHopVPNTunnel::new().set_uri("example");
14255 /// ```
14256 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14257 self.uri = v.into();
14258 self
14259 }
14260
14261 /// Sets the value of [vpc_network][crate::model::NextHopVPNTunnel::vpc_network].
14262 ///
14263 /// # Example
14264 /// ```ignore,no_run
14265 /// # use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
14266 /// let x = NextHopVPNTunnel::new().set_vpc_network("example");
14267 /// ```
14268 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14269 self.vpc_network = v.into();
14270 self
14271 }
14272
14273 /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopVPNTunnel::site_to_site_data_transfer].
14274 ///
14275 /// # Example
14276 /// ```ignore,no_run
14277 /// # use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
14278 /// let x = NextHopVPNTunnel::new().set_site_to_site_data_transfer(true);
14279 /// ```
14280 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14281 self.site_to_site_data_transfer = v.into();
14282 self
14283 }
14284}
14285
14286impl wkt::message::Message for NextHopVPNTunnel {
14287 fn typename() -> &'static str {
14288 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVPNTunnel"
14289 }
14290}
14291
14292/// A route next hop that leads to a Router appliance instance.
14293#[derive(Clone, Default, PartialEq)]
14294#[non_exhaustive]
14295pub struct NextHopRouterApplianceInstance {
14296 /// The URI of the Router appliance instance.
14297 pub uri: std::string::String,
14298
14299 /// The VPC network where this VM is located.
14300 pub vpc_network: std::string::String,
14301
14302 /// Indicates whether site-to-site data transfer is allowed for this Router
14303 /// appliance instance resource. Data transfer is available only in [supported
14304 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
14305 pub site_to_site_data_transfer: bool,
14306
14307 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14308}
14309
14310impl NextHopRouterApplianceInstance {
14311 /// Creates a new default instance.
14312 pub fn new() -> Self {
14313 std::default::Default::default()
14314 }
14315
14316 /// Sets the value of [uri][crate::model::NextHopRouterApplianceInstance::uri].
14317 ///
14318 /// # Example
14319 /// ```ignore,no_run
14320 /// # use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
14321 /// let x = NextHopRouterApplianceInstance::new().set_uri("example");
14322 /// ```
14323 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14324 self.uri = v.into();
14325 self
14326 }
14327
14328 /// Sets the value of [vpc_network][crate::model::NextHopRouterApplianceInstance::vpc_network].
14329 ///
14330 /// # Example
14331 /// ```ignore,no_run
14332 /// # use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
14333 /// let x = NextHopRouterApplianceInstance::new().set_vpc_network("example");
14334 /// ```
14335 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14336 self.vpc_network = v.into();
14337 self
14338 }
14339
14340 /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopRouterApplianceInstance::site_to_site_data_transfer].
14341 ///
14342 /// # Example
14343 /// ```ignore,no_run
14344 /// # use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
14345 /// let x = NextHopRouterApplianceInstance::new().set_site_to_site_data_transfer(true);
14346 /// ```
14347 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14348 self.site_to_site_data_transfer = v.into();
14349 self
14350 }
14351}
14352
14353impl wkt::message::Message for NextHopRouterApplianceInstance {
14354 fn typename() -> &'static str {
14355 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopRouterApplianceInstance"
14356 }
14357}
14358
14359/// A route next hop that leads to an interconnect attachment resource.
14360#[derive(Clone, Default, PartialEq)]
14361#[non_exhaustive]
14362pub struct NextHopInterconnectAttachment {
14363 /// The URI of the interconnect attachment resource.
14364 pub uri: std::string::String,
14365
14366 /// The VPC network where this interconnect attachment is located.
14367 pub vpc_network: std::string::String,
14368
14369 /// Indicates whether site-to-site data transfer is allowed for this
14370 /// interconnect attachment resource. Data transfer is available only in
14371 /// [supported
14372 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
14373 pub site_to_site_data_transfer: bool,
14374
14375 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14376}
14377
14378impl NextHopInterconnectAttachment {
14379 /// Creates a new default instance.
14380 pub fn new() -> Self {
14381 std::default::Default::default()
14382 }
14383
14384 /// Sets the value of [uri][crate::model::NextHopInterconnectAttachment::uri].
14385 ///
14386 /// # Example
14387 /// ```ignore,no_run
14388 /// # use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
14389 /// let x = NextHopInterconnectAttachment::new().set_uri("example");
14390 /// ```
14391 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14392 self.uri = v.into();
14393 self
14394 }
14395
14396 /// Sets the value of [vpc_network][crate::model::NextHopInterconnectAttachment::vpc_network].
14397 ///
14398 /// # Example
14399 /// ```ignore,no_run
14400 /// # use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
14401 /// let x = NextHopInterconnectAttachment::new().set_vpc_network("example");
14402 /// ```
14403 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14404 self.vpc_network = v.into();
14405 self
14406 }
14407
14408 /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopInterconnectAttachment::site_to_site_data_transfer].
14409 ///
14410 /// # Example
14411 /// ```ignore,no_run
14412 /// # use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
14413 /// let x = NextHopInterconnectAttachment::new().set_site_to_site_data_transfer(true);
14414 /// ```
14415 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14416 self.site_to_site_data_transfer = v.into();
14417 self
14418 }
14419}
14420
14421impl wkt::message::Message for NextHopInterconnectAttachment {
14422 fn typename() -> &'static str {
14423 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopInterconnectAttachment"
14424 }
14425}
14426
14427/// Summarizes information about the spokes associated with a hub.
14428/// The summary includes a count of spokes according to type
14429/// and according to state. If any spokes are inactive,
14430/// the summary also lists the reasons they are inactive,
14431/// including a count for each reason.
14432#[derive(Clone, Default, PartialEq)]
14433#[non_exhaustive]
14434pub struct SpokeSummary {
14435 /// Output only. Counts the number of spokes of each type that are
14436 /// associated with a specific hub.
14437 pub spoke_type_counts: std::vec::Vec<crate::model::spoke_summary::SpokeTypeCount>,
14438
14439 /// Output only. Counts the number of spokes that are in each state
14440 /// and associated with a given hub.
14441 pub spoke_state_counts: std::vec::Vec<crate::model::spoke_summary::SpokeStateCount>,
14442
14443 /// Output only. Counts the number of spokes that are inactive for each
14444 /// possible reason and associated with a given hub.
14445 pub spoke_state_reason_counts:
14446 std::vec::Vec<crate::model::spoke_summary::SpokeStateReasonCount>,
14447
14448 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14449}
14450
14451impl SpokeSummary {
14452 /// Creates a new default instance.
14453 pub fn new() -> Self {
14454 std::default::Default::default()
14455 }
14456
14457 /// Sets the value of [spoke_type_counts][crate::model::SpokeSummary::spoke_type_counts].
14458 ///
14459 /// # Example
14460 /// ```ignore,no_run
14461 /// # use google_cloud_networkconnectivity_v1::model::SpokeSummary;
14462 /// use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeTypeCount;
14463 /// let x = SpokeSummary::new()
14464 /// .set_spoke_type_counts([
14465 /// SpokeTypeCount::default()/* use setters */,
14466 /// SpokeTypeCount::default()/* use (different) setters */,
14467 /// ]);
14468 /// ```
14469 pub fn set_spoke_type_counts<T, V>(mut self, v: T) -> Self
14470 where
14471 T: std::iter::IntoIterator<Item = V>,
14472 V: std::convert::Into<crate::model::spoke_summary::SpokeTypeCount>,
14473 {
14474 use std::iter::Iterator;
14475 self.spoke_type_counts = v.into_iter().map(|i| i.into()).collect();
14476 self
14477 }
14478
14479 /// Sets the value of [spoke_state_counts][crate::model::SpokeSummary::spoke_state_counts].
14480 ///
14481 /// # Example
14482 /// ```ignore,no_run
14483 /// # use google_cloud_networkconnectivity_v1::model::SpokeSummary;
14484 /// use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateCount;
14485 /// let x = SpokeSummary::new()
14486 /// .set_spoke_state_counts([
14487 /// SpokeStateCount::default()/* use setters */,
14488 /// SpokeStateCount::default()/* use (different) setters */,
14489 /// ]);
14490 /// ```
14491 pub fn set_spoke_state_counts<T, V>(mut self, v: T) -> Self
14492 where
14493 T: std::iter::IntoIterator<Item = V>,
14494 V: std::convert::Into<crate::model::spoke_summary::SpokeStateCount>,
14495 {
14496 use std::iter::Iterator;
14497 self.spoke_state_counts = v.into_iter().map(|i| i.into()).collect();
14498 self
14499 }
14500
14501 /// Sets the value of [spoke_state_reason_counts][crate::model::SpokeSummary::spoke_state_reason_counts].
14502 ///
14503 /// # Example
14504 /// ```ignore,no_run
14505 /// # use google_cloud_networkconnectivity_v1::model::SpokeSummary;
14506 /// use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateReasonCount;
14507 /// let x = SpokeSummary::new()
14508 /// .set_spoke_state_reason_counts([
14509 /// SpokeStateReasonCount::default()/* use setters */,
14510 /// SpokeStateReasonCount::default()/* use (different) setters */,
14511 /// ]);
14512 /// ```
14513 pub fn set_spoke_state_reason_counts<T, V>(mut self, v: T) -> Self
14514 where
14515 T: std::iter::IntoIterator<Item = V>,
14516 V: std::convert::Into<crate::model::spoke_summary::SpokeStateReasonCount>,
14517 {
14518 use std::iter::Iterator;
14519 self.spoke_state_reason_counts = v.into_iter().map(|i| i.into()).collect();
14520 self
14521 }
14522}
14523
14524impl wkt::message::Message for SpokeSummary {
14525 fn typename() -> &'static str {
14526 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary"
14527 }
14528}
14529
14530/// Defines additional types related to [SpokeSummary].
14531pub mod spoke_summary {
14532 #[allow(unused_imports)]
14533 use super::*;
14534
14535 /// The number of spokes of a given type that are associated
14536 /// with a specific hub. The type indicates what kind of
14537 /// resource is associated with the spoke.
14538 #[derive(Clone, Default, PartialEq)]
14539 #[non_exhaustive]
14540 pub struct SpokeTypeCount {
14541 /// Output only. The type of the spokes.
14542 pub spoke_type: crate::model::SpokeType,
14543
14544 /// Output only. The total number of spokes of this type that are
14545 /// associated with the hub.
14546 pub count: i64,
14547
14548 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14549 }
14550
14551 impl SpokeTypeCount {
14552 /// Creates a new default instance.
14553 pub fn new() -> Self {
14554 std::default::Default::default()
14555 }
14556
14557 /// Sets the value of [spoke_type][crate::model::spoke_summary::SpokeTypeCount::spoke_type].
14558 ///
14559 /// # Example
14560 /// ```ignore,no_run
14561 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeTypeCount;
14562 /// use google_cloud_networkconnectivity_v1::model::SpokeType;
14563 /// let x0 = SpokeTypeCount::new().set_spoke_type(SpokeType::VpnTunnel);
14564 /// let x1 = SpokeTypeCount::new().set_spoke_type(SpokeType::InterconnectAttachment);
14565 /// let x2 = SpokeTypeCount::new().set_spoke_type(SpokeType::RouterAppliance);
14566 /// ```
14567 pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(
14568 mut self,
14569 v: T,
14570 ) -> Self {
14571 self.spoke_type = v.into();
14572 self
14573 }
14574
14575 /// Sets the value of [count][crate::model::spoke_summary::SpokeTypeCount::count].
14576 ///
14577 /// # Example
14578 /// ```ignore,no_run
14579 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeTypeCount;
14580 /// let x = SpokeTypeCount::new().set_count(42);
14581 /// ```
14582 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14583 self.count = v.into();
14584 self
14585 }
14586 }
14587
14588 impl wkt::message::Message for SpokeTypeCount {
14589 fn typename() -> &'static str {
14590 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount"
14591 }
14592 }
14593
14594 /// The number of spokes that are in a particular state
14595 /// and associated with a given hub.
14596 #[derive(Clone, Default, PartialEq)]
14597 #[non_exhaustive]
14598 pub struct SpokeStateCount {
14599 /// Output only. The state of the spokes.
14600 pub state: crate::model::State,
14601
14602 /// Output only. The total number of spokes that are in this state
14603 /// and associated with a given hub.
14604 pub count: i64,
14605
14606 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14607 }
14608
14609 impl SpokeStateCount {
14610 /// Creates a new default instance.
14611 pub fn new() -> Self {
14612 std::default::Default::default()
14613 }
14614
14615 /// Sets the value of [state][crate::model::spoke_summary::SpokeStateCount::state].
14616 ///
14617 /// # Example
14618 /// ```ignore,no_run
14619 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateCount;
14620 /// use google_cloud_networkconnectivity_v1::model::State;
14621 /// let x0 = SpokeStateCount::new().set_state(State::Creating);
14622 /// let x1 = SpokeStateCount::new().set_state(State::Active);
14623 /// let x2 = SpokeStateCount::new().set_state(State::Deleting);
14624 /// ```
14625 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
14626 self.state = v.into();
14627 self
14628 }
14629
14630 /// Sets the value of [count][crate::model::spoke_summary::SpokeStateCount::count].
14631 ///
14632 /// # Example
14633 /// ```ignore,no_run
14634 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateCount;
14635 /// let x = SpokeStateCount::new().set_count(42);
14636 /// ```
14637 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14638 self.count = v.into();
14639 self
14640 }
14641 }
14642
14643 impl wkt::message::Message for SpokeStateCount {
14644 fn typename() -> &'static str {
14645 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount"
14646 }
14647 }
14648
14649 /// The number of spokes in the hub that are inactive for this reason.
14650 #[derive(Clone, Default, PartialEq)]
14651 #[non_exhaustive]
14652 pub struct SpokeStateReasonCount {
14653 /// Output only. The reason that a spoke is inactive.
14654 pub state_reason_code: crate::model::spoke::state_reason::Code,
14655
14656 /// Output only. The total number of spokes that are inactive for a
14657 /// particular reason and associated with a given hub.
14658 pub count: i64,
14659
14660 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14661 }
14662
14663 impl SpokeStateReasonCount {
14664 /// Creates a new default instance.
14665 pub fn new() -> Self {
14666 std::default::Default::default()
14667 }
14668
14669 /// Sets the value of [state_reason_code][crate::model::spoke_summary::SpokeStateReasonCount::state_reason_code].
14670 ///
14671 /// # Example
14672 /// ```ignore,no_run
14673 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateReasonCount;
14674 /// use google_cloud_networkconnectivity_v1::model::spoke::state_reason::Code;
14675 /// let x0 = SpokeStateReasonCount::new().set_state_reason_code(Code::PendingReview);
14676 /// let x1 = SpokeStateReasonCount::new().set_state_reason_code(Code::Rejected);
14677 /// let x2 = SpokeStateReasonCount::new().set_state_reason_code(Code::Paused);
14678 /// ```
14679 pub fn set_state_reason_code<
14680 T: std::convert::Into<crate::model::spoke::state_reason::Code>,
14681 >(
14682 mut self,
14683 v: T,
14684 ) -> Self {
14685 self.state_reason_code = v.into();
14686 self
14687 }
14688
14689 /// Sets the value of [count][crate::model::spoke_summary::SpokeStateReasonCount::count].
14690 ///
14691 /// # Example
14692 /// ```ignore,no_run
14693 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateReasonCount;
14694 /// let x = SpokeStateReasonCount::new().set_count(42);
14695 /// ```
14696 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14697 self.count = v.into();
14698 self
14699 }
14700 }
14701
14702 impl wkt::message::Message for SpokeStateReasonCount {
14703 fn typename() -> &'static str {
14704 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount"
14705 }
14706 }
14707}
14708
14709/// The request for
14710/// [HubService.GetGroup][google.cloud.networkconnectivity.v1.HubService.GetGroup].
14711///
14712/// [google.cloud.networkconnectivity.v1.HubService.GetGroup]: crate::client::HubService::get_group
14713#[derive(Clone, Default, PartialEq)]
14714#[non_exhaustive]
14715pub struct GetGroupRequest {
14716 /// Required. The name of the route table resource.
14717 pub name: std::string::String,
14718
14719 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14720}
14721
14722impl GetGroupRequest {
14723 /// Creates a new default instance.
14724 pub fn new() -> Self {
14725 std::default::Default::default()
14726 }
14727
14728 /// Sets the value of [name][crate::model::GetGroupRequest::name].
14729 ///
14730 /// # Example
14731 /// ```ignore,no_run
14732 /// # use google_cloud_networkconnectivity_v1::model::GetGroupRequest;
14733 /// # let project_id = "project_id";
14734 /// # let hub_id = "hub_id";
14735 /// # let group_id = "group_id";
14736 /// let x = GetGroupRequest::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}/groups/{group_id}"));
14737 /// ```
14738 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14739 self.name = v.into();
14740 self
14741 }
14742}
14743
14744impl wkt::message::Message for GetGroupRequest {
14745 fn typename() -> &'static str {
14746 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetGroupRequest"
14747 }
14748}
14749
14750/// Request for
14751/// [HubService.UpdateGroup][google.cloud.networkconnectivity.v1.HubService.UpdateGroup]
14752/// method.
14753///
14754/// [google.cloud.networkconnectivity.v1.HubService.UpdateGroup]: crate::client::HubService::update_group
14755#[derive(Clone, Default, PartialEq)]
14756#[non_exhaustive]
14757pub struct UpdateGroupRequest {
14758 /// Optional. In the case of an update to an existing group, field mask is used
14759 /// to specify the fields to be overwritten. The fields specified in the
14760 /// update_mask are relative to the resource, not the full request. A field is
14761 /// overwritten if it is in the mask. If the user does not provide a mask, then
14762 /// all fields are overwritten.
14763 pub update_mask: std::option::Option<wkt::FieldMask>,
14764
14765 /// Required. The state that the group should be in after the update.
14766 pub group: std::option::Option<crate::model::Group>,
14767
14768 /// Optional. A request ID to identify requests. Specify a unique request ID so
14769 /// that if you must retry your request, the server knows to ignore the request
14770 /// if it has already been completed. The server guarantees that a request
14771 /// doesn't result in creation of duplicate commitments for at least 60
14772 /// minutes.
14773 ///
14774 /// For example, consider a situation where you make an initial request and
14775 /// the request times out. If you make the request again with the same request
14776 /// ID, the server can check to see whether the original operation
14777 /// was received. If it was, the server ignores the second request. This
14778 /// behavior prevents clients from mistakenly creating duplicate commitments.
14779 ///
14780 /// The request ID must be a valid UUID, with the exception that zero UUID is
14781 /// not supported (00000000-0000-0000-0000-000000000000).
14782 pub request_id: std::string::String,
14783
14784 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14785}
14786
14787impl UpdateGroupRequest {
14788 /// Creates a new default instance.
14789 pub fn new() -> Self {
14790 std::default::Default::default()
14791 }
14792
14793 /// Sets the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
14794 ///
14795 /// # Example
14796 /// ```ignore,no_run
14797 /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14798 /// use wkt::FieldMask;
14799 /// let x = UpdateGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
14800 /// ```
14801 pub fn set_update_mask<T>(mut self, v: T) -> Self
14802 where
14803 T: std::convert::Into<wkt::FieldMask>,
14804 {
14805 self.update_mask = std::option::Option::Some(v.into());
14806 self
14807 }
14808
14809 /// Sets or clears the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
14810 ///
14811 /// # Example
14812 /// ```ignore,no_run
14813 /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14814 /// use wkt::FieldMask;
14815 /// let x = UpdateGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
14816 /// let x = UpdateGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
14817 /// ```
14818 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14819 where
14820 T: std::convert::Into<wkt::FieldMask>,
14821 {
14822 self.update_mask = v.map(|x| x.into());
14823 self
14824 }
14825
14826 /// Sets the value of [group][crate::model::UpdateGroupRequest::group].
14827 ///
14828 /// # Example
14829 /// ```ignore,no_run
14830 /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14831 /// use google_cloud_networkconnectivity_v1::model::Group;
14832 /// let x = UpdateGroupRequest::new().set_group(Group::default()/* use setters */);
14833 /// ```
14834 pub fn set_group<T>(mut self, v: T) -> Self
14835 where
14836 T: std::convert::Into<crate::model::Group>,
14837 {
14838 self.group = std::option::Option::Some(v.into());
14839 self
14840 }
14841
14842 /// Sets or clears the value of [group][crate::model::UpdateGroupRequest::group].
14843 ///
14844 /// # Example
14845 /// ```ignore,no_run
14846 /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14847 /// use google_cloud_networkconnectivity_v1::model::Group;
14848 /// let x = UpdateGroupRequest::new().set_or_clear_group(Some(Group::default()/* use setters */));
14849 /// let x = UpdateGroupRequest::new().set_or_clear_group(None::<Group>);
14850 /// ```
14851 pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
14852 where
14853 T: std::convert::Into<crate::model::Group>,
14854 {
14855 self.group = v.map(|x| x.into());
14856 self
14857 }
14858
14859 /// Sets the value of [request_id][crate::model::UpdateGroupRequest::request_id].
14860 ///
14861 /// # Example
14862 /// ```ignore,no_run
14863 /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14864 /// let x = UpdateGroupRequest::new().set_request_id("example");
14865 /// ```
14866 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14867 self.request_id = v.into();
14868 self
14869 }
14870}
14871
14872impl wkt::message::Message for UpdateGroupRequest {
14873 fn typename() -> &'static str {
14874 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateGroupRequest"
14875 }
14876}
14877
14878/// The internal range resource for IPAM operations within a VPC network.
14879/// Used to represent a private address range along with behavioral
14880/// characteristics of that range (its usage and peering behavior).
14881/// Networking resources can link to this range if they are created
14882/// as belonging to it.
14883#[derive(Clone, Default, PartialEq)]
14884#[non_exhaustive]
14885pub struct InternalRange {
14886 /// Identifier. The name of an internal range.
14887 /// Format:
14888 /// projects/{project}/locations/{location}/internalRanges/{internal_range}
14889 /// See: <https://google.aip.dev/122#fields-representing-resource-names>
14890 pub name: std::string::String,
14891
14892 /// Output only. Time when the internal range was created.
14893 pub create_time: std::option::Option<wkt::Timestamp>,
14894
14895 /// Output only. Time when the internal range was updated.
14896 pub update_time: std::option::Option<wkt::Timestamp>,
14897
14898 /// User-defined labels.
14899 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
14900
14901 /// Optional. A description of this resource.
14902 pub description: std::string::String,
14903
14904 /// Optional. The IP range that this internal range defines.
14905 /// NOTE: IPv6 ranges are limited to usage=EXTERNAL_TO_VPC and
14906 /// peering=FOR_SELF.
14907 /// NOTE: For IPv6 Ranges this field is compulsory, i.e. the address range must
14908 /// be specified explicitly.
14909 pub ip_cidr_range: std::string::String,
14910
14911 /// Immutable. The URL or resource ID of the network in which to reserve the
14912 /// internal range. The network cannot be deleted if there are any reserved
14913 /// internal ranges referring to it. Legacy networks are not supported. For
14914 /// example:
14915 /// <https://www.googleapis.com/compute/v1/projects/{project}/locations/global/networks/{network}>
14916 /// projects/{project}/locations/global/networks/{network}
14917 /// {network}
14918 pub network: std::string::String,
14919
14920 /// Optional. The type of usage set for this InternalRange.
14921 pub usage: crate::model::internal_range::Usage,
14922
14923 /// Optional. The type of peering set for this internal range.
14924 pub peering: crate::model::internal_range::Peering,
14925
14926 /// Optional. An alternate to ip_cidr_range. Can be set when trying to create
14927 /// an IPv4 reservation that automatically finds a free range of the given
14928 /// size. If both ip_cidr_range and prefix_length are set, there is an error if
14929 /// the range sizes do not match. Can also be used during updates to change the
14930 /// range size.
14931 /// NOTE: For IPv6 this field only works if ip_cidr_range is set as well, and
14932 /// both fields must match. In other words, with IPv6 this field only works as
14933 /// a redundant parameter.
14934 pub prefix_length: i32,
14935
14936 /// Optional. Can be set to narrow down or pick a different address space while
14937 /// searching for a free range. If not set, defaults to the ["10.0.0.0/8",
14938 /// "172.16.0.0/12", "192.168.0.0/16"] address space (for auto-mode networks,
14939 /// the "10.0.0.0/9" range is used instead of "10.0.0.0/8"). This can be used
14940 /// to target the search in other rfc-1918 address spaces like "172.16.0.0/12"
14941 /// and "192.168.0.0/16" or non-rfc-1918 address spaces used in the VPC.
14942 pub target_cidr_range: std::vec::Vec<std::string::String>,
14943
14944 /// Output only. The list of resources that refer to this internal range.
14945 /// Resources that use the internal range for their range allocation
14946 /// are referred to as users of the range. Other resources mark themselves
14947 /// as users while doing so by creating a reference to this internal range.
14948 /// Having a user, based on this reference, prevents deletion of the
14949 /// internal range referred to. Can be empty.
14950 pub users: std::vec::Vec<std::string::String>,
14951
14952 /// Optional. Types of resources that are allowed to overlap with the current
14953 /// internal range.
14954 pub overlaps: std::vec::Vec<crate::model::internal_range::Overlap>,
14955
14956 /// Optional. Must be present if usage is set to FOR_MIGRATION.
14957 pub migration: std::option::Option<crate::model::internal_range::Migration>,
14958
14959 /// Optional. Immutable ranges cannot have their fields modified, except for
14960 /// labels and description.
14961 pub immutable: bool,
14962
14963 /// Optional. Range auto-allocation options, may be set only when
14964 /// auto-allocation is selected by not setting ip_cidr_range (and setting
14965 /// prefix_length).
14966 pub allocation_options: std::option::Option<crate::model::internal_range::AllocationOptions>,
14967
14968 /// Optional. ExcludeCidrRanges flag. Specifies a set of CIDR blocks that
14969 /// allows exclusion of particular CIDR ranges from the auto-allocation
14970 /// process, without having to reserve these blocks
14971 pub exclude_cidr_ranges: std::vec::Vec<std::string::String>,
14972
14973 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14974}
14975
14976impl InternalRange {
14977 /// Creates a new default instance.
14978 pub fn new() -> Self {
14979 std::default::Default::default()
14980 }
14981
14982 /// Sets the value of [name][crate::model::InternalRange::name].
14983 ///
14984 /// # Example
14985 /// ```ignore,no_run
14986 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14987 /// # let project_id = "project_id";
14988 /// # let location_id = "location_id";
14989 /// # let internal_range_id = "internal_range_id";
14990 /// let x = InternalRange::new().set_name(format!("projects/{project_id}/locations/{location_id}/internalRanges/{internal_range_id}"));
14991 /// ```
14992 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14993 self.name = v.into();
14994 self
14995 }
14996
14997 /// Sets the value of [create_time][crate::model::InternalRange::create_time].
14998 ///
14999 /// # Example
15000 /// ```ignore,no_run
15001 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15002 /// use wkt::Timestamp;
15003 /// let x = InternalRange::new().set_create_time(Timestamp::default()/* use setters */);
15004 /// ```
15005 pub fn set_create_time<T>(mut self, v: T) -> Self
15006 where
15007 T: std::convert::Into<wkt::Timestamp>,
15008 {
15009 self.create_time = std::option::Option::Some(v.into());
15010 self
15011 }
15012
15013 /// Sets or clears the value of [create_time][crate::model::InternalRange::create_time].
15014 ///
15015 /// # Example
15016 /// ```ignore,no_run
15017 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15018 /// use wkt::Timestamp;
15019 /// let x = InternalRange::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
15020 /// let x = InternalRange::new().set_or_clear_create_time(None::<Timestamp>);
15021 /// ```
15022 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15023 where
15024 T: std::convert::Into<wkt::Timestamp>,
15025 {
15026 self.create_time = v.map(|x| x.into());
15027 self
15028 }
15029
15030 /// Sets the value of [update_time][crate::model::InternalRange::update_time].
15031 ///
15032 /// # Example
15033 /// ```ignore,no_run
15034 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15035 /// use wkt::Timestamp;
15036 /// let x = InternalRange::new().set_update_time(Timestamp::default()/* use setters */);
15037 /// ```
15038 pub fn set_update_time<T>(mut self, v: T) -> Self
15039 where
15040 T: std::convert::Into<wkt::Timestamp>,
15041 {
15042 self.update_time = std::option::Option::Some(v.into());
15043 self
15044 }
15045
15046 /// Sets or clears the value of [update_time][crate::model::InternalRange::update_time].
15047 ///
15048 /// # Example
15049 /// ```ignore,no_run
15050 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15051 /// use wkt::Timestamp;
15052 /// let x = InternalRange::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
15053 /// let x = InternalRange::new().set_or_clear_update_time(None::<Timestamp>);
15054 /// ```
15055 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
15056 where
15057 T: std::convert::Into<wkt::Timestamp>,
15058 {
15059 self.update_time = v.map(|x| x.into());
15060 self
15061 }
15062
15063 /// Sets the value of [labels][crate::model::InternalRange::labels].
15064 ///
15065 /// # Example
15066 /// ```ignore,no_run
15067 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15068 /// let x = InternalRange::new().set_labels([
15069 /// ("key0", "abc"),
15070 /// ("key1", "xyz"),
15071 /// ]);
15072 /// ```
15073 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
15074 where
15075 T: std::iter::IntoIterator<Item = (K, V)>,
15076 K: std::convert::Into<std::string::String>,
15077 V: std::convert::Into<std::string::String>,
15078 {
15079 use std::iter::Iterator;
15080 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15081 self
15082 }
15083
15084 /// Sets the value of [description][crate::model::InternalRange::description].
15085 ///
15086 /// # Example
15087 /// ```ignore,no_run
15088 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15089 /// let x = InternalRange::new().set_description("example");
15090 /// ```
15091 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15092 self.description = v.into();
15093 self
15094 }
15095
15096 /// Sets the value of [ip_cidr_range][crate::model::InternalRange::ip_cidr_range].
15097 ///
15098 /// # Example
15099 /// ```ignore,no_run
15100 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15101 /// let x = InternalRange::new().set_ip_cidr_range("example");
15102 /// ```
15103 pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15104 self.ip_cidr_range = v.into();
15105 self
15106 }
15107
15108 /// Sets the value of [network][crate::model::InternalRange::network].
15109 ///
15110 /// # Example
15111 /// ```ignore,no_run
15112 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15113 /// let x = InternalRange::new().set_network("example");
15114 /// ```
15115 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15116 self.network = v.into();
15117 self
15118 }
15119
15120 /// Sets the value of [usage][crate::model::InternalRange::usage].
15121 ///
15122 /// # Example
15123 /// ```ignore,no_run
15124 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15125 /// use google_cloud_networkconnectivity_v1::model::internal_range::Usage;
15126 /// let x0 = InternalRange::new().set_usage(Usage::ForVpc);
15127 /// let x1 = InternalRange::new().set_usage(Usage::ExternalToVpc);
15128 /// let x2 = InternalRange::new().set_usage(Usage::ForMigration);
15129 /// ```
15130 pub fn set_usage<T: std::convert::Into<crate::model::internal_range::Usage>>(
15131 mut self,
15132 v: T,
15133 ) -> Self {
15134 self.usage = v.into();
15135 self
15136 }
15137
15138 /// Sets the value of [peering][crate::model::InternalRange::peering].
15139 ///
15140 /// # Example
15141 /// ```ignore,no_run
15142 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15143 /// use google_cloud_networkconnectivity_v1::model::internal_range::Peering;
15144 /// let x0 = InternalRange::new().set_peering(Peering::ForSelf);
15145 /// let x1 = InternalRange::new().set_peering(Peering::ForPeer);
15146 /// let x2 = InternalRange::new().set_peering(Peering::NotShared);
15147 /// ```
15148 pub fn set_peering<T: std::convert::Into<crate::model::internal_range::Peering>>(
15149 mut self,
15150 v: T,
15151 ) -> Self {
15152 self.peering = v.into();
15153 self
15154 }
15155
15156 /// Sets the value of [prefix_length][crate::model::InternalRange::prefix_length].
15157 ///
15158 /// # Example
15159 /// ```ignore,no_run
15160 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15161 /// let x = InternalRange::new().set_prefix_length(42);
15162 /// ```
15163 pub fn set_prefix_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15164 self.prefix_length = v.into();
15165 self
15166 }
15167
15168 /// Sets the value of [target_cidr_range][crate::model::InternalRange::target_cidr_range].
15169 ///
15170 /// # Example
15171 /// ```ignore,no_run
15172 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15173 /// let x = InternalRange::new().set_target_cidr_range(["a", "b", "c"]);
15174 /// ```
15175 pub fn set_target_cidr_range<T, V>(mut self, v: T) -> Self
15176 where
15177 T: std::iter::IntoIterator<Item = V>,
15178 V: std::convert::Into<std::string::String>,
15179 {
15180 use std::iter::Iterator;
15181 self.target_cidr_range = v.into_iter().map(|i| i.into()).collect();
15182 self
15183 }
15184
15185 /// Sets the value of [users][crate::model::InternalRange::users].
15186 ///
15187 /// # Example
15188 /// ```ignore,no_run
15189 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15190 /// let x = InternalRange::new().set_users(["a", "b", "c"]);
15191 /// ```
15192 pub fn set_users<T, V>(mut self, v: T) -> Self
15193 where
15194 T: std::iter::IntoIterator<Item = V>,
15195 V: std::convert::Into<std::string::String>,
15196 {
15197 use std::iter::Iterator;
15198 self.users = v.into_iter().map(|i| i.into()).collect();
15199 self
15200 }
15201
15202 /// Sets the value of [overlaps][crate::model::InternalRange::overlaps].
15203 ///
15204 /// # Example
15205 /// ```ignore,no_run
15206 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15207 /// use google_cloud_networkconnectivity_v1::model::internal_range::Overlap;
15208 /// let x = InternalRange::new().set_overlaps([
15209 /// Overlap::RouteRange,
15210 /// Overlap::ExistingSubnetRange,
15211 /// ]);
15212 /// ```
15213 pub fn set_overlaps<T, V>(mut self, v: T) -> Self
15214 where
15215 T: std::iter::IntoIterator<Item = V>,
15216 V: std::convert::Into<crate::model::internal_range::Overlap>,
15217 {
15218 use std::iter::Iterator;
15219 self.overlaps = v.into_iter().map(|i| i.into()).collect();
15220 self
15221 }
15222
15223 /// Sets the value of [migration][crate::model::InternalRange::migration].
15224 ///
15225 /// # Example
15226 /// ```ignore,no_run
15227 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15228 /// use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
15229 /// let x = InternalRange::new().set_migration(Migration::default()/* use setters */);
15230 /// ```
15231 pub fn set_migration<T>(mut self, v: T) -> Self
15232 where
15233 T: std::convert::Into<crate::model::internal_range::Migration>,
15234 {
15235 self.migration = std::option::Option::Some(v.into());
15236 self
15237 }
15238
15239 /// Sets or clears the value of [migration][crate::model::InternalRange::migration].
15240 ///
15241 /// # Example
15242 /// ```ignore,no_run
15243 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15244 /// use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
15245 /// let x = InternalRange::new().set_or_clear_migration(Some(Migration::default()/* use setters */));
15246 /// let x = InternalRange::new().set_or_clear_migration(None::<Migration>);
15247 /// ```
15248 pub fn set_or_clear_migration<T>(mut self, v: std::option::Option<T>) -> Self
15249 where
15250 T: std::convert::Into<crate::model::internal_range::Migration>,
15251 {
15252 self.migration = v.map(|x| x.into());
15253 self
15254 }
15255
15256 /// Sets the value of [immutable][crate::model::InternalRange::immutable].
15257 ///
15258 /// # Example
15259 /// ```ignore,no_run
15260 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15261 /// let x = InternalRange::new().set_immutable(true);
15262 /// ```
15263 pub fn set_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15264 self.immutable = v.into();
15265 self
15266 }
15267
15268 /// Sets the value of [allocation_options][crate::model::InternalRange::allocation_options].
15269 ///
15270 /// # Example
15271 /// ```ignore,no_run
15272 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15273 /// use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15274 /// let x = InternalRange::new().set_allocation_options(AllocationOptions::default()/* use setters */);
15275 /// ```
15276 pub fn set_allocation_options<T>(mut self, v: T) -> Self
15277 where
15278 T: std::convert::Into<crate::model::internal_range::AllocationOptions>,
15279 {
15280 self.allocation_options = std::option::Option::Some(v.into());
15281 self
15282 }
15283
15284 /// Sets or clears the value of [allocation_options][crate::model::InternalRange::allocation_options].
15285 ///
15286 /// # Example
15287 /// ```ignore,no_run
15288 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15289 /// use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15290 /// let x = InternalRange::new().set_or_clear_allocation_options(Some(AllocationOptions::default()/* use setters */));
15291 /// let x = InternalRange::new().set_or_clear_allocation_options(None::<AllocationOptions>);
15292 /// ```
15293 pub fn set_or_clear_allocation_options<T>(mut self, v: std::option::Option<T>) -> Self
15294 where
15295 T: std::convert::Into<crate::model::internal_range::AllocationOptions>,
15296 {
15297 self.allocation_options = v.map(|x| x.into());
15298 self
15299 }
15300
15301 /// Sets the value of [exclude_cidr_ranges][crate::model::InternalRange::exclude_cidr_ranges].
15302 ///
15303 /// # Example
15304 /// ```ignore,no_run
15305 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15306 /// let x = InternalRange::new().set_exclude_cidr_ranges(["a", "b", "c"]);
15307 /// ```
15308 pub fn set_exclude_cidr_ranges<T, V>(mut self, v: T) -> Self
15309 where
15310 T: std::iter::IntoIterator<Item = V>,
15311 V: std::convert::Into<std::string::String>,
15312 {
15313 use std::iter::Iterator;
15314 self.exclude_cidr_ranges = v.into_iter().map(|i| i.into()).collect();
15315 self
15316 }
15317}
15318
15319impl wkt::message::Message for InternalRange {
15320 fn typename() -> &'static str {
15321 "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange"
15322 }
15323}
15324
15325/// Defines additional types related to [InternalRange].
15326pub mod internal_range {
15327 #[allow(unused_imports)]
15328 use super::*;
15329
15330 /// Specification for migration with source and target resource names.
15331 #[derive(Clone, Default, PartialEq)]
15332 #[non_exhaustive]
15333 pub struct Migration {
15334 /// Immutable. Resource path as an URI of the source resource, for example a
15335 /// subnet. The project for the source resource should match the project for
15336 /// the InternalRange. An example:
15337 /// /projects/{project}/regions/{region}/subnetworks/{subnet}
15338 pub source: std::string::String,
15339
15340 /// Immutable. Resource path of the target resource. The target project can
15341 /// be different, as in the cases when migrating to peer networks. For
15342 /// example:
15343 /// /projects/{project}/regions/{region}/subnetworks/{subnet}
15344 pub target: std::string::String,
15345
15346 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15347 }
15348
15349 impl Migration {
15350 /// Creates a new default instance.
15351 pub fn new() -> Self {
15352 std::default::Default::default()
15353 }
15354
15355 /// Sets the value of [source][crate::model::internal_range::Migration::source].
15356 ///
15357 /// # Example
15358 /// ```ignore,no_run
15359 /// # use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
15360 /// let x = Migration::new().set_source("example");
15361 /// ```
15362 pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15363 self.source = v.into();
15364 self
15365 }
15366
15367 /// Sets the value of [target][crate::model::internal_range::Migration::target].
15368 ///
15369 /// # Example
15370 /// ```ignore,no_run
15371 /// # use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
15372 /// let x = Migration::new().set_target("example");
15373 /// ```
15374 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15375 self.target = v.into();
15376 self
15377 }
15378 }
15379
15380 impl wkt::message::Message for Migration {
15381 fn typename() -> &'static str {
15382 "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange.Migration"
15383 }
15384 }
15385
15386 /// Range auto-allocation options, to be optionally used when CIDR block is not
15387 /// explicitly set.
15388 #[derive(Clone, Default, PartialEq)]
15389 #[non_exhaustive]
15390 pub struct AllocationOptions {
15391 /// Optional. Allocation strategy Not setting this field when the allocation
15392 /// is requested means an implementation defined strategy is used.
15393 pub allocation_strategy: crate::model::internal_range::AllocationStrategy,
15394
15395 /// Optional. This field must be set only when allocation_strategy is set to
15396 /// RANDOM_FIRST_N_AVAILABLE.
15397 /// The value should be the maximum expected parallelism of range creation
15398 /// requests issued to the same space of peered netwroks.
15399 pub first_available_ranges_lookup_size: i32,
15400
15401 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15402 }
15403
15404 impl AllocationOptions {
15405 /// Creates a new default instance.
15406 pub fn new() -> Self {
15407 std::default::Default::default()
15408 }
15409
15410 /// Sets the value of [allocation_strategy][crate::model::internal_range::AllocationOptions::allocation_strategy].
15411 ///
15412 /// # Example
15413 /// ```ignore,no_run
15414 /// # use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15415 /// use google_cloud_networkconnectivity_v1::model::internal_range::AllocationStrategy;
15416 /// let x0 = AllocationOptions::new().set_allocation_strategy(AllocationStrategy::Random);
15417 /// let x1 = AllocationOptions::new().set_allocation_strategy(AllocationStrategy::FirstAvailable);
15418 /// let x2 = AllocationOptions::new().set_allocation_strategy(AllocationStrategy::RandomFirstNAvailable);
15419 /// ```
15420 pub fn set_allocation_strategy<
15421 T: std::convert::Into<crate::model::internal_range::AllocationStrategy>,
15422 >(
15423 mut self,
15424 v: T,
15425 ) -> Self {
15426 self.allocation_strategy = v.into();
15427 self
15428 }
15429
15430 /// Sets the value of [first_available_ranges_lookup_size][crate::model::internal_range::AllocationOptions::first_available_ranges_lookup_size].
15431 ///
15432 /// # Example
15433 /// ```ignore,no_run
15434 /// # use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15435 /// let x = AllocationOptions::new().set_first_available_ranges_lookup_size(42);
15436 /// ```
15437 pub fn set_first_available_ranges_lookup_size<T: std::convert::Into<i32>>(
15438 mut self,
15439 v: T,
15440 ) -> Self {
15441 self.first_available_ranges_lookup_size = v.into();
15442 self
15443 }
15444 }
15445
15446 impl wkt::message::Message for AllocationOptions {
15447 fn typename() -> &'static str {
15448 "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange.AllocationOptions"
15449 }
15450 }
15451
15452 /// Possible usage of an internal range.
15453 ///
15454 /// # Working with unknown values
15455 ///
15456 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15457 /// additional enum variants at any time. Adding new variants is not considered
15458 /// a breaking change. Applications should write their code in anticipation of:
15459 ///
15460 /// - New values appearing in future releases of the client library, **and**
15461 /// - New values received dynamically, without application changes.
15462 ///
15463 /// Please consult the [Working with enums] section in the user guide for some
15464 /// guidelines.
15465 ///
15466 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15467 #[derive(Clone, Debug, PartialEq)]
15468 #[non_exhaustive]
15469 pub enum Usage {
15470 /// Unspecified usage is allowed in calls which identify the resource by
15471 /// other fields and do not need Usage set to complete. These are, i.e.:
15472 /// GetInternalRange and DeleteInternalRange.
15473 /// Usage needs to be specified explicitly in CreateInternalRange
15474 /// or UpdateInternalRange calls.
15475 Unspecified,
15476 /// A VPC resource can use the reserved CIDR block by associating it with the
15477 /// internal range resource if usage is set to FOR_VPC.
15478 ForVpc,
15479 /// Ranges created with EXTERNAL_TO_VPC cannot be associated with VPC
15480 /// resources and are meant to block out address ranges for various use
15481 /// cases, like for example, usage on-prem, with dynamic route announcements
15482 /// via interconnect.
15483 ExternalToVpc,
15484 /// Ranges created FOR_MIGRATION can be used to lock a CIDR range between a
15485 /// source and target subnet. If usage is set to FOR_MIGRATION, the peering
15486 /// value has to be set to FOR_SELF or default to FOR_SELF when unset.
15487 ForMigration,
15488 /// If set, the enum was initialized with an unknown value.
15489 ///
15490 /// Applications can examine the value using [Usage::value] or
15491 /// [Usage::name].
15492 UnknownValue(usage::UnknownValue),
15493 }
15494
15495 #[doc(hidden)]
15496 pub mod usage {
15497 #[allow(unused_imports)]
15498 use super::*;
15499 #[derive(Clone, Debug, PartialEq)]
15500 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15501 }
15502
15503 impl Usage {
15504 /// Gets the enum value.
15505 ///
15506 /// Returns `None` if the enum contains an unknown value deserialized from
15507 /// the string representation of enums.
15508 pub fn value(&self) -> std::option::Option<i32> {
15509 match self {
15510 Self::Unspecified => std::option::Option::Some(0),
15511 Self::ForVpc => std::option::Option::Some(1),
15512 Self::ExternalToVpc => std::option::Option::Some(2),
15513 Self::ForMigration => std::option::Option::Some(3),
15514 Self::UnknownValue(u) => u.0.value(),
15515 }
15516 }
15517
15518 /// Gets the enum value as a string.
15519 ///
15520 /// Returns `None` if the enum contains an unknown value deserialized from
15521 /// the integer representation of enums.
15522 pub fn name(&self) -> std::option::Option<&str> {
15523 match self {
15524 Self::Unspecified => std::option::Option::Some("USAGE_UNSPECIFIED"),
15525 Self::ForVpc => std::option::Option::Some("FOR_VPC"),
15526 Self::ExternalToVpc => std::option::Option::Some("EXTERNAL_TO_VPC"),
15527 Self::ForMigration => std::option::Option::Some("FOR_MIGRATION"),
15528 Self::UnknownValue(u) => u.0.name(),
15529 }
15530 }
15531 }
15532
15533 impl std::default::Default for Usage {
15534 fn default() -> Self {
15535 use std::convert::From;
15536 Self::from(0)
15537 }
15538 }
15539
15540 impl std::fmt::Display for Usage {
15541 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15542 wkt::internal::display_enum(f, self.name(), self.value())
15543 }
15544 }
15545
15546 impl std::convert::From<i32> for Usage {
15547 fn from(value: i32) -> Self {
15548 match value {
15549 0 => Self::Unspecified,
15550 1 => Self::ForVpc,
15551 2 => Self::ExternalToVpc,
15552 3 => Self::ForMigration,
15553 _ => Self::UnknownValue(usage::UnknownValue(
15554 wkt::internal::UnknownEnumValue::Integer(value),
15555 )),
15556 }
15557 }
15558 }
15559
15560 impl std::convert::From<&str> for Usage {
15561 fn from(value: &str) -> Self {
15562 use std::string::ToString;
15563 match value {
15564 "USAGE_UNSPECIFIED" => Self::Unspecified,
15565 "FOR_VPC" => Self::ForVpc,
15566 "EXTERNAL_TO_VPC" => Self::ExternalToVpc,
15567 "FOR_MIGRATION" => Self::ForMigration,
15568 _ => Self::UnknownValue(usage::UnknownValue(
15569 wkt::internal::UnknownEnumValue::String(value.to_string()),
15570 )),
15571 }
15572 }
15573 }
15574
15575 impl serde::ser::Serialize for Usage {
15576 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15577 where
15578 S: serde::Serializer,
15579 {
15580 match self {
15581 Self::Unspecified => serializer.serialize_i32(0),
15582 Self::ForVpc => serializer.serialize_i32(1),
15583 Self::ExternalToVpc => serializer.serialize_i32(2),
15584 Self::ForMigration => serializer.serialize_i32(3),
15585 Self::UnknownValue(u) => u.0.serialize(serializer),
15586 }
15587 }
15588 }
15589
15590 impl<'de> serde::de::Deserialize<'de> for Usage {
15591 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15592 where
15593 D: serde::Deserializer<'de>,
15594 {
15595 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Usage>::new(
15596 ".google.cloud.networkconnectivity.v1.InternalRange.Usage",
15597 ))
15598 }
15599 }
15600
15601 /// Peering type.
15602 ///
15603 /// # Working with unknown values
15604 ///
15605 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15606 /// additional enum variants at any time. Adding new variants is not considered
15607 /// a breaking change. Applications should write their code in anticipation of:
15608 ///
15609 /// - New values appearing in future releases of the client library, **and**
15610 /// - New values received dynamically, without application changes.
15611 ///
15612 /// Please consult the [Working with enums] section in the user guide for some
15613 /// guidelines.
15614 ///
15615 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15616 #[derive(Clone, Debug, PartialEq)]
15617 #[non_exhaustive]
15618 pub enum Peering {
15619 /// If Peering is left unspecified in CreateInternalRange or
15620 /// UpdateInternalRange, it will be defaulted to FOR_SELF.
15621 Unspecified,
15622 /// This is the default behavior and represents the case that this
15623 /// internal range is intended to be used in the VPC in which it is created
15624 /// and is accessible from its peers. This implies that peers or
15625 /// peers-of-peers cannot use this range.
15626 ForSelf,
15627 /// This behavior can be set when the internal range is being reserved for
15628 /// usage by peers. This means that no resource within the VPC in which
15629 /// it is being created can use this to associate with a VPC resource, but
15630 /// one of the peers can. This represents donating a range for peers to
15631 /// use.
15632 ForPeer,
15633 /// This behavior can be set when the internal range is being reserved for
15634 /// usage by the VPC in which it is created, but not shared with peers.
15635 /// In a sense, it is local to the VPC. This can be used to create internal
15636 /// ranges for various purposes like HTTP_INTERNAL_LOAD_BALANCER or for
15637 /// Interconnect routes that are not shared with peers. This also implies
15638 /// that peers cannot use this range in a way that is visible to this VPC,
15639 /// but can re-use this range as long as it is NOT_SHARED from the peer VPC,
15640 /// too.
15641 NotShared,
15642 /// If set, the enum was initialized with an unknown value.
15643 ///
15644 /// Applications can examine the value using [Peering::value] or
15645 /// [Peering::name].
15646 UnknownValue(peering::UnknownValue),
15647 }
15648
15649 #[doc(hidden)]
15650 pub mod peering {
15651 #[allow(unused_imports)]
15652 use super::*;
15653 #[derive(Clone, Debug, PartialEq)]
15654 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15655 }
15656
15657 impl Peering {
15658 /// Gets the enum value.
15659 ///
15660 /// Returns `None` if the enum contains an unknown value deserialized from
15661 /// the string representation of enums.
15662 pub fn value(&self) -> std::option::Option<i32> {
15663 match self {
15664 Self::Unspecified => std::option::Option::Some(0),
15665 Self::ForSelf => std::option::Option::Some(1),
15666 Self::ForPeer => std::option::Option::Some(2),
15667 Self::NotShared => std::option::Option::Some(3),
15668 Self::UnknownValue(u) => u.0.value(),
15669 }
15670 }
15671
15672 /// Gets the enum value as a string.
15673 ///
15674 /// Returns `None` if the enum contains an unknown value deserialized from
15675 /// the integer representation of enums.
15676 pub fn name(&self) -> std::option::Option<&str> {
15677 match self {
15678 Self::Unspecified => std::option::Option::Some("PEERING_UNSPECIFIED"),
15679 Self::ForSelf => std::option::Option::Some("FOR_SELF"),
15680 Self::ForPeer => std::option::Option::Some("FOR_PEER"),
15681 Self::NotShared => std::option::Option::Some("NOT_SHARED"),
15682 Self::UnknownValue(u) => u.0.name(),
15683 }
15684 }
15685 }
15686
15687 impl std::default::Default for Peering {
15688 fn default() -> Self {
15689 use std::convert::From;
15690 Self::from(0)
15691 }
15692 }
15693
15694 impl std::fmt::Display for Peering {
15695 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15696 wkt::internal::display_enum(f, self.name(), self.value())
15697 }
15698 }
15699
15700 impl std::convert::From<i32> for Peering {
15701 fn from(value: i32) -> Self {
15702 match value {
15703 0 => Self::Unspecified,
15704 1 => Self::ForSelf,
15705 2 => Self::ForPeer,
15706 3 => Self::NotShared,
15707 _ => Self::UnknownValue(peering::UnknownValue(
15708 wkt::internal::UnknownEnumValue::Integer(value),
15709 )),
15710 }
15711 }
15712 }
15713
15714 impl std::convert::From<&str> for Peering {
15715 fn from(value: &str) -> Self {
15716 use std::string::ToString;
15717 match value {
15718 "PEERING_UNSPECIFIED" => Self::Unspecified,
15719 "FOR_SELF" => Self::ForSelf,
15720 "FOR_PEER" => Self::ForPeer,
15721 "NOT_SHARED" => Self::NotShared,
15722 _ => Self::UnknownValue(peering::UnknownValue(
15723 wkt::internal::UnknownEnumValue::String(value.to_string()),
15724 )),
15725 }
15726 }
15727 }
15728
15729 impl serde::ser::Serialize for Peering {
15730 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15731 where
15732 S: serde::Serializer,
15733 {
15734 match self {
15735 Self::Unspecified => serializer.serialize_i32(0),
15736 Self::ForSelf => serializer.serialize_i32(1),
15737 Self::ForPeer => serializer.serialize_i32(2),
15738 Self::NotShared => serializer.serialize_i32(3),
15739 Self::UnknownValue(u) => u.0.serialize(serializer),
15740 }
15741 }
15742 }
15743
15744 impl<'de> serde::de::Deserialize<'de> for Peering {
15745 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15746 where
15747 D: serde::Deserializer<'de>,
15748 {
15749 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Peering>::new(
15750 ".google.cloud.networkconnectivity.v1.InternalRange.Peering",
15751 ))
15752 }
15753 }
15754
15755 /// Overlap specifications.
15756 ///
15757 /// # Working with unknown values
15758 ///
15759 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15760 /// additional enum variants at any time. Adding new variants is not considered
15761 /// a breaking change. Applications should write their code in anticipation of:
15762 ///
15763 /// - New values appearing in future releases of the client library, **and**
15764 /// - New values received dynamically, without application changes.
15765 ///
15766 /// Please consult the [Working with enums] section in the user guide for some
15767 /// guidelines.
15768 ///
15769 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15770 #[derive(Clone, Debug, PartialEq)]
15771 #[non_exhaustive]
15772 pub enum Overlap {
15773 /// No overlap overrides.
15774 Unspecified,
15775 /// Allow creation of static routes more specific that the current
15776 /// internal range.
15777 RouteRange,
15778 /// Allow creation of internal ranges that overlap with existing subnets.
15779 ExistingSubnetRange,
15780 /// If set, the enum was initialized with an unknown value.
15781 ///
15782 /// Applications can examine the value using [Overlap::value] or
15783 /// [Overlap::name].
15784 UnknownValue(overlap::UnknownValue),
15785 }
15786
15787 #[doc(hidden)]
15788 pub mod overlap {
15789 #[allow(unused_imports)]
15790 use super::*;
15791 #[derive(Clone, Debug, PartialEq)]
15792 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15793 }
15794
15795 impl Overlap {
15796 /// Gets the enum value.
15797 ///
15798 /// Returns `None` if the enum contains an unknown value deserialized from
15799 /// the string representation of enums.
15800 pub fn value(&self) -> std::option::Option<i32> {
15801 match self {
15802 Self::Unspecified => std::option::Option::Some(0),
15803 Self::RouteRange => std::option::Option::Some(1),
15804 Self::ExistingSubnetRange => std::option::Option::Some(2),
15805 Self::UnknownValue(u) => u.0.value(),
15806 }
15807 }
15808
15809 /// Gets the enum value as a string.
15810 ///
15811 /// Returns `None` if the enum contains an unknown value deserialized from
15812 /// the integer representation of enums.
15813 pub fn name(&self) -> std::option::Option<&str> {
15814 match self {
15815 Self::Unspecified => std::option::Option::Some("OVERLAP_UNSPECIFIED"),
15816 Self::RouteRange => std::option::Option::Some("OVERLAP_ROUTE_RANGE"),
15817 Self::ExistingSubnetRange => {
15818 std::option::Option::Some("OVERLAP_EXISTING_SUBNET_RANGE")
15819 }
15820 Self::UnknownValue(u) => u.0.name(),
15821 }
15822 }
15823 }
15824
15825 impl std::default::Default for Overlap {
15826 fn default() -> Self {
15827 use std::convert::From;
15828 Self::from(0)
15829 }
15830 }
15831
15832 impl std::fmt::Display for Overlap {
15833 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15834 wkt::internal::display_enum(f, self.name(), self.value())
15835 }
15836 }
15837
15838 impl std::convert::From<i32> for Overlap {
15839 fn from(value: i32) -> Self {
15840 match value {
15841 0 => Self::Unspecified,
15842 1 => Self::RouteRange,
15843 2 => Self::ExistingSubnetRange,
15844 _ => Self::UnknownValue(overlap::UnknownValue(
15845 wkt::internal::UnknownEnumValue::Integer(value),
15846 )),
15847 }
15848 }
15849 }
15850
15851 impl std::convert::From<&str> for Overlap {
15852 fn from(value: &str) -> Self {
15853 use std::string::ToString;
15854 match value {
15855 "OVERLAP_UNSPECIFIED" => Self::Unspecified,
15856 "OVERLAP_ROUTE_RANGE" => Self::RouteRange,
15857 "OVERLAP_EXISTING_SUBNET_RANGE" => Self::ExistingSubnetRange,
15858 _ => Self::UnknownValue(overlap::UnknownValue(
15859 wkt::internal::UnknownEnumValue::String(value.to_string()),
15860 )),
15861 }
15862 }
15863 }
15864
15865 impl serde::ser::Serialize for Overlap {
15866 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15867 where
15868 S: serde::Serializer,
15869 {
15870 match self {
15871 Self::Unspecified => serializer.serialize_i32(0),
15872 Self::RouteRange => serializer.serialize_i32(1),
15873 Self::ExistingSubnetRange => serializer.serialize_i32(2),
15874 Self::UnknownValue(u) => u.0.serialize(serializer),
15875 }
15876 }
15877 }
15878
15879 impl<'de> serde::de::Deserialize<'de> for Overlap {
15880 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15881 where
15882 D: serde::Deserializer<'de>,
15883 {
15884 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Overlap>::new(
15885 ".google.cloud.networkconnectivity.v1.InternalRange.Overlap",
15886 ))
15887 }
15888 }
15889
15890 /// Enumeration of range auto-allocation strategies
15891 ///
15892 /// # Working with unknown values
15893 ///
15894 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15895 /// additional enum variants at any time. Adding new variants is not considered
15896 /// a breaking change. Applications should write their code in anticipation of:
15897 ///
15898 /// - New values appearing in future releases of the client library, **and**
15899 /// - New values received dynamically, without application changes.
15900 ///
15901 /// Please consult the [Working with enums] section in the user guide for some
15902 /// guidelines.
15903 ///
15904 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15905 #[derive(Clone, Debug, PartialEq)]
15906 #[non_exhaustive]
15907 pub enum AllocationStrategy {
15908 /// Unspecified is the only valid option when the range is specified
15909 /// explicitly by ip_cidr_range field. Otherwise unspefified means using the
15910 /// default strategy.
15911 Unspecified,
15912 /// Random strategy, the legacy algorithm, used for backwards compatibility.
15913 /// This allocation strategy remains efficient in the case of concurrent
15914 /// allocation requests in the same peered network space and doesn't require
15915 /// providing the level of concurrency in an explicit parameter, but it is
15916 /// prone to fragmenting available address space.
15917 Random,
15918 /// Pick the first available address range. This strategy is deterministic
15919 /// and the result is easy to predict.
15920 FirstAvailable,
15921 /// Pick an arbitrary range out of the first N available ones. The N will be
15922 /// set in the first_available_ranges_lookup_size field. This strategy should
15923 /// be used when concurrent allocation requests are made in the same space of
15924 /// peered networks while the fragmentation of the addrress space is reduced.
15925 RandomFirstNAvailable,
15926 /// Pick the smallest but fitting available range. This deterministic
15927 /// strategy minimizes fragmentation of the address space.
15928 FirstSmallestFitting,
15929 /// If set, the enum was initialized with an unknown value.
15930 ///
15931 /// Applications can examine the value using [AllocationStrategy::value] or
15932 /// [AllocationStrategy::name].
15933 UnknownValue(allocation_strategy::UnknownValue),
15934 }
15935
15936 #[doc(hidden)]
15937 pub mod allocation_strategy {
15938 #[allow(unused_imports)]
15939 use super::*;
15940 #[derive(Clone, Debug, PartialEq)]
15941 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15942 }
15943
15944 impl AllocationStrategy {
15945 /// Gets the enum value.
15946 ///
15947 /// Returns `None` if the enum contains an unknown value deserialized from
15948 /// the string representation of enums.
15949 pub fn value(&self) -> std::option::Option<i32> {
15950 match self {
15951 Self::Unspecified => std::option::Option::Some(0),
15952 Self::Random => std::option::Option::Some(1),
15953 Self::FirstAvailable => std::option::Option::Some(2),
15954 Self::RandomFirstNAvailable => std::option::Option::Some(3),
15955 Self::FirstSmallestFitting => std::option::Option::Some(4),
15956 Self::UnknownValue(u) => u.0.value(),
15957 }
15958 }
15959
15960 /// Gets the enum value as a string.
15961 ///
15962 /// Returns `None` if the enum contains an unknown value deserialized from
15963 /// the integer representation of enums.
15964 pub fn name(&self) -> std::option::Option<&str> {
15965 match self {
15966 Self::Unspecified => std::option::Option::Some("ALLOCATION_STRATEGY_UNSPECIFIED"),
15967 Self::Random => std::option::Option::Some("RANDOM"),
15968 Self::FirstAvailable => std::option::Option::Some("FIRST_AVAILABLE"),
15969 Self::RandomFirstNAvailable => {
15970 std::option::Option::Some("RANDOM_FIRST_N_AVAILABLE")
15971 }
15972 Self::FirstSmallestFitting => std::option::Option::Some("FIRST_SMALLEST_FITTING"),
15973 Self::UnknownValue(u) => u.0.name(),
15974 }
15975 }
15976 }
15977
15978 impl std::default::Default for AllocationStrategy {
15979 fn default() -> Self {
15980 use std::convert::From;
15981 Self::from(0)
15982 }
15983 }
15984
15985 impl std::fmt::Display for AllocationStrategy {
15986 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15987 wkt::internal::display_enum(f, self.name(), self.value())
15988 }
15989 }
15990
15991 impl std::convert::From<i32> for AllocationStrategy {
15992 fn from(value: i32) -> Self {
15993 match value {
15994 0 => Self::Unspecified,
15995 1 => Self::Random,
15996 2 => Self::FirstAvailable,
15997 3 => Self::RandomFirstNAvailable,
15998 4 => Self::FirstSmallestFitting,
15999 _ => Self::UnknownValue(allocation_strategy::UnknownValue(
16000 wkt::internal::UnknownEnumValue::Integer(value),
16001 )),
16002 }
16003 }
16004 }
16005
16006 impl std::convert::From<&str> for AllocationStrategy {
16007 fn from(value: &str) -> Self {
16008 use std::string::ToString;
16009 match value {
16010 "ALLOCATION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
16011 "RANDOM" => Self::Random,
16012 "FIRST_AVAILABLE" => Self::FirstAvailable,
16013 "RANDOM_FIRST_N_AVAILABLE" => Self::RandomFirstNAvailable,
16014 "FIRST_SMALLEST_FITTING" => Self::FirstSmallestFitting,
16015 _ => Self::UnknownValue(allocation_strategy::UnknownValue(
16016 wkt::internal::UnknownEnumValue::String(value.to_string()),
16017 )),
16018 }
16019 }
16020 }
16021
16022 impl serde::ser::Serialize for AllocationStrategy {
16023 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16024 where
16025 S: serde::Serializer,
16026 {
16027 match self {
16028 Self::Unspecified => serializer.serialize_i32(0),
16029 Self::Random => serializer.serialize_i32(1),
16030 Self::FirstAvailable => serializer.serialize_i32(2),
16031 Self::RandomFirstNAvailable => serializer.serialize_i32(3),
16032 Self::FirstSmallestFitting => serializer.serialize_i32(4),
16033 Self::UnknownValue(u) => u.0.serialize(serializer),
16034 }
16035 }
16036 }
16037
16038 impl<'de> serde::de::Deserialize<'de> for AllocationStrategy {
16039 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16040 where
16041 D: serde::Deserializer<'de>,
16042 {
16043 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AllocationStrategy>::new(
16044 ".google.cloud.networkconnectivity.v1.InternalRange.AllocationStrategy",
16045 ))
16046 }
16047 }
16048}
16049
16050/// Request for InternalRangeService.ListInternalRanges
16051#[derive(Clone, Default, PartialEq)]
16052#[non_exhaustive]
16053pub struct ListInternalRangesRequest {
16054 /// Required. The parent resource's name.
16055 pub parent: std::string::String,
16056
16057 /// The maximum number of results per page that should be returned.
16058 pub page_size: i32,
16059
16060 /// The page token.
16061 pub page_token: std::string::String,
16062
16063 /// A filter expression that filters the results listed in the response.
16064 pub filter: std::string::String,
16065
16066 /// Sort the results by a certain order.
16067 pub order_by: std::string::String,
16068
16069 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16070}
16071
16072impl ListInternalRangesRequest {
16073 /// Creates a new default instance.
16074 pub fn new() -> Self {
16075 std::default::Default::default()
16076 }
16077
16078 /// Sets the value of [parent][crate::model::ListInternalRangesRequest::parent].
16079 ///
16080 /// # Example
16081 /// ```ignore,no_run
16082 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
16083 /// let x = ListInternalRangesRequest::new().set_parent("example");
16084 /// ```
16085 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16086 self.parent = v.into();
16087 self
16088 }
16089
16090 /// Sets the value of [page_size][crate::model::ListInternalRangesRequest::page_size].
16091 ///
16092 /// # Example
16093 /// ```ignore,no_run
16094 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
16095 /// let x = ListInternalRangesRequest::new().set_page_size(42);
16096 /// ```
16097 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16098 self.page_size = v.into();
16099 self
16100 }
16101
16102 /// Sets the value of [page_token][crate::model::ListInternalRangesRequest::page_token].
16103 ///
16104 /// # Example
16105 /// ```ignore,no_run
16106 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
16107 /// let x = ListInternalRangesRequest::new().set_page_token("example");
16108 /// ```
16109 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16110 self.page_token = v.into();
16111 self
16112 }
16113
16114 /// Sets the value of [filter][crate::model::ListInternalRangesRequest::filter].
16115 ///
16116 /// # Example
16117 /// ```ignore,no_run
16118 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
16119 /// let x = ListInternalRangesRequest::new().set_filter("example");
16120 /// ```
16121 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16122 self.filter = v.into();
16123 self
16124 }
16125
16126 /// Sets the value of [order_by][crate::model::ListInternalRangesRequest::order_by].
16127 ///
16128 /// # Example
16129 /// ```ignore,no_run
16130 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
16131 /// let x = ListInternalRangesRequest::new().set_order_by("example");
16132 /// ```
16133 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16134 self.order_by = v.into();
16135 self
16136 }
16137}
16138
16139impl wkt::message::Message for ListInternalRangesRequest {
16140 fn typename() -> &'static str {
16141 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListInternalRangesRequest"
16142 }
16143}
16144
16145/// Response for InternalRange.ListInternalRanges
16146#[derive(Clone, Default, PartialEq)]
16147#[non_exhaustive]
16148pub struct ListInternalRangesResponse {
16149 /// Internal ranges to be returned.
16150 pub internal_ranges: std::vec::Vec<crate::model::InternalRange>,
16151
16152 /// The next pagination token in the List response. It should be used as
16153 /// page_token for the following request. An empty value means no more result.
16154 pub next_page_token: std::string::String,
16155
16156 /// Locations that could not be reached.
16157 pub unreachable: std::vec::Vec<std::string::String>,
16158
16159 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16160}
16161
16162impl ListInternalRangesResponse {
16163 /// Creates a new default instance.
16164 pub fn new() -> Self {
16165 std::default::Default::default()
16166 }
16167
16168 /// Sets the value of [internal_ranges][crate::model::ListInternalRangesResponse::internal_ranges].
16169 ///
16170 /// # Example
16171 /// ```ignore,no_run
16172 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesResponse;
16173 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16174 /// let x = ListInternalRangesResponse::new()
16175 /// .set_internal_ranges([
16176 /// InternalRange::default()/* use setters */,
16177 /// InternalRange::default()/* use (different) setters */,
16178 /// ]);
16179 /// ```
16180 pub fn set_internal_ranges<T, V>(mut self, v: T) -> Self
16181 where
16182 T: std::iter::IntoIterator<Item = V>,
16183 V: std::convert::Into<crate::model::InternalRange>,
16184 {
16185 use std::iter::Iterator;
16186 self.internal_ranges = v.into_iter().map(|i| i.into()).collect();
16187 self
16188 }
16189
16190 /// Sets the value of [next_page_token][crate::model::ListInternalRangesResponse::next_page_token].
16191 ///
16192 /// # Example
16193 /// ```ignore,no_run
16194 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesResponse;
16195 /// let x = ListInternalRangesResponse::new().set_next_page_token("example");
16196 /// ```
16197 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16198 self.next_page_token = v.into();
16199 self
16200 }
16201
16202 /// Sets the value of [unreachable][crate::model::ListInternalRangesResponse::unreachable].
16203 ///
16204 /// # Example
16205 /// ```ignore,no_run
16206 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesResponse;
16207 /// let x = ListInternalRangesResponse::new().set_unreachable(["a", "b", "c"]);
16208 /// ```
16209 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
16210 where
16211 T: std::iter::IntoIterator<Item = V>,
16212 V: std::convert::Into<std::string::String>,
16213 {
16214 use std::iter::Iterator;
16215 self.unreachable = v.into_iter().map(|i| i.into()).collect();
16216 self
16217 }
16218}
16219
16220impl wkt::message::Message for ListInternalRangesResponse {
16221 fn typename() -> &'static str {
16222 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListInternalRangesResponse"
16223 }
16224}
16225
16226#[doc(hidden)]
16227impl google_cloud_gax::paginator::internal::PageableResponse for ListInternalRangesResponse {
16228 type PageItem = crate::model::InternalRange;
16229
16230 fn items(self) -> std::vec::Vec<Self::PageItem> {
16231 self.internal_ranges
16232 }
16233
16234 fn next_page_token(&self) -> std::string::String {
16235 use std::clone::Clone;
16236 self.next_page_token.clone()
16237 }
16238}
16239
16240/// Request for InternalRangeService.GetInternalRange
16241#[derive(Clone, Default, PartialEq)]
16242#[non_exhaustive]
16243pub struct GetInternalRangeRequest {
16244 /// Required. Name of the InternalRange to get.
16245 pub name: std::string::String,
16246
16247 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16248}
16249
16250impl GetInternalRangeRequest {
16251 /// Creates a new default instance.
16252 pub fn new() -> Self {
16253 std::default::Default::default()
16254 }
16255
16256 /// Sets the value of [name][crate::model::GetInternalRangeRequest::name].
16257 ///
16258 /// # Example
16259 /// ```ignore,no_run
16260 /// # use google_cloud_networkconnectivity_v1::model::GetInternalRangeRequest;
16261 /// # let project_id = "project_id";
16262 /// # let location_id = "location_id";
16263 /// # let internal_range_id = "internal_range_id";
16264 /// let x = GetInternalRangeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/internalRanges/{internal_range_id}"));
16265 /// ```
16266 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16267 self.name = v.into();
16268 self
16269 }
16270}
16271
16272impl wkt::message::Message for GetInternalRangeRequest {
16273 fn typename() -> &'static str {
16274 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetInternalRangeRequest"
16275 }
16276}
16277
16278/// Request for InternalRangeService.CreateInternalRange
16279#[derive(Clone, Default, PartialEq)]
16280#[non_exhaustive]
16281pub struct CreateInternalRangeRequest {
16282 /// Required. The parent resource's name of the internal range.
16283 pub parent: std::string::String,
16284
16285 /// Optional. Resource ID
16286 /// (i.e. 'foo' in '[...]/projects/p/locations/l/internalRanges/foo')
16287 /// See <https://google.aip.dev/122#resource-id-segments>
16288 /// Unique per location.
16289 pub internal_range_id: std::string::String,
16290
16291 /// Required. Initial values for a new internal range
16292 pub internal_range: std::option::Option<crate::model::InternalRange>,
16293
16294 /// Optional. An optional request ID to identify requests. Specify a unique
16295 /// request ID so that if you must retry your request, the server will know to
16296 /// ignore the request if it has already been completed. The server will
16297 /// guarantee that for at least 60 minutes since the first request.
16298 ///
16299 /// For example, consider a situation where you make an initial request and
16300 /// the request times out. If you make the request again with the same request
16301 /// ID, the server can check if original operation with the same request ID
16302 /// was received, and if so, will ignore the second request. This prevents
16303 /// clients from accidentally creating duplicate commitments.
16304 ///
16305 /// The request ID must be a valid UUID with the exception that zero UUID is
16306 /// not supported (00000000-0000-0000-0000-000000000000).
16307 pub request_id: std::string::String,
16308
16309 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16310}
16311
16312impl CreateInternalRangeRequest {
16313 /// Creates a new default instance.
16314 pub fn new() -> Self {
16315 std::default::Default::default()
16316 }
16317
16318 /// Sets the value of [parent][crate::model::CreateInternalRangeRequest::parent].
16319 ///
16320 /// # Example
16321 /// ```ignore,no_run
16322 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16323 /// # let project_id = "project_id";
16324 /// # let location_id = "location_id";
16325 /// let x = CreateInternalRangeRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
16326 /// ```
16327 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16328 self.parent = v.into();
16329 self
16330 }
16331
16332 /// Sets the value of [internal_range_id][crate::model::CreateInternalRangeRequest::internal_range_id].
16333 ///
16334 /// # Example
16335 /// ```ignore,no_run
16336 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16337 /// let x = CreateInternalRangeRequest::new().set_internal_range_id("example");
16338 /// ```
16339 pub fn set_internal_range_id<T: std::convert::Into<std::string::String>>(
16340 mut self,
16341 v: T,
16342 ) -> Self {
16343 self.internal_range_id = v.into();
16344 self
16345 }
16346
16347 /// Sets the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
16348 ///
16349 /// # Example
16350 /// ```ignore,no_run
16351 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16352 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16353 /// let x = CreateInternalRangeRequest::new().set_internal_range(InternalRange::default()/* use setters */);
16354 /// ```
16355 pub fn set_internal_range<T>(mut self, v: T) -> Self
16356 where
16357 T: std::convert::Into<crate::model::InternalRange>,
16358 {
16359 self.internal_range = std::option::Option::Some(v.into());
16360 self
16361 }
16362
16363 /// Sets or clears the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
16364 ///
16365 /// # Example
16366 /// ```ignore,no_run
16367 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16368 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16369 /// let x = CreateInternalRangeRequest::new().set_or_clear_internal_range(Some(InternalRange::default()/* use setters */));
16370 /// let x = CreateInternalRangeRequest::new().set_or_clear_internal_range(None::<InternalRange>);
16371 /// ```
16372 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
16373 where
16374 T: std::convert::Into<crate::model::InternalRange>,
16375 {
16376 self.internal_range = v.map(|x| x.into());
16377 self
16378 }
16379
16380 /// Sets the value of [request_id][crate::model::CreateInternalRangeRequest::request_id].
16381 ///
16382 /// # Example
16383 /// ```ignore,no_run
16384 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16385 /// let x = CreateInternalRangeRequest::new().set_request_id("example");
16386 /// ```
16387 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16388 self.request_id = v.into();
16389 self
16390 }
16391}
16392
16393impl wkt::message::Message for CreateInternalRangeRequest {
16394 fn typename() -> &'static str {
16395 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateInternalRangeRequest"
16396 }
16397}
16398
16399/// Request for InternalRangeService.UpdateInternalRange
16400#[derive(Clone, Default, PartialEq)]
16401#[non_exhaustive]
16402pub struct UpdateInternalRangeRequest {
16403 /// Optional. Field mask is used to specify the fields to be overwritten in the
16404 /// InternalRange resource by the update.
16405 /// The fields specified in the update_mask are relative to the resource, not
16406 /// the full request. A field will be overwritten if it is in the mask. If the
16407 /// user does not provide a mask then all fields will be overwritten.
16408 pub update_mask: std::option::Option<wkt::FieldMask>,
16409
16410 /// Required. New values to be patched into the resource.
16411 pub internal_range: std::option::Option<crate::model::InternalRange>,
16412
16413 /// Optional. An optional request ID to identify requests. Specify a unique
16414 /// request ID so that if you must retry your request, the server will know to
16415 /// ignore the request if it has already been completed. The server will
16416 /// guarantee that for at least 60 minutes since the first request.
16417 ///
16418 /// For example, consider a situation where you make an initial request and
16419 /// the request times out. If you make the request again with the same request
16420 /// ID, the server can check if original operation with the same request ID
16421 /// was received, and if so, will ignore the second request. This prevents
16422 /// clients from accidentally creating duplicate commitments.
16423 ///
16424 /// The request ID must be a valid UUID with the exception that zero UUID is
16425 /// not supported (00000000-0000-0000-0000-000000000000).
16426 pub request_id: std::string::String,
16427
16428 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16429}
16430
16431impl UpdateInternalRangeRequest {
16432 /// Creates a new default instance.
16433 pub fn new() -> Self {
16434 std::default::Default::default()
16435 }
16436
16437 /// Sets the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
16438 ///
16439 /// # Example
16440 /// ```ignore,no_run
16441 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16442 /// use wkt::FieldMask;
16443 /// let x = UpdateInternalRangeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
16444 /// ```
16445 pub fn set_update_mask<T>(mut self, v: T) -> Self
16446 where
16447 T: std::convert::Into<wkt::FieldMask>,
16448 {
16449 self.update_mask = std::option::Option::Some(v.into());
16450 self
16451 }
16452
16453 /// Sets or clears the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
16454 ///
16455 /// # Example
16456 /// ```ignore,no_run
16457 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16458 /// use wkt::FieldMask;
16459 /// let x = UpdateInternalRangeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
16460 /// let x = UpdateInternalRangeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
16461 /// ```
16462 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16463 where
16464 T: std::convert::Into<wkt::FieldMask>,
16465 {
16466 self.update_mask = v.map(|x| x.into());
16467 self
16468 }
16469
16470 /// Sets the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
16471 ///
16472 /// # Example
16473 /// ```ignore,no_run
16474 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16475 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16476 /// let x = UpdateInternalRangeRequest::new().set_internal_range(InternalRange::default()/* use setters */);
16477 /// ```
16478 pub fn set_internal_range<T>(mut self, v: T) -> Self
16479 where
16480 T: std::convert::Into<crate::model::InternalRange>,
16481 {
16482 self.internal_range = std::option::Option::Some(v.into());
16483 self
16484 }
16485
16486 /// Sets or clears the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
16487 ///
16488 /// # Example
16489 /// ```ignore,no_run
16490 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16491 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16492 /// let x = UpdateInternalRangeRequest::new().set_or_clear_internal_range(Some(InternalRange::default()/* use setters */));
16493 /// let x = UpdateInternalRangeRequest::new().set_or_clear_internal_range(None::<InternalRange>);
16494 /// ```
16495 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
16496 where
16497 T: std::convert::Into<crate::model::InternalRange>,
16498 {
16499 self.internal_range = v.map(|x| x.into());
16500 self
16501 }
16502
16503 /// Sets the value of [request_id][crate::model::UpdateInternalRangeRequest::request_id].
16504 ///
16505 /// # Example
16506 /// ```ignore,no_run
16507 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16508 /// let x = UpdateInternalRangeRequest::new().set_request_id("example");
16509 /// ```
16510 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16511 self.request_id = v.into();
16512 self
16513 }
16514}
16515
16516impl wkt::message::Message for UpdateInternalRangeRequest {
16517 fn typename() -> &'static str {
16518 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateInternalRangeRequest"
16519 }
16520}
16521
16522/// Request for InternalRangeService.DeleteInternalRange
16523#[derive(Clone, Default, PartialEq)]
16524#[non_exhaustive]
16525pub struct DeleteInternalRangeRequest {
16526 /// Required. The name of the internal range to delete.
16527 pub name: std::string::String,
16528
16529 /// Optional. An optional request ID to identify requests. Specify a unique
16530 /// request ID so that if you must retry your request, the server will know to
16531 /// ignore the request if it has already been completed. The server will
16532 /// guarantee that for at least 60 minutes after the first request.
16533 ///
16534 /// For example, consider a situation where you make an initial request and
16535 /// the request times out. If you make the request again with the same request
16536 /// ID, the server can check if original operation with the same request ID
16537 /// was received, and if so, will ignore the second request. This prevents
16538 /// clients from accidentally creating duplicate commitments.
16539 ///
16540 /// The request ID must be a valid UUID with the exception that zero UUID is
16541 /// not supported (00000000-0000-0000-0000-000000000000).
16542 pub request_id: std::string::String,
16543
16544 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16545}
16546
16547impl DeleteInternalRangeRequest {
16548 /// Creates a new default instance.
16549 pub fn new() -> Self {
16550 std::default::Default::default()
16551 }
16552
16553 /// Sets the value of [name][crate::model::DeleteInternalRangeRequest::name].
16554 ///
16555 /// # Example
16556 /// ```ignore,no_run
16557 /// # use google_cloud_networkconnectivity_v1::model::DeleteInternalRangeRequest;
16558 /// # let project_id = "project_id";
16559 /// # let location_id = "location_id";
16560 /// # let internal_range_id = "internal_range_id";
16561 /// let x = DeleteInternalRangeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/internalRanges/{internal_range_id}"));
16562 /// ```
16563 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16564 self.name = v.into();
16565 self
16566 }
16567
16568 /// Sets the value of [request_id][crate::model::DeleteInternalRangeRequest::request_id].
16569 ///
16570 /// # Example
16571 /// ```ignore,no_run
16572 /// # use google_cloud_networkconnectivity_v1::model::DeleteInternalRangeRequest;
16573 /// let x = DeleteInternalRangeRequest::new().set_request_id("example");
16574 /// ```
16575 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16576 self.request_id = v.into();
16577 self
16578 }
16579}
16580
16581impl wkt::message::Message for DeleteInternalRangeRequest {
16582 fn typename() -> &'static str {
16583 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteInternalRangeRequest"
16584 }
16585}
16586
16587/// Policy-based routes route L4 network traffic based on not just destination IP
16588/// address, but also source IP address, protocol, and more. If a policy-based
16589/// route conflicts with other types of routes, the policy-based route always
16590/// takes precedence.
16591#[derive(Clone, Default, PartialEq)]
16592#[non_exhaustive]
16593pub struct PolicyBasedRoute {
16594 /// Immutable. A unique name of the resource in the form of
16595 /// `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`
16596 pub name: std::string::String,
16597
16598 /// Output only. Time when the policy-based route was created.
16599 pub create_time: std::option::Option<wkt::Timestamp>,
16600
16601 /// Output only. Time when the policy-based route was updated.
16602 pub update_time: std::option::Option<wkt::Timestamp>,
16603
16604 /// User-defined labels.
16605 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
16606
16607 /// Optional. An optional description of this resource. Provide this field when
16608 /// you create the resource.
16609 pub description: std::string::String,
16610
16611 /// Required. Fully-qualified URL of the network that this route applies to,
16612 /// for example: projects/my-project/global/networks/my-network.
16613 pub network: std::string::String,
16614
16615 /// Required. The filter to match L4 traffic.
16616 pub filter: std::option::Option<crate::model::policy_based_route::Filter>,
16617
16618 /// Optional. The priority of this policy-based route. Priority is used to
16619 /// break ties in cases where there are more than one matching policy-based
16620 /// routes found. In cases where multiple policy-based routes are matched, the
16621 /// one with the lowest-numbered priority value wins. The default value is
16622 /// 1000. The priority value must be from 1 to 65535, inclusive.
16623 pub priority: i32,
16624
16625 /// Output only. If potential misconfigurations are detected for this route,
16626 /// this field will be populated with warning messages.
16627 pub warnings: std::vec::Vec<crate::model::policy_based_route::Warnings>,
16628
16629 /// Output only. Server-defined fully-qualified URL for this resource.
16630 pub self_link: std::string::String,
16631
16632 /// Output only. Type of this resource. Always
16633 /// networkconnectivity#policyBasedRoute for policy-based Route resources.
16634 pub kind: std::string::String,
16635
16636 /// Target specifies network endpoints that this policy-based route applies to.
16637 /// If no target is specified, the PBR will be installed on all network
16638 /// endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC.
16639 pub target: std::option::Option<crate::model::policy_based_route::Target>,
16640
16641 #[allow(missing_docs)]
16642 pub next_hop: std::option::Option<crate::model::policy_based_route::NextHop>,
16643
16644 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16645}
16646
16647impl PolicyBasedRoute {
16648 /// Creates a new default instance.
16649 pub fn new() -> Self {
16650 std::default::Default::default()
16651 }
16652
16653 /// Sets the value of [name][crate::model::PolicyBasedRoute::name].
16654 ///
16655 /// # Example
16656 /// ```ignore,no_run
16657 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16658 /// # let project_id = "project_id";
16659 /// # let policy_based_route_id = "policy_based_route_id";
16660 /// let x = PolicyBasedRoute::new().set_name(format!("projects/{project_id}/locations/global/PolicyBasedRoutes/{policy_based_route_id}"));
16661 /// ```
16662 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16663 self.name = v.into();
16664 self
16665 }
16666
16667 /// Sets the value of [create_time][crate::model::PolicyBasedRoute::create_time].
16668 ///
16669 /// # Example
16670 /// ```ignore,no_run
16671 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16672 /// use wkt::Timestamp;
16673 /// let x = PolicyBasedRoute::new().set_create_time(Timestamp::default()/* use setters */);
16674 /// ```
16675 pub fn set_create_time<T>(mut self, v: T) -> Self
16676 where
16677 T: std::convert::Into<wkt::Timestamp>,
16678 {
16679 self.create_time = std::option::Option::Some(v.into());
16680 self
16681 }
16682
16683 /// Sets or clears the value of [create_time][crate::model::PolicyBasedRoute::create_time].
16684 ///
16685 /// # Example
16686 /// ```ignore,no_run
16687 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16688 /// use wkt::Timestamp;
16689 /// let x = PolicyBasedRoute::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16690 /// let x = PolicyBasedRoute::new().set_or_clear_create_time(None::<Timestamp>);
16691 /// ```
16692 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16693 where
16694 T: std::convert::Into<wkt::Timestamp>,
16695 {
16696 self.create_time = v.map(|x| x.into());
16697 self
16698 }
16699
16700 /// Sets the value of [update_time][crate::model::PolicyBasedRoute::update_time].
16701 ///
16702 /// # Example
16703 /// ```ignore,no_run
16704 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16705 /// use wkt::Timestamp;
16706 /// let x = PolicyBasedRoute::new().set_update_time(Timestamp::default()/* use setters */);
16707 /// ```
16708 pub fn set_update_time<T>(mut self, v: T) -> Self
16709 where
16710 T: std::convert::Into<wkt::Timestamp>,
16711 {
16712 self.update_time = std::option::Option::Some(v.into());
16713 self
16714 }
16715
16716 /// Sets or clears the value of [update_time][crate::model::PolicyBasedRoute::update_time].
16717 ///
16718 /// # Example
16719 /// ```ignore,no_run
16720 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16721 /// use wkt::Timestamp;
16722 /// let x = PolicyBasedRoute::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16723 /// let x = PolicyBasedRoute::new().set_or_clear_update_time(None::<Timestamp>);
16724 /// ```
16725 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16726 where
16727 T: std::convert::Into<wkt::Timestamp>,
16728 {
16729 self.update_time = v.map(|x| x.into());
16730 self
16731 }
16732
16733 /// Sets the value of [labels][crate::model::PolicyBasedRoute::labels].
16734 ///
16735 /// # Example
16736 /// ```ignore,no_run
16737 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16738 /// let x = PolicyBasedRoute::new().set_labels([
16739 /// ("key0", "abc"),
16740 /// ("key1", "xyz"),
16741 /// ]);
16742 /// ```
16743 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
16744 where
16745 T: std::iter::IntoIterator<Item = (K, V)>,
16746 K: std::convert::Into<std::string::String>,
16747 V: std::convert::Into<std::string::String>,
16748 {
16749 use std::iter::Iterator;
16750 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16751 self
16752 }
16753
16754 /// Sets the value of [description][crate::model::PolicyBasedRoute::description].
16755 ///
16756 /// # Example
16757 /// ```ignore,no_run
16758 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16759 /// let x = PolicyBasedRoute::new().set_description("example");
16760 /// ```
16761 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16762 self.description = v.into();
16763 self
16764 }
16765
16766 /// Sets the value of [network][crate::model::PolicyBasedRoute::network].
16767 ///
16768 /// # Example
16769 /// ```ignore,no_run
16770 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16771 /// let x = PolicyBasedRoute::new().set_network("example");
16772 /// ```
16773 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16774 self.network = v.into();
16775 self
16776 }
16777
16778 /// Sets the value of [filter][crate::model::PolicyBasedRoute::filter].
16779 ///
16780 /// # Example
16781 /// ```ignore,no_run
16782 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16783 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16784 /// let x = PolicyBasedRoute::new().set_filter(Filter::default()/* use setters */);
16785 /// ```
16786 pub fn set_filter<T>(mut self, v: T) -> Self
16787 where
16788 T: std::convert::Into<crate::model::policy_based_route::Filter>,
16789 {
16790 self.filter = std::option::Option::Some(v.into());
16791 self
16792 }
16793
16794 /// Sets or clears the value of [filter][crate::model::PolicyBasedRoute::filter].
16795 ///
16796 /// # Example
16797 /// ```ignore,no_run
16798 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16799 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16800 /// let x = PolicyBasedRoute::new().set_or_clear_filter(Some(Filter::default()/* use setters */));
16801 /// let x = PolicyBasedRoute::new().set_or_clear_filter(None::<Filter>);
16802 /// ```
16803 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
16804 where
16805 T: std::convert::Into<crate::model::policy_based_route::Filter>,
16806 {
16807 self.filter = v.map(|x| x.into());
16808 self
16809 }
16810
16811 /// Sets the value of [priority][crate::model::PolicyBasedRoute::priority].
16812 ///
16813 /// # Example
16814 /// ```ignore,no_run
16815 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16816 /// let x = PolicyBasedRoute::new().set_priority(42);
16817 /// ```
16818 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16819 self.priority = v.into();
16820 self
16821 }
16822
16823 /// Sets the value of [warnings][crate::model::PolicyBasedRoute::warnings].
16824 ///
16825 /// # Example
16826 /// ```ignore,no_run
16827 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16828 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
16829 /// let x = PolicyBasedRoute::new()
16830 /// .set_warnings([
16831 /// Warnings::default()/* use setters */,
16832 /// Warnings::default()/* use (different) setters */,
16833 /// ]);
16834 /// ```
16835 pub fn set_warnings<T, V>(mut self, v: T) -> Self
16836 where
16837 T: std::iter::IntoIterator<Item = V>,
16838 V: std::convert::Into<crate::model::policy_based_route::Warnings>,
16839 {
16840 use std::iter::Iterator;
16841 self.warnings = v.into_iter().map(|i| i.into()).collect();
16842 self
16843 }
16844
16845 /// Sets the value of [self_link][crate::model::PolicyBasedRoute::self_link].
16846 ///
16847 /// # Example
16848 /// ```ignore,no_run
16849 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16850 /// let x = PolicyBasedRoute::new().set_self_link("example");
16851 /// ```
16852 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16853 self.self_link = v.into();
16854 self
16855 }
16856
16857 /// Sets the value of [kind][crate::model::PolicyBasedRoute::kind].
16858 ///
16859 /// # Example
16860 /// ```ignore,no_run
16861 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16862 /// let x = PolicyBasedRoute::new().set_kind("example");
16863 /// ```
16864 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16865 self.kind = v.into();
16866 self
16867 }
16868
16869 /// Sets the value of [target][crate::model::PolicyBasedRoute::target].
16870 ///
16871 /// Note that all the setters affecting `target` are mutually
16872 /// exclusive.
16873 ///
16874 /// # Example
16875 /// ```ignore,no_run
16876 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16877 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::VirtualMachine;
16878 /// let x = PolicyBasedRoute::new().set_target(Some(
16879 /// google_cloud_networkconnectivity_v1::model::policy_based_route::Target::VirtualMachine(VirtualMachine::default().into())));
16880 /// ```
16881 pub fn set_target<
16882 T: std::convert::Into<std::option::Option<crate::model::policy_based_route::Target>>,
16883 >(
16884 mut self,
16885 v: T,
16886 ) -> Self {
16887 self.target = v.into();
16888 self
16889 }
16890
16891 /// The value of [target][crate::model::PolicyBasedRoute::target]
16892 /// if it holds a `VirtualMachine`, `None` if the field is not set or
16893 /// holds a different branch.
16894 pub fn virtual_machine(
16895 &self,
16896 ) -> std::option::Option<&std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>
16897 {
16898 #[allow(unreachable_patterns)]
16899 self.target.as_ref().and_then(|v| match v {
16900 crate::model::policy_based_route::Target::VirtualMachine(v) => {
16901 std::option::Option::Some(v)
16902 }
16903 _ => std::option::Option::None,
16904 })
16905 }
16906
16907 /// Sets the value of [target][crate::model::PolicyBasedRoute::target]
16908 /// to hold a `VirtualMachine`.
16909 ///
16910 /// Note that all the setters affecting `target` are
16911 /// mutually exclusive.
16912 ///
16913 /// # Example
16914 /// ```ignore,no_run
16915 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16916 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::VirtualMachine;
16917 /// let x = PolicyBasedRoute::new().set_virtual_machine(VirtualMachine::default()/* use setters */);
16918 /// assert!(x.virtual_machine().is_some());
16919 /// assert!(x.interconnect_attachment().is_none());
16920 /// ```
16921 pub fn set_virtual_machine<
16922 T: std::convert::Into<std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>,
16923 >(
16924 mut self,
16925 v: T,
16926 ) -> Self {
16927 self.target = std::option::Option::Some(
16928 crate::model::policy_based_route::Target::VirtualMachine(v.into()),
16929 );
16930 self
16931 }
16932
16933 /// The value of [target][crate::model::PolicyBasedRoute::target]
16934 /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
16935 /// holds a different branch.
16936 pub fn interconnect_attachment(
16937 &self,
16938 ) -> std::option::Option<
16939 &std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
16940 > {
16941 #[allow(unreachable_patterns)]
16942 self.target.as_ref().and_then(|v| match v {
16943 crate::model::policy_based_route::Target::InterconnectAttachment(v) => {
16944 std::option::Option::Some(v)
16945 }
16946 _ => std::option::Option::None,
16947 })
16948 }
16949
16950 /// Sets the value of [target][crate::model::PolicyBasedRoute::target]
16951 /// to hold a `InterconnectAttachment`.
16952 ///
16953 /// Note that all the setters affecting `target` are
16954 /// mutually exclusive.
16955 ///
16956 /// # Example
16957 /// ```ignore,no_run
16958 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16959 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::InterconnectAttachment;
16960 /// let x = PolicyBasedRoute::new().set_interconnect_attachment(InterconnectAttachment::default()/* use setters */);
16961 /// assert!(x.interconnect_attachment().is_some());
16962 /// assert!(x.virtual_machine().is_none());
16963 /// ```
16964 pub fn set_interconnect_attachment<
16965 T: std::convert::Into<
16966 std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
16967 >,
16968 >(
16969 mut self,
16970 v: T,
16971 ) -> Self {
16972 self.target = std::option::Option::Some(
16973 crate::model::policy_based_route::Target::InterconnectAttachment(v.into()),
16974 );
16975 self
16976 }
16977
16978 /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop].
16979 ///
16980 /// Note that all the setters affecting `next_hop` are mutually
16981 /// exclusive.
16982 ///
16983 /// # Example
16984 /// ```ignore,no_run
16985 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16986 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::NextHop;
16987 /// let x = PolicyBasedRoute::new().set_next_hop(Some(NextHop::NextHopIlbIp("example".to_string())));
16988 /// ```
16989 pub fn set_next_hop<
16990 T: std::convert::Into<std::option::Option<crate::model::policy_based_route::NextHop>>,
16991 >(
16992 mut self,
16993 v: T,
16994 ) -> Self {
16995 self.next_hop = v.into();
16996 self
16997 }
16998
16999 /// The value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
17000 /// if it holds a `NextHopIlbIp`, `None` if the field is not set or
17001 /// holds a different branch.
17002 pub fn next_hop_ilb_ip(&self) -> std::option::Option<&std::string::String> {
17003 #[allow(unreachable_patterns)]
17004 self.next_hop.as_ref().and_then(|v| match v {
17005 crate::model::policy_based_route::NextHop::NextHopIlbIp(v) => {
17006 std::option::Option::Some(v)
17007 }
17008 _ => std::option::Option::None,
17009 })
17010 }
17011
17012 /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
17013 /// to hold a `NextHopIlbIp`.
17014 ///
17015 /// Note that all the setters affecting `next_hop` are
17016 /// mutually exclusive.
17017 ///
17018 /// # Example
17019 /// ```ignore,no_run
17020 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
17021 /// let x = PolicyBasedRoute::new().set_next_hop_ilb_ip("example");
17022 /// assert!(x.next_hop_ilb_ip().is_some());
17023 /// assert!(x.next_hop_other_routes().is_none());
17024 /// ```
17025 pub fn set_next_hop_ilb_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17026 self.next_hop = std::option::Option::Some(
17027 crate::model::policy_based_route::NextHop::NextHopIlbIp(v.into()),
17028 );
17029 self
17030 }
17031
17032 /// The value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
17033 /// if it holds a `NextHopOtherRoutes`, `None` if the field is not set or
17034 /// holds a different branch.
17035 pub fn next_hop_other_routes(
17036 &self,
17037 ) -> std::option::Option<&crate::model::policy_based_route::OtherRoutes> {
17038 #[allow(unreachable_patterns)]
17039 self.next_hop.as_ref().and_then(|v| match v {
17040 crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v) => {
17041 std::option::Option::Some(v)
17042 }
17043 _ => std::option::Option::None,
17044 })
17045 }
17046
17047 /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
17048 /// to hold a `NextHopOtherRoutes`.
17049 ///
17050 /// Note that all the setters affecting `next_hop` are
17051 /// mutually exclusive.
17052 ///
17053 /// # Example
17054 /// ```ignore,no_run
17055 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
17056 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::OtherRoutes;
17057 /// let x0 = PolicyBasedRoute::new().set_next_hop_other_routes(OtherRoutes::DefaultRouting);
17058 /// assert!(x0.next_hop_other_routes().is_some());
17059 /// assert!(x0.next_hop_ilb_ip().is_none());
17060 /// ```
17061 pub fn set_next_hop_other_routes<
17062 T: std::convert::Into<crate::model::policy_based_route::OtherRoutes>,
17063 >(
17064 mut self,
17065 v: T,
17066 ) -> Self {
17067 self.next_hop = std::option::Option::Some(
17068 crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v.into()),
17069 );
17070 self
17071 }
17072}
17073
17074impl wkt::message::Message for PolicyBasedRoute {
17075 fn typename() -> &'static str {
17076 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute"
17077 }
17078}
17079
17080/// Defines additional types related to [PolicyBasedRoute].
17081pub mod policy_based_route {
17082 #[allow(unused_imports)]
17083 use super::*;
17084
17085 /// VM instances that this policy-based route applies to.
17086 #[derive(Clone, Default, PartialEq)]
17087 #[non_exhaustive]
17088 pub struct VirtualMachine {
17089 /// Optional. A list of VM instance tags that this policy-based route applies
17090 /// to. VM instances that have ANY of tags specified here installs this PBR.
17091 pub tags: std::vec::Vec<std::string::String>,
17092
17093 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17094 }
17095
17096 impl VirtualMachine {
17097 /// Creates a new default instance.
17098 pub fn new() -> Self {
17099 std::default::Default::default()
17100 }
17101
17102 /// Sets the value of [tags][crate::model::policy_based_route::VirtualMachine::tags].
17103 ///
17104 /// # Example
17105 /// ```ignore,no_run
17106 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::VirtualMachine;
17107 /// let x = VirtualMachine::new().set_tags(["a", "b", "c"]);
17108 /// ```
17109 pub fn set_tags<T, V>(mut self, v: T) -> Self
17110 where
17111 T: std::iter::IntoIterator<Item = V>,
17112 V: std::convert::Into<std::string::String>,
17113 {
17114 use std::iter::Iterator;
17115 self.tags = v.into_iter().map(|i| i.into()).collect();
17116 self
17117 }
17118 }
17119
17120 impl wkt::message::Message for VirtualMachine {
17121 fn typename() -> &'static str {
17122 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine"
17123 }
17124 }
17125
17126 /// InterconnectAttachment that this route applies to.
17127 #[derive(Clone, Default, PartialEq)]
17128 #[non_exhaustive]
17129 pub struct InterconnectAttachment {
17130 /// Optional. Cloud region to install this policy-based route on interconnect
17131 /// attachment. Use `all` to install it on all interconnect attachments.
17132 pub region: std::string::String,
17133
17134 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17135 }
17136
17137 impl InterconnectAttachment {
17138 /// Creates a new default instance.
17139 pub fn new() -> Self {
17140 std::default::Default::default()
17141 }
17142
17143 /// Sets the value of [region][crate::model::policy_based_route::InterconnectAttachment::region].
17144 ///
17145 /// # Example
17146 /// ```ignore,no_run
17147 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::InterconnectAttachment;
17148 /// let x = InterconnectAttachment::new().set_region("example");
17149 /// ```
17150 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17151 self.region = v.into();
17152 self
17153 }
17154 }
17155
17156 impl wkt::message::Message for InterconnectAttachment {
17157 fn typename() -> &'static str {
17158 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment"
17159 }
17160 }
17161
17162 /// Filter matches L4 traffic.
17163 #[derive(Clone, Default, PartialEq)]
17164 #[non_exhaustive]
17165 pub struct Filter {
17166 /// Optional. The IP protocol that this policy-based route applies to. Valid
17167 /// values are 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
17168 pub ip_protocol: std::string::String,
17169
17170 /// Optional. The source IP range of outgoing packets that this policy-based
17171 /// route applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
17172 pub src_range: std::string::String,
17173
17174 /// Optional. The destination IP range of outgoing packets that this
17175 /// policy-based route applies to. Default is "0.0.0.0/0" if protocol version
17176 /// is IPv4.
17177 pub dest_range: std::string::String,
17178
17179 /// Required. Internet protocol versions this policy-based route applies to.
17180 /// For this version, only IPV4 is supported. IPV6 is supported in preview.
17181 pub protocol_version: crate::model::policy_based_route::filter::ProtocolVersion,
17182
17183 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17184 }
17185
17186 impl Filter {
17187 /// Creates a new default instance.
17188 pub fn new() -> Self {
17189 std::default::Default::default()
17190 }
17191
17192 /// Sets the value of [ip_protocol][crate::model::policy_based_route::Filter::ip_protocol].
17193 ///
17194 /// # Example
17195 /// ```ignore,no_run
17196 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
17197 /// let x = Filter::new().set_ip_protocol("example");
17198 /// ```
17199 pub fn set_ip_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17200 self.ip_protocol = v.into();
17201 self
17202 }
17203
17204 /// Sets the value of [src_range][crate::model::policy_based_route::Filter::src_range].
17205 ///
17206 /// # Example
17207 /// ```ignore,no_run
17208 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
17209 /// let x = Filter::new().set_src_range("example");
17210 /// ```
17211 pub fn set_src_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17212 self.src_range = v.into();
17213 self
17214 }
17215
17216 /// Sets the value of [dest_range][crate::model::policy_based_route::Filter::dest_range].
17217 ///
17218 /// # Example
17219 /// ```ignore,no_run
17220 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
17221 /// let x = Filter::new().set_dest_range("example");
17222 /// ```
17223 pub fn set_dest_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17224 self.dest_range = v.into();
17225 self
17226 }
17227
17228 /// Sets the value of [protocol_version][crate::model::policy_based_route::Filter::protocol_version].
17229 ///
17230 /// # Example
17231 /// ```ignore,no_run
17232 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
17233 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::filter::ProtocolVersion;
17234 /// let x0 = Filter::new().set_protocol_version(ProtocolVersion::Ipv4);
17235 /// ```
17236 pub fn set_protocol_version<
17237 T: std::convert::Into<crate::model::policy_based_route::filter::ProtocolVersion>,
17238 >(
17239 mut self,
17240 v: T,
17241 ) -> Self {
17242 self.protocol_version = v.into();
17243 self
17244 }
17245 }
17246
17247 impl wkt::message::Message for Filter {
17248 fn typename() -> &'static str {
17249 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter"
17250 }
17251 }
17252
17253 /// Defines additional types related to [Filter].
17254 pub mod filter {
17255 #[allow(unused_imports)]
17256 use super::*;
17257
17258 /// The internet protocol version.
17259 ///
17260 /// # Working with unknown values
17261 ///
17262 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17263 /// additional enum variants at any time. Adding new variants is not considered
17264 /// a breaking change. Applications should write their code in anticipation of:
17265 ///
17266 /// - New values appearing in future releases of the client library, **and**
17267 /// - New values received dynamically, without application changes.
17268 ///
17269 /// Please consult the [Working with enums] section in the user guide for some
17270 /// guidelines.
17271 ///
17272 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17273 #[derive(Clone, Debug, PartialEq)]
17274 #[non_exhaustive]
17275 pub enum ProtocolVersion {
17276 /// Default value.
17277 Unspecified,
17278 /// The PBR is for IPv4 internet protocol traffic.
17279 Ipv4,
17280 /// If set, the enum was initialized with an unknown value.
17281 ///
17282 /// Applications can examine the value using [ProtocolVersion::value] or
17283 /// [ProtocolVersion::name].
17284 UnknownValue(protocol_version::UnknownValue),
17285 }
17286
17287 #[doc(hidden)]
17288 pub mod protocol_version {
17289 #[allow(unused_imports)]
17290 use super::*;
17291 #[derive(Clone, Debug, PartialEq)]
17292 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17293 }
17294
17295 impl ProtocolVersion {
17296 /// Gets the enum value.
17297 ///
17298 /// Returns `None` if the enum contains an unknown value deserialized from
17299 /// the string representation of enums.
17300 pub fn value(&self) -> std::option::Option<i32> {
17301 match self {
17302 Self::Unspecified => std::option::Option::Some(0),
17303 Self::Ipv4 => std::option::Option::Some(1),
17304 Self::UnknownValue(u) => u.0.value(),
17305 }
17306 }
17307
17308 /// Gets the enum value as a string.
17309 ///
17310 /// Returns `None` if the enum contains an unknown value deserialized from
17311 /// the integer representation of enums.
17312 pub fn name(&self) -> std::option::Option<&str> {
17313 match self {
17314 Self::Unspecified => std::option::Option::Some("PROTOCOL_VERSION_UNSPECIFIED"),
17315 Self::Ipv4 => std::option::Option::Some("IPV4"),
17316 Self::UnknownValue(u) => u.0.name(),
17317 }
17318 }
17319 }
17320
17321 impl std::default::Default for ProtocolVersion {
17322 fn default() -> Self {
17323 use std::convert::From;
17324 Self::from(0)
17325 }
17326 }
17327
17328 impl std::fmt::Display for ProtocolVersion {
17329 fn fmt(
17330 &self,
17331 f: &mut std::fmt::Formatter<'_>,
17332 ) -> std::result::Result<(), std::fmt::Error> {
17333 wkt::internal::display_enum(f, self.name(), self.value())
17334 }
17335 }
17336
17337 impl std::convert::From<i32> for ProtocolVersion {
17338 fn from(value: i32) -> Self {
17339 match value {
17340 0 => Self::Unspecified,
17341 1 => Self::Ipv4,
17342 _ => Self::UnknownValue(protocol_version::UnknownValue(
17343 wkt::internal::UnknownEnumValue::Integer(value),
17344 )),
17345 }
17346 }
17347 }
17348
17349 impl std::convert::From<&str> for ProtocolVersion {
17350 fn from(value: &str) -> Self {
17351 use std::string::ToString;
17352 match value {
17353 "PROTOCOL_VERSION_UNSPECIFIED" => Self::Unspecified,
17354 "IPV4" => Self::Ipv4,
17355 _ => Self::UnknownValue(protocol_version::UnknownValue(
17356 wkt::internal::UnknownEnumValue::String(value.to_string()),
17357 )),
17358 }
17359 }
17360 }
17361
17362 impl serde::ser::Serialize for ProtocolVersion {
17363 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17364 where
17365 S: serde::Serializer,
17366 {
17367 match self {
17368 Self::Unspecified => serializer.serialize_i32(0),
17369 Self::Ipv4 => serializer.serialize_i32(1),
17370 Self::UnknownValue(u) => u.0.serialize(serializer),
17371 }
17372 }
17373 }
17374
17375 impl<'de> serde::de::Deserialize<'de> for ProtocolVersion {
17376 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17377 where
17378 D: serde::Deserializer<'de>,
17379 {
17380 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProtocolVersion>::new(
17381 ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion",
17382 ))
17383 }
17384 }
17385 }
17386
17387 /// Informational warning message.
17388 #[derive(Clone, Default, PartialEq)]
17389 #[non_exhaustive]
17390 pub struct Warnings {
17391 /// Output only. A warning code, if applicable.
17392 pub code: crate::model::policy_based_route::warnings::Code,
17393
17394 /// Output only. Metadata about this warning in key: value format. The key
17395 /// should provides more detail on the warning being returned. For example,
17396 /// for warnings where there are no results in a list request for a
17397 /// particular zone, this key might be scope and the key value might be the
17398 /// zone name. Other examples might be a key indicating a deprecated resource
17399 /// and a suggested replacement.
17400 pub data: std::collections::HashMap<std::string::String, std::string::String>,
17401
17402 /// Output only. A human-readable description of the warning code.
17403 pub warning_message: std::string::String,
17404
17405 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17406 }
17407
17408 impl Warnings {
17409 /// Creates a new default instance.
17410 pub fn new() -> Self {
17411 std::default::Default::default()
17412 }
17413
17414 /// Sets the value of [code][crate::model::policy_based_route::Warnings::code].
17415 ///
17416 /// # Example
17417 /// ```ignore,no_run
17418 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
17419 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::warnings::Code;
17420 /// let x0 = Warnings::new().set_code(Code::ResourceNotActive);
17421 /// let x1 = Warnings::new().set_code(Code::ResourceBeingModified);
17422 /// ```
17423 pub fn set_code<T: std::convert::Into<crate::model::policy_based_route::warnings::Code>>(
17424 mut self,
17425 v: T,
17426 ) -> Self {
17427 self.code = v.into();
17428 self
17429 }
17430
17431 /// Sets the value of [data][crate::model::policy_based_route::Warnings::data].
17432 ///
17433 /// # Example
17434 /// ```ignore,no_run
17435 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
17436 /// let x = Warnings::new().set_data([
17437 /// ("key0", "abc"),
17438 /// ("key1", "xyz"),
17439 /// ]);
17440 /// ```
17441 pub fn set_data<T, K, V>(mut self, v: T) -> Self
17442 where
17443 T: std::iter::IntoIterator<Item = (K, V)>,
17444 K: std::convert::Into<std::string::String>,
17445 V: std::convert::Into<std::string::String>,
17446 {
17447 use std::iter::Iterator;
17448 self.data = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
17449 self
17450 }
17451
17452 /// Sets the value of [warning_message][crate::model::policy_based_route::Warnings::warning_message].
17453 ///
17454 /// # Example
17455 /// ```ignore,no_run
17456 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
17457 /// let x = Warnings::new().set_warning_message("example");
17458 /// ```
17459 pub fn set_warning_message<T: std::convert::Into<std::string::String>>(
17460 mut self,
17461 v: T,
17462 ) -> Self {
17463 self.warning_message = v.into();
17464 self
17465 }
17466 }
17467
17468 impl wkt::message::Message for Warnings {
17469 fn typename() -> &'static str {
17470 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings"
17471 }
17472 }
17473
17474 /// Defines additional types related to [Warnings].
17475 pub mod warnings {
17476 #[allow(unused_imports)]
17477 use super::*;
17478
17479 /// Warning code for policy-based routing. Expect to add values in the
17480 /// future.
17481 ///
17482 /// # Working with unknown values
17483 ///
17484 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17485 /// additional enum variants at any time. Adding new variants is not considered
17486 /// a breaking change. Applications should write their code in anticipation of:
17487 ///
17488 /// - New values appearing in future releases of the client library, **and**
17489 /// - New values received dynamically, without application changes.
17490 ///
17491 /// Please consult the [Working with enums] section in the user guide for some
17492 /// guidelines.
17493 ///
17494 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17495 #[derive(Clone, Debug, PartialEq)]
17496 #[non_exhaustive]
17497 pub enum Code {
17498 /// Default value.
17499 WarningUnspecified,
17500 /// The policy-based route is not active and functioning. Common causes are
17501 /// that the dependent network was deleted or the resource project was
17502 /// turned off.
17503 ResourceNotActive,
17504 /// The policy-based route is being modified (e.g. created/deleted) at this
17505 /// time.
17506 ResourceBeingModified,
17507 /// If set, the enum was initialized with an unknown value.
17508 ///
17509 /// Applications can examine the value using [Code::value] or
17510 /// [Code::name].
17511 UnknownValue(code::UnknownValue),
17512 }
17513
17514 #[doc(hidden)]
17515 pub mod code {
17516 #[allow(unused_imports)]
17517 use super::*;
17518 #[derive(Clone, Debug, PartialEq)]
17519 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17520 }
17521
17522 impl Code {
17523 /// Gets the enum value.
17524 ///
17525 /// Returns `None` if the enum contains an unknown value deserialized from
17526 /// the string representation of enums.
17527 pub fn value(&self) -> std::option::Option<i32> {
17528 match self {
17529 Self::WarningUnspecified => std::option::Option::Some(0),
17530 Self::ResourceNotActive => std::option::Option::Some(1),
17531 Self::ResourceBeingModified => std::option::Option::Some(2),
17532 Self::UnknownValue(u) => u.0.value(),
17533 }
17534 }
17535
17536 /// Gets the enum value as a string.
17537 ///
17538 /// Returns `None` if the enum contains an unknown value deserialized from
17539 /// the integer representation of enums.
17540 pub fn name(&self) -> std::option::Option<&str> {
17541 match self {
17542 Self::WarningUnspecified => std::option::Option::Some("WARNING_UNSPECIFIED"),
17543 Self::ResourceNotActive => std::option::Option::Some("RESOURCE_NOT_ACTIVE"),
17544 Self::ResourceBeingModified => {
17545 std::option::Option::Some("RESOURCE_BEING_MODIFIED")
17546 }
17547 Self::UnknownValue(u) => u.0.name(),
17548 }
17549 }
17550 }
17551
17552 impl std::default::Default for Code {
17553 fn default() -> Self {
17554 use std::convert::From;
17555 Self::from(0)
17556 }
17557 }
17558
17559 impl std::fmt::Display for Code {
17560 fn fmt(
17561 &self,
17562 f: &mut std::fmt::Formatter<'_>,
17563 ) -> std::result::Result<(), std::fmt::Error> {
17564 wkt::internal::display_enum(f, self.name(), self.value())
17565 }
17566 }
17567
17568 impl std::convert::From<i32> for Code {
17569 fn from(value: i32) -> Self {
17570 match value {
17571 0 => Self::WarningUnspecified,
17572 1 => Self::ResourceNotActive,
17573 2 => Self::ResourceBeingModified,
17574 _ => Self::UnknownValue(code::UnknownValue(
17575 wkt::internal::UnknownEnumValue::Integer(value),
17576 )),
17577 }
17578 }
17579 }
17580
17581 impl std::convert::From<&str> for Code {
17582 fn from(value: &str) -> Self {
17583 use std::string::ToString;
17584 match value {
17585 "WARNING_UNSPECIFIED" => Self::WarningUnspecified,
17586 "RESOURCE_NOT_ACTIVE" => Self::ResourceNotActive,
17587 "RESOURCE_BEING_MODIFIED" => Self::ResourceBeingModified,
17588 _ => Self::UnknownValue(code::UnknownValue(
17589 wkt::internal::UnknownEnumValue::String(value.to_string()),
17590 )),
17591 }
17592 }
17593 }
17594
17595 impl serde::ser::Serialize for Code {
17596 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17597 where
17598 S: serde::Serializer,
17599 {
17600 match self {
17601 Self::WarningUnspecified => serializer.serialize_i32(0),
17602 Self::ResourceNotActive => serializer.serialize_i32(1),
17603 Self::ResourceBeingModified => serializer.serialize_i32(2),
17604 Self::UnknownValue(u) => u.0.serialize(serializer),
17605 }
17606 }
17607 }
17608
17609 impl<'de> serde::de::Deserialize<'de> for Code {
17610 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17611 where
17612 D: serde::Deserializer<'de>,
17613 {
17614 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
17615 ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code",
17616 ))
17617 }
17618 }
17619 }
17620
17621 /// The other routing cases.
17622 ///
17623 /// # Working with unknown values
17624 ///
17625 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17626 /// additional enum variants at any time. Adding new variants is not considered
17627 /// a breaking change. Applications should write their code in anticipation of:
17628 ///
17629 /// - New values appearing in future releases of the client library, **and**
17630 /// - New values received dynamically, without application changes.
17631 ///
17632 /// Please consult the [Working with enums] section in the user guide for some
17633 /// guidelines.
17634 ///
17635 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17636 #[derive(Clone, Debug, PartialEq)]
17637 #[non_exhaustive]
17638 pub enum OtherRoutes {
17639 /// Default value.
17640 Unspecified,
17641 /// Use the routes from the default routing tables (system-generated routes,
17642 /// custom routes, peering route) to determine the next hop. This effectively
17643 /// excludes matching packets being applied on other PBRs with a lower
17644 /// priority.
17645 DefaultRouting,
17646 /// If set, the enum was initialized with an unknown value.
17647 ///
17648 /// Applications can examine the value using [OtherRoutes::value] or
17649 /// [OtherRoutes::name].
17650 UnknownValue(other_routes::UnknownValue),
17651 }
17652
17653 #[doc(hidden)]
17654 pub mod other_routes {
17655 #[allow(unused_imports)]
17656 use super::*;
17657 #[derive(Clone, Debug, PartialEq)]
17658 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17659 }
17660
17661 impl OtherRoutes {
17662 /// Gets the enum value.
17663 ///
17664 /// Returns `None` if the enum contains an unknown value deserialized from
17665 /// the string representation of enums.
17666 pub fn value(&self) -> std::option::Option<i32> {
17667 match self {
17668 Self::Unspecified => std::option::Option::Some(0),
17669 Self::DefaultRouting => std::option::Option::Some(1),
17670 Self::UnknownValue(u) => u.0.value(),
17671 }
17672 }
17673
17674 /// Gets the enum value as a string.
17675 ///
17676 /// Returns `None` if the enum contains an unknown value deserialized from
17677 /// the integer representation of enums.
17678 pub fn name(&self) -> std::option::Option<&str> {
17679 match self {
17680 Self::Unspecified => std::option::Option::Some("OTHER_ROUTES_UNSPECIFIED"),
17681 Self::DefaultRouting => std::option::Option::Some("DEFAULT_ROUTING"),
17682 Self::UnknownValue(u) => u.0.name(),
17683 }
17684 }
17685 }
17686
17687 impl std::default::Default for OtherRoutes {
17688 fn default() -> Self {
17689 use std::convert::From;
17690 Self::from(0)
17691 }
17692 }
17693
17694 impl std::fmt::Display for OtherRoutes {
17695 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17696 wkt::internal::display_enum(f, self.name(), self.value())
17697 }
17698 }
17699
17700 impl std::convert::From<i32> for OtherRoutes {
17701 fn from(value: i32) -> Self {
17702 match value {
17703 0 => Self::Unspecified,
17704 1 => Self::DefaultRouting,
17705 _ => Self::UnknownValue(other_routes::UnknownValue(
17706 wkt::internal::UnknownEnumValue::Integer(value),
17707 )),
17708 }
17709 }
17710 }
17711
17712 impl std::convert::From<&str> for OtherRoutes {
17713 fn from(value: &str) -> Self {
17714 use std::string::ToString;
17715 match value {
17716 "OTHER_ROUTES_UNSPECIFIED" => Self::Unspecified,
17717 "DEFAULT_ROUTING" => Self::DefaultRouting,
17718 _ => Self::UnknownValue(other_routes::UnknownValue(
17719 wkt::internal::UnknownEnumValue::String(value.to_string()),
17720 )),
17721 }
17722 }
17723 }
17724
17725 impl serde::ser::Serialize for OtherRoutes {
17726 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17727 where
17728 S: serde::Serializer,
17729 {
17730 match self {
17731 Self::Unspecified => serializer.serialize_i32(0),
17732 Self::DefaultRouting => serializer.serialize_i32(1),
17733 Self::UnknownValue(u) => u.0.serialize(serializer),
17734 }
17735 }
17736 }
17737
17738 impl<'de> serde::de::Deserialize<'de> for OtherRoutes {
17739 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17740 where
17741 D: serde::Deserializer<'de>,
17742 {
17743 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OtherRoutes>::new(
17744 ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes",
17745 ))
17746 }
17747 }
17748
17749 /// Target specifies network endpoints that this policy-based route applies to.
17750 /// If no target is specified, the PBR will be installed on all network
17751 /// endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC.
17752 #[derive(Clone, Debug, PartialEq)]
17753 #[non_exhaustive]
17754 pub enum Target {
17755 /// Optional. VM instances that this policy-based route applies to.
17756 VirtualMachine(std::boxed::Box<crate::model::policy_based_route::VirtualMachine>),
17757 /// Optional. The interconnect attachments that this policy-based route
17758 /// applies to.
17759 InterconnectAttachment(
17760 std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
17761 ),
17762 }
17763
17764 #[allow(missing_docs)]
17765 #[derive(Clone, Debug, PartialEq)]
17766 #[non_exhaustive]
17767 pub enum NextHop {
17768 /// Optional. The IP address of a global-access-enabled L4 ILB that is the
17769 /// next hop for matching packets. For this version, only nextHopIlbIp is
17770 /// supported.
17771 NextHopIlbIp(std::string::String),
17772 /// Optional. Other routes that will be referenced to determine the next hop
17773 /// of the packet.
17774 NextHopOtherRoutes(crate::model::policy_based_route::OtherRoutes),
17775 }
17776}
17777
17778/// Request for
17779/// [PolicyBasedRoutingService.ListPolicyBasedRoutes][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]
17780/// method.
17781///
17782/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]: crate::client::PolicyBasedRoutingService::list_policy_based_routes
17783#[derive(Clone, Default, PartialEq)]
17784#[non_exhaustive]
17785pub struct ListPolicyBasedRoutesRequest {
17786 /// Required. The parent resource's name.
17787 pub parent: std::string::String,
17788
17789 /// The maximum number of results per page that should be returned.
17790 pub page_size: i32,
17791
17792 /// The page token.
17793 pub page_token: std::string::String,
17794
17795 /// A filter expression that filters the results listed in the response.
17796 pub filter: std::string::String,
17797
17798 /// Sort the results by a certain order.
17799 pub order_by: std::string::String,
17800
17801 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17802}
17803
17804impl ListPolicyBasedRoutesRequest {
17805 /// Creates a new default instance.
17806 pub fn new() -> Self {
17807 std::default::Default::default()
17808 }
17809
17810 /// Sets the value of [parent][crate::model::ListPolicyBasedRoutesRequest::parent].
17811 ///
17812 /// # Example
17813 /// ```ignore,no_run
17814 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17815 /// let x = ListPolicyBasedRoutesRequest::new().set_parent("example");
17816 /// ```
17817 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17818 self.parent = v.into();
17819 self
17820 }
17821
17822 /// Sets the value of [page_size][crate::model::ListPolicyBasedRoutesRequest::page_size].
17823 ///
17824 /// # Example
17825 /// ```ignore,no_run
17826 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17827 /// let x = ListPolicyBasedRoutesRequest::new().set_page_size(42);
17828 /// ```
17829 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17830 self.page_size = v.into();
17831 self
17832 }
17833
17834 /// Sets the value of [page_token][crate::model::ListPolicyBasedRoutesRequest::page_token].
17835 ///
17836 /// # Example
17837 /// ```ignore,no_run
17838 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17839 /// let x = ListPolicyBasedRoutesRequest::new().set_page_token("example");
17840 /// ```
17841 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17842 self.page_token = v.into();
17843 self
17844 }
17845
17846 /// Sets the value of [filter][crate::model::ListPolicyBasedRoutesRequest::filter].
17847 ///
17848 /// # Example
17849 /// ```ignore,no_run
17850 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17851 /// let x = ListPolicyBasedRoutesRequest::new().set_filter("example");
17852 /// ```
17853 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17854 self.filter = v.into();
17855 self
17856 }
17857
17858 /// Sets the value of [order_by][crate::model::ListPolicyBasedRoutesRequest::order_by].
17859 ///
17860 /// # Example
17861 /// ```ignore,no_run
17862 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17863 /// let x = ListPolicyBasedRoutesRequest::new().set_order_by("example");
17864 /// ```
17865 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17866 self.order_by = v.into();
17867 self
17868 }
17869}
17870
17871impl wkt::message::Message for ListPolicyBasedRoutesRequest {
17872 fn typename() -> &'static str {
17873 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest"
17874 }
17875}
17876
17877/// Response for
17878/// [PolicyBasedRoutingService.ListPolicyBasedRoutes][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]
17879/// method.
17880///
17881/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]: crate::client::PolicyBasedRoutingService::list_policy_based_routes
17882#[derive(Clone, Default, PartialEq)]
17883#[non_exhaustive]
17884pub struct ListPolicyBasedRoutesResponse {
17885 /// Policy-based routes to be returned.
17886 pub policy_based_routes: std::vec::Vec<crate::model::PolicyBasedRoute>,
17887
17888 /// The next pagination token in the List response. It should be used as
17889 /// page_token for the following request. An empty value means no more result.
17890 pub next_page_token: std::string::String,
17891
17892 /// Locations that could not be reached.
17893 pub unreachable: std::vec::Vec<std::string::String>,
17894
17895 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17896}
17897
17898impl ListPolicyBasedRoutesResponse {
17899 /// Creates a new default instance.
17900 pub fn new() -> Self {
17901 std::default::Default::default()
17902 }
17903
17904 /// Sets the value of [policy_based_routes][crate::model::ListPolicyBasedRoutesResponse::policy_based_routes].
17905 ///
17906 /// # Example
17907 /// ```ignore,no_run
17908 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesResponse;
17909 /// use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
17910 /// let x = ListPolicyBasedRoutesResponse::new()
17911 /// .set_policy_based_routes([
17912 /// PolicyBasedRoute::default()/* use setters */,
17913 /// PolicyBasedRoute::default()/* use (different) setters */,
17914 /// ]);
17915 /// ```
17916 pub fn set_policy_based_routes<T, V>(mut self, v: T) -> Self
17917 where
17918 T: std::iter::IntoIterator<Item = V>,
17919 V: std::convert::Into<crate::model::PolicyBasedRoute>,
17920 {
17921 use std::iter::Iterator;
17922 self.policy_based_routes = v.into_iter().map(|i| i.into()).collect();
17923 self
17924 }
17925
17926 /// Sets the value of [next_page_token][crate::model::ListPolicyBasedRoutesResponse::next_page_token].
17927 ///
17928 /// # Example
17929 /// ```ignore,no_run
17930 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesResponse;
17931 /// let x = ListPolicyBasedRoutesResponse::new().set_next_page_token("example");
17932 /// ```
17933 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17934 self.next_page_token = v.into();
17935 self
17936 }
17937
17938 /// Sets the value of [unreachable][crate::model::ListPolicyBasedRoutesResponse::unreachable].
17939 ///
17940 /// # Example
17941 /// ```ignore,no_run
17942 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesResponse;
17943 /// let x = ListPolicyBasedRoutesResponse::new().set_unreachable(["a", "b", "c"]);
17944 /// ```
17945 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
17946 where
17947 T: std::iter::IntoIterator<Item = V>,
17948 V: std::convert::Into<std::string::String>,
17949 {
17950 use std::iter::Iterator;
17951 self.unreachable = v.into_iter().map(|i| i.into()).collect();
17952 self
17953 }
17954}
17955
17956impl wkt::message::Message for ListPolicyBasedRoutesResponse {
17957 fn typename() -> &'static str {
17958 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse"
17959 }
17960}
17961
17962#[doc(hidden)]
17963impl google_cloud_gax::paginator::internal::PageableResponse for ListPolicyBasedRoutesResponse {
17964 type PageItem = crate::model::PolicyBasedRoute;
17965
17966 fn items(self) -> std::vec::Vec<Self::PageItem> {
17967 self.policy_based_routes
17968 }
17969
17970 fn next_page_token(&self) -> std::string::String {
17971 use std::clone::Clone;
17972 self.next_page_token.clone()
17973 }
17974}
17975
17976/// Request for
17977/// [PolicyBasedRoutingService.GetPolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRoute]
17978/// method.
17979///
17980/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRoute]: crate::client::PolicyBasedRoutingService::get_policy_based_route
17981#[derive(Clone, Default, PartialEq)]
17982#[non_exhaustive]
17983pub struct GetPolicyBasedRouteRequest {
17984 /// Required. Name of the PolicyBasedRoute resource to get.
17985 pub name: std::string::String,
17986
17987 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17988}
17989
17990impl GetPolicyBasedRouteRequest {
17991 /// Creates a new default instance.
17992 pub fn new() -> Self {
17993 std::default::Default::default()
17994 }
17995
17996 /// Sets the value of [name][crate::model::GetPolicyBasedRouteRequest::name].
17997 ///
17998 /// # Example
17999 /// ```ignore,no_run
18000 /// # use google_cloud_networkconnectivity_v1::model::GetPolicyBasedRouteRequest;
18001 /// # let project_id = "project_id";
18002 /// # let policy_based_route_id = "policy_based_route_id";
18003 /// let x = GetPolicyBasedRouteRequest::new().set_name(format!("projects/{project_id}/locations/global/PolicyBasedRoutes/{policy_based_route_id}"));
18004 /// ```
18005 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18006 self.name = v.into();
18007 self
18008 }
18009}
18010
18011impl wkt::message::Message for GetPolicyBasedRouteRequest {
18012 fn typename() -> &'static str {
18013 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest"
18014 }
18015}
18016
18017/// Request for
18018/// [PolicyBasedRoutingService.CreatePolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRoute]
18019/// method.
18020///
18021/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRoute]: crate::client::PolicyBasedRoutingService::create_policy_based_route
18022#[derive(Clone, Default, PartialEq)]
18023#[non_exhaustive]
18024pub struct CreatePolicyBasedRouteRequest {
18025 /// Required. The parent resource's name of the PolicyBasedRoute.
18026 pub parent: std::string::String,
18027
18028 /// Required. Unique id for the policy-based route to create. Provided by the
18029 /// client when the resource is created. The name must comply with
18030 /// <https://google.aip.dev/122#resource-id-segments>. Specifically, the name
18031 /// must be 1-63 characters long and match the regular expression
18032 /// [a-z]([a-z0-9-]*[a-z0-9])?. The first character must be a lowercase letter,
18033 /// and all following characters (except for the last character) must be a
18034 /// dash, lowercase letter, or digit. The last character must be a lowercase
18035 /// letter or digit.
18036 pub policy_based_route_id: std::string::String,
18037
18038 /// Required. Initial values for a new policy-based route.
18039 pub policy_based_route: std::option::Option<crate::model::PolicyBasedRoute>,
18040
18041 /// Optional. An optional request ID to identify requests. Specify a unique
18042 /// request ID so that if you must retry your request, the server knows to
18043 /// ignore the request if it has already been completed. The server guarantees
18044 /// that for at least 60 minutes since the first request.
18045 ///
18046 /// For example, consider a situation where you make an initial request and
18047 /// the request times out. If you make the request again with the same request
18048 /// ID, the server can check if original operation with the same request ID
18049 /// was received, and if so, ignores the second request. This prevents clients
18050 /// from accidentally creating duplicate commitments.
18051 ///
18052 /// The request ID must be a valid UUID with the exception that zero UUID is
18053 /// not supported (00000000-0000-0000-0000-000000000000).
18054 pub request_id: std::string::String,
18055
18056 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18057}
18058
18059impl CreatePolicyBasedRouteRequest {
18060 /// Creates a new default instance.
18061 pub fn new() -> Self {
18062 std::default::Default::default()
18063 }
18064
18065 /// Sets the value of [parent][crate::model::CreatePolicyBasedRouteRequest::parent].
18066 ///
18067 /// # Example
18068 /// ```ignore,no_run
18069 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
18070 /// let x = CreatePolicyBasedRouteRequest::new().set_parent("example");
18071 /// ```
18072 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18073 self.parent = v.into();
18074 self
18075 }
18076
18077 /// Sets the value of [policy_based_route_id][crate::model::CreatePolicyBasedRouteRequest::policy_based_route_id].
18078 ///
18079 /// # Example
18080 /// ```ignore,no_run
18081 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
18082 /// let x = CreatePolicyBasedRouteRequest::new().set_policy_based_route_id("example");
18083 /// ```
18084 pub fn set_policy_based_route_id<T: std::convert::Into<std::string::String>>(
18085 mut self,
18086 v: T,
18087 ) -> Self {
18088 self.policy_based_route_id = v.into();
18089 self
18090 }
18091
18092 /// Sets the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
18093 ///
18094 /// # Example
18095 /// ```ignore,no_run
18096 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
18097 /// use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
18098 /// let x = CreatePolicyBasedRouteRequest::new().set_policy_based_route(PolicyBasedRoute::default()/* use setters */);
18099 /// ```
18100 pub fn set_policy_based_route<T>(mut self, v: T) -> Self
18101 where
18102 T: std::convert::Into<crate::model::PolicyBasedRoute>,
18103 {
18104 self.policy_based_route = std::option::Option::Some(v.into());
18105 self
18106 }
18107
18108 /// Sets or clears the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
18109 ///
18110 /// # Example
18111 /// ```ignore,no_run
18112 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
18113 /// use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
18114 /// let x = CreatePolicyBasedRouteRequest::new().set_or_clear_policy_based_route(Some(PolicyBasedRoute::default()/* use setters */));
18115 /// let x = CreatePolicyBasedRouteRequest::new().set_or_clear_policy_based_route(None::<PolicyBasedRoute>);
18116 /// ```
18117 pub fn set_or_clear_policy_based_route<T>(mut self, v: std::option::Option<T>) -> Self
18118 where
18119 T: std::convert::Into<crate::model::PolicyBasedRoute>,
18120 {
18121 self.policy_based_route = v.map(|x| x.into());
18122 self
18123 }
18124
18125 /// Sets the value of [request_id][crate::model::CreatePolicyBasedRouteRequest::request_id].
18126 ///
18127 /// # Example
18128 /// ```ignore,no_run
18129 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
18130 /// let x = CreatePolicyBasedRouteRequest::new().set_request_id("example");
18131 /// ```
18132 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18133 self.request_id = v.into();
18134 self
18135 }
18136}
18137
18138impl wkt::message::Message for CreatePolicyBasedRouteRequest {
18139 fn typename() -> &'static str {
18140 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest"
18141 }
18142}
18143
18144/// Request for
18145/// [PolicyBasedRoutingService.DeletePolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRoute]
18146/// method.
18147///
18148/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRoute]: crate::client::PolicyBasedRoutingService::delete_policy_based_route
18149#[derive(Clone, Default, PartialEq)]
18150#[non_exhaustive]
18151pub struct DeletePolicyBasedRouteRequest {
18152 /// Required. Name of the policy-based route resource to delete.
18153 pub name: std::string::String,
18154
18155 /// Optional. An optional request ID to identify requests. Specify a unique
18156 /// request ID so that if you must retry your request, the server knows to
18157 /// ignore the request if it has already been completed. The server guarantees
18158 /// that for at least 60 minutes after the first request.
18159 ///
18160 /// For example, consider a situation where you make an initial request and
18161 /// the request times out. If you make the request again with the same request
18162 /// ID, the server can check if original operation with the same request ID
18163 /// was received, and if so, ignores the second request. This prevents clients
18164 /// from accidentally creating duplicate commitments.
18165 ///
18166 /// The request ID must be a valid UUID with the exception that zero UUID is
18167 /// not supported (00000000-0000-0000-0000-000000000000).
18168 pub request_id: std::string::String,
18169
18170 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18171}
18172
18173impl DeletePolicyBasedRouteRequest {
18174 /// Creates a new default instance.
18175 pub fn new() -> Self {
18176 std::default::Default::default()
18177 }
18178
18179 /// Sets the value of [name][crate::model::DeletePolicyBasedRouteRequest::name].
18180 ///
18181 /// # Example
18182 /// ```ignore,no_run
18183 /// # use google_cloud_networkconnectivity_v1::model::DeletePolicyBasedRouteRequest;
18184 /// # let project_id = "project_id";
18185 /// # let policy_based_route_id = "policy_based_route_id";
18186 /// let x = DeletePolicyBasedRouteRequest::new().set_name(format!("projects/{project_id}/locations/global/PolicyBasedRoutes/{policy_based_route_id}"));
18187 /// ```
18188 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18189 self.name = v.into();
18190 self
18191 }
18192
18193 /// Sets the value of [request_id][crate::model::DeletePolicyBasedRouteRequest::request_id].
18194 ///
18195 /// # Example
18196 /// ```ignore,no_run
18197 /// # use google_cloud_networkconnectivity_v1::model::DeletePolicyBasedRouteRequest;
18198 /// let x = DeletePolicyBasedRouteRequest::new().set_request_id("example");
18199 /// ```
18200 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18201 self.request_id = v.into();
18202 self
18203 }
18204}
18205
18206impl wkt::message::Message for DeletePolicyBasedRouteRequest {
18207 fn typename() -> &'static str {
18208 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest"
18209 }
18210}
18211
18212/// The infrastructure used for connections between consumers/producers.
18213///
18214/// # Working with unknown values
18215///
18216/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18217/// additional enum variants at any time. Adding new variants is not considered
18218/// a breaking change. Applications should write their code in anticipation of:
18219///
18220/// - New values appearing in future releases of the client library, **and**
18221/// - New values received dynamically, without application changes.
18222///
18223/// Please consult the [Working with enums] section in the user guide for some
18224/// guidelines.
18225///
18226/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18227#[derive(Clone, Debug, PartialEq)]
18228#[non_exhaustive]
18229pub enum Infrastructure {
18230 /// An invalid infrastructure as the default case.
18231 Unspecified,
18232 /// Private Service Connect is used for connections.
18233 Psc,
18234 /// If set, the enum was initialized with an unknown value.
18235 ///
18236 /// Applications can examine the value using [Infrastructure::value] or
18237 /// [Infrastructure::name].
18238 UnknownValue(infrastructure::UnknownValue),
18239}
18240
18241#[doc(hidden)]
18242pub mod infrastructure {
18243 #[allow(unused_imports)]
18244 use super::*;
18245 #[derive(Clone, Debug, PartialEq)]
18246 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18247}
18248
18249impl Infrastructure {
18250 /// Gets the enum value.
18251 ///
18252 /// Returns `None` if the enum contains an unknown value deserialized from
18253 /// the string representation of enums.
18254 pub fn value(&self) -> std::option::Option<i32> {
18255 match self {
18256 Self::Unspecified => std::option::Option::Some(0),
18257 Self::Psc => std::option::Option::Some(1),
18258 Self::UnknownValue(u) => u.0.value(),
18259 }
18260 }
18261
18262 /// Gets the enum value as a string.
18263 ///
18264 /// Returns `None` if the enum contains an unknown value deserialized from
18265 /// the integer representation of enums.
18266 pub fn name(&self) -> std::option::Option<&str> {
18267 match self {
18268 Self::Unspecified => std::option::Option::Some("INFRASTRUCTURE_UNSPECIFIED"),
18269 Self::Psc => std::option::Option::Some("PSC"),
18270 Self::UnknownValue(u) => u.0.name(),
18271 }
18272 }
18273}
18274
18275impl std::default::Default for Infrastructure {
18276 fn default() -> Self {
18277 use std::convert::From;
18278 Self::from(0)
18279 }
18280}
18281
18282impl std::fmt::Display for Infrastructure {
18283 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18284 wkt::internal::display_enum(f, self.name(), self.value())
18285 }
18286}
18287
18288impl std::convert::From<i32> for Infrastructure {
18289 fn from(value: i32) -> Self {
18290 match value {
18291 0 => Self::Unspecified,
18292 1 => Self::Psc,
18293 _ => Self::UnknownValue(infrastructure::UnknownValue(
18294 wkt::internal::UnknownEnumValue::Integer(value),
18295 )),
18296 }
18297 }
18298}
18299
18300impl std::convert::From<&str> for Infrastructure {
18301 fn from(value: &str) -> Self {
18302 use std::string::ToString;
18303 match value {
18304 "INFRASTRUCTURE_UNSPECIFIED" => Self::Unspecified,
18305 "PSC" => Self::Psc,
18306 _ => Self::UnknownValue(infrastructure::UnknownValue(
18307 wkt::internal::UnknownEnumValue::String(value.to_string()),
18308 )),
18309 }
18310 }
18311}
18312
18313impl serde::ser::Serialize for Infrastructure {
18314 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18315 where
18316 S: serde::Serializer,
18317 {
18318 match self {
18319 Self::Unspecified => serializer.serialize_i32(0),
18320 Self::Psc => serializer.serialize_i32(1),
18321 Self::UnknownValue(u) => u.0.serialize(serializer),
18322 }
18323 }
18324}
18325
18326impl<'de> serde::de::Deserialize<'de> for Infrastructure {
18327 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18328 where
18329 D: serde::Deserializer<'de>,
18330 {
18331 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Infrastructure>::new(
18332 ".google.cloud.networkconnectivity.v1.Infrastructure",
18333 ))
18334 }
18335}
18336
18337/// The error type indicates whether a connection error is consumer facing,
18338/// producer facing or system internal.
18339///
18340/// # Working with unknown values
18341///
18342/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18343/// additional enum variants at any time. Adding new variants is not considered
18344/// a breaking change. Applications should write their code in anticipation of:
18345///
18346/// - New values appearing in future releases of the client library, **and**
18347/// - New values received dynamically, without application changes.
18348///
18349/// Please consult the [Working with enums] section in the user guide for some
18350/// guidelines.
18351///
18352/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18353#[derive(Clone, Debug, PartialEq)]
18354#[non_exhaustive]
18355pub enum ConnectionErrorType {
18356 /// An invalid error type as the default case.
18357 Unspecified,
18358 /// The error is due to Service Automation system internal.
18359 ErrorInternal,
18360 /// The error is due to the setup on consumer side.
18361 ErrorConsumerSide,
18362 /// The error is due to the setup on producer side.
18363 ErrorProducerSide,
18364 /// If set, the enum was initialized with an unknown value.
18365 ///
18366 /// Applications can examine the value using [ConnectionErrorType::value] or
18367 /// [ConnectionErrorType::name].
18368 UnknownValue(connection_error_type::UnknownValue),
18369}
18370
18371#[doc(hidden)]
18372pub mod connection_error_type {
18373 #[allow(unused_imports)]
18374 use super::*;
18375 #[derive(Clone, Debug, PartialEq)]
18376 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18377}
18378
18379impl ConnectionErrorType {
18380 /// Gets the enum value.
18381 ///
18382 /// Returns `None` if the enum contains an unknown value deserialized from
18383 /// the string representation of enums.
18384 pub fn value(&self) -> std::option::Option<i32> {
18385 match self {
18386 Self::Unspecified => std::option::Option::Some(0),
18387 Self::ErrorInternal => std::option::Option::Some(1),
18388 Self::ErrorConsumerSide => std::option::Option::Some(2),
18389 Self::ErrorProducerSide => std::option::Option::Some(3),
18390 Self::UnknownValue(u) => u.0.value(),
18391 }
18392 }
18393
18394 /// Gets the enum value as a string.
18395 ///
18396 /// Returns `None` if the enum contains an unknown value deserialized from
18397 /// the integer representation of enums.
18398 pub fn name(&self) -> std::option::Option<&str> {
18399 match self {
18400 Self::Unspecified => std::option::Option::Some("CONNECTION_ERROR_TYPE_UNSPECIFIED"),
18401 Self::ErrorInternal => std::option::Option::Some("ERROR_INTERNAL"),
18402 Self::ErrorConsumerSide => std::option::Option::Some("ERROR_CONSUMER_SIDE"),
18403 Self::ErrorProducerSide => std::option::Option::Some("ERROR_PRODUCER_SIDE"),
18404 Self::UnknownValue(u) => u.0.name(),
18405 }
18406 }
18407}
18408
18409impl std::default::Default for ConnectionErrorType {
18410 fn default() -> Self {
18411 use std::convert::From;
18412 Self::from(0)
18413 }
18414}
18415
18416impl std::fmt::Display for ConnectionErrorType {
18417 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18418 wkt::internal::display_enum(f, self.name(), self.value())
18419 }
18420}
18421
18422impl std::convert::From<i32> for ConnectionErrorType {
18423 fn from(value: i32) -> Self {
18424 match value {
18425 0 => Self::Unspecified,
18426 1 => Self::ErrorInternal,
18427 2 => Self::ErrorConsumerSide,
18428 3 => Self::ErrorProducerSide,
18429 _ => Self::UnknownValue(connection_error_type::UnknownValue(
18430 wkt::internal::UnknownEnumValue::Integer(value),
18431 )),
18432 }
18433 }
18434}
18435
18436impl std::convert::From<&str> for ConnectionErrorType {
18437 fn from(value: &str) -> Self {
18438 use std::string::ToString;
18439 match value {
18440 "CONNECTION_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
18441 "ERROR_INTERNAL" => Self::ErrorInternal,
18442 "ERROR_CONSUMER_SIDE" => Self::ErrorConsumerSide,
18443 "ERROR_PRODUCER_SIDE" => Self::ErrorProducerSide,
18444 _ => Self::UnknownValue(connection_error_type::UnknownValue(
18445 wkt::internal::UnknownEnumValue::String(value.to_string()),
18446 )),
18447 }
18448 }
18449}
18450
18451impl serde::ser::Serialize for ConnectionErrorType {
18452 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18453 where
18454 S: serde::Serializer,
18455 {
18456 match self {
18457 Self::Unspecified => serializer.serialize_i32(0),
18458 Self::ErrorInternal => serializer.serialize_i32(1),
18459 Self::ErrorConsumerSide => serializer.serialize_i32(2),
18460 Self::ErrorProducerSide => serializer.serialize_i32(3),
18461 Self::UnknownValue(u) => u.0.serialize(serializer),
18462 }
18463 }
18464}
18465
18466impl<'de> serde::de::Deserialize<'de> for ConnectionErrorType {
18467 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18468 where
18469 D: serde::Deserializer<'de>,
18470 {
18471 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionErrorType>::new(
18472 ".google.cloud.networkconnectivity.v1.ConnectionErrorType",
18473 ))
18474 }
18475}
18476
18477/// The requested IP version for the PSC connection.
18478///
18479/// # Working with unknown values
18480///
18481/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18482/// additional enum variants at any time. Adding new variants is not considered
18483/// a breaking change. Applications should write their code in anticipation of:
18484///
18485/// - New values appearing in future releases of the client library, **and**
18486/// - New values received dynamically, without application changes.
18487///
18488/// Please consult the [Working with enums] section in the user guide for some
18489/// guidelines.
18490///
18491/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18492#[derive(Clone, Debug, PartialEq)]
18493#[non_exhaustive]
18494pub enum IPVersion {
18495 /// Default value. We will use IPv4 or IPv6 depending on the IP version of
18496 /// first available subnetwork.
18497 Unspecified,
18498 /// Will use IPv4 only.
18499 Ipv4,
18500 /// Will use IPv6 only.
18501 Ipv6,
18502 /// If set, the enum was initialized with an unknown value.
18503 ///
18504 /// Applications can examine the value using [IPVersion::value] or
18505 /// [IPVersion::name].
18506 UnknownValue(ip_version::UnknownValue),
18507}
18508
18509#[doc(hidden)]
18510pub mod ip_version {
18511 #[allow(unused_imports)]
18512 use super::*;
18513 #[derive(Clone, Debug, PartialEq)]
18514 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18515}
18516
18517impl IPVersion {
18518 /// Gets the enum value.
18519 ///
18520 /// Returns `None` if the enum contains an unknown value deserialized from
18521 /// the string representation of enums.
18522 pub fn value(&self) -> std::option::Option<i32> {
18523 match self {
18524 Self::Unspecified => std::option::Option::Some(0),
18525 Self::Ipv4 => std::option::Option::Some(1),
18526 Self::Ipv6 => std::option::Option::Some(2),
18527 Self::UnknownValue(u) => u.0.value(),
18528 }
18529 }
18530
18531 /// Gets the enum value as a string.
18532 ///
18533 /// Returns `None` if the enum contains an unknown value deserialized from
18534 /// the integer representation of enums.
18535 pub fn name(&self) -> std::option::Option<&str> {
18536 match self {
18537 Self::Unspecified => std::option::Option::Some("IP_VERSION_UNSPECIFIED"),
18538 Self::Ipv4 => std::option::Option::Some("IPV4"),
18539 Self::Ipv6 => std::option::Option::Some("IPV6"),
18540 Self::UnknownValue(u) => u.0.name(),
18541 }
18542 }
18543}
18544
18545impl std::default::Default for IPVersion {
18546 fn default() -> Self {
18547 use std::convert::From;
18548 Self::from(0)
18549 }
18550}
18551
18552impl std::fmt::Display for IPVersion {
18553 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18554 wkt::internal::display_enum(f, self.name(), self.value())
18555 }
18556}
18557
18558impl std::convert::From<i32> for IPVersion {
18559 fn from(value: i32) -> Self {
18560 match value {
18561 0 => Self::Unspecified,
18562 1 => Self::Ipv4,
18563 2 => Self::Ipv6,
18564 _ => Self::UnknownValue(ip_version::UnknownValue(
18565 wkt::internal::UnknownEnumValue::Integer(value),
18566 )),
18567 }
18568 }
18569}
18570
18571impl std::convert::From<&str> for IPVersion {
18572 fn from(value: &str) -> Self {
18573 use std::string::ToString;
18574 match value {
18575 "IP_VERSION_UNSPECIFIED" => Self::Unspecified,
18576 "IPV4" => Self::Ipv4,
18577 "IPV6" => Self::Ipv6,
18578 _ => Self::UnknownValue(ip_version::UnknownValue(
18579 wkt::internal::UnknownEnumValue::String(value.to_string()),
18580 )),
18581 }
18582 }
18583}
18584
18585impl serde::ser::Serialize for IPVersion {
18586 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18587 where
18588 S: serde::Serializer,
18589 {
18590 match self {
18591 Self::Unspecified => serializer.serialize_i32(0),
18592 Self::Ipv4 => serializer.serialize_i32(1),
18593 Self::Ipv6 => serializer.serialize_i32(2),
18594 Self::UnknownValue(u) => u.0.serialize(serializer),
18595 }
18596 }
18597}
18598
18599impl<'de> serde::de::Deserialize<'de> for IPVersion {
18600 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18601 where
18602 D: serde::Deserializer<'de>,
18603 {
18604 deserializer.deserialize_any(wkt::internal::EnumVisitor::<IPVersion>::new(
18605 ".google.cloud.networkconnectivity.v1.IPVersion",
18606 ))
18607 }
18608}
18609
18610/// Supported features for a location
18611///
18612/// # Working with unknown values
18613///
18614/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18615/// additional enum variants at any time. Adding new variants is not considered
18616/// a breaking change. Applications should write their code in anticipation of:
18617///
18618/// - New values appearing in future releases of the client library, **and**
18619/// - New values received dynamically, without application changes.
18620///
18621/// Please consult the [Working with enums] section in the user guide for some
18622/// guidelines.
18623///
18624/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18625#[derive(Clone, Debug, PartialEq)]
18626#[non_exhaustive]
18627pub enum LocationFeature {
18628 /// No publicly supported feature in this location
18629 Unspecified,
18630 /// Site-to-cloud spokes are supported in this location
18631 SiteToCloudSpokes,
18632 /// Site-to-site spokes are supported in this location
18633 SiteToSiteSpokes,
18634 /// If set, the enum was initialized with an unknown value.
18635 ///
18636 /// Applications can examine the value using [LocationFeature::value] or
18637 /// [LocationFeature::name].
18638 UnknownValue(location_feature::UnknownValue),
18639}
18640
18641#[doc(hidden)]
18642pub mod location_feature {
18643 #[allow(unused_imports)]
18644 use super::*;
18645 #[derive(Clone, Debug, PartialEq)]
18646 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18647}
18648
18649impl LocationFeature {
18650 /// Gets the enum value.
18651 ///
18652 /// Returns `None` if the enum contains an unknown value deserialized from
18653 /// the string representation of enums.
18654 pub fn value(&self) -> std::option::Option<i32> {
18655 match self {
18656 Self::Unspecified => std::option::Option::Some(0),
18657 Self::SiteToCloudSpokes => std::option::Option::Some(1),
18658 Self::SiteToSiteSpokes => std::option::Option::Some(2),
18659 Self::UnknownValue(u) => u.0.value(),
18660 }
18661 }
18662
18663 /// Gets the enum value as a string.
18664 ///
18665 /// Returns `None` if the enum contains an unknown value deserialized from
18666 /// the integer representation of enums.
18667 pub fn name(&self) -> std::option::Option<&str> {
18668 match self {
18669 Self::Unspecified => std::option::Option::Some("LOCATION_FEATURE_UNSPECIFIED"),
18670 Self::SiteToCloudSpokes => std::option::Option::Some("SITE_TO_CLOUD_SPOKES"),
18671 Self::SiteToSiteSpokes => std::option::Option::Some("SITE_TO_SITE_SPOKES"),
18672 Self::UnknownValue(u) => u.0.name(),
18673 }
18674 }
18675}
18676
18677impl std::default::Default for LocationFeature {
18678 fn default() -> Self {
18679 use std::convert::From;
18680 Self::from(0)
18681 }
18682}
18683
18684impl std::fmt::Display for LocationFeature {
18685 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18686 wkt::internal::display_enum(f, self.name(), self.value())
18687 }
18688}
18689
18690impl std::convert::From<i32> for LocationFeature {
18691 fn from(value: i32) -> Self {
18692 match value {
18693 0 => Self::Unspecified,
18694 1 => Self::SiteToCloudSpokes,
18695 2 => Self::SiteToSiteSpokes,
18696 _ => Self::UnknownValue(location_feature::UnknownValue(
18697 wkt::internal::UnknownEnumValue::Integer(value),
18698 )),
18699 }
18700 }
18701}
18702
18703impl std::convert::From<&str> for LocationFeature {
18704 fn from(value: &str) -> Self {
18705 use std::string::ToString;
18706 match value {
18707 "LOCATION_FEATURE_UNSPECIFIED" => Self::Unspecified,
18708 "SITE_TO_CLOUD_SPOKES" => Self::SiteToCloudSpokes,
18709 "SITE_TO_SITE_SPOKES" => Self::SiteToSiteSpokes,
18710 _ => Self::UnknownValue(location_feature::UnknownValue(
18711 wkt::internal::UnknownEnumValue::String(value.to_string()),
18712 )),
18713 }
18714 }
18715}
18716
18717impl serde::ser::Serialize for LocationFeature {
18718 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18719 where
18720 S: serde::Serializer,
18721 {
18722 match self {
18723 Self::Unspecified => serializer.serialize_i32(0),
18724 Self::SiteToCloudSpokes => serializer.serialize_i32(1),
18725 Self::SiteToSiteSpokes => serializer.serialize_i32(2),
18726 Self::UnknownValue(u) => u.0.serialize(serializer),
18727 }
18728 }
18729}
18730
18731impl<'de> serde::de::Deserialize<'de> for LocationFeature {
18732 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18733 where
18734 D: serde::Deserializer<'de>,
18735 {
18736 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LocationFeature>::new(
18737 ".google.cloud.networkconnectivity.v1.LocationFeature",
18738 ))
18739 }
18740}
18741
18742/// The route's type
18743///
18744/// # Working with unknown values
18745///
18746/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18747/// additional enum variants at any time. Adding new variants is not considered
18748/// a breaking change. Applications should write their code in anticipation of:
18749///
18750/// - New values appearing in future releases of the client library, **and**
18751/// - New values received dynamically, without application changes.
18752///
18753/// Please consult the [Working with enums] section in the user guide for some
18754/// guidelines.
18755///
18756/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18757#[derive(Clone, Debug, PartialEq)]
18758#[non_exhaustive]
18759pub enum RouteType {
18760 /// No route type information specified
18761 Unspecified,
18762 /// The route leads to a destination within the primary address range of the
18763 /// VPC network's subnet.
18764 VpcPrimarySubnet,
18765 /// The route leads to a destination within the secondary address range of the
18766 /// VPC network's subnet.
18767 VpcSecondarySubnet,
18768 /// The route leads to a destination in a dynamic route. Dynamic routes are
18769 /// derived from Border Gateway Protocol (BGP) advertisements received from an
18770 /// NCC hybrid spoke.
18771 DynamicRoute,
18772 /// If set, the enum was initialized with an unknown value.
18773 ///
18774 /// Applications can examine the value using [RouteType::value] or
18775 /// [RouteType::name].
18776 UnknownValue(route_type::UnknownValue),
18777}
18778
18779#[doc(hidden)]
18780pub mod route_type {
18781 #[allow(unused_imports)]
18782 use super::*;
18783 #[derive(Clone, Debug, PartialEq)]
18784 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18785}
18786
18787impl RouteType {
18788 /// Gets the enum value.
18789 ///
18790 /// Returns `None` if the enum contains an unknown value deserialized from
18791 /// the string representation of enums.
18792 pub fn value(&self) -> std::option::Option<i32> {
18793 match self {
18794 Self::Unspecified => std::option::Option::Some(0),
18795 Self::VpcPrimarySubnet => std::option::Option::Some(1),
18796 Self::VpcSecondarySubnet => std::option::Option::Some(2),
18797 Self::DynamicRoute => std::option::Option::Some(3),
18798 Self::UnknownValue(u) => u.0.value(),
18799 }
18800 }
18801
18802 /// Gets the enum value as a string.
18803 ///
18804 /// Returns `None` if the enum contains an unknown value deserialized from
18805 /// the integer representation of enums.
18806 pub fn name(&self) -> std::option::Option<&str> {
18807 match self {
18808 Self::Unspecified => std::option::Option::Some("ROUTE_TYPE_UNSPECIFIED"),
18809 Self::VpcPrimarySubnet => std::option::Option::Some("VPC_PRIMARY_SUBNET"),
18810 Self::VpcSecondarySubnet => std::option::Option::Some("VPC_SECONDARY_SUBNET"),
18811 Self::DynamicRoute => std::option::Option::Some("DYNAMIC_ROUTE"),
18812 Self::UnknownValue(u) => u.0.name(),
18813 }
18814 }
18815}
18816
18817impl std::default::Default for RouteType {
18818 fn default() -> Self {
18819 use std::convert::From;
18820 Self::from(0)
18821 }
18822}
18823
18824impl std::fmt::Display for RouteType {
18825 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18826 wkt::internal::display_enum(f, self.name(), self.value())
18827 }
18828}
18829
18830impl std::convert::From<i32> for RouteType {
18831 fn from(value: i32) -> Self {
18832 match value {
18833 0 => Self::Unspecified,
18834 1 => Self::VpcPrimarySubnet,
18835 2 => Self::VpcSecondarySubnet,
18836 3 => Self::DynamicRoute,
18837 _ => Self::UnknownValue(route_type::UnknownValue(
18838 wkt::internal::UnknownEnumValue::Integer(value),
18839 )),
18840 }
18841 }
18842}
18843
18844impl std::convert::From<&str> for RouteType {
18845 fn from(value: &str) -> Self {
18846 use std::string::ToString;
18847 match value {
18848 "ROUTE_TYPE_UNSPECIFIED" => Self::Unspecified,
18849 "VPC_PRIMARY_SUBNET" => Self::VpcPrimarySubnet,
18850 "VPC_SECONDARY_SUBNET" => Self::VpcSecondarySubnet,
18851 "DYNAMIC_ROUTE" => Self::DynamicRoute,
18852 _ => Self::UnknownValue(route_type::UnknownValue(
18853 wkt::internal::UnknownEnumValue::String(value.to_string()),
18854 )),
18855 }
18856 }
18857}
18858
18859impl serde::ser::Serialize for RouteType {
18860 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18861 where
18862 S: serde::Serializer,
18863 {
18864 match self {
18865 Self::Unspecified => serializer.serialize_i32(0),
18866 Self::VpcPrimarySubnet => serializer.serialize_i32(1),
18867 Self::VpcSecondarySubnet => serializer.serialize_i32(2),
18868 Self::DynamicRoute => serializer.serialize_i32(3),
18869 Self::UnknownValue(u) => u.0.serialize(serializer),
18870 }
18871 }
18872}
18873
18874impl<'de> serde::de::Deserialize<'de> for RouteType {
18875 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18876 where
18877 D: serde::Deserializer<'de>,
18878 {
18879 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteType>::new(
18880 ".google.cloud.networkconnectivity.v1.RouteType",
18881 ))
18882 }
18883}
18884
18885/// The State enum represents the lifecycle stage of a Network Connectivity
18886/// Center resource.
18887///
18888/// # Working with unknown values
18889///
18890/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18891/// additional enum variants at any time. Adding new variants is not considered
18892/// a breaking change. Applications should write their code in anticipation of:
18893///
18894/// - New values appearing in future releases of the client library, **and**
18895/// - New values received dynamically, without application changes.
18896///
18897/// Please consult the [Working with enums] section in the user guide for some
18898/// guidelines.
18899///
18900/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18901#[derive(Clone, Debug, PartialEq)]
18902#[non_exhaustive]
18903pub enum State {
18904 /// No state information available
18905 Unspecified,
18906 /// The resource's create operation is in progress.
18907 Creating,
18908 /// The resource is active
18909 Active,
18910 /// The resource's delete operation is in progress.
18911 Deleting,
18912 /// The resource's accept operation is in progress.
18913 Accepting,
18914 /// The resource's reject operation is in progress.
18915 Rejecting,
18916 /// The resource's update operation is in progress.
18917 Updating,
18918 /// The resource is inactive.
18919 Inactive,
18920 /// The hub associated with this spoke resource has been deleted.
18921 /// This state applies to spoke resources only.
18922 Obsolete,
18923 /// The resource is in an undefined state due to resource creation or deletion
18924 /// failure. You can try to delete the resource later or contact support for
18925 /// help.
18926 Failed,
18927 /// If set, the enum was initialized with an unknown value.
18928 ///
18929 /// Applications can examine the value using [State::value] or
18930 /// [State::name].
18931 UnknownValue(state::UnknownValue),
18932}
18933
18934#[doc(hidden)]
18935pub mod state {
18936 #[allow(unused_imports)]
18937 use super::*;
18938 #[derive(Clone, Debug, PartialEq)]
18939 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18940}
18941
18942impl State {
18943 /// Gets the enum value.
18944 ///
18945 /// Returns `None` if the enum contains an unknown value deserialized from
18946 /// the string representation of enums.
18947 pub fn value(&self) -> std::option::Option<i32> {
18948 match self {
18949 Self::Unspecified => std::option::Option::Some(0),
18950 Self::Creating => std::option::Option::Some(1),
18951 Self::Active => std::option::Option::Some(2),
18952 Self::Deleting => std::option::Option::Some(3),
18953 Self::Accepting => std::option::Option::Some(8),
18954 Self::Rejecting => std::option::Option::Some(9),
18955 Self::Updating => std::option::Option::Some(6),
18956 Self::Inactive => std::option::Option::Some(7),
18957 Self::Obsolete => std::option::Option::Some(10),
18958 Self::Failed => std::option::Option::Some(11),
18959 Self::UnknownValue(u) => u.0.value(),
18960 }
18961 }
18962
18963 /// Gets the enum value as a string.
18964 ///
18965 /// Returns `None` if the enum contains an unknown value deserialized from
18966 /// the integer representation of enums.
18967 pub fn name(&self) -> std::option::Option<&str> {
18968 match self {
18969 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
18970 Self::Creating => std::option::Option::Some("CREATING"),
18971 Self::Active => std::option::Option::Some("ACTIVE"),
18972 Self::Deleting => std::option::Option::Some("DELETING"),
18973 Self::Accepting => std::option::Option::Some("ACCEPTING"),
18974 Self::Rejecting => std::option::Option::Some("REJECTING"),
18975 Self::Updating => std::option::Option::Some("UPDATING"),
18976 Self::Inactive => std::option::Option::Some("INACTIVE"),
18977 Self::Obsolete => std::option::Option::Some("OBSOLETE"),
18978 Self::Failed => std::option::Option::Some("FAILED"),
18979 Self::UnknownValue(u) => u.0.name(),
18980 }
18981 }
18982}
18983
18984impl std::default::Default for State {
18985 fn default() -> Self {
18986 use std::convert::From;
18987 Self::from(0)
18988 }
18989}
18990
18991impl std::fmt::Display for State {
18992 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18993 wkt::internal::display_enum(f, self.name(), self.value())
18994 }
18995}
18996
18997impl std::convert::From<i32> for State {
18998 fn from(value: i32) -> Self {
18999 match value {
19000 0 => Self::Unspecified,
19001 1 => Self::Creating,
19002 2 => Self::Active,
19003 3 => Self::Deleting,
19004 6 => Self::Updating,
19005 7 => Self::Inactive,
19006 8 => Self::Accepting,
19007 9 => Self::Rejecting,
19008 10 => Self::Obsolete,
19009 11 => Self::Failed,
19010 _ => Self::UnknownValue(state::UnknownValue(
19011 wkt::internal::UnknownEnumValue::Integer(value),
19012 )),
19013 }
19014 }
19015}
19016
19017impl std::convert::From<&str> for State {
19018 fn from(value: &str) -> Self {
19019 use std::string::ToString;
19020 match value {
19021 "STATE_UNSPECIFIED" => Self::Unspecified,
19022 "CREATING" => Self::Creating,
19023 "ACTIVE" => Self::Active,
19024 "DELETING" => Self::Deleting,
19025 "ACCEPTING" => Self::Accepting,
19026 "REJECTING" => Self::Rejecting,
19027 "UPDATING" => Self::Updating,
19028 "INACTIVE" => Self::Inactive,
19029 "OBSOLETE" => Self::Obsolete,
19030 "FAILED" => Self::Failed,
19031 _ => Self::UnknownValue(state::UnknownValue(
19032 wkt::internal::UnknownEnumValue::String(value.to_string()),
19033 )),
19034 }
19035 }
19036}
19037
19038impl serde::ser::Serialize for State {
19039 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19040 where
19041 S: serde::Serializer,
19042 {
19043 match self {
19044 Self::Unspecified => serializer.serialize_i32(0),
19045 Self::Creating => serializer.serialize_i32(1),
19046 Self::Active => serializer.serialize_i32(2),
19047 Self::Deleting => serializer.serialize_i32(3),
19048 Self::Accepting => serializer.serialize_i32(8),
19049 Self::Rejecting => serializer.serialize_i32(9),
19050 Self::Updating => serializer.serialize_i32(6),
19051 Self::Inactive => serializer.serialize_i32(7),
19052 Self::Obsolete => serializer.serialize_i32(10),
19053 Self::Failed => serializer.serialize_i32(11),
19054 Self::UnknownValue(u) => u.0.serialize(serializer),
19055 }
19056 }
19057}
19058
19059impl<'de> serde::de::Deserialize<'de> for State {
19060 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19061 where
19062 D: serde::Deserializer<'de>,
19063 {
19064 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
19065 ".google.cloud.networkconnectivity.v1.State",
19066 ))
19067 }
19068}
19069
19070/// The SpokeType enum represents the type of spoke. The type
19071/// reflects the kind of resource that a spoke is associated with.
19072///
19073/// # Working with unknown values
19074///
19075/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19076/// additional enum variants at any time. Adding new variants is not considered
19077/// a breaking change. Applications should write their code in anticipation of:
19078///
19079/// - New values appearing in future releases of the client library, **and**
19080/// - New values received dynamically, without application changes.
19081///
19082/// Please consult the [Working with enums] section in the user guide for some
19083/// guidelines.
19084///
19085/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19086#[derive(Clone, Debug, PartialEq)]
19087#[non_exhaustive]
19088pub enum SpokeType {
19089 /// Unspecified spoke type.
19090 Unspecified,
19091 /// Spokes associated with VPN tunnels.
19092 VpnTunnel,
19093 /// Spokes associated with VLAN attachments.
19094 InterconnectAttachment,
19095 /// Spokes associated with router appliance instances.
19096 RouterAppliance,
19097 /// Spokes associated with VPC networks.
19098 VpcNetwork,
19099 /// Spokes that are backed by a producer VPC network.
19100 ProducerVpcNetwork,
19101 /// If set, the enum was initialized with an unknown value.
19102 ///
19103 /// Applications can examine the value using [SpokeType::value] or
19104 /// [SpokeType::name].
19105 UnknownValue(spoke_type::UnknownValue),
19106}
19107
19108#[doc(hidden)]
19109pub mod spoke_type {
19110 #[allow(unused_imports)]
19111 use super::*;
19112 #[derive(Clone, Debug, PartialEq)]
19113 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19114}
19115
19116impl SpokeType {
19117 /// Gets the enum value.
19118 ///
19119 /// Returns `None` if the enum contains an unknown value deserialized from
19120 /// the string representation of enums.
19121 pub fn value(&self) -> std::option::Option<i32> {
19122 match self {
19123 Self::Unspecified => std::option::Option::Some(0),
19124 Self::VpnTunnel => std::option::Option::Some(1),
19125 Self::InterconnectAttachment => std::option::Option::Some(2),
19126 Self::RouterAppliance => std::option::Option::Some(3),
19127 Self::VpcNetwork => std::option::Option::Some(4),
19128 Self::ProducerVpcNetwork => std::option::Option::Some(7),
19129 Self::UnknownValue(u) => u.0.value(),
19130 }
19131 }
19132
19133 /// Gets the enum value as a string.
19134 ///
19135 /// Returns `None` if the enum contains an unknown value deserialized from
19136 /// the integer representation of enums.
19137 pub fn name(&self) -> std::option::Option<&str> {
19138 match self {
19139 Self::Unspecified => std::option::Option::Some("SPOKE_TYPE_UNSPECIFIED"),
19140 Self::VpnTunnel => std::option::Option::Some("VPN_TUNNEL"),
19141 Self::InterconnectAttachment => std::option::Option::Some("INTERCONNECT_ATTACHMENT"),
19142 Self::RouterAppliance => std::option::Option::Some("ROUTER_APPLIANCE"),
19143 Self::VpcNetwork => std::option::Option::Some("VPC_NETWORK"),
19144 Self::ProducerVpcNetwork => std::option::Option::Some("PRODUCER_VPC_NETWORK"),
19145 Self::UnknownValue(u) => u.0.name(),
19146 }
19147 }
19148}
19149
19150impl std::default::Default for SpokeType {
19151 fn default() -> Self {
19152 use std::convert::From;
19153 Self::from(0)
19154 }
19155}
19156
19157impl std::fmt::Display for SpokeType {
19158 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19159 wkt::internal::display_enum(f, self.name(), self.value())
19160 }
19161}
19162
19163impl std::convert::From<i32> for SpokeType {
19164 fn from(value: i32) -> Self {
19165 match value {
19166 0 => Self::Unspecified,
19167 1 => Self::VpnTunnel,
19168 2 => Self::InterconnectAttachment,
19169 3 => Self::RouterAppliance,
19170 4 => Self::VpcNetwork,
19171 7 => Self::ProducerVpcNetwork,
19172 _ => Self::UnknownValue(spoke_type::UnknownValue(
19173 wkt::internal::UnknownEnumValue::Integer(value),
19174 )),
19175 }
19176 }
19177}
19178
19179impl std::convert::From<&str> for SpokeType {
19180 fn from(value: &str) -> Self {
19181 use std::string::ToString;
19182 match value {
19183 "SPOKE_TYPE_UNSPECIFIED" => Self::Unspecified,
19184 "VPN_TUNNEL" => Self::VpnTunnel,
19185 "INTERCONNECT_ATTACHMENT" => Self::InterconnectAttachment,
19186 "ROUTER_APPLIANCE" => Self::RouterAppliance,
19187 "VPC_NETWORK" => Self::VpcNetwork,
19188 "PRODUCER_VPC_NETWORK" => Self::ProducerVpcNetwork,
19189 _ => Self::UnknownValue(spoke_type::UnknownValue(
19190 wkt::internal::UnknownEnumValue::String(value.to_string()),
19191 )),
19192 }
19193 }
19194}
19195
19196impl serde::ser::Serialize for SpokeType {
19197 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19198 where
19199 S: serde::Serializer,
19200 {
19201 match self {
19202 Self::Unspecified => serializer.serialize_i32(0),
19203 Self::VpnTunnel => serializer.serialize_i32(1),
19204 Self::InterconnectAttachment => serializer.serialize_i32(2),
19205 Self::RouterAppliance => serializer.serialize_i32(3),
19206 Self::VpcNetwork => serializer.serialize_i32(4),
19207 Self::ProducerVpcNetwork => serializer.serialize_i32(7),
19208 Self::UnknownValue(u) => u.0.serialize(serializer),
19209 }
19210 }
19211}
19212
19213impl<'de> serde::de::Deserialize<'de> for SpokeType {
19214 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19215 where
19216 D: serde::Deserializer<'de>,
19217 {
19218 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpokeType>::new(
19219 ".google.cloud.networkconnectivity.v1.SpokeType",
19220 ))
19221 }
19222}
19223
19224/// This enum controls the policy mode used in a hub.
19225///
19226/// # Working with unknown values
19227///
19228/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19229/// additional enum variants at any time. Adding new variants is not considered
19230/// a breaking change. Applications should write their code in anticipation of:
19231///
19232/// - New values appearing in future releases of the client library, **and**
19233/// - New values received dynamically, without application changes.
19234///
19235/// Please consult the [Working with enums] section in the user guide for some
19236/// guidelines.
19237///
19238/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19239#[derive(Clone, Debug, PartialEq)]
19240#[non_exhaustive]
19241pub enum PolicyMode {
19242 /// Policy mode is unspecified. It defaults to PRESET
19243 /// with preset_topology = MESH.
19244 Unspecified,
19245 /// Hub uses one of the preset topologies.
19246 Preset,
19247 /// If set, the enum was initialized with an unknown value.
19248 ///
19249 /// Applications can examine the value using [PolicyMode::value] or
19250 /// [PolicyMode::name].
19251 UnknownValue(policy_mode::UnknownValue),
19252}
19253
19254#[doc(hidden)]
19255pub mod policy_mode {
19256 #[allow(unused_imports)]
19257 use super::*;
19258 #[derive(Clone, Debug, PartialEq)]
19259 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19260}
19261
19262impl PolicyMode {
19263 /// Gets the enum value.
19264 ///
19265 /// Returns `None` if the enum contains an unknown value deserialized from
19266 /// the string representation of enums.
19267 pub fn value(&self) -> std::option::Option<i32> {
19268 match self {
19269 Self::Unspecified => std::option::Option::Some(0),
19270 Self::Preset => std::option::Option::Some(1),
19271 Self::UnknownValue(u) => u.0.value(),
19272 }
19273 }
19274
19275 /// Gets the enum value as a string.
19276 ///
19277 /// Returns `None` if the enum contains an unknown value deserialized from
19278 /// the integer representation of enums.
19279 pub fn name(&self) -> std::option::Option<&str> {
19280 match self {
19281 Self::Unspecified => std::option::Option::Some("POLICY_MODE_UNSPECIFIED"),
19282 Self::Preset => std::option::Option::Some("PRESET"),
19283 Self::UnknownValue(u) => u.0.name(),
19284 }
19285 }
19286}
19287
19288impl std::default::Default for PolicyMode {
19289 fn default() -> Self {
19290 use std::convert::From;
19291 Self::from(0)
19292 }
19293}
19294
19295impl std::fmt::Display for PolicyMode {
19296 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19297 wkt::internal::display_enum(f, self.name(), self.value())
19298 }
19299}
19300
19301impl std::convert::From<i32> for PolicyMode {
19302 fn from(value: i32) -> Self {
19303 match value {
19304 0 => Self::Unspecified,
19305 1 => Self::Preset,
19306 _ => Self::UnknownValue(policy_mode::UnknownValue(
19307 wkt::internal::UnknownEnumValue::Integer(value),
19308 )),
19309 }
19310 }
19311}
19312
19313impl std::convert::From<&str> for PolicyMode {
19314 fn from(value: &str) -> Self {
19315 use std::string::ToString;
19316 match value {
19317 "POLICY_MODE_UNSPECIFIED" => Self::Unspecified,
19318 "PRESET" => Self::Preset,
19319 _ => Self::UnknownValue(policy_mode::UnknownValue(
19320 wkt::internal::UnknownEnumValue::String(value.to_string()),
19321 )),
19322 }
19323 }
19324}
19325
19326impl serde::ser::Serialize for PolicyMode {
19327 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19328 where
19329 S: serde::Serializer,
19330 {
19331 match self {
19332 Self::Unspecified => serializer.serialize_i32(0),
19333 Self::Preset => serializer.serialize_i32(1),
19334 Self::UnknownValue(u) => u.0.serialize(serializer),
19335 }
19336 }
19337}
19338
19339impl<'de> serde::de::Deserialize<'de> for PolicyMode {
19340 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19341 where
19342 D: serde::Deserializer<'de>,
19343 {
19344 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyMode>::new(
19345 ".google.cloud.networkconnectivity.v1.PolicyMode",
19346 ))
19347 }
19348}
19349
19350/// The list of available preset topologies.
19351///
19352/// # Working with unknown values
19353///
19354/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19355/// additional enum variants at any time. Adding new variants is not considered
19356/// a breaking change. Applications should write their code in anticipation of:
19357///
19358/// - New values appearing in future releases of the client library, **and**
19359/// - New values received dynamically, without application changes.
19360///
19361/// Please consult the [Working with enums] section in the user guide for some
19362/// guidelines.
19363///
19364/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19365#[derive(Clone, Debug, PartialEq)]
19366#[non_exhaustive]
19367pub enum PresetTopology {
19368 /// Preset topology is unspecified. When policy_mode = PRESET,
19369 /// it defaults to MESH.
19370 Unspecified,
19371 /// Mesh topology is implemented. Group `default` is automatically created.
19372 /// All spokes in the hub are added to group `default`.
19373 Mesh,
19374 /// Star topology is implemented. Two groups, `center` and `edge`, are
19375 /// automatically created along with hub creation. Spokes have to join one of
19376 /// the groups during creation.
19377 Star,
19378 /// If set, the enum was initialized with an unknown value.
19379 ///
19380 /// Applications can examine the value using [PresetTopology::value] or
19381 /// [PresetTopology::name].
19382 UnknownValue(preset_topology::UnknownValue),
19383}
19384
19385#[doc(hidden)]
19386pub mod preset_topology {
19387 #[allow(unused_imports)]
19388 use super::*;
19389 #[derive(Clone, Debug, PartialEq)]
19390 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19391}
19392
19393impl PresetTopology {
19394 /// Gets the enum value.
19395 ///
19396 /// Returns `None` if the enum contains an unknown value deserialized from
19397 /// the string representation of enums.
19398 pub fn value(&self) -> std::option::Option<i32> {
19399 match self {
19400 Self::Unspecified => std::option::Option::Some(0),
19401 Self::Mesh => std::option::Option::Some(2),
19402 Self::Star => std::option::Option::Some(3),
19403 Self::UnknownValue(u) => u.0.value(),
19404 }
19405 }
19406
19407 /// Gets the enum value as a string.
19408 ///
19409 /// Returns `None` if the enum contains an unknown value deserialized from
19410 /// the integer representation of enums.
19411 pub fn name(&self) -> std::option::Option<&str> {
19412 match self {
19413 Self::Unspecified => std::option::Option::Some("PRESET_TOPOLOGY_UNSPECIFIED"),
19414 Self::Mesh => std::option::Option::Some("MESH"),
19415 Self::Star => std::option::Option::Some("STAR"),
19416 Self::UnknownValue(u) => u.0.name(),
19417 }
19418 }
19419}
19420
19421impl std::default::Default for PresetTopology {
19422 fn default() -> Self {
19423 use std::convert::From;
19424 Self::from(0)
19425 }
19426}
19427
19428impl std::fmt::Display for PresetTopology {
19429 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19430 wkt::internal::display_enum(f, self.name(), self.value())
19431 }
19432}
19433
19434impl std::convert::From<i32> for PresetTopology {
19435 fn from(value: i32) -> Self {
19436 match value {
19437 0 => Self::Unspecified,
19438 2 => Self::Mesh,
19439 3 => Self::Star,
19440 _ => Self::UnknownValue(preset_topology::UnknownValue(
19441 wkt::internal::UnknownEnumValue::Integer(value),
19442 )),
19443 }
19444 }
19445}
19446
19447impl std::convert::From<&str> for PresetTopology {
19448 fn from(value: &str) -> Self {
19449 use std::string::ToString;
19450 match value {
19451 "PRESET_TOPOLOGY_UNSPECIFIED" => Self::Unspecified,
19452 "MESH" => Self::Mesh,
19453 "STAR" => Self::Star,
19454 _ => Self::UnknownValue(preset_topology::UnknownValue(
19455 wkt::internal::UnknownEnumValue::String(value.to_string()),
19456 )),
19457 }
19458 }
19459}
19460
19461impl serde::ser::Serialize for PresetTopology {
19462 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19463 where
19464 S: serde::Serializer,
19465 {
19466 match self {
19467 Self::Unspecified => serializer.serialize_i32(0),
19468 Self::Mesh => serializer.serialize_i32(2),
19469 Self::Star => serializer.serialize_i32(3),
19470 Self::UnknownValue(u) => u.0.serialize(serializer),
19471 }
19472 }
19473}
19474
19475impl<'de> serde::de::Deserialize<'de> for PresetTopology {
19476 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19477 where
19478 D: serde::Deserializer<'de>,
19479 {
19480 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PresetTopology>::new(
19481 ".google.cloud.networkconnectivity.v1.PresetTopology",
19482 ))
19483 }
19484}